/* 20090618 */
/**
 * Copyright (c) 2008-current HB Stone http://jelo.callee.info/
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 * 
 */

var Jelo=window.Jelo||{};Jelo.uID=function(){var id=1;return function(){return id++;};}();Jelo.emptyFn=function(){};Jelo.each=function(a,f,s){if(typeof a.length=="number"){for(var i=0,l=a.length;i<l;i++){if(typeof a[i]!="undefined"){f.call(s||a[i],a[i],i,a);}}}else if(typeof a=="object"){for(var i in a){if(a.hasOwnProperty(i)&&typeof a[i]!="undefined"){f.call(s||a[i],a[i],i,a);}}}};Jelo.delegate=function(fn,scope){var s=scope||window;var a=[].slice.call(arguments,2);return function(){fn.apply(s,a);};};(function(){if(!window.console||!console.firebug){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=Jelo.emptyFn;}}
Jelo.Console=window.console;Jelo.Console.getStackTrace=function(){return;var mode;try{(0)()}catch(e){mode=e.stack?'Firefox':window.opera?'Opera':'Other';}
switch(mode){case'Firefox':return function(){try{(0)()}catch(e){return e.stack.replace(/^.*?\n/,'').replace(/(?:\n@:0)?\s+$/m,'').replace(/^\(/gm,'{anonymous}(').split("\n");}};case'Opera':return function(){try{(0)()}catch(e){var lines=e.message.split("\n"),ANON='{anonymous}',lineRE=/Line\s+(\d+).*?in\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,i,j,len;for(i=4,j=0,len=lines.length;i<len;i+=2){if(lineRE.test(lines[i])){lines[j++]=(RegExp.$3?RegExp.$3+'()@'+RegExp.$2+RegExp.$1:ANON+RegExp.$2+':'+RegExp.$1)+' -- '+
lines[i+1].replace(/^\s+/,'');}}
lines.splice(j,lines.length-j);return lines;}};default:return function(){var curr=arguments.callee.caller,FUNC='function',ANON="{anonymous}",fnRE=/function\s*([\w\-$]+)?\s*\(/i,stack=[],j=0,fn,args,i;while(curr){fn=fnRE.test(curr.toString())?RegExp.$1||ANON:ANON;args=stack.slice.call(curr.arguments);i=args.length;while(i--){switch(typeof args[i]){case'string':args[i]='"'+args[i].replace(/"/g,'\\"')+'"';break;case'function':args[i]=FUNC;break;}}
stack[j++]=fn+'('+args.join()+')';curr=curr.caller;}
return stack;};}}();})();(function(){if(!('opera'in window)&&('ActiveXObject'in window)){(function(f){window.setTimeout=f(window.setTimeout);window.setInterval=f(window.setInterval);})(function(f){return function(c,t){var a=[].slice.call(arguments,2);return f(function(){c.apply(this,a);},t);};});}
if(typeof Array.indexOf=="undefined"){Array.prototype.indexOf=function(k){var len=this.length;for(i=0;i<len;i++){if(this[i]==k){return i;}}
return-1;}
Array.indexOf=Array.prototype.indexOf;}
if(typeof Array.lastIndexOf=="undefined"){Array.prototype.lastIndexOf=function(k){var len=this.length;for(i=len-1;i>-1;i--){if(this[i]==k){return i;}}
return-1;};Array.lastIndexOf=Array.prototype.lastIndexOf;}})();Jelo.dragCheckbox=function(root){root=root||document;var dragging=false;var current=false;var undrag=function(){dragging=false;};Jelo.un(document,"mouseup",undrag);Jelo.on(document,"mouseup",undrag);var getTarget=function(element){switch(element.tagName.toLowerCase()){case'input':return element;break;case'label':Jelo.css(element,'-moz-user-select','none');Jelo.css(element,'-webkit-user-select','ignore');element.onselectstart=function(){return false;}
var el=element.getAttribute('for')||element.getAttribute('htmlFor');return $('input#'+el);break;default:return null;}};Jelo.each($$('[type=checkbox]',root),function(){var down=function(){var box=getTarget(this);if(box){dragging=true;box.checked=!box.checked;current=box.checked;}};var over=function(){var box=getTarget(this);if(box&&dragging){box.checked=current;}};var click=function(target,event){var box=getTarget(this);if(box){box.checked=current;}};Jelo.un(this,"mousedown",down);Jelo.un(this,"mouseover",over);Jelo.un(this,"click",click);Jelo.on(this,"mousedown",down);Jelo.on(this,"mouseover",over);Jelo.on(this,"click",click);var label=$('label[for='+this.id+']',root);if(label){Jelo.un(label,"mousedown",down);Jelo.un(label,"mouseover",over);Jelo.un(label,"click",click);Jelo.on(label,"mousedown",down);Jelo.on(label,"mouseover",over);Jelo.on(label,"click",click);}});};
Jelo.Environment=function(){var ua=navigator.userAgent.toLowerCase();var isStrict=document.compatMode=="CSS1Compat";var isWindows=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1);var isMac=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1);var isLinux=(ua.indexOf("linux")!=-1);var isAir=(ua.indexOf("adobeair")!=-1);var isWebkit=(/webkit|khtml/).test(ua);var isSafari3=(/webkit\/5/).test(ua);var isGecko=!isWebkit&&(/gecko/).test(ua);var isFirefox=isGecko&&(/firefox\/\d/).test(ua);var isFirefoxOld=isGecko&&(/firefox\/[0-2]/).test(ua);var isOpera=(/opera/).test(ua);var isIE=!!(window.attachEvent&&!isOpera);var isIE7=isIE&&(/msie 7/).test(ua);var isIE8=isIE&&(/msie 8/).test(ua);var isIEOld=isIE&&(/msie [0-6]/).test(ua);var isGoogle=(/google/).test(ua);var isGoogleChrome=(/chrome\/[0-1]/).test(ua);var isYahoo=(/yahoo/).test(ua);var isBot=(/bot|crawler|http/).test(ua);var isSecure=window.location.href.toLowerCase().indexOf("https")===0;var isModern=(typeof XMLHttpRequest!="undefined");if(isIEOld){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}
return{getViewWidth:function(full){return full?this.getDocumentWidth():this.getViewportWidth();},getViewHeight:function(full){return full?this.getDocumentHeight():this.getViewportHeight();},getDocumentWidth:function(){var scrollWidth=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(scrollWidth,this.getViewportWidth());},getDocumentHeight:function(){var scrollHeight=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(scrollHeight,this.getViewportHeight());},getViewportWidth:function(){if(this.isIE){return this.isStrict?document.documentElement.clientWidth:document.body.clientWidth;}else{return self.innerWidth;}},getViewportHeight:function(){if(this.isIE){return this.isStrict?document.documentElement.clientHeight:document.body.clientHeight;}else{return self.innerHeight;}},getUA:function(){return ua;},isStrict:isStrict,isWindows:isWindows,isMac:isMac,isLinux:isLinux,isAir:isAir,isWebkit:isWebkit,isSafari3:isSafari3,isGecko:isGecko,isFirefox:isFirefox,isOpera:isOpera,isIE:isIE,isIE7:isIE7,isIE8:isIE8,isIEOld:isIEOld,isGoogle:isGoogle,isYahoo:isYahoo,isBot:isBot,isSecure:isSecure,isStandard:isModern,isModern:isModern};}();Jelo.Env=Jelo.Environment;
Jelo.Valid=function(){Array.prototype.isArray=true;Function.prototype.isFunction=true;Number.prototype.isNumber=true;String.prototype.isString=true;return{is:function(i){return(typeof i==="undefined")||(i===null);},isArray:function(a){return!!a.isArray||(a instanceof Array)||(a&&typeof a==='object'&&typeof a.length==='number');},isElement:function(e){return(typeof e=="object")&&(e!==null)&&(typeof e.tagName=="string")&&(typeof e.className=="string");},isFunction:function(f){return!!f.isFunction||(f instanceof Function)||(typeof f=="function");},isNumber:function(n){return n&&(!!n.isNumber||!isNaN(n));},isEmail:function(e){var regex=/^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)$/;return regex.test(e);}};}();
Jelo.Format=function(){return{toCamel:function(str){return str.replace(/-(.)/g,function(m,l){return l.toUpperCase();});},hyphenatedToCamelCase:function(str){return Jelo.Format.toCamel(str);},cutHexHash:function(h){return(h.charAt(0)=="#")?h.substring(1):h;},hexToR:function(h){return parseInt(Jelo.Format.cutHexHash(h).substring(0,2),16);},hexToG:function(h){return parseInt(Jelo.Format.cutHexHash(h).substring(2,4),16);},hexToB:function(h){return parseInt(Jelo.Format.cutHexHash(h).substring(4,6),16);},hexToRGB:function(h){var r=this.hexToR(h);var g=this.hexToG(h);var b=this.hexToB(h);return[r,g,b];},rgbStringToArray:function(s){if(s.isString){try{var sub=s.split(/\D/g);var sub2=[];for(var i=0;i<sub.length;i++){if(sub[i]){sub2[sub2.length]=parseInt(sub[i],10);}}
return sub2;}catch(e){throw new Error("Jelo.Format.rgbStringToArray: Invalid input "+s);}}else{return[];}},rgbToHex:function(s){if(s.isString){try{function toHex(n){var chr="0123456789ABCDEF";if(n==null){return"00";}
n=parseInt(n);if(n==0||isNaN(n)){return"00";}
n=Math.max(0,n);n=Math.min(n,255);n=Math.round(n);return chr.charAt((n-n%16)/16)+chr.charAt(n%16);}
var a=Jelo.Format.rgbStringToArray(s);return"#"+toHex(a[0])+toHex(a[1])+toHex(a[2]);}catch(e){throw new Error("Jelo.Format.rgbStringToHex: Invalid input "+s);}}},urldecode:function(str){var histogram={};var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';for(replace in histogram){search=histogram[replace];ret=replacer(search,replace,ret)}
ret=decodeURIComponent(ret);return ret;},urlencode:function(str){var histogram={},tmp_arr=[];var ret=str.toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';ret=encodeURIComponent(ret);for(search in histogram){replace=histogram[search];ret=replacer(search,replace,ret)}
return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase();});return ret;},urlDecode:function(str){return Jelo.Format.urldecode(str);},urlEncode:function(str){return Jelo.Format.urlencode(str);}};}();
Jelo.CSS=function(){var clearOpacity=function(el){if(Jelo.Env.isIE){if(typeof el.style.filter==="string"&&(/alpha/i).test(el.style.filter)){el.style.filter="";}}else{el.style.opacity="";el.style["-moz-opacity"]="";el.style["-khtml-opacity"]="";}};var toCamel=Jelo.Format.toCamel;return{clearOpacity:clearOpacity,addClass:function(e,c){var curr=e.className;if(!new RegExp(c,"i").test(curr)){e.className=curr+(curr.length?" ":"")+c;}},hasClass:function(e,c){return c&&(' '+e.className+' ').indexOf(' '+c+' ')!=-1;},removeClass:function(e,c){e.className=e.className.replace(new RegExp(c+"\s?","i"),"").replace(/^\s?|\s?$/g,"");},getStyle:function(){var view=document.defaultView;return(view&&view.getComputedStyle)?function(el,p){if(!el||!p){return null;}
var styles=[];if(typeof el=="string"){el=Jelo.Dom.select(el);}
if(typeof p=="string"){p=p.toLowerCase();}
if(Jelo.Valid.isArray(el)){for(var i=0;i<el.length;i++){styles.push(arguments.callee(el[i],p));}
return styles;}
if(Jelo.Valid.isArray(p)){for(var i=0;i<p.length;i++){styles.push(arguments.callee(el,p[i]));}
return styles;}
if(p=="float"){p="cssFloat";}
var cp=toCamel(p);switch(cp){case"backgroundPositionX":try{return Jelo.css(el,"background-position").split(" ")[0];}catch(e){return null;}
case"backgroundPositionY":try{return Jelo.css(el,"background-position").split(" ")[1];}catch(e){return null;}}
var v;if(v=el.style[p]){return(/color/).test(p)?Jelo.Format.rgbToHex(v).toLowerCase():v.toString().toLowerCase();}
if(v=view.getComputedStyle(el,"")[cp]){return(/color/).test(p)?Jelo.Format.rgbToHex(v):v.toString();}
return null;}:function(el,p){var v;if(!el||!p){return null;}
if(Jelo.Valid.isArray(el)){var styles=[];for(var i=0;i<el.length;i++){var e=el[i];styles.push(arguments.callee(e,p));}
return styles;}
if(Jelo.Valid.isArray(p)){var styles=[];for(var i=0;i<p.length;i++){var e=p[i];styles.push(arguments.callee(el,e));}
return styles;}
if(typeof el=="string"){el=document.getElementById(el);}
if(p=="opacity"){if(typeof el.style.filter=='string'){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0;}}}
return 1;}
if(p=="float"){p="styleFloat";}
p=toCamel(p);if(v=el.style[p]){return v.toString();}
if(el.currentStyle&&(v=el.currentStyle[p])){if(v=="auto"){if(v=el["offset"+
p.replace(/^(.)/,function(m,l){return l.toUpperCase();})]){return v+"px";}}
return v.toString();}
return null;};}(),setStyle:function(el,p,v){if(typeof el==="string"){el=Jelo.Dom.select(el);}
if(Jelo.Valid.isArray(el)){for(var i=0;i<el.length;i++){arguments.callee(el[i],p,v);}
return;}
p=toCamel(p);if((/width|height|top|right|bottom|left|size/).test(p)){var unit=v.replace(/[^(%|px|em)]/g,"");if(!unit.length){unit="px";}
v=parseInt(v);if(isNaN(v)){v=0;}
v+=unit;}
var s=el.style;if(p==="opacity"){if(Jelo.Env.isIE){s.zoom=1;s.filter=(s.filter||'').replace(/alpha\([^\)]*\)/gi,"")+
(v==1?"":" alpha(opacity="+v*100+")");}else{s.opacity=parseFloat(v);}}else{s[p]=v;}}};}();Jelo.css=function(){if(arguments.length==2){return Jelo.CSS.getStyle(arguments[0],arguments[1]);}
if(arguments.length==3){return Jelo.CSS.setStyle(arguments[0],arguments[1],arguments[2]);}
throw new Error("Jelo.css: Syntax should be (element, property) for get, and (element, property, value) for set.");};
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString,hasDuplicate=false;var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}
if(!selector||typeof selector!=="string"){return results;}
var parts=[],sortOrder,m,set,checkSet,extra,prune=true,contextXML=isXML(context);chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}
if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}
return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"
+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while((node=node.previousSibling)){if(node.nodeType===1)
return false;}
if(type=='first')
return true;node=elem;case'last':while((node=node.nextSibling)){if(node.nodeType===1)
return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result
+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length
-check.length)===check:type==="|="?value===check||value.substr(0,check.length
+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source
+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
(function(){var form=document.createElement("div"),id="script"
+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}
div=null;})();if(document.querySelectorAll)
(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}
div=null;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)
(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&elem.ownerDocument.documentElement.nodeName!=="HTML";};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};window.Sizzle=Sizzle;})();Jelo.Dom=function(){return{filter:function(selector,set){return Sizzle.matches(selector,set);},select:function(selector,context,results){return Sizzle(selector,context,results);},selectNode:function(selector,context,results){return Sizzle(selector,context,results)[0];}};}();if(typeof $=='undefined'){$=Jelo.Dom.selectNode;}
if(typeof $$=='undefined'){$$=Jelo.Dom.select;}
Jelo.Event=function(){var isDomReady=false;var domFunctions=[];var handlers=[];var fireDomReady=function(){isDomReady=true;for(var i=0;i<domFunctions.length;i++){var fn=domFunctions[i];try{fn();}catch(e){}}
domFunctions=[];};var init=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",fireDomReady,false);}else if(Jelo.Env.isIE&&document.getElementById){document.write("<script id='ieDomReady' defer "+"src=//:><\/script>");var ieReady=document.getElementById("ieDomReady");ieReady.onreadystatechange=function(){if(ieReady.readyState==="complete"){fireDomReady();}};}
if(Jelo.Env.isWebkit){var timerDomReady=setInterval(function(){if(/loaded|complete/i.test(document.readyState)){fireDomReady.call(this);clearInterval(timerDomReady);}},10);}else{var oldOnload=(typeof window.onload=="function")?window.onload:function(){};window.onload=function(){oldOnload();fireDomReady();};}}();return{onReady:function(fn){if(typeof fn==="function"){if(isDomReady){fn();}else{domFunctions.push(fn);}}},add:function(el,ev,fn){if(!!el&&ev.isString&&!!fn){var handler=function(event){event=event||window.event;target=event.target?event.target:event.srcElement;if(target.nodeType===3){target=target.parentNode;}
event.preventDefault=event.preventDefault||function(){this.returnValue=false;};event.stopPropagation=event.stopPropagation||function(){this.cancelBubble=true;};fn.call(target,target,event);};if(el.addEventListener){el.addEventListener(ev,handler,false);}else if(el.attachEvent){el.attachEvent("on"+ev,handler);}else{throw("Jelo.Event.add: Could not observe "+ev+" on "+el);}
var newEvent={target:el,event:ev,handler:handler,fn:fn};handlers.push(newEvent);}else{throw("Syntax Error. Jelo.Event.add(DOMElement, Event:String, Function)");}},remove:function(el,ev,fn){if(!!el&&ev.isString&&!!fn){for(var i=0;i<handlers.length;i++){var jeh=handlers[i];var ml=el===jeh.target;var mv=ev===jeh.event;var mf=fn===jeh.fn;if(ml&&mv&&mf){if(el.removeEventListener){el.removeEventListener(ev,jeh.handler,false);}else if(el.detachEvent){el.detachEvent("on"+ev,jeh.handler);}else{throw("Jelo.Event.remove: Could not remove "+ev+" from "+el);}
handlers.splice(i,1);break;}}}else{throw("Syntax Error. Jelo.Event.remove(DOMElement, Event:String, Function");}}};}();Jelo.on=Jelo.Event.add;Jelo.un=Jelo.Event.remove;Jelo.Event.rem=Jelo.Event.remove;Jelo.onReady=Jelo.Event.onReady;
Jelo.Ajax=function(){var Status={OK:200,Created:201,Accepted:202,NoContent:204,BadRequest:400,Forbidden:403,NotFound:404,Gone:410,ServerError:500};var cache={};var getFromCache=function(url,success,failure,callback,config){var r=cache[url]||false;if(r){var h={status:Status.OK,readyState:4,responseText:r};if(success.isFunction){success.apply(h,[h,config]);}
if(callback.isFunction){callback.apply(h,[h,config]);}
return true;}
if(failure.isFunction){failure.apply(h,[h,config]);}
return false;};var http=function(){try{return new XMLHttpRequest();}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
return null;}();return{isBusy:function(){return((http.readyState!==0)&&(http.readyState!==4));},jdomp:function(){var config=arguments[0]||false;if(!config||!config.url){return;}
var cache=config.cache||false;var now=new Date().getTime();var params=config.params||null;var url=config.url;url+=(cache)?"?jdompCache=true":"?jdompCache="+now;for(var p in params){if(params.hasOwnProperty(p)){url+="&"+escape(p)+"="+escape(params[p]);}}
var h=document.getElementsByTagName("head")[0]||false;var e=document.getElementById("script-jdomp")||false;if(e){h.removeChild(e);}
var s=document.createElement("script");s.id="script-jdomp";s.type="text/javascript";s.src=url;var alreadyExists=false;if(cache){s.id+="-"+config.url.replace(/[^a-z]/gi,"");alreadyExists=document.getElementById(s.id)||false;if(alreadyExists){h.removeChild(alreadyExists);}}
h.appendChild(s);if(typeof config.callback==="function"){var c=document.createElement("script");c.type="text/javascript";c.id=s.id+"-callback";c.text="new "+config.callback;alreadyExists=document.getElementById(c.id)||false;if(alreadyExists){h.removeChild(alreadyExists);}
h.appendChild(c);}},request:function(){var config=arguments[0]||{};if(!config||!config.url){throw new Error("Jelo.Ajax.request: Required configuration option missing: url");}
var http=config.abortable?http:function(){try{return new XMLHttpRequest();}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}
return null;}();if(!http){throw new Error("Jelo.Ajax.request: XMLHttpRequest not supported.");}
var u=config.url;var x=config.proxy;if(x){u=x+"?url="+u;}
var p=config.params||config.data||{};var query='';var m=(config.method||"GET").toUpperCase();var c=config.cache||false;var cs=config.success||false;var cf=config.failure||false;var cc=config.callback||false;var a=(config.args&&config.args.isArray)?config.args:[];var e=(/\?/).test(u);if((m!=="GET")&&(m!=="POST")&&(m!=="PUT")&&(m!=="DELETE")){throw new Error("Jelo.Ajax.request: Method must be one of GET, POST, PUT, DELETE");}
if(typeof p=="object"){for(var param in p){if(p.hasOwnProperty(param)){query+=(query.indexOf('?')!==-1?'&':'?')+Jelo.Format.urlEncode(param)+"="+
Jelo.Format.urlEncode(p[param]);}}
if(m==="POST"){query=query.split("?",2)[1];}}else if(typeof p=="string"){query+=p;}
var uCache=u+query;if(c){var inCache=getFromCache(uCache,cs,cf,cc,config);if(!!inCache){return;}}
query+=(query.indexOf('?')!==-1?'&':'?')+'_nocache='+new Date().getTime();if((http.readyState!==0)&&(http.readyState!==4)){http.abort();}
var orsc=function(){if(http.readyState!==4){return;}
if(http.status===Status.OK){if(c){cache[uCache]=http.responseText;}
if(cs.isFunction){cs.apply(http,[http,config]);}}else{if(cf.isFunction){cf.apply(http,[http,config]);}}
if(cc.isFunction){cc.apply(http,[http,config]);}
http=null;}
switch(m){case"GET":http.open(m,u+query,true);http.onreadystatechange=orsc;http.setRequestHeader("User-Agent","Jelo.Ajax.request() http://jelo.callee.info/");http.send(null);break;case"POST":http.open(m,u,true);http.onreadystatechange=orsc;http.setRequestHeader("User-Agent","Jelo.Ajax.request() http://jelo.callee.info/");http.setRequestHeader("Content-type","application/x-www-form-urlencoded");http.setRequestHeader("Content-length",query.length);http.setRequestHeader("Connection","close");http.send(query);break;default:throw new Error("Jelo.Ajax.request(): Method "+m+" not yet implemented.");}}};}();
Jelo.Anim=function(){var _={defaultDuration:0.5,tasks:[],removeQueue:[],now:function(){return new Date().getTime();},timer:null,interval:10};var Strategies=function(){var percentComplete=function(){var delta=this.endTime-this.startTime;var ratio=1-((this.endTime-_.now())/delta);var p=this.easing(ratio);return Math.round(p*1000)/1000;};return{Border:function(){},Color:function(){var p=percentComplete.call(this);var f=this.startVal;var t=this.endVal;f=(f.substring(0,3)==="rgb")?Jelo.Format.rgbStringToArray(f):Jelo.Format.hexToRGB(f);t=(t.substring(0,3)==="rgb")?Jelo.Format.rgbStringToArray(t):Jelo.Format.hexToRGB(t);var v=[];for(var i=0;i<3;i++){var delta=Math.floor(t[i]-f[i]);var current=Math.floor(p*delta);v[i]=current+f[i];}
v="rgb("+v[0]+","+v[1]+","+v[2]+")";Jelo.CSS.setStyle(this.element,this.property,v);},ComboPx:function(){switch(this.property){case"backgroundPositionX":var rx=/\-?[0-9]+px/;if(rx.test(this.startVal)&&rx.test(this.endVal)){var getVal=function(val){return val.replace(/[^0-9\-]/g,"");};var p=percentComplete.call(this);var y0=Jelo.css(this.element,"background-position-y");var x=[getVal(this.startVal),getVal(this.endVal)];var y=[getVal(y0),getVal(y0)];var deltaValue=[parseInt(x[1],10)-parseInt(x[0],10),parseInt(y[1],10)-parseInt(y[0],10)];var currDelta=[Math.floor(p*deltaValue[0]),Math.floor(p*deltaValue[1])];var v=[currDelta[0]+parseInt(x[0],10),currDelta[1]+parseInt(y[0],10)];Jelo.CSS.setStyle(this.element,"background-position",v[0]+"px "+v[1]+"px");}
break;case"backgroundPositionY":var rx=/\-?[0-9]+px/;if(rx.test(this.startVal)&&rx.test(this.endVal)){var getVal=function(val){return val.replace(/[^0-9\-]/g,"");};var p=percentComplete.call(this);var x0=Jelo.css(this.element,"background-position-x");var x=[getVal(x0),getVal(x0)];var y=[getVal(this.startVal),getVal(this.endVal)];var deltaValue=[parseInt(x[1],10)-parseInt(x[0],10),parseInt(y[1],10)-parseInt(y[0],10)];var currDelta=[Math.floor(p*deltaValue[0]),Math.floor(p*deltaValue[1])];var v=[currDelta[0]+parseInt(x[0],10),currDelta[1]+parseInt(y[0],10)];Jelo.CSS.setStyle(this.element,"background-position",v[0]+"px "+v[1]+"px");}
break;case"backgroundPosition":var rx=/\-?[0-9]+px \-?[0-9]+px/;if(rx.test(this.startVal)&&rx.test(this.endVal)){var getVal=function(val,index){return val.split(" ")[index].replace(/[^0-9\-]/g,"");};var p=percentComplete.call(this);var x=[getVal(this.startVal,0),getVal(this.endVal,0)];var y=[getVal(this.startVal,1),getVal(this.endVal,1)];var deltaValue=[parseInt(x[1],10)-parseInt(x[0],10),parseInt(y[1],10)-parseInt(y[0],10)];var currDelta=[Math.floor(p*deltaValue[0]),Math.floor(p*deltaValue[1])];var v=[currDelta[0]+parseInt(x[0],10),currDelta[1]+parseInt(y[0],10)];Jelo.CSS.setStyle(this.element,this.property,v[0]+"px "+v[1]+"px");}
break;default:var rx=/\-?[0-9]+px \-?[0-9]+px \-?[0-9]+px \-?[0-9]+px/;if(rx.test(this.startVal)&&rx.test(this.endVal)){var getVal=function(val,index){return val.split(" ")[index].replace(/[^0-9\-]/g,"");};var p=percentComplete.call(this);var top=[getVal(this.startVal,0),getVal(this.endVal,0)];var right=[getVal(this.startVal,1),getVal(this.endVal,1)];var bottom=[getVal(this.startVal,2),getVal(this.endVal,2)];var left=[getVal(this.startVal,3),getVal(this.endVal,3)];var deltaValue=[parseInt(top[1],10)-parseInt(top[0],10),parseInt(right[1],10)-parseInt(right[0],10),parseInt(bottom[1],10)-parseInt(bottom[0],10),parseInt(left[1],10)-parseInt(left[0],10)];var currDelta=[];for(var i in[0,1,2,3]){currDelta[i]=Math.floor(p*deltaValue[i]);}
var v=[currDelta[0]+parseInt(top[0],10),currDelta[1]+parseInt(right[0],10),currDelta[2]+parseInt(bottom[0],10),currDelta[3]+parseInt(left[0],10)];Jelo.CSS.setStyle(this.element,this.property,v[0]+"px "+v[1]+"px "+v[2]+"px "+v[3]+"px");}}},Numerical:function(){var p=percentComplete.call(this);var deltaValue=parseFloat(this.endVal,10)-parseFloat(this.startVal,10);var currDelta=p*deltaValue;var v=currDelta+parseFloat(this.startVal,10);switch(this.property){case"opacity":v=parseFloat(v);if(v<0){v=0;}
if(v>1){v=1;}
break;case"zIndex":v=parseInt(v,10);break;}
Jelo.CSS.setStyle(this.element,this.property,v);},NumericalPx:function(){var p=percentComplete.call(this);var deltaValue=parseInt(this.endVal,10)-parseInt(this.startVal,10);var currDelta=Math.floor(p*deltaValue);var v=currDelta+parseInt(this.startVal,10);Jelo.CSS.setStyle(this.element,this.property,v+"px");}};}();var Easing={LINEAR:function(x){return x;},IN:function(x){return Math.pow(x,3);},OUT:function(x){return 1-Math.pow(1-x,3);},SMOOTH:function(x){return x<0.5?2*x*x:-2*Math.pow(x-1,2)+1;},OVERSHOOT:function(x){var s=1.70158;return(x-=1)*x*((s+1)*x+s)+1;},SPRING:function(x){return 1-(Math.cos(x*4.5*Math.PI)*Math.exp(-x*6));},WOBBLE:function(x){return(-Math.cos(3*x*Math.PI)/2)+.5;}};var animate=function(config){if(!config){return;}
var m=config.me||false;if(!m){throw new Error('Jelo.Anim.ate() Missing required configuration option me:HTMLElement|String');}else if(m.isArray){m=m[0];}else if(typeof m==="string"){m=Jelo.Dom.selectNode(m);}
if(!m){throw new Error('Jelo.Anim.ate() Missing required configuration option me:HTMLElement|String');}
var css=config.css||false;if(!css||(typeof css!=="string")){throw new Error('Jelo.Anim.ate() Missing required configuration option css:String');}
var c=Jelo.Format.hyphenatedToCamelCase(css);if(Jelo.Env.isIE){if(c=="backgroundPosition"){return;}}
var f=config.from;if(!f&&typeof f!=="number"){f=Jelo.CSS.getStyle(m,c);if(!f&&typeof f!=="number"){f=Jelo.CSS.getStyle(m,css);}
if(!f&&typeof f!=="number"){throw new Error("Jelo.Anim.ate("+m.tagName+c+") Cannot detect starting value, please supply configuration option from:String|Number");}}
if(f==="auto"){f=0;}
var t=config.to;if(!t&&typeof t!=="number"){throw new Error('Jelo.Anim.ate() Missing required configuration option to:String|Number');}
var b=(typeof config.before==="function")?config.before:Jelo.emptyFn;var a=(typeof config.after==="function")?config.after:Jelo.emptyFn;var d=parseFloat(config.duration);if(isNaN(d)){d=_.defaultDuration;}
d=Math.floor(Math.abs(d*1000));var e=config.easing||Jelo.Anim.Easing.LINEAR;if((typeof e==="string")&&e.length){e=Jelo.Anim.Easing[e.toUpperCase()]||Jelo.Anim.Easing.LINEAR;}else if(typeof e!="function"){throw new Error("Jelo.Anim.ate: Easing must be a string such as 'linear', 'out', etc. or a function.");}
for(var i=0;i<_.tasks.length;i++){var ti=_.tasks[i];if((ti.element==m)&&(ti.property==c)){_.tasks.splice(i,1);break;}}
var animFn=function(c){switch(c){case"border":case"borderBottom":case"borderLeft":case"borderRight":case"borderTop":return Strategies.Border;case"backgroundColor":case"color":return Strategies.Color;case"backgroundPositionX":case"backgroundPositionY":case"backgroundPosition":case"margin":case"padding":return Strategies.ComboPx;case"opacity":case"zIndex":return Strategies.Numerical;case"bottom":case"height":case"left":case"marginBottom":case"marginLeft":case"marginRight":case"marginTop":case"paddingBottom":case"paddingLeft":case"paddingRight":case"paddingTop":case"right":case"top":case"width":return Strategies.NumericalPx;default:return Jelo.emptyFn;}}(c);var animObj={element:m,property:c,callback:a,startTime:_.now(),endTime:_.now()+d,startVal:f,endVal:t,fn:animFn,easing:e};_.tasks.push(animObj);b.call(animObj);run();};var run=function(){if(!_.timer){_.timer=setInterval(function(){if(_.removeQueue.length){var callbacks=[];for(var i=_.removeQueue.length-1;i>=0;i--){var ri=_.removeQueue[i];var ti=_.tasks[ri];var v=null;switch(ti.fn){case Strategies.Border:v=ti.endVal;break;case Strategies.ComboPx:v=ti.endVal;break;case Strategies.Color:v="#"+ti.endVal.replace(/#/,"");break;case Strategies.NumericalPx:v=parseInt(ti.endVal,10)+"px";break;case Strategies.Numerical:v=parseFloat(ti.endVal);break;default:v=ti.endVal;}
Jelo.CSS.setStyle(ti.element,ti.property,v);callbacks.push(ti);_.tasks.splice(ri,1);}
_.removeQueue=[];for(var i=0;i<callbacks.length;i++){var ti=callbacks[i];ti.callback.call(ti);}}
if(_.tasks.length){for(var i=0;i<_.tasks.length;i++){var t=_.tasks[i];if(_.now()<t.endTime){t.fn.call(t);}else{_.removeQueue.push(i);}}}},_.interval);}};return{Easing:Easing,ate:animate,ating:function(){return!!_.tasks.length;},stopAll:function(){_.removeQueue=[];_.tasks=[];if(_.timer){clearTimeout(_.timer);_.timer=null;}}};}();
Jelo.DD=function(){var _={minOffset:5,zHigh:20000,zHigher:20001,isDragging:false,item:null,mouseX:null,mouseY:null,lastDragged:null,dropTargets:[]};var active=false;var zeroNaN=function(n){return isNaN(n)?0:n;};var mouseDown=function(t,e){if(!active){return true;}
var t=this;while(!t.jeloDragTarget&&t!=null){t=t.parentNode||t.parentElement;}
if(t==null){return false;}
var d=t.jeloDragTarget;var iPos=findPosition(d);console.log(iPos);d.jeloDragT=Jelo.css(d,"top");d.jeloDragL=Jelo.css(d,"left");d.jeloDragP=Jelo.css(d,"position");d.jeloDragO=Jelo.css(d,"opacity");d.jeloDragZ=Jelo.css(d,"z-index");Jelo.css(d,"position","absolute");Jelo.css(d,"top",iPos.y+"px");Jelo.css(d,"left",iPos.x+"px");d.jeloDragTop=parseInt(Jelo.css(d,"top"));d.jeloDragLeft=parseInt(Jelo.css(d,"left"));Jelo.css(d,"position",d.jeloDragP);Jelo.css(d,"left",d.jeloDragL);Jelo.css(d,"top",d.jeloDragT);Jelo.on(document,"mousemove",mouseMove);Jelo.on(document,"mouseup",mouseUp);_.item=d;_.isDragging=true;_.mouseX=e.clientX;_.mouseY=e.clientY;return false;};var mouseMove=function(t,e){if(!active||!_.isDragging||!_.item){return true;}
var x=e.clientX-_.mouseX;var y=e.clientY-_.mouseY;var ax=Math.abs(e.clientX-_.mouseX);var ay=Math.abs(e.clientY-_.mouseY);if(Math.round((ax+ay)/2)>_.minOffset){var d=_.item;Jelo.css(d,"position","absolute");Jelo.css(d,"opacity",0.7);Jelo.css(d,"z-index",_.zHigher);Jelo.css(d,"top",parseInt(d.jeloDragTop+y)+"px");Jelo.css(d,"left",parseInt(d.jeloDragLeft+x)+"px");document.body.appendChild(d);}
return false;};var mouseUp=function(t,e){if(!active){return true;}
if(_.item){if(_.lastDragged!=_.item){_.zHigh++;_.zHigher++;}
_.lastDragged=_.item;Jelo.css(_.item,"opacity",_.item.jeloDragO);Jelo.css(_.item,"z-index",_.zHigh);if(typeof _.item.jeloDragOnMouseUp=="function"){_.item.jeloDragOnMouseUp.call(_.item,_.item.jeloDragHandle);}
Jelo.each(_.dropTargets,function(){if(typeof this.jeloOnDrop=="function"){var t=findPosition(_.item);var p=findPosition(this);var r=p.x+zeroNaN(parseInt(Jelo.css(this,"width")));var b=p.y+zeroNaN(parseInt(Jelo.css(this,"height")));var mx=e.clientX;var my=e.clientY;if(mx>p.x&&mx<r&&my>p.y&&my<b){var d=_.item;Jelo.css(d,"position","static");Jelo.css(d,"left","auto");Jelo.css(d,"top","auto");this.appendChild(_.item);this.jeloOnDrop.call(this,_.item,_.item.jeloDragHandle);}}});}
Jelo.un(document,"mousemove",mouseMove);Jelo.un(document,"mouseup",mouseUp);_.mouseX=null;_.mouseY=null;_.item=null;_.isDragging=false;};var detectDrop=function(t,e){console.log('test');}
var findPosition=function(o){var offsetX=zeroNaN(parseInt(Jelo.css(o,"margin-left")));var offsetY=zeroNaN(parseInt(Jelo.css(o,"margin-top")));var curleft=curtop=0;if(o.offsetParent){curleft=o.offsetLeft
curtop=o.offsetTop
while(o=o.offsetParent){curleft+=o.offsetLeft
curtop+=o.offsetTop}}
return{"x":curleft-offsetX,"y":curtop-offsetY};};return{isDraggy:function(el){return(el&&!!el.jeloDraggy);},isDroppy:function(el){return(el&&!!el.jeloDroppy);},setDraggy:function(el,bool,handle,fn){bool=(typeof bool=="boolean")?bool:true;handle=handle||el;if(Jelo.Valid.isElement(el)&&Jelo.Valid.isElement(handle)){handle.jeloDragTarget=el;Jelo.on(handle,"mousedown",mouseDown);Jelo.css(handle,"cursor","move");el.jeloDraggy=bool;el.jeloDragHandle=handle;if(typeof fn=="function"){el.jeloDragOnMouseUp=fn;}}},setDroppy:function(el,bool,handle,fn){bool=(typeof bool=="boolean")?bool:true;handle=handle||el;if(Jelo.Valid.isElement(el)&&Jelo.Valid.isElement(handle)){handle.jeloDropTarget=el;el.jeloDroppy=bool;el.jeloDropHandle=handle;if(typeof fn=="function"){el.jeloOnDrop=fn;}
_.dropTargets.push(el);}},on:function(){active=true;},off:function(){active=false;},setMinimumDrag:function(n){n=parseInt(n,10);if(!isNaN(n)){_.minOffset=n;}}};}();
