/*
* Proto library v1.10 (jan 04, 2012)
* Copyright 2011 group94 - http://www.group94.com
* Unauthorised use, copying and/or redistributing is strictly prohibited.
	
	PROTO.TWEEN:
	===========
	proto.tween(div, {prop:"width", end:10, duration:15})
	proto.tween(div, {prop:"width", start:50, end:100, skip:0.5, duration:20, delay:10, round:0.5, setPx:false, equation:"quint", ease:"in", tweenvars:{**see below**}, onProgress:func, onComplete:function(){}, debug:true})
	
	-> PROPERTIES:
		prop           String      Property that will be tweened: margin-left, opacity, .. Can also be a variable: proto.tween(this, {prop:"varName"})
		duration       Number      Length of the tween (#frames, 30fps)
		start          Number      Tween start value
		end            Number      Tween target value
		delay          Number      Time to wait before tween begins (#frames)
		skip           Number      Percentage to skip of the tween (0% -> 1%)
		setPx          Boolean     Disables adding "px" to the tweened property
		round          Number      Round the calculated value (Math.round(val*(1/round)) / (1/round)
		ease           String      Possible values: in, out, inOut, outIn 	[!] not all functions have all these easings
		equation       String      Possible values: linear, cubic, quint, quart, quad(=default), expo, sine, circ, bounce, elastic*, back*  	[!] make sure functions below are uncommented!
												*elastic:	tweenVars:{amplitude:50, period:20}
												*back:		tweenVars:{overshoot:1.5}
		debug          Boolean     Traces out values when executing tween (tracer.js must be added!)
		onStart        Array       Execute a function when the tween begins.
		onProgress     Array       Execute a function each frame when the tween is running. -> example:  onProgress:[ scope, func, ["a",94] ]  /OR:/  onProgress:myFunc  /OR:/  onProgress:function(){..}
		onComplete     Array       Execute a function when the tween completes.
		
	-> METHODS:
	proto.disposeTween(div, "width")
	proto.disposeAllTweens(div)
	proto.endTween(div, "width")
	proto.endAllTweens(div)
	
	
	PROTO.WAIT:
	===========
	proto.wait("uniqueID", {func:test, duration:15, args:["bla"]})		// uniqueID can be null (but cannot be disposed!)
	proto.disposeWait("uniqueID")
	
	ON INIT / RESIZE / SCROLL:
	--------------------------
	proto.registerInit(func)		// document.DOMContentLoaded()
	proto.registerLoad(func)		// window.load()
	proto.registerResize(func)
	proto.registerScroll(func)
	
	proto.unregisterInit(func)
	proto.unregisterLoad(func)
	proto.unregisterResize(func)
	proto.unregisterScroll(func)
	
	
	ITEM SELECTOR:
	=============
	[!] selecting items other than by id always return an array!
	$("divID") or $("#divID")					selects item with this id
	$("#divID .content")		selects all .content classes in element with this id
	$(".item")					selects all elements with this class
	$(".content > li)
	-> more on Sizzle: https://github.com/jquery/sizzle/wiki/Sizzle-Home
	
	
	OTHER METHODS:
	=============
	traceObject(obj)
	isFunction(testFunc)
	getURL("http://www.google.com", "_blank")
	addUrlVar(http://www.url.com?var1=0, "var2", 0)				// returns: http://www.url.com?var1=0&var2=0
	swapDepth()
	callFlashFunction(divID, funcName, value)
	
	//---- css properties:
	setCss($("divID"), "width", 500)
	getCss($("divID"), "width")
	
	//---- css classes:
	getElementsByClassName("class", "div", $("elem"))		// class to look for, [inside specific tag], [inside specific element]
	setClass(div, "classname");
	addClass(div, "classname");
	removeClass(div, "classname");
	hasClass(div, "classname");
	
	//---- scrolling:
	getScrollTop()
	scrollToPos(ypos, duration)
	hasScrollbar()
	
	//---- document properties:
	getDocumentHeight()
	getWindowSize()				// returns {w, h}
	
	//---- cookies:
	setCookie("testcookie", "value");
	getCookie("testcookie");
	deleteCookie("testcookie");
	
	//---- events:
	addEvent(obj, event, handler)
*/

// SHORTCUT FUNCTIONS
function getCss($target, $prop){return getPropertyValue($target, $prop);}
function setCss($target, $prop, $val, $px){setPropertyValue($target, $prop, $val, $px);}


/////////////////////////////////////////////////////////////////////////////////////////////////// USER AGENT
var agent ={}
agent.browser = "";
agent.version = "";
agent.mobile = false;
agent.ios = false;
agent.os = "windows";

(function(){
	var u = navigator.userAgent;
	if(!!u.match(/Chrome/))			agent.browser = "chrome";
	if(!!u.match(/Safari/) && agent.browser != "chrome") 	agent.browser = "safari";
	if(!!u.match(/MSIE/))			agent.browser = "ie";
	if(!!window.opera)				agent.browser = "opera";
	if(!!u.match(/Firefox/))		agent.browser = "firefox";
	if(!!u.match(/iPhone/))			agent.browser = "iphone";
	if(!!u.match(/iPod/))			agent.browser = "ipod";
	if(!!u.match(/iPad/))			agent.browser = "ipad";
	if(!!u.match(/android/i))		agent.browser = "android";
	if(!!u.match(/Blackberry/i))	agent.browser = "blackberry";
	
	//------------------------- browser version
	if(agent.browser == "firefox" && u.match(/Firefox\D+(\d+(\.\d+)?)/))		agent.version = parseFloat(RegExp.$1);
	else if(agent.browser == "safari" && u.match(/Version\D(\d+(\.\d+)?)/))	agent.version = parseFloat(RegExp.$1);
	else if(agent.browser == "chrome" && u.match(/Chrome\D(\d+(\.\d+)?)/))	agent.version = parseFloat(RegExp.$1);
	else if(agent.browser == "ie" && u.match(/MSIE\D+(\d+(\.\d+)?)/))			agent.version = parseFloat(RegExp.$1);
	else if(agent.browser == "opera" && u.match(/Opera\D+(\d+(\.\d+)?)/))	agent.version = parseFloat(RegExp.$1);
	
	//------------------------- mobile?
	agent.mobile = (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(u.toLowerCase()));
	agent.ios = (agent.browser=="ipod" || agent.browser=="ipad" || agent.browser=="iphone")
	
	//------------------------- os
	if(agent.browser=="android")	agent.os = "android";
	else if(!!u.match(/Mac/i))		agent.os = "mac";
})();



/////////////////////////////////////////////////////////////////////////////////////////////////// TOOLS
//------------------------- GET ITEM
function $(query){
	if(query){
		var elem = document.getElementById(query.replace("#",""))
		if(!elem)	elem = Sizzle(query)
		if(!elem)	throw new Error("$() Cannot get DOM element: " +query);
		return(elem);
	}
}

// SIZZLE CSS SELECTOR
(function(){function r(a,b,c,d,e,f){for(var g=0,i=d.length;g<i;g++){var j=d[g];if(j){var k=false;j=j[a];while(j){if(j.sizcache===c){k=d[j.sizset];break}if(j.nodeType===1){if(!f){j.sizcache=c;j.sizset=g}if(typeof b!=="string"){if(j===b){k=true;break}}else if(h.filter(b,[j]).length>0){k=j;break}}j=j[a]}d[g]=k}}}function q(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=false;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1&&!f){i.sizcache=c;i.sizset=g}if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,b=0,c=Object.prototype.toString,d=false,e=true,f=/\\/g,g=/\W/;[0,0].sort(function(){e=false;return 0});var h=function(b,d,e,f){e=e||[];d=d||document;var g=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!=="string"){return e}var k,l,n,o,p,q,r,t,u=true,v=h.isXML(d),w=[],x=b;do{a.exec("");k=a.exec(x);if(k){x=k[3];w.push(k[1]);if(k[2]){o=k[3];break}}}while(k);if(w.length>1&&j.exec(b)){if(w.length===2&&i.relative[w[0]]){l=s(w[0]+w[1],d)}else{l=i.relative[w[0]]?[d]:h(w.shift(),d);while(w.length){b=w.shift();if(i.relative[b]){b+=w.shift()}l=s(b,l)}}}else{if(!f&&w.length>1&&d.nodeType===9&&!v&&i.match.ID.test(w[0])&&!i.match.ID.test(w[w.length-1])){p=h.find(w.shift(),d,v);d=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]}if(d){p=f?{expr:w.pop(),set:m(f)}:h.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v);l=p.expr?h.filter(p.expr,p.set):p.set;if(w.length>0){n=m(l)}else{u=false}while(w.length){q=w.pop();r=q;if(!i.relative[q]){q=""}else{r=w.pop()}if(r==null){r=d}i.relative[q](n,r,v)}}else{n=w=[]}}if(!n){n=l}if(!n){h.error(q||b)}if(c.call(n)==="[object Array]"){if(!u){e.push.apply(e,n)}else if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){if(n[t]&&(n[t]===true||n[t].nodeType===1&&h.contains(d,n[t]))){e.push(l[t])}}}else{for(t=0;n[t]!=null;t++){if(n[t]&&n[t].nodeType===1){e.push(l[t])}}}}else{m(n,e)}if(o){h(o,g,e,f);h.uniqueSort(e)}return e};h.uniqueSort=function(a){if(o){d=e;a.sort(o);if(d){for(var b=1;b<a.length;b++){if(a[b]===a[b-1]){a.splice(b--,1)}}}}return a};h.matches=function(a,b){return h(a,null,null,b)};h.matchesSelector=function(a,b){return h(b,null,null,[a]).length>0};h.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,g=i.order.length;e<g;e++){var h,j=i.order[e];if(h=i.leftMatch[j].exec(a)){var k=h[1];h.splice(1,1);if(k.substr(k.length-1)!=="\\"){h[1]=(h[1]||"").replace(f,"");d=i.find[j](h,b,c);if(d!=null){a=a.replace(i.match[j],"");break}}}}if(!d){d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]}return{set:d,expr:a}};h.filter=function(a,b,c,d){var e,f,g=a,j=[],k=b,l=b&&b[0]&&h.isXML(b[0]);while(a&&b.length){for(var m in i.filter){if((e=i.leftMatch[m].exec(a))!=null&&e[2]){var n,o,p=i.filter[m],q=e[1];f=false;e.splice(1,1);if(q.substr(q.length-1)==="\\"){continue}if(k===j){j=[]}if(i.preFilter[m]){e=i.preFilter[m](e,k,c,j,d,l);if(!e){f=n=true}else if(e===true){continue}}if(e){for(var r=0;(o=k[r])!=null;r++){if(o){n=p(o,e,r,k);var s=d^!!n;if(c&&n!=null){if(s){f=true}else{k[r]=false}}else if(s){j.push(o);f=true}}}}if(n!==undefined){if(!c){k=j}a=a.replace(i.match[m],"");if(!f){return[]}break}}}if(a===g){if(f==null){h.error(a)}else{break}}g=a}return k};h.error=function(a){throw"Syntax error, unrecognized expression: "+a};var i=h.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!g.test(b),e=c&&!d;if(d){b=b.toLowerCase()}for(var f=0,i=a.length,j;f<i;f++){if(j=a[f]){while((j=j.previousSibling)&&j.nodeType!==1){}a[f]=e||j&&j.nodeName.toLowerCase()===b?j||false:j===b}}if(e){h.filter(b,a,true)}},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!g.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var i=c.parentNode;a[e]=i.nodeName.toLowerCase()===b?i:false}}}else{for(;e<f;e++){c=a[e];if(c){a[e]=d?c.parentNode:c.parentNode===b}}if(d){h.filter(b,a,true)}}},"":function(a,c,d){var e,f=b++,h=r;if(typeof c==="string"&&!g.test(c)){c=c.toLowerCase();e=c;h=q}h("parentNode",c,f,a,e,d)},"~":function(a,c,d){var e,f=b++,h=r;if(typeof c==="string"&&!g.test(c)){c=c.toLowerCase();e=c;h=q}h("previousSibling",c,f,a,e,d)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){if(d[e].getAttribute("name")===a[1]){c.push(d[e])}}return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined"){return b.getElementsByTagName(a[1])}}},preFilter:{CLASS:function(a,b,c,d,e,g){a=" "+a[1].replace(f,"")+" ";if(g){return a}for(var h=0,i;(i=b[h])!=null;h++){if(i){if(e^(i.className&&(" "+i.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)){if(!c){d.push(i)}}else if(c){b[h]=false}}}return false},ID:function(a){return a[1].replace(f,"")},TAG:function(a,b){return a[1].replace(f,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){if(!a[2]){h.error(a[0])}a[2]=a[2].replace(/^\+|\s*/g,"");var c=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=c[1]+(c[2]||1)-0;a[3]=c[3]-0}else if(a[2]){h.error(a[0])}a[0]=b++;return a},ATTR:function(a,b,c,d,e,g){var h=a[1]=a[1].replace(f,"");if(!g&&i.attrMap[h]){a[1]=i.attrMap[h]}a[4]=(a[4]||a[5]||"").replace(f,"");if(a[2]==="~="){a[4]=" "+a[4]+" "}return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=h(b[3],null,null,c)}else{var g=h.filter(b[3],c,d,true^f);if(!d){e.push.apply(e,g)}return false}}else if(i.match.POS.test(b[0])||i.match.CHILD.test(b[0])){return true}return b},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){if(a.parentNode){a.parentNode.selectedIndex}return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!h(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=i.filters[e];if(f){return f(a,c,b,d)}else if(e==="contains"){return(a.textContent||a.innerText||h.getText([a])||"").indexOf(b[3])>=0}else if(e==="not"){var g=b[3];for(var j=0,k=g.length;j<k;j++){if(g[j]===a){return false}}return true}else{h.error(e)}},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return false}}if(c==="first"){return true}d=a;case"last":while(d=d.nextSibling){if(d.nodeType===1){return false}}return true;case"nth":var e=b[2],f=b[3];if(e===1&&f===0){return true}var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling){if(d.nodeType===1){d.nodeIndex=++i}}h.sizcache=g}var j=a.nodeIndex-f;if(e===0){return j===0}else{return j%e===0&&j/e>=0}}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=i.attrHandle[c]?i.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:!g?e&&d!==false:f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":false},POS:function(a,b,c,d){var e=b[2],f=i.setFilters[e];if(f){return f(a,c,b,d)}}}};var j=i.match.POS,k=function(a,b){return"\\"+(b-0+1)};for(var l in i.match){i.match[l]=new RegExp(i.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source);i.leftMatch[l]=new RegExp(/(^(?:.|\r|\n)*?)/.source+i.match[l].source.replace(/\\(\d+)/g,k))}var m=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(n){m=function(a,b){var d=0,e=b||[];if(c.call(a)==="[object Array]"){Array.prototype.push.apply(e,a)}else{if(typeof a.length==="number"){for(var f=a.length;d<f;d++){e.push(a[d])}}else{for(;a[d];d++){e.push(a[d])}}}return e}}var o,p;if(document.documentElement.compareDocumentPosition){o=function(a,b){if(a===b){d=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}}else{o=function(a,b){if(a===b){d=true;return 0}else if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex}var c,e,f=[],g=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i){return p(a,b)}else if(!h){return-1}else if(!i){return 1}while(j){f.unshift(j);j=j.parentNode}j=i;while(j){g.unshift(j);j=j.parentNode}c=f.length;e=g.length;for(var k=0;k<c&&k<e;k++){if(f[k]!==g[k]){return p(f[k],g[k])}}return k===c?p(a,g[k],-1):p(f[k],b,1)};p=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return-1}d=d.nextSibling}return 1}}h.getText=function(a){var b="",c;for(var d=0;a[d];d++){c=a[d];if(c.nodeType===3||c.nodeType===4){b+=c.nodeValue}else if(c.nodeType!==8){b+=h.getText(c.childNodes)}}return b};(function(){var a=document.createElement("div"),b="script"+(new Date).getTime(),c=document.documentElement;a.innerHTML="<a name='"+b+"'/>";c.insertBefore(a,c.firstChild);if(document.getElementById(b)){i.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d?d.id===a[1]||typeof d.getAttributeNode!=="undefined"&&d.getAttributeNode("id").nodeValue===a[1]?[d]:undefined:[]}};i.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}}c.removeChild(a);c=a=null})();(function(){var a=document.createElement("div");a.appendChild(document.createComment(""));if(a.getElementsByTagName("*").length>0){i.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){if(c[e].nodeType===1){d.push(c[e])}}c=d}return c}}a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"){i.attrHandle.href=function(a){return a.getAttribute("href",2)}}a=null})();if(document.querySelectorAll&&false){(function(){var a=h,b=document.createElement("div"),c="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(b.querySelectorAll&&b.querySelectorAll(".TEST").length===0){return}h=function(b,d,e,f){d=d||document;if(!f&&!h.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(d.nodeType===1||d.nodeType===9)){if(g[1]){return m(d.getElementsByTagName(b),e)}else if(g[2]&&i.find.CLASS&&d.getElementsByClassName){return m(d.getElementsByClassName(g[2]),e)}}if(d.nodeType===9){if(b==="body"&&d.body){return m([d.body],e)}else if(g&&g[3]){var j=d.getElementById(g[3]);if(j&&j.parentNode){if(j.id===g[3]){return m([j],e)}}else{return m([],e)}}try{return m(d.querySelectorAll(b),e)}catch(k){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var l=d,n=d.getAttribute("id"),o=n||c,p=d.parentNode,q=/^\s*[+~]/.test(b);if(!n){d.setAttribute("id",o)}else{o=o.replace(/'/g,"\\$&")}if(q&&p){d=d.parentNode}try{if(!q||p){return m(d.querySelectorAll("[id='"+o+"'] "+b),e)}}catch(r){}finally{if(!n){l.removeAttribute("id")}}}}return a(b,d,e,f)};for(var d in a){h[d]=a[d]}b=null})()}(function(){var a=document.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(document.createElement("div"),"div"),d=false;try{b.call(document.documentElement,"[test!='']:sizzle")}catch(e){d=true}h.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(a)){try{if(d||!i.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return h(e,null,null,[a]).length>0}}})();(function(){var a=document.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!a.getElementsByClassName||a.getElementsByClassName("e").length===0){return}a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}i.order.splice(1,0,"CLASS");i.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c){return b.getElementsByClassName(a[1])}};a=null})();if(document.documentElement.contains){h.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):true)}}else if(document.documentElement.compareDocumentPosition){h.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}}else{h.contains=function(){return false}}h.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":false};var s=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=i.match.PSEUDO.exec(a)){e+=c[0];a=a.replace(i.match.PSEUDO,"")}a=i.relative[a]?a+"*":a;for(var g=0,j=f.length;g<j;g++){h(a,f[g],d)}return h.filter(e,d)};window.Sizzle=h})()


//------------------------- SET STYLE PROPERTY:
function setPropertyValue($elem, $prop, $val, $px){
	$prop = parseProperty($prop);
	if($prop=="opacity"){
		$px = false;
		if(agent.browser=="ie" && agent.version <9){
			if($elem.style)	$elem.style.zoom = 1;
			//if($val<1)		$elem.style['filter'] = "alpha(opacity="+Math.round($val*100)+")";
			//else				$elem.style.removeAttribute("filter");
			$elem.style['filter'] = "alpha(opacity="+Math.round($val*100)+")";
			return;
		}
	}else	if($prop=="width" || $prop=="height" || $prop=="top" || $prop=="right" || $prop=="bottom" || $prop=="left" || $prop.match(/margin/) || $prop.match(/padding/)){
		$px = true;
	}
	if($px==true)	$val += "px";
	
	if($elem.style)		$elem.style[$prop] = $val;
	else						$elem[$prop] = $val;
}

//------------------------- GET STYLE PROPERTY:
function getPropertyValue($elem, $prop){
	var val = "";
	try{	if($elem[$prop] != undefined)		val = $elem[$prop];	}catch($e){}
	
	if(val===""){
		if(document.defaultView && document.defaultView.getComputedStyle){
			val = document.defaultView.getComputedStyle($elem, "").getPropertyValue($prop);
		}else if($elem.currentStyle){
			$prop = $prop.replace(/\-(\w)/g, function(strMatch, p1){
				return p1.toUpperCase();
			})
			val = $elem.currentStyle[$prop];
		}
		// IE<9
		if(agent.browser=="ie" && agent.version <9){
			if(val=="auto" && $prop=="width")	return $elem.offsetWidth;
			if(val=="auto" && $prop=="height")	return $elem.offsetHeight;
			if($prop=="opacity"){
				if($elem.filters.alpha)	return $elem.filters.alpha.opacity/100;
				else							return 1;
			}
		}
	}
	
	if(val=="auto")	val = 0;		// temp fix?
	val = String(val).split("px")[0]
	if(!isNaN(Number(val)))		return Number(String(val));
	else								return val;
}


//------------------------- CSS CLASS MANIPULATION:
function setClass($div, $name){
	if($div)	$div.className = $name;
}
function addClass($div, $name){
	if(!hasClass($div,$name)) $div.className += " "+$name;
}
function removeClass($div, $name){
	if(hasClass($div,$name)){
		var reg = new RegExp('(\\s|^)'+$name+'(\\s|$)');
		$div.className=$div.className.replace(reg,' ');
	}
}
function hasClass($div, $name){
	return $div.className.match(new RegExp('(\\s|^)'+$name+'(\\s|$)'));
}
 

//------------------------- SCROLLING:
function getScrollTop(){
	if(window.pageYOffset)			return window.pageYOffset;
	if(document.documentElement)	return document.documentElement.scrollTop;
	if(document.body)					return document.body.scrollTop;
	return null;
}

function scrollToPos($posY, $duration){
	this._scrollVal = getScrollTop();
	proto.tween(this, {prop:"_scrollVal", end:$posY, duration:$duration, setPx:false, onProgress:function(){
		window.scrollTo(0, this._scrollVal);
	}})
}

function hasScrollbar(){
	return document.documentElement.clientHeight < document.body.offsetHeight;
}


//------------------------- DOCUMENT PROPERTIES:
function getWindowSize(){
	if(document.documentElement)		return {w:document.documentElement.clientWidth, h:document.documentElement.clientHeight};
	if(document.body)						return {w:document.body.clientWidth, h:document.body.clientHeight};
	if(window.innerWidth)				return {w:window.innerWidth, h:window.innerHeight};
	return null;
}

//------------------------- GET DOCUMENT HEIGHT
function getDocumentHeight(){
    return Math.max(
        Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
        Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
        Math.max(document.body.clientHeight, document.documentElement.clientHeight)
    );
}


//------------------------- CALL FLASH FUNCTION
function callFlashFunction($id, $func, $val){
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	var flashmovie =(isIE) ? window[$id] : document[$id];
	if($val)	flashmovie[$func]($val);
	else		flashmovie[$func]();
}
/*	JS: callFlashFunction("divID", "flash_init", "testvalue");
FLASH: ExternalInterface.addCallback("flash_init", init); function init($val){ .whatever. }	*/


//------------------------- SWAP Z INDEX
var z_index = 100;
function swapDepth($elem, $z){
	if($z)	$elem.style.zIndex = $z;
	else		$elem.style.zIndex = z_index++;
	return false;
}


//------------------------- TRACE OBJECT
function traceObject($obj, $space){
	if(!$space)		$space = "";
	var txt = "";
	for(var i in $obj){
		var type = typeof($obj[i]);
		if(type=="object" && $space.length <100){
			txt += $space + i + ": \n" + traceObject($obj[i], $space+"    ");
		}else{
			txt += $space + i + ": " + $obj[i] + "\n";		//+ "  (" + typeof($obj[i]) +")\n"
		}
	}
	if($space!="")	return txt;
	else				alert(txt);
}


//------------------------- COOKIES
function setCookie(cookieName, cookieValue, nDays) {
	var today = new Date();
	var expire = new Date();
	if(nDays==null || nDays==0)	nDays=9494;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString()+";path=/;";
}
function getCookie(cookieName){
	var i,x,y,arr=document.cookie.split(";");
	for(i=0;i<arr.length;i++){
		x=arr[i].substr(0,arr[i].indexOf("="));
		y=arr[i].substr(arr[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if(x==cookieName)	  return unescape(y);
	}
	return null;
}
function deleteCookie(cookieName){
	document.cookie = cookieName+ ";expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/;";
}


//------------------------- GETURL
function getURL($url, $target){
	if(!$target)						window.location.href = $url;
	else if($target == "_blank")	window.open($url);
	else if(opt == "background"){		// open in background
		window.open($url);
		self.focus();
	}
}


//------------------------- ADD/REPLACE URL VARIABLE (adds "&" or "?")
// It will also replace existing values with the new value
function addUrlVar($url, $name, $value){
	var split = $url.split("?")
	if(split.length >1){
		var mainurl = split[0];
		var getVars = split[1].split("&");
		// replace existing value
		var replaced = false;
		for(var i=0; i<getVars.length; i++){
			if(getVars[i].indexOf($name)>-1){
				getVars[i] = $name +"="+ $value;
				replaced = true;
				break;
			}
		}
		// or add to the vars
		if(!replaced)	getVars.push($name+"="+$value);
		
		// rebuild url string
		for(var i=0; i<getVars.length; i++){
			if(i==0)	mainurl += "?"+getVars[i];
			else		mainurl += "&"+getVars[i];
		}
		return mainurl;
	}else{
		return $url +"?"+ $name +"="+ $value;
	}
}


//------------------------- TOOLS
function isFunction($fc){
	return typeof $fc==="function";
}

function parseProperty($prop){
	if(agent.browser == "opera" || agent.browser == "firefox" || (agent.browser=="ie"&&agent.version==8)){
		$prop = $prop.replace(/-([a-z])/ig, function(a, l) { return l.toUpperCase(); }) 
	}
	if($prop=="z-index")	return "zIndex";
	return $prop;
}

function addEvent(obj, event, handler){
	if(obj.addEventListener)	obj.addEventListener(event, handler, false);
	else if(obj.attachEvent) 	obj.attachEvent('on' + event, handler);
	else								handler.call(obj, {type: event});
}



/////////////////////////////////////////////////////////////////////////////////////////////////// PROTO. INIT,LOAD,RESIZE,SCROLL / TWEEN,WAIT
(function(){
	var proto ={
		inited:false,
		
		//------------------------- INIT
		init_arr:[],
		init:function(){
			if(!this.inited){
				for(var i=0; i<this.init_arr.length; i++){	this.init_arr[i]();	}
				this.resize();
				this.inited = true;
			}
		},
		registerInit:function($fc){	this.init_arr.push($fc)		},
		unregisterInit:function($fc){
			for(var i=0; i<this.init_arr.length; i++){	if(this.init_arr[i] == $fc)	this.init_arr.splice(i,1);	}
		},
		
		
		//------------------------- LOAD
		load_arr:[],
		load:function(){
			for(var i=0; i<this.load_arr.length; i++){	this.load_arr[i]();	}
		},
		registerLoad:function($fc){	this.load_arr.push($fc);		},
		unregisterLoad:function($fc){
			for(var i=0; i<this.load_arr.length; i++){	if(this.load_arr[i] == $fc)	this.load_arr.splice(i,1);	}
		},
		
		
		//------------------------- RESIZE
		resize_arr:[],
		resize:function(){
			for(var i=0; i<this.resize_arr.length; i++){	this.resize_arr[i]();	}
		},
		registerResize:function($fc){		this.resize_arr.push($fc);	},
		unregisterResize:function($fc){
			for(var i=0; i<this.resize_arr.length; i++){	if(this.resize_arr[i] == $fc)	this.resize_arr.splice(i,1);	}
		},
		
		
		//------------------------- SCROLL
		scroll_arr:[],
		scroll:function(){
			for(var i=0; i<this.scroll_arr.length; i++){	this.scroll_arr[i]();	}
		},
		registerScroll:function($fc){		this.scroll_arr.push($fc);		},
		unregisterScroll:function($fc){
			for(var i=0; i<this.scroll_arr.length; i++){	if(this.scroll_arr[i] == $fc)	this.scroll_arr.splice(i,1);	}
		},


		///////////////////////////////////////////////////////////////////////////////////////////////////////////////
		/////////////////////////////////////////////////////////////////////////////////////////////////// PROTO.TWEEN
		fps:30,			// "fake" framerate, similar to flash
		multiply:2,		// value > 1: makes the screen render faster

		tween:function($target, $config){
			// FIRST CHECKS
			if(!$target)						throw new Error("[TWEEN] Invalid target.");
			if($config.end == undefined)	throw new Error("[TWEEN] Invalid end.");
			
			if($config.debug && typeof tracer=="function"){tracer("\n[TWEEN]");for(var i in $config){tracer("&nbsp;&nbsp;&nbsp;" + i+ ": " + $config[i])};tracer("")}
			
			// INITIALIZE
			if($config.setPx == undefined)	$config.setPx = true;
			if($config.start != undefined)	setPropertyValue($target, $config.prop, $config.start, $config.setPx);
			$config.current = getPropertyValue($target, $config.prop);
			
			if($config.current != $config.end){
				$config.target = $target;
				$config.start = $config.current;
				$config.progress = 0;
				if($config.skip != undefined)		$config.start +=($config.end-$config.start)*$config.skip;
				if($config.delay)						$config.count_delay = 0;
				if($config.duration==undefined)	$config.duration = 15;
				if(!$config.equation)				$config.equation = "quad";
				if(!$config.ease)						$config.ease = "out";
				
				$config.duration *= this.multiply;
				
				// CREATE INTERVAL FUNCTION
				var tick = function(){
					var cnt = 0;
					for(var i in $target._TWEENS){
						if($target._TWEENS[i]){
							if($target._TWEENS[i].DONE==undefined){
								proto.runTween($target, $target._TWEENS[i]);
								cnt++;
							}else{
								delete $target._TWEENS[$target._TWEENS[i].prop];
							}
						}
					}
					if(cnt==0){
						clearInterval($target._interval);
						$target._interval = null;
						$target._TWEENS = null;
					}
				}
						
				// ADD INTERVAL
				if(!$target._interval){
					$target._TWEENS = {}
					$target._interval = setInterval(tick, 1000/(this.fps*this.multiply))
				}
				
				// ADD NEW TWEEN
				$target._TWEENS[$config.prop] = $config;
			}
		},


		//------------------------------------------------------------------------ RUN TWEEN
		runTween:function($target, $config){
			if($config.delay && $config.count_delay < $config.delay){
				$config.count_delay++;
				
			}else{
				// ONSTART()
				if($config.onStart){
					proto.executeFunction("onStart", $config.onStart);
					$config.onStart = null;
				}
				
				// TWEEN RUNNING
				if($config.progress+1 < $config.duration){
					$config.progress++;
					$config.current = this[$config.equation+"_"+$config.ease]($config.progress, $config.start,($config.end-$config.start), $config.duration, $config.tweenvars);
					if($config.round)	$config.current = Math.round( $config.current*(1/$config.round) ) / (1/$config.round);
					setPropertyValue($target, $config.prop, $config.current, $config.setPx);
					if($config.debug && typeof tracer=="function")	tracer("[TWEEN] " +$config.prop+": " +$config.current);
				
				// TWEEN DONE
				}else{
					$config.progress = $config.duration;
					setPropertyValue($target, $config.prop, $config.end, $config.setPx);
					$target._TWEENS[$config.prop].DONE = true;
					if($config.debug && typeof tracer=="function")	tracer("[TWEEN] " +$config.prop + ": completed.");
				}
				
				// ONPROGRESS()
				if($config.onProgress)	proto.executeFunction("onProgress", $config.onProgress);
				
				// ONCOMPLETE()
				if($target._TWEENS[$config.prop].DONE){
					if($config.onComplete)	proto.executeFunction("onComplete", $config.onComplete);
				}
			}
		},
		
		
		//------------------------------------------------------------------------ METHODS
		disposeTween:function($target, $property){
			if($target._TWEENS)		delete $target._TWEENS[$property];
		},
		
		disposeAllTweens:function($target){
			if($target._TWEENS){
				clearInterval($target._interval);
				$target._interval = null;
				$target._TWEENS = null;
			}
		},
		
		endTween:function($target, $property){
			if($target._TWEENS){
				var config = $target._TWEENS[$property]
				setPropertyValue($target, config.prop, config.end, $config.setPx);
				if(config.onComplete)		proto.executeFunction("onComplete", config.onComplete);
				delete $target._TWEENS[config.prop];
			}
		},
		
		endAllTweens:function($target){
			if($target._TWEENS){
				for(var i in $target._TWEENS){
					if(!$target._TWEENS[i].DONE)	proto.endTween($target, $target._TWEENS[i].prop);
				}
			}
		},


		//------------------------------------------------------------------------ EQUATIONS ("out" only)
		linear_out:function(t, b, c, d){return c*t/d+b;},
		
		quad_in:function(t, b, c, d){return c*(t/=d)*t + b;},
		quad_out:function(t, b, c, d){return -c *(t/=d)*(t-2)+b;},
		quad_inOut:function(t, b, c, d){if((t/=d/2)<1)return c/2*t*t+b; return -c/2*((--t)*(t-2)-1)+b;},
		
		cubic_in:function(t, b, c, d){return c*(t/=d)*t*t + b;},
		cubic_out:function(t, b, c, d){return c*((t=t/d-1)*t*t+1)+b;},
		cubic_inOut:function(t, b, c, d){if((t/=d/2)<1) return c/2*t*t*t+b; return c/2*((t-=2)*t*t+2)+b;},
		
		quart_in:function(t, b, c, d){return c*(t/=d)*t*t*t+b;},
		quart_out:function(t, b, c, d){return -c *((t=t/d-1)*t*t*t-1)+b;},
		quart_inOut:function(t, b, c, d){if((t/=d/2)<1) return c/2*t*t*t*t+b; return -c/2*((t-=2)*t*t*t-2)+b;},
		
		quint_in:function(t, b, c, d){return c*(t/=d)*t*t*t*t + b;},
		quint_out:function(t, b, c, d){return c*((t=t/d-1)*t*t*t*t + 1) + b;},
		quint_inOut:function(t, b, c, d){if((t/=d/2) < 1) return c/2*t*t*t*t*t + b;return c/2*((t-=2)*t*t*t*t + 2) + b;},
		
		sine_in:function(t, b, c, d){return -c * Math.cos(t/d *(Math.PI/2)) + c + b;},
		sine_out:function(t, b, c, d){return c*Math.sin(t/d*(Math.PI/2))+b;},
		sine_inOut:function(t, b, c, d){return -c/2 *(Math.cos(Math.PI*t/d) - 1) + b;},
		
		/*
		expo_in:function(t, b, c, d){return(t==0) ? b : c * Math.pow(2, 10 *(t/d - 1)) + b - c * 0.001;},
		expo_out:function(t, b, c, d){return(t==d)?b+c:c*1.001*(-Math.pow(2,-10*t/d)+1)+b;},
		expo_inOut:function(t, b, c, d){if(t==0) return b;if(t==d) return b+c;
			if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 *(t - 1)) + b - c * 0.0005;
			return c/2 * 1.0005 *(-Math.pow(2, -10 * --t) + 2) + b;
		},
		*/
		
		/*
		circ_in:function(t, b, c, d){return -c *(Math.sqrt(1 -(t/=d)*t) - 1) + b;},
		circ_out:function(t,b, c, d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},
		circ_inOut:function(t, b, c, d){if((t/=d/2) < 1) return -c/2 *(Math.sqrt(1 - t*t) - 1) + b; return c/2 *(Math.sqrt(1 -(t-=2)*t) + 1) + b;},
		*/
		
		/*
		elastic_out:function(t, b, c, d, vars){
			if(t==0) return b; if((t/=d)==1) return b+c;
			var p = !Boolean(vars) || isNaN(vars.period) ? d*.3 :vars.period;
			var s;
			var a = !Boolean(vars) || isNaN(vars.amplitude) ? 0 :vars.amplitude;
			if(!Boolean(a) || a < Math.abs(c)){a = c; s = p/4;}else{s = p/(2*Math.PI)*Math.asin(c/a);}
			return(a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b);
		},
		elastic_inOut:function(t, b, c, d, vars){
			if(t==0) return b;
			if((t/=d/2)==2) return b+c;
			var p = !Boolean(vars) || isNaN(vars.period) ? d*(.3*1.5) : vars.period;
			var s;
			var a = !Boolean(vars) || isNaN(vars.amplitude) ? 0 : vars.amplitude;
			if(!Boolean(a) || a < Math.abs(c)){
				a = c;
				s = p/4;
			} else{
				s = p/(2*Math.PI) * Math.asin(c/a);
			}
			if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
			return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b;
		},
		*/
		
		/*
		back_out:function(t, b, c, d, vars){
			var s = !Boolean(vars) || isNaN(vars.overshoot) ? 1.70158 :vars.overshoot;
			return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;
		},
		bounce_out:function(t, b, c, d){
			if((t/=d) <(1/2.75))		return c*(7.5625*t*t)+b;
			else if(t <(2/2.75))		return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;
			else if(t <(2.5/2.75))	return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;
			else							return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;
		},
		*/
		
		//------------------------------------------------------------------------ RUN ONSTART, ONPROGRESS, ONCOMPLETE
		executeFunction:function($type, $var){
			// onComplete:function(){} :
			if(isFunction($var)){
				$var();
				return;
			}
			// onComplete:["test", [6,"a",1]] :
			if(typeof($var[0]) == "string")	$var[0] = window[$var[0]];
			if($var[0] != undefined){
				if($var[2])	$var[1].apply($var[0], $var[2]);		// with arguments
				else			$var[1].apply($var[0]);
			}else{
				throw new Error("[TWEEN] Invalid "+$type+" function.");
			}
		},
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////
		/////////////////////////////////////////////////////////////////////////////////////////////////// PROTO.WAIT
		_WAITS:{},
		wait_interval:null,
		
		wait:function($identifier, $config){
			if($identifier==null)		$identifier = "_wait"+Math.round(Math.random()*1000);
			if(!$config.duration)		$config.duration = 0;
			if(!$config.progress)		$config.progress = 0;		// enterframe has 1 frame delay
			
			$config.duration *= this.multiply;
			
			// CREATE INTERVAL FUNCTION
			var tick = function(){
				var cnt = 0;
				for(var i in proto._WAITS){
					if(proto._WAITS[i]){
						if(proto._WAITS[i].DONE==undefined){
							proto.runWait(proto._WAITS[i]);
							cnt++;
						}else{
							proto._WAITS[i] = null;
						}
					}
				}
				if(cnt==0){
					clearInterval(proto.wait_interval);
					proto.wait_interval = null;
				}
			}
					
			// ADD INTERVAL
			if(!proto.wait_interval)	proto.wait_interval = setInterval(tick, 1000/(this.fps*this.multiply));
			
			// ADD NEW WAIT
			proto._WAITS[$identifier] = $config;
		},
		
		//------------------------------------------------------------------------ RUN WAIT
		runWait:function($config){
			if($config.progress < $config.duration){
				$config.progress++;
			}else{
				var scope = window;
				if($config.scope)	scope = $config.scope;
				if(typeof($config.func) == "string")	$config.func = scope[$config.func];
				if($config.args)	$config.func.apply(scope, $config.args);
				else					$config.func.apply(scope);
				$config.DONE = true;
			}
		},
		
		//------------------------------------------------------------------------ METHODS
		disposeWait:function($identifier){
			delete proto._WAITS[$identifier];
		}
	}
	
	// SET GLOBAL
	window.proto = proto;
})();


/////////////////////////////////////////////////////////////////////////////////////////////////// INIT, LOAD, RESIZE, SCROLL
if(document.addEventListener){	
	// INIT (DOM ready)
	document.addEventListener("DOMContentLoaded", function(){
		document.removeEventListener("DOMContentLoaded", arguments.callee, false);
		proto.init();
	},false);
	
	// LOAD
	window.addEventListener("load", function(){
		window.removeEventListener("load", arguments.callee, false);
		proto.load();
	},false);
	
	// RESIZE, SCROLL
	window.addEventListener("resize", function(){proto.resize()}, false);
	window.addEventListener("DOMMouseScroll", function(){proto.scroll()}, false);		// firefox
	window.addEventListener("scroll",function(){proto.scroll()}, false);					// IE9, opera, chrome, safari
	
	
}else if(window.attachEvent){
	// INIT (DOM ready)
	try{	var isFrame = window.frameElement != null	}catch(e){}
	// IE: not inside iFrame
	if(document.documentElement.doScroll && !isFrame){
		function tryScroll(){
			try{
				document.documentElement.doScroll("left");
				proto.init();
			}catch(e){
				setTimeout(tryScroll, 10);
			}
		}
		tryScroll()
	}
	// IE: inside iFrame
	document.attachEvent("onreadystatechange", function(){
		if(document.readyState==="complete")	proto.init();
	})
	
	// LOAD
	window.attachEvent("onload", function(){proto.load()})
	
	// RESIZE, SCROLL
	window.attachEvent("onresize", function(){proto.resize()})
	window.attachEvent("onmousewheel", function(){proto.scroll()})
	window.attachEvent("onscroll", function(){proto.scroll()})
}
