/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.1",build:"984"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[].slice.call(arguments,0),F=true,C,I=false;if(!this.silent){}var B=this.subscribers.slice();for(C=0;C<D;++C){var K=B[C];if(!K){I=true;}else{if(!this.silent){}var J=K.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=K.fn.call(J,A,K.obj);}catch(E){this.lastError=E;}}else{try{F=K.fn.call(J,this.type,H,K.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;
if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);
I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.1",build:"984"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;
}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement("<iframe id=\""+B+"\" name=\""+B+"\" />");if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(this._formNode.encoding){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);}else{M.upload.apply(M.scope,[P]);}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.1",build:"984"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;
var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.1",build:"984"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=H.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P<Q;++P){if(typeof T[P]==="string"){U=G(J[T[P]],T,R-1);if(U){S[O++]=M(T[P])+":"+U;}}}}else{O=0;for(N in J){if(typeof N==="string"&&E.hasOwnProperty(J,N)){U=G(J[N],T,R-1);if(U){S[O++]=M(N)+":"+U;}}}}}B.pop();return"{"+S.join(",")+"}";}return undefined;};F=F>=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.1",build:"984"});/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});}}}}}},getBestMatch:function(D){var F=null;
var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;
this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");
YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","javascript: false;");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.1",build:"984"});
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.1
*/
(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=('<div class="'+G.CSS_HEADER+'"></div>'+'<div class="'+G.CSS_BODY+'"></div><div class="'+G.CSS_FOOTER+'"></div>');O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);
this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}this.element=U;if(U.id){this.id=U.id;}V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}if(!U){T=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}R.id="_yuiResizeMonitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}G.textResizeInitialized=true;}this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);
}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;
if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);T=S.parentNode;var Q=T||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];
K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(L,K,M){var O=K[0];var N=this.getConstrainedXY(O[0],O[1]);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},getConstrainedXY:function(V,T){var N=B.VIEWPORT_OFFSET,U=D.getViewportWidth(),Q=D.getViewportHeight(),M=this.element.offsetHeight,S=this.element.offsetWidth,Y=D.getDocumentScrollLeft(),W=D.getDocumentScrollTop();var P=V;var L=T;if(S+N<U){var R=Y+N;var X=Y+U-S-N;if(V<R){P=R;}else{if(V>X){P=X;}}}else{P=N+Y;}if(M+N<Q){var O=W+N;var K=W+Q-M-N;if(T<O){L=O;}else{if(T>K){L=K;}}}else{L=N+W;}return[P,L];},center:function(){var N=B.VIEWPORT_OFFSET,O=this.element.offsetWidth,M=this.element.offsetHeight,L=D.getViewportWidth(),P=D.getViewportHeight(),K,Q;if(O<L){K=(L/2)-(O/2)+D.getDocumentScrollLeft();}else{K=N+D.getDocumentScrollLeft();}if(M<P){Q=(P/2)-(M/2)+D.getDocumentScrollTop();}else{Q=N+D.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(K,10),parseInt(Q,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var O=[],N=this.element;function R(V,U){var X=D.getStyle(V,"zIndex"),W=D.getStyle(U,"zIndex"),T=(!X||isNaN(X))?0:parseInt(X,10),S=(!W||isNaN(W))?0:parseInt(W,10);if(T>S){return -1;}else{if(T<S){return 1;}else{return 0;}}}function M(U){var S=D.hasClass(U,B.CSS_OVERLAY),T=YAHOO.widget.Panel;if(S&&!D.isAncestor(N,S)){if(T&&D.hasClass(U,T.CSS_PANEL)){O[O.length]=U.parentNode;}else{O[O.length]=U;}}}D.getElementsBy(M,"DIV",document.body);O.sort(R);var K=O[0],Q;if(K){Q=D.getStyle(K,"zIndex");if(!isNaN(Q)){var P=false;if(K!=N){P=true;}else{if(O.length>1){var L=D.getStyle(O[1],"zIndex");if(!isNaN(L)&&(Q==L)){P=true;}}}if(P){this.cfg.setProperty("zindex",(parseInt(Q,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");
if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(N,M){YAHOO.widget.Tooltip.superclass.constructor.call(this,N,M);};var E=YAHOO.lang,L=YAHOO.util.Event,K=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,G=YAHOO.widget.Tooltip,F,H={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};G.CSS_TOOLTIP="yui-tt";function I(N,M,O){var R=O[0],P=O[1],Q=this.cfg,S=Q.getProperty("width");if(S==P){Q.setProperty("width",R);}this.unsubscribe("hide",this._onHide,O);}function D(N,M){var O=document.body,S=this.cfg,R=S.getProperty("width"),P,Q;if((!R||R=="auto")&&(S.getProperty("container")!=O||S.getProperty("x")>=C.getViewportWidth()||S.getProperty("y")>=C.getViewportHeight())){Q=this.element.cloneNode(true);Q.style.visibility="hidden";Q.style.top="0px";Q.style.left="0px";O.appendChild(Q);P=(Q.offsetWidth+"px");O.removeChild(Q);Q=null;S.setProperty("width",P);S.refireEvent("xy");this.subscribe("hide",I,[(R||""),P]);}}function B(N,M,O){this.render(O);}function J(){L.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(G,YAHOO.widget.Overlay,{init:function(N,M){G.superclass.init.call(this,N);this.beforeInitEvent.fire(G);C.addClass(this.element,G.CSS_TOOLTIP);if(M){this.cfg.applyConfig(M,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",D);this.subscribe("init",J);this.subscribe("render",this.onRender);this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);var M=K.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=M;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=M;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=M;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.PREVENT_OVERLAP.key,{value:H.PREVENT_OVERLAP.value,validator:H.PREVENT_OVERLAP.validator,supercedes:H.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(H.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:H.SHOW_DELAY.validator});this.cfg.addProperty(H.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:H.AUTO_DISMISS_DELAY.value,validator:H.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(H.HIDE_DELAY.key,{handler:this.configHideDelay,value:H.HIDE_DELAY.value,validator:H.HIDE_DELAY.validator});this.cfg.addProperty(H.TEXT.key,{handler:this.configText,suppressEvent:H.TEXT.suppressEvent});this.cfg.addProperty(H.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(H.DISABLED.key,{handler:this.configContainer,value:H.DISABLED.value,supressEvent:H.DISABLED.suppressEvent});},configText:function(N,M,O){var P=M[0];if(P){this.setBody(P);}},configContainer:function(O,N,P){var M=N[0];if(typeof M=="string"){this.cfg.setProperty("container",document.getElementById(M),true);}},_removeEventListeners:function(){var P=this._context,M,O,N;if(P){M=P.length;if(M>0){N=M-1;do{O=P[N];L.removeListener(O,"mouseover",this.onContextMouseOver);L.removeListener(O,"mousemove",this.onContextMouseMove);L.removeListener(O,"mouseout",this.onContextMouseOut);}while(N--);}}},configContext:function(R,N,S){var Q=N[0],T,M,P,O;if(Q){if(!(Q instanceof Array)){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q)],true);}else{this.cfg.setProperty("context",[Q],true);}Q=this.cfg.getProperty("context");}this._removeEventListeners();this._context=Q;T=this._context;if(T){M=T.length;if(M>0){O=M-1;do{P=T[O];L.on(P,"mouseover",this.onContextMouseOver,this);L.on(P,"mousemove",this.onContextMouseMove,this);L.on(P,"mouseout",this.onContextMouseOut,this);}while(O--);}}}},onContextMouseMove:function(N,M){M.pageX=L.getPageX(N);M.pageY=L.getPageY(N);},onContextMouseOver:function(O,N){var M=this;if(M.title){N._tempTitle=M.title;M.title="";}if(N.fireEvent("contextMouseOver",M,O)!==false&&!N.cfg.getProperty("disabled")){if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}L.on(M,"mousemove",N.onContextMouseMove,N);N.showProcId=N.doShow(O,M);}},onContextMouseOut:function(O,N){var M=this;if(N._tempTitle){M.title=N._tempTitle;N._tempTitle=null;}if(N.showProcId){clearTimeout(N.showProcId);N.showProcId=null;}if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}N.fireEvent("contextMouseOut",M,O);N.hideProcId=setTimeout(function(){N.hide();},N.cfg.getProperty("hidedelay"));},doShow:function(O,M){var P=25,N=this;if(YAHOO.env.ua.opera&&M.tagName&&M.tagName.toUpperCase()=="A"){P+=12;
}return setTimeout(function(){var Q=N.cfg.getProperty("text");if(N._tempTitle&&(Q===""||YAHOO.lang.isUndefined(Q)||YAHOO.lang.isNull(Q))){N.setBody(N._tempTitle);}else{N.cfg.refireEvent("text");}N.moveTo(N.pageX,N.pageY+P);if(N.cfg.getProperty("preventoverlap")){N.preventOverlap(N.pageX,N.pageY);}L.removeListener(M,"mousemove",N.onContextMouseMove);N.contextTriggerEvent.fire(M);N.show();N.hideProcId=N.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var M=this;return setTimeout(function(){M.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(Q,P){var M=this.element.offsetHeight,O=new YAHOO.util.Point(Q,P),N=C.getRegion(this.element);N.top-=5;N.left-=5;N.right+=5;N.bottom+=5;if(N.contains(O)){this.cfg.setProperty("y",(P-M-5));}},onRender:function(Q,P){function R(){var U=this.element,T=this._shadow;if(T){T.style.width=(U.offsetWidth+6)+"px";T.style.height=(U.offsetHeight+1)+"px";}}function N(){C.addClass(this._shadow,"yui-tt-shadow-visible");}function M(){C.removeClass(this._shadow,"yui-tt-shadow-visible");}function S(){var V=this._shadow,U,T,X,W;if(!V){U=this.element;T=YAHOO.widget.Module;X=YAHOO.env.ua.ie;W=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}V=F.cloneNode(false);U.appendChild(V);this._shadow=V;N.call(this);this.subscribe("beforeShow",N);this.subscribe("beforeHide",M);if(X==6||(X==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){R.call(W);},0);this.cfg.subscribeToConfigEvent("width",R);this.cfg.subscribeToConfigEvent("height",R);this.subscribe("changeContent",R);T.textResizeEvent.subscribe(R,this,true);this.subscribe("destroy",function(){T.textResizeEvent.unsubscribe(R,this);});}}}function O(){S.call(this);this.unsubscribe("beforeShow",O);}if(this.cfg.getProperty("visible")){S.call(this);}else{this.subscribe("beforeShow",O);}},destroy:function(){this._removeEventListeners();G.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(R,Q){YAHOO.widget.Panel.superclass.constructor.call(this,R,Q);};var I=YAHOO.lang,E=YAHOO.util.DD,F=YAHOO.util.Dom,P=YAHOO.util.Event,B=YAHOO.widget.Overlay,O=YAHOO.util.CustomEvent,C=YAHOO.util.Config,N=YAHOO.widget.Panel,H,L,D,A={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},J={"CLOSE":{key:"close",value:true,validator:I.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(E?true:false),validator:I.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:I.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:I.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};N.CSS_PANEL="yui-panel";N.CSS_PANEL_CONTAINER="yui-panel-container";N.FOCUSABLE=["a","button","select","textarea","input"];function M(R,Q){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function K(R,Q,S){var V=S[0],T=S[1],U=this.cfg,W=U.getProperty("width");if(W==T){U.setProperty("width",V);}this.unsubscribe("hide",K,S);}function G(R,Q){var V=YAHOO.env.ua.ie,U,T,S;if(V==6||(V==7&&document.compatMode=="BackCompat")){U=this.cfg;T=U.getProperty("width");if(!T||T=="auto"){S=(this.element.offsetWidth+"px");U.setProperty("width",S);this.subscribe("hide",K,[(T||""),S]);}}}YAHOO.extend(N,B,{init:function(R,Q){N.superclass.init.call(this,R);this.beforeInitEvent.fire(N);F.addClass(this.element,N.CSS_PANEL);this.buildWrapper();if(Q){this.cfg.applyConfig(Q,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",M);this.initEvent.fire(N);},_onElementFocus:function(Q){this.blur();},_addFocusHandlers:function(Y,S){var V=this,Z="focus",U="hidden";function X(a){if(a.type!==U&&!F.isAncestor(V.element,a)){P.on(a,Z,V._onElementFocus);return true;}return false;}var W=N.FOCUSABLE,Q=W.length,T=[];for(var R=0;R<Q;R++){T=T.concat(F.getElementsBy(X,W[R]));}this.focusableElements=T;},_removeFocusHandlers:function(T,S){var V=this.focusableElements,Q=V.length,R="focus";if(V){for(var U=0;U<Q;U++){P.removeListener(V[U],R,this._onElementFocus);}}},initEvents:function(){N.superclass.initEvents.call(this);var Q=O.LIST;this.showMaskEvent=this.createEvent(A.SHOW_MASK);this.showMaskEvent.signature=Q;this.hideMaskEvent=this.createEvent(A.HIDE_MASK);this.hideMaskEvent.signature=Q;this.dragEvent=this.createEvent(A.DRAG);this.dragEvent.signature=Q;},initDefaultConfig:function(){N.superclass.initDefaultConfig.call(this);this.cfg.addProperty(J.CLOSE.key,{handler:this.configClose,value:J.CLOSE.value,validator:J.CLOSE.validator,supercedes:J.CLOSE.supercedes});this.cfg.addProperty(J.DRAGGABLE.key,{handler:this.configDraggable,value:J.DRAGGABLE.value,validator:J.DRAGGABLE.validator,supercedes:J.DRAGGABLE.supercedes});this.cfg.addProperty(J.DRAG_ONLY.key,{value:J.DRAG_ONLY.value,validator:J.DRAG_ONLY.validator,supercedes:J.DRAG_ONLY.supercedes});this.cfg.addProperty(J.UNDERLAY.key,{handler:this.configUnderlay,value:J.UNDERLAY.value,supercedes:J.UNDERLAY.supercedes});this.cfg.addProperty(J.MODAL.key,{handler:this.configModal,value:J.MODAL.value,validator:J.MODAL.validator,supercedes:J.MODAL.supercedes});this.cfg.addProperty(J.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:J.KEY_LISTENERS.suppressEvent,supercedes:J.KEY_LISTENERS.supercedes});},configClose:function(S,Q,U){var V=Q[0],R=this.close;function T(X,W){W.hide();}if(V){if(!R){if(!D){D=document.createElement("span");D.innerHTML="&#160;";D.className="container-close";}R=D.cloneNode(true);this.innerElement.appendChild(R);P.on(R,"click",T,this);this.close=R;}else{R.style.display="block";}}else{if(R){R.style.display="none";}}},configDraggable:function(R,Q,S){var T=Q[0];if(T){if(!E){this.cfg.setProperty("draggable",false);return ;}if(this.header){F.setStyle(this.header,"cursor","move");this.registerDragDrop();
}this.subscribe("beforeShow",G);}else{if(this.dd){this.dd.unreg();}if(this.header){F.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",G);}},configUnderlay:function(b,a,V){var Z=YAHOO.env.ua,X=(this.platform=="mac"&&Z.gecko),Y=(Z.ie==6||(Z.ie==7&&document.compatMode=="BackCompat")),c=a[0].toLowerCase(),R=this.underlay,S=this.element;function d(){var e=this.underlay;F.addClass(e,"yui-force-redraw");window.setTimeout(function(){F.removeClass(e,"yui-force-redraw");},0);}function T(){var e=false;if(!R){if(!L){L=document.createElement("div");L.className="underlay";}R=L.cloneNode(false);this.element.appendChild(R);this.underlay=R;if(Y){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(Z.webkit&&Z.webkit<420){this.changeContentEvent.subscribe(d);}e=true;}}function W(){var e=T.call(this);if(!e&&Y){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(W);}function U(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(W);this._underlayDeferred=false;}if(R){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(d);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(R);this.underlay=null;}}switch(c){case"shadow":F.removeClass(S,"matte");F.addClass(S,"shadow");break;case"matte":if(!X){U.call(this);}F.removeClass(S,"shadow");F.addClass(S,"matte");break;default:if(!X){U.call(this);}F.removeClass(S,"shadow");F.removeClass(S,"matte");break;}if((c=="shadow")||(X&&!R)){if(this.cfg.getProperty("visible")){var Q=T.call(this);if(!Q&&Y){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(W);this._underlayDeferred=true;}}}},configModal:function(R,Q,T){var S=Q[0];if(S){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);B.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);B.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var R=this.mask,Q;if(R){this.hideMask();Q=R.parentNode;if(Q){Q.removeChild(R);}this.mask=null;}},configKeyListeners:function(T,Q,W){var S=Q[0],V,U,R;if(S){if(S instanceof Array){U=S.length;for(R=0;R<U;R++){V=S[R];if(!C.alreadySubscribed(this.showEvent,V.enable,V)){this.showEvent.subscribe(V.enable,V,true);}if(!C.alreadySubscribed(this.hideEvent,V.disable,V)){this.hideEvent.subscribe(V.disable,V,true);this.destroyEvent.subscribe(V.disable,V,true);}}}else{if(!C.alreadySubscribed(this.showEvent,S.enable,S)){this.showEvent.subscribe(S.enable,S,true);}if(!C.alreadySubscribed(this.hideEvent,S.disable,S)){this.hideEvent.subscribe(S.disable,S,true);this.destroyEvent.subscribe(S.disable,S,true);}}}},configHeight:function(T,R,U){var Q=R[0],S=this.innerElement;F.setStyle(S,"height",Q);this.cfg.refireEvent("iframe");},configWidth:function(T,Q,U){var S=Q[0],R=this.innerElement;F.setStyle(R,"width",S);this.cfg.refireEvent("iframe");},configzIndex:function(R,Q,T){N.superclass.configzIndex.call(this,R,Q,T);if(this.mask||this.cfg.getProperty("modal")===true){var S=F.getStyle(this.element,"zIndex");if(!S||isNaN(S)){S=0;}if(S===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var S=this.element.parentNode,Q=this.element,R=document.createElement("div");R.className=N.CSS_PANEL_CONTAINER;R.id=Q.id+"_c";if(S){S.insertBefore(R,Q);}R.appendChild(Q);this.element=R;this.innerElement=Q;F.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var R=this.underlay,Q;if(R){Q=this.element;R.style.width=Q.offsetWidth+"px";R.style.height=Q.offsetHeight+"px";}},registerDragDrop:function(){var R=this;if(this.header){if(!E){return ;}var Q=(this.cfg.getProperty("dragonly")===true);this.dd=new E(this.element.id,this.id,{dragOnly:Q});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var T,V,S,Y,X,W;if(YAHOO.env.ua.ie==6){F.addClass(R.element,"drag");}if(R.cfg.getProperty("constraintoviewport")){var U=B.VIEWPORT_OFFSET;T=R.element.offsetHeight;V=R.element.offsetWidth;S=F.getViewportWidth();Y=F.getViewportHeight();X=F.getDocumentScrollLeft();W=F.getDocumentScrollTop();if(T+U<Y){this.minY=W+U;this.maxY=W+Y-T-U;}else{this.minY=W+U;this.maxY=W+U;}if(V+U<S){this.minX=X+U;this.maxX=X+S-V-U;}else{this.minX=X+U;this.maxX=X+U;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}R.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){R.syncPosition();R.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}R.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){F.removeClass(R.element,"drag");}R.dragEvent.fire("endDrag",arguments);R.moveEvent.fire(R.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var Q=this.mask;if(!Q){if(!H){H=document.createElement("div");H.className="mask";H.innerHTML="&#160;";}Q=H.cloneNode(true);Q.id=this.id+"_mask";document.body.insertBefore(Q,document.body.firstChild);this.mask=Q;if(YAHOO.env.ua.gecko&&this.platform=="mac"){F.addClass(this.mask,"block-scrollbars");
}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();F.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){F.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=F.getDocumentHeight()+"px";this.mask.style.width=F.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var Q=F.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(Q)&&!isNaN(Q)){F.setStyle(this.mask,"zIndex",Q-1);}}},render:function(Q){return N.superclass.render.call(this,Q,this.innerElement);},destroy:function(){B.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){P.purgeElement(this.close);}N.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(L,K){YAHOO.widget.Dialog.superclass.constructor.call(this,L,K);};var J=YAHOO.util.Event,I=YAHOO.util.CustomEvent,D=YAHOO.util.Dom,B=YAHOO.util.KeyListener,H=YAHOO.util.Connect,F=YAHOO.widget.Dialog,E=YAHOO.lang,A={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},G={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};F.CSS_DIALOG="yui-dialog";function C(){var N=this._aButtons,L,M,K;if(E.isArray(N)){L=N.length;if(L>0){K=L-1;do{M=N[K];if(YAHOO.widget.Button&&M instanceof YAHOO.widget.Button){M.destroy();}else{if(M.tagName.toUpperCase()=="BUTTON"){J.purgeElement(M);J.purgeElement(M,false);}}}while(K--);}}}YAHOO.extend(F,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(G.POST_METHOD.key,{handler:this.configPostMethod,value:G.POST_METHOD.value,validator:function(K){if(K!="form"&&K!="async"&&K!="none"&&K!="manual"){return false;}else{return true;}}});this.cfg.addProperty(G.HIDEAFTERSUBMIT.key,{value:G.HIDEAFTERSUBMIT.value});this.cfg.addProperty(G.BUTTONS.key,{handler:this.configButtons,value:G.BUTTONS.value});},initEvents:function(){F.superclass.initEvents.call(this);var K=I.LIST;this.beforeSubmitEvent=this.createEvent(A.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=K;this.submitEvent=this.createEvent(A.SUBMIT);this.submitEvent.signature=K;this.manualSubmitEvent=this.createEvent(A.MANUAL_SUBMIT);this.manualSubmitEvent.signature=K;this.asyncSubmitEvent=this.createEvent(A.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=K;this.formSubmitEvent=this.createEvent(A.FORM_SUBMIT);this.formSubmitEvent.signature=K;this.cancelEvent=this.createEvent(A.CANCEL);this.cancelEvent.signature=K;},init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);D.addClass(this.element,F.CSS_DIALOG);this.cfg.setProperty("visible",false);if(K){this.cfg.applyConfig(K,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(F);},doSubmit:function(){var Q=this.form,O=false,N=false,P,K,M,L;switch(this.cfg.getProperty("postmethod")){case"async":P=Q.elements;K=P.length;if(K>0){M=K-1;do{if(P[M].type=="file"){O=true;break;}}while(M--);}if(O&&YAHOO.env.ua.ie&&this.isSecure){N=true;}L=(Q.getAttribute("method")||"POST").toUpperCase();H.setForm(Q,O,N);H.asyncRequest(L,Q.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var M=this.element.getElementsByTagName("form")[0],L=this,K,N;if(this.form){if(this.form==M&&D.isAncestor(this.element,this.form)){return ;}else{J.purgeElement(this.form);this.form=null;}}if(!M){M=document.createElement("form");M.name="frm_"+this.id;this.body.appendChild(M);}if(M){this.form=M;J.on(M,"submit",function(O){J.stopEvent(O);this.submit();this.form.blur();},this,true);this.firstFormElement=function(){var Q,P,O=M.elements.length;for(Q=0;Q<O;Q++){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();this.lastFormElement=function(){var Q,P,O=M.elements.length;for(Q=O-1;Q>=0;Q--){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();if(this.cfg.getProperty("modal")){K=this.firstFormElement||this.firstButton;if(K){this.preventBackTab=new B(K,{shift:true,keys:9},{fn:L.focusLast,scope:L,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}N=this.lastButton||this.lastFormElement;if(N){this.preventTabOut=new B(N,{shift:false,keys:9},{fn:L.focusFirst,scope:L,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(M,K,N){var O=K[0];function L(Q,P){P.cancel();}if(O){if(!this.close){this.close=document.createElement("div");D.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);J.on(this.close,"click",L,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(U,T,O){var P=YAHOO.widget.Button,W=T[0],M=this.innerElement,V,R,L,S,Q,K,N;C.call(this);this._aButtons=null;if(E.isArray(W)){Q=document.createElement("span");Q.className="button-group";S=W.length;this._aButtons=[];for(N=0;N<S;N++){V=W[N];if(P){L=new P({label:V.text,container:Q});R=L.get("element");if(V.isDefault){L.addClass("default");this.defaultHtmlButton=R;}if(E.isFunction(V.handler)){L.set("onclick",{fn:V.handler,obj:this,scope:this});
}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){L.set("onclick",{fn:V.handler.fn,obj:((!E.isUndefined(V.handler.obj))?V.handler.obj:this),scope:(V.handler.scope||this)});}}this._aButtons[this._aButtons.length]=L;}else{R=document.createElement("button");R.setAttribute("type","button");if(V.isDefault){R.className="default";this.defaultHtmlButton=R;}R.innerHTML=V.text;if(E.isFunction(V.handler)){J.on(R,"click",V.handler,this,true);}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){J.on(R,"click",V.handler.fn,((!E.isUndefined(V.handler.obj))?V.handler.obj:this),(V.handler.scope||this));}}Q.appendChild(R);this._aButtons[this._aButtons.length]=R;}V.htmlButton=R;if(N===0){this.firstButton=R;}if(N==(S-1)){this.lastButton=R;}}this.setFooter(Q);K=this.footer;if(D.inDocument(this.element)&&!D.isAncestor(M,K)){M.appendChild(K);}this.buttonSpan=Q;}else{Q=this.buttonSpan;K=this.footer;if(Q&&K){K.removeChild(Q);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var K=this._aButtons;if(K){return K;}},focusFirst:function(N,L,P){var M=this.firstFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(M){try{M.focus();}catch(O){}}else{this.focusDefaultButton();}},focusLast:function(N,L,P){var Q=this.cfg.getProperty("buttons"),M=this.lastFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(Q&&E.isArray(Q)){this.focusLastButton();}else{if(M){try{M.focus();}catch(O){}}}},focusDefaultButton:function(){var K=this.defaultHtmlButton;if(K){try{K.focus();}catch(L){}}},blurButtons:function(){var P=this.cfg.getProperty("buttons"),M,O,L,K;if(P&&E.isArray(P)){M=P.length;if(M>0){K=(M-1);do{O=P[K];if(O){L=O.htmlButton;if(L){try{L.blur();}catch(N){}}}}while(K--);}}},focusFirstButton:function(){var N=this.cfg.getProperty("buttons"),M,K;if(N&&E.isArray(N)){M=N[0];if(M){K=M.htmlButton;if(K){try{K.focus();}catch(L){}}}}},focusLastButton:function(){var O=this.cfg.getProperty("buttons"),L,N,K;if(O&&E.isArray(O)){L=O.length;if(L>0){N=O[(L-1)];if(N){K=N.htmlButton;if(K){try{K.focus();}catch(M){}}}}}},configPostMethod:function(L,K,M){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var a=this.form,M,T,W,O,U,R,Q,L,X,N,Y,b,K,P,c,Z,V;function S(e){var d=e.tagName.toUpperCase();return((d=="INPUT"||d=="TEXTAREA"||d=="SELECT")&&e.name==O);}if(a){M=a.elements;T=M.length;W={};for(Z=0;Z<T;Z++){O=M[Z].name;U=D.getElementsBy(S,"*",a);R=U.length;if(R>0){if(R==1){U=U[0];Q=U.type;L=U.tagName.toUpperCase();switch(L){case"INPUT":if(Q=="checkbox"){W[O]=U.checked;}else{if(Q!="radio"){W[O]=U.value;}}break;case"TEXTAREA":W[O]=U.value;break;case"SELECT":X=U.options;N=X.length;Y=[];for(V=0;V<N;V++){b=X[V];if(b.selected){K=b.value;if(!K||K===""){K=b.text;}Y[Y.length]=K;}}W[O]=Y;break;}}else{Q=U[0].type;switch(Q){case"radio":for(V=0;V<R;V++){P=U[V];if(P.checked){W[O]=P.value;break;}}break;case"checkbox":Y=[];for(V=0;V<R;V++){c=U[V];if(c.checked){Y[Y.length]=c.value;}}W[O]=Y;break;}}}}}return W;},destroy:function(){C.call(this);this._aButtons=null;var K=this.element.getElementsByTagName("form"),L;if(K.length>0){L=K[0];if(L){J.purgeElement(L);if(L.parentNode){L.parentNode.removeChild(L);}this.form=null;}}F.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML="&#160;";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,G){var I={attributes:{opacity:{from:0,to:1}},duration:G,method:C.easeIn};var F={attributes:{opacity:{to:0}},duration:G,method:C.easeOut};var H=new A(E,I,F,E.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;
if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(E.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(E.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(M,L,P){var N=B.getViewportWidth(),Q=B.getXY(P.overlay.element),O=Q[1];P.animOut.attributes.points.to=[(N+25),O];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.5.1",build:"984"});function CreateNamespace(){for(var A=0;A<arguments.length;A++){var D=arguments[A].split(".");var C=window;for(var B=0;B<D.length;B++){if(!C[D[B]]){C[D[B]]=new Object()}C=C[D[B]]}}}CreateNamespace("Pol.VI");Pol.VI.ConfigParams={BaseUrl:"http://in.pictometry.com/ImageNavigator/"};Pol.VI.ImageLevel={Neighborhood:"N",Community:"C"};Pol.VI.ImageType={Orthogonal:"Or",Oblique:"Ob"};Pol.VI.Orientation={North:"N",East:"E",South:"S",West:"W"};Pol.VI.Events={onclick:null,ondblclick:null,onmousedown:null,onmouseup:null,oncontextmenu:null,onstartmeasurement:null,onendmeasurement:null,onstartselect:null,onendselect:null,onviewchange:null,onscalechange:null,onresize:null,onedgedetect:null,onstartcontinuouspan:null,onstopcontinuouspan:null,onoverlayrendered:null,onnavigatefail:null,ongroundplanechange:null,onerror:null};Pol.VI.ImageEvent={mouse:{x:0,y:0},image:{x:0,y:0},type:null,target:null};Pol.VI.ViewEvent={view:{level:0,type:0,orientation:0},scale:1};Pol.VI.InfoEvent={status:0,reason:"OK"};Pol.VI.KeyEvent={type:null,keycode:0};Pol.VI.Status={status:0,reason:"OK",OK:{status:0,reason:"OK"},NoImagesAvailable:{status:1,reason:"No Images Available"},ServerError:{status:2,reason:"Server Error"},ServiceUnavailable:{status:3,reason:"Service Unavailable"},BadRequest:{status:4,reason:"Bad Request"},AuthorizationFailed:{status:5,reason:"Authorization Failed"},AccessDenied:{status:6,reason:"Access Denied"},UnknownRequest:{status:7,reason:"Unkown Request"},IncompleteRequest:{status:8,reason:"Incomplete Request"},DatabaseError:{status:9,reason:"Database Error"},BadResponse:{status:10,reason:"Bad Response Data"},SetViewFailed:{status:11,reason:"Set View Failed"},GeoBoundaryExceeded:{status:12,reason:"Geographic Boundary Exceeded"},NoDataAvailable:{status:13,reason:"No Data Available"}};Pol.VI.SearchRange={MostRecent:"M",LeastRecent:"L"};Pol.VI.SearchFilter={range:Pol.VI.SearchRange.MostRecent,depth:5};Pol.VI.Translate={LocationToImage:0,ImageToLocation:1};Pol.VI.DistanceUnits={Inches:0,Feet:1,Yards:2,Miles:3,Millimeters:4,Centimeters:5,Meters:6,Kilometers:7,NauticalMiles:8};Pol.VI.AreaUnits={SquareInches:0,SquareFeet:1,SquareYards:2,SquareMiles:3,SquareMillimeters:4,SquareCentimeters:5,SquareMeters:6,SquareKilometers:7,Acres:8,Hectares:9};Pol.VI.LocationUnits={Degrees:0,Radians:1};Pol.VI.AngleUnits={Degrees:0,Radians:1};Pol.VI.CoordinateFormats={DecimalDegree:0,DegreeMinute:1,DegreeMinuteSecond:2};Pol.VI.ExportTypes={Image:0,WorldFile:1,KML:2};Pol.VI.ImageFormats={JPEG:0,GIF:1,PNG:2};Pol.VI.ImageOptions={Date:1,NorthPointer:2};Pol.VI.AccessControl={Allow:0,Deny:1};YAHOO.util.CustomEvent.prototype.notify=function(B){var A=this.subscribers.length;for(var C=0;C<A;C++){var E=this.subscribers[C];if(E){var D=(E.override)?E.obj:this.scope;E.fn.call(D,B,E.obj)}}};Pol.VI.ImageNavigator=function(B,C){this.viewer=null;this.TileSize=256;this.EdgeLimit=100;this.ScaleFactor=1;this.ScaledPixels=Math.round(this.TileSize*this.ScaleFactor);this.HitSet={};this.OriginHitSet={};this.CurrentView=null;this.SearchFilter={range:Pol.VI.SearchRange.MostRecent,depth:5};this.SelectedView={level:Pol.VI.ImageLevel.Neighborhood,type:Pol.VI.ImageType.Oblique,orientation:Pol.VI.Orientation.North};this.AutoNavigate=false;this.EnableMousePan=true;this.EnableMouseWheelZoom=false;this.MouseWheelScaleIncr=0.25;this.EdgeDetected=false;this.Events=[];this.EventsList=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","oncontextmenu","onstartmeasurement","onendmeasurement","onstartselect","onendselect","onviewchange","onscalechange","onresize","onedgedetect","onstartcontinuouspan","onstopcontinuouspan","onoverlayrendered","onnavigatefail","ongroundplanechange","onkeydown","onkeyup","onerror"];this.ServerProxy=null;this.ScoreBias=1;this.TileServers=["http://ts0.pictometry.com/","http://ts1.pictometry.com/","http://ts2.pictometry.com/","http://ts3.pictometry.com/"];this.EdgeTile=new Image(this.TileSize,this.TileSize);this.MissingTile=new Image(this.TileSize,this.TileSize);this.GrabCursor="default";this.GrabbingCursor="default";this.NavigateCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/navigate.cur),pointer";this.NavigateOnSelect=false;this.ContinuousPanEnabled=false;this.SuppressPanning=false;this.HasPanned=false;this.TimerId=null;this.RequestTimeout=10000;this.StatisticsTimerId=null;this.StatisticsInterval=5000;this.ViewerElements=[];this.UserId=null;this.Statistics={searches:0,views:0,exports:0};this.ContinuousPanInterval=125;this.RequestType={Search:1,Navigate:2,Translate:3,Measure:4,Metadata:5,Bounds:6,Overlay:7,Export:8,Compute:9,Statistics:10,Link:11,Contour:12};this.ExportOverlay=false;this.Xpos=false;this.Xneg=false;this.Ypos=false;this.Yneg=false;this.AccessControlList=[[],[]];this.GeoFenceList=[];this.Logo=null;this.LogoText="";this.GroundPlane={capture:false,active:false,elevation:0,offset:0};this.TransactionObjs={search:null,navigate:null,translate:null};this.ViewFlags={isPar:1};this.Version="1.0.3.8";if(typeof B=="string"){B=document.getElementById(B)}if(B==null){return false}if(C==undefined){return false}if(C.UserId!=undefined){this.UserId=C.UserId}else{return false}if(C.ServerProxy!=undefined){this.ServerProxy=C.ServerProxy}else{return false}if(C.BaseUrl){Pol.VI.ConfigParams.BaseUrl=C.BaseUrl}if(C.SSL){Pol.VI.ConfigParams.BaseUrl=Pol.VI.ConfigParams.BaseUrl.replace(/http/,"https");for(var A=0;A<this.TileServers.length;A++){this.TileServers[A]=this.TileServers[A].replace(/http/,"https")}}if(C.TileServers!=undefined){this.TileServers.length=0;for(var A=0;A<C.TileServers.length;A++){this.TileServers.push(C.TileServers[A])}}if(C.AutoNavigate!=undefined){this.AutoNavigate=C.AutoNavigate}if(C.EnableMousePan!=undefined){this.EnableMousePan=C.EnableMousePan}if(C.EnableMouseWheelZoom!=undefined){this.EnableMouseWheelZoom=C.EnableMouseWheelZoom}this.viewer=B;this.viewer.portal=document.createElement("div");this.viewer.overlay=document.createElement("div");YAHOO.util.Dom.generateId(this.viewer.portal,"pol-vi-portal");this.viewer.portal.className="pol-vi-portal";YAHOO.util.Dom.generateId(this.viewer.overlay,"pol-vi-overlay");this.viewer.overlay.className="pol-vi-overlay";YAHOO.util.Dom.setStyle(this.viewer.overlay,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif)");this.viewer.portal.style.cursor="default";this.viewer.overlay.style.cursor="default";this.viewer.portal.style.width=this.viewer.style.width;this.viewer.portal.style.height=this.viewer.style.height;this.viewer.overlay.style.width=this.viewer.style.width;this.viewer.overlay.style.height=this.viewer.style.height;this.viewer.appendChild(this.viewer.portal);this.viewer.appendChild(this.viewer.overlay);this.ViewerElements.push(this.viewer);this.ViewerElements.push(this.viewer.portal);this.EdgeTile.src=Pol.VI.ConfigParams.BaseUrl+"i/edgetile.png";this.MissingTile.src=Pol.VI.ConfigParams.BaseUrl+"i/missingtile.png";this.Init=function(){try{document.execCommand("BackgroundImageCache",false,true)}catch(F){}this.viewer.style.display="block";var E=this.viewer.offsetWidth;var D=this.viewer.offsetHeight;this.viewer.style.width=E+"px";this.viewer.style.height=D+"px";this.viewer.dimensions={width:E,height:D,halfwidth:Math.round(E/2),halfheight:Math.round(D/2),tilesize:this.ScaledPixels,x:0,y:0};this.viewer.start={x:0,y:0};this.viewer.selected=false;this._CreateTiles();this._CreateEvents();this._SetCursors();this._InitOverlay();this._InitTools();this._InitExport();this._InitStatistics();this._InitLogo()};this._SenseSelect=function(F,K){var J=YAHOO.util.Event.getXY(F);var H=K._GetXY(K.viewer,J[0],J[1]);K.HasPanned=false;if(K.IsViewActive()){if(K.NavigateOnSelect){var E=K.CurrentView;var I=K.viewer.dimensions;var G=(H.x-I.halfwidth)+E.mx;var D=(H.y-I.halfheight)+E.my;K.viewer.overlay.style.cursor=K.GrabCursor;K.EdgeDetected=true;K.SetCenter(G,D);K._Navigate({isWalkingMan:true})}else{if(K.EnableMousePan){K.viewer.selected=true;K.viewer.start={x:H.x,y:H.y};K.viewer.overlay.style.cursor=K.GrabbingCursor;YAHOO.util.Event.removeListener(K.viewer.overlay,"mousemove",K._SenseMove);YAHOO.util.Event.addListener(K.viewer.overlay,"mousemove",K._SenseMove,K)}}K._OnMouseEventHandler(F,K)}};this._SenseRelease=function(E,J){var K=J.viewer;if(K.selected){var I=YAHOO.util.Event.getXY(E);var H=K.dimensions;var G=J._GetXY(K,I[0],I[1]);var F=Math.round((G.x-K.start.x)/J.ScaleFactor);var D=Math.round((G.y-K.start.y)/J.ScaleFactor);YAHOO.util.Event.removeListener(K.overlay,"mousemove",J._SenseMove);K.overlay.style.cursor=J.GrabCursor;K.selected=false;H.x+=(G.x-K.start.x);H.y+=(G.y-K.start.y);J._UpdateView(J,F,D);J._UpdateOverlay(J,F,D,false);J._OnMouseEventHandler(E,J)}};this._SenseMove=function(D,G){var F=YAHOO.util.Event.getXY(D);var E=G._GetXY(G.viewer,F[0],F[1]);if(G.SuppressPanning){return }G.HasPanned=true;G._PositionTiles(G,{x:E.x,y:E.y},false);G._PositionOverlay(G,{x:E.x,y:E.y})};this._OnMouseMove=function(O,G){if(G.AutoNavigate&&(G.CurrentView!=null)&&(G.viewer.selected==false)){var P=YAHOO.util.Event.getXY(O);var H=G._GetXY(G.viewer,P[0],P[1]);var K=G.CurrentView;var I=G.viewer.dimensions.halfwidth/G.ScaleFactor;var F=G.viewer.dimensions.halfheight/G.ScaleFactor;var N=H.x/G.ScaleFactor;var L=H.y/G.ScaleFactor;var E=(((K.mx-I)+N)<=G.EdgeLimit);var J=(((K.my-F)+L)<=G.EdgeLimit);var M=((K.width-(K.mx+N-I))<=G.EdgeLimit);var D=((K.height-(K.my+L-F))<=G.EdgeLimit);if(E||M||J||D){G.NavigateOnSelect=true;G.viewer.overlay.style.cursor=G.NavigateCursor;G.viewer.portal.style.cursor=G.NavigateCursor}else{G.NavigateOnSelect=false;G.viewer.overlay.style.cursor=G.GrabCursor;G.viewer.portal.style.cursor="default"}}};this._GetXY=function(G,D,H){var E={x:D,y:H};for(var F=G;F;F=F.offsetParent){E.x-=F.offsetLeft;E.y-=F.offsetTop}return E};this._CreateTiles=function(){this.viewer.tiles=[];var G=Math.ceil(this.viewer.dimensions.height/this.viewer.dimensions.tilesize)+1;var H=Math.ceil(this.viewer.dimensions.width/this.viewer.dimensions.tilesize)+1;for(var I=0;I<H;I++){var D=[];for(var F=0;F<G;F++){var E={c:I,r:F,img:document.createElement("img"),viewer:this.viewer};E.img.className="pol-vi-tile";E.img.style.width=this.viewer.dimensions.tilesize+"px";E.img.style.height=this.viewer.dimensions.tilesize+"px";E.img.src=this.MissingTile.src;E.img.style.top=(F*this.ScaledPixels)+"px";E.img.style.left=(I*this.ScaledPixels)+"px";this.viewer.portal.appendChild(E.img);D.push(E)}this.viewer.tiles.push(D)}this.viewer.tiles.rightedge=(H*this.viewer.dimensions.tilesize)-this.viewer.dimensions.tilesize;this.viewer.tiles.bottomedge=(G*this.viewer.dimensions.tilesize)-this.viewer.dimensions.tilesize};this._GetTileServer=function(D){return this.TileServers[D%this.TileServers.length]};this._BuildTileUrl=function(D,G,F){var E;if(D.flags&this.ViewFlags.isPar){E=this._GetTileServer(G+F)+"tiles/?i="+D.path+D.index+"&s=1.0&c="+G+"&r="+F+"&t="+this.UserId}else{E=this._GetTileServer(G+F)+D.path+D.index+"/"+G+"-"+F+".jpg?t="+this.UserId}return E};this._BuildThumbUrl=function(D){var E;if(D.flags&this.ViewFlags.isPar){E=this._GetTileServer(0)+"thumbs/?i="+D.path+D.index+"&t="+this.UserId}else{E=this._GetTileServer(0)+D.path+D.index+"/thumb.jpg?t="+this.UserId}return E};this._OnLoadTile=function(D){this.style.display="block"};this._OnErrorTile=function(D){var E=this.src;this.onerror=null;this.src=E};this._OnAbortTile=function(D){var E=this.src;this.onabort=null;this.src=E};this._LoadTile=function(E){var D=this.CurrentView;var F=(E.c<0)||(E.r<0)||(E.c>=(Math.round(D.width*this.ScaleFactor)/this.ScaledPixels))||(E.r>=(Math.round(D.height*this.ScaleFactor)/this.ScaledPixels));if(F){E.img.onload=null;E.img.onerror=null;E.img.onabort=null;E.img.src=null;E.img.style.display="none"}else{E.img.style.display="none";E.img.onload=this._OnLoadTile;E.img.onerror=this._OnErrorTile;E.img.onabort=this._OnAbortTile;E.img.src=this._BuildTileUrl(D,E.c,E.r)}};this._PositionTiles=function(F,H,E){var R=F.viewer.tiles;var G=F.viewer.dimensions;var K=G.tilesize;var I=K*-1;var Q=G.x+(H.x-F.viewer.start.x);var O=G.y+(H.y-F.viewer.start.y);for(var M=0,N=R.length;M<N;M++){for(var D=0,P=R[M].length;D<P;D++){var J=R[M][D];var L=false;J.x=(J.c*K)+Q;J.y=(J.r*K)+O;if(J.x>R.rightedge){do{J.c-=R.length;J.x=(J.c*K)+Q;L=true}while(J.x>G.width)}else{while(J.x<I){J.c+=R.length;J.x=(J.c*K)+Q;L=true}}if(J.y>R.bottomedge){do{J.r-=R[M].length;J.y=(J.r*K)+O;L=true}while(J.y>G.height)}else{while(J.y<I){J.r+=R[M].length;J.y=(J.r*K)+O;L=true}}J.img.style.top=Math.round(J.y)+"px";J.img.style.left=Math.round(J.x)+"px";if(E||L){F._LoadTile(J)}}}};this._UnloadTiles=function(){for(var F=0;F<this.viewer.tiles.length;F++){var D=this.viewer.tiles[F];for(var G=0;G<D.length;G++){var E=D[G];this.viewer.portal.removeChild(E.img);delete (E.img);delete (D[G])}delete (this.viewer.tiles[F])}this.viewer.tiles=null};this._IsViewValid=function(I,G,E){var D=false;var F=false;var H=false;switch(I){case Pol.VI.ImageLevel.Neighborhood:case Pol.VI.ImageLevel.Community:D=true;break;default:break}switch(G){case Pol.VI.ImageType.Oblique:F=true;switch(E){case Pol.VI.Orientation.North:case Pol.VI.Orientation.East:case Pol.VI.Orientation.South:case Pol.VI.Orientation.West:H=true;break;default:break}break;case Pol.VI.ImageType.Orthogonal:F=true;switch(E){case Pol.VI.Orientation.North:H=true;break;default:break}break;default:break}return D&&F&&H};this._GetBucketIndex=function(I,G,E){var D;var F;var H;switch(I){case Pol.VI.ImageLevel.Neighborhood:D=0;break;case Pol.VI.ImageLevel.Community:D=5;break;default:return -1}switch(G){case Pol.VI.ImageType.Oblique:F=0;break;case Pol.VI.ImageType.Orthogonal:F=4;break;default:return -1}switch(E){case Pol.VI.Orientation.North:H=0;break;case Pol.VI.Orientation.East:H=1;break;case Pol.VI.Orientation.South:H=2;break;case Pol.VI.Orientation.West:H=3;break;default:return -1}return D+F+H};this.Search=function(K,H,D,G){var I=(G==undefined)?null:G;if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.search)){YAHOO.util.Connect.abort(this.TransactionObjs.search)}if(this._IsLatLonValid(K,H)){if(this._IsWithinFence(K,H)){var F=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Search+"&x="+H+"&y="+K+"&sb="+this.ScoreBias+"&sy="+this.SearchFilter.range+"&bd="+this.SearchFilter.depth+"&ac="+YAHOO.lang.JSON.stringify(this.AccessControlList);var J={success:this._SearchSuccess,failure:this._SearchFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D,data:I}};this.CurrentView=null;this.Statistics.searches++;YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.search=YAHOO.util.Connect.asyncRequest("GET",F,J)}else{var E={status:Pol.VI.Status.GeoBoundaryExceeded.status,reason:Pol.VI.Status.GeoBoundaryExceeded.reason};if(I!=null){E.data=I}D(E)}}else{var E={status:Pol.VI.Status.BadRequest.status,reason:Pol.VI.Status.BadRequest.reason};if(I!=null){E.data=I}D(E)}};this._SearchSuccess=function(G){if(this.TransactionObjs.search.tId==G.tId){var E=this._GetStatus(G);try{this.HitSet=YAHOO.lang.JSON.parse(G.responseText);this.OriginHitSet=this.HitSet;for(var D=0;D<this.HitSet.images.length;D++){this.HitSet.images[D].iindex=0}}catch(F){E={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}G.argument.fn(E)}};this._SearchFailure=function(E){var D=this._GetStatus(E);this.HitSet={};this.OriginHitSet={};this.ClearView(this.MissingTile.src);E.argument.fn(D)};this.GetSearchFilter=function(){return this.SearchFilter};this.SetSearchFilter=function(D){if(D.range){this.SearchFilter.range=D.range}if(D.depth){this.SearchFilter.depth=D.depth}};this.Navigate=function(){this._Navigate({isWalkingMan:false})};this._Navigate=function(E){if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.navigate)){YAHOO.util.Connect.abort(this.TransactionObjs.navigate)}this.SuppressPanning=true;var F="["+this.Yneg+","+this.Ypos+","+this.Xneg+","+this.Xpos+"]";this.Yneg=this.Ypos=this.Xneg=this.Xpos=false;this.Statistics.searches++;var D=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Navigate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my+"&sb="+this.ScoreBias+"&sy="+this.SearchFilter.range+"&bd="+this.SearchFilter.depth+"&db="+F+"&ac="+YAHOO.lang.JSON.stringify(this.AccessControlList);this.CurrentView=null;var G={success:this._NavigateSuccess,failure:this._NavigateFailure,timeout:this.RequestTimeout,scope:this,argument:{isWalkingMan:E.isWalkingMan?E.isWalkingMan:false}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.navigate=YAHOO.util.Connect.asyncRequest("GET",D,G)};this._NavigateSuccess=function(H){if(this.TransactionObjs.navigate.tId==H.tId){var D=this.SelectedView;var F={nosync:true,fireviewchange:true,isWalkingMan:H.argument.isWalkingMan};try{this.HitSet=YAHOO.lang.JSON.parse(H.responseText);if(this._IsWithinFence(this.HitSet.region.y,this.HitSet.region.x)){for(var E=0;E<this.HitSet.images.length;E++){this.HitSet.images[E].iindex=0}if(this.SetView(D.level,D.type,D.orientation,F)==false){this.Events.onnavigatefail.notify(Pol.VI.Status.SetViewFailed)}}else{this.SetView(D.level,D.type,D.orientation,F);this.Events.onnavigatefail.notify(Pol.VI.Status.GeoBoundaryExceeded)}}catch(G){this.Events.onnavigatefail.notify(Pol.VI.Status.BadResponse)}}};this._NavigateFailure=function(E){var D=this._GetStatus(E);this.Events.onnavigatefail.notify(D);this.SuppressPanning=false};this.GetNextImage=function(){if(this.IsViewActive()){var D=this.CurrentView.bindex;var E=this.HitSet.images[D].iindex+1;var F=(E>=this.HitSet.images[D].length)?0:E;this.HitSet.images[D].iindex=F;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}};this.GetPrevImage=function(){if(this.IsViewActive()){var D=this.CurrentView.bindex;var E=this.HitSet.images[D].iindex-1;var F=(E<0)?this.HitSet.images[D].length-1:E;this.HitSet.images[D].iindex=F;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}};this.GotoImage=function(E){if(this.IsViewActive()){var D=this.CurrentView.bindex;E--;if((E>=0)||(E<this.HitSet.images[D].length)){this.HitSet.images[D].iindex=E;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}}};this.GetViewInfo=function(){var D={};if(this.IsViewActive()){var G=this.CurrentView.bindex;var E=[];for(var H=0;H<this.HitSet.images[G].length;H++){var I=this.HitSet.images[G][H];var F=this._BuildThumbUrl(I);E.push({position:H+1,name:I.name,year:I.date.year,month:I.date.month,day:I.date.day,thumb:F})}D={position:this.HitSet.images[G].iindex+1,count:this.HitSet.images[G].length,view:E}}return D};this._UpdateView=function(G,F,D){var E=G.CurrentView;if(E.mx==undefined){E.mx=E.x}if(E.my==undefined){E.my=E.y}E.mx-=F;E.my-=D};this._IsSynchronized=function(){var E=true;if(this.AutoNavigate){if(this.IsViewActive()){var D=this.CurrentView;if((D.mx!=undefined)&&(D.my!=undefined)){if((D.mx!=D.x)||(D.my!=D.y)){E=false}}}}return E};this.IsViewActive=function(){return(this.CurrentView==null)?false:true};this.SetView=function(E,K,G){var H=false;var L=null;var F=(arguments[3]!=undefined)?arguments[3]:{nosync:false,fireviewchange:true};if(this._IsViewValid(E,K,G)){this.SelectedView={level:E,type:K,orientation:G};this.ClearView();if(this._IsSynchronized()||F.nosync){var I=this._GetBucketIndex(E,K,G);if(this.HitSet.images[I].length>0){var N=this.HitSet.images[I].iindex;this.CurrentView=this.HitSet.images[I][N];this.CurrentView.bindex=I;L=this.CurrentView;if(L.x&&L.y){var J=this.viewer.dimensions;if((L.mx==undefined)&&(L.my==undefined)){J.x=(Math.round(L.x*this.ScaleFactor)-J.halfwidth)*-1;J.y=(Math.round(L.y*this.ScaleFactor)-J.halfheight)*-1;L.mx=L.x;L.my=L.y}else{J.x=(Math.round(L.mx*this.ScaleFactor)-J.halfwidth)*-1;J.y=(Math.round(L.my*this.ScaleFactor)-J.halfheight)*-1}this.viewer.start.x=this.viewer.start.y=0;this._PositionTiles(this,{x:0,y:0},true);this._AlignOverlay();this._UpdateLogo(L.cr);if(F.fireviewchange){this.Statistics.views++;var D={view:{level:E,type:K,orientation:G},scale:this.ScaleFactor,isWalkingMan:(F.isWalkingMan?F.isWalkingMan:false)};this.Events.onviewchange.notify(D)}this.SuppressPanning=false}else{var O=this;var M=function(P){O._ViewTranslateCb(P,I,N,F)};this.Translate([this.HitSet.region.y,this.HitSet.region.x],Pol.VI.Translate.LocationToImage,M)}H=true}}else{this.Navigate()}this.EdgeDetected=false}return H};this._ViewTranslateCb=function(H,D,F,G){if(H.status==0){var E=this.HitSet.images[D][F];E.x=H.points[0].x;E.y=H.points[0].y;G.nosync=true;G.fireviewchange=true;if(E===this.CurrentView){this.SetView(this.SelectedView.level,this.SelectedView.type,this.SelectedView.orientation,G)}}};this.GetView=function(){return this.SelectedView};this.ClearView=function(I){var F=(I==undefined)?this.EdgeTile.src:I;var E=this.viewer.tiles;for(var K=0,D=E.length;K<D;K++){for(var H=0,J=E[K].length;H<J;H++){var G=E[K][H];G.img.src=F}}};this.SetImageLevel=function(D){return this.IsViewActive()?this.SetView(D,this.CurrentView.type,this.CurrentView.orientation,{nosync:false,fireviewchange:true}):false};this.SetImageType=function(D){return this.IsViewActive()?this.SetView(this.CurrentView.level,D,Pol.VI.Orientation.North,{nosync:false,fireviewchange:true}):false};this.SetOrientation=function(D){return this.IsViewActive()?this.SetView(this.CurrentView.level,this.CurrentView.type,D,{nosync:false,fireviewchange:true}):false};this.SetAutoNavigate=function(D){if(D){this.AutoNavigate=true}else{this.AutoNavigate=false;this.NavigateOnSelect=false;this.viewer.overlay.style.cursor=this.GrabCursor;this.viewer.portal.style.cursor="default"}};this.GetAutoNavigate=function(){return this.AutoNavigate};this.SetMousePan=function(D){this.EnableMousePan=D;this._SetCursors()};this.GetMousePan=function(){return this.EnableMousePan};this.SetCursors=function(D){if(D.grab){this.GrabCursor="url("+D.grab+"),pointer"}if(D.grabbing){this.GrabbingCursor="url("+D.grabbing+"),pointer"}if(D.navigate){this.NavigateCursor="url("+D.navigate+"),pointer"}this.viewer.overlay.style.cursor=this.GrabCursor};this.ResetCursors=function(){this._SetCursors()};this._SetCursors=function(){if(this.EnableMousePan){this.GrabCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/grab.cur),pointer";this.GrabbingCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/grabbing.cur),move";this.viewer.overlay.style.cursor=this.GrabCursor}else{this.GrabCursor="default";this.GrabbingCursor="default";this.viewer.overlay.style.cursor=this.GrabCursor}this.NavigateCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/navigate.cur),crosshair"};this.SetMouseWheelZoom=function(D){this.EnableMouseWheelZoom=D;if(D){YAHOO.util.Event.addListener(this.viewer.overlay,"mousewheel",this._OnMouseWheel,this);YAHOO.util.Event.addListener(this.viewer.overlay,"DOMMouseScroll",this._OnMouseWheel,this);if(this.viewer.measure){YAHOO.util.Event.addListener(this.viewer.measure,"mousewheel",this._OnMouseWheel,this);YAHOO.util.Event.addListener(this.viewer.measure,"DOMMouseScroll",this._OnMouseWheel,this)}}else{YAHOO.util.Event.removeListener(this.viewer.overlay,"mousewheel",this._OnMouseWheel);YAHOO.util.Event.removeListener(this.viewer.overlay,"DOMMouseScroll",this._OnMouseWheel);if(this.viewer.measure){YAHOO.util.Event.removeListener(this.viewer.measure,"mousewheel",this._OnMouseWheel);YAHOO.util.Event.removeListener(this.viewer.measure,"DOMMouseScroll",this._OnMouseWheel)}}};this.GetMouseWheelZoom=function(){return this.EnableMouseWheelZoom};this.SetMouseWheelIncr=function(E){var D=parseFloat(E);if((D>=0.01)&&(D<=1)){this.MouseWheelScaleIncr=D}};this.GetMouseWheelIncr=function(){return this.MouseWheelScaleIncr};this._CreateEvents=function(){for(var E=0;E<this.EventsList.length;E++){var D=this.EventsList[E];this.Events[D]=new YAHOO.util.CustomEvent(D,this)}YAHOO.util.Event.addListener(this.viewer.overlay,"mousedown",this._SenseSelect,this);YAHOO.util.Event.addListener(this.viewer.portal,"mousedown",this._SenseSelect,this);YAHOO.util.Event.addListener(document,"mouseup",this._SenseRelease,this);YAHOO.util.Event.addListener(window,"mouseup",this._SenseRelease,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mousemove",this._OnMouseMove,this);YAHOO.util.Event.addListener(this.viewer.portal,"mousemove",this._OnMouseMove,this);YAHOO.util.Event.addListener(this.viewer.overlay,"click",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"dblclick",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"contextmenu",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mouseover",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mouseout",this._OnMouseEventHandler,this);if(this.EnableMouseWheelZoom){this.SetMouseWheelZoom(true)}};this._GetEventInfo=function(F){var E=this.CurrentView;var K=this.viewer.dimensions;var J=YAHOO.util.Event.getXY(F);var H=this._GetXY(this.viewer,J[0],J[1]);var G=0;var D=0;G=H.x-K.halfwidth;D=H.y-K.halfheight;G=Math.round(G/this.ScaleFactor);D=Math.round(D/this.ScaleFactor);var I={mouse:{x:H.x,y:H.y},image:{x:E.mx+G,y:E.my+D}};return I};this._IsEventValid=function(D){return(this.HasPanned&&(D.type=="click"))?false:true};this._OnMouseEventHandler=function(D,G){if(G.IsViewActive()&&G._IsEventValid(D)){var H=YAHOO.util.Event.getTarget(D);var F=G._GetEventInfo(D);F.type=D.type;while(H.id!=G.viewer.overlay.id){if(H.id in G.viewer.overlay.events){var E=G.viewer.overlay.events[H.id];F.target=E;E._EventHandler(F)}H=H.parentNode;if(H==null){break}}F.target=this;G.Events["on"+D.type].notify(F);YAHOO.util.Event.preventDefault(D)}};this._OnMouseWheel=function(D,E){var G;var F;if(D.wheelDelta){if(window.opera){G=-D.wheelDelta/40}else{G=D.wheelDelta/120}}else{if(D.detail){G=-D.detail}}F=E.ScaleFactor;if(G>0){F+=E.MouseWheelScaleIncr}else{F-=E.MouseWheelScaleIncr}if((F>=0.25)&&(F<=4)){E.SetScale(F)}};this.EnableKeyDown=function(D){if(this._KeyDownListener){this._KeyDownListener.disable()}this._KeyDownListener=new YAHOO.util.KeyListener(document,D,{fn:this._OnKeyEvent,scope:this,correctScope:true},YAHOO.util.KeyListener.KEYDOWN);this._KeyDownListener.enable()};this.DisableKeyDown=function(){if(this._KeyDownListener){this._KeyDownListener.disable()}};this.EnableKeyUp=function(D){if(this._KeyUpListener){this._KeyUpListener.disable()}this._KeyUpListener=new YAHOO.util.KeyListener(document,D,{fn:this._OnKeyEvent,scope:this,correctScope:true},YAHOO.util.KeyListener.KEYUP);this._KeyUpListener.enable()};this.DisableKeyUp=function(){if(this._KeyUpListener){this._KeyUpListener.disable()}};this._OnKeyEvent=function(D,F,G){if(G.IsViewActive()){var E={type:F[1].type,keycode:F[1].keyCode};G.Events["on"+E.type].notify(E)}};this.AttachEvent=function(F,E,D){var G=false;if(D==undefined){if(F in this.Events){this.Events[F].subscribe(E,this);G=true}}else{if(Pol.VI.OverlayUtil.IsValidShape(D)&&Pol.VI.OverlayUtil.IsValidEvent(F)){this.viewer.overlay.events[D.id]=D;D._AttachEvent(F,E);G=true}}return G};this.DetachEvent=function(F,E,D){var G=false;if(D==undefined){if(F in this.Events){this.Events[F].unsubscribe(E,this);G=true}}else{if(Pol.VI.OverlayUtil.IsValidShape(D)&&Pol.VI.OverlayUtil.IsValidEvent(F)){this.viewer.overlay.events[D.id]=null;delete this.viewer.overlay.events[D.id];D._DetachEvent(F,E);G=true}}return G};this.PanImage=function(H,G){var I=this.viewer.dimensions;var K=this.CurrentView;var J=((H==0)&&(G==0));var D=false;if(this.SuppressPanning||!this.IsViewActive()){return }if(J){this.HitSet=this.OriginHitSet;var F=this._GetBucketIndex(this.SelectedView.level,this.SelectedView.type,this.SelectedView.orientation);var L=this.HitSet.images[F].iindex;this.CurrentView=this.HitSet.images[F][L];this.CurrentView.bindex=F;K=this.CurrentView;I.x=(Math.round(K.x*this.ScaleFactor)-I.halfwidth)*-1;I.y=(Math.round(K.y*this.ScaleFactor)-I.halfheight)*-1;K.mx=K.x;K.my=K.y;D=true}else{I.x+=(Math.round(H*this.ScaleFactor))*-1;I.y+=(Math.round(G*this.ScaleFactor))*-1}this.viewer.start.x=0;this.viewer.start.y=0;this._PositionTiles(this,{x:0,y:0},D);this._UpdateView(this,(H*-1),(G*-1));var N=(Math.round(H*this.ScaleFactor))*-1;var M=(Math.round(G*this.ScaleFactor))*-1;this._PositionOverlay(this,{x:N,y:M});this._UpdateOverlay(this,H,G,true);if(J){this.Statistics.views++;var E={view:{level:this.level,type:this.type,orientation:this.orientation},scale:this.ScaleFactor,isWalkingMan:false};this.Events.onviewchange.notify(E)}this.Xpos=H>0;this.Xneg=H<0;this.Ypos=G>0;this.Yneg=G<0;this._EdgeDetect(this)};this.ContinuousPan=function(E,D){var F=this;var G=function(){F.PanImage(E,D)};if(this.SuppressPanning||!this.IsViewActive()||((E==0)&&(D==0))){return }this.Events.onstartcontinuouspan.notify(Pol.VI.Status.OK);if(this.ContinuousPanEnabled&&this.TimerId){window.clearInterval(this.TimerId)}this.TimerId=null;this.ContinuousPanEnabled=true;this.TimerId=window.setInterval(G,F.ContinuousPanInterval)};this.StopContinuousPan=function(){if(this.ContinuousPanEnabled){this.ContinuousPanEnabled=false;window.clearInterval(this.TimerId);this.TimerId=null;this.Events.onstopcontinuouspan.notify(Pol.VI.Status.OK)}};this.GetCenter=function(){return this.IsViewActive()?{x:this.CurrentView.mx,y:this.CurrentView.my}:{x:-1,y:-1}};this.SetCenter=function(G,F){if(this.IsViewActive()){var E=(G/this.ScaleFactor)-(this.CurrentView.mx/this.ScaleFactor);var D=(F/this.ScaleFactor)-(this.CurrentView.my/this.ScaleFactor);this.PanImage(E,D)}};this.GetViewer=function(){return this.viewer};this.SetViewerSize=function(F,D){var G;this._UnloadTiles();for(var E=0;E<this.ViewerElements.length;E++){this.ViewerElements[E].style.width=parseInt(F)+"px";this.ViewerElements[E].style.height=parseInt(D)+"px"}this.viewer.dimensions.width=F;this.viewer.dimensions.height=D;this.viewer.dimensions.halfwidth=Math.round(F/2);this.viewer.dimensions.halfheight=Math.round(D/2);this._CreateTiles();if(this.IsViewActive()){this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:false});G={view:{level:this.CurrentView.level,type:this.CurrentView.type,orientation:this.CurrentView.orientation},scale:this.ScaleFactor}}else{G={view:{level:-1,type:-1,orientation:-1},scale:this.ScaleFactor}}this._InitLogo();this.Events.onresize.notify(G)};this.GetViewerSize=function(){return{width:this.viewer.dimensions.width,height:this.viewer.dimensions.height}};this.GetViewerPosition=function(){var E=left=0;for(var D=this.viewer;D;D=D.offsetParent){E+=D.offsetTop;left+=D.offsetLeft}return{top:E,left:left}};this.SetScoreBias=function(D){this.ScoreBias=D};this.GetScoreBias=function(){return this.ScoreBias};this.SetScale=function(E){var D;this.ScaleFactor=E;this._UnloadTiles();this.viewer.dimensions.tilesize=this.ScaledPixels=Math.round(this.TileSize*this.ScaleFactor);this._CreateTiles();if(this.IsViewActive()){this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:false});D={view:{level:this.CurrentView.level,type:this.CurrentView.type,orientation:this.CurrentView.orientation},scale:this.ScaleFactor}}else{D={view:{level:-1,type:-1,orientation:-1},scale:this.ScaleFactor}}this._InitLogo();this.Events.onscalechange.notify(D)};this.SetOpacity=function(D){if((D<0)||(D>1)){return }var E=Math.floor(D*100);this.viewer.portal.style.opacity=D;this.viewer.portal.style.filter="alpha(opacity="+E+")"};this.Hide=function(){this.viewer.style.visibility="hidden"};this.Show=function(){this.viewer.style.visibility="visible"};this.IsAvailable=function(G,F,E){if(this._IsViewValid(G,F,E)){var D=this._GetBucketIndex(G,F,E);return(this.HitSet.images[D].length>0)?true:false}return false};this.FindFirstOblique=function(){var F=Pol.VI.ImageLevel;var H=Pol.VI.ImageType;var G=Pol.VI.Orientation;var D=[{l:F.Neighborhood,t:H.Oblique,o:G.North},{l:F.Neighborhood,t:H.Oblique,o:G.East},{l:F.Neighborhood,t:H.Oblique,o:G.South},{l:F.Neighborhood,t:H.Oblique,o:G.West},{l:F.Community,t:H.Oblique,o:G.North},{l:F.Community,t:H.Oblique,o:G.East},{l:F.Community,t:H.Oblique,o:G.South},{l:F.Community,t:H.Oblique,o:G.West}];for(var E in D){if(this.IsAvailable(D[E].l,D[E].t,D[E].o)){return{level:D[E].l,type:D[E].t,orientation:D[E].o}}}};this.GetX=function(){return this.IsViewActive()?this.CurrentView.x:-1};this.GetY=function(){return this.IsViewActive()?this.CurrentView.y:-1};this.GetWidth=function(){return this.IsViewActive()?this.CurrentView.width:-1};this.GetHeight=function(){return this.IsViewActive()?this.CurrentView.height:-1};this.GetLevel=function(){return this.IsViewActive()?this.CurrentView.level:-1};this.GetType=function(){return this.IsViewActive()?this.CurrentView.type:-1};this.GetOrientation=function(){return this.IsViewActive()?this.CurrentView.orientation:-1};this.GetHeading=function(){return this.IsViewActive()?this.CurrentView.heading:-1};this.GetDay=function(){return this.IsViewActive()?this.CurrentView.date.day:-1};this.GetMonth=function(){return this.IsViewActive()?this.CurrentView.date.month:-1};this.GetYear=function(){return this.IsViewActive()?this.CurrentView.date.year:-1};this.GetName=function(){return this.IsViewActive()?this.CurrentView.name:null};this.GetThumbnail=function(){return this.IsViewActive()?this._BuildThumbUrl(this.CurrentView):null};this.GetScale=function(){return this.ScaleFactor};this.GetVersion=function(){return this.Version};this.GetViewPort=function(){var E;var D;var G;var F=null;if(this.IsViewActive()){E=this.CurrentView;D=Math.round(this.viewer.dimensions.halfwidth/this.ScaleFactor);G=Math.round(this.viewer.dimensions.halfheight/this.ScaleFactor);F={ul:{x:E.mx-D,y:E.my-G},ur:{x:E.mx+D,y:E.my-G},lr:{x:E.mx+D,y:E.my+G},ll:{x:E.mx-D,y:E.my+G}}}return F};this.GetCenterLatLng=function(D){if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.translate)){YAHOO.util.Connect.abort(this.TransactionObjs.translate)}if(this.IsViewActive()){var F=[];F.push(this.CurrentView.mx);F.push(this.CurrentView.my);var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Translate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(F)+"&tt="+Pol.VI.Translate.ImageToLocation;var G={success:this._GetCenterLatLngSuccess,failure:this._GetCenterLatLngFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.translate=YAHOO.util.Connect.asyncRequest("GET",E,G)}};this._GetCenterLatLngSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,latitude:E[0].latitude,longitude:E[0].longitude}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetCenterLatLngFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.Translate=function(G,F,D){if(this.IsViewActive()){var E="id="+this.UserId+"&type="+this.RequestType.Translate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(G)+"&tt="+F;var H={success:this._TranslateSuccess,failure:this._TranslateFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D,tt:F}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,H,E)}};this._TranslateSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,type:H.argument.tt,points:E}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponses.reason}}H.argument.fn(D)};this._TranslateFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetMetaData=function(D){if(this.IsViewActive()){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Metadata+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my;var F={success:this._GetMetaDataSuccess,failure:this._GetMetaDataFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,F)}};this._GetMetaDataSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,latitude:E.latitude,longitude:E.longitude,altitude:E.altitude,elevation:E.elevation,declination:E.declination,bearing:E.bearing,roll:E.roll,camera:{latitude:E.camera.latitude,longitude:E.camera.longitude},ul:{latitude:E.ul.latitude,longitude:E.ul.longitude},ur:{latitude:E.ur.latitude,longitude:E.ur.longitude},lr:{latitude:E.lr.latitude,longitude:E.lr.longitude},ll:{latitude:E.ll.latitude,longitude:E.ll.longitude}}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetMetaDataFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetImageData=function(F,D){if(this.IsViewActive()){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Metadata+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(F);var G={success:this._GetImageDataSuccess,failure:this._GetImageDataFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,G)}};this._GetImageDataSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,path:E.path,pixels:E.pixels}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetImageDataFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetLatLngBounds=function(E){if(this.IsViewActive()){var D=Math.round(this.viewer.dimensions.halfwidth/this.ScaleFactor);var H=Math.round(this.viewer.dimensions.halfheight/this.ScaleFactor);var G=[];var I=[];G.push(this.CurrentView.mx-D);G.push(this.CurrentView.mx+D);G.push(this.CurrentView.mx+D);G.push(this.CurrentView.mx-D);I.push(this.CurrentView.my-H);I.push(this.CurrentView.my-H);I.push(this.CurrentView.my+H);I.push(this.CurrentView.my+H);var F=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Bounds+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my+"&xp="+G.toString()+"&yp="+I.toString();var J={success:this._GetLatLngBoundsSuccess,failure:this._GetLatLngBoundsFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:E}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",F,J)}};this._GetLatLngBoundsSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,center:{latitude:E.center.latitude,longitude:E.center.longitude},ul:{latitude:E.ul.latitude,longitude:E.ul.longitude},ur:{latitude:E.ur.latitude,longitude:E.ur.longitude},lr:{latitude:E.lr.latitude,longitude:E.lr.longitude},ll:{latitude:E.ll.latitude,longitude:E.ll.longitude}}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetLatLngBoundsFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetTileUrl=function(E,J){var G=null;var F;var D;if(this.IsViewActive()){if((E!=undefined)&&(J!=undefined)){F=E;D=J}else{F=this.CurrentView.mx;D=this.CurrentView.my}if((F<this.CurrentView.width)&&(D<this.CurrentView.height)&&(F>=0)&&(D>=0)){var I=Math.floor(F/this.TileSize);var H=Math.floor(D/this.TileSize);G=this._BuildTileUrl(this.CurrentView,I,H)}}return G};this._IsLatLonValid=function(G,E){var F=parseFloat(G);var D=parseFloat(E);if(isNaN(F)||isNaN(D)){return false}if((F<-90)||(F>90)){return false}if((D<-180)||(D>180)){return false}return true};this.SetEdgeLimit=function(D){if((D>=0)&&(D<=256)){this.EdgeLimit=D}};this.GetEdgeLimit=function(){return this.EdgeLimit};this.SetRequestTimeout=function(D){if(D>0){this.RequestTimeout=D}};this.GetRequestTimeout=function(){return this.RequestTimeout};this._EdgeDetect=function(K){if(K.AutoNavigate && !K.Measuring){var E=K.CurrentView;var D=K.viewer.dimensions.halfwidth/K.ScaleFactor;var H=K.viewer.dimensions.halfheight/K.ScaleFactor;var G=((E.width-(E.mx+D))<=K.EdgeLimit)&&K.Xpos;var J=((E.mx-D)<=K.EdgeLimit)&&K.Xneg;var I=((E.my-H)<=K.EdgeLimit)&&K.Yneg;var F=((E.height-(E.my+H))<=K.EdgeLimit)&&K.Ypos;if(J||G||I||F){if(K.EdgeDetected){return }K.EdgeDetected=true;K.Events.onedgedetect.notify(Pol.VI.Status.OK)}else{K.EdgeDetected=false}}};this._GetStatus=function(E){var D;switch(E.status){case 200:D=Pol.VI.Status.OK;break;case 401:D=Pol.VI.Status.AuthorizationFailed;break;case 403:D=Pol.VI.Status.AccessDenied;break;case 404:D=Pol.VI.Status.NoImagesAvailable;break;case 421:D=Pol.VI.Status.UnknownRequest;break;case 424:D=Pol.VI.Status.IncompleteRequest;break;case 425:D=Pol.VI.Status.NoDataAvailable;break;case 430:D=Pol.VI.Status.DatabaseError;break;case 503:D=Pol.VI.Status.ServiceUnavailable;break;default:D=Pol.VI.Status.ServerError;break}if(E.argument){if(E.argument.data!=null){D.data=E.argument.data}}return D};this._InitOverlay=function(){this.viewer.overlay.shapes=[];this.viewer.overlay.events=[];this.viewer.overlay.mx=0;this.viewer.overlay.my=0;this.viewer.overlay.renderer=Pol.VI.GetRenderer();this.viewer.overlay.renderer.Init(this.viewer.overlay);this.AttachEvent("onviewchange",this._OverlayViewChange);this.AttachEvent("onscalechange",this._OverlayScaleChange);this.ContourCfg={visible:false,units:Pol.VI.DistanceUnits.Feet,points:[],annotations:{color:"#ffffff",spacing:10,text:[]},minor:{width:1,increment:10,color:"#c0c0c0",draw:null},major:{width:2,steps:5,color:"#708a90",draw:null}};this.SetContourLinesCfg()};this._UpdateOverlay=function(H,F,D,I){var G=Math.round(F*H.ScaleFactor);var E=Math.round(D*H.ScaleFactor);if(I){G*=-1;E*=-1}H.viewer.overlay.mx+=G;H.viewer.overlay.my+=E};this._PositionOverlay=function(H,D){var J=H.viewer.start;var G=H.viewer.dimensions;var I=H.viewer.overlay;if((D.x==0)&&(D.y==0)){I.mx=G.halfwidth;I.my=G.halfheight}var F=I.mx+(D.x-J.x);var E=I.my+(D.y-J.y);I.style.top=E+"px";I.style.left=F+"px"};this.SetExportOverlay=function(D){this.ExportOverlay=D};this.GetExportOverlay=function(){return this.ExportOverlay};this.Export=function(I,H,K){if(this.IsViewActive()&&(Math.abs(I.lr.x-I.ul.x)>0)&&(Math.abs(I.lr.y-I.ul.y)>0)){this.Statistics.exports++;if(arguments.length==2){var E={id:this.UserId,type:this.RequestType.Export,table:this.CurrentView.table,index:this.CurrentView.index,ulx:I.ul.x,uly:I.ul.y,lrx:I.lr.x,lry:I.lr.y,ts:this.TileSize,et:H.type,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading};if(this.ExportOverlay&&(H.type!=Pol.VI.ExportTypes.WorldFile)){if(this._IsShapeData()){E.shapes=this._GetShapeInfo()}}if(H.type==Pol.VI.ExportTypes.KML){var D={id:this.UserId,tb:this.CurrentView.table,ii:this.CurrentView.index,sx:I.ul.x,sy:I.ul.y,ex:I.lr.x,ey:I.lr.y,ts:this.TileSize,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading,ds:0};E.qs=YAHOO.lang.JSON.stringify(D)}this._ExportImageForm.action=this.ServerProxy;while(this._ExportImageForm.hasChildNodes()){this._ExportImageForm.removeChild(this._ExportImageForm.lastChild)}for(var J in E){var F;if(YAHOO.env.ua.ie){F=document.createElement('<input name="'+J+'" >')}else{F=document.createElement("input");F.name=J}F.type="hidden";F.value=E[J];this._ExportImageForm.appendChild(F)}this._ExportImageForm.submit()}else{if(arguments.length==3){var E={id:this.UserId,tb:this.CurrentView.table,ii:this.CurrentView.index,sx:I.ul.x,sy:I.ul.y,ex:I.lr.x,ey:I.lr.y,ts:this.TileSize,et:H.type,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading,ds:0};var G=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Link+"&qs="+YAHOO.lang.JSON.stringify(E);var K={success:this._ExportLinkSuccess,failure:this._ExportLinkFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:K}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",G,K)}}}};this._ExportLinkSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,url:E.url}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponses.reason}}H.argument.fn(D)};this._ExportLinkFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this._InitExport=function(){this._ExportImageForm=document.createElement("form");this._ExportImageForm.method="post";this._ExportImageForm.style.visibility="hidden";this._ExportImageForm.style.position="absolute";document.body.appendChild(this._ExportImageForm);var D=YAHOO.util.Dom.generateId(this._ExportImageForm,"pol-vi-export");if(YAHOO.env.ua.ie){this._ExportImageIframe=document.createElement('<iframe name="'+D+'" />')}else{this._ExportImageIframe=document.createElement("iframe");this._ExportImageIframe.name=D}this._ExportImageIframe.src="javascript:false;";this._ExportImageIframe.style.visibility="hidden";this._ExportImageIframe.style.position="absolute";document.body.appendChild(this._ExportImageIframe);this._ExportImageForm.target=D};this.SetAccessControl=function(E,D){switch(E){case Pol.VI.AccessControl.Allow:case Pol.VI.AccessControl.Deny:this.AccessControlList[E]=D.split(",");break;default:break}};this.ResetAccessControl=function(D){switch(D){case Pol.VI.AccessControl.Allow:case Pol.VI.AccessControl.Deny:this.AccessControlList[D]=[];break;default:break}};this.AddGeoFence=function(H,F,G,D){var E=false;if((H<F)&&(G<D)){this.GeoFenceList.push({xmin:H,xmax:F,ymin:G,ymax:D});E=true}return E};this._IsWithinFence=function(G,E){var D=false;if(this.GeoFenceList.length>0){for(var F=0;F<this.GeoFenceList.length;F++){var H=this.GeoFenceList[F];if((G<=H.ymax)&&(G>=H.ymin)&&(E<=H.xmax)&&(E>=H.xmin)){D=true;break}}}else{D=true}return D};this._XmitStats=function(){var D=this.Statistics.views;if(D>0){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Statistics+"&v="+D;var F={scope:this,timeout:this.RequestTimeout};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,F)}this.Statistics.views-=D};this._InitStatistics=function(){var D=this;var E=function(){D._XmitStats()};this.StatisticsTimerId=window.setInterval(E,this.StatisticsInterval)};this._InitLogo=function(){var E=new Date();function D(){var H=navigator.userAgent.indexOf("MSIE ");if(H==-1){return false}var G=navigator.userAgent.substring(H+5);return(((G.indexOf("5.5")==0)||(G.indexOf("6")==0))&&(navigator.platform==("Win32")))}if(this.Logo){this.Logo.logodiv=null;this.Logo.destroy()}var F=document.createElement("div");YAHOO.util.Dom.generateId(F,"pol-vi-logo");F.className="pol-vi-logo";this.Logo=new YAHOO.widget.Overlay(F,{visible:true,zIndex:0});this.Logo.render(this.viewer.portal);YAHOO.util.Dom.setStyle(F,"zIndex",0);this.Logo.moveTo(YAHOO.util.Dom.getX(this.viewer)+5,YAHOO.util.Dom.getY(this.viewer)+this.viewer.offsetHeight-35);if(D()){YAHOO.util.Dom.setStyle(F,"filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Pol.VI.ConfigParams.BaseUrl+"i/poweredby.png, sizingMethod='crop')")}else{YAHOO.util.Dom.setStyle(F,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/poweredby.png)")}this.Logo.logodiv=F;this.Logo.logodiv.innerHTML='<span class="pol-vi-logo-text">&#169; 2000-'+E.getFullYear()+this.LogoText+"</span>"};this._UpdateLogo=function(D){var E=new Date();this.LogoText=' <span class="pol-vi-logo-text-supplemental">'+D+"</span>";this.Logo.logodiv.innerHTML='<span class="pol-vi-logo-text">&#169; 2000-'+E.getFullYear()+this.LogoText+"</span>"};this.ConvertCoordinate=function(L,E,O){var D;var G;var J;var P;var I;var K;var N;var F;var Q;var H;var M=null;if(O==Pol.VI.CoordinateFormats.DegreeMinute){if(L>=0){D=1}else{D=-1}if(E>=0){G=1}else{G=-1}J=Math.floor(Math.abs(L));P=Math.floor(Math.abs(E));I=Math.abs(L)-J;K=Math.abs(E)-P;N=I*60;F=K*60;M={latitude:(D*J)+" "+(Math.round(N*100)/100),longitude:(G*P)+" "+(Math.round(F*100)/100)}}if(O==Pol.VI.CoordinateFormats.DegreeMinuteSecond){if(L>=0){D=1}else{D=-1}if(E>=0){G=1}else{G=-1}J=Math.floor(Math.abs(L));P=Math.floor(Math.abs(E));I=Math.abs(L)-J;K=Math.abs(E)-P;I*=60;K*=60;N=Math.floor(I);F=Math.floor(K);Q=((I-N)*60);H=((K-F)*60);M={latitude:(D*J)+" "+N+" "+(Math.round(Q*100)/100),longitude:(G*P)+" "+F+" "+(Math.round(H*100)/100)}}return M};this.ExportImage=function(E,D){this.Export(E,{type:Pol.VI.ExportTypes.Image,image:D})};this.ExportWorldFile=function(D){this.Export(D,{type:Pol.VI.ExportTypes.WorldFile})};this.GetLink=function(F,D,E){this.Export(F,{type:Pol.VI.ExportTypes.Image,image:E},D)}};
Pol.VI.OverlayUtil={EventList:["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","oncontextmenu","onlocationchange"],IsValidShape:function(A){return(A instanceof Pol.VI.Marker||A instanceof Pol.VI.Element||A instanceof Pol.VI.Point||A instanceof Pol.VI.Polyline||A instanceof Pol.VI.Polygon||A instanceof Pol.VI.Circle||A instanceof Pol.VI.Text||A instanceof Pol.VI.Layer)},IsValidEvent:function(C){var B=false;for(var A=0;A<Pol.VI.OverlayUtil.EventList.length;A++){if(C===Pol.VI.OverlayUtil.EventList[A]){B=true;break}}return B},CreateCustomEvents:function(D){var C=[];for(var B=0;B<Pol.VI.OverlayUtil.EventList.length;B++){var A=Pol.VI.OverlayUtil.EventList[B];C[A]=new YAHOO.util.CustomEvent(A,D)}return C}};Pol.VI.OverlayShape={Marker:1,Element:2,Point:3,Polyline:4,Polygon:5,Circle:6,Text:7,Layer:8,Contour:9};Pol.VI.Pixel=function(A,B){this.x=parseInt(A);this.y=parseInt(B);this.Equals=function(D){var C=false;if(D instanceof Pol.VI.Pixel){C=((this.x==D.x)&&(this.y==D.y))}return C};this.toString=function(){return this.x+","+this.y}};Pol.VI.Size=function(B,A){this.width=parseInt(B);this.height=parseInt(A);this.Equals=function(D){var C=false;if(D instanceof Pol.VI.Size){C=((this.width==D.width)&&(this.height==D.height))}return C};this.toString=function(){return this.width+","+this.height}};Pol.VI.Icon=function(B,A){if(typeof B!="undefined"){if(B instanceof Pol.VI.Icon){this.image=B.image;this.iconSize=new Pol.VI.Size(B.iconSize.width,B.iconSize.height);this.iconAnchor=new Pol.VI.Pixel(B.iconAnchor.x,B.iconAnchor.y);if(typeof A!="undefined"){if(typeof A==="string"){this.image=A}}}}else{this.image=Pol.VI.ConfigParams.BaseUrl+"i/marker.png";this.iconSize=new Pol.VI.Size(20,34);this.iconAnchor=new Pol.VI.Pixel(10,34)}};Pol.VI.LatLng=function(B,A){this.lat=parseFloat(B);this.lng=parseFloat(A);this.precision=5e-7;this.SetLatLng=function(D,C){this.lat=parseFloat(D);this.lng=parseFloat(C)};this.Equals=function(E){var D=false;if(E instanceof Pol.VI.LatLng){var C=(Math.abs(this.lat-E.lat)<this.precision);var F=(Math.abs(this.lng-E.lng)<this.precision);D=C&&F}return D};this.DistanceTo=function(C){var D=NaN;if(C instanceof Pol.VI.LatLng){D=this._DistanceToHaversine(C)}return D};this.OverThere=function(C,I){var D=6371000;var H=this.toRad(this.lat);var F=this.toRad(this.lng);C=this.toRad(C);var G=Math.asin(Math.sin(H)*Math.cos(I/D)+Math.cos(H)*Math.sin(I/D)*Math.cos(C));var E=F+Math.atan2(Math.sin(C)*Math.sin(I/D)*Math.cos(H),Math.cos(I/D)-Math.sin(H)*Math.sin(G));E=(E+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(G)||isNaN(E)){return null}return new Pol.VI.LatLng(this.toDeg(G),this.toDeg(E))};this.BearingTo=function(E){var G=this.toRad(this.lat);var F=this.toRad(E.lat);var D=this.toRad(E.lng-this.lng);var H=Math.sin(D)*Math.cos(F);var C=Math.cos(G)*Math.sin(F)-Math.sin(G)*Math.cos(F)*Math.cos(D);return this.toBrng(Math.atan2(H,C))};this.Lat=function(){return this.lat};this.Lng=function(){return this.lng};this.toRad=function(C){return C*Math.PI/180};this.toDeg=function(C){return C*180/Math.PI};this.toString=function(){return this.lat+","+this.lng};this.toBrng=function(C){return(this.toDeg(C)+360)%360};this._DistanceToHaversine=function(G){var H=NaN;var F=6371000;var D=this.toRad(G.lat-this.lat);var E=this.toRad(G.lng-this.lng);var C=Math.sin(D/2)*Math.sin(D/2)+Math.cos(this.toRad(this.lat))*Math.cos(this.toRad(G.lat))*Math.sin(E/2)*Math.sin(E/2);var I=2*Math.atan2(Math.sqrt(C),Math.sqrt(1-C));H=F*I;return H}};Pol.VI.MarkerOptions=function(A){this.title=null,this.icon=null,this.draggable=null;if(typeof A!="undefined"){if(A.title){this.title=A.title}if(A.icon){this.icon=A.icon}if(A.draggable){this.draggable=A.draggable}}};Pol.VI.Marker=function(A,B){this.IsPNGandIE=function(D){if(D.toLowerCase().indexOf("png")==-1){return false}var E=navigator.userAgent.indexOf("MSIE ");if(E==-1){return false}var C=navigator.userAgent.substring(E+5);return(((C.indexOf("5.5")==0)||(C.indexOf("6")==0))&&(navigator.platform==("Win32")))};this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);this.point=A;this.options=null;this.visible=true;this.x=0;this.y=0;this.navigator=null;this.cursor="default";this.draggable=false;this.icon=new Pol.VI.Icon();this.image=document.createElement("img");YAHOO.util.Dom.generateId(this.image,"marker");this.id=this.image.id;this.DD=new YAHOO.util.DD(this.image.id);this.DD.lock();if(typeof B!="undefined"){this.options=B;if(B.title){this.image.title=this.image.alt=B.title}if(B.icon){if(B.icon instanceof Pol.VI.Icon){this.icon=B.icon}}if(B.draggable){if(typeof B.draggable=="boolean"){this.draggable=B.draggable}}}if(this.IsPNGandIE(this.icon.image)){this.image.src=Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif";this.image.className="pol-vi-marker";this.image.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.icon.image+"', sizingMethod='scale')"}else{this.image.src=this.icon.image;this.image.className="pol-vi-marker"}this.image.style.position="absolute";this.image.style.zIndex=1;this.image.style.width=this.icon.iconSize.width+"px";this.image.style.height=this.icon.iconSize.height+"px";this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.image.style.visibility="visible"};this.Hide=function(){this.visible=false;this.image.style.visibility="hidden"};this.GetPoint=function(){return this.point};this.SetPoint=function(C){this.point=C};this.GetOptions=function(){return this.options};this.GetId=function(){return this.image.id};this.SetDraggable=function(C){if(this.navigator){this.DD.lock();this.DD.unsubscribe("mouseUpEvent",this._OnDDMouseEvent,this);this.DD.unsubscribe("mouseDownEvent",this._OnDDMouseEvent,this);this.DD.unsubscribe("endDragEvent",this._OnEndDrag,this);this.image.style.cursor=this.cursor;if(C){this.DD.subscribe("endDragEvent",this._OnEndDrag,this);this.DD.subscribe("mouseDownEvent",this._OnDDMouseEvent,this);this.DD.subscribe("mouseUpEvent",this._OnDDMouseEvent,this);this.DD.unlock();this.image.style.cursor="move"}}this.draggable=C};this.IsDraggable=function(){return this.draggable};this._DDtranslateCB=function(C){this.SetPoint(new Pol.VI.LatLng(C.points[0].latitude,C.points[0].longitude));this.DDevent.type="locationchange";this.DDevent.target=this;this.Events["on"+this.DDevent.type].notify(this.DDevent);this.DDevent=null};this._OnEndDrag=function(C,F){var E=Math.round(parseInt(F.image.style.top)/F.navigator.ScaleFactor);var D=Math.round(parseInt(F.image.style.left)/F.navigator.ScaleFactor);F.x=D+Math.round(F.icon.iconAnchor.x/F.navigator.ScaleFactor);F.y=E+Math.round(F.icon.iconAnchor.y/F.navigator.ScaleFactor);F.DDevent=F.navigator._GetEventInfo(C.e);F.navigator.Translate([F.x,F.y],Pol.VI.Translate.ImageToLocation,function(G){F._DDtranslateCB(G)})};this._OnDDMouseEvent=function(C,D){D.navigator._OnMouseEventHandler((C.e)?C.e:C,D.navigator)};this._AttachEvent=function(D,C){this.Events[D].subscribe(C,this);if(D!="onlocationchange"){this.cursor="pointer"}this.image.style.cursor=this.cursor};this._DetachEvent=function(D,C){this.Events[D].unsubscribe(C,this);this.cursor="default";this.image.style.cursor=this.cursor};this._EventHandler=function(C){this.Events["on"+C.type].notify(C)};this._Add=function(C){this.navigator=C;this.navigator.viewer.overlay.appendChild(this.image);if(this.IsDraggable()){this.SetDraggable(true)}};this._Remove=function(){this.SetDraggable(false);this.navigator.viewer.overlay.removeChild(this.image);this.navigator=null};this._SaveCoords=function(C){this.x=C[0];this.y=C[1]};this._Draw=function(D){if(this.visible){var E=Math.round(this.x*D);var C=Math.round(this.y*D);this.image.style.top=(C-this.icon.iconAnchor.y)+"px";this.image.style.left=(E-this.icon.iconAnchor.x)+"px";this.image.style.visibility="visible"}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Marker+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var C={st:Pol.VI.OverlayShape.Marker,lk:this.icon.image,cx:this.x,cy:this.y,ax:this.icon.iconAnchor.x,ay:this.icon.iconAnchor.y,iw:this.icon.iconSize.width,ih:this.icon.iconSize.height};return YAHOO.lang.JSON.stringify(C)}};Pol.VI.ElementOptions=function(A){this.id=null,this.size=null,this.className=null,this.innerHTML=null,this.zIndex=null,this.anchor=null;if(typeof A!="undefined"){if(A.id){this.id=A.id}if(A.size){this.size=A.size}if(A.className){this.className=A.className}if(A.innerHTML){this.innerHTML=A.innerHTML}if(A.zIndex){this.zIndex=A.zIndex}if(A.anchor){this.anchor=A.anchor}}};Pol.VI.Element=function(A,C){this.point=A;this.options=null;this.x=0;this.y=0;this.viewer=null;this.navigator=null;this.visible=true;this.cursor="default";this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);this.Element=document.createElement("div");this.Element.style.position="absolute";this.Element.style.visibility="hidden";this.Element.style.zIndex=1;this.Element.size={width:0,height:0};this.Element.anchor={x:0,y:0};if(typeof C!="undefined"){this.options=C;if(C.size){var B=parseInt(C.size.width);var D=parseInt(C.size.height);this.Element.size=C.size;this.Element.style.width=B+"px";this.Element.style.height=D+"px";this.Element.anchor.x=Math.round(C.size.width/2);this.Element.anchor.y=Math.round(C.size.height/2)}if(C.className){this.Element.className=C.className}if(C.innerHTML){this.Element.innerHTML=C.innerHTML}if(C.zIndex){this.Element.stlye.zIndex=C.zIndex}if(C.anchor){this.Element.anchor=C.anchor}}YAHOO.util.Dom.generateId(this.Element,((C&&C.id)?C.id:"element"));this.id=this.Element.id;this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.Element.style.visibility="visible"};this.Hide=function(){this.visible=false;this.Element.style.visibility="hidden"};this.GetPoint=function(){return this.point};this.SetPoint=function(E){this.point=E};this.GetOptions=function(){return this.options};this.SetOptions=function(F){if(typeof F!="undefined"){this.options=F;if(F.size){var E=parseInt(F.size.width);var G=parseInt(F.size.height);this.Element.size=F.size;this.Element.style.width=E+"px";this.Element.style.height=G+"px";this.Element.anchor.x=Math.round(F.size.width/2);this.Element.anchor.y=Math.round(F.size.height/2)}if(F.className){this.Element.className=F.className}if(F.innerHTML){this.Element.innerHTML=F.innerHTML}if(F.zIndex){this.Element.stlye.zIndex=F.zIndex}if(F.anchor){this.Element.anchor=F.anchor}this._Draw(this.navigator.ScaleFactor)}};this.GetId=function(){return this.Element.id};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.Element.style.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.Element.style.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._Add=function(E){this.viewer=E.viewer;this.navigator=E;this.viewer.overlay.appendChild(this.Element);this.Element.style.cursor=this.cursor};this._Remove=function(){this.viewer.overlay.removeChild(this.Element)};this._SaveCoords=function(E){this.x=E[0];this.y=E[1]};this._Draw=function(F){if(this.visible){var G=Math.round(this.x*F);var E=Math.round(this.y*F);this.Element.style.top=(E-this.Element.anchor.y)+"px";this.Element.style.left=(G-this.Element.anchor.x)+"px";this.Element.style.visibility="visible"}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Element+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Element,cx:this.x,cy:this.y,ax:this.Element.anchor.x,ay:this.Element.anchor.y};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Point=function(A,D,C,B){this.point=A;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"point");this.xy=[];this.shape=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.radius="5";this.cursor="default";if(typeof D!="undefined"){this.strokeColor=D}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(E){this.strokeColor=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor});this.renderer.SetAttributes(this.shape,{fillColor:this.strokeColor})}};this.SetStrokeWeight=function(E){this.strokeWeight=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(E){this.strokeOpacity=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity});this.renderer.SetAttributes(this.shape,{fillOpacity:this.strokeOpacity})}};this.GetPoint=function(){return this.point};this.SetPoint=function(E){this.point=E};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._SaveCoords=function(E){this.xy[0]=E[0];this.xy[1]=E[1]};this._Add=function(E){this.renderer=E.viewer.overlay.renderer;this.shape=this.renderer.Create("circle",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.strokeColor);this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(F){if(this.visible){var E=[];E[0]=Math.round(this.xy[0]*F);E[1]=Math.round(this.xy[1]*F);this.renderer.SetAttributes(this.shape,{center:E.join(","),radius:this.radius})}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Point+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Point,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,pr:parseInt(this.radius),sp:this.xy};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Polyline=function(C,D,B,A){this.points=C;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"polyline");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.cursor="default";this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.strokeLinecap="butt";this.strokeLinejoin="miter";if(typeof D!="undefined"){this.strokeColor=D}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeWeight=parseInt(B)}else{this.strokeWeight=B}}if(typeof A!="undefined"){if(typeof A=="string"){this.strokeOpacity=parseFloat(A)}else{this.strokeOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(E){this.strokeColor=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(E){this.strokeWeight=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(E){this.strokeOpacity=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetLinecap=function(E){this.strokeLinecap=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeLinecap:this.strokeLinecap})}};this.SetLinejoin=function(E){this.strokeLinejoin=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeLinejoin:this.strokeLinejoin})}};this.GetPoints=function(){return this.points};this.SetPoints=function(E){this.points=E};this.GetDistance=function(F,E){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,F,E)};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._SaveCoords=function(F){for(var E=0;E<F.length;E++){this.xy[E]=F[E]}};this._Add=function(E){this.navigator=E;this.renderer=E.viewer.overlay.renderer;this.shape=this.renderer.Create("polyline",this.strokeColor,this.strokeWeight,this.strokeOpacity);this.renderer.SetAttributes(this.shape,{strokeLinecap:this.strokeLinecap});this.renderer.SetAttributes(this.shape,{strokeLinejoin:this.strokeLinejoin});this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(G){if(this.visible){var F=[];for(var E=0;E<this.xy.length;E++){F[E]=Math.round(this.xy[E]*G)}this.renderer.SetAttributes(this.shape,{points:F.join(",")})}};this._Stringify=function(){var E=[];for(var F=0;F<this.points.length;F++){E.push(this.points[F].lat+","+this.points[F].lng)}return"["+Pol.VI.OverlayShape.Polyline+","+E.join(",")+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Polyline,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,sp:this.xy};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Polygon=function(D,E,C,B,F,A){this.points=D;if(this.points.length>0){if(this.points[0] instanceof Array){this.OuterRing=this.points[0];this.InnerRing=this.points.slice(1)}else{this.OuterRing=this.points;this.InnerRing=[]}}else{this.OuterRing=[];this.InnerRing=[]}this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"polygon");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.fill=false;this.fillColor="#000000";this.fillOpacity=1;this.cursor="default";if(typeof E!="undefined"){this.strokeColor=E}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}if(typeof F!="undefined"){this.fill=true;this.fillColor=F}if(typeof A!="undefined"){if(typeof A=="string"){this.fillOpacity=parseFloat(A)}else{this.fillOpacity=A}}this._IsFillPolygon=function(){return this.fill};this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(G){this.strokeColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(G){this.strokeWeight=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(G){this.strokeOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetFillColor=function(G){this.fillColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.fillColor})}};this.SetFillOpacity=function(G){this.fillOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.fillOpacity})}};this.GetPoints=function(){return this.points};this.SetPoints=function(G){this.points=G;if(this.points.length>0){if(this.points[0] instanceof Array){this.OuterRing=this.points[0];this.InnerRing=this.points.slice(1)}else{this.OuterRing=this.points;this.InnerRing=[]}}else{this.OuterRing=[];this.InnerRing=[]}};this.GetArea=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Area,H,G)};this.GetDistance=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,H,G)};this._AttachEvent=function(H,G){this.Events[H].subscribe(G,this);this.cursor="pointer"};this._DetachEvent=function(H,G){this.Events[H].unsubscribe(G,this);this.cursor="default"};this._EventHandler=function(G){this.Events["on"+G.type].notify(G)};this._SaveCoords=function(H){for(var G=0;G<H.length;G++){this.xy[G]=H[G]}};this._Add=function(G){this.navigator=G;this.renderer=G.viewer.overlay.renderer;if(this.fill){this.shape=this.renderer.Create("path",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.fillColor,this.fillOpacity);this.renderer.SetAttributes(this.shape,{fillRule:"evenodd"})}else{this.shape=this.renderer.Create("path",this.strokeColor,this.strokeWeight,this.strokeOpacity)}this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(M){if(this.visible){var L=[];var H;var G=this.OuterRing.length*2;for(var I=0;I<this.xy.length;I++){L[I]=Math.round(this.xy[I]*M)}H=this.shape.moveto+L[0]+" "+L[1]+this.shape.lineto+L.slice(2,G).join(" ")+this.shape.closepath;for(var I=0,J=G;I<this.InnerRing.length;I++){var K=this.InnerRing[I].length*2;H+=this.shape.moveto+L[J]+" "+L[J+1]+this.shape.lineto+L.slice(J+2,J+K).join(" ")+this.shape.closepath;J+=K}H+=this.shape.endpath;this.renderer.SetAttributes(this.shape,{d:H})}};this._Stringify=function(){var G=[];for(var I=0;I<this.OuterRing.length;I++){G.push(this.OuterRing[I].lat+","+this.OuterRing[I].lng)}for(var I=0;I<this.InnerRing.length;I++){for(var H=0;H<this.InnerRing[I].length;H++){G.push(this.InnerRing[I][H].lat+","+this.InnerRing[I][H].lng)}}return"["+Pol.VI.OverlayShape.Polygon+","+G.join(",")+"]"};this._Encode=function(){var J;var K;if(this.InnerRing.length>0){var M=this.OuterRing.length*2;J=this.xy.slice(0,M);J.push(this.xy[0],this.xy[1]);K=[this.OuterRing.length];for(var H=0,I=M;H<this.InnerRing.length;H++){var L=this.InnerRing[H].length*2;J=J.concat(this.xy.slice(I,I+L));J.push(this.xy[I],this.xy[I+1]);I+=L;K.push(this.InnerRing[H].length)}}else{J=this.xy.slice(0);K=[this.OuterRing.length]}var G={st:Pol.VI.OverlayShape.Polygon,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,fi:this.fill,fc:this.fillColor,fo:this.fillOpacity,sp:J,nr:K};return YAHOO.lang.JSON.stringify(G)}};Pol.VI.Circle=function(D,E,C,B,F,A){this.points=D;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"circle");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.fill=false;this.fillColor="#000000";this.fillOpacity=1;this.cursor="default";if(typeof E!="undefined"){this.strokeColor=E}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}if(typeof F!="undefined"){this.fill=true;this.fillColor=F}if(typeof A!="undefined"){if(typeof A=="string"){this.fillOpacity=parseFloat(A)}else{this.fillOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(G){this.strokeColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(G){this.strokeWeight=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(G){this.strokeOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetFillColor=function(G){this.fillColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.fillColor})}};this.SetFillOpacity=function(G){this.fillOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.fillOpacity})}};this.GetPoints=function(){return this.points};this.SetPoints=function(G){this.points=G};this.GetArea=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Area,H,G)};this.GetDistance=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,H,G)};this._AttachEvent=function(H,G){this.Events[H].subscribe(G,this);this.cursor="pointer"};this._DetachEvent=function(H,G){this.Events[H].unsubscribe(G,this);this.cursor="default"};this._EventHandler=function(G){this.Events["on"+G.type].notify(G)};this._SaveCoords=function(H){for(var G=0;G<H.length;G++){this.xy[G]=H[G]}};this._Add=function(G){this.navigator=G;this.renderer=G.viewer.overlay.renderer;if(this.fill){this.shape=this.renderer.Create("ellipse",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.fillColor,this.fillOpacity)}else{this.shape=this.renderer.Create("ellipse",this.strokeColor,this.strokeWeight,this.strokeOpacity)}this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(L){if(this.visible){var K=[];var J;for(J=0;J<this.xy.length;J++){K[J]=Math.round(this.xy[J]*L)}var G=K[0];var N=K[1];var H=K.slice(2);var I=Math.abs(H[0]-G);var M=Math.abs(H[1]-N);for(J=2;J<H.length;J+=2){I=Math.max(Math.abs(H[J]-G),I);M=Math.max(Math.abs(H[J+1]-N),M)}this.renderer.SetAttributes(this.shape,{center:G+","+N,radius:I+","+M})}};this._Stringify=function(){if(this.points.radius.distance){return"["+Pol.VI.OverlayShape.Circle+","+this.points.center.lat+","+this.points.center.lng+","+this.points.radius.distance+","+this.points.radius.unit+","+0+"]"}else{return"["+Pol.VI.OverlayShape.Circle+","+this.points.center.lat+","+this.points.center.lng+","+this.points.radius.lat+","+this.points.radius.lng+","+1+"]"}};this._Encode=function(){var G={st:Pol.VI.OverlayShape.Circle,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,fc:this.fillColor,fo:this.fillOpacity,sp:this.xy};return YAHOO.lang.JSON.stringify(G)}};Pol.VI.Text=function(B,D,A,F,C,G,E){this.point=B;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"text");this.text=null;this.xy=[];this.shape=null;this.renderer=null;this.color="#0000ff";this.fontFamily="Verdana";this.fontSize="12px";this.fontWeight="normal";this.fontStyle="normal";this.opacity=1;this.anchor="middle";this.cursor="default";if(typeof D!="undefined"){this.color=D}if(typeof A!="undefined"){this.fontFamily=A}if(typeof F!="undefined"){this.fontSize=F}if(typeof C!="undefined"){this.fontWeight=C}if(typeof G!="undefined"){this.fontStyle=G}if(typeof E!="undefined"){if(typeof E=="string"){this.opacity=parseFloat(E)}else{this.opacity=E}}this.SetColor=function(H){this.color=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.color});this.renderer.SetAttributes(this.shape,{textColor:this.color})}};this.SetFontFamily=function(H){this.fontFamily=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontFamily:this.fontFamily})}};this.SetFontSize=function(H){this.fontSize=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontSize:this.fontSize})}};this.SetFontWeight=function(H){this.fontWeight=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontWeight:this.fontWeight})}};this.SetFontStyle=function(H){this.fontStyle=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontStyle:this.fontStyle})}};this.SetOpacity=function(H){this.opacity=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.opacity});this.renderer.SetAttributes(this.shape,{textOpacity:this.opacity})}};this.SetAnchor=function(H){this.anchor=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{textAnchor:this.anchor})}};this.AddText=function(H){this.text=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{text:this.text})}};this.GetText=function(){return this.text};this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.GetPoint=function(){return this.point};this.SetPoint=function(H){this.point=H};this._AttachEvent=function(I,H){this.Events[I].subscribe(H,this);this.cursor="pointer"};this._DetachEvent=function(I,H){this.Events[I].unsubscribe(H,this);this.cursor="default"};this._EventHandler=function(H){this.Events["on"+H.type].notify(H)};this._SaveCoords=function(H){this.xy[0]=H[0];this.xy[1]=H[1]};this._Add=function(H){this.renderer=H.viewer.overlay.renderer;this.shape=this.renderer.Create("text","none","1","1.0",this.color,this.opacity);this.renderer.SetAttributes(this.shape,{text:this.text,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontStyle:this.fontStyle,textColor:this.color,textOpacity:this.opacity,textAnchor:this.anchor});this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(I){if(this.visible){var H=[];H[0]=Math.round(this.xy[0]*I);H[1]=Math.round(this.xy[1]*I);this.renderer.SetAttributes(this.shape,{x:H[0],y:H[1]})}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Text+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var H={st:Pol.VI.OverlayShape.Text,fc:this.color,ff:this.fontFamily,fs:this.fontSize,fw:this.fontWeight,fy:this.fontStyle,fo:this.opacity,ac:this.anchor,tx:this.text,sp:this.xy};return YAHOO.lang.JSON.stringify(H)}};Pol.VI.Layer=function(D,C,B,E,A){this.shapes=[];this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"layer");this.sid=0;this.xy=[];this.DrawPolygons=null;this.DrawPolylines=null;this.DrawPoints=null;this.renderer=null;this.navigator=null;this.PolygonAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.PolylineAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.PointAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.cursor="default";if(typeof D!="undefined"){this.PolygonAttr.strokeColor=this.PolylineAttr.strokeColor=this.PointAttr.strokeColor=D}if(typeof C!="undefined"){if(typeof C=="string"){this.PolygonAttr.strokeWeight=this.PolylineAttr.strokeWeight=this.PointAttr.strokeWeight=parseInt(C)}else{this.PolygonAttr.strokeWeight=this.PolylineAttr.strokeWeight=this.PointAttr.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.PolygonAttr.strokeOpacity=this.PolylineAttr.strokeOpacity=this.PointAttr.strokeOpacity=parseFloat(B)}else{this.PolygonAttr.strokeOpacity=this.PolylineAttr.strokeOpacity=this.PointAttr.strokeOpacity=B}}if(typeof E!="undefined"){this.PolygonAttr.fill=this.PolylineAttr.fill=this.PointAttr.fill=true;this.PolygonAttr.fillColor=this.PolylineAttr.fillColor=this.PointAttr.fillColor=E}if(typeof A!="undefined"){if(typeof A=="string"){this.PolygonAttr.fillOpacity=this.PolylineAttr.fillOpacity=this.PointAttr.fillOpacity=parseFloat(A)}else{this.PolygonAttr.fillOpacity=this.PolylineAttr.fillOpacity=this.PointAttr.fillOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.DrawPolygons,{display:"block"});this.renderer.SetAttributes(this.DrawPolylines,{display:"block"});this.renderer.SetAttributes(this.DrawPoints,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.DrawPolygons,{display:"none"});this.renderer.SetAttributes(this.DrawPolylines,{display:"none"});this.renderer.SetAttributes(this.DrawPoints,{display:"none"})};this.GetId=function(){return this.id};this.GetNumShapes=function(){return this.shapes.length};this.SetStrokeColor=function(G,H){var F=this._GetDrawTool(G);if((this.renderer!=null)&&(F!=null)){F.attr.strokeColor=H;this.renderer.SetAttributes(F,{strokeColor:H})}};this.SetStrokeWeight=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeWeight=G;this.renderer.SetAttributes(F,{strokeWeight:G})}};this.SetStrokeOpacity=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeOpacity=G;this.renderer.SetAttributes(F,{strokeOpacity:G})}};this.SetFillColor=function(G,H){var F=this._GetDrawTool(G);if((this.renderer!=null)&&(F!=null)){F.attr.fillColor=H;this.renderer.SetAttributes(F,{fillColor:H})}};this.SetFillOpacity=function(H,F){var G=this._GetDrawTool(H);if((this.renderer!=null)&&(G!=null)){G.attr.fillOpacity=F;this.renderer.SetAttributes(G,{fillOpacity:F})}};this.SetLinecap=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeLinecap=G;this.renderer.SetAttributes(F,{strokeLinecap:G})}};this.SetLinejoin=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeLinejoin=G;this.renderer.SetAttributes(F,{strokeLinejoin:G})}};this.AddShape=function(G,F){var I=this.id+"#"+this.sid++;var H=F.slice(0);H.id=I;H.type=G;H.visible=true;this.shapes.push(H);return I};this.RemoveShape=function(H){var G=false;for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===H){this.shapes.splice(F,1);G=true;break}}return G};this.ShowShape=function(G){for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===G){this.shapes[F].visible=true;break}}this._Draw(this.navigator.ScaleFactor)};this.HideShape=function(G){for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===G){this.shapes[F].visible=false;break}}this._Draw(this.navigator.ScaleFactor)};this.GetArea=function(M,K,F){var J=null;for(var I=0;I<this.shapes.length;I++){if((this.shapes[I].id===M)&&(this.shapes[I].type==Pol.VI.OverlayShape.Polygon)){var G=[];var L=this.shapes[I];for(var H=0;H<L.length;H++){G.push(L[H].lat+","+L[H].lng)}J="["+L.type+","+G.join(",")+"]"}}if(J){this.navigator._Compute(J,Pol.VI.ImageTools.Area,K,F)}};this.GetDistance=function(M,K,F){var J=null;for(var I=0;I<this.shapes.length;I++){if((this.shapes[I].id===M)&&((this.shapes[I].type==Pol.VI.OverlayShape.Polygon)||(this.shapes[I].type==Pol.VI.OverlayShape.Polyline))){var G=[];var L=this.shapes[I];for(var H=0;H<L.length;H++){G.push(L[H].lat+","+L[H].lng)}J="["+L.type+","+G.join(",")+"]"}}if(J){this.navigator._Compute(J,Pol.VI.ImageTools.Distance,K,F)}};this.GetShapeId=function(F,M){var J=null;var L=0;for(var H=0,K=0,G=0;((H<this.shapes.length)&&(J==null));H++){var I;G=this.shapes[H].length*2;I=this.xy.slice(K,K+G);if(this.shapes[H].visible){switch(this.shapes[H].type){case Pol.VI.OverlayShape.Polygon:if(this._IsWithinPolygon(I,F,M)){J=this.shapes[H].id}break;case Pol.VI.OverlayShape.Polyline:L=parseInt(this.PolylineAttr.strokeWeight)*0.5;if(this._IsOnPolyline(I,F,M,L)){J=this.shapes[H].id}break;case Pol.VI.OverlayShape.Point:L=4;if(this._IsOnPoint(I,F,M,L)){J=this.shapes[H].id}break;default:break}}K+=G}return J};this._AttachEvent=function(G,F){this.Events[G].subscribe(F,this);this.cursor="pointer"};this._DetachEvent=function(G,F){this.Events[G].unsubscribe(F,this);this.cursor="default"};this._EventHandler=function(F){this.Events["on"+F.type].notify(F)};this._GetDrawTool=function(G){var F=null;switch(G){case Pol.VI.OverlayShape.Polygon:F=this.DrawPolygons;break;case Pol.VI.OverlayShape.Polyline:F=this.DrawPolylines;break;case Pol.VI.OverlayShape.Point:F=this.DrawPoints;break;default:break}return F};this._IsWithinPolygon=function(K,G,L){var F=false;var J=K.length;for(var I=0;I<J;I+=2){var H=(I+2)%J;if((((K[I+1]<=L)&&(L<K[H+1]))||((K[H+1]<=L)&&(L<K[I+1])))&&(G<(K[H]-K[I])*(L-K[I+1])/(K[H+1]-K[I+1])+K[I])){F=!F}}return F};this._IsOnPolyline=function(H,T,S,G){for(var N=0;N<H.length;N+=2){var M=H[N];var F=H[N+1];var U=H[N+2];var Q=H[N+3];if((M==U)&&(F==Q)){if((Math.abs(M-T)<=G)&&(Math.abs(F-S)<=G)){return true}else{return false}}if(M==U){if((T<M-G)||(T>M+G)){return false}if((Q>F)&&(S<=Q)&&(S>=F)){return true}else{if((S<=F)&&(S>=Q)){return true}else{return false}}}if(F==Q){if((S<F-G)||(S>F+G)){return false}if((U>M)&&(T<=U)&&(T>=M)){return true}else{if((T<=M)&&(T>=U)){return true}else{return false}}}var J=(Q-F)/(U-M);var R=F-(J*M);var P=S-(J*T)-R;P=P*Math.cos(Math.atan(-J));if(P<0){P=-P}if(P<=G){J=-1/J;var O=(M+U)/2;var K=(F+Q)/2;R=K-(J*O);var I=Q-(J*U)-R;var L=I*-1;if(L>I){I=L}P=S-(J*T)-R;if(P<0){P=-P}if(P<=I){return true}}}return false};this._IsOnPoint=function(H,F,K,J){var G=H[0];var I=H[1];if((Math.abs(G-F)<=J)&&(Math.abs(I-K)<=J)){return true}else{return false}};this._SaveCoords=function(G){for(var F=0;F<G.length;F++){this.xy[F]=G[F]}};this._Add=function(F){this.navigator=F;this.renderer=F.viewer.overlay.renderer;if(this.PolygonAttr.fill){this.DrawPolygons=this.renderer.Create("path",this.PolygonAttr.strokeColor,this.PolygonAttr.strokeWeight,this.PolygonAttr.strokeOpacity,this.PolygonAttr.fillColor,this.PolygonAttr.fillOpacity)}else{this.DrawPolygons=this.renderer.Create("path",this.PolygonAttr.strokeColor,this.PolygonAttr.strokeWeight,this.PolygonAttr.strokeOpacity)}this.DrawPolylines=this.renderer.Create("path",this.PolylineAttr.strokeColor,this.PolylineAttr.strokeWeight,this.PolylineAttr.strokeOpacity);this.DrawPoints=this.renderer.Create("path",this.PointAttr.strokeColor,this.PointAttr.strokeWeight,this.PointAttr.strokeOpacity);this.renderer.SetAttributes(this.DrawPoints,{strokeWeight:"8px"});this.renderer.SetAttributes(this.DrawPoints,{strokeLinecap:"round"});this.renderer.SetAttributes(this.DrawPoints,{strokeLinejoin:"round"});this.DrawPolygons.id=this.id;this.DrawPolylines.id=this.id;this.DrawPoints.id=this.id;this.DrawPolygons.attr=this.PolygonAttr;this.DrawPolylines.attr=this.PolylineAttr;this.DrawPoints.attr=this.PointAttr;this.DrawPolygons.style.cursor=this.cursor;this.DrawPolylines.style.cursor=this.cursor;this.DrawPoints.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.DrawPolygons);this.renderer.Remove(this.DrawPolylines);this.renderer.Remove(this.DrawPoints)};this._Draw=function(H){if(this.visible){var O=[];var F="";var M="";var L="";for(var K=0;K<this.xy.length;K++){O[K]=Math.round(this.xy[K]*H)}for(var J=0,G=0,I=0;J<this.shapes.length;J++){var N;I=this.shapes[J].length*2;N=O.slice(G,G+I);if(this.shapes[J].visible){switch(this.shapes[J].type){case Pol.VI.OverlayShape.Polygon:F+=this.DrawPolygons.moveto+N[0]+" "+N[1]+this.DrawPolygons.lineto+N.slice(2).join(" ")+this.DrawPolygons.closepath;break;case Pol.VI.OverlayShape.Polyline:M+=this.DrawPolylines.moveto+N[0]+" "+N[1]+this.DrawPolylines.lineto+N.slice(2).join(" ");break;case Pol.VI.OverlayShape.Point:L+=this.DrawPoints.moveto+N[0]+" "+N[1]+this.DrawPoints.lineto+N[0]+" "+(N[1]-1)+this.DrawPoints.lineto+N[0]+" "+(N[1]+1)+this.DrawPoints.lineto+(N[0]+1)+" "+N[1]+this.DrawPoints.lineto+(N[0]-1)+" "+N[1];break;default:break}}G+=I}this.renderer.SetAttributes(this.DrawPolygons,{d:F});this.renderer.SetAttributes(this.DrawPolylines,{d:M});this.renderer.SetAttributes(this.DrawPoints,{d:L})}};this._Stringify=function(){var F=[];if(this.shapes.length>0){for(var G=0;G<this.shapes.length;G++){F.push(this.shapes[G].join(","))}}else{F[0]=0;F[1]=0}return"["+Pol.VI.OverlayShape.Layer+","+F.join(",")+"]"};this._Encode=function(){var G=[];for(var H=0,K=0,F=0;H<this.shapes.length;H++){var J;var I;F=this.shapes[H].length*2;J=this.xy.slice(K,K+F);if(this.shapes[H].visible){switch(this.shapes[H].type){case Pol.VI.OverlayShape.Polygon:I={st:Pol.VI.OverlayShape.Polygon,sc:this.PolygonAttr.strokeColor,sw:this.PolygonAttr.strokeWeight,so:this.PolygonAttr.strokeOpacity,fc:this.PolygonAttr.fillColor,fo:this.PolygonAttr.fillOpacity,sp:J,fi:this.PolygonAttr.fill,nr:[J.length / 2]};G.push(YAHOO.lang.JSON.stringify(I));break;case Pol.VI.OverlayShape.Polyline:I={st:Pol.VI.OverlayShape.Polyline,sc:this.PolylineAttr.strokeColor,sw:this.PolylineAttr.strokeWeight,so:this.PolylineAttr.strokeOpacity,sp:J};G.push(YAHOO.lang.JSON.stringify(I));break;case Pol.VI.OverlayShape.Point:I={st:Pol.VI.OverlayShape.Point,sc:this.PointAttr.strokeColor,sw:this.PointAttr.strokeWeight,so:this.PointAttr.strokeOpacity,pr:4,sp:J};G.push(YAHOO.lang.JSON.stringify(I));break;default:break}}K+=F}return G.join(",")}};Pol.VI.ImageNavigator.prototype.AddOverlay=function(A){if(Pol.VI.OverlayUtil.IsValidShape(A)){A._Add(this);this.viewer.overlay.shapes.push(A)}};Pol.VI.ImageNavigator.prototype.RemoveOverlay=function(B){var A=this.viewer.overlay.shapes;if(Pol.VI.OverlayUtil.IsValidShape(B)){for(var C=0;C<A.length;C++){if(A[C]===B){B._Remove();A.splice(C,1)}}}};Pol.VI.ImageNavigator.prototype.RenderOverlay=function(){var A=this.viewer.overlay.shapes;if((A.length>0)&&this.IsViewActive()){this._HideOverlay();this._GetOverlay()}};Pol.VI.ImageNavigator.prototype.ClearOverlay=function(){var A=this.viewer.overlay.shapes;while(A.length>0){var B=A.pop();B._Remove()}};Pol.VI.ImageNavigator.prototype.ShowOverlay=function(){var A=this.viewer.overlay.shapes;for(var B=0;B<A.length;B++){A[B].Show()}};Pol.VI.ImageNavigator.prototype.HideOverlay=function(){var A=this.viewer.overlay.shapes;for(var B=0;B<A.length;B++){A[B].Hide()}};Pol.VI.ImageNavigator.prototype._ShowOverlay=function(){YAHOO.util.Dom.setStyle(this.viewer.overlay,"visibility","visible");YAHOO.util.Dom.setStyle(this.viewer.overlay,"display","block")};Pol.VI.ImageNavigator.prototype._HideOverlay=function(){YAHOO.util.Dom.setStyle(this.viewer.overlay,"visibility","hidden");YAHOO.util.Dom.setStyle(this.viewer.overlay,"display","none")};Pol.VI.ImageNavigator.prototype._OverlayViewChange=function(A){this.RenderOverlay();if(this.ContourCfg.visible){this._GetContourLines()}};Pol.VI.ImageNavigator.prototype._OverlayScaleChange=function(A){shapes=this.viewer.overlay.shapes;for(var B=0;B<shapes.length;B++){shapes[B]._Draw(this.ScaleFactor)}if(this.ContourCfg.visible){this._DrawContourLines()}};Pol.VI.ImageNavigator.prototype._AlignOverlay=function(){var A=this.CurrentView;var C=this.viewer.dimensions;var D=this.viewer.overlay;var B=Math.round(A.width*this.ScaleFactor);var E=Math.round(A.height*this.ScaleFactor);D.style.width=B+"px";D.style.height=E+"px";D.renderer.SetWidth(B);D.renderer.SetHeight(E);D.mx=C.halfwidth-Math.round(A.mx*this.ScaleFactor);D.my=C.halfheight-Math.round(A.my*this.ScaleFactor);D.style.left=D.mx+"px";D.style.top=D.my+"px"};Pol.VI.ImageNavigator.prototype._GetShapeData=function(){var B=this.viewer.overlay.shapes;var C="&shapes=";var A=[];for(var D=0;D<B.length;D++){A.push(B[D]._Stringify())}C+="["+A.join(",")+"]";return C};Pol.VI.ImageNavigator.prototype._GetShapeInfo=function(){var B=this.viewer.overlay.shapes;var A=[];for(var C=0;C<B.length;C++){if(B[C].IsVisible()){A.push(B[C]._Encode())}}if(this.ContourCfg.visible){A.push(this._EncodeContourLines())}return"["+A.join(",")+"]"};Pol.VI.ImageNavigator.prototype._IsShapeData=function(){return this.viewer.overlay.shapes.length>0};Pol.VI.ImageNavigator.prototype._GetOverlay=function(){var A=this.CurrentView;if(YAHOO.util.Connect.isCallInProgress(this._OverlayTransaction)){YAHOO.util.Connect.abort(this._OverlayTransaction)}var C={success:this._GetOverlaySuccess,failure:this._GetOverlayFailure,scope:this,timeout:this.RequestTimeout,argument:A.table+A.index};var B="id="+this.UserId+"&type="+this.RequestType.Overlay+"&table="+A.table+"&index="+A.index+this._GetShapeData();YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this._OverlayTransaction=YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,C,B)};Pol.VI.ImageNavigator.prototype._GetOverlaySuccess=function(F){var D;var A;var C=this._GetStatus(F);try{D=YAHOO.lang.JSON.parse(F.responseText);A=this.viewer.overlay.shapes;if(A.length==D.length){for(var B=0;B<D.length;B++){A[B]._SaveCoords(D[B]);A[B]._Draw(this.ScaleFactor)}}}catch(E){C={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}this._ShowOverlay();this.Events.onoverlayrendered.notify(C)};Pol.VI.ImageNavigator.prototype._GetOverlayFailure=function(B){var A=this._GetStatus(B);this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype.ShowContourLines=function(){if(this.IsViewActive()){this._GetContourLines()}};Pol.VI.ImageNavigator.prototype.HideContourLines=function(){this.ContourCfg.visible=false;this._ClearContourLines()};Pol.VI.ImageNavigator.prototype.SetContourLinesCfg=function(A){if(typeof A!="undefined"){if(A.visible){this.ContourCfg.visible=A.visible}if(A.units){if((A.units==Pol.VI.DistanceUnits.Feet)||(A.units==Pol.VI.DistanceUnits.Meters)){this.ContourCfg.units=A.units}}if(typeof A.minor!="undefined"){if(A.minor.width){this.ContourCfg.minor.width=A.minor.width}if(A.major.width){this.ContourCfg.major.width=A.major.width}if(A.minor.increment){this.ContourCfg.minor.increment=A.minor.increment}}if(typeof A.major!="undefined"){if(A.major.steps){this.ContourCfg.major.steps=A.major.steps}if(A.minor.color){this.ContourCfg.minor.color=A.minor.color}if(A.major.color){this.ContourCfg.major.color=A.major.color}}if(typeof A.annotations!="undefined"){if(A.annotations.color){this.ContourCfg.annotations.color=A.annotations.color}if(A.annotations.spacing){this.ContourCfg.annotations.spacing=A.annotations.spacing}}}if(this.ContourCfg.minor.draw!=null){this.viewer.overlay.renderer.Remove(this.ContourCfg.minor.draw)}if(this.ContourCfg.major.draw!=null){this.viewer.overlay.renderer.Remove(this.ContourCfg.major.draw)}this.ContourCfg.minor.draw=this.viewer.overlay.renderer.Create("path",this.ContourCfg.minor.color,this.ContourCfg.minor.width,1,"none",1);this.ContourCfg.major.draw=this.viewer.overlay.renderer.Create("path",this.ContourCfg.major.color,this.ContourCfg.major.width,1,"none",1)};Pol.VI.ImageNavigator.prototype.GetContourLinesCfg=function(){var B=this.ContourCfg;var A={units:B.units,minor:{width:B.minor.width,increment:B.minor.increment,color:B.minor.color},major:{width:B.major.width,steps:B.major.steps,color:B.major.color},annotations:{color:B.annotations.color,spacing:B.annotations.spacing}};return A};Pol.VI.ImageNavigator.prototype._ClearContourLines=function(){if(this.ContourCfg.annotations.text.length>0){for(var A=0;A<this.ContourCfg.annotations.text.length;A++){this.viewer.overlay.renderer.Remove(this.ContourCfg.annotations.text[A]);this.ContourCfg.annotations.text[A]=null}this.ContourCfg.annotations.text=[]}this.viewer.overlay.renderer.SetAttributes(this.ContourCfg.minor.draw,{d:" "});this.viewer.overlay.renderer.SetAttributes(this.ContourCfg.major.draw,{d:" "})};Pol.VI.ImageNavigator.prototype._DrawContourLines=function(){var S=this.ScaleFactor;var K=this.viewer.overlay.renderer;var O=this.ContourCfg.points;var D=this.ContourCfg.annotations.spacing;var H=this.ContourCfg.major.draw.moveto;var G=this.ContourCfg.major.draw.lineto;var F=this.ContourCfg.major.draw.endpath;var M=(this.ContourCfg.units==Pol.VI.DistanceUnits.Feet)?" ft":" m";var C={textColor:this.ContourCfg.annotations.color,fillColor:this.ContourCfg.annotations.color,fontFamily:"Verdana",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",textAnchor:"start",textOpacity:1,fillOpacity:1};this._ClearContourLines();if(this.ContourCfg.visible){var B=[];var L=[];for(var P=0;P<O.length;P++){var I=O[P].XArray;var Q=O[P].YArray;var R=O[P].isMajor;var J=R?L:B;var A=true;J.push(H+(Math.round(I[0]*S))+" "+(Math.round(Q[0]*S))+" "+G);for(var N=1;N<I.length;N++){J.push((Math.round(I[N]*S))+" "+(Math.round(Q[N]*S)));if(R&&(((N%Math.round(D/S))==0)||A)){var E=K.Create("text","none","1","1.0","none",1);C.text=O[P].elevation+M;C.x=Math.round(I[N]*S);C.y=Math.round(Q[N]*S);K.SetAttributes(E,C);this.ContourCfg.annotations.text.push(E);A=false}}J.push(F)}K.SetAttributes(this.ContourCfg.major.draw,{d:L.join(" ")});K.SetAttributes(this.ContourCfg.minor.draw,{d:B.join(" ")})}};Pol.VI.ImageNavigator.prototype._GetContourLines=function(){var A=this.CurrentView;this.ContourCfg.points=[];this._ClearContourLines();if(YAHOO.util.Connect.isCallInProgress(this._ContourTransaction)){YAHOO.util.Connect.abort(this._ContourTransaction)}var C={success:this._GetContourLinesSuccess,failure:this._GetContourLinesFailure,scope:this,timeout:this.RequestTimeout,argument:A.table+A.index};var B="id="+this.UserId+"&type="+this.RequestType.Contour+"&table="+A.table+"&index="+A.index+"&units="+this.ContourCfg.units+"&steps="+this.ContourCfg.major.steps+"&incr="+this.ContourCfg.minor.increment;YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this._ContourTransaction=YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,C,B)};Pol.VI.ImageNavigator.prototype._GetContourLinesSuccess=function(C){var A=this._GetStatus(C);try{this.ContourCfg.points=YAHOO.lang.JSON.parse(C.responseText);this.ContourCfg.visible=true;this._DrawContourLines()}catch(B){A={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype._GetContourLinesFailure=function(B){var A=this._GetStatus(B);this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype._EncodeContourLines=function(){var A={st:Pol.VI.OverlayShape.Contour,nc:this.ContourCfg.minor.color,nw:this.ContourCfg.minor.width,mc:this.ContourCfg.major.color,mw:this.ContourCfg.major.width,ms:this.ContourCfg.major.steps,mi:this.ContourCfg.minor.increment,un:this.ContourCfg.units,ac:this.ContourCfg.annotations.color,as:this.ContourCfg.annotations.spacing,sf:this.ScaleFactor};return YAHOO.lang.JSON.stringify(A)};
Pol.VI.ImageTools={NoTool:0,Distance:1,Height:2,Location:3,Area:4,Elevation:5,Bearing:6,Pitch:7,Select:8};Pol.VI.DistanceResult={};Pol.VI.HeightResult={};Pol.VI.LocationResult={};Pol.VI.AreaResult={};Pol.VI.ElevationResult={};Pol.VI.BearingResult={};Pol.VI.PitchResult={};Pol.VI.ImageNavigator.prototype._InitTools=function(){this.DistanceUnit=Pol.VI.DistanceUnits.Feet;this.AreaUnit=Pol.VI.AreaUnits.SquareFeet;this.LocationUnit=Pol.VI.LocationUnits.Degrees;this.AngleUnit=Pol.VI.AngleUnits.Degrees;this.ImageX=[];this.ImageY=[];this.IntermediateX=[];this.IntermediateY=[];this.MouseX=[];this.MouseY=[];this.LineSegmentX=[];this.LineSegmentY=[];this.TranslateX=0;this.TranslateY=0;this.ToolsRenderer=null;this.DrawTool=null;this.Measuring=false;this.IsKeyUp=true;this.IsMultiImage=false;this.IsIntermediate=false;this.NoDistance=0;this.LineDistance=1;this.BoxDistance=2;this.FreeFormDistance=3;this.SelectDistance=4;this.DistanceType=this.LineDistance;this.SinglePoint=0;this.MultiPoint=1;this.MeasurementType=this.MultiPoint;this.SelectedTool=Pol.VI.ImageTools.NoTool;this.SelectedUnit=0;this.ToolCursor="default";this.ToolStrokeColor="#00ffff";this.ToolStrokeWeight=1;this.PitchState=0;this.SelectedArea={ul:{x:0,y:0},lr:{x:0,y:0}};this.viewer.measure=document.createElement("div");YAHOO.util.Dom.generateId(this.viewer.measure,"pol-vi-measure");this.viewer.measure.className="pol-vi-measure";YAHOO.util.Dom.setStyle(this.viewer.measure,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif)");this.viewer.measure.style.cursor=this.ToolCursor;this.viewer.measure.style.width=this.viewer.style.width;this.viewer.measure.style.height=this.viewer.style.height;this.viewer.measure.style.zIndex=2;YAHOO.util.Event.addListener(this.viewer.measure,"mousedown",this._OnStartMeasurement,this);this.viewer.measure.style.display="none";this.viewer.appendChild(this.viewer.measure);this.ViewerElements.push(this.viewer.measure);this.ToolsRenderer=Pol.VI.GetRenderer();this.ToolsRenderer.Init(this.viewer.measure);this.DrawTool=this.ToolsRenderer.Create("path",this.ToolStrokeColor,this.ToolStrokeWeight,1,"none",1);this.PlumbTool=this.ToolsRenderer.Create("path",this.ToolStrokeColor,this.ToolStrokeWeight,1,"none",1);this.MultiImage=[];this.ToolOptions={wte:false,plumb:false,plumbColor:this.ToolStrokeColor,plumbWeight:this.ToolStrokeWeight,topdown:false}};Pol.VI.ImageNavigator.prototype._OnStartMeasurement=function(H,D){var G=D.CurrentView;var K=YAHOO.util.Event.getXY(H);var E=D.viewer.dimensions;var F=D._GetXY(D.viewer,K[0],K[1]);var I=(D.SelectedTool==Pol.VI.ImageTools.Select)?"onstartselect":"onstartmeasurement";var L;var J;var C;var B;D.Measuring=true;D.ToolsRenderer.SetAttributes(D.PlumbTool,{d:" "});window.focus();if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState!=0)){L=F.x-E.halfwidth;J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);C=G.mx+L;B=G.my+J;if(D.DistanceType!=D.BoxDistance){D.ImageX.push(C);D.ImageY.push(B)}if(D.PitchState==1){D.DrawTool.pathdata+=D.DrawTool.moveto+F.x+" "+F.y+" "+D.DrawTool.lineto}D.MouseX[0]=F.x;D.MouseY[0]=F.y}else{D.DrawTool.pathorigin=D.DrawTool.moveto+F.x+" "+F.y;D.DrawTool.pathdata=D.DrawTool.pathorigin+" "+D.DrawTool.lineto;D.TranslateX=D.TranslateY=0;D.MouseX.length=D.MouseY.length=0;D.LineSegmentX.length=D.LineSegmentY.length=0;D.ImageX.length=D.ImageY.length=0;D.MouseX[0]=F.x;D.MouseY[0]=F.y;YAHOO.util.Event.addListener(document,"keydown",D._OnKeyDownMeasure,D);YAHOO.util.Event.addListener(document,"keyup",D._OnKeyUpMeasure,D);YAHOO.util.Event.addListener(document,"mouseup",D._OnEndMeasurement,D);YAHOO.util.Event.addListener(document,"mousemove",D._OnMoveMeasure,D);L=F.x-E.halfwidth;J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);C=G.mx+L;B=G.my+J;D.ImageX[0]=C;D.ImageY[0]=B;var A={mouse:{x:F.x,y:F.y},image:{x:C,y:B}};D.Events[I].notify(A);YAHOO.util.Event.preventDefault(H)}};Pol.VI.ImageNavigator.prototype._OnEndMeasurement=function(H,D){var G=D.CurrentView;var K=YAHOO.util.Event.getXY(H);var E=D.viewer.dimensions;var F=D._GetXY(D.viewer,K[0],K[1]);var I=(D.SelectedTool==Pol.VI.ImageTools.Select)?"onendselect":"onendmeasurement";D.Measuring=false;D.IsIntermediate=false;if(D.SelectedTool==Pol.VI.ImageTools.Pitch){D.PitchState++}if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState==1)){D.LineSegmentX[0]=F.x;D.LineSegmentY[0]=F.y;D.DrawTool.pathdata+=F.x+" "+F.y+" "}if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState==2)){D.LineSegmentX[1]=F.x;D.LineSegmentY[1]=F.y;D.DrawTool.pathdata+=F.x+" "+F.y+" "+D.DrawTool.moveto+D.LineSegmentX[0]+" "+D.LineSegmentY[0]+" "+D.DrawTool.lineto+D.LineSegmentX[1]+" "+D.LineSegmentY[1]+" "}if((D.SelectedTool!=Pol.VI.ImageTools.Pitch)||(D.PitchState==3)){YAHOO.util.Event.removeListener(document,"keydown",D._OnKeyDownMeasure);YAHOO.util.Event.removeListener(document,"keyup",D._OnKeyUpMeasure);YAHOO.util.Event.removeListener(document,"mouseup",D._OnEndMeasurement);YAHOO.util.Event.removeListener(document,"mousemove",D._OnMoveMeasure)}var L=F.x-E.halfwidth;var J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);var C=G.mx+L;var B=G.my+J;if(D.IsMultiImage){D.MultiImage[1]={t:G.table,i:G.index,x:C,y:B}}else{D.MultiImage[0]={t:G.table,i:G.index,x:C,y:B}}if(D.DistanceType!=D.BoxDistance){D.ImageX.push(C);D.ImageY.push(B);if(D.SelectedTool==Pol.VI.ImageTools.Area){D._ClosePath()}}if((D.SelectedTool==Pol.VI.ImageTools.Distance)&&(D.DistanceType==D.BoxDistance)){D.ImageX.push(D.ImageX[0]);D.ImageY.push(D.ImageY[0])}if(D.DistanceType==D.SelectDistance){if(D.ImageX[0]<C){D.SelectedArea.ul.x=D.ImageX[0];D.SelectedArea.lr.x=C}else{D.SelectedArea.ul.x=C;D.SelectedArea.lr.x=D.ImageX[0]}if(D.ImageY[0]>B){D.SelectedArea.ul.y=B;D.SelectedArea.lr.y=D.ImageY[0]}else{D.SelectedArea.ul.y=D.ImageY[0];D.SelectedArea.lr.y=B}}if(D.DistanceType==D.FreeFormDistance){D._RemoveRedundantPoints()}if((D.SelectedTool!=Pol.VI.ImageTools.Pitch)||(D.PitchState==3)){var A={mouse:{x:F.x,y:F.y},image:{x:C,y:B}};D.PitchState=0;D.Events[I].notify(A);D._OnKeyUpMeasure(H,D);D._ResetMode(D);YAHOO.util.Event.preventDefault(H)}};Pol.VI.ImageNavigator.prototype._OnMoveMeasure=function(U,Q){var O=Q.CurrentView;var K=YAHOO.util.Event.getXY(U);var d=Q.viewer.dimensions;var P=Q._GetXY(Q.viewer,K[0],K[1]);var a=Q.ToolsRenderer;var S;var R;var H;var C;var Z;var X;if(Q.Measuring){var L=Math.round(10*Q.ScaleFactor);Q.MouseX.push(P.x);Q.MouseY.push(P.y);if(P.x<0){Q.PanImage(-10,0);Q.TranslateX+=L}if(P.y<0){Q.PanImage(0,-10);Q.TranslateY+=L}if(P.x>d.width){Q.PanImage(10,0);Q.TranslateX-=L}if(P.y>d.height){Q.PanImage(0,10);Q.TranslateY-=L}var c=P.x-Q.TranslateX;var b=P.y-Q.TranslateY;a.SetAttributes(Q.DrawTool,{translate:Q.TranslateX+","+Q.TranslateY});if(Q.ToolOptions.plumb){a.SetAttributes(Q.PlumbTool,{translate:Q.TranslateX+","+Q.TranslateY})}if(Q.DistanceType==Q.LineDistance){if((Q.SelectedTool==Pol.VI.ImageTools.Pitch)&&(Q.PitchState==2)){S=P.x-Q.LineSegmentX[1];R=P.y-Q.LineSegmentY[1];H=Math.atan2(S,R);C=Math.sqrt((S*S)+(R*R));Q.LineSegmentX[2]=P.x;Q.LineSegmentY[2]=P.y;Q.LineSegmentX[3]=Math.round(Q.LineSegmentX[0]+(Math.sin(H)*C));Q.LineSegmentY[3]=Math.round(Q.LineSegmentY[0]+(Math.cos(H)*C));Z=Q.LineSegmentX[3]-Q.TranslateX;X=Q.LineSegmentY[3]-Q.TranslateY;a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b+" "+Z+" "+X+Q.DrawTool.closepath})}else{a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b})}}else{if(Q.DistanceType==Q.BoxDistance){S=P.x-Q.LineSegmentX[1];R=P.y-Q.LineSegmentY[1];H=Math.atan2(S,R);C=Math.sqrt((S*S)+(R*R));Q.LineSegmentX[2]=P.x;Q.LineSegmentY[2]=P.y;Q.LineSegmentX[3]=Math.round(Q.LineSegmentX[0]+(Math.sin(H)*C));Q.LineSegmentY[3]=Math.round(Q.LineSegmentY[0]+(Math.cos(H)*C));Z=Q.LineSegmentX[3]-Q.TranslateX;X=Q.LineSegmentY[3]-Q.TranslateY;a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b+" "+Z+" "+X+Q.DrawTool.closepath});for(var e=2;e<4;e++){var G=Q.LineSegmentX[e]-d.halfwidth;var F=Q.LineSegmentY[e]-d.halfheight;G=Math.round(G/Q.ScaleFactor);F=Math.round(F/Q.ScaleFactor);Q.ImageX[e]=O.mx+G;Q.ImageY[e]=O.my+F}}else{if(Q.DistanceType==Q.FreeFormDistance){var W=Q.MouseX[Q.MouseX.length-2];var T=Q.MouseY[Q.MouseY.length-2];var g=Q.MouseX[Q.MouseX.length-1];var f=Q.MouseY[Q.MouseY.length-1];Q.DrawTool.pathdata+=" "+c+" "+b+" ";a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata});var E=W-d.halfwidth;var D=T-d.halfheight;var B=g-d.halfwidth;var A=f-d.halfheight;E=Math.round(E/Q.ScaleFactor);D=Math.round(D/Q.ScaleFactor);B=Math.round(B/Q.ScaleFactor);A=Math.round(A/Q.ScaleFactor);Q.ImageX.push(O.mx+E);Q.ImageY.push(O.my+D);Q.ImageX.push(O.mx+B);Q.ImageY.push(O.my+A)}else{if(Q.DistanceType==Q.SelectDistance){var N=c-Q.MouseX[0];var M=b-Q.MouseY[0];var Y=Q.MouseX[0];var V=Q.MouseY[0]+M;var j=c;var h=b;var J=Q.MouseX[0]+N;var I=Q.MouseY[0];a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+Y+" "+V+" "+j+" "+h+" "+J+" "+I+Q.DrawTool.closepath})}}}}}YAHOO.util.Event.preventDefault(U)};Pol.VI.ImageNavigator.prototype._ClosePath=function(){this.ToolsRenderer.SetAttributes(this.DrawTool,{d:this.DrawTool.pathdata+this.DrawTool.closepath})};Pol.VI.ImageNavigator.prototype._OnKeyDownMeasure=function(A,B){if(B.Measuring&&(B.IsKeyUp||(A.keyCode==16))){B.IsKeyUp=false;switch(A.keyCode){case 16:B._DoMeasurement(B);break;case 17:if(B.SelectedTool==Pol.VI.ImageTools.Elevation){B.DistanceType=B.LineDistance;B.MeasurementType=B.MultiPoint}else{if(B.SelectedTool==Pol.VI.ImageTools.Bearing){B._SaveLineSegment(B,false)}else{B.DistanceType=B.BoxDistance;B._SaveLineSegment(B,true)}}break;case 18:if(B.SelectedTool==Pol.VI.ImageTools.Height){B.DistanceType=B.LineDistance}else{B.DistanceType=B.FreeFormDistance}break;case 86:B._SaveLineSegment(B,true);break;case 80:case 107:B.IsMultiImage=true;break;default:B.DistanceType=B.LineDistance;break}}YAHOO.util.Event.preventDefault(A)};Pol.VI.ImageNavigator.prototype._ResetMode=function(A){if((A.SelectedTool==Pol.VI.ImageTools.Elevation)||(A.SelectedTool==Pol.VI.ImageTools.Location)){A.DistanceType=A.NoDistance;A.MeasurementType=A.SinglePoint}else{if(A.SelectedTool!=Pol.VI.ImageTools.Select){A.DistanceType=A.LineDistance;A.MeasurementType=A.MultiPoint}}};Pol.VI.ImageNavigator.prototype._OnKeyUpMeasure=function(A,B){B.IsKeyUp=true;YAHOO.util.Event.preventDefault(A)};Pol.VI.ImageNavigator.prototype._DoMeasurement=function(H){var D=H.CurrentView;var G=H.viewer.dimensions;H.IntermediateX=H.ImageX.slice(0);H.IntermediateY=H.ImageY.slice(0);H.IsIntermediate=true;var E=H.MouseX[H.MouseX.length-1]-G.halfwidth;var C=H.MouseY[H.MouseY.length-1]-G.halfheight;E=Math.round(E/H.ScaleFactor);C=Math.round(C/H.ScaleFactor);var B=D.mx+E;var A=D.my+C;if(H.DistanceType!=H.BoxDistance){H.IntermediateX.push(B);H.IntermediateY.push(A)}var F={mouse:{x:H.MouseX[H.MouseX.length-1],y:H.MouseY[H.MouseY.length-1]},image:{x:B,y:A}};H.Events.onendmeasurement.notify(F)};Pol.VI.ImageNavigator.prototype._SaveLineSegment=function(G,D){var B=G.CurrentView;var F=G.viewer.dimensions;var H=G.MouseX[G.MouseX.length-1];var E=G.MouseY[G.MouseY.length-1];G.DrawTool.pathdata+=" "+(H-G.TranslateX)+" "+(E-G.TranslateY)+" ";var C=H-F.halfwidth;var A=E-F.halfheight;C=Math.round(C/G.ScaleFactor);A=Math.round(A/G.ScaleFactor);G.ImageX.push(B.mx+C);G.ImageY.push(B.my+A);G.LineSegmentX.push(G.MouseX[0]);G.LineSegmentX.push(H);G.LineSegmentY.push(G.MouseY[0]);G.LineSegmentY.push(E);if(D){G.MouseX.length=G.MouseY.length=0;G.MouseX[0]=H;G.MouseY[0]=E}else{G.DrawTool.pathdata+=" "+G.DrawTool.pathorigin+" "+G.DrawTool.lineto;G.MouseX.length=G.MouseY.length=1}};Pol.VI.ImageNavigator.prototype.Measure=function(A){if((this.SelectedTool!=Pol.VI.ImageTools.Select)&&(this.SelectedTool!=Pol.VI.ImageTools.NoTool)&&this.IsViewActive()){var B=this.CurrentView;var F=this.IsIntermediate?this.IntermediateX.slice(0):this.ImageX.slice(0);var D=this.IsIntermediate?this.IntermediateY.slice(0):this.ImageY.slice(0);this.IsIntermediate=false;if((this.SelectedTool==Pol.VI.ImageTools.Height)&&this.ToolOptions.topdown){F.reverse();D.reverse()}var C="id="+this.UserId+"&type="+this.RequestType.Measure+"&tool="+this.SelectedTool+"&unit="+this.SelectedUnit+"&mt="+this.MeasurementType+"&gp="+this.GroundPlane.offset+"&table="+B.table+"&index="+B.index+"&ImageX="+F.toString()+"&ImageY="+D.toString();if(this.IsMultiImage){C+="&mi="+YAHOO.lang.JSON.stringify(this.MultiImage)}if((this.SelectedTool==Pol.VI.ImageTools.Distance)&&this.ToolOptions.wte){C+="&wte=1"}this.IsMultiImage=false;var E={success:this._MeasureSuccess,failure:this._MeasureFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:A,tool:this.SelectedTool,shape:this._GetMeasurementShape()}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,E,C)}};Pol.VI.ImageNavigator.prototype._Compute=function(B,C,E,A){if(this.IsViewActive()){var D="id="+this.UserId+"&type="+this.RequestType.Compute+"&tool="+C+"&unit="+E+"&shape="+B;var F={success:this._MeasureSuccess,failure:this._MeasureFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:A,tool:C,shape:0}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,F,D)}};Pol.VI.ImageNavigator.prototype._MeasureSuccess=function(A){var D;var C;var I;var H=this._GetStatus(A);try{C=YAHOO.lang.JSON.parse(A.responseText);D=A.argument.tool;switch(D){case Pol.VI.ImageTools.Location:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,unit:C.unit,latitude:C.latitude,longitude:C.longitude};break;case Pol.VI.ImageTools.Pitch:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,area:C.area,angle:C.angle,eave:C.eave,peak:C.peak,pitch:C.pitch};break;case Pol.VI.ImageTools.Elevation:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,value:C.value,distance:C.distance,unit:C.unit};break;default:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,value:C.value,unit:C.unit};if(C.mi){var G=[];var F=[];G[0]=this.MultiImage[1].x;G[1]=C.mi.x;F[0]=this.MultiImage[1].y;F[1]=C.mi.y;this._RefreshDrawTool(this.DrawTool,G,F)}if(this.ToolOptions.wte&&C.wtex&&C.wtey){this._RefreshDrawTool(this.DrawTool,C.wtex,C.wtey)}if(this.ToolOptions.plumb&&C.hx&&C.hx){this._RefreshDrawTool(this.PlumbTool,C.hx,C.hy)}if((D==Pol.VI.ImageTools.Height)&&this.GroundPlane.capture){var B={active:true,elevation:C.xd.e,offset:C.xd.z};this._ClearGroundPlaneCapture();this.GroundPlane.active=true;this.GroundPlane.elevation=C.xd.e;this.GroundPlane.offset=C.xd.z;this.Events.ongroundplanechange.notify(B)}break}}catch(E){I={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}A.argument.fn(I)};Pol.VI.ImageNavigator.prototype._MeasureFailure=function(B){var A=this._GetStatus(B);B.argument.fn(A)};Pol.VI.ImageNavigator.prototype.SetImageTool=function(A,C){var B=(C!=undefined)?true:false;this.ClearMeasurement();switch(A){case 0:this.SelectedTool=Pol.VI.ImageTools.NoTool;this.SelectedUnit=0;this.ToolCursor="default";this.viewer.measure.style.display="none";break;case 1:this.SelectedTool=Pol.VI.ImageTools.Distance;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/distance.cur";break;case 2:this.SelectedTool=Pol.VI.ImageTools.Height;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/height.cur";break;case 3:this.SelectedTool=Pol.VI.ImageTools.Location;this.SelectedUnit=this.LocationUnit;this.DistanceType=this.NoDistance;this.MeasurementType=this.SinglePoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/locale.cur";break;case 4:this.SelectedTool=Pol.VI.ImageTools.Area;this.SelectedUnit=this.AreaUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/area.cur";break;case 5:this.SelectedTool=Pol.VI.ImageTools.Elevation;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.NoDistance;this.MeasurementType=this.SinglePoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/elevation.cur";break;case 6:this.SelectedTool=Pol.VI.ImageTools.Bearing;this.SelectedUnit=this.AngleUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/bearing.cur";break;case 7:this.SelectedTool=Pol.VI.ImageTools.Pitch;this.PitchState=0;this.SelectedUnit=this.AreaUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/pitchedareacursor.cur";break;case 8:this.SelectedTool=Pol.VI.ImageTools.Select;this.DistanceType=this.SelectDistance;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/cross.cur";break;default:break}this.viewer.measure.style.cursor="url("+this.ToolCursor+"),crosshair"};Pol.VI.ImageNavigator.prototype.SetToolOptions=function(A){if(A.wte!=undefined){this.ToolOptions.wte=A.wte}if(A.plumb!=undefined){this.ToolOptions.plumb=A.plumb}if(A.plumbColor!=undefined){this.ToolOptions.plumbColor=A.plumbColor;this.ToolsRenderer.SetAttributes(this.PlumbTool,{strokeColor:A.plumbColor})}if(A.plumbWeight!=undefined){this.ToolOptions.plumbWeight=A.plumbWeight;this.ToolsRenderer.SetAttributes(this.PlumbTool,{strokeWeight:A.plumbWeight})}if(A.topdown!=undefined){this.ToolOptions.topdown=A.topdown}};Pol.VI.ImageNavigator.prototype.GetToolOptions=function(){return this.ToolOptions};Pol.VI.ImageNavigator.prototype.GetImageTool=function(){return this.SelectedTool};Pol.VI.ImageNavigator.prototype.GetToolCursor=function(){return this.ToolCursor};Pol.VI.ImageNavigator.prototype.SetDistanceUnit=function(A){this.DistanceUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetDistanceUnit=function(){return this.DistanceUnit};Pol.VI.ImageNavigator.prototype.SetAreaUnit=function(A){this.AreaUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetAreaUnit=function(){return this.AreaUnit};Pol.VI.ImageNavigator.prototype.SetLocationUnit=function(A){this.LocationUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetLocationUnit=function(){return this.LocationUnit};Pol.VI.ImageNavigator.prototype.SetAngleUnit=function(A){this.AngleUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetAngleUnit=function(){return this.AngleUnit};Pol.VI.ImageNavigator.prototype.SetColor=function(A){this.ToolStrokeColor=A;this.ToolsRenderer.SetAttributes(this.DrawTool,{strokeColor:A})};Pol.VI.ImageNavigator.prototype.GetColor=function(){return this.ToolStrokeColor};Pol.VI.ImageNavigator.prototype.SetThickness=function(A){if(typeof (A)=="string"){A=parseInt(A)}this.ToolStrokeWeight=A;this.ToolsRenderer.SetAttributes(this.DrawTool,{strokeWeight:A})};Pol.VI.ImageNavigator.prototype.GetThickness=function(){return this.ToolStrokeWeight};Pol.VI.ImageNavigator.prototype.GetSelectedArea=function(){return this.SelectedArea};Pol.VI.ImageNavigator.prototype.ClearMeasurement=function(){this.ToolsRenderer.SetAttributes(this.DrawTool,{d:" "});this.ToolsRenderer.SetAttributes(this.PlumbTool,{d:" "})};Pol.VI.ImageNavigator.prototype.SaveToolsConfig=function(){var C=365;var B=new Date();var A;B.setTime(B.getTime()+(C*24*60*60*1000));A="; expires="+B.toGMTString();document.cookie="DistanceUnit="+this.DistanceUnit+A+"; path=/";document.cookie="AreaUnit="+this.AreaUnit+A+"; path=/";document.cookie="LocationUnit="+this.LocationUnit+A+"; path=/";document.cookie="AngleUnit="+this.AngleUnit+A+"; path=/";document.cookie="LineThickness="+this.ToolStrokeWeight+A+"; path=/";document.cookie="LineColor="+this.ToolStrokeColor+A+"; path=/"};Pol.VI.ImageNavigator.prototype.ReadToolsConfig=function(){var B;if((B=A("DistanceUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetDistanceUnit(B)}}if((B=A("AreaUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetAreaUnit(B)}}if((B=A("LocationUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetLocationUnit(B)}}if((B=A("AngleUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetAngleUnit(B)}}if((B=A("LineThickness"))!=null){if(B.length>0){B=parseInt(B);this.SetThickness(B)}}if((B=A("LineColor"))!=null){if(B.length>0){this.SetColor(B)}}function A(D){var F=D+"=";var C=document.cookie.split(";");for(var E=0;E<C.length;E++){var G=C[E];while(G.charAt(0)==" "){G=G.substring(1,G.length)}if(G.indexOf(F)==0){return G.substring(F.length,G.length)}}return null}};Pol.VI.ImageNavigator.prototype.DeleteToolsConfig=function(){var B="";var A="";document.cookie="DistanceUnit="+B+A+"; path=/";document.cookie="AreaUnit="+B+A+"; path=/";document.cookie="LocationUnit="+B+A+"; path=/";document.cookie="AngleUnit="+B+A+"; path=/";document.cookie="LineThickness="+B+A+"; path=/";document.cookie="LineColor="+B+A+"; path=/"};Pol.VI.ImageNavigator.prototype.GetMeasurementPoints=function(A){var G=[];if(this.SelectedTool==Pol.VI.ImageTools.Pitch){var E=this.ImageX[5]-this.ImageX[4];var D=this.ImageY[5]-this.ImageY[4];var F=Math.atan2(E,D);var C=Math.sqrt((E*E)+(D*D));this.ImageX[6]=Math.round(this.ImageX[1]+(Math.sin(F)*C));this.ImageY[6]=Math.round(this.ImageY[1]+(Math.cos(F)*C))}for(var B=0;B<this.ImageX.length;B++){G.push(this.ImageX[B]);G.push(this.ImageY[B])}this.Translate(G,Pol.VI.Translate.ImageToLocation,A)};Pol.VI.ImageNavigator.prototype._GetMeasurementShape=function(){var A=0;switch(this.DistanceType){case 0:A=Pol.VI.OverlayShape.Point;break;case 1:case 3:A=Pol.VI.OverlayShape.Polyline;break;case 2:case 4:A=Pol.VI.OverlayShape.Polygon;break;default:break}return A};Pol.VI.ImageNavigator.prototype._RemoveRedundantPoints=function(){for(var A=0;A<this.ImageX.length-1;A++){if((this.ImageX[A]==this.ImageX[A+1])&&(this.ImageY[A]==this.ImageY[A+1])){this.ImageX.splice(A,1);this.ImageY.splice(A,1)}}};Pol.VI.ImageNavigator.prototype._RefreshDrawTool=function(C,A,G){var F;var B;var E;B=Math.round((A[0]-this.CurrentView.mx)*this.ScaleFactor)+this.viewer.dimensions.halfwidth;E=Math.round((G[0]-this.CurrentView.my)*this.ScaleFactor)+this.viewer.dimensions.halfheight;F=C.moveto+B+" "+E+" "+C.lineto;for(var D=1;D<A.length;D++){B=Math.round((A[D]-this.CurrentView.mx)*this.ScaleFactor)+this.viewer.dimensions.halfwidth-this.TranslateX;E=Math.round((G[D]-this.CurrentView.my)*this.ScaleFactor)+this.viewer.dimensions.halfheight-this.TranslateY;F+=B+" "+E+" "}this.ToolsRenderer.SetAttributes(C,{translate:this.TranslateX+","+this.TranslateY});this.ToolsRenderer.SetAttributes(C,{d:F})};Pol.VI.ImageNavigator.prototype.SetGroundPlane=function(A){this.GroundPlane.capture=false;this.GroundPlane.active=false;this.GroundPlane.elevation=0;this.GroundPlane.offset=0;this.SetImageTool(Pol.VI.ImageTools.NoTool);if(A){this.GroundPlane.capture=true;this.SetImageTool(Pol.VI.ImageTools.Height,"i/cursors/offset_c.cur")}else{var B={active:this.GroundPlane.active,elevation:this.GroundPlane.elevation,offset:this.GroundPlane.offset};this.Events.ongroundplanechange.notify(B)}};Pol.VI.ImageNavigator.prototype.GetGroundPlane=function(){var A={active:this.GroundPlane.active,elevation:this.GroundPlane.elevation,offset:this.GroundPlane.offset};return A};Pol.VI.ImageNavigator.prototype._ClearGroundPlaneCapture=function(){this.GroundPlane.capture=false;this.SetImageTool(Pol.VI.ImageTools.NoTool)};Pol.VI.RendererShapes={rect:"rect",circle:"circle",ellipse:"ellipse",line:"line",polyline:"polyline",polygon:"polygon"};Pol.VI.StyleAttributes={strokeColor:"strokeColor",strokeWeight:"strokeWeight",strokeOpacity:"strokeOpacity",fillColor:"fillColor",fillOpacity:"fillOpacity",display:"display"};Pol.VI.PolygonAttributes={points:"points"};Pol.VI.PolylineAttributes={points:"points",strokeLinecap:"strokeLinecap"};Pol.VI.EllipseAttributes={center:"center",radius:"radius"};Pol.VI.LineAttributes={start:"start",end:"end"};Pol.VI.RectangleAttributes={x:"x",y:"y",width:"width",height:"height"};Pol.VI.LinecapAttributes={butt:"butt",round:"round",square:"square"};Pol.VI.LinejoinAttributes={miter:"miter",round:"round",bevel:"bevel"};Pol.VI.SVGrenderer=function(){this.SVGroot=null;this.SVGnamespace="http://www.w3.org/2000/svg";this.XlinkNS="http://www.w3.org/1999/xlink";this.Init=function(A){this.container=A;this.container.style.MozUserSelect="none";this.SVGroot=this.container.ownerDocument.createElementNS(this.SVGnamespace,"svg");this.container.appendChild(this.SVGroot);this.SVGroot.id=A.id+"-svg"};this.Create=function(C,F,E,D,G,B){var A=null;switch(C){case"rect":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"rect");break;case"circle":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"circle");break;case"ellipse":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"ellipse");break;case"line":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"line");break;case"polyline":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"polyline");break;case"polygon":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"polygon");break;case"text":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"text");break;case"path":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"path");A.moveto="M";A.lineto="L";A.endpath="";A.closepath=" z";break;default:break}A.style.position="absolute";if(typeof F!="undefined"){A.setAttributeNS(null,"stroke",F)}else{A.setAttributeNS(null,"stroke","none")}if(typeof E!="undefined"){A.setAttributeNS(null,"stroke-width",E)}if(typeof D!="undefined"){A.setAttributeNS(null,"stroke-opacity",(+D))}if(typeof G!="undefined"){A.setAttributeNS(null,"fill",G)}else{A.setAttributeNS(null,"fill","none")}if(typeof B!="undefined"){A.setAttributeNS(null,"fill-opacity",(+B))}this.SVGroot.appendChild(A);return A};this.Remove=function(A){A.parentNode.removeChild(A)};this.SetWidth=function(B){var A=parseInt(B)+"px";this.SVGroot.setAttributeNS(null,"width",A)};this.SetHeight=function(A){var B=parseInt(A)+"px";this.SVGroot.setAttributeNS(null,"height",B)};this.Hide=function(){this.SVGroot.style.display="none"};this.Show=function(){this.SVGroot.style.display="block"};this.SetAttributes=function(E,C){if((typeof E!="undefined")&&(typeof C!="undefined")){for(attribute in C){var G=C[attribute];switch(attribute){case"strokeColor":E.setAttributeNS(null,"stroke",G);break;case"strokeWeight":E.setAttributeNS(null,"stroke-width",parseInt(G)+"px");break;case"strokeOpacity":E.setAttributeNS(null,"stroke-opacity",(+G));break;case"strokeLinecap":E.setAttributeNS(null,"stroke-linecap",G);break;case"strokeLinejoin":E.setAttributeNS(null,"stroke-linejoin",G);break;case"fillColor":E.setAttributeNS(null,"fill",G);break;case"fillRule":E.setAttributeNS(null,"fill-rule",G);break;case"fillOpacity":E.setAttributeNS(null,"fill-opacity",(+G));break;case"fontFamily":E.style.fontFamily=G;break;case"fontSize":E.style.fontSize=parseInt(G)+"px";break;case"fontWeight":E.setAttributeNS(null,"font-weight",G);break;case"fontStyle":E.setAttributeNS(null,"font-style",G);break;case"text":var B=document.createTextNode(G);E.setAttributeNS(null,"text-anchor","middle");E.appendChild(B);break;case"textAnchor":E.setAttributeNS(null,"text-anchor",G);break;case"points":E.setAttributeNS(null,"points",G);break;case"center":var F=G.split(",");E.setAttributeNS(null,"cx",parseInt(F[0])+"px");E.setAttributeNS(null,"cy",parseInt(F[1])+"px");break;case"x":E.setAttributeNS(null,"x",parseInt(G)+"px");break;case"y":E.setAttributeNS(null,"y",parseInt(G)+"px");break;case"start":var I=G.split(",");E.setAttributeNS(null,"x1",parseInt(I[0])+"px");E.setAttributeNS(null,"y1",parseInt(I[1])+"px");break;case"end":var D=G.split(",");E.setAttributeNS(null,"x2",parseInt(D[0])+"px");E.setAttributeNS(null,"y2",parseInt(D[1])+"px");break;case"radius":var A=G.split(",");if(A.length==2){E.setAttributeNS(null,"rx",parseInt(A[0])+"px");E.setAttributeNS(null,"ry",parseInt(A[1])+"px")}else{E.setAttributeNS(null,"r",parseInt(A[0])+"px")}break;case"width":E.setAttributeNS(null,"width",parseInt(G)+"px");break;case"height":E.setAttributeNS(null,"height",parseInt(G)+"px");break;case"display":E.style.display=G;break;case"d":E.setAttributeNS(null,"d",G);break;case"translate":var H="translate("+G+")";E.setAttributeNS(null,"transform",H);break;default:break}}}};this.GetMarkup=function(){return this.container.innerHTML};this.GetPathData=function(A){return A.getAttributeNS(null,"d")}};Pol.VI.VMLrenderer=function(){this.text_alignment={start:"left",middle:"center",end:"right"};this.coordsystem={origin:"0,0",size:"100000,100000",width:"100000px",height:"100000px"};this.Init=function(B){this.container=B;B.ownerDocument.namespaces.add("v","urn:schemas-microsoft-com:vml");var A=B.ownerDocument.createStyleSheet();A.addRule("v\\:group","behavior: url(#default#VML);");A.addRule("v\\:line","behavior: url(#default#VML);");A.addRule("v\\:polyline","behavior: url(#default#VML);");A.addRule("v\\:rect","behavior: url(#default#VML);");A.addRule("v\\:oval","behavior: url(#default#VML);");A.addRule("v\\:path","behavior: url(#default#VML);");A.addRule("v\\:shape","behavior: url(#default#VML);");A.addRule("v\\:text","behavior: url(#default#VML);");A.addRule("v\\:textpath","behavior: url(#default#VML);");A.addRule("v\\:fill","behavior: url(#default#VML);");A.addRule("v\\:stroke","behavior: url(#default#VML);");this.VMLroot=this.container.ownerDocument.createElement("v:group");this.VMLroot.id=B.id+"-vml";this.VMLroot.style.position="absolute";this.VMLroot.coordorigin=this.coordsystem.origin;this.VMLroot.coordsize=this.coordsystem.size;this.VMLroot.style.width=this.coordsystem.width;this.VMLroot.style.height=this.coordsystem.height;this.container.appendChild(this.VMLroot)};this.Create=function(E,I,C,D,B,F){var A=null;var H=null;var G=null;switch(E){case"rect":A=this.container.ownerDocument.createElement("v:rect");break;case"circle":case"ellipse":A=this.container.ownerDocument.createElement("v:oval");A.style.top="0px";A.style.left="0px";A.style.width="0px";A.style.height="0px";break;case"line":A=this.container.ownerDocument.createElement("v:line");break;case"polyline":A=this.container.ownerDocument.createElement("v:polyline");A.closed=false;break;case"polygon":A=this.container.ownerDocument.createElement("v:polyline");A.closed=true;break;case"text":A=this.container.ownerDocument.createElement("v:shape");A.antialias=true;A.coordorigin=this.coordsystem.origin;A.coordsize=this.coordsystem.size;A.style.width=this.coordsystem.width;A.style.height=this.coordsystem.height;A.pathElem=this.container.ownerDocument.createElement("v:path");A.pathElem.textpathok=true;A.pathElem.v="m 0,0 l 1,0 e";A.appendChild(A.pathElem);A.textElem=this.container.ownerDocument.createElement("v:textpath");A.textElem.on=true;A.appendChild(A.textElem);break;case"path":A=this.container.ownerDocument.createElement("v:shape");A.coordorigin=this.coordsystem.origin;A.coordsize=this.coordsystem.size;A.style.width=this.coordsystem.width;A.style.height=this.coordsystem.height;A.moveto="m";A.lineto="l";A.endpath=" e";A.closepath=" x";A.pathElem=this.container.ownerDocument.createElement("v:path");A.pathElem.fillok=false;A.appendChild(A.pathElem);break;default:break}A.style.position="absolute";if(typeof I!="undefined"){H=this.container.ownerDocument.createElement("v:stroke");A.stroked=true;H.color=I;if(typeof C!="undefined"){H.weight=C}if(typeof D!="undefined"){H.opacity=parseFloat(D)}A.strokeElem=H;A.appendChild(H)}else{A.stroked=false}if(typeof B!="undefined"){G=this.container.ownerDocument.createElement("v:fill");A.filled=true;G.color=B;if(typeof F!="undefined"){G.opacity=parseFloat(F)}A.fillElem=G;if((E=="path")&&(B!="none")){A.pathElem.fillok=true}A.appendChild(G)}else{A.filled=false}this.VMLroot.appendChild(A);return A};this.Remove=function(A){A.removeNode(true)};this.SetWidth=function(A){};this.SetHeight=function(A){};this.Hide=function(){this.VMLroot.style.display="none"};this.Show=function(){this.VMLroot.style.display="block"};this.SetAttributes=function(E,C){var L,F,J,D,B,K,A,H,G;if((typeof E!="undefined")&&(typeof C!="undefined")){for(attribute in C){var I=C[attribute];switch(attribute){case"strokeColor":E.strokeElem.color=I;break;case"strokeWeight":E.strokeElem.weight=parseInt(I)+"px";break;case"strokeOpacity":E.strokeElem.opacity=parseFloat(I);break;case"strokeLinecap":if(I=="butt"){E.strokeElem.endcap="flat"}else{E.strokeElem.endcap=I}break;case"strokeLinejoin":E.strokeElem.joinstyle=I;break;case"fillColor":if(I=="none"){E.pathElem.fillok=false;E.fillElem.color=I}else{E.pathElem.fillok=true;E.fillElem.color=I}break;case"fillOpacity":E.fillElem.opacity=parseFloat(I);break;case"fontFamily":E.textElem.style.fontFamily=I;break;case"fontSize":E.textElem.style.fontSize=parseInt(I)+"px";break;case"fontWeight":E.textElem.style.fontWeight=I;break;case"fontStyle":E.textElem.style.fontStyle=I;break;case"textColor":E.strokeElem.color=I;E.fillElem.color=I;break;case"textOpacity":E.strokeElem.opacity=I;E.fillElem.opacity=I;break;case"text":E.textElem.string=I;break;case"d":E.pathElem.v=I;break;case"textAnchor":E.textElem.style["v-text-align"]=this.text_alignment[I];break;case"points":if(E.closed){L=I+","+I.split(",",2).join(",");E.points.value=L}else{E.points.value=I}break;case"center":F=I.split(",");B=parseInt(F[0]);K=parseInt(F[1]);E.style.top=K+"px";E.style.left=B+"px";break;case"x":E.style.left=parseInt(I)+"px";break;case"y":E.style.top=parseInt(I)+"px";break;case"start":E.from=I;break;case"end":E.to=I;break;case"radius":A=I.split(",");K=parseInt(E.style.top);B=parseInt(E.style.left);if(A.length==2){J=parseInt(A[0]);D=parseInt(A[1]);E.style.top=(K-D)+"px";E.style.left=(B-J)+"px";E.style.width=(J*2)+"px";E.style.height=(D*2)+"px"}else{J=D=parseInt(A[0]);E.style.top=(K-D)+"px";E.style.left=(B-J)+"px";E.style.width=(J*2)+"px";E.style.height=(D*2)+"px"}break;case"width":E.style.width=parseInt(I)+"px";break;case"height":E.style.height=parseInt(I)+"px";break;case"coordsize":E.coordsize=I;break;case"translate":K=I.split(",");H=parseInt(K[0])*-1;G=parseInt(K[1])*-1;E.coordorigin=H+","+G;break;case"display":E.style.display=I;break;default:break}}}};this.GetMarkup=function(){return this.container.innerHTML};this.GetPathData=function(A){return A.pathElem.v}};Pol.VI.GetRenderer=function(){var B;var C=navigator.appVersion.match(/MSIE (\d\.\d)/);var A=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);if(!C||A){B=new Pol.VI.SVGrenderer()}else{B=new Pol.VI.VMLrenderer()}return B};