var TOP="top";var RIGHT="right";var BOTTOM="bottom";var LEFT="left";var browser=new Browser();var dom=new DOM();var page=new Page();var doc=document;var B_P=Browser.prototype;var D_P=DOM.prototype;var P_P=Page.prototype;var C_P=CSS.prototype;function Browser(){ this.IE=false;this.MOZILLA=false;this.SAFARI=false;this.OPERA=false;this.name="";this.tagRegExp=new RegExp("<[A-Za-z\/][^<>]*>",'ig');this.date_ISO8601=new RegExp(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/);this.objects=[];this.months=[ "January","February","March","April","May","June","July","August","September","October","November","December" ];this.hexDec={ "0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","a":10,"b":11,"c":12,"d":13,"e":14,"f":15};this.decHex=[ 0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f" ];this.ver=0;{ var appVer=navigator.appVersion;var agent=navigator.userAgent;if(window.opera){ this.OPERA=true;this.ver=opera.version();this.name="Opera";}else if(appVer.indexOf("MSIE") > -1&&document.all){ var start=appVer.indexOf("MSIE ")+5;this.IE=true;this.ver=parseFloat(appVer.substring(start,appVer.indexOf(";",start)));this.name="Internet Explorer";}else if(appVer.indexOf("Safari") > -1){ var start=appVer.indexOf("AppleWebKit/")+12;this.SAFARI=true;this.ver=parseFloat(appVer.substring(start,appVer.indexOf("(",start)));this.name="Safari";}else{ this.MOZILLA=true;if(navigator.userAgent.indexOf("Firefox") > -1){ this.ver=parseFloat(agent.substring(agent.lastIndexOf("/")+1));this.name="Firefox";}else{ var start=agent.indexOf("rv:")+3;this.ver=parseFloat(agent.substring(start,agent.indexOf(")",start)));this.name="Mozilla";}}}}B_P.fixPng=function(){ var e;var sizing=arguments[arguments.length-1];var p1="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='";if(this.IE&&this.ver < 7){ for(var i=0;i < arguments.length-1;i++){ e=$(arguments[i]);if(e.nodeName.toLowerCase()=='img'&&e.src.indexOf(".png") > -1){ var parent=e.parentNode;parent.removeChild(e);parent.style.backgroundImage='none';parent.style.filter=p1+e.src+"',sizingMethod='"+sizing+"')";}else{ var bg=e.css.get("background-image");var src=bg.substring(5,bg.length-2);e.style.backgroundImage='none';e.style.filter=p1+src+"',sizingMethod='"+sizing+"')";}}}};B_P.getNow=function(){ var now=new Date();return Math.round(now.getTime()/1000);};B_P.stripHTML=function(string,whitelist){ return string.replace(this.tagRegExp,'');};B_P.objectId=function(obj){ this.objects.push(obj);return this.objects.length-1;};B_P.getObject=function(id){ return this.objects[id];};B_P.ajax=function(url,paramString,method){ var req;var queue=new Chain(url,0,false);method=method.toUpperCase();if(method.toUpperCase()=='GET'&&paramString) url+= '?'+paramString;if(window.XMLHttpRequest){ req=new XMLHttpRequest();}else if(window.ActiveXObject){ try { req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){ req=new ActiveXObject("Microsoft.XMLHTTP");}}reqId=browser.objectId(req);req.onreadystatechange=new Function( "var req=browser.getObject("+reqId+");"+"if(req.readyState!=4) return;"+"if(req.status!=200){ allChains['"+queue.name+"'].error=true;allChains['"+queue.name+"'].next();return;}"+"allChains['"+queue.name+"'].unshift(req.responseText+\";allChains['"+queue.name+"'].next();\");"+"allChains['"+queue.name+"'].start();" );req.open(method,url,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");if(req.overrideMimeType) req.overrideMimeType('text/plain');if(method.toUpperCase()=='POST'){ req.send(paramString);}else if(window.XMLHttpRequest){ req.send('');}else{ req.send();}return queue;};B_P.parseDate=function(string){ if(string){ if(string.search(this.date_ISO8601) > -1){ dateBits=string.split(/T|\+|Z|-|\./);string=this.months[dateBits[1]-1]+" "+dateBits[2]+","+dateBits[0]+" "+dateBits[3];}return new Date(string);}return null;};B_P.stop=function(windowObj){ if(!windowObj) windowObj=self;if(browser.IE) windowObj.document.execCommand('Stop');else windowObj.stop();};function Page(){ this.trackingCursor=false;this.cursorX=0;this.cursorY=0;this.params=[];}P_P.getWidth=function(){ if(doc.documentElement.clientWidth){ return doc.documentElement.clientWidth;}else if(window.innerWidth){ return window.innerWidth;}return 0;};P_P.getHeight=function(){ if(browser.OPERA){ return window.innerHeight;}if(doc.documentElement.clientHeight){ return doc.documentElement.clientHeight;}return 0;};P_P.stopPropagation=function(ev){ ev=ev ? ev : window.event;if(ev){ if(ev.stopPropagation) ev.stopPropagation();else ev.cancelBubble=true;}};function DOM(){ this.bodyElement=null;this.orphans=[];}function $(id){ return dom.get(id);}D_P.get=function(id){ var e;if(!id) return null;if(typeof(id)=="string"){ if(id.toLowerCase()=="body") return this.getBody();e=this.enhance(doc.getElementById(id));}else{ e=this.enhance(id);id=e.id;}return e;};D_P.getBody=function(){ if(this.bodyElement==null)this.bodyElement=this.enhance(doc.body||doc.documentElement);return this.bodyElement;};D_P.getRoot=function(){ var html=this.getBody();while(html.parentNode.parentNode){ html=html.parentNode;}return this.enhance(html);};D_P.create=function(tagName,className,id){ var newElement=doc.createElement(tagName);if(id) newElement.setAttribute("id",id);if(className) newElement.className=className;return this.enhance(newElement);};D_P.createText=function(string){ return doc.createTextNode(string);};D_P.remove=function(e){ e=this.get(e);if(e&&e.parentNode){ var result=e.parentNode.removeChild(e);}return e;};D_P.limbo=function(el){ if(typeof el=='string'){ el=$(el);}if(el){ this.orphans[el.id]=this.remove(el);}};D_P.retrieve=function(id){ if(id&&this.orphans[id]!=null){ var el=this.orphans[id];delete this.orphans[id];return el;}else{ return null;}};D_P.enhance=function(e){ if(e&&! e.isEnhanced){ e.isEnhanced=true;e.access=this;e.css=new CSS(e);e.opacity=100;e.create=E_create;e.createText=E_createText;e.getParent=E_getParent;e.getChildren=E_getChildren;e.getChild=E_getChild;e.push=E_push;e.unshift=E_unshift;e.toHTML=E_toHTML;e.toggle=E_toggle;e.display=E_display;e.getWidth=E_getWidth;e.getHeight=E_getHeight;e.slideTo=E_slideTo;e.setOpacity=E_setOpacity;if(e.nodeName.toLowerCase()=="form"){ e.ajaxSubmit=E_ajaxSubmit;e.clearAll=E_clearAll;}}return e;};function E_create(tagName,className,id){ var newNode=this.access.create(tagName,className,id);return this.push(newNode);}function E_createText(string){ var newNode=this.access.createText(string);return this.push(newNode);}function E_getParent(){ return this.access.get(this.parentNode);}function E_getChildren(tagName,cssClass){ var all=this.getElementsByTagName(tagName);var children=[];for(var i=0;i < all.length;i++){ if(all[i].className.indexOf(cssClass) > -1||cssClass==null){ children.push($(all[i]));}}return children;}function E_getChild(tagName,cssClass){ var e=this.getElementsByTagName(tagName);for(var i=0;i < e.length;i++){ if(e[i].className.indexOf(cssClass) > -1||cssClass==null){ return $(e[i]);}}}function E_push(e){ try { this.appendChild(e);return e;}catch(e){}}function E_unshift(e){ if(this.childNodes.length > 0) this.insertBefore(e,this.childNodes[0]);else this.push(e);return e;}function E_toHTML(){ var temp1=dom.create('p');var temp2=this.cloneNode(true);temp1.push(temp2);return temp1.innerHTML;}function E_toggle(){ if(this.style.display=="block") this.style.display="none";else this.style.display="block";}function E_display(mode){ if(arguments.length==0) mode=true;if(typeof mode=="string"){ this.style.display=mode;}else if(mode){ this.style.display="block";}else{ this.style.display="none";}}function E_getWidth(outer){ var width=parseInt(this.offsetWidth);if(outer){ width+= this.css.getInt('border-left');width+= this.css.getInt('border-right');}return width;}function E_getHeight(outer){ var height=parseInt(this.offsetHeight);if(outer){ height+= this.css.getInt('border-top');height+= this.css.getInt('border-bottom');}return height;}function E_slideTo(left,top,step,delay){ var chain;var directionX,directionY=1;var distX,distY,startX,startY,i=0;if(left!=null){ if(left < this.offsetLeft) directionX=-1;distX=(left-this.offsetLeft) * directionX;startX=this.offsetLeft;}if(top!=null){ if(top < this.offsetTop) directionY=-1;distY=(top-this.offsetTop) * directionY;startY=this.offsetTop;}chain=new Chain(this.id,delay,true);while(distX > step||distY > step){ if(distX > step){ chain.add("$('"+this.id+"').style.left="+(startX+(i * step * directionX))+"+'px'");distX-= step;}if(distY > step){ chain.add("$('"+this.id+"').style.top="+(startY+(i * step * directionY))+"+'px'");distY-= step;}i++;}if(left!=null) chain.add("$('"+this.id+"').style.left='"+left+"px';");if(top!=null) chain.add("$('"+this.id+"').style.top='"+top+"px';");return chain;}function E_setOpacity(percent,steps,delay){ if(arguments.length==1){ if(browser.IE){ this.style.filter=(percent < 100) ? "progid:DXImageTransform.Microsoft.Alpha(opacity="+percent+",style=0);" : null;}else{ this.style.opacity=percent/100;}this.opacity=percent;}else{ var current=this.opacity;var chain=new Chain(this.id,delay,true);for(var i=0;i < steps;i++){ chain.add("$('"+this.id+"').setOpacity("+(current+((i+1) *((percent-current)/steps)))+");");}return chain;}}function E_ajaxSubmit(){ var params="";for(var i=0;i < this.elements.length;i++){ if(this.elements[i].name){ params+= escape(this.elements[i].name)+"="+escape(this.elements[i].value);if(i+1 < this.elements.length) params+= "&";}}return browser.ajax(this.action,params,this.method);}function E_clearAll(){ for(var i=0;i < this.elements.length;i++){ this.elements[i].value='';}}function CSS(e){ this.e=e;}C_P.get=function(prop,returnInt){ var value;if(browser.IE){ if(eval("this.e.currentStyle")) value=eval("this.e.currentStyle."+jsProperty(prop));else value=null;}else{ var style=doc.defaultView.getComputedStyle(this.e,"");if(style!=null) value=style.getPropertyValue(prop);}if(prop!=null&&returnInt){ value=parseInt(value);if(isNaN(value)) value=0;}return value;};C_P.getInt=function(p){ return this.get(p,true);};C_P.addClass=function(c){ if(this.e.className){ if(this.e.className.indexOf(c)==-1) this.e.className+= " "+c;}else{ this.e.className=c;}};C_P.removeClass=function(c){ if(this.e.className) this.e.className=this.e.className.replace(c,'');};C_P.swapClass=function(c1,c2){ if(this.e.className){ if(this.e.className.indexOf(c1) > -1) this.e.className=this.e.className.replace(c1,c2);else this.e.className=this.e.className.replace(c2,c1);}};C_P.getColor=function(prop){ return new Color(this.get(prop));};function jsProperty(prop){ while(prop.indexOf("-") > -1&&prop.length >= prop.indexOf("-")+2){ prop=prop.substring(0,prop.indexOf("-"))+prop.charAt(prop.indexOf("-")+1).toUpperCase()+prop.substr(prop.indexOf("-")+2);}return prop;}var allChains=[];function Chain(name,delay,advance){ this.events=[];this.delay=delay;this.advance=advance;this.name=name;this.timer=null;this.started=(advance) ? true : false;this.timeout=0;this.timeoutTimer=null;this.timeoutAction="";this.start=function(){ this.started=true;this.next();};this.unshift=function(evalString){ if(this.advance) evalString+= ";allChains['"+this.name+"'].next();";this.events.unshift(evalString);if(this.timer==null&&this.started) this.next();};this.add=function(evalString,autoAdvance){ if(this.advance||autoAdvance) evalString+= ";allChains['"+this.name+"'].next();";this.events.push(evalString);if(this.timer==null&&this.started) this.next();};this.push=this.add;this.next=function(){ if(this.started){ if(this.events.length > 0){ this.timer=setTimeout(this.events.shift(),this.delay);if(this.timeout){ clearTimeout(this.timeoutTimer);this.timeoutAction+= ";allChains['"+this.name+"'].next();";this.timeoutTimer=setTimeout(this.timeoutAction,this.timeout);this.timeoutAction="";}}else{ this.timer=null;clearTimeout(this.timeoutTimer);}}};this.stop=function(){ clearTimeout(this.timer);allChains[name]=null;};this.clearTimeout=function(){ clearTimeout(this.timeoutTimer);};if(allChains[name]) allChains[name].stop();allChains[name]=this;}function Point(a,b,c){ this.circlePoint=false;this._x;this._y;this.angle;this.radius;this.midpoint;this.changed=false;if(arguments.length==3){ this.circlePoint=true;this.changed=true;this.midpoint=a;this.radius=b;this.angle=c;}else{ this._x=a ? a : 0;this._y=b ? b : 0;}this.setAngle=function(a){ this.changed=true;this.angle=validAngle(a);};this.getX=function(){ if(this._x!=null&&! this.changed) return this._x;this.calcXY();return this._x;};this.getY=function(){ if(this._y!=null&&! this.changed) return this._y;this.calcXY();return this._y;};this.calcXY=function(){ this._x=this.midpoint.getX()+Math.round(this.radius * Math.sin(toRadians(this.angle)));this._y=this.midpoint.getY()+Math.round(this.radius * Math.cos(toRadians(this.angle)));this.changed=false;};}Point.prototype.distanceFrom=function(p){ var dist=Math.sqrt(Math.pow((this.getX()-p.getX()),2)+Math.pow((this.getY()-p.getY()),2));return Math.round(dist);};function Line(a,b){ this.a=a;this.b=b;this.getLength=function(){ return this.a.distanceFrom(this.b);};}function toRadians(d){ return d *(Math.PI/180);}function diff(a,b){ var d=a-b;return Math.max(d,d * -1);}function validAngle(d){ if(d >= 360) return d % 360;if(d < 0) return 360+(d % 360);return d;}function Color(r,g,b,hex){ if(arguments.length==1){ var c=arguments[0];if(r.indexOf("rgb") > -1){ c=c.substring(c.indexOf("(")+1,c.indexOf(")")).split(/,\s*/);this.r=parseInt(c[0]);this.g=parseInt(c[1]);this.b=parseInt(c[2]);}else if(r.indexOf("#")==0&&r.length==4){ this.r=hexToDec(c.charAt(1)+c.charAt(1));this.g=hexToDec(c.charAt(2)+c.charAt(2));this.b=hexToDec(c.charAt(3)+c.charAt(3));}else if(r.indexOf("#")==0&&r.length==7){ this.r=hexToDec(c.substr(1,2));this.g=hexToDec(c.substr(3,2));this.b=hexToDec(c.substr(5,2));}}else if(hex){ this.r=hexToDec(r);this.g=hexToDec(g);this.b=hexToDec(b);}else{ this.r=parseInt(r);this.g=parseInt(g);this.b=parseInt(b);}this.toString=function(){ if(browser.IE) return "#"+decToHex(this.r)+decToHex(this.g)+decToHex(this.b);return "rgb("+this.r+","+this.g+","+this.b+")";};this.lighten=function(level,max){ level=(max) ? level * max : level;return new Color(((level *(255-this.r))+this.r),((level *(255-this.g))+this.g),((level *(255-this.b))+this.b));};this.darken=function(level,max){ level=(max) ? level * max : level;return new Color((this.r -(level * this.r)),(this.g -(level * this.g)),(this.b -(level * this.b)));};this.getTransition=function(target,steps){ if(this.toString()==target.toString()) return null;var colors=[];var rStep=(target.r-this.r)/steps;var gStep=(target.g-this.g)/steps;var bStep=(target.b-this.b)/steps;for(var i=0;i < steps;i++){ colors[i]=new Color(this.r+(rStep *(i+1)),this.g+(gStep *(i+1)),this.b+(bStep *(i+1)));}colors.push(target);return colors;};}function hexToDec(str){ str=str.toLowerCase();return(parseInt(browser.hexDec[str.charAt(0)]) * 16)+parseInt(browser.hexDec[str.charAt(1)]);}function decToHex(value){ var hex="";value=(value!=null&&value >= 0) ? Math.round(value) : 0;hex+=(value!=0) ? browser.decHex[Math.floor(value / 16)] : 0;hex+=(value!=0) ? browser.decHex[Math.floor(value % 16)] : 0;return hex;}function isset(val){ if(val!=null&&val!='') return true;return false;}function trim(str){ return str.replace(/^\s+|\s+$/,"");}function escapeRegExp(text){ if(!arguments.callee.sRE){ var specials=[ '/','.','*','+','?','|','(',')','[',']','{','}','\\' ];arguments.callee.sRE=new RegExp( '(\\'+specials.join('|\\')+')','g' );}return text.replace(arguments.callee.sRE,'\\$1');}function jsSafe(string){ string=string.replace(/\'/,"\\'");string=string.replace(/\"/,"\\\"");return string;}