{Array.prototype.index=0;Array.prototype.get=function(index,wrap){if(!wrap||!this.length)return this[index];index=index%this.length;if(index<0)index+=this.length;return this[index];};Array.prototype.current=function(){return this[this.index];};Array.prototype.next=function(wrap){this.index++;if(wrap&&this.index>=this.length)this.index=0;return this[this.index];};Array.prototype.previous=function(wrap){this.index--;if(wrap&&this.index<0)this.index=this.length-1;return this[this.index];};Array.prototype.jumpTo=function(index,wrap){this.index=index;if(!wrap||!this.length)return(index>=this.length)?this[0]:this[index];this.index=this.index%this.length;if(this.index<0)this.index+=this.length;return this[this.index];};Array.prototype.jumpBy=function(amount,wrap){return this.jumpTo(this.index+amount,wrap);};Array.prototype.copy=function(){var tempArray=[];var i=this.length;while(i--)tempArray[i]=(this[i]instanceof Array)?this[i].copy():this[i];return tempArray;};Array.prototype.swap=function(firstIndex,secondIndex){if(firstIndex<0)firstIndex=this.length+firstIndex;if(secondIndex<0)secondIndex=this.length+secondIndex;if(this[firstIndex]==this[secondIndex])return;var tempIndex=this[firstIndex];this[firstIndex]=this[secondIndex];this[secondIndex]=tempIndex;};Array.prototype.range=function(from,to,step){if(from==null&&to==null)return[];if(from!=null&&from==to)return[from];var range=[];var i=from;if(!step)step=1;if((step>0&&from>to)||(step<0&&from=to)||(from>to&&i<=to)){return range;}i+=step;}};Array.prototype.contains=function(value){var i=this.length;while(i--)if(this[i]===value)return true;return false;};Array.prototype.indexOf=function(value){for(var i=0;i=0);};String.prototype.beginsWith=function(value){return(value==this.substring(0,value.length));};String.prototype.endsWith=function(value){return(value==this.substring(this.length-value.length));};String.prototype.stripTags=function(){return this.replace(/<\/?[^>]+>/gi,"");};String.prototype.htmlEncode=function(){var entities={"&":"&","<":"<",">":">",'"':"""};var t=this;for(var i in entities)t=t.replace(i,entities[i]);return t;};String.prototype.htmlDecode=function(){var entities={"&":"&","<":"<",">":">",'"':"""};var t=this;for(var i in entities)t=t.replace(entities[i],i);return t;};String.prototype.urlEncode=function(){return encodeURIComponent(this);};String.prototype.urlDecode=function(){return decodeURIComponent(this);};String.prototype.ucFirst=function(){return this.charAt(0).toUpperCase()+this.slice(1);};String.prototype.getQueryParams=function(){var params={};this.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function($0,$1,$2,$3){if(!$3)return;params[$1]=$3;});return params;}}{Number.prototype.toPrice=function(){var price=this.toFixed(2)+"";var parts=price.split(".");hundredths=parts[1];price=new Number(parts[0]);return price.toLocaleString()+"."+hundredths;};Number.prototype.toHrsMin=function(){var converted={hours:Math.floor(this/3600),minutes:Math.floor((this/60)%60)};return{hours:converted.hours,minutes:converted.minutes,text:converted.hours.toString().pad(2,0)+":"+converted.minutes.toString().pad(2,0)};};}{document.getClientWidth=function(){var doc=document.documentElement;return(doc&&doc.clientWidth)?doc.clientWidth:document.body.clientWidth;};document.getClientHeight=function(){var doc=document.documentElement;return(doc&&doc.clientHeight)?doc.clientHeight:document.body.clientHeight;};}{window.isArray=function(value){return isObject(value)&&value.constructor==Array;};window.isBoolean=function(value){return typeof value=="boolean";};window.isFunction=function(value){return typeof value=="function";};window.isObject=function(value){return(value&&typeof value=="object")||isFunction(value);};window.isNull=function(value){return typeof value=="object"&&!value;};window.isNumber=function(value){return typeof value=="number"&&isFinite(value);};window.isNaNNumber=function(value){return typeof value=="number"&&isNaN(value);};window.isUnNumber=function(value){return typeof value=="number"&&(isNaN(value)||!isFinite(value));};window.isString=function(value){return typeof value=="string";};window.isUndefined=function(value){return typeof value=="undefined";};window.isUnknown=function(value){return isObject(value)&&typeof value.constructor!="function";};window.isWidget=function(value,type){if(!isObject(value)||!value.hasAttribute||!value.hasAttribute("widget"))return false;if(!type)return true;var wtype=value.getAttribute("widget").split(" ");var i=wtype.length;while(i--)if(wtype[i]==type)return true;return false;};window.isComponent=function(value,type){if(!isObject(value)||!value.hasAttribute||!value.hasAttribute("component"))return false;return(type)?value.getAttribute("component")==type:value.hasAttribute("component");};}{Math.significantFigures=function(value,sigFigures){if(value==0)return 0;if(Math.round(value)==value)return value;var digits=Math.round((-Math.log(Math.abs(value))/Math.LN10)+(sigFigures||2));if(digits<0)digits=0;return value.toFixed(digits);};}{window.getElementsById=function(){if(arguments.length==1){return(isString(arguments[0]))?document.getElementById(arguments[0]):arguments[0];}for(var elements=[],i=0;i":">"+this.innerHTML+"");});HTMLElement.prototype.__defineSetter__("outerHTML",function(html){var range=this.ownerDocument.createRange();range.setStartBefore(this);this.parentNode.replaceChild(range.createContextualFragment(html),this);});HTMLElement.prototype.insertAfter=function(node,referenceNode){this.insertBefore(node,referenceNode.nextSibling);};HTMLElement.prototype.prependChild=function(node){this.insertBefore(node,this.firstChild);};HTMLElement.prototype.__defineGetter__("isDisabled",function(){return this.hasAttribute("disabled");});HTMLElement.prototype.contains=function(node){while(node&&(this!=node))node=node.parentNode;return this==node;};HTMLElement.prototype.getAppliedStyle=function(name){return document.defaultView.getComputedStyle(this,null).getPropertyValue(name);};HTMLElement.prototype.refresh=function(){};}};SOAPI.Core_Gecko_CreateElement=function(){document._createElement=document.createElement;document.createElement=function(type){var element=document._createElement(type);if(type.toLowerCase()=="input"||type.toLowerCase()=="textarea"){SOAPI.Event.addEventHandler(element,"focus");SOAPI.Event.addEventHandler(element,"blur");}return element;};};window.SOAPI=window.SOAPI||{};var SOAPI=window.SOAPI;SOAPI.Core_Webkit_HTMLElement=function(){{HTMLTableColElement.prototype.getAppliedStyle=function(name){return this.style[name];};}};{window.opera=window.opera||false;window.ie=(!window.opera&&typeof HTMLElement=="undefined");window.gecko=(!window.ie&&typeof window.mozInnerScreenX!=="undefined");window.webkit=(!window.ie&&!window.gecko&&typeof HTMLElement.prototype.__defineGetter__!=="undefined");window.ie9=(!window.ie&&!window.gecko&&!window.webkit&&!window.opera);window.hasTouch=("ontouchstart"in document);}if(opera||ie9){SOAPI.Core_Opera_HTMLElement.call();SOAPI.Core_Opera_CreateElement.call();}else if(ie){SOAPI.Core_IE_HTMLElement.call();SOAPI.Core_IE_CreateElement.call();}else {SOAPI.Core_Gecko_HTMLElement.call();SOAPI.Core_Gecko_CreateElement.call();if(webkit)SOAPI.Core_Webkit_HTMLElement.call();}SOAPI.Cookie={get:function(name){var start=document.cookie.indexOf(name+"=");if(start==-1)return;var middle=start+name.length+1;var end=document.cookie.indexOf(';',middle);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(middle,end));},set:function(name,value,expires,path,domain,secure){var cookie=name+"="+escape(value);if(expires!=null){var date=new Date();date.setTime(date.getTime()+(expires*1000));cookie+=";expires="+date.toGMTString();}cookie+=";path="+((path!=null)?path:"/");if(domain!=null)cookie+=";domain="+domain;if(secure)cookie+=";secure";document.cookie=cookie;},clear:function(name,path,domain){this.set(name,"",-1,path,domain);}};SOAPI.Message={domRef:null,contentDomRef:null,bottom:0,timerOffset:0,_ERROR:'error',_INFO:'info',_WARNING:'warning',_MESSAGE_ERROR:'Please provide a message for SOAPI.Message',_TYPE_ERROR:'Please select an existing SOAPI.Message type',_MESSAGE_DISPLAY:'Unable to display message, make sure there is an available DOM reference',initialise:function(){if($('messages')){var messages=window.messages;this.domRef=$('messages');this.contentDomRef=$('content');this.bottom=this.contentDomRef.get('bottom');if(messages.length>0){for(var i=0;i0?height+bottom:""));SOAPI.Event.triggerEvent('contentchange',this.contentDomRef,null,true);}};window.SOAPI=window.SOAPI||{};var SOAPI=window.SOAPI;{SOAPI.version="5.0";SOAPI.progress=false;SOAPI.built=false;SOAPI.action=null;SOAPI.widgets=SOAPI.widgets||{};SOAPI.setupActions=[];SOAPI.speedtest=0;SOAPI.timezoneoffset=false;SOAPI.dialog=null;SOAPI.setup=function(progress,action,build,speedtest){while(SOAPI.setupActions.length){var setupAction=SOAPI.setupActions.shift();setupAction();}if(progress)SOAPI.progress=true;if(action)SOAPI.action=action;if(SOAPI.built){if(SOAPI.action&&isFunction(SOAPI.action))SOAPI.action();if(SOAPI.action&&!isFunction(SOAPI.action))eval(SOAPI.action);SOAPI.action=null;return;}var theHTMLElement=(ie&&SOAPI.HTMLElement)?SOAPI.HTMLElement:window.HTMLElement.prototype;for(var member in SOAPI.Sprite.prototype){if(["parentClass","construct","isSprite","dragger","animators","timer","callParent"].contains(member))continue;theHTMLElement[member]=SOAPI.Sprite.prototype[member];}if(ie&&SOAPI.HTMLElement)SOAPI.extendHTML(document);if((speedtest==undefined||speedtest==true)&&!(SOAPI.speedtest=SOAPI.Cookie.get('speedtest'))){function fibTest(n){var s=0;if(n==0)return s;if(n==1){s+=1;return s;}else {return fibTest(n-1)+fibTest(n-2);}};var timeOne=new Date();var testArray=new Array();for(i=0;i<27;i++)testArray.push(fibTest(i));var timeTwo=new Date();var diff=timeTwo.getTime()-timeOne.getTime();if(diff<650)SOAPI.speedtest='good';else SOAPI.speedtest='poor';SOAPI.Cookie.set('speedtest',SOAPI.speedtest,3600);}if(!(SOAPI.timezoneoffset=SOAPI.Cookie.get('timezoneoffset'))){var timezoneoffset={current:-1*new Date().getTimezoneOffset()*60,summer:-1*new Date(Date.UTC(2000,6,21,0,0,0,0)).getTimezoneOffset()*60,winter:-1*new Date(Date.UTC(2000,12,21,0,0,0,0)).getTimezoneOffset()*60};SOAPI.Cookie.set('timezoneoffset',JSON.stringify(timezoneoffset),3600);}SOAPI.Event.setupEventHandlers();SOAPI.Message.initialise();if(build)return SOAPI.buildWidgets();if(SOAPI.action&&isFunction(SOAPI.action))SOAPI.action();if(SOAPI.action&&!isFunction(SOAPI.action))eval(SOAPI.action);SOAPI.dialog=SOAPI.findFirstChildWidget(document.body,"dialog","div");};SOAPI.createElement=function(parameters){var p={type:"div",element:null,parent:document.body,attributes:null,styles:null,content:null,insert:true};for(var pName in parameters){if(parameters[pName]!=null)p[pName]=parameters[pName];}var px={left:true,top:true,width:true,height:true};if(isString(p.parent))p.parent=document.getElementById(p.parent);if(isString(p.element))p.element=document.getElementById(p.element);var e=(p.element)?p.element:document.createElement(p.type);for(pName in p.attributes){if(p.attributes[pName]!=null)e.setAttribute(pName,p.attributes[pName]);}for(pName in p.styles){if(p.styles[pName]!=null){e.style[pName]=(px[pName]==null)?p.styles[pName]:parseFloat(p.styles[pName])+"px";}}if(p.content!=null)e.innerHTML=p.content;if(!p.element&&p.insert)p.parent.appendChild(e);return e;};SOAPI.destroyElement=function(element){if(isString(element))element=document.getElementById(element);element.innerHTML="";element.outerHTML="";};SOAPI.findAllChildElements=function(parent,type,attributes,recurse,limit,forwards){type=(type)?type.toLowerCase():"*";var a=(attributes)?attributes:{};var children=[];var childNodes=(recurse)?parent.getElementsByTagName(type):parent.childNodes;var i=childNodes.length;while(i--){var child=childNodes[(forwards)?childNodes.length-i-1:i];if(child.nodeType!=1||(type!="*"&&child.tagName.toLowerCase()!=type)){continue;}var found=true;for(var aName in a){var found=false;if(!child.hasAttribute(aName))break;var attribute=child.getAttribute(aName);if(isArray(a[aName])){var aSub=a[aName];var j=aSub.length;while(j--){var aSubName=aSub[j];switch(aName){case"widget":found=isWidget(child,aSubName);break;case"class":found=attribute.split(" ").contains(aSubName);break;default:found=attribute==aSubName;break;}if(found)break;}}else {switch(aName){case"widget":found=isWidget(child,a[aName]);break;case"class":found=attribute.split(" ").contains(a[aName]);break;default:found=attribute==a[aName];break;}}if(!found)break;}if(found)children.push(child);if(children.length>=limit)break;}return children;};SOAPI.findFirstChildElement=function(parent,type,attributes,recurse){return this.findAllChildElements(parent,type,attributes,recurse,1,true)[0];};SOAPI.findLastChildElement=function(parent,type,attributes,recurse){return this.findAllChildElements(parent,type,attributes,recurse,1)[0];};SOAPI.findAllChildComponents=function(parent,cType,eType,recurse){return this.findAllChildElements(parent,eType,{component:cType},recurse);};SOAPI.findFirstChildComponent=function(parent,cType,eType,recurse){return this.findFirstChildElement(parent,eType,{component:cType},recurse);};SOAPI.findLastChildComponent=function(parent,cType,eType,recurse){return this.findLastChildElement(parent,eType,{component:cType},recurse);};SOAPI.findAllChildWidgets=function(parent,wType,eType,recurse){return this.findAllChildElements(parent,eType,{widget:wType},recurse);};SOAPI.findFirstChildWidget=function(parent,wType,eType,recurse){return this.findFirstChildElement(parent,eType,{widget:wType},recurse);};SOAPI.findLastChildWidget=function(parent,wType,eType,recurse){return this.findLastChildElement(parent,eType,{widget:wType},recurse);};SOAPI.getMatchingAttributes=function(element,attributes){for(var i in attributes){if(element.hasAttribute(i))attributes[i]=element.getAttribute(i);}return attributes;};SOAPI.buildWidgets=function(element){element=element||document.body;var elements=[];var allelements=element.getElementsByTagName("*");var stack=[element];var buildsubs=0;for(var i=0,e;(e=allelements[i])!=null;i++){if(((isWidget(e)&&this.widgets[e.getAttribute("widget")])||isComponent(e))&&!e.built){var hasBuild=e.hasAttribute("build");var hasBuildsubs=e.hasAttribute("buildsubs");var j=stack.length-1;while(j>=0){if(stack[j]===document.body||stack[j].contains(e)){stack.push(e);if(buildsubs==j&&((hasBuildsubs&&e.getAttribute("buildsubs")!="false")||(!hasBuildsubs))){buildsubs=j+1;}j++;break;}stack.pop();j--;if(buildsubs>j)buildsubs=j;}if(isWidget(e)&&buildsubs>=j-1&&(j==1||((hasBuild&&e.getAttribute("build")!="false")||(!hasBuild)))){elements.push(e);}}}if(isWidget(element))element.builtsubs=true;var progress=this.progress;if(!this.ProgressBar)progress=false;if(progress){progress=this.progress={};progress.time=0;progress.elements=elements;progress.element=0;progress.bar=new this.ProgressBar({element:document.getElementById("SOAPI_LoadBar")});return this.buildNextWidget();}for(var i=0,e;(e=elements[i])!=null;i++)this.widgets[e.getAttribute("widget")]({element:e});this.built=true;SOAPI.setup();};SOAPI.buildNextWidget=function(){var progress=SOAPI.progress;var e=progress.elements[progress.element];SOAPI.widgets[e.getAttribute("widget")]({element:e});progress.element++;if(progress.element1000){progress.bar.updatePosition(progress.element/progress.elements.length*100);progress.time=time;return setTimeout(SOAPI.buildNextWidget,0);}else {return SOAPI.buildNextWidget();}}progress.bar.parentNode.removeChild(progress.bar);SOAPI.progress=true;SOAPI.built=true;SOAPI.setup();};SOAPI.findParentWidget=function(element,type){while((element=element.parentNode)!==document){if(isWidget(element,type))return element;}return false;};SOAPI.findParentComponent=function(element,type){while((element=element.parentNode)!==document){if(isComponent(element,type))return element;}return false;};SOAPI.configureWidgetPieces=function(config){for(var i in config){var pieces=config[i];var widget=SOAPI[i].prototype;if(!isObject(pieces)){widget.parameters=SOAPI.merge(widget.parameters);widget.parameters.pieces=pieces;continue;}for(var j in pieces){if(j=="self"){widget.parameters.pieces=pieces[j];continue;}widget.ctypes[j]=widget.ctypes[j].duplicate();var proto=widget.ctypes[j].prototype;proto.parameters=SOAPI.merge(proto.parameters);proto.parameters.pieces=pieces[j];}}};SOAPI.merge=function(){if(isArray(arguments[0]))return[].concat(arguments);var result={};for(var i=0;i5)element.src=bg.match(/http.+[^")]/g)[0];else if(element.src=="")element.style.display="none";element.style.backgroundImage="none";};SOAPI.extendHTML=function(baseElement){var element=!isString(baseElement)?baseElement:$(baseElement);var elements=element.getElementsByTagName("*");var HTMLElement=SOAPI.HTMLElement;for(var i=elements.length-1;i>=0;i--){var el=elements[i];if(typeof el.getAppliedStyle=="undefined"){if(el.tagName=="OBJECT"){for(var pName in HTMLElement){if(!el[pName])el[pName]=HTMLElement[pName];}continue;}for(var p in HTMLElement)el[p]=HTMLElement[p];}}};}SOAPI.Class=function(){};{SOAPI.Class.prototype.construct=function(){};SOAPI.Class.extension=function(){var subClass=this.duplicate();subClass.prototype.parentClass=this.prototype;return subClass;};SOAPI.Class.extend=function(members){for(var member in members)this.prototype[member]=members[member];};SOAPI.Class.duplicate=function(){var Class=SOAPI.Class;var sibClass=function(){if(arguments[0]!==Class)return this.construct.apply(this,arguments);};sibClass.prototype=new this(Class);sibClass.extension=this.extension;sibClass.extend=this.extend;sibClass.duplicate=this.duplicate;return sibClass;};SOAPI.Class.prototype.callParent=function(object,name,parameters){var currentClass=this;var found=null;while(currentClass!=null){if(currentClass[name]===object)found=currentClass;currentClass=currentClass.parentClass;}currentClass=found||this;return currentClass.parentClass[name].apply(this,parameters);};}SOAPI.Events={resizetimer:null,mousedown:["onMouseDown","mousedown"],mousemove:["onMouseMove","mousemove"],mouseup:["onMouseUp","mouseup"],mousewheel:["onMouseWheel",(gecko||webkit)?"wheel":"mousewheel"],mouseover:["onMouseOver","mouseover"],mouseout:["onMouseOut","mouseout"],focus:["onFocus",(!ie)?"focus":"activate"],blur:["onBlur",(!ie)?"blur":"deactivate"],keypress:["onKeyPress","keypress"],keydown:["onKeyDown","keydown"],keyup:["onKeyUp","keyup"],change:["onChange","change"],scroll:["onScroll","scroll"],nodeinserted:["onNodeInserted",(!ie9)?"addNodeInsertedObserver":"DOMNodeInserted"],noderemoved:["onNodeRemoved",(!ie9)?"addNodeRemovedObserver":"DOMNodeRemoved"],attrmodified:["onAttrModified",(!ie9)?"addAttrModifiedObserver":"DOMAttrModified"],drag:["onDrag"],dragstart:["onDragStart"],dragend:["onDragEnd"],dragover:["onDragOver"],dragout:["onDragOut"],drop:["onDrop"],dblclick:["onDblClick","dblclick"],resize:["onResize","resize"],sizechange:["onSizeChange"],contentchange:["onContentChange"],action:["onAction"],filedrop:["onFileDrop","drop"],filedragover:["onFileDragover","dragover"],filedragout:["onFileDragout","dragleave"],paste:["onPaste","paste"],copy:["onCopy","copy"],cut:["onCut","cut"],transitionend:["onTransitionEnd",(webkit)?"webkitTransitionEnd":"transitionend"],touchstart:["onTouchstart","touchstart"],touchend:["onTouchend","touchend"],touchmove:["onTouchmove","touchmove"],onmousedown:function(event){return SOAPI.Event.processEvent("mousedown",event,this);},onmousemove:function(event){return SOAPI.Event.processEvent("mousemove",event,this);},onmouseup:function(event){return SOAPI.Event.processEvent("mouseup",event,this);},onmousewheel:function(event){return SOAPI.Event.processEvent("mousewheel",event,this);},onmouseover:function(event){return SOAPI.Event.processEvent("mouseover",event,this);},onmouseout:function(event){return SOAPI.Event.processEvent("mouseout",event,this);},onfocus:function(event){return SOAPI.Event.processEvent("focus",event,this);},onblur:function(event){return SOAPI.Event.processEvent("blur",event,this);},onkeypress:function(event){return SOAPI.Event.processEvent("keypress",event,this);},onkeydown:function(event){return SOAPI.Event.processEvent("keydown",event,this);},onkeyup:function(event){return SOAPI.Event.processEvent("keyup",event,this);},onchange:function(event){return SOAPI.Event.processEvent("change",event,this);},onscroll:function(event){return SOAPI.Event.processEvent("scroll",event,this);},ondrag:function(event){return SOAPI.Event.processEvent("drag",event,this);},ondragstart:function(event){return SOAPI.Event.processEvent("dragstart",event,this);},ondragend:function(event){return SOAPI.Event.processEvent("dragend",event,this);},ondragover:function(event){return SOAPI.Event.processEvent("dragover",event,this);},ondragout:function(event){return SOAPI.Event.processEvent("dragout",event,this);},ondrop:function(event){return SOAPI.Event.processEvent("drop",event,this);},ondblclick:function(event){return SOAPI.Event.processEvent("dblclick",event,this);},onresize:function(event){return SOAPI.Event.processEvent("resize",event,this);},onsizechange:function(event){return SOAPI.Event.processEvent("sizechange",event,this);},onnodeinserted:function(event){return SOAPI.Event.processEvent("nodeinserted",event,this);},onnoderemoved:function(event){return SOAPI.Event.processEvent("noderemoved",event,this);},onattrmodified:function(event){return SOAPI.Event.processEvent("attrmodified",event,this);},onfiledrop:function(event){return SOAPI.Event.processEvent("filedrop",event,this);},onfiledragover:function(event){return SOAPI.Event.processEvent("filedragover",event,this);},onfiledragout:function(event){return SOAPI.Event.processEvent("filedragout",event,this);},oncontentchange:function(event){return SOAPI.Event.processEvent("contentchange",event,this);},onpaste:function(event){return SOAPI.Event.processEvent("paste",event,this);},oncopy:function(event){return SOAPI.Event.processEvent("copy",event,this);},oncut:function(event){return SOAPI.Event.processEvent("cut",event,this);},ontransitionend:function(event){return SOAPI.Event.processEvent("transitionend",event,this);},ontouchstart:function(event){return SOAPI.Event.processEvent("touchstart",event,this);},ontouchend:function(event){return SOAPI.Event.processEvent("touchend",event,this);},ontouchmove:function(event){return SOAPI.Event.processEvent("touchmove",event,this);},onMouseDown:function(event){var E=SOAPI.Event;var e=event.event;var element=event.element;var offset=window.scrollOffset();E.button=event.getMouseButton();E.x=e.clientX+offset.x;E.y=e.clientY+offset.y;E.currentLeft=(element.isSprite)?element.get("left"):element.offsetLeft;E.currentTop=(element.isSprite)?element.get("top"):element.offsetTop;E.offsetX=E.x-E.currentLeft;E.offsetY=E.y-E.currentTop;if(!element.isSprite)return true;if(element.isUsable&&!element.isUsable()){if(element.parentNode)E.triggerEvent("focus",element.parentNode,null,true);return false;}if(E.button==E.LEFT&&element.dragger&&element.dragger.enabled){E.triggerEvent("focus",element,null,true);E.dragImminent=element;event.stopPropagation();}return true;},onMouseMove:function(event){var E=SOAPI.Event;var e=event.event;var offset=window.scrollOffset();E.x=e.clientX+offset.x;E.y=e.clientY+offset.y;E.distanceX=E.x-E.offsetX-E.currentLeft;E.distanceY=E.y-E.offsetY-E.currentTop;E.currentLeft+=E.distanceX;E.currentTop+=E.distanceY;if(!E.dragActive){if(!E.dragImminent){if(event.element.isUsable&&!event.element.isUsable())event.stopProcessing();return true;}event.element=E.dragImminent;E.triggerEvent("dragstart",event.element);E.dragImminent=false;}event.element=E.dragActive;if(!event.element.isSprite)return false;if(event.getMouseButton()){E.triggerEvent("drag",event.element);}else {E.triggerEvent("dragend",event.element);}event.stopPropagation();return false;},onMouseUp:function(event){var E=SOAPI.Event;var e=event.event;var offset=window.scrollOffset();E.x=e.clientX+offset.x;E.y=e.clientY+offset.y;E.dragImminent=false;if(!E.dragActive){if(event.element.isUsable&&!event.element.isUsable())event.stopProcessing();return true;}E.triggerEvent("dragend",E.dragActive);event.stopPropagation();return true;},onMouseWheel:function(event){var E=SOAPI.Event;var e=event.event;var modeModifier=e.deltaMode===e.DOM_DELTA_LINE?1:18;if(e.deltaX)E.wheelDeltaX=e.deltaX/modeModifier;if(e.deltaY)E.wheelDeltaY=e.deltaY/modeModifier;if(e.wheelDelta)E.wheelDelta=e.wheelDelta/120*((opera)?1:-1);if(E.dragActive)return false;if(event.element.isUsable&&!event.element.isUsable())event.stopProcessing();return true;},onMouseOver:function(event){if(SOAPI.Event.dragActive&&event.element!=SOAPI.Event.dragActive)event.stopProcessing();if(event.element.isUsable&&!event.element.isUsable())event.stopProcessing();return true;},onMouseOut:function(event){if(SOAPI.Event.dragActive&&event.element!=SOAPI.Event.dragActive)event.stopProcessing();if(event.element.isUsable&&!event.element.isUsable())event.stopProcessing();return true;},onDragStart:function(event){SOAPI.Event.dragActive=event.element;var elements=event.element.getElementsByTagName("*");var i=elements.length;while(i--){if(elements[i].eventHandlers&&elements[i].eventHandlers["sizechange"]){SOAPI.Event.changeOnDrag.push(elements[i]);}}return true;},onDrag:function(event){var E=SOAPI.Event;var element=E.dragActive;if(E.distanceX||E.distanceY)SOAPI.Events.doDrag(E,element.dragger.partners,false);if(E.distanceX||E.distanceY)SOAPI.Events.doDrag(E,element.dragger.partners,true);var targets=element.dragger.targets;var topTarget=null;var topZIndex=null;var i=targets.length;while(i--){var target=targets[i];var sprite=target.sprite;var zIndex=parseInt(sprite.style.zIndex);if(E.x>sprite.get("ActualLeft")&&E.xsprite.get("ActualTop")&&E.ytopZIndex||(isNaN(zIndex)&&topZIndex==null))&&sprite.isVisible()){topTarget=target;if(!isNaN(zIndex))topZIndex=zIndex;}}if(topTarget&&!topTarget.over){var target=topTarget.sprite;target.trigger=event.element;E.triggerEvent("dragover",target);topTarget.over=true;}var i=targets.length;while(i--){var target=targets[i];if(target!==topTarget&&target.over){E.triggerEvent("dragout",target.sprite);target.over=false;}}var i=E.changeOnDrag.length;while(i--)E.triggerEvent("sizechange",E.changeOnDrag[i]);return true;},onDragEnd:function(event){var partners=SOAPI.Event.dragActive.dragger.partners;var i=partners.length;while(i--){var r=partners[i].sprite.dragger.restrictions;for(style in r)r[style].delta=0;}var targets=SOAPI.Event.dragActive.dragger.targets;var i=targets.length;while(i--){if(targets[i].over){SOAPI.Event.triggerEvent("drop",targets[i].sprite);break;}}SOAPI.Event.dragActive=false;SOAPI.Event.changeOnDrag=[];return true;},doDrag:function(object,partners,apply){var i=partners.length;while(i--){var partner=partners[i];var sprite=partner.sprite;for(var axis in{X:null,Y:null}){var multiply=partner["multiply"+axis];for(var style in multiply){if(multiply[style]==null)continue;var d=object["distance"+axis]*multiply[style];if(apply){sprite.styleBy(style,d);continue;}var styles=[[style,1]];switch(style){case"width":{var sl=sprite.style.left;var sr=sprite.style.right;if(sl!=""||sr==""){styles.push(["right",-1],["lright",1]);}else {styles.push(["left",-1],["rleft",1]);}}break;case"left":{var sw=sprite.style.width;var sl=sprite.style.left;if((sw=="auto"||sw=="")&&sl!=""){styles.push(["width",-1]);}else {styles.push(["right",-1],["lright",1]);}styles.push(["rleft",-1]);}break;case"right":{var sw=sprite.style.width;var sr=sprite.style.right;if((sw=="auto"||sw=="")&&sr!=""){styles.push(["width",-1]);}else {styles.push(["left",-1],["rleft",1]);}styles.push(["lright",-1]);}break;case"height":{var st=sprite.style.top;var sb=sprite.style.bottom;if(st!=""||sb==""){styles.push(["bottom",-1],["tbottom",1]);}else {styles.push(["top",-1],["btop",1]);}}break;case"top":{var sh=sprite.style.height;var st=sprite.style.top;if((sh=="auto"||sh=="")&&st!=""){styles.push(["height",-1]);}else {styles.push(["bottom",-1],["tbottom",1]);}styles.push(["btop",-1]);}break;case"bottom":{var sh=sprite.style.height;var sb=sprite.style.bottom;if((sh=="auto"||sh=="")&&sb!=""){styles.push(["height",-1]);}else {styles.push(["top",-1],["btop",1]);}styles.push(["tbottom",-1]);}break;}if(!sprite.dragger.restrict)continue;var j=styles.length;while(j--){var r=sprite.dragger.restrictions[styles[j][0]];if(!r)continue;var value=parseFloat(sprite.get(styles[j][0]));d*=styles[j][1];r.delta+=d;if(d<0&&r.min!=null&&value+d<=r.min){d=r.min-value;continue;}else if(d>0&&r.max!=null&&value+d>=r.max){d=r.max-value;continue;}else if(SOAPI.Event.dragActive&&((d<0&&r.delta>0&&r.delta+d>0)||(d>0&&r.delta<0&&r.delta+d<0))){d=0;}r.delta-=d;d*=styles[j][1];if(!d||r.step==null)continue;d*=styles[j][1];r.delta+=d;var steps=Math.floor(Math.abs(r.delta)/r.step);var part=r.delta%r.step;if(Math.abs(part)>r.step/2){steps++;d=steps*r.step*((r.delta>0)?1:-1);r.delta-=d;d*=styles[j][1];}else {d=0;}}if(partner.key)object["distance"+axis]=d/multiply[style];}}}},onFocus:function(event){SOAPI.Event.propogateEvent(event,event.element);if(SOAPI.Event.dragActive)event.preventDefault();return true;},onBlur:function(event){SOAPI.Event.propogateEvent(event,event.element);return true;},addNodeInsertedObserver:function(element){var MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var observer=new MutationObserver(function(event){var ln=event.length;while(ln--){var mutation=event[ln];if(mutation.type=="childList"&&mutation.addedNodes.length>0){SOAPI.Event.triggerEvent("nodeinserted",element,{mutation:event[ln]},true);}}});observer.observe(element,{childList:true});},addNodeRemovedObserver:function(element){var MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var observer=new MutationObserver(function(event){var ln=event.length;while(ln--){var mutation=event[ln];if(mutation.type=="childList"&&mutation.removedNodes.length>0){SOAPI.Event.triggerEvent("noderemoved",element,{mutation:event[ln]},true);}}});observer.observe(element,{childList:true});},addAttrModifiedObserver:function(element){var MutationObserver=window.MutationObserver||window.WebKitMutationObserver;var observer=new MutationObserver(function(event){var ln=event.length;while(ln--){var mutation=event[ln];if(mutation.type=="attributes"&&mutation.attributeName!==""){SOAPI.Event.triggerEvent("attrmodified",element,{mutation:event[ln]},true);}}});observer.observe(element,{attributes:true});},onNodeInserted:function(event){event.event=event.mutation;delete event.mutation;return true;},onNodeRemoved:function(event){event.event=event.mutation;delete event.mutation;return true;},onAttrModified:function(event){event.event=event.mutation;delete event.mutation;return true;},onResize:function(event){if(SOAPI.Events.resizetimer!==null){clearTimeout(SOAPI.Events.resizetimer);SOAPI.Events.resizetimer=null;}SOAPI.Events.resizetimer=setTimeout(function(){SOAPI.Event.triggerEvent("sizechange",document.body,null,false,true);SOAPI.Events.resizetimer=null;},700);return true;},onTouchstart:function(event){SOAPI.Event.copyTouchState(event.event);this.touchstart=performance.now();return SOAPI.Events.onMouseDown(event);},onTouchend:function(event){SOAPI.Event.copyTouchState(event.event);this.touchend=performance.now();return SOAPI.Events.onMouseUp(event);},onTouchmove:function(event){var e=event.event;var E=SOAPI.Event;var offset=window.scrollOffset();SOAPI.Event.copyTouchState(e);this.touchmove=performance.now();E.touchDeltaX=e.clientX-E.x+offset.x;E.touchDeltaY=e.clientY-E.y+offset.y;if(E.dragActive!==false)event.stopPropagation();return SOAPI.Events.onMouseMove(event);},onDragOver:function(event){return true;},onDragOut:function(event){return true;},onDrop:function(event){return true;},onKeyPress:function(event){return true;},onKeyDown:function(event){return true;},onKeyUp:function(event){return true;},onChange:function(event){return true;},onScroll:function(event){return true;},onSizeChange:function(event){return true;},onContentChange:function(event){return true;},onFileDrop:function(event){return true;},onFileDragover:function(event){return true;},onFileDragout:function(event){return true;},onPaste:function(event){return true;},onCopy:function(event){return true;},onCut:function(event){return true;},onTransitionEnd:function(event){return true;},onDblClick:function(event){return true;}};SOAPI.Event={button:0,LEFT:1,RIGHT:2,MIDDLE:4,wheelDeltaX:0,wheelDeltaY:0,touchDeltaX:0,touchDeltaY:0,x:0,y:0,offsetX:0,offsetY:0,distanceX:0,distanceY:0,currentLeft:0,currentTop:0,dragActive:false,dragImminent:false,changeOnDrag:[],toucheventmapping:{mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"},setupEventHandlers:function(){SOAPI.Event.addEventHandler(document,"mousemove");SOAPI.Event.addEventHandler(document,"mousedown");SOAPI.Event.addEventHandler(document,"mouseup");SOAPI.Event.addEventHandler(window,"resize");var sets=[document.getElementsByTagName("input"),document.getElementsByTagName("textarea")];var s=sets.length;while(s--){var elements=sets[s];var i=elements.length;while(i--){SOAPI.Event.addEventHandler(elements[i],"focus");SOAPI.Event.addEventHandler(elements[i],"blur");}}},addEventHandler:function(element,type,handler,name,order){var events=this.toucheventmapping;if(hasTouch&&events[type]!==undefined){SOAPI.Event.addEventHandler(element,events[type],handler,name,order);}if(isString(element))element=document.getElementById(element);if(!isArray(order))order=(order)?[order]:["last"];type=type.toLowerCase().replace(/^on/,"");if(!SOAPI.Events[type])return false;if(!element.eventHandlers){element.eventHandlers={};element.eventQueues={};}if(!element.eventHandlers[type]){var defaultName=SOAPI.Events[type][0];element.eventHandlers[type]={};element.eventHandlers[type][defaultName]={handler:SOAPI.Events[defaultName],pos:0};element.eventQueues[type]=[defaultName];if(typeof SOAPI.Events[SOAPI.Events[type][1]]=="function"){SOAPI.Events[SOAPI.Events[type][1]](element);}else if(SOAPI.Events[type][1]){if(element.addEventListener){element.addEventListener(SOAPI.Events[type][1],SOAPI.Events["on"+type],false);}else {element["on"+SOAPI.Events[type][1]]=SOAPI.Events["on"+type];}}}if(!handler||!name)return true;var handlers=element.eventHandlers[type];var queue=element.eventQueues[type];if(handlers[name])queue.splice(handlers[name].pos,1);var pos=false;for(var i=0;ivalue)value=width;}return value;}case"height":{var value=this.getAppliedStyle("height");return(!isNumber(value)&&value.indexOf("px")<0)?this.clientHeight:parseFloat(value);}case"offsetheight":return this.offsetHeight;case"clientheight":return this.clientHeight;case"scrollheight":return this.scrollHeight;case"actualheight":return this.offsetHeight;case"contentheight":{var value=0;var i=this.childNodes.length;while(i--){var node=this.childNodes[i];if(node.nodeType!=1)continue;var height=node.offsetTop+node.offsetHeight;if(height>value)value=height;}return value;}case"minwidth":return parseFloat(this.getAppliedStyle("min-width"));case"maxwidth":return parseFloat(this.getAppliedStyle("max-width"));case"minheight":return parseFloat(this.getAppliedStyle("min-height"));case"maxheight":return parseFloat(this.getAppliedStyle("max-height"));case"left":{var value=this.getAppliedStyle("left");return(!isNumber(value)&&value.indexOf("px")<0)?this.offsetLeft:parseFloat(value);}case"offsetleft":return this.offsetLeft;case"clientleft":return this.clientLeft;case"scrollleft":return this.scrollLeft;case"actualleft":return this.getActual("offsetLeft");case"right":{var value=this.getAppliedStyle("right");return(!isNumber(value)&&value.indexOf("px")<0)?this.offsetRight:parseFloat(value);}case"offsetright":return this.offsetRight;case"clientright":return this.clientRight;case"scrollright":return this.scrollRight;case"actualright":return this.getActual("offsetRight");case"top":{var value=this.getAppliedStyle("top");return(!isNumber(value)&&value.indexOf("px")<0)?this.offsetTop:parseFloat(value);}case"offsettop":return this.offsetTop;case"clienttop":return this.clientTop;case"scrolltop":return this.scrollTop;case"actualtop":return this.getActual("offsetTop");case"bottom":{var value=this.getAppliedStyle("bottom");return(!isNumber(value)&&value.indexOf("px")<0)?this.offsetBottom:parseFloat(value);}case"offsetbottom":return this.offsetBottom;case"clientbottom":return this.clientBottom;case"scrollbottom":return this.scrollBottom;case"actualbottom":return this.getActual("offsetBottom");case"rleft":return this.get("right")+this.get("width");case"offsetrleft":return this.get("offsetright")+this.get("offsetwidth");case"clientrleft":return this.get("clientright")+this.get("clientwidth");case"scrollrleft":return this.get("scrollright")+this.get("scrollwidth");case"actualrleft":return this.get("actualright")+this.get("actualwidth");case"lright":return this.get("left")+this.get("width");case"offsetlright":return this.get("offsetleft")+this.get("offsetwidth");case"clientlright":return this.get("clientleft")+this.get("clientwidth");case"scrolllright":return this.get("scrollleft")+this.get("scrollwidth");case"actuallright":return this.get("actualleft")+this.get("actualwidth");case"btop":return this.get("bottom")+this.get("height");case"offsetbtop":return this.get("offsetbottom")+this.get("offsetheight");case"clientbtop":return this.get("clientbottom")+this.get("clientheight");case"scrollbtop":return this.get("scrollbottom")+this.get("scrollheight");case"actualbtop":return this.get("actualbottom")+this.get("actualheight");case"tbottom":return this.get("top")+this.get("height");case"offsettbottom":return this.get("offsettop")+this.get("offsetheight");case"clienttbottom":return this.get("clienttop")+this.get("clientheight");case"scrolltbottom":return this.get("scrolltop")+this.get("scrollheight");case"actualtbottom":return this.get("actualtop")+this.get("actualheight");case"clip":{var regex=(giveUnits)?/rect|\(|\)|\s/ig:/rect|\(|\)|px|\s/ig;var clip=this.getAppliedStyle("clip").replace(regex,"").split(",");if(clip.length<4){if(clip.length==1&&clip[0]=="")return["auto","auto","auto","auto"];if(clip.length==1)return[clip[0],clip[0],clip[0],clip[0]];if(clip.length==2)return[clip[0],clip[1],clip[0],clip[1]];clip[3]="auto";}return clip;}case"opacity":return parseFloat(this.getAppliedStyle("opacity"))*100;case"borderleftwidth":case"borderrightwidth":case"bordertopwidth":case"borderbottomwidth":return parseFloat(this.getAppliedStyle(name));default:return this.getAppliedStyle(name);}},getActual:function(name){var obj=this;var value=obj[name];var offsetName=(name.substring(0,6)=="offset")?name.substring(6).toLowerCase():"";var borderName=(offsetName)?"border-"+offsetName+"-width":"";while(obj=obj.offsetParent){if(name=="offsetTop"&&obj!==document.body)value-=obj.get('scrolltop');if(name=="offsetLeft"&&obj!==document.body)value-=obj.get('scrollleft');var borderWidth=(borderName)?parseFloat(obj.getAppliedStyle(borderName)):0;value+=obj[name]+(isNaN(borderWidth)?0:borderWidth);if(gecko&&obj.getAppliedStyle("overflow")=="hidden"){value+=isNaN(borderWidth)?0:borderWidth;}}return value;},moveTo:function(left,top){this.styleTo({left:left,top:top});},moveBy:function(left,top){this.moveTo((left!=null)?this.get("left")+left:left,(top!=null)?this.get("top")+top:top);},sizeTo:function(width,height){this.styleTo({width:(width<0)?0:width,height:(height<0)?0:height});},sizeBy:function(width,height){this.sizeTo((width!=null)?this.get("width")+width:width,(height!=null)?this.get("height")+height:height);},clipTo:function(clipTop,clipRight,clipBottom,clipLeft){var clip=this.get("clip",true);if(clipTop!=null)clip[0]=(clipTop=="auto")?"auto":clipTop+"px";if(clipRight!=null)clip[1]=(clipRight=="auto")?"auto":clipRight+"px";if(clipBottom!=null)clip[2]=(clipBottom=="auto")?"auto":clipBottom+"px";if(clipLeft!=null)clip[3]=(clipLeft=="auto")?"auto":clipLeft+"px";this.style.clip="rect("+clip[0]+" "+clip[1]+" "+clip[2]+" "+clip[3]+")";},clipBy:function(clipTop,clipRight,clipBottom,clipLeft){var clip=this.get("clip",false);clipTop=parseFloat(clipTop);clipRight=parseFloat(clipRight);clipBottom=parseFloat(clipBottom);clipLeft=parseFloat(clipLeft);clipTop=(clipTop)?clipTop+((clip[0]=="auto")?0:parseFloat(clip[0])):clip[0];clipRight=(clipRight)?clipRight+((clip[1]=="auto")?this.scrollWidth:parseFloat(clip[1])):clip[1];clipBottom=(clipBottom)?clipBottom+((clip[2]=="auto")?this.scrollHeight:parseFloat(clip[2])):clip[2];clipLeft=(clipLeft)?clipLeft+((clip[3]=="auto")?0:parseFloat(clip[3])):clip[3];this.clipTo(clipTop,clipRight,clipBottom,clipLeft);},blendTo:function(opacity){if(!isNumber(opacity))return;this.style.opacity=opacity/100;if(ie)this.style.filter="alpha(opacity="+opacity+")";},blendBy:function(opacity){this.blendTo((this.get("opacity")*100)+opacity);},hide:function(){this.style.visibility="hidden";if(this.getAppliedStyle("display")!="none"){this.previousDisplayCSS=this.getAppliedStyle("display");this.style.display="none";}},show:function(){this.style.visibility="visible";if(this.getAppliedStyle("display")=="none"){this.style.display=(this.previousDisplayCSS)?this.previousDisplayCSS:"block";}SOAPI.Event.triggerEvent("sizechange",this,null,false,true);SOAPI.Event.triggerEvent("contentchange",this,null,true);},visibilityTo:function(visible){this[(visible)?"show":"hide"]();},isVisible:function(){return!(this.getAppliedStyle("visibility")=="hidden"||this.getAppliedStyle("display")=="none");},toggleVisibility:function(){this[(this.isVisible())?"hide":"show"]();},classNames:function(){return this.className.split(/\s+/);},hasClassName:function(className){return(this.className&&this.className.match(new RegExp("(^|\\s)"+className+"(\\s|$)")))?true:false;},addClassName:function(className){if(this.hasClassName(className))return;this.className+=(this.className?" ":"")+className;},removeClassName:function(className){this.className=this.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)")," ").trim();},toggleClassName:function(className){this[(this.hasClassName(className))?"removeClassName":"addClassName"](className);},styleTo:function(name,value){var px={"width":true,"height":true,"left":true,"right":true,"top":true,"bottom":true};var pos={"width":true,"height":true};var scroll={"scrollTop":true,"scrollLeft":true};var styles=isObject(name)?name:{};if(!isObject(name))styles[name]=value;for(var i in styles){if(styles[i]==null||isUnNumber(styles[i]))continue;if(pos[i]&&styles[i]<0)styles[i]=0;if(scroll[i])this[i]=styles[i];else this.style[i]=styles[i]+((isNumber(styles[i])&&px[i])?"px":"");}},styleBy:function(name,value){var styles=isObject(name)?name:{};if(!isObject(name))styles[name]=value;for(var i in styles){if(isNumber(styles[i]))styles[i]+=this.get(i);}this.styleTo(styles);},write:function(html,append,position){position=position||"beforeend";if(append)this.insertAdjacentHTML(position,html);else this.innerHTML=html;}});SOAPI.Ajax={threads:[],queue:[],limit:3,loadIndicator:null,_404_ERROR:"The request URL was unreachable",_AJAX_FAIL:"Unable to create the AJAX request",_EMPTY_URL:"No request provided",_TYPE_GET:"GET",_TYPE_POST:"POST",_ENCTYPE_URLENCODED:"application/x-www-form-urlencoded",_ENCTYPE_MULTI:"multipart/form-data",setup:function(){this.threads=[];for(var i=0;i<=this.limit-1;i++){this.threads[i]={ajax:null,request:null,updating:false,timerOn:false,slow:false};}},request:function(properties){if(this.threads.length!=this.limit)this.setup();var r={url:null,data:"",dataType:this._TYPE_GET,onSuccess:function(){},onError:function(e){console.log(e);},onUploadEvents:null,executeResponse:false,DOMReference:[],showProgress:true,multipart:false};if(isObject(properties)){for(var pName in properties)r[pName]=properties[pName];if(properties.dataType)r.dataType=properties.dataType.toUpperCase();if(properties.multipart)r.boundary=Date.now().toString(16);if(isObject(r.data)&&(typeof FormData=="undefined"||r.data.constructor!==FormData)){r.data="";if(typeof properties.data.join!=="undefined"){r.data=properties.data.join("&")+"&";}else {for(var key in properties.data)r.data+=key+'='+encodeURIComponent(properties.data[key])+"&";}}else {r.data=properties.data||"";}for(var i=0;isettings.frameMax)||(settings.frameMin!=null&&animation.framesettings.stepLimit)){return this.doActions(aIndex);}for(var pName in properties)properties[pName].jumpBy(settings.direction,settings.repeat);for(var pName in custom)custom[pName].jumpBy(settings.direction,settings.repeat);animation.updated=false;if(!this.Update(aIndex))return this.doActions(aIndex);function timer(animator,aIndex){return function(){animator.runAnimation(aIndex);};}animation.timer=setTimeout(timer(this,aIndex),settings.interval.jumpBy(settings.direction,settings.repeat));},doActions:function(aIndex){this.Pause(aIndex);for(var i=0,action;action=this.animations[aIndex].settings.action[i];i++){if(isFunction(action))action();if(isString(action))eval(action);if(isArray(action)){for(var key in action)eval(action[key]);}}},Play:function(aIndex){if(this.animations[aIndex].busy)return;this.animations[aIndex].busy=true;this.runAnimation(aIndex);},PlayAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Play(aIndex);},Stop:function(aIndex){this.Pause(aIndex);this.Reset(aIndex);},StopAll:function(){this.PauseAll();this.ResetAll();},Pause:function(aIndex){this.animations[aIndex].busy=false;clearTimeout(this.animations[aIndex].timer);},PauseAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Pause(aIndex);},Reset:function(aIndex){var animation=this.animations[aIndex];var properties=animation.properties;var settings=animation.settings;var custom=animation.custom;animation.frame=0;animation.step=1;for(var pName in properties)properties[pName].jumpTo(0);for(var pName in custom)custom[pName].jumpTo(0);settings.interval.jumpTo(0);},ResetAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Reset(aIndex);},Reverse:function(aIndex){this.animations[aIndex].settings.direction*=-1;},ReverseAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Reverse(aIndex);},JumpTo:function(aIndex,frame){var animation=this.animations[aIndex];var properties=animation.properties;var settings=animation.settings;var custom=animation.custom;animation.frame=frame;for(var pName in properties)properties[pName].jumpTo(frame,settings.repeat);for(var pName in custom)custom[pName].jumpTo(frame,settings.repeat);settings.interval.jumpTo(frame,settings.repeat);},JumpToAll:function(frame){var aIndex=this.animations.length;while(aIndex--)this.JumpTo(aIndex,frame);},JumpBy:function(aIndex,frames){var animation=this.animations[aIndex];var properties=animation.properties;var settings=animation.settings;var custom=animation.custom;animation.frame+=frames;for(var pName in properties)properties[pName].jumpBy(frames,settings.repeat);for(var pName in custom)custom[pName].jumpBy(frames,settings.repeat);settings.interval.jumpBy(frames,settings.repeat);},JumpByAll:function(frames){var aIndex=this.animations.length;while(aIndex--)this.JumpBy(aIndex,frames);},Update:function(aIndex){var animation=this.animations[aIndex];var properties=animation.properties;var settings=animation.settings;var custom=animation.custom;var p={};var values=0;var method=(settings.relative)?"By":"To";if(settings.relative&&animation.updated)return;for(var pName in properties){p[pName]=properties[pName].current();if(p[pName]!=null)values++;}if(p.clipTop!=null||p.clipRight!=null||p.clipBottom!=null||p.clipLeft!=null){this.parentNode["clip"+method](p.clipTop,p.clipRight,p.clipBottom,p.clipLeft);}if(p.width!=null||p.height!=null)this.parentNode["size"+method](p.width,p.height);if(p.left!=null||p.top!=null)this.parentNode["move"+method](p.left,p.top);if(p.opacity!=null)this.parentNode["blend"+method](p.opacity);for(var pName in custom){var value=custom[pName].current();if(value==null)continue;values++;this.parentNode["style"+method](pName,value);}animation.updated=true;return values;},UpdateAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Update(aIndex);},Clear:function(aIndex){this.Stop(aIndex);this.animations[aIndex]=null;},ClearAll:function(){var aIndex=this.animations.length;while(aIndex--)this.Clear(aIndex);}});SOAPI.widgets.panel=function(p){new SOAPI.Panel(p);};SOAPI.Panel=SOAPI.Widget.extension();SOAPI.Panel.extend({wtype:"panel",setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;w._write=SOAPI.Sprite.prototype.write;if(p.pieces&1){c.content=this.createComponent({element:p.element,parent:w,cType:"content"},true);}return result;},configure:function(){if(this.hasAttribute("text"))this.write(this.getAttribute("text"),true,"afterbegin");this.removeAttribute("text");},write:function(html,append,position){if(this.components.content){this.components.content.write(html,append,position);}else {this._write(html,append,position);}}});SOAPI.Events.action=["onAction"];SOAPI.Events.onAction=function(event){return true};SOAPI.widgets.button=function(p){new SOAPI.Button(p);};SOAPI.Button=SOAPI.Panel.extension();SOAPI.Button.extend({wtype:"button",parameters:SOAPI.merge(SOAPI.Panel.prototype.parameters,{tabindex:0,action:""}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Button_Handlers;w.setAttribute("tabindex",p.tabindex);w.setAttribute("state","default");SOAPI.Event.addEventHandler(w,"mousedown",handlers.onMouseDown,"Button");SOAPI.Event.addEventHandler(w,"mouseup",handlers.onMouseUp,"Button");SOAPI.Event.addEventHandler(w,"mouseup",handlers.onMouseUpAction,"Action");SOAPI.Event.addEventHandler(w,"mouseover",handlers.onMouseOver,"Button");SOAPI.Event.addEventHandler(w,"mouseout",handlers.onMouseOut,"Button");SOAPI.Event.addEventHandler(w,"keydown",handlers.onKeyDown,"Button");SOAPI.Event.addEventHandler(w,"action");SOAPI.Event.addEventHandler(w,"focus",w.onFocus,"Widget");SOAPI.Event.addEventHandler(w,"blur",w.onBlur,"Widget");if(w.hasAttribute("onaction")){eval("var func = function(event) {"+w.getAttribute("onaction")+"}");SOAPI.Event.addEventHandler(w,"action",func,"Attribute");w.removeAttribute("onaction");}if(p.pieces&4096){var icon=c.icon=this.createComponent({element:p.element,parent:w,cType:"icon"});}return result;},getValue:function(){var value=this.getAttribute("value");return(value===""||isNaN(value)?value:Number(value));},getText:function(){return this.innerText||this.textContent;}});SOAPI.Button_Handlers={onMouseOver:function(event){this.setAttribute("state","over");event.stopPropagation();return true;},onMouseOut:function(event){this.setAttribute("state","default");event.stopPropagation();return true;},onMouseDown:function(event){this.setAttribute("state","down");event.stopPropagation();return true;},onMouseUp:function(event){this.setAttribute("state","over");event.stopPropagation();return true;},onMouseUpAction:function(event){SOAPI.Event.triggerEvent("action",this);return true;},onKeyDown:function(event){var e=event.event;if(e.keyCode==32){event.stopPropagation();event.preventDefault();SOAPI.Event.triggerEvent("mouseup",this);return false;}return true;}};SOAPI.Events.minimize=["onMinimize"];SOAPI.Events.maximize=["onMaximize"];SOAPI.Events.restore=["onRestore"];SOAPI.Events.close=["onClose"];SOAPI.Events.onMinimize=function(event){return true};SOAPI.Events.onMaximize=function(event){return true};SOAPI.Events.onRestore=function(event){return true};SOAPI.Events.onClose=function(event){return true};SOAPI.widgets.window=function(p){new SOAPI.Window(p);};SOAPI.Window=SOAPI.Panel.extension();SOAPI.Window.extend({wtype:"window",ctypes:{titlebar:SOAPI.Panel,task:SOAPI.Button,minimize:SOAPI.Button,maximize:SOAPI.Button,close:SOAPI.Button},draggable:true,parameters:SOAPI.merge(SOAPI.Panel.prototype.parameters,{tabindex:0,resizeable:"false",taskbar:"true"}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Window_Handlers;w.setAttribute("resizeable",p.resizeable!="false");w.setAttribute("taskbar",p.taskbar!="false");w.setAttribute("state","default");w.dragger.enabled=p.resizeable!="false";w.dragger.removePartner(w);SOAPI.Event.addEventHandler(w,"mousedown",handlers.onMouseDown,"Window");SOAPI.Event.addEventHandler(w,"mouseup");SOAPI.Event.addEventHandler(w,"focus",w.onFocus,"Widget");SOAPI.Event.addEventHandler(w,"focus",handlers.onFocus,"Window");SOAPI.Event.addEventHandler(w,"blur",w.onBlur,"Widget");SOAPI.Event.addEventHandler(w,"blur",handlers.onBlur,"Window");SOAPI.Event.addEventHandler(w,"drag");SOAPI.Event.addEventHandler(w,"dragstart",handlers.onDragStart,"Window");SOAPI.Event.addEventHandler(w,"dragend",handlers.onDragEnd,"Window");SOAPI.Event.addEventHandler(w,"minimize",handlers.onMinimize,"Window");SOAPI.Event.addEventHandler(w,"maximize",handlers.onMaximize,"Window");SOAPI.Event.addEventHandler(w,"restore",handlers.onRestore,"Window");SOAPI.Event.addEventHandler(w,"close",handlers.onClose,"Window");var content=c.content=this.createComponent({element:p.element,parent:w,cType:"content"},true);SOAPI.Event.addEventHandler(content,"mousedown",handlers.content.onMouseDown,"Window");SOAPI.Event.addEventHandler(content,"mouseup",handlers.content.onMouseUp,"Window");var titlebar=c.titlebar=this.createComponent({element:p.element,parent:w,cType:"titlebar"},true,true);titlebar.dragger.enabled=true;titlebar.dragger.removePartner(titlebar);titlebar.dragger.addPartner(w,{left:1},{top:1});SOAPI.Event.addEventHandler(titlebar,"mousedown",handlers.titlebar.onMouseDown,"Window");SOAPI.Event.addEventHandler(titlebar,"mouseup");SOAPI.Event.addEventHandler(titlebar,"drag");SOAPI.Event.addEventHandler(titlebar,"dragstart",handlers.titlebar.onDragStart,"Window");SOAPI.Event.addEventHandler(titlebar,"dragend",handlers.titlebar.onDragEnd,"Window");if(w.getAttribute("taskbar")!="false"){var task=c.task=this.createComponent({element:p.element,parent:w,cType:"task",extras:{"class":w.className}});SOAPI.Event.addEventHandler(task,"mouseup",handlers.task.onMouseUp,"Window",["before Action"]);SOAPI.Event.addEventHandler(task,"mousedown",handlers.task.onMouseDown,"Window");SOAPI.Event.addEventHandler(task,"focus",handlers.task.onFocus,"Window",["before onFocus"]);}var minimize=c.minimize=this.createComponent({element:p.element,parent:w,cType:"minimize"});SOAPI.Event.addEventHandler(minimize,"mouseup",handlers.minimize.onMouseUp,"Window",["before Action"]);var maximize=c.maximize=this.createComponent({element:p.element,parent:w,cType:"maximize"});SOAPI.Event.addEventHandler(maximize,"mouseup",handlers.maximize.onMouseUp,"Window",["before Action"]);var close=c.close=this.createComponent({element:p.element,parent:w,cType:"close"});SOAPI.Event.addEventHandler(close,"mouseup",handlers.close.onMouseUp,"Window",["before Action"]);if(p.pieces&4096){var icon=c.icon=this.createComponent({element:p.element,parent:w,cType:"icon"});}if(p.pieces&8192){var gripper=c.gripper=this.createComponent({element:p.element,parent:w,cType:"gripper"});}return result;},configure:function(){var c=this.components;if(this.hasAttribute("text"))c.titlebar.write(this.getAttribute("text"),true);if(this.hasAttribute("text"))c.task.write(this.getAttribute("text"),true);if(this.getAttribute("taskbar")!="false"){var desktop=SOAPI.findParentWidget(this,"desktop");if(desktop)desktop.components.taskbar.components.content.appendChild(c.task);if(desktop)desktop.recalculateWorkspace();}function show(object){return function(){object.show();try{object.parentWidget.focus();}catch(err){}}}if(!isComponent(this)){c.content.hide();}},minimize:function(){SOAPI.Event.triggerEvent("minimize",this);},maximize:function(){SOAPI.Event.triggerEvent("maximize",this);},restore:function(){SOAPI.Event.triggerEvent("restore",this);},close:function(){SOAPI.Event.triggerEvent("close",this);}});SOAPI.Window_Handlers={onMouseDown:function(event){event.preventDefault();this.focus();return true;},onFocus:function(event){var current=SOAPI.findLastChildElement(this.parentNode,"div",{widget:"window"});if(typeof current!=="undefined"&¤t!==this){this.parentNode.insertAfter(this,current);}if(this.components.task)this.components.task.setAttribute("focused",true);return true;},onBlur:function(event){if(this.components.task)this.components.task.setAttribute("focused",false);return true;},onDragStart:function(event){var multiplyX={width:1};var multiplyY={height:1};if(SOAPI.Event.offsetX1){var forward=c.forward=this.createComponent({parent:c.dialog.components.window,widget:w,cType:'forward'});var back=c.back=this.createComponent({parent:c.dialog.components.window,widget:w,cType:'back'});forward.hide();back.hide();var win=dialog.components.window;SOAPI.Event.addEventHandler(forward,"mousedown",[w,handlers.buttons.mousedown],"Lightbox");SOAPI.Event.addEventHandler(back,"mousedown",[w,handlers.buttons.mousedown],"Lightbox");SOAPI.Event.addEventHandler(win,"mouseover",[w,handlers.win.mouseover],"Lightbox");SOAPI.Event.addEventHandler(win,"mouseout",[w,handlers.win.mouseout],"Lightbox");}SOAPI.Event.addEventHandler(directlink,"mousedown",[w,handlers.directlink.mousedown],"Lightbox");if(dialog.components.window.components.icon)dialog.components.window.components.icon.hide();if(w.hasAttribute("isDraggroup")&&w.getAttribute("isDraggroup")=="true"){w.allowPreview=false;SOAPI.Event.addEventHandler(w,"keydown",handlers.lightbox.keydown,"Lightbox");SOAPI.Event.addEventHandler(w,"keyup",handlers.lightbox.keyup,"Lightbox");SOAPI.Event.addEventHandler(w,"blur",handlers.lightbox.blur,"Lightbox");}var content=dialog.components.window.components.content;image.onload=function(){if(!dialog.isVisible()){dialog.activate();}else {dialog.resizePositionAndShow();}image.setAttribute("fadein",true);};this.checkHash();}return result;},checkHash:function(){var ln=this.galleryElements.length;var hash=window.location.hash;var obj=this;function show(){while(ln--){if(hash=="#"+obj.galleryElements[ln].directlink){obj.currentElement=ln;obj.displayImage();}}}setTimeout(show,1000);},displayImage:function(){var element=this.galleryElements[this.currentElement];var src=element.getAttribute("lightboxlink");if(src===null)return;var dialog=this.components.dialog;var content=dialog.components.window.components.content;var title=this.components.title;var description=this.components.description;var image=this.components.image;image.setAttribute("fadein",false);title.write(element.getAttribute("title")||"");description.write(element.getAttribute("description")||"");image.src=src;}});SOAPI.LightBox_Handlers={lightbox:{keydown:function(event){event.stopPropagation();event.preventDefault();var keyCode=event.event.keyCode;if(keyCode==224||keyCode==17){this.allowPreview=true;}return true;},keyup:function(event){this.allowPreview=false;return true;},blur:function(event){this.allowPreview=false;return true;}},galleryElement:{mousedown:function(event){this.focus();if(this.allowPreview){this.currentElement=this.galleryElements.indexOf(event.element);this.displayImage();}return true;}},buttons:{mousedown:function(event){var element=event.element;this.currentElement+=isComponent(element,"forward")?-1:1;if(this.currentElement==this.galleryElements.length)this.currentElement=0;if(this.currentElement==-1)this.currentElement=(this.galleryElements.length-1);this.displayImage();return true;}},win:{mouseover:function(event){this.components.back.show();this.components.forward.show();return true;},mouseout:function(event){this.components.back.hide();this.components.forward.hide();return true;}},directlink:{mousedown:function(event){window.location.hash=this.galleryElements[this.currentElement].directlink;return true;}}};SOAPI.Validator={NO_FILTER:0,UPPERCASE:1,LOWERCASE:2,ALPHABETIC:3,NUMERIC:4,ALPHANUMERIC:7,ALL:7,definitions:{},addDefinition:function(name,parameters){var p={filters:this.NO_FILTER,custom:"",description:"",actionBefore:null,actionAfter:null};for(var pName in parameters)p[pName]=parameters[pName];this.definitions[name]=p;},validateKey:function(object,event,definition,maxlength){var e=event.event;var keyCode=e.keyCode;var charCode=e.charCode||e.keyCode;if(!keyCode&&!charCode)return true;if((opera&&(!e.which||keyCode==16||keyCode==17))||(!ie&&!opera&&!webkit&&(keyCode==8||keyCode==9||keyCode==13||keyCode==35||keyCode==36||keyCode==46||(keyCode>=37&&keyCode<=40)||(charCode==120&&e.ctrlKey)||(charCode==99&&e.ctrlKey)))){return true;}if((charCode==118&&e.ctrlKey)){function validate(object,definition,maxlength){return function(){object.value=SOAPI.Validator.validateText(object.value,definition,maxlength);};}this.timer=setTimeout(validate(object,definition,maxlength),0);return true;}var selectionStart=object.selectionStart;var selectionEnd=object.selectionEnd;if(object.value.length>=maxlength&&(ie||selectionStart==selectionEnd)){event.preventDefault();return 0;}var keyChar=String.fromCharCode(charCode);var newKeyChar=this.validateText(keyChar,definition);if(!newKeyChar){event.preventDefault();return false;}if(ie){if(newKeyChar!=keyChar)e.keyCode=newKeyChar.charCodeAt(0);return true;}if(newKeyChar!=keyChar){object.value=object.value.substring(0,selectionStart)+newKeyChar+object.value.substring(selectionEnd);object.setSelectionRange(selectionStart+newKeyChar.length,selectionStart+newKeyChar.length);event.preventDefault();}return true;},validateText:function(text,definition,maxlength){var definition=this.definitions[definition];if(!definition)return text;if(definition.actionBefore)text=this.executeAction(definition.actionBefore,text);var validText="";for(var i=0;i64&&charCode<91))||(((definition.filters&this.LOWERCASE)==this.LOWERCASE)&&(charCode>96&&charCode<123))||(((definition.filters&this.NUMERIC)==this.NUMERIC)&&(charCode>47&&charCode<58))||(definition.custom.indexOf(text.charAt(i))!==-1)){validText+=text.charAt(i);}}if(definition.actionAfter)validText=this.executeAction(definition.actionAfter,validText);return(maxlength)?validText.substring(0,maxlength):validText;},executeAction:function(action,data){if(isFunction(action))return action(data);if(isString(action))eval(action);if(isArray(action)){for(var key in action)eval(action[key]);}return data;}};{var valid=SOAPI.Validator;valid.addDefinition("Alphabetic",{filters:valid.ALPHABETIC,custom:"",description:"A-Z and a-z only"});valid.addDefinition("Alphabetic_S",{filters:valid.ALPHABETIC,custom:" ",description:"A-Z, a-z, and space only"});valid.addDefinition("Alphanumeric",{filters:valid.ALPHANUMERIC,custom:"",description:"A-Z, a-z, and 0-9 only"});valid.addDefinition("Alphanumeric_S",{filters:valid.ALPHANUMERIC,custom:" ",description:"A-Z, a-z, 0-9, and space only"});valid.addDefinition("Any",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~",description:"all characters except ' and \""});valid.addDefinition("Any_BQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~'\"",description:"all characters"});valid.addDefinition("Any_DQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~\"",description:"all characters except '"});valid.addDefinition("Any_Multi",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~\t\r\n",description:"all characters except ' and \""});valid.addDefinition("Any_Multi_BQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~'\"\t\r\n",description:"all characters"});valid.addDefinition("Any_Multi_DQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~\"\t\r\n",description:"all characters except '"});valid.addDefinition("Any_Multi_SQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~'\t\r\n",description:"all characters except \""});valid.addDefinition("Any_SQ",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()*+,-./:;<=>?@[\\]^_`{|}~'",description:"all characters except \""});valid.addDefinition("Boolean",{filters:valid.NO_FILTER,custom:"01",description:"0 and 1 only"});valid.addDefinition("Date",{filters:valid.ALPHANUMERIC,custom:" ,-./:",description:"A-Z, a-z, 0-9, space, and ,-./: only"});valid.addDefinition("Decimal",{filters:valid.NUMERIC,custom:".",description:"0-9 and . only"});valid.addDefinition("Decimal_S",{filters:valid.NUMERIC,custom:" .",description:"0-9, space, and . only"});valid.addDefinition("Email",{filters:valid.LOWERCASE|valid.NUMERIC,custom:".-@_",description:"a-z, 0-9, and .-@_ only",actionBefore:'data=data.toLowerCase()'});valid.addDefinition("Filename",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()+,-.;=@[]^_`{}~'",description:"all characters except \\/:*?\"<>|"});valid.addDefinition("Filepath",{filters:valid.ALPHANUMERIC,custom:" !#\u00A3$%&()+,-./;=@[]^_`{}~'",description:"all characters except \\:*?\"<>|"});valid.addDefinition("Integer",{filters:valid.NUMERIC,custom:"-",description:"0-9 and - only"});valid.addDefinition("Integer_S",{filters:valid.NUMERIC,custom:" -",description:"0-9, space, and - only"});valid.addDefinition("Lowercase",{filters:valid.LOWERCASE,custom:"",description:"a-z only",actionBefore:'data=data.toLowerCase()'});valid.addDefinition("Lowercase_S",{filters:valid.LOWERCASE,custom:" ",description:"a-z and space only",actionBefore:'data=data.toLowerCase()'});valid.addDefinition("Number",{filters:valid.NUMERIC,custom:"-.",description:"0-9 and -. only"});valid.addDefinition("Number_S",{filters:valid.NUMERIC,custom:" -.",description:"0-9, space, and -. only"});valid.addDefinition("Numeric",{filters:valid.NUMERIC,custom:"",description:"0-9 only"});valid.addDefinition("Numeric_S",{filters:valid.NUMERIC,custom:" ",description:"0-9 and space only"});valid.addDefinition("Uppercase",{filters:valid.UPPERCASE,custom:"",description:"A-Z only",actionBefore:'data=data.toUpperCase()'});valid.addDefinition("Uppercase_S",{filters:valid.UPPERCASE,custom:" ",description:"A-Z and space only",actionBefore:'data=data.toUpperCase()'});valid.addDefinition("URL",{filters:valid.ALPHANUMERIC,custom:";/?:@=&#%$-_.+!*'(),",description:"A-Z, a-z, 0-9, and ;/?:@=&#%$-_.+!*'(), only"});valid.addDefinition("URLSegment",{filters:valid.ALPHANUMERIC,custom:"$-_.+!*'(),",description:"A-Z, a-z, 0-9, and $-_.+!*'(), only"});valid.addDefinition("Variable_PHP",{filters:valid.ALPHANUMERIC,custom:"_",description:"A-Z, a-z, 0-9, and _ only"});}SOAPI.widgets.textbox=function(p){new SOAPI.Textbox(p);};SOAPI.Textbox=SOAPI.Widget.extension();SOAPI.Textbox.extend({wtype:"textbox",tooltip:null,parameters:SOAPI.merge(SOAPI.Widget.prototype.parameters,{tabindex:0,value:"",tooltip:"",password:"false"}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Textbox_Handlers;w.setAttribute("tabindex","-1");w.setAttribute("password",p.password!="false");if(p.tooltip!=="")w.tooltip=$(p.tooltip)||null;SOAPI.Event.addEventHandler(w,"focus",w.onFocus,"Widget");SOAPI.Event.addEventHandler(w,"blur",w.onBlur,"Widget");SOAPI.Event.addEventHandler(w,"focus",handlers.onFocus,"Textbox");SOAPI.Event.addEventHandler(w,"blur",handlers.onBlur,"Textbox");var type=(p.password=="false")?"text":"password";var textbox=c.textbox=this.createComponent({element:p.element,parent:w,cType:"textbox",eType:"input",extras:{name:w.getAttribute("name"),tabindex:p.tabindex,value:p.value,type:type},criteria:{type:type}},true);textbox.disabled=!w.isUsable();textbox.write=handlers.textbox.write;SOAPI.Event.addEventHandler(textbox,"focus",w.onFocus,"Widget");SOAPI.Event.addEventHandler(textbox,"blur",w.onBlur,"Widget");SOAPI.Event.addEventHandler(textbox,"keypress",handlers.textbox.onKeyPress,"Textbox");SOAPI.Event.addEventHandler(textbox,"change",handlers.textbox.onChange,"Textbox");return result;},write:function(html,append,position){this.components.textbox.write(html,append,position);},allow:function(){this.callParent(arguments.callee,"allow");this.components.textbox.disabled=this.isDisabled;},deny:function(){this.callParent(arguments.callee,"deny");this.components.textbox.disabled=true;},getValue:function(){return this.components.textbox.value;},setValue:function(value){this.components.textbox.value=value;}});SOAPI.Textbox_Handlers={onFocus:function(event){this.components.textbox.focus();return true;},onBlur:function(event){if(this.tooltip!==null)this.tooltip.deactivate(this);return true;},textbox:{write:function(text,append){this.value=(append)?this.value+text:text;},onKeyPress:function(event){var parentWidget=this.parentWidget;var valid=(parentWidget.getAttribute("filter"))?SOAPI.Validator.validateKey(this,event,parentWidget.getAttribute("filter"),parentWidget.getAttribute("maxlength")):true;if(!valid&&parentWidget.tooltip!==null){parentWidget.tooltip.write((valid===false)?"Invalid character entered.
"+"The characters allowed are:
"+SOAPI.Validator.definitions[parentWidget.getAttribute("filter")].description:"Maximum length reached.
"+"Only "+parentWidget.getAttribute("maxlength")+" characters are allowed in this field.");parentWidget.tooltip.activate(parentWidget);}return valid;},onChange:function(event){if(this.parentWidget.getAttribute("filter")){this.value=SOAPI.Validator.validateText(this.value,this.parentWidget.getAttribute("filter"),this.parentWidget.getAttribute("maxlength"));}return true;}}};SOAPI.Events.scrollstart=["onScrollStart"];SOAPI.Events.scrollend=["onScrollEnd"];SOAPI.Events.onScrollStart=function(event){return true};SOAPI.Events.onScrollEnd=function(event){return true};SOAPI.widgets.scrollbar=function(p){new SOAPI.Scrollbar(p);};SOAPI.Scrollbar=SOAPI.Widget.extension();SOAPI.Scrollbar.extend({wtype:"scrollbar",ctypes:{track:SOAPI.Panel,upleft:SOAPI.Button,downright:SOAPI.Button,handle:SOAPI.Button},orientation:"horizontal",initialDelay:500,repeatDelay:50,timer:null,initialDone:false,active:false,distanceFactor:20,partners:null,min:0,max:100,position:0,slice:10,ratio:1,trackStart:0,trackSize:100,handleSize:10,scrollpropagate:null,parameters:SOAPI.merge(SOAPI.Widget.prototype.parameters,{orientation:"horizontal",scrollpropagate:false}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Scrollbar_Handlers;var vertical=(p.orientation=="vertical");w.orientation=(vertical)?"vertical":"horizontal";w.scrollpropagate=(p.scrollpropagate==="true");w.setAttribute("orientation",w.orientation);SOAPI.Event.addEventHandler(w,"mousewheel",handlers.onMouseWheel,"Scrollbar");SOAPI.Event.addEventHandler(w,"scrollstart",handlers.onScrollStart,"Scrollbar");SOAPI.Event.addEventHandler(w,"scrollend",handlers.onScrollEnd,"Scrollbar");SOAPI.Event.addEventHandler(w,"contentchange",handlers.onContentChange,"Scrollbar");var track=c.track=this.createComponent({element:p.element,parent:w,cType:"track"});SOAPI.Event.addEventHandler(track,"mousedown",handlers.track.onMouseDown,"Scrollbar");SOAPI.Event.addEventHandler(track,"mouseup",handlers.track.onMouseUp,"Scrollbar");SOAPI.Event.addEventHandler(track,"mouseout",handlers.track.onMouseOut,"Scrollbar");var upleft=c.upleft=this.createComponent({element:p.element,parent:w,cType:"upleft"});upleft.setAttribute("tabindex","");SOAPI.Event.addEventHandler(upleft,"mousedown",handlers.upleft.onMouseDown,"Scrollbar");SOAPI.Event.addEventHandler(upleft,"mouseup",handlers.upleft.onMouseUp,"Scrollbar",["before Action"]);SOAPI.Event.addEventHandler(upleft,"mouseout",handlers.upleft.onMouseOut,"Scrollbar");var downright=c.downright=this.createComponent({element:p.element,parent:w,cType:"downright"});downright.setAttribute("tabindex","");SOAPI.Event.addEventHandler(downright,"mousedown",handlers.downright.onMouseDown,"Scrollbar");SOAPI.Event.addEventHandler(downright,"mouseup",handlers.downright.onMouseUp,"Scrollbar",["before Action"]);SOAPI.Event.addEventHandler(downright,"mouseout",handlers.downright.onMouseOut,"Scrollbar");var handle=c.handle=this.createComponent({element:p.element,parent:w,cType:"handle"},true,true);handle.minSize=10;handle.dragger.enabled=true;handle.dragger.restrict=true;handle.dragger.removePartner(handle);handle.dragger.addPartner(handle,(vertical)?null:{left:1},(vertical)?{top:1}:null,true);handle.setAttribute("tabindex","");SOAPI.Event.addEventHandler(handle,"mouseover",handlers.handle.onMouseOver,"Scrollbar",["after onMouseOver"]);SOAPI.Event.addEventHandler(handle,"mouseout",handlers.handle.onMouseOut,"Scrollbar",["after onMouseOut"]);SOAPI.Event.addEventHandler(handle,"mousedown",handlers.handle.onMousedown,"Scrollbar");SOAPI.Event.addEventHandler(handle,"dragstart",handlers.handle.onDragStart,"Scrollbar");SOAPI.Event.addEventHandler(handle,"dragend",handlers.handle.onDragEnd,"Scrollbar");SOAPI.Event.addEventHandler(handle,"drag",handlers.handle.onDrag,"Scrollbar");w.partners=[];return result;},configure:function(){this.recalculateScrollProperties(0,500,0,100);},addPartner:function(sprite,property,min,max){if(isString(sprite))sprite=document.getElementById(sprite);this.partners.push({sprite:sprite,property:property,min:min,max:max});},removePartner:function(sprite,property){if(isString(sprite))sprite=document.getElementById(sprite);var i=this.partners.length;while(i--){if(this.partners[i].sprite===sprite&&(property==null||this.partners[i].property==property)){this.partners.splice(i,1);}}},recalculateScrollProperties:function(min,max,position,slice){var vertical=(this.orientation=="vertical");var track=this.components.track;var handle=this.components.handle;var trackStart=(vertical)?track.get("top"):track.get("left");var trackSize=(vertical)?track.get("height"):track.get("width");var handleStart=(vertical)?handle.get("top"):handle.get("left");var area=max-min;this.max=max;this.min=min;this.position=position/(area-slice);this.slice=slice/area;this.ratio=area/trackSize;this.trackStart=trackStart;this.trackSize=trackSize;var handleSize=Math.round(trackSize*this.slice);if(this.position<0)this.position=0;if(this.position>1)this.position=1;if(handleSizetrackSize)handleSize=trackSize;handle.visibilityTo(handleSize!=trackSize);handle.styleTo((vertical)?"height":"width",handleSize);this.handleSize=handleSize;var trackArea=trackSize-handleSize;var property=(vertical)?"top":"left";handle.dragger.removeRestriction(property);handle.dragger.addRestriction(property,{min:trackStart,max:trackStart+trackArea});handle.styleTo(property,trackStart+this.position*trackArea);this.updateScrollPartners();},doScroll:function(direction,trackPressed,wheelUsed){var vertical=(this.orientation=="vertical");var handle=this.components.handle;var pos=(vertical)?SOAPI.Event.y:SOAPI.Event.x;var start=(vertical)?handle.get("ActualTop"):handle.get("ActualLeft");var end=start+((vertical)?handle.get("height"):handle.get("width"));var distance=this.distanceFactor/this.ratio*direction*((trackPressed)?10:1);var property="distance"+((vertical)?"Y":"X");handle[property]=(trackPressed&&!(direction<0&&pos0&&pos>end))?0:distance;if(handle[property])SOAPI.Events.doDrag(handle,handle.dragger.partners,false);if(handle[property])SOAPI.Events.doDrag(handle,handle.dragger.partners,true);if(handle[property])this.updateScrollPosition();if(this.active&&this.isUsable()){function timer(scrollbar,direction,trackPressed){return function(){scrollbar.doScroll(direction,trackPressed);};}this.timer=setTimeout(timer(this,direction,trackPressed),(this.initialDone)?this.repeatDelay:this.initialDelay);this.initialDone=true;}else {clearTimeout(this.timer);this.initialDone=false;}return true;},updateScrollPosition:function(){var handle=this.components.handle;var handleStart=(this.orientation=="vertical")?handle.get("top"):handle.get("left");this.position=(handleStart-this.trackStart)/(this.trackSize-this.handleSize);if(!isNumber(this.position))this.position=0;this.updateScrollPartners();SOAPI.Event.triggerEvent("scroll",this.parentWidget);},updateScrollPartners:function(){for(var i=this.partners.length-1;i>=0;i--){var p=this.partners[i];if(p.sprite.isSprite){p.sprite.styleTo(p.property,(p.min+(p.max-p.min)*this.position));}else {SOAPI.Sprite.prototype.styleTo.apply(p.sprite,[p.property,(p.min+(p.max-p.min)*this.position)]);}}},scrollTo:function(percent){if(!isNumber(percent))return;percent/=100;if(percent<0)percent=0;if(percent>1)percent=1;this.position=percent;this.components.handle.styleTo((this.orientation=="vertical")?"top":"left",this.trackStart+percent*(this.trackSize-this.handleSize));this.updateScrollPartners();},scrollBy:function(percent){if(!isNumber(percent))return;this.scrollTo(percent+this.position*100);},allow:function(noBubble){this.callParent(arguments.callee,"allow",arguments);this.components.handle.visibilityTo(this.handleSize!=this.trackSize);},deny:function(noBubble){this.callParent(arguments.callee,"deny",arguments);this.components.handle.hide();}});SOAPI.Scrollbar_Handlers={onMouseWheel:function(event){var modifier=event.event.shiftKey;SOAPI.Event.triggerEvent("scrollstart",this,{direction:SOAPI.Event[(this.orientation=="horizontal"&&modifier===false?"wheelDeltaX":"wheelDeltaY")],wheelUsed:true});if(this.scrollpropagate===false||(this.position!=0&&this.position!==1)){event.stopPropagation();event.preventDefault();}return true;},onScrollStart:function(event){if(event.direction!=null&&this.isUsable()){this.active=!event.wheelUsed;this.doScroll(event.direction,event.trackPressed,event.wheelUsed);}else {this.active=false;}return true;},onScrollEnd:function(event){this.active=false;this.initialDone=false;clearTimeout(this.timer);return true;},onContentChange:function(event){return event.stopPropagation()||true;},track:{onMouseDown:function(event){if(SOAPI.Event.button!=SOAPI.Event.LEFT)return true;var vertical=(this.parentWidget.orientation=="vertical");var handle=this.parentWidget.components.handle;var pos=(vertical)?SOAPI.Event.y:SOAPI.Event.x;var start=(vertical)?handle.get("ActualTop"):handle.get("ActualLeft");var end=start+((vertical)?handle.get("height"):handle.get("width"));var direction=0;if(posend)direction=1;SOAPI.Event.triggerEvent("scrollstart",this.parentWidget,{direction:direction,trackPressed:true});return true;},onMouseUp:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;},onMouseOut:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;}},handle:{onMouseOver:function(event){if(SOAPI.Event.dragActive)this.out=event.stopProcessing()&&false;return true;},onMouseOut:function(event){if(SOAPI.Event.dragActive)this.out=event.stopProcessing()||true;return true;},onMousedown:function(event){event.preventDefault();event.stopPropagation();return true;},onDragStart:function(event){SOAPI.Event.triggerEvent("scrollstart",this.parentWidget);return true;},onDrag:function(event){event.preventDefault();event.stopPropagation();this.parentWidget.updateScrollPosition();return true;},onDragEnd:function(event){if(this.out)this.out=SOAPI.Event.triggerEvent("mouseout",this)&&false;SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;}},upleft:{onMouseDown:function(event){if(SOAPI.Event.button!=SOAPI.Event.LEFT)return true;SOAPI.Event.triggerEvent("scrollstart",this.parentWidget,{direction:-1});return true;},onMouseUp:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;},onMouseOut:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;}},downright:{onMouseDown:function(event){if(SOAPI.Event.button!=SOAPI.Event.LEFT)return true;SOAPI.Event.triggerEvent("scrollstart",this.parentWidget,{direction:1});return true;},onMouseUp:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;},onMouseOut:function(event){SOAPI.Event.triggerEvent("scrollend",this.parentWidget);return true;}}};SOAPI.widgets.scrollbox=function(p){new SOAPI.Scrollbox(p);};SOAPI.Scrollbox=SOAPI.Panel.extension();SOAPI.Scrollbox.extend({wtype:"scrollbox",ctypes:{scrollbarV:SOAPI.Scrollbar,scrollbarH:SOAPI.Scrollbar},scrollpropagate:null,parameters:SOAPI.merge(SOAPI.Panel.prototype.parameters,{scrollbars:"",scrollbarH:"",scrollbarV:"",scrollpropagate:false}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Scrollbox_Handlers;w.scrollpropagate=(p.scrollpropagate==="true");if(p.scrollbars!="both"&&p.scrollbars!="none"&&p.scrollbars!="horizontal"&&p.scrollbars!="vertical"){p.scrollbars="auto";}if(p.scrollbarH!="on"&&p.scrollbarH!="off"&&p.scrollbarH!="auto"){p.scrollbarH=(p.scrollbars=="both"||p.scrollbars=="horizontal")?"on":((p.scrollbars=="none"||p.scrollbars=="vertical")?"off":"auto");}if(p.scrollbarV!="on"&&p.scrollbarV!="off"&&p.scrollbarV!="auto"){p.scrollbarV=(p.scrollbars=="both"||p.scrollbars=="vertical")?"on":((p.scrollbars=="none"||p.scrollbars=="horizontal")?"off":"auto");}w.setAttribute("scrollbars",p.scrollbars);w.setAttribute("scrollbarH",p.scrollbarH);w.setAttribute("scrollbarV",p.scrollbarV);w.setAttribute("scrollH",p.scrollbarH=="on");w.setAttribute("scrollV",p.scrollbarV=="on");SOAPI.Event.addEventHandler(w,"mousewheel",handlers.onWheelAndTouch,"Scrollbox");SOAPI.Event.addEventHandler(w,"sizechange",handlers.onSizeChange,"Scrollbox");SOAPI.Event.addEventHandler(w,"contentchange",handlers.onContentChange,"Scrollbox");var content=c.content=this.createComponent({element:p.element,parent:w,cType:"content"},true);content.write=handlers.content.write;var scrollbarV=c.scrollbarV=this.createComponent({element:p.element,parent:w,cType:"scrollbarV",parameters:{orientation:"vertical"}});var scrollbarH=c.scrollbarH=this.createComponent({element:p.element,parent:w,cType:"scrollbarH",parameters:{orientation:"horizontal"}});SOAPI.Event.addEventHandler(content,"touchstart");SOAPI.Event.addEventHandler(content,"touchmove",[w,handlers.onWheelAndTouch],"Scrollbox");return result;},configure:function(){if(this.getAttribute("scrollbarV")!="on")this.hideScrollbarV();if(this.getAttribute("scrollbarH")!="on")this.hideScrollbarH();SOAPI.Event.triggerEvent("contentchange",this);},recalculate:function(){if(!this.isUsable())return false;var content=this.components.content;var scrollbarV=this.components.scrollbarV;var scrollbarH=this.components.scrollbarH;var contentHeight=content.get("actualHeight");var contentWidth=content.get("actualWidth");var scrollHeight=content.get("scrollHeight");var scrollWidth=content.get("scrollWidth");var scrollTop=content.get("scrollTop");var scrollLeft=content.get("scrollLeft");if(scrollHeight-scrollTop"):value;this.components.textbox.write(value);this.refreshValue();},triggerChangeEvent:function(){if(this.changeTimer!==null)clearTimeout(this.changeTimer);var obj=this;this.changeTimer=setTimeout(function(){SOAPI.Event.triggerEvent("change",obj.components.value,null,true);clearTimeout(obj.changeTimer);obj.changeTimer=null;},1000);},textify:function(text){return text.replace(/\/g,"\n").replace(/<\/p>

/g,"\n").replace(/<\/div>

/g,"\n").replace(/ /g," ");}});SOAPI.Textarea_Handlers={textbox:{onChange:function(event){var pWidget=this.parentWidget;var content=pWidget.components.scrollbox.components.content;SOAPI.Event.triggerEvent("contentchange",pWidget.components.scrollbox,null,true);pWidget.triggerChangeEvent();pWidget.refreshValue();return true;},onFocus:function(event){this.parentWidget.setAttribute("focused",true);return true;},onBlur:function(event){this.parentWidget.setAttribute("focused",false);return true;}}};SOAPI.widgets.tooltip=function(p){new SOAPI.Tooltip(p);};SOAPI.Tooltip=SOAPI.Panel.extension();SOAPI.Tooltip.extend({wtype:"tooltip",point:"bottom",action:null,delay:5000,caller:null,parameters:SOAPI.merge(SOAPI.Panel.prototype.parameters,{tabindex:0,point:"bottom"}),setup:function(parameters){var result=this.callParent(arguments.callee,"setup",arguments);var p=result.p;var w=result.w;var c=w.components;var handlers=SOAPI.Tooltip_Handlers;w.point=p.point;SOAPI.Event.addEventHandler(w,"mouseup",handlers.onMouseUp,"Tooltip");SOAPI.Event.addEventHandler(w,"mouseover",handlers.onMouseOver,"Tooltip");SOAPI.Event.addEventHandler(w,"mouseout",handlers.onMouseOut,"Tooltip");SOAPI.Event.addEventHandler(w,"focus",handlers.onFocus,"Tooltip");var content=c.content=this.createComponent({element:p.element,parent:w,cType:"content"},true);if(p.pieces&4096){c.point=this.createComponent({element:p.element,parent:w,cType:"point"},true);}return result;},activate:function(caller,action){this.caller=caller;clearTimeout(this.timer);this.action=action;var parentLayer=SOAPI.findParentWidget(caller,"desktop")||SOAPI.findParentWidget(caller,"desktop").parentNode||document.body;parentLayer.appendChild(this);this.moveTo(0,0);var width=this.get("actualWidth");var height=this.get("actualHeight");if(this.point=="bottomleft"){var vertDiff=this.components.point.get("actualTBottom")-this.get("actualTBottom");var horizDiff=this.get("actualLeft")-this.components.point.get("actualLeft");var callerWidth=caller.get("actualWidth");var callerHeight=caller.get("actualHeight");var callerLRight=caller.get("actualLRight");var callerTop=caller.get("actualTop");var minWidth=(callerWidth>40)?20:callerWidth/2;var minHeight=(callerHeight>40)?20:callerHeight/2;this.moveTo(callerLRight-minWidth+horizDiff,callerTop+minHeight-height-vertDiff);}this.active=true;this.setAttribute("active",true);function close(object){return function(){object.deactivate(object.caller);}}this.timer=setTimeout(close(this),this.delay);var scrollableParent=this.caller.findScrollableParent();if(scrollableParent!=null){if(scrollableParent.eventHandlers==undefined||scrollableParent.eventHandlers.scroll==undefined||scrollableParent.eventHandlers.scroll.Tooltip==undefined){SOAPI.Event.addEventHandler(scrollableParent,"scroll",close(this),"Tooltip");}}},deactivate:function(caller,value){if(caller!==this.caller)return;if(this.action&&isFunction(this.action))this.action(value);if(this.action&&!isFunction(this.action))eval(this.action);this.action=null;this.close();this.setAttribute("active",false);},close:function(){this.active=false;return true;}});SOAPI.Tooltip_Handlers={onMouseOver:function(event){event.stopPropagation();if(this.active)this.setAttribute("active",true);clearTimeout(this.timer);return true;},onMouseOut:function(event){event.stopPropagation();if(this.active)this.setAttribute("active",true);function close(object){return function(){object.deactivate(object.caller);}}this.timer=setTimeout(close(this),this.delay);return true;},onMouseUp:function(event){event.stopPropagation();this.deactivate(this);return true;},onFocus:function(event){event.preventDefault();this.caller.focus();return false;}};