function AFLAX(C,B,D,A){if(C!=null){AFLAX.path=C}if(B!=null){AFLAX.tracing=B}if(A==undefined||A==null){A=""}this.id="aflax_obj_"+AFLAX.count++;if(D!=undefined||D==true){if(document.getElementById("flashSettings")==null&&arguments.length>0){var E="width: 215px; height: 138px; position: absolute; z-index: 100;left: -500px; top: -500px";document.write('<div id="flashSettings" style="'+E+'">Flash Settings Dialog</div>\n');AFLAX.settings=new AFLAX();AFLAX.settings.addFlashToElement("flashSettings",215,138,"#FFFFFF",A,true)}}}AFLAX.version="0.41";AFLAX.tracing=false;AFLAX.count=0;AFLAX.path="aflax.swf";AFLAX.settings=null;AFLAX.prototype.id=null;AFLAX.prototype.flash=null;AFLAX.prototype.root=null;AFLAX.prototype.stage=null;AFLAX.prototype.getHTML=function(A,G,I,F,H,B){var C=new com.deconcept.PlayerVersion([8,0,0]);var E=com.deconcept.FlashObjectUtil.getPlayerVersion();if(E.versionIsValid(C)==false){return"<div style='border:2px solid #FF0000'>To see this contents you need to install <a target='_blank' href='http://www.macromedia.com/go/getflashplayer'>Flash Player</a> version 8.0 or higher.</div>"}I=I||"#FFFFFF";F=F||"_none_";var D='<object width="'+A+'" height="'+G+'" id="'+this.id+'" type="application/x-shockwave-flash" data="'+AFLAX.path+(F?("?callback="+F):"")+'"';if(B){D+='style="position: absolute"'}D+='><param name="allowScriptAccess" value="always" /><param name="bgcolor" value="'+I+'" /><param name="movie" value="'+AFLAX.path+(F?("?callback="+F):"")+'" /><param name="scale" value="noscale" /><param name="salign" value="lt" />';if(H){D+='<param name="wmode" value="transparent" />'}D+="</object>";if(AFLAX.tracing){D+='<div style="border:1px solid #ddd;padding: 4px;background-color: #fafafa;font-size: 8pt;" id="aflaxlogger"></div>'}return D};AFLAX.prototype.addFlashToElement=function(C,B,H,J,G,I){var E=typeof C=="string"?document.getElementById(C):C;var F=this.getHTML(B,H,J,G,I);var A=document.createElement("div");A.innerHTML=F;var D=A.removeChild(A.firstChild);while(E.firstChild){E.removeChild(E.firstChild)}E.appendChild(D);return D};AFLAX.prototype.insertFlash=function(D,A,C,G,F,B){var E=this.getHTML(D,A,C,G,F,B);document.write(E);if(AFLAX.tracing){AFLAX.trace("AFLAX Logger initialized.")}return document.getElementById(this.id)};AFLAX.prototype.getRoot=function(){if(this.root==null){this.root=new AFLAX.MovieClip(this,null,"_root")}return this.root};AFLAX.prototype.getStage=function(){if(this.stage==null){this.stage=new AFLAX.MovieClip(this,null,"_stage");this.stage.exposeProperty("width",this.stage);this.stage.exposeProperty("height",this.stage);this.stage.exposeProperty("scaleMode",this.stage);this.stage.exposeProperty("showMenu",this.stage);this.stage.exposeProperty("align",this.stage)}return this.stage};AFLAX.prototype.getFlash=function(){if(this.flash==null){this.flash=document[this.id]}return this.flash};AFLAX.returnsHash={"true":true,"false":false,"undefined":undefined,"null":null,"NaN":NaN};AFLAX.prototype.callFunction=function(B){var A=this.getFlash().CallFunction('<invoke name="'+B+'" returntype="javascript">'+__flash__argumentsToXML(arguments,1)+"</invoke>");if(AFLAX.returnsHash.hasOwnProperty(A)){A=AFLAX.returnsHash[A]}else{if(A.charAt(0)=='"'){if(A.charAt(A.length-1)=='"'){A=A.substring(1,A.length-1)}}else{A=A-0}}return A};AFLAX.prototype.storeValue=function(B,D,A,C){if(C==true){D="[JSON]"+JSON.stringify(D)}if(A==undefined||A==null){return this.callFunction("aflaxStoreValue",[B,D])}else{return this.callFunction("aflaxStoreValue",[B,D,A])}};AFLAX.prototype.getStoredValue=function(A){var B=this.callFunction("aflaxGetValue",[A]);B=B.split('\\"').join('"');B=B.split("\\'").join("'");alert(B);if(B.substring(0,6)=="[JSON]"){return JSON.parse(B.substring(6))}else{return B}};AFLAX.hideFlashSettings=function(){var A=document.getElementById("flashSettings");A.style.left=-500+"px";A.style.top=-500+"px"};AFLAX.showFlashSettings=function(A,D,C){if(A==undefined){A=100}if(D==undefined){D=100}if(C==undefined){C=1}var B=document.getElementById("flashSettings");B.style.left=A+"px";B.style.top=D+"px";AFLAX.settings.callStaticFunction("System","showSettings",C)};AFLAX.prototype.callStaticFunction=function(D,C){var A=new Array();A[0]=D;A[1]=C;for(var B=2;B<arguments.length;B++){A[B]=arguments[B]}return this.callFunction("aflaxCallStaticFunction",A)};AFLAX.prototype.getStaticProperty=function(B,A){return this.callFunction("aflaxGetStaticProperty",[B,A])};AFLAX.prototype.attachEventListener=function(C,B,A){var D=C;if(C.id!=undefined){D=C.id}this.callFunction("aflaxAttachEventListener",[D,B,A])};AFLAX.prototype.callBulkFunctions=function(B){var E=new Array(B.length);for(var D=0,C=B.length;D<C;D++){var F=B[D];E[D]=F.join("1")}var A=E.join("2");this.callFunction("aflaxBulkCallFunction",A)};AFLAX.prototype.updateAfterEvent=function(){this.callFunction("aflaxUpdateAfterEvent")};AFLAX.prototype.createFlashArray=function(D){var C=new AFLAX.FlashObject(this,"Array");C.exposeFunction("push",C);C.exposeFunction("reverse",C);C.exposeProperty("length",C);var A=D.length;for(var B=0;B<A;B++){C.push(D[B])}return C};AFLAX.extend=function(A,C){var B=function(){};B.prototype=A.prototype;C.prototype=new B();C.prototype.baseConstructor=A;C.prototype.superClass=A.prototype;C.prototype._prototype=C.prototype;if(A.prototype.superClass==undefined){A.prototype.superClass=Object.prototype}return C};AFLAX.extractArgs=function(B,D){var A=new Array();for(var C=D;C<B.length;C++){A[C-D]=B[C]}return A};AFLAX.FlashObject=function(D,C,F,E){if(arguments.length==0){return }this.aflax=D;this.flash=this.aflax.getFlash();this._prototype=AFLAX.FlashObject.prototype;if(F==null||F==undefined){F=new Array()}if(C!=null&&C!=undefined){var B=new Array();B[0]=C;for(i=0;i<F.length;i++){var A=F[i];if(A.id!=undefined){A="ref:"+A.id}B[i+1]=A}this.id=this.aflax.callFunction("aflaxCreateObject",B)}else{if(E!=null&&E!=undefined){this.id=E}}if(this.bound==false){}};AFLAX.FlashObject.prototype.bound=false;AFLAX.FlashObject.prototype.id=null;AFLAX.FlashObject.prototype._prototype=null;AFLAX.FlashObject.prototype.aflax=null;AFLAX.FlashObject.prototype.flash=null;AFLAX.FlashObject.prototype.callFunction=function(functionName){var args=new Array();args[0]=this.id;args[1]=functionName;for(i=1;i<arguments.length;i++){var val=arguments[i];if(val==null){val="null"}if(typeof (val)=="string"){if(val.substring(0,4)=="ref:"){var varPart=val.substring(4);var restPart=null;if(varPart.indexOf(".")!=-1){restPart=varPart.substring(varPart.indexOf("."));varPart=varPart.substring(0,varPart.indexOf("."))}val="ref:"+eval(varPart).id;if(restPart!=null){val+=restPart}}}if(val.id!=undefined){val="ref:"+val.id}args[i+1]=val}var retval=this.aflax.callFunction("aflaxCallFunction",args);return retval};AFLAX.FlashObject.prototype.bind=function(B,E,F){if(B!=null&&B!=undefined){for(var A=0;A<B.length;A++){this.exposeProperty(B[A])}}if(E!=null&&E!=undefined){for(var C=0;C<E.length;C++){this.exposeFunction(E[C])}}if(F!=null&&F!=undefined){for(var D=0;D<F.length;D++){this.mapFunction(F[D])}}};AFLAX.FlashObject.prototype.exposeProperty=function(B,C){var A=B.substring(0,1).toUpperCase()+B.substring(1);var D=this._prototype;if(C!=null){D=C}D["get"+A]=function(){var E=this.aflax.callFunction("aflaxGetProperty",[this.id,B]);if(E==null){return null}if(E==undefined){return }if(typeof (E)=="string"){return E.split("\\r").join("\r").split("\\n").join("\n")}else{return E}};D["set"+A]=function(E){this.aflax.callFunction("aflaxSetProperty",[this.id,B,E])}};AFLAX.FlashObject.prototype.exposeFunction=function(B,A){var C=this._prototype;if(A!=null){C=A}C[B]=function(){var D=new Array();D[0]=this.id;D[1]=B;for(var E=0;E<arguments.length;E++){D[E+2]=arguments[E]}return this.aflax.callFunction("aflaxCallFunction",D)}};AFLAX.FlashObject.prototype.mapFunction=function(B,A){var C=this._prototype;if(A!=null){C=A}C[B]=function(){var E=new Array();E[0]=this.id;for(var F=0;F<arguments.length;F++){var D=arguments[F];if(D.id!=undefined){D=D.id}E[F+1]=D}var G="aflax"+B.substring(0,1).toUpperCase()+B.substring(1);return this.aflax.callFunction(G,E)}};AFLAX.MovieClip=function(B,A,C){if(arguments.length==0){return }arguments.callee.prototype.baseConstructor.call(this,B,null,null,C);if(C==undefined||C==null){if(A!=undefined&&A!=null&&this.flash.aflaxCreateEmptyMovieClip!=undefined&&this.flash.aflaxCreateEmptyMovieClip!=null){this.id=this.aflax.callFunction("aflaxCreateEmptyMovieClip",[A])}else{this.id=this.aflax.callFunction("aflaxCreateEmptyMovieClip",["_root"])}}if(AFLAX.MovieClip.bound==false){this.bind(AFLAX.MovieClip.movieClipProperties,AFLAX.MovieClip.movieClipFunctions,AFLAX.MovieClip.movieClipMappings);AFLAX.MovieClip.bound=true}};AFLAX.extend(AFLAX.FlashObject,AFLAX.MovieClip);AFLAX.MovieClip.prototype.drawCircle=function(N,M,G){var A=G;var Q=Math.PI/180;var D=8;var C=45*Q;var H=G/Math.cos(C/2);var E=0;var K=E-C/2;var B=new Array(D+1);var J=0;B[J++]=[this.id,"moveTo",N+A,M];for(var F=0;F<D;F++){E+=C;K+=C;var P=A*Math.cos(E);var O=A*Math.sin(E);var L=H*Math.cos(K);var I=H*Math.sin(K);B[J++]=[this.id,"curveTo",N+L,M+I,N+P,M+O]}this.aflax.callBulkFunctions(B)};AFLAX.MovieClip.bound=false;AFLAX.MovieClip.movieClipProperties=["_x","_y","_height","_width","_rotation","_xmouse","_ymouse","_xscale","_yscale","_alpha","blendMode","_visible","cacheAsBitmap"];AFLAX.MovieClip.movieClipFunctions=["moveTo","lineTo","curveTo","lineStyle","beginFill","endFill","clear","getURL","removeMovieClip"];AFLAX.MovieClip.movieClipMappings=["attachVideo","createTextField","addEventHandler","attachBitmap","applyFilter","loadMovie"];AFLAX.MovieClip.prototype.clone=function(){var A=this.aflax.callFunction("aflaxDuplicateMovieClip",[this.id]);var B=new AFLAX.MovieClip(this.aflax,null,A);return B};AFLAX.CameraClip=function(C,A){if(arguments.length==0){return }arguments.callee.prototype.baseConstructor.call(this,C,A,null);if(A==undefined||A==null){A="_root"}this.id=this.aflax.callFunction("aflaxCreateVideoClip",[A]);var B=this.aflax.callFunction("aflaxGetCamera");this.attachVideo(B)};AFLAX.CameraClip.GetCameras=function(A){return A.getFlash().aflaxGetStaticProperty(["Camera","names"])};AFLAX.extend(AFLAX.MovieClip,AFLAX.CameraClip);AFLAX.VideoClip=function(F,B,C,E,A){if(arguments.length==0){return }arguments.callee.prototype.baseConstructor.call(this,F,B,null);if(B==undefined||B==null){B="_root"}this.id=this.aflax.callFunction("aflaxCreateVideoClip",[B]);var G=new AFLAX.FlashObject(this.aflax,"NetConnection");G.callFunction("connect",null);var D=new AFLAX.FlashObject(this.aflax,"NetStream",[G]);D.exposeProperty("time",D);this.netStream=D;this.attachVideo(D);if(A!=null&&A!=undefined){this.aflax.flash.aflaxAttachVideoStatusEvent([D.id,A])}if(E!=null&&E!=undefined){this.aflax.flash.aflaxAttachCuePointEvent([D.id,E])}D.callFunction("setBufferTime",0);D.callFunction("play",C)};AFLAX.extend(AFLAX.MovieClip,AFLAX.VideoClip);AFLAX.VideoClip.prototype.netStream=null;AFLAX.VideoClip.GetStatusValue=function(E,D){var C=E;var A=C.split(";");var F=new Array();for(var B=0;B<A.length;B++){var G=A[B].split("=");if(G[0]!=""){F[G[0]]=G[1]}}return F[D]};AFLAX.VideoClip.NetStream_Buffer_Empty="NetStream.Buffer.Empty";AFLAX.VideoClip.NetStream_Buffer_Full="NetStream.Buffer.Full";AFLAX.VideoClip.NetStream_Buffer_Flush="NetStream.Buffer.Flush";AFLAX.VideoClip.NetStream_Play_Start="NetStream.Play.Start";AFLAX.VideoClip.NetStream_Play_Stop="NetStream.Play.Stop";AFLAX.VideoClip.NetStream_Play_StreamNotFound="NetStream.Play.StreamNotFound";AFLAX.VideoClip.NetStream_Seek_InvalidTime="NetStream.Seek.InvalidTime";AFLAX.VideoClip.NetStream_Seek_Notify="NetStream.Seek.Notify";AFLAX.TextField=function(A,B){if(arguments.length==0){return }arguments.callee.prototype.baseConstructor.call(this,A,null,B);if(AFLAX.TextField.bound==false){this.bind(AFLAX.TextField.textFieldProperties,AFLAX.TextField.textFieldFunctions);AFLAX.TextField.bound=true}};AFLAX.extend(AFLAX.MovieClip,AFLAX.TextField);AFLAX.TextField.bound=false;AFLAX.TextField.textFieldProperties=["type","multiline","wordWrap","text","htmlText","embedFonts"];AFLAX.TextField.textFieldFunctions=["setTextFormat"];if(AFLAX.tracing==true){window.onerror=AFLAX.windowError}AFLAX.windowError=function(C,B,A){AFLAX.trace("Error on line "+A+" of document "+B+": "+C);return true};AFLAX.trace=function(A){if(AFLAX.tracing==true){var D=document.getElementById("aflaxlogger");if(D!=null){var B=document.createElement("p");B.style.margin=0;B.style.padding=0;B.style.textAlign="left";var C=document.createTextNode(A);B.appendChild(C);D.appendChild(B)}}};AFLAX.Socket=function(F,G,C,B,E,H){var D=F.getFlash();var A=new AFLAX.FlashObject(F,"XMLSocket");D.aflaxAttachSocketEvents([A.id,B,E,H]);A.exposeFunction("connect",A);A.exposeFunction("close",A);A.exposeFunction("send",A);A.connect(G,C);return A};if(typeof com=="undefined"){var com;com=new Object()}if(typeof com.deconcept=="undefined"){com.deconcept=new Object()}if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object()}if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object()}com.deconcept.FlashObjectUtil.getPlayerVersion=function(){var B=new com.deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){B=new com.deconcept.PlayerVersion(A.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(window.ActiveXObject){try{var C=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");B=new com.deconcept.PlayerVersion(C.GetVariable("$version").split(" ")[1].split(","))}catch(D){return new com.deconcept.PlayerVersion([8,0,0])}}}return B};com.deconcept.PlayerVersion=function(A){this.major=parseInt(A[0])||0;this.minor=parseInt(A[1])||0;this.rev=parseInt(A[2])||0};com.deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};Array.prototype.______array="______array";var JSON={org:"http://www.JSON.org",copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(A){var F,D,B,E="",C;switch(typeof A){case"object":if(A){if(A.______array=="______array"){for(D=0;D<A.length;++D){C=this.stringify(A[D]);if(E){E+=","}E+=C}return"["+E+"]"}else{if(typeof A.toString!="undefined"){for(D in A){C=A[D];if(typeof C!="undefined"&&typeof C!="function"){C=this.stringify(C);if(E){E+=","}E+=this.stringify(D)+":"+C}}return"{"+E+"}"}}}return"null";case"number":return isFinite(A)?String(A):"null";case"string":B=A.length;E='"';for(D=0;D<B;D+=1){F=A.charAt(D);if(F>=" "){if(F=="\\"||F=='"'){E+="\\"}E+=F}else{switch(F){case"\b":E+="\\b";break;case"\f":E+="\\f";break;case"\n":E+="\\n";break;case"\r":E+="\\r";break;case"\t":E+="\\t";break;default:F=F.charCodeAt();E+="\\u00"+Math.floor(F/16).toString(16)+(F%16).toString(16)}}}return E+'"';case"boolean":return String(A);default:return"null"}},parse:function(L){var D=0;var A=" ";function K(M){throw {name:"JSONError",message:M,at:D-1,text:L}}function G(){A=L.charAt(D);D+=1;return A}function I(){while(A!=""&&A<=" "){G()}}function J(){var O,P="",N,M;if(A=='"'){outer:while(G()){if(A=='"'){G();return P}else{if(A=="\\"){switch(G()){case"b":P+="\b";break;case"f":P+="\f";break;case"n":P+="\n";break;case"r":P+="\r";break;case"t":P+="\t";break;case"u":M=0;for(O=0;O<4;O+=1){N=parseInt(G(),16);if(!isFinite(N)){break outer}M=M*16+N}P+=String.fromCharCode(M);break;default:P+=A}}else{P+=A}}}}K("Bad string")}function H(){var M=[];if(A=="["){G();I();if(A=="]"){G();return M}while(A){M.push(C());I();if(A=="]"){G();return M}else{if(A!=","){break}}G();I()}}K("Bad array")}function E(){var M,N={};if(A=="{"){G();I();if(A=="}"){G();return N}while(A){M=J();I();if(A!=":"){break}G();N[M]=C();I();if(A=="}"){G();return N}else{if(A!=","){break}}G();I()}}K("Bad object")}function F(){var N="",M;if(A=="-"){N="-";G()}while(A>="0"&&A<="9"){N+=A;G()}if(A=="."){N+=".";while(G()&&A>="0"&&A<="9"){N+=A}}if(A=="e"||A=="E"){N+="e";G();if(A=="-"||A=="+"){N+=A;G()}while(A>="0"&&A<="9"){N+=A;G()}}M=+N;if(!isFinite(M)){K("Bad number")}else{return M}}function B(){switch(A){case"t":if(G()=="r"&&G()=="u"&&G()=="e"){G();return true}break;case"f":if(G()=="a"&&G()=="l"&&G()=="s"&&G()=="e"){G();return false}break;case"n":if(G()=="u"&&G()=="l"&&G()=="l"){G();return null}break}K("Syntax error")}function C(){I();switch(A){case"{":return E();case"[":return H();case'"':return J();case"-":return F();default:return A>="0"&&A<="9"?F():B()}}return C()}};function XMLHttpRequestObject(D,G,F,C,B){this.requestObj=null;this.before=D;this.after=G;this.parse=F;this.wait=false;try{this.requestObj=new XMLHttpRequest()}catch(E){try{this.requestObj=new ActiveXObject("Msxml2.XMLHTTP")}catch(E){try{this.requestObj=new ActiveXObject("Microsoft.XMLHTTP")}catch(A){this.requestObj=null}}}if(C){this.send(C,B)}}XMLHttpRequestObject.prototype.send=function(C,A){if(this.requestObj==null){return false}if(this.wait){return false}this.wait=true;if(this.before){this.before()}try{var B=this;if(A!=null){method="POST"}else{method="GET"}this.requestObj.open(method,C,true);this.requestObj.onreadystatechange=function(){return B.handleResponse.apply(B)};if(A!=null){this.requestObj.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.requestObj.setRequestHeader("Content-length",A.length);this.requestObj.setRequestHeader("Connection","close")}this.requestObj.send(A)}catch(D){return false}return true};XMLHttpRequestObject.prototype.handleResponse=function(){if(this.requestObj.readyState==4){this.wait=false;if(this.after){this.after()}if(this.requestObj.status!=200){return }if(!this.requestObj.responseXML||typeof (this.requestObj.responseXML)=="undefined"){return }this.parse(this.requestObj.responseXML)}};function addDOMLoadEvent(func){if(!window.__load_events){var init=function(){if(arguments.callee.done){return }arguments.callee.done=true;if(window.__load_timer){clearInterval(window.__load_timer);window.__load_timer=null}for(var i=0;i<window.__load_events.length;i++){window.__load_events[i]()}window.__load_events=null};if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);/*@cc_on @*//*@if (@_win32)
		
		document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");
		var script = document.getElementById("__ie_onload");
		script.onreadystatechange = function() {
			if (this.readyState == "complete") {
				init(); // call the onload handler
			}
		};
		
		/*@end @*/}if(/WebKit/i.test(navigator.userAgent)){window.__load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}window.onload=init;window.__load_events=[]}window.__load_events.push(func)}function addEvent(E,D,B,A){if(E.addEventListener){E.addEventListener(D,B,A);return true}else{if(E.attachEvent){var C=E.attachEvent("on"+D,B);return C}else{E["on"+D]=B}}}function addLoadEvent(A){var B=window.onload;if(typeof window.onload!="function"){window.onload=A}else{window.onload=function(){B();A()}}}function addUnloadEvent(B){var A=window.onunload;if(typeof window.onunload!="function"){window.onunload=B}else{window.onunload=function(){A();B()}}}function addMouseHandler(C,E,B){var A=B||window;if(C!="onmousedown"&&C!="onmousemove"&&C!="onmouseup"){return }if(typeof document[C]!="function"){A.document[C]=E}else{var D=document[C];A.document[C]=function(){D(e);E(e)}}}function swapMouseHandler(C,E,B){var A=B||window;if(C!="onmousedown"&&C!="onmousemove"&&C!="onmouseup"){return }var D=document[C];A.document[C]=E;return D}function getElementsByClass(G,E,A){var D=new Array();if(E==null){E=document}if(A==null){A="*"}var C=E.getElementsByTagName(A);var B=C.length;var F=new RegExp("(^|\\s)"+G+"(\\s|$)");for(i=0,j=0;i<B;i++){if(F.test(C[i].className)){D[j]=C[i];j++}}return D}function getElementByName(C,F,A){A=A||"*";var D=F.getElementsByTagName(A);for(var B,E=0;E<D.length;E++){var G=D[E];if(G.getAttribute("name")==C){return G}}}function getElementsByName(D,G,A){A=A||"*";var C=[];var E=G.getElementsByTagName(A);for(var B,F=0;F<E.length;F++){var H=E[F];if(H.getAttribute("name")==D){C.push(H)}}return C}function toggle(B){var A;if(typeof B=="string"){A=document.getElementById(B)}else{A=B}if(A.style.display!="none"){A.style.display="none"}else{A.style.display=""}}function insertAfter(B,C,A){B.insertBefore(C,A.nextSibling)}function array_search(C,B){if(!B){return false}for(var A=0;A<B.length;A++){if(B[A]==C){return A}}return false}function getCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function setCookie(C,E,A,H,D,G){var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=C+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")}function deleteCookie(A,C,B){if(getCookie(A)){document.cookie=A+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}function $(){var C=new Array();for(var B=0;B<arguments.length;B++){var A=arguments[B];if(typeof A=="string"){A=document.getElementById(A)}if(arguments.length==1){return A}C.push(A)}return C}function hasClass(B,A){return B.className.match(new RegExp("(\\s|^)"+A+"(\\s|$)"))}function addClass(B,A){if(!this.hasClass(B,A)){B.className+=" "+A}}function removeClass(C,A){if(hasClass(C,A)){var B=new RegExp("(\\s|^)"+A+"(\\s|$)");C.className=C.className.replace(B," ")}}function getElementStyle(D,B,C){if(D.currentStyle){return D.currentStyle[B]}else{if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(D,"");return A.getPropertyValue(C)}}return""}function getScrollPos(){var B=0,A=0;if(typeof (window.pageYOffset)=="number"){A=window.pageYOffset;B=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollTop;B=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft}}}return[B,A]}function getElementPos(C){var B=0;var F=0;if(C.getBoundingClientRect){var D=C.getBoundingClientRect();B=D.left;F=D.top;var E=getScrollPos();B+=E[0];F+=E[1]}else{var A=C;while(A&&A!=document.body&&A!=document.documentElement){B+=A.offsetLeft;F+=A.offsetTop;A=A.offsetParent}}return[B,F]}function getWindowDims(A){A=A||window;return[getWindowWidth(A),getWindowHeight(A)]}function getWindowWidth(A){A=A||window;if(A.innerWidth&&A.innerWidth!=0){return A.innerWidth}if(A.document.documentElement.clientWidth&&A.document.documentElement.clientWidth!=0){return A.document.documentElement.clientWidth}if(A.document.body.clientWidth&&A.document.body.clientWidth!=0){return A.document.body.clientWidth}return 0}function getWindowHeight(A){A=A||window;if(A.innerHeight&&A.innerHeight!=0){return A.innerHeight}if(A.document.documentElement.clientHeight&&A.document.documentElement.clientHeight!=0){return A.document.documentElement.clientHeight}if(A.document.body.clientHeight&&A.document.body.clientHeight!=0){return A.document.body.clientHeight}return 0}function getElementDims(A){return[getElementWidth(A),getElementHeight(A)]}function getElementHeight(A){if(A.clientHeight){return A.clientHeight}else{if(A.innerHeight){return A.innerHeight}else{if(A.offsetHeight){return A.offsetHeight}else{return 0}}}}function getElementWidth(A){if(A.clientWidth){return A.clientWidth}else{if(A.innerWidth){return A.innerWidth}else{if(A.offsetWidth){return A.offsetWidth}else{return 0}}}}var Gilean=window.Gilean||{};Gilean.observer=Gilean.observer||{};new function(C){function B(D){this._funcName=D||"onNotify"}B.prototype.notifyListener=function(E,D){if(E&&E[this._funcName]){E[this._funcName](D)}};function A(){this._events=[];this._eventsById=[];this._listeners=[];this._relays=[]}A.prototype.addEvent=function(E,D){this._events.push(D);this._eventsById[E]=D};A.prototype.getEvent=function(D){return this._eventsById[D]};A.prototype.notifyListeners=function(F,D){if(typeof F=="string"){F=this.getEvent(F)}if(F==null||typeof (F)=="undefined"){throw RangeError("RangeError: Undefined event provided")}for(var E=0;E<this._listeners.length;E++){var G=this._listeners[E];F.notifyListener(G,D)}for(var E=0;E<this._relays.length;E++){var H=this._relays[E];H.notifyListeners(F,D)}};A.prototype.addListener=function(D){this._listeners.push(D)};A.prototype.addRelay=function(D){this._relays.push(D)};C.Event=B;C.Subject=A}(Gilean.observer);Gilean.mvc=Gilean.mvc||{};new function(A){function D(){this.__base=Gilean.observer.Subject;this.__base()}D.prototype=new Gilean.observer.Subject;function C(E){this.__base=Gilean.observer.Subject;this.__base();if(E){this._model=E;E.addListener(this)}}C.prototype=new Gilean.observer.Subject;function B(F,E){if(F==null||E==null){return }this._model=F;this._view=E;E.addListener(this)}A.Model=D;A.View=C;A.Controller=B}(Gilean.mvc);Date.prototype.formatDate=function(J,C){var B=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var K=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var G=["January","February","March","April","May","June","July","August","September","October","November","December"];var I={a:function(){return A.getHours()>11?"pm":"am"},A:function(){return(this.a().toUpperCase())},B:function(){var N=(A.getTimezoneOffset()+60)*60;var L=(A.getHours()*3600)+(A.getMinutes()*60)+A.getSeconds()+N;var M=Math.floor(L/86.4);if(M>1000){M-=1000}if(M<0){M+=1000}if((String(M)).length==1){M="00"+M}if((String(M)).length==2){M="0"+M}return M},c:function(){return(this.Y()+"-"+this.m()+"-"+this.d()+"T"+this.h()+":"+this.i()+":"+this.s()+this.P())},d:function(){var L=String(this.j());return(L.length==1?"0"+L:L)},D:function(){return K[A.getDay()]},F:function(){return G[A.getMonth()]},g:function(){return A.getHours()>12?A.getHours()-12:A.getHours()},G:function(){return A.getHours()},h:function(){var L=String(this.g());return(L.length==1?"0"+L:L)},H:function(){var L=String(this.G());return(L.length==1?"0"+L:L)},i:function(){var L=String(A.getMinutes());return(L.length==1?"0"+L:L)},I:function(){var L=new Date("January 1 "+this.Y()+" 00:00:00");return(L.getTimezoneOffset()==A.getTimezoneOffset()?0:1)},j:function(){return A.getDate()},l:function(){return B[A.getDay()]},L:function(){var L=this.Y();if((L%4==0&&L%100!=0)||(L%4==0&&L%100==0&&L%400==0)){return 1}else{return 0}},m:function(){var L=String(this.n());return(L.length==1?"0"+L:L)},M:function(){return H[A.getMonth()]},n:function(){return A.getMonth()+1},N:function(){var L=this.w();return(L==0?7:L)},O:function(){var N=Math.abs(A.getTimezoneOffset());var M=String(Math.floor(N/60));var L=String(N%60);M.length==1?M="0"+M:1;L.length==1?L="0"+L:1;return A.getTimezoneOffset()<0?"+"+M+L:"-"+M+L},P:function(){var L=this.O();return(L.substr(0,3)+":"+L.substr(3,2))},r:function(){var L;L=this.D()+", "+this.d()+" "+this.M()+" "+this.Y()+" "+this.H()+":"+this.i()+":"+this.s()+" "+this.O();return L},s:function(){var L=String(A.getSeconds());return(L.length==1?"0"+L:L)},S:function(){switch(A.getDate()){case 1:return("st");case 2:return("nd");case 3:return("rd");case 21:return("st");case 22:return("nd");case 23:return("rd");case 31:return("st");default:return("th")}},t:function(){var L=[null,31,28,31,30,31,30,31,31,30,31,30,31];if(this.L()==1&&this.n()==2){return 29}return L[this.n()]},U:function(){return Math.round(A.getTime()/1000)},w:function(){return A.getDay()},W:function(){var O=this.N();var M=this.z();var L=364+this.L()-M;if(L<=2&&O<=(3-L)){return 1}if(M<=2&&O>=5){return new Date(this.Y()-1,11,31).formatDate("W")}var N=new Date(this.Y(),0,1).getDay();N=N!=0?N-1:6;if(N<=3){return(1+Math.floor((M+N)/7))}else{return(1+Math.floor((M-(7-N))/7))}},y:function(){var L=String(this.Y());return L.substring(L.length-2,L.length)},Y:function(){if(A.getFullYear){var M=new Date("January 1 2001 00:00:00 +0000");var L=M.getFullYear();if(L==2001){return A.getFullYear()}}var L=A.getYear();var N=L%100;N+=(N<38)?2000:1900;return N},z:function(){var L=new Date("January 1 "+this.Y()+" 00:00:00");var M=A.getTime()-L.getTime();return Math.floor(M/1000/60/60/24)},Z:function(){return(A.getTimezoneOffset()*-60)}};function E(L){if(I[L]!=undefined){return I[L]()}else{return L}}var A;if(C){var A=new Date(C)}else{var A=this}var D=J.split("");var F=0;while(F<D.length){if(D[F]=="\\"){D.splice(F,1)}else{D[F]=E(D[F])}F++}return D.join("")};Date.DATE_ATOM="Y-m-d\\TH:i:sP";Date.DATE_ISO8601="Y-m-d\\TH:i:sO";Date.DATE_RFC2822="D, d M Y H:i:s O";Date.DATE_W3C="Y-m-d\\TH:i:sP";var LazyLoad=function(){var B=null;var A=[];return{load:function(H,I,G,E){var F={urls:H,callback:I,obj:G,scope:E};if(B){A.push(F);return }B=F;H=H.constructor===Array?H:[H];var C;for(var D=0;D<H.length;D+=1){C=document.createElement("script");C.src=H[D];document.body.appendChild(C)}if(!C){return }if((/msie/i).test(navigator.userAgent)&&!(/AppleWebKit\/([^ ]*)/).test(navigator.userAgent)&&!(/opera/i).test(navigator.userAgent)){C.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){LazyLoad.requestComplete()}}}else{C=document.createElement("script");C.appendChild(document.createTextNode("LazyLoad.requestComplete();"));document.body.appendChild(C)}},loadOnce:function(K,L,I,M,D){var E=[],F=document.getElementsByTagName("script");K=K.constructor===Array?K:[K];for(var J=0;J<K.length;J+=1){var H=false,C=K[J];for(var G=0;G<F.length;G+=1){if(C===F[G].src){H=true;break}}if(!H){E.push(C)}}if(E.length>0){this.load(E,L,I,M)}else{if(D){if(I){if(M){L.call(I)}else{L.call(window,I)}}else{L.call()}}}},requestComplete:function(){if(B.callback){if(B.obj){if(B.scope){B.callback.call(B.obj)}else{B.callback.call(window,B.obj)}}else{B.callback.call()}}B=null;if(A.length>0){var C=A.shift();this.load(C.urls,C.callback,C.obj,C.scope)}}}}();function Logger(){}Logger.debug=function(D){return ;if(window.console){console.log(D);return }if(!Logger.m_wnd){Logger.m_wnd=new JSWnd();Logger.m_wnd.CreateWindow("Logger",100,400,700,200,false,false,true);var C=document.createElement("div");C.innerHTML="";Logger.m_wnd.SetContent(C);C.style.height="100%";C.style.backgroundColor="#f0f0f0";C.style.fontSize="8pt";C.style.overflow="auto";C.style.fontFamily="Monaco, Courier New";Logger.log=C}var A=new Date();var E=document.createElement("p");E.style.margin=0;E.style.padding=0;E.style.textAlign="left";var B=document.createElement("span");B.style.color="blue";B.innerHTML=A.toLocaleString()+":";var F=document.createTextNode(" "+D);E.appendChild(B);E.appendChild(F);Logger.log.appendChild(E);Logger.log.scrollTop=Logger.log.scrollHeight};var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))}function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}function str_md5(A){return binl2str(core_md5(str2binl(A),A.length*chrsz))}function hex_hmac_md5(A,B){return binl2hex(core_hmac_md5(A,B))}function b64_hmac_md5(A,B){return binl2b64(core_hmac_md5(A,B))}function str_hmac_md5(A,B){return binl2str(core_hmac_md5(A,B))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(K,F){K[F>>5]|=128<<((F)%32);K[(((F+64)>>>9)<<4)+14]=F;var J=1732584193;var I=-271733879;var H=-1732584194;var G=271733878;for(var C=0;C<K.length;C+=16){var E=J;var D=I;var B=H;var A=G;J=md5_ff(J,I,H,G,K[C+0],7,-680876936);G=md5_ff(G,J,I,H,K[C+1],12,-389564586);H=md5_ff(H,G,J,I,K[C+2],17,606105819);I=md5_ff(I,H,G,J,K[C+3],22,-1044525330);J=md5_ff(J,I,H,G,K[C+4],7,-176418897);G=md5_ff(G,J,I,H,K[C+5],12,1200080426);H=md5_ff(H,G,J,I,K[C+6],17,-1473231341);I=md5_ff(I,H,G,J,K[C+7],22,-45705983);J=md5_ff(J,I,H,G,K[C+8],7,1770035416);G=md5_ff(G,J,I,H,K[C+9],12,-1958414417);H=md5_ff(H,G,J,I,K[C+10],17,-42063);I=md5_ff(I,H,G,J,K[C+11],22,-1990404162);J=md5_ff(J,I,H,G,K[C+12],7,1804603682);G=md5_ff(G,J,I,H,K[C+13],12,-40341101);H=md5_ff(H,G,J,I,K[C+14],17,-1502002290);I=md5_ff(I,H,G,J,K[C+15],22,1236535329);J=md5_gg(J,I,H,G,K[C+1],5,-165796510);G=md5_gg(G,J,I,H,K[C+6],9,-1069501632);H=md5_gg(H,G,J,I,K[C+11],14,643717713);I=md5_gg(I,H,G,J,K[C+0],20,-373897302);J=md5_gg(J,I,H,G,K[C+5],5,-701558691);G=md5_gg(G,J,I,H,K[C+10],9,38016083);H=md5_gg(H,G,J,I,K[C+15],14,-660478335);I=md5_gg(I,H,G,J,K[C+4],20,-405537848);J=md5_gg(J,I,H,G,K[C+9],5,568446438);G=md5_gg(G,J,I,H,K[C+14],9,-1019803690);H=md5_gg(H,G,J,I,K[C+3],14,-187363961);I=md5_gg(I,H,G,J,K[C+8],20,1163531501);J=md5_gg(J,I,H,G,K[C+13],5,-1444681467);G=md5_gg(G,J,I,H,K[C+2],9,-51403784);H=md5_gg(H,G,J,I,K[C+7],14,1735328473);I=md5_gg(I,H,G,J,K[C+12],20,-1926607734);J=md5_hh(J,I,H,G,K[C+5],4,-378558);G=md5_hh(G,J,I,H,K[C+8],11,-2022574463);H=md5_hh(H,G,J,I,K[C+11],16,1839030562);I=md5_hh(I,H,G,J,K[C+14],23,-35309556);J=md5_hh(J,I,H,G,K[C+1],4,-1530992060);G=md5_hh(G,J,I,H,K[C+4],11,1272893353);H=md5_hh(H,G,J,I,K[C+7],16,-155497632);I=md5_hh(I,H,G,J,K[C+10],23,-1094730640);J=md5_hh(J,I,H,G,K[C+13],4,681279174);G=md5_hh(G,J,I,H,K[C+0],11,-358537222);H=md5_hh(H,G,J,I,K[C+3],16,-722521979);I=md5_hh(I,H,G,J,K[C+6],23,76029189);J=md5_hh(J,I,H,G,K[C+9],4,-640364487);G=md5_hh(G,J,I,H,K[C+12],11,-421815835);H=md5_hh(H,G,J,I,K[C+15],16,530742520);I=md5_hh(I,H,G,J,K[C+2],23,-995338651);J=md5_ii(J,I,H,G,K[C+0],6,-198630844);G=md5_ii(G,J,I,H,K[C+7],10,1126891415);H=md5_ii(H,G,J,I,K[C+14],15,-1416354905);I=md5_ii(I,H,G,J,K[C+5],21,-57434055);J=md5_ii(J,I,H,G,K[C+12],6,1700485571);G=md5_ii(G,J,I,H,K[C+3],10,-1894986606);H=md5_ii(H,G,J,I,K[C+10],15,-1051523);I=md5_ii(I,H,G,J,K[C+1],21,-2054922799);J=md5_ii(J,I,H,G,K[C+8],6,1873313359);G=md5_ii(G,J,I,H,K[C+15],10,-30611744);H=md5_ii(H,G,J,I,K[C+6],15,-1560198380);I=md5_ii(I,H,G,J,K[C+13],21,1309151649);J=md5_ii(J,I,H,G,K[C+4],6,-145523070);G=md5_ii(G,J,I,H,K[C+11],10,-1120210379);H=md5_ii(H,G,J,I,K[C+2],15,718787259);I=md5_ii(I,H,G,J,K[C+9],21,-343485551);J=safe_add(J,E);I=safe_add(I,D);H=safe_add(H,B);G=safe_add(G,A)}return Array(J,I,H,G)}function md5_cmn(F,C,B,A,E,D){return safe_add(bit_rol(safe_add(safe_add(C,F),safe_add(A,D)),E),B)}function md5_ff(C,B,G,F,A,E,D){return md5_cmn((B&G)|((~B)&F),C,B,A,E,D)}function md5_gg(C,B,G,F,A,E,D){return md5_cmn((B&F)|(G&(~F)),C,B,A,E,D)}function md5_hh(C,B,G,F,A,E,D){return md5_cmn(B^G^F,C,B,A,E,D)}function md5_ii(C,B,G,F,A,E,D){return md5_cmn(G^(B|(~F)),C,B,A,E,D)}function core_hmac_md5(C,F){var E=str2binl(C);if(E.length>16){E=core_md5(E,C.length*chrsz)}var A=Array(16),D=Array(16);for(var B=0;B<16;B++){A[B]=E[B]^909522486;D[B]=E[B]^1549556828}var G=core_md5(A.concat(str2binl(F)),512+F.length*chrsz);return core_md5(D.concat(G),512+128)}function safe_add(A,D){var C=(A&65535)+(D&65535);var B=(A>>16)+(D>>16)+(C>>16);return(B<<16)|(C&65535)}function bit_rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binl(D){var C=Array();var A=(1<<chrsz)-1;for(var B=0;B<D.length*chrsz;B+=chrsz){C[B>>5]|=(D.charCodeAt(B/chrsz)&A)<<(B%32)}return C}function binl2str(C){var D="";var A=(1<<chrsz)-1;for(var B=0;B<C.length*32;B+=chrsz){D+=String.fromCharCode((C[B>>5]>>>(B%32))&A)}return D}function binl2hex(C){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";var D="";for(var A=0;A<C.length*4;A++){D+=B.charAt((C[A>>2]>>((A%4)*8+4))&15)+B.charAt((C[A>>2]>>((A%4)*8))&15)}return D}function binl2b64(D){var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var F="";for(var B=0;B<D.length*4;B+=3){var E=(((D[B>>2]>>8*(B%4))&255)<<16)|(((D[B+1>>2]>>8*((B+1)%4))&255)<<8)|((D[B+2>>2]>>8*((B+2)%4))&255);for(var A=0;A<4;A++){if(B*8+A*6>D.length*32){F+=b64pad}else{F+=C.charAt((E>>6*(3-A))&63)}}}return F}var keySizeInBits=128;var blockSizeInBits=128;var roundsArray=[,,,,[,,,,10,,12,,14],,[,,,,12,,12,,14],,[,,,,14,,14,,14]];var shiftOffsets=[,,,,[,1,2,3],,[,1,2,3],,[,1,3,4]];var Rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var SBox=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var SBoxInverse=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];function cyclicShiftLeft(C,A){var B=C.slice(0,A);C=C.slice(A).concat(B);return C}var Nk=keySizeInBits/32;var Nb=blockSizeInBits/32;var Nr=roundsArray[Nk][Nb];function xtime(A){A<<=1;return((A&256)?(A^283):(A))}function mult_GF256(B,D){var C,A=0;for(C=1;C<256;C*=2,D=xtime(D)){if(B&C){A^=D}}return A}function byteSub(D,E){var C;if(E=="encrypt"){C=SBox}else{C=SBoxInverse}for(var B=0;B<4;B++){for(var A=0;A<Nb;A++){D[B][A]=C[D[B][A]]}}}function shiftRow(B,C){for(var A=1;A<4;A++){if(C=="encrypt"){B[A]=cyclicShiftLeft(B[A],shiftOffsets[Nb][A])}else{B[A]=cyclicShiftLeft(B[A],Nb-shiftOffsets[Nb][A])}}}function mixColumn(D,E){var A=[];for(var B=0;B<Nb;B++){for(var C=0;C<4;C++){if(E=="encrypt"){A[C]=mult_GF256(D[C][B],2)^mult_GF256(D[(C+1)%4][B],3)^D[(C+2)%4][B]^D[(C+3)%4][B]}else{A[C]=mult_GF256(D[C][B],14)^mult_GF256(D[(C+1)%4][B],11)^mult_GF256(D[(C+2)%4][B],13)^mult_GF256(D[(C+3)%4][B],9)}}for(var C=0;C<4;C++){D[C][B]=A[C]}}}function addRoundKey(B,C){for(var A=0;A<Nb;A++){B[0][A]^=(C[A]&255);B[1][A]^=((C[A]>>8)&255);B[2][A]^=((C[A]>>16)&255);B[3][A]^=((C[A]>>24)&255)}}function keyExpansion(D){var C=new Array();var A;Nk=keySizeInBits/32;Nb=blockSizeInBits/32;Nr=roundsArray[Nk][Nb];for(var B=0;B<Nk;B++){C[B]=(D[4*B])|(D[4*B+1]<<8)|(D[4*B+2]<<16)|(D[4*B+3]<<24)}for(B=Nk;B<Nb*(Nr+1);B++){A=C[B-1];if(B%Nk==0){A=((SBox[(A>>8)&255])|(SBox[(A>>16)&255]<<8)|(SBox[(A>>24)&255]<<16)|(SBox[A&255]<<24))^Rcon[Math.floor(B/Nk)-1]}else{if(Nk>6&&B%Nk==4){A=(SBox[(A>>24)&255]<<24)|(SBox[(A>>16)&255]<<16)|(SBox[(A>>8)&255]<<8)|(SBox[A&255])}}C[B]=C[B-Nk]^A}return C}function Round(A,B){byteSub(A,"encrypt");shiftRow(A,"encrypt");mixColumn(A,"encrypt");addRoundKey(A,B)}function InverseRound(A,B){addRoundKey(A,B);mixColumn(A,"decrypt");shiftRow(A,"decrypt");byteSub(A,"decrypt")}function FinalRound(A,B){byteSub(A,"encrypt");shiftRow(A,"encrypt");addRoundKey(A,B)}function InverseFinalRound(A,B){addRoundKey(A,B);shiftRow(A,"decrypt");byteSub(A,"decrypt")}function encrypt(C,A){var B;if(!C||C.length*8!=blockSizeInBits){return }if(!A){return }C=packBytes(C);addRoundKey(C,A);for(B=1;B<Nr;B++){Round(C,A.slice(Nb*B,Nb*(B+1)))}FinalRound(C,A.slice(Nb*Nr));return unpackBytes(C)}function decrypt(C,A){var B;if(!C||C.length*8!=blockSizeInBits){return }if(!A){return }C=packBytes(C);InverseFinalRound(C,A.slice(Nb*Nr));for(B=Nr-1;B>0;B--){InverseRound(C,A.slice(Nb*B,Nb*(B+1)))}addRoundKey(C,A);return unpackBytes(C)}function byteArrayToString(B){var A="";for(var C=0;C<B.length;C++){if(B[C]!=0){A+=String.fromCharCode(B[C])}}return A}function byteArrayToHex(B){var A="";if(!B){return }for(var C=0;C<B.length;C++){A+=((B[C]<16)?"0":"")+B[C].toString(16)}return A}function hexToByteArray(B){var A=[];if(B.length%2){return }if(B.indexOf("0x")==0||B.indexOf("0X")==0){B=B.substring(2)}for(var C=0;C<B.length;C+=2){A[Math.floor(C/2)]=parseInt(B.slice(C,C+2),16)}return A}function packBytes(B){var C=new Array();if(!B||B.length%4){return }C[0]=new Array();C[1]=new Array();C[2]=new Array();C[3]=new Array();for(var A=0;A<B.length;A+=4){C[0][A/4]=B[A];C[1][A/4]=B[A+1];C[2][A/4]=B[A+2];C[3][A/4]=B[A+3]}return C}function unpackBytes(B){var A=new Array();for(var C=0;C<B[0].length;C++){A[A.length]=B[0][C];A[A.length]=B[1][C];A[A.length]=B[2][C];A[A.length]=B[3][C]}return A}function formatPlaintext(B){var C=blockSizeInBits/8;var A;if(typeof B=="string"||(B.indexOf&&B.split)){B=B.split("");for(A=0;A<B.length;A++){B[A]=B[A].charCodeAt(0)&255}}for(A=C-(B.length%C);A>0&&A<C;A--){B[B.length]=0}return B}function formatKey(B){var C=keySizeInBits/8;var A;if(typeof B=="string"||(B.indexOf&&B.split)){B=B.split("");for(A=0;A<B.length;A++){B[A]=B[A].charCodeAt(0)&255}}for(A=C-(B.length%C);A>0&&A<C;A--){B[B.length]=0}return B}function getRandomBytes(C){var B;var A=new Array();for(B=0;B<C;B++){A[B]=Math.round(Math.random()*255)}return A}function rijndaelEncrypt(B,H,F){var C,E,I;var A=blockSizeInBits/8;var G;if(!B||!H){return }if(H.length*8!=keySizeInBits){return }if(F=="CBC"){G=getRandomBytes(A)}else{F="ECB";G=new Array()}B=formatPlaintext(B);C=keyExpansion(H);for(var D=0;D<B.length/A;D++){I=B.slice(D*A,(D+1)*A);if(F=="CBC"){for(var E=0;E<A;E++){I[E]^=G[D*A+E]}}G=G.concat(encrypt(I,C))}return G}function rijndaelDecrypt(C,G,F){var B;var A=blockSizeInBits/8;var I=new Array();var H;var D;if(!C||!G||typeof C=="string"){return }if(G.length*8!=keySizeInBits){return }if(!F){F="ECB"}B=keyExpansion(G);for(D=(C.length/A)-1;D>0;D--){H=decrypt(C.slice(D*A,(D+1)*A),B);if(F=="CBC"){for(var E=0;E<A;E++){I[(D-1)*A+E]=H[E]^C[(D-1)*A+E]}}else{I=H.concat(I)}}if(F=="ECB"){I=decrypt(C.slice(0,A),B).concat(I)}return I}function embedFlash(E,B,G,I,F,H,C){var D=E.getHTML(B,G,I,F,H,C);var A=document.createElement("div");document.body.appendChild(A);A.innerHTML=D;return document.getElementById(E.id)}var sock_Aflax=null;var sock_Ready=false;function initSock(){}function sockReady(){sock_Ready=true}function Sock(){if(sock_Aflax==null){initSock()}this.connection=null}Sock.prototype.Connect=function(E,A,D,C,B){if(!sock_Ready){return false}this.connection=new AFLAX.Socket(sock_Aflax,E,A,D,C,B);return true};Sock.prototype.Disconnect=function(){if(this.connection){this.connection.close();delete this.connection;this.connection=null;return true}return false};Sock.prototype.Send=function(A){return this.connection.send(A)};var test_sock;Sock_UnitTest=function(){test_sock=new Sock;test_sock.Connect("192.168.11.4",7777,"Sock_UnitTestConn","Sock_UnitTestRecv","Sock_UnitTestClos")};Sock_UnitTestConn=function(A){if(A){alert("Connection successful.")}else{alert("Could not make connection to server.")}setTimeout("test_sock.Disconnect();",2000)};Sock_UnitTestRecv=function(A){test_sock.Send(A)};Sock_UnitTestClos=function(){alert("Closed")};function SortedList(A){this._element=document.createElement("ul");this._sortfunc=A}SortedList.prototype.getElement=function(){return this._element};SortedList.prototype.size=function(){var A=this._element;if(A.hasChildNodes()){return A.childNodes.length}return 0};SortedList.prototype.insert=function(B){var C=this._element;if(C.hasChildNodes()){var A=0;var D=C.childNodes.length-1;var E=A;while(A<=D){E=Math.floor((A+D)/2);if(this._sortfunc(B,C.childNodes[E])>0){D=E-1}else{A=E+1}}if(this._sortfunc(B,C.childNodes[E])>0){C.insertBefore(B,C.childNodes[E])}else{insertAfter(C,B,C.childNodes[E])}}else{C.appendChild(B)}};SortedList.prototype.remove=function(A){this._element.removeChild(A)};SortedList.prototype.empty=function(){while(this._element.firstChild){this._element.removeChild(this._element.firstChild)}};function SoundFile(A,B){this.loaded=false;this.aflax=A;this.path=B}SoundFile.prototype.load=function(){this.soundObj=new AFLAX.FlashObject(this.aflax,"Sound");this.soundObj.exposeFunction("loadSound",this.soundObj);this.soundObj.exposeFunction("start",this.soundObj);this.soundObj.exposeFunction("stop",this.soundObj);this.soundObj.loadSound(this.path,true);this.loaded=true};SoundFile.prototype.play=function(){if(this.isLoaded()){this.soundObj.start()}else{this.load()}};SoundFile.prototype.isLoaded=function(){return this.loaded};var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(A){this.initSWFUpload(A)}}SWFUpload.prototype.initSWFUpload=function(B){try{this.customSettings={};this.settings=B;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(A){delete SWFUpload.instances[this.movieName];throw A}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 Beta 3";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(B,A){this.settings[B]=(this.settings[B]==undefined)?A:this.settings[B]};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+"?swfuploadrnd="+Math.floor(Math.random()*999999999)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){if(this.settings.button_placeholder_id!==""){this.replaceWithFlash()}else{this.appendFlash()}};SWFUpload.prototype.appendFlash=function(){var B,A;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}B=document.getElementsByTagName("body")[0];if(B==undefined){throw"Could not find the 'body' element."}A=document.createElement("div");A.style.width="1px";A.style.height="1px";A.style.overflow="hidden";B.appendChild(A);A.innerHTML=this.getFlashHTML();if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.replaceWithFlash=function(){var A,B;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}A=document.getElementById(this.settings.button_placeholder_id);if(A==undefined){throw"Could not find the placeholder element."}B=document.createElement("div");B.innerHTML=this.getFlashHTML();A.parentNode.replaceChild(B.firstChild,A);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var B=this.buildParamString();var A=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(A),"&amp;params=",encodeURIComponent(B),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var C=this.settings.post_params;var B=[];if(typeof (C)==="object"){for(var A in C){if(C.hasOwnProperty(A)){B.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(C[A].toString()))}}}return B.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var A=null;A=this.getMovieElement();if(A){for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(D){}}try{A.parentNode.removeChild(A)}catch(B){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(D){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(B,C,A){if(C==undefined){return(this.settings[B]=A)}else{return(this.settings[B]=C)}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(A){this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelUpload=function(A,B){if(B!==false){B=true}this.callFlash("CancelUpload",[A,B])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A])};SWFUpload.prototype.getFile=function(A){if(typeof (A)==="number"){return this.callFlash("GetFileByIndex",[A])}else{return this.callFlash("GetFile",[A])}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C])};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B])};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A])};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A])};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(A,B){this.settings.file_types=A;this.settings.file_types_description=B;this.callFlash("SetFileTypes",[A,B])};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A])};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A])};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A])};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A])};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A])};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A])};SWFUpload.prototype.setHTTPSuccess=function(A){if(typeof A==="string"){A=A.replace(" ","").split(",")}this.settings.http_success=A;this.callFlash("SetHTTPSuccess",[A])};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A])};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A=""}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A])};SWFUpload.prototype.setButtonDimensions=function(C,A){this.settings.button_width=C;this.settings.button_height=A;var B=this.getMovieElement();if(B!=undefined){B.style.width=C+"px";B.style.height=A+"px"}this.callFlash("SetButtonDimensions",[C,A])};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A])};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A])};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;this.callFlash("SetButtonTextStyle",[A])};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A])};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A])};SWFUpload.prototype.setButtonCursor=function(A){this.settings.button_cursor=A;this.callFlash("SetButtonCursor",[A])};SWFUpload.prototype.queueEvent=function(B,C){if(C==undefined){C=[]}else{if(!(C instanceof Array)){C=[C]}}var A=this;if(typeof this.settings[B]==="function"){this.eventQueue.push(function(){this.settings[B].apply(this,C)});setTimeout(function(){A.executeNextEvent()},0)}else{if(this.settings[B]!==null){throw"Event handler "+B+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof (A)==="function"){A.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(C){var E=/[$]([0-9a-f]{4})/i;var F={};var D;if(C!=undefined){for(var A in C.post){if(C.post.hasOwnProperty(A)){D=A;var B;while((B=E.exec(D))!==null){D=D.replace(B[0],String.fromCharCode(parseInt("0x"+B[1],16)))}F[D]=C.post[A]}}C.post=F}return C};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(typeof (A.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(B){}}}this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A)};SWFUpload.prototype.fileQueueError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("file_queue_error_handler",[A,C,B])};SWFUpload.prototype.fileDialogComplete=function(A,B){this.queueEvent("file_dialog_complete_handler",[A,B])};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A)};SWFUpload.prototype.returnUploadStart=function(A){var B;if(typeof this.settings.upload_start_handler==="function"){A=this.unescapeFilePostParams(A);B=this.settings.upload_start_handler.call(this,A)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(B===undefined){B=true}B=!!B;this.callFlash("ReturnUploadStart",[B])};SWFUpload.prototype.uploadProgress=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_progress_handler",[A,C,B])};SWFUpload.prototype.uploadError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_error_handler",[A,C,B])};SWFUpload.prototype.uploadSuccess=function(B,A){B=this.unescapeFilePostParams(B);this.queueEvent("upload_success_handler",[B,A])};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A)};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A)};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B])}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A)}else{SWFUpload.Console.writeLine(C)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(D){var B,A;try{B=document.getElementById("SWFUpload_Console");if(!B){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);B=document.createElement("textarea");B.id="SWFUpload_Console";B.style.fontFamily="monospace";B.setAttribute("wrap","off");B.wrap="off";B.style.overflow="auto";B.style.width="700px";B.style.height="350px";B.style.margin="5px";A.appendChild(B)}B.value+=D+"\n";B.scrollTop=B.scrollHeight-B.clientHeight}catch(C){alert("Exception: "+C.name+" Message: "+C.message)}};var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(D,C){var A="";var K,I,G,J,H,F,E;var B=0;if(C){D=Base64._utf8_encode(D)}while(B<D.length){K=D.charCodeAt(B++);I=D.charCodeAt(B++);G=D.charCodeAt(B++);J=K>>2;H=((K&3)<<4)|(I>>4);F=((I&15)<<2)|(G>>6);E=G&63;if(isNaN(I)){F=E=64}else{if(isNaN(G)){E=64}}A=A+this._keyStr.charAt(J)+this._keyStr.charAt(H)+this._keyStr.charAt(F)+this._keyStr.charAt(E)}return A},encodeBytes:function(C){var A="";var J,H,F,I,G,E,D;var B=0;while(B<C.length){J=C[B++];H=C[B++];F=C[B++];I=J>>2;G=((J&3)<<4)|(H>>4);E=((H&15)<<2)|(F>>6);D=F&63;if(isNaN(H)){E=D=64}else{if(isNaN(F)){D=64}}A=A+this._keyStr.charAt(I)+this._keyStr.charAt(G)+this._keyStr.charAt(E)+this._keyStr.charAt(D)}return A},decode:function(D,C){var A="";var K,I,G;var J,H,F,E;var B=0;D=D.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(B<D.length){J=this._keyStr.indexOf(D.charAt(B++));H=this._keyStr.indexOf(D.charAt(B++));F=this._keyStr.indexOf(D.charAt(B++));E=this._keyStr.indexOf(D.charAt(B++));K=(J<<2)|(H>>4);I=((H&15)<<4)|(F>>2);G=((F&3)<<6)|E;A=A+String.fromCharCode(K);if(F!=64){A=A+String.fromCharCode(I)}if(E!=64){A=A+String.fromCharCode(G)}}if(C){A=Base64._utf8_decode(A)}return A},decodeBytes:function(C){var A=[];var J,H,F;var I,G,E,D;var B=0;C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(B<C.length){I=this._keyStr.indexOf(C.charAt(B++));G=this._keyStr.indexOf(C.charAt(B++));E=this._keyStr.indexOf(C.charAt(B++));D=this._keyStr.indexOf(C.charAt(B++));J=(I<<2)|(G>>4);H=((G&15)<<4)|(E>>2);F=((E&3)<<6)|D;A.push(J);if(E!=64){A.push(H)}if(D!=64){A.push(F)}}return A},_utf8_encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A},_utf8_decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3}}}return B}};var Utf8={encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A},decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3}}}return B}};var XMLParser={parseXML:function(A){if(window.ActiveXObject){var B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";B.loadXML(A)}else{var C=new DOMParser();var B=C.parseFromString(A,"text/xml")}return B.documentElement}};function JSDialog(){JSWnd.apply(this);this._modalCover=null}JSDialog.prototype=new JSWnd;JSDialog.prototype.CreateWindow=function(G,H,E,C,I){this.divClass=C||"JSWnd";this.modalCoverClass=I||"modal-cover";this._createModalCover();document.body.appendChild(E);var D=getWindowDims();var J=getElementDims(E);var A=getScrollPos();var B=Math.max((D[0]-J[0])/2,0);var F=Math.max((D[1]-J[1])/2,0);JSWnd.prototype.CreateWindow.call(this,G,B,F,J[0],J[1],H,false,false,this.divClass);this.SetContent(E);var J=getElementDims(this.oWnd);var B=Math.max((D[0]-J[0])/2,0);var F=Math.max((D[1]-J[1])/3,0)+A[1];this.setPosition(B,F)};JSDialog.prototype._createModalCover=function(){var B=getWindowDims();var A=getElementDims(document.body);this._modalCover=document.createElement("div");this._modalCover.className=this.modalCoverClass;this._modalCover.style.position="absolute";this._modalCover.style.left=0;this._modalCover.style.top=0;this._modalCover.style.width="100%";this._modalCover.style.height=Math.max(B[1],A[1])+"px";document.body.appendChild(this._modalCover)};JSDialog.prototype.bringToFront=function(){JSWnd.prototype.bringToFront.apply(this);if(this._modalCover){this._modalCover.style.zIndex=parseInt(this.oWnd.style.zIndex);this.oWnd.style.zIndex=parseInt(this.oWnd.style.zIndex)+1}};JSDialog.prototype.DestroyWindow=function(){document.body.removeChild(this._modalCover);this._modalCover=null;JSWnd.prototype.DestroyWindow.apply(this)};function JSWnd(){this._listeners=[];this._content=null}JSWnd.prototype.CreateWindow=function(E,F,D,G,C,I,B,H,A){this.m_title=E;this.m_x=F;this.m_y=D;this.m_w=G;this.m_h=C;this._closable=I;this._extractable=B;this._sizable=H;this._subwin=null;this.oWnd=this._Create(this.m_title,this.m_w,this.m_h);this.oWnd.style.position="absolute";this.oWnd.style.left=this.m_x+"px";this.oWnd.style.top=this.m_y+"px";this.oWnd.style.zIndex=1;this.oWnd.className=A||"JSWnd";this.oWnd.ptr=this;this.oWnd.onmousedown=JSWnd.prototype.OnWindowMouseDown;document.body.appendChild(this.oWnd);this.bringToFront();return this.oWnd};JSWnd.prototype.DestroyWindow=function(){if(this._subwin){this._subwin.close()}for(var B=0;B<this._listeners.length;B++){var C=this._listeners[B];if(typeof (C.onClose)=="function"){var A=C.onClose();if(A==false){return }}}this._content=null;this.oWnd.parentNode.removeChild(this.oWnd)};JSWnd.prototype.SetTitle=function(A){m_title=A;this.oTitle.innerHTML='		<table cellpadding="0" cellspacing="0" width="100%">			<tr valign="top" width="100%">				<td class=\'JSWnd_nw\'><div class=\'JSWnd_nw\'></div></td>				<td class=\'JSWndTitle\' width="100%">					<div class=\'JSWndTitleText\'>'+A+"</div>				</td>				<td class='JSWnd_ne'><div class='JSWnd_ne'></div></td>			</tr>		</table>"};JSWnd.prototype.SetContent=function(B,E,D){this._content=B;this.oBody.appendChild(B);if(E){this.m_w=parseInt(E,10);this.oBody.style.width=this.m_w+"px"}if(D){this.m_h=parseInt(D,10);this.oBody.style.height=this.m_h+"px"}for(var A=0;A<this._listeners.length;A++){var C=this._listeners[A];if(typeof (C.onSize)=="function"){C.onSize(this.m_w,this.m_h)}}};JSWnd.prototype.setPosition=function(B,A){this.m_x=B;this.m_y=A;this.oWnd.style.left=this.m_x+"px";this.oWnd.style.top=this.m_y+"px"};JSWnd.prototype.addListener=function(A){this._listeners.push(A)};JSWnd.prototype.getDims=function(){return[this.m_w,this.m_h]};JSWnd.prototype.setExtractedPage=function(A){this._extractedHTML=A};JSWnd.prototype.isExtracted=function(){return(this._subwin!=null)};JSWnd.prototype.isFocused=function(){if(this.isExtracted()){return this._subwin.focused}else{return(this.oWnd.className=="JSWnd")}};JSWnd.prototype._Create=function(H,I,E){if(!H){H="&nbsp;"}this.oBody=document.createElement("div");this.oBody.style.overflow="hidden";this.oBody.style.height=E+"px";this.oBody.style.width=I+"px";this.oBody.className="JSWndBody";for(var D=0;D<this._listeners.length;D++){var B=this._listeners[D];if(typeof (B.onSize)=="function"){B.onSize(this.m_w,this.m_h)}}this.oTitle=document.createElement("div");this.oTitle.ptr=this;this.oTitle.onmousedown=JSWnd.prototype.OnTitleBarMouseDown;this.oTitle.innerHTML='	<table cellpadding="0" cellspacing="0" width="100%">		<tr valign="top" width="100%">			<td class=\'JSWnd_nw\'><div class=\'JSWnd_nw\'></div></td>			<td class=\'JSWndTitle\' width="100%">				<div class=\'JSWndTitleText\'>'+H+"</div>			</td>			<td class='JSWnd_ne'><div class='JSWnd_ne'></div></td>		</tr>	</table>";this.oStatus=document.createElement("div");this.oStatus.className="JSWndStatus";win=document.createElement("div");win.className="JSWnd";var F="";F+='<div class="caption">';if(this._closable){F+='		<a class="close" name="close"></a>'}if(this._extractable){F+='		<a class="extract" name="extract"></a>'}F+="</div>";F+="		<table cellpadding=\"0\" cellspacing=\"0\">			<tr>				<td name='insert_title'></td>			</tr>			<tr>				<td>					<table cellpadding=\"0\" cellspacing=\"0\">						<tr>							<td class='JSWnd_w'>								<div class='JSWnd_w'></div>							</td>							<td valign='top' name='insert_body'></td>							<td class='JSWnd_e'>								<div class='JSWnd_e'></div>							</td>						</tr>					</table>				</td>			</tr>			<tr>				<td>					<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">						<tr>							<td class='JSWnd_sw'>								<div class='JSWnd_sw'></div>							</td>							<td class='JSWndStatus' name='insert_status'></td>							<td class='JSWndSizer' name='insert_sizer'>								<div class='JSWndSizer'></div>							</td>						</tr>					</table>				</td>			</tr>		</table>";win.innerHTML=F;getChildWithName(win,"insert_title").appendChild(this.oTitle);getChildWithName(win,"insert_body").appendChild(this.oBody);getChildWithName(win,"insert_status").appendChild(this.oStatus);var A=getChildWithName(win,"insert_sizer");A.ptr=this;if(this._sizable){A.onmousedown=JSWnd.prototype.OnSizerMouseDown}var J=getChildWithName(win,"close");if(J){J.ptr=this;J.onclick=JSWnd.prototype._onClose}var C=getChildWithName(win,"extract");if(C){var G=this;C.onclick=function(){G.extract()}}return win};function getChildWithName(E,B){var C=E.getElementsByTagName("*");for(var A,D=0;D<C.length;D++){var F=C[D];if(F.getAttribute("name")==B){return F}}}JSWnd.prototype.OnWindowMouseDown=function(A){this.ptr.bringToFront();return true};JSWnd.prototype.bringToFront=function(){if(this._subwin){this._subwin.focus();return }windows=getElementsByClass("JSWnd");inactiveWindows=getElementsByClass("JSWndInactive");windows=windows.concat(inactiveWindows);var C=0;var A=null;var D=parseInt(this.oWnd.style.zIndex);for(var B=0;B<windows.length;B++){if(C<parseInt(windows[B].style.zIndex)){C=windows[B].style.zIndex}if(windows[B]!=this.oWnd){windows[B].className="JSWndInactive"}}if(D>parseInt(C)){this.oWnd.className="JSWnd";return }this.oWnd.style.zIndex=parseInt(C)+1;this.oWnd.className="JSWnd"};JSWnd.prototype._onClose=function(){this.ptr.DestroyWindow()};JSWnd.prototype.extract=function(){var D=window.open("","","width="+this.m_w+",height="+this.m_h+",resizable=yes,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");var C=this;var A=function(){if(!D.document.body){setTimeout(A,200);return }C.oWnd.style.display="none";C._subwin=D;var E=C.m_w;var J=C.m_h;for(var G=0;G<C._listeners.length;G++){var H=C._listeners[G];if(typeof (H.onExtract)=="function"){var F=H.onExtract(D,D.document.body)}}var I=getWindowDims(D);for(var G=0;G<C._listeners.length;G++){var H=C._listeners[G];if(typeof (H.onSize)=="function"){H.onSize(I[0],I[1])}}D.onunload=D.document.body.onunload=D.document.body.onbeforeunload=function(){if(C.oWnd.style.display==""){return }C.oBody.innerHTML="";C.oWnd.style.display="";C._subwin=null;for(var K=0;K<C._listeners.length;K++){var L=C._listeners[K];if(typeof (L.onExtract)=="function"){L.onExtract(window,C.oBody)}}C.m_w=E;C.m_h=J;for(var K=0;K<C._listeners.length;K++){var L=C._listeners[K];if(typeof (L.onSize)=="function"){L.onSize(C.m_w,C.m_h)}}};D.onresize=D.document.body.onresize=function(){var M=getWindowDims(D);C.m_w=M[0];C.m_h=M[1];for(var K=0;K<C._listeners.length;K++){var L=C._listeners[K];if(typeof (L.onSize)=="function"){L.onSize(M[0],M[1])}}};D.onfocus=function(){D.focused=true};D.onblur=function(){D.focused=false}};var B=null;D.document.open();if(this._extractedHTML){D.document.write(this._extractedHTML)}D.document.close();D.focused=true;setTimeout(A,300);return };JSWnd.prototype.SetCapture=function(){this.saveBodyMouseMove=document.body.onmousemove;this.saveBodyMouseUp=document.body.onmouseup;this.saveBodyMouseDown=document.body.onmousedown;this.saveDocMouseMove=document.onmousemove;this.saveDocMouseUp=document.onmouseup;this.saveDocMouseDown=document.onmousedown;document.onmousedown=null;document.onmousemove=JSWnd.prototype.OnMouseMove;document.onmouseup=JSWnd.prototype.OnMouseUp;document.body.onmousedown=null;document.body.onmousemove=JSWnd.prototype.OnMouseMove;document.body.onmouseup=JSWnd.prototype.OnMouseUp;document.ptr=this;document.body.ptr=this};JSWnd.prototype.ReleaseCapture=function(){document.body.onmousemove=this.saveBodyMouseMove;document.body.onmouseup=this.saveBodyMouseUp;document.body.onmousedown=this.saveBodyMouseDown;document.onmousemove=this.saveDocMouseMove;document.onmouseup=this.saveDocMouseUp;document.onmousedown=this.saveDocMouseDown;document.ptr=null;document.body.ptr=null};JSWnd.prototype.OnTitleBarMouseDown=function(){this.ptr.OnStartDrag();return false};JSWnd.prototype.OnSizerMouseDown=function(){this.ptr.OnStartSizing();return false};JSWnd.prototype.OnMouseMove=function(A){var B=window.event?window.event:A;if(this.ptr.m_bDragging){this.ptr.OnDoDrag(B)}else{if(this.ptr.m_bSizing){this.ptr.OnDoSizing(B)}}return false};JSWnd.prototype.OnMouseUp=function(){this.ptr.OnStopDrag()};JSWnd.prototype.OnStartDrag=function(){this.m_bDragging=true;this.m_bContinue=false;this.SetCapture()};JSWnd.prototype.OnDoDrag=function(A){if((document.all&&window.ActiveXObject)&&!(A.button&1)){this.OnStopDrag();return }if(!this.m_bContinue){this.dx=parseInt(this.oWnd.style.left+0,10)-A.clientX;this.dy=parseInt(this.oWnd.style.top+0,10)-A.clientY;this.m_bContinue=true}else{var B=getWindowDims();var F=getElementDims(document.body);var E=getElementDims(this.oWnd);var D=Math.max(B[0],F[0]);var C=Math.max(B[1],F[1]);this.m_x=Math.max(this.dx+A.clientX,0);this.m_x=Math.min(this.m_x,D-E[0]);this.m_y=Math.max(this.dy+A.clientY,0);this.m_y=Math.min(this.m_y,C-E[1]);this.oWnd.style.left=this.m_x+"px";this.oWnd.style.top=this.m_y+"px"}};JSWnd.prototype.OnStopDrag=function(){this.m_bContinue=false;this.m_bDragging=false;this.ReleaseCapture()};JSWnd.prototype.OnStartSizing=function(){this.m_bSizing=true;this.m_bContinue=false;this.SetCapture()};JSWnd.prototype.OnDoSizing=function(K){if((document.all&&window.ActiveXObject)&&!(K.button&1)){this.OnStopSizing();return }if(!this.m_bContinue){if(this.m_w){this.dx=this.m_x+this.m_w-K.clientX;this.dy=this.m_y+this.m_h-K.clientY}else{this.dy=-35;this.dx=10}this.m_bContinue=true}else{var E=getElementPos(this.oWnd);var G=getWindowDims();var H=getElementDims(document.body);var C=getElementDims(this.oWnd);var I=Math.max(G[0],H[0]);var J=Math.max(G[1],H[1]);var A=I-E[0]-(C[0]-this.m_w);var F=J-E[1]-(C[1]-this.m_h);this.m_w=Math.min(Math.max(this.dx-this.m_x+K.clientX,0),A);this.m_h=Math.min(Math.max(this.dy-this.m_y+K.clientY,0),F);this.oBody.style.width=this.m_w+"px";this.oBody.style.height=this.m_h+"px";for(var D=0;D<this._listeners.length;D++){var B=this._listeners[D];if(typeof (B.onSize)=="function"){B.onSize(this.m_w,this.m_h)}}}};JSWnd.prototype.OnStopSizing=function(){this.m_bSizing=false;this.m_bContinue=false;this.ReleaseCapture()};JSWnd_UnitTest=function(){var C=new JSWnd();var B=new JSWnd();var A=new JSWnd();C.CreateWindow("Title 1",0,0,300,300);B.CreateWindow("Title 2",100,100,200,100);A.CreateWindow("Title 3",200,200,400,200);var D=document.createElement("div");D.innerHTML="foo";A.SetContent(D);B.DestroyWindow()};function JSTabControl(){var G=null;var O=null;var Q=null;var E=null;var P=null;var C=null;var M=null;var D=null;var R=null;var B=-1;var K=[];var J=0;var A=[];var F=null;var I=this;var H=function(S){return F.setInterval(function(){if(hasClass(S,"flash")){removeClass(S,"flash")}else{addClass(S,"flash")}},1000)};var N=function(){var X=false;var U=false;var T=getElementWidth(_tabsContainer);var Z=P.scrollLeft;for(var S in K){var Y=K[S];if(!Y){continue}if(Y.interval){var V=Y.offsetLeft;var W=getElementWidth(Y);if(V>Z+T){if(!D.interval){D.interval=H(D)}U=true}else{if(V+W<Z){if(!M.interval){M.interval=H(M)}X=true}}}}if(!X){removeClass(M,"flash");if(M.interval){F.clearInterval(M.interval)}M.interval=null}if(!U){removeClass(D,"flash");if(D.interval){F.clearInterval(D.interval)}D.interval=null}};var L=function(U,S,W){var T=U.document.createElement("span");T.className="tab";T.style.overflow="hidden";T.style.cursor="pointer";T.style.whiteSpace="nowrap";T.style.verticalAlign="middle";var V=U.document.createElement("div");if(K.length>0){V.style.display="none"}else{B=0;T.className="tab tab-active"}T.innerHTML=W;T.content=V;T.index=S;K[T.index]=T;T.onclick=function(){I.setSelectedIndex(T.index)};P.appendChild(T);Q.appendChild(V);return T.index};this.create=function(T,S){F=S||window;O=F.document.createElement("div");O.className="tabFrame";O.style.position="relative";O.style.overflow="hidden";C=F.document.createElement("div");C.className="controls";C.style.position="absolute";C.style.top=0;C.style.right=0;C.style.zIndex=1;M=F.document.createElement("div");M.className="left";M.style.cssFloat="left";M.style.styleFloat="left";M.style.cursor="pointer";M.onmousedown=function(){P.scrollLeft-=30;M.intervalID=F.setInterval(function(){P.scrollLeft-=30},50);var U=swapMouseHandler("onmouseup",function(){if(M.intervalID){F.clearInterval(M.intervalID);M.intervalID=null}swapMouseHandler("onmouseup",U,F);N()},F)};D=F.document.createElement("div");D.className="right";D.style.cssFloat="left";D.style.styleFloat="left";D.style.cursor="pointer";D.onmousedown=function(){P.scrollLeft+=30;D.intervalID=F.setInterval(function(){P.scrollLeft+=30},50);var U=swapMouseHandler("onmouseup",function(){if(D.intervalID){F.clearInterval(D.intervalID);D.intervalID=null}swapMouseHandler("onmouseup",U,F);N()},F)};R=F.document.createElement("div");R.className="close";R.style.cssFloat="left";R.style.styleFloat="left";R.style.cursor="pointer";R.onclick=function(){I.removeTab(I.getSelectedIndex())};C.appendChild(M);C.appendChild(D);C.appendChild(R);_tabsContainer=F.document.createElement("div");_tabsContainer.className="tabs";_tabsContainer.style.overflow="hidden";_tabsContainer.style.whiteSpace="nowrap";P=F.document.createElement("div");P.style.overflow="hidden";P.style.whiteSpace="nowrap";P.style.width="100%";_tabsContainer.appendChild(P);O.appendChild(C);O.appendChild(_tabsContainer);Q=F.document.createElement("div");G=F.document.createElement("div");G.appendChild(O);G.appendChild(Q);if(T){G.id=T}return G};this.close=function(){for(var S=0;S<A.length;S++){var T=A[S];if(typeof (T.onClose)!="undefined"){T.onClose()}}if(G.parentNode){G.parentNode.removeChild(G)}};this.addTab=function(S){return L(F,J++,S)};this.removeTab=function(T){if(K[T]){var V=K[T];for(var U=0;U<A.length;U++){var W=A[U];if(typeof (W.onClose)=="function"){W.onClose(T)}}var S=V.previousSibling;if(!S){S=V.nextSibling}if(S){I.setSelectedIndex(S.index)}else{for(var U=0;U<A.length;U++){var W=A[U];if(typeof (W.onEmpty)=="function"){W.onEmpty()}}}P.removeChild(V);K[T]=null}};this.getWnd=function(){return G};this.getContent=function(S){if(K[S]){return K[S].content}return null};this.getSelectedIndex=function(){return B};this.getSelectedContent=function(){if(B>=0){return K[B].content}return null};this.flashIndex=function(S){if(S==B){return }var T=K[S];if(T&&!T.interval){T.interval=H(T)}N()};this.setSelectedIndex=function(W){var U=B;B=W;if(B!=U){if(U>=0&&K[U]){K[U].content.style.display="none";K[U].className="tab"}if(K[B]){K[B].content.style.display="block";K[B].className="tab tab-active";if(K[B].interval){F.clearInterval(K[B].interval);K[B].interval=null}var T=K[B].offsetLeft;var V=getElementWidth(K[B]);var S=getElementWidth(_tabsContainer);var Z=P.scrollLeft;if(T+V>Z+S){P.scrollLeft=T+V-S}else{if(T<Z){P.scrollLeft=T}}}}for(var X=0;X<A.length;X++){var Y=A[X];if(typeof (Y.onActivate)=="function"){Y.onActivate(W)}}N()};this.setDimensions=function(S,U){G.style.width=S+"px";G.style.height=U+"px";for(var T=0;T<A.length;T++){var V=A[T];if(typeof (V.onSize)!="undefined"){V.onSize(S,U)}}};this.getContentDims=function(){var T=getElementDims(G);var S=getElementDims(O);return[T[0],T[1]-S[1]]};this.addListener=function(S){A.push(S)};this.move=function(W,V){F=V||window;tabsArray=K;if(G.parentNode){G.parentNode.removeChild(G)}var T=this.create(W,F);for(var U in tabsArray){if(tabsArray[U]&&typeof (tabsArray[U].index)!="undefined"){L(F,tabsArray[U].index,tabsArray[U].innerHTML)}}var S=B;B=-1;this.setSelectedIndex(S);return T}}function TooltipTarget(C,A){if(!TooltipTarget.eventAdded){addEvent(document,"mousemove",TooltipTarget.move,true);TooltipTarget.eventAdded=true}var B=this;B.m_tooltip=new Tooltip({"left":0,"top":0},A,C);B.m_targetDiv=C;this._div=C}TooltipTarget.prototype.attachTrigger=function(A,C){C=C||this._div;var B=this;addEvent(C,A,function(){B.showTooltip()},true)};TooltipTarget.prototype.showTooltip=function(I){var C=I?I:window.event;I=C;var D=this;if(!this.m_tooltip){return }TooltipTarget.move(I);if(TooltipTarget.curTarget){return }var G=getElementPos(this._div);var J=getElementDims(this._div);var H=getScrollPos();var E=getWindowDims();var A=G[1]-H[1];var B=G[0]-H[0];var F=[];if(A>E[1]*5/9){bodyBottom=getElementHeight(document.body);F["bottom"]=bodyBottom-G[1]-5}else{F["top"]=G[1]+J[1]-10}if(B>E[0]*5/9){bodyRight=getElementWidth(document.body);F["right"]=bodyRight-(G[0]+J[0]+50)}else{F["left"]=Math.max(0,G[0]-50)}this.m_tooltip.setPos(F);this.tid=setTimeout(function(){D._showTooltip()},500);TooltipTarget.curTarget=this};TooltipTarget.prototype._showTooltip=function(){this.m_tooltip.show()};TooltipTarget.prototype.hideTooltip=function(){this.m_tooltip.hide()};TooltipTarget.move=function(E){if(!TooltipTarget.curTarget){return }if(!E){return }var D=TooltipTarget.curTarget;var G=getElementPos(D.m_targetDiv);var C=getElementDims(D.m_targetDiv);var B=getScrollPos();var A=E.clientX+B[0];var F=E.clientY+B[1];if(!(A-10<(G[0]+C[0])&&A>=G[0])||!(F<(G[1]+C[1])&&F>=G[1])){var G=getElementPos(D.m_tooltip._container);var C=getElementDims(D.m_tooltip._container);if(!(A<(G[0]+C[0])&&A+10>=G[0])||!(F-10<(G[1]+C[1])&&F+10>=G[1])){TooltipTarget.curTarget=null;clearTimeout(D.tid);D.hideTooltip()}}};function Tooltip(C,A,B){this._container=this.create(null,A);this._container.className="Tooltip";this._shim=this.createShim();this._wrapper=document.createElement("div");this._wrapper.style.position="absolute";this._wrapper.appendChild(this._shim);this._wrapper.appendChild(this._container);this.hide();document.body.appendChild(this._wrapper)}Tooltip.prototype.create=function(C,A){this.m_pos=C;var B=document.createElement("div");B.style.left="0px";B.style.top="0px";B.style.position="relative";B.style.zIndex=2;if(typeof A=="string"){B.innerHTML=A}else{B.appendChild(A)}return B};Tooltip.prototype.createShim=function(){var A=document.createElement("iframe");A.frameBorder="0";A.scrolling="no";A.style.border="0px";A.style.position="absolute";A.style.overflow="hidden";A.style.left=0;A.style.top=0;A.style.zIndex=1;return A};Tooltip.prototype.setPos=function(A){this.m_pos=A};Tooltip.prototype.show=function(){if(this._isShown==true){return }var C=this._wrapper;var D=this._shim;C.style.left="";C.style.top="";C.style.right="";C.style.bottom="";if(this.m_pos["left"]){C.style.left=this.m_pos["left"]+"px"}if(this.m_pos["top"]){C.style.top=this.m_pos["top"]+"px"}if(this.m_pos["right"]){C.style.right=this.m_pos["right"]+"px"}if(this.m_pos["bottom"]){C.style.bottom=this.m_pos["bottom"]+"px"}C.style.opacity=0;C.style.filter="alpha(opacity=0)";C.style.display="block";var B=getElementWidth(C);var A=getElementHeight(C);D.style.width=B+"px";D.style.height=A+"px";C.style.opacity=1;C.style.filter="alpha(opacity=100";this._isShown=true};Tooltip.prototype.hide=function(){this._wrapper.style.display="none";this._isShown=false};function StubTarget(B,A){if(!StubTarget.eventAdded){addEvent(document,"mousemove",StubTarget.move,true);StubTarget.eventAdded=true}this.m_tooltip=A;this.m_targetDiv=B}StubTarget.prototype.attachTrigger=function(A,C){C=C||this.m_targetDiv;var B=this;addEvent(C,A,function(){B.showTooltip()},true)};StubTarget.prototype.showTooltip=function(A){var C=A?A:window.event;A=C;var B=this;if(!this.m_tooltip){return }StubTarget.move(A);if(StubTarget.curTarget){return }this.m_tooltip.style.visibility="visible";StubTarget.curTarget=this};StubTarget.prototype._showTooltip=function(){this.m_tooltip.show()};StubTarget.prototype.hideTooltip=function(){this.m_tooltip.style.visibility="hidden"};StubTarget.move=function(E){if(!StubTarget.curTarget){return }if(!E){return }var D=StubTarget.curTarget;var G=getElementPos(D.m_targetDiv);var C=getElementDims(D.m_targetDiv);var B=getScrollPos();var A=E.clientX+B[0];var F=E.clientY+B[1];if(!(A-10<(G[0]+C[0])&&A>=G[0])||!(F<(G[1]+C[1])&&F>=G[1])){var G=getElementPos(D.m_tooltip);var C=getElementDims(D.m_tooltip);if(!(A<(G[0]+C[0])&&A+10>=G[0])||!(F-10<(G[1]+C[1])&&F+10>=G[1])){StubTarget.curTarget=null;D.hideTooltip()}}}
