if(typeof fleegix=="undefined"){var fleegix={}}fleegix.event=new function(){var B=[];var A={};this.listen=function(){var F=arguments[0];var D=arguments[1];var E={};var G={};if(typeof arguments[2]=="function"){E.method=arguments[2];G=arguments[3]||{}}else{E.context=arguments[2];E.method=arguments[3];G=arguments[4]||{}}if(!F){throw new Error("fleegix.listen called on an object ("+F+") that does not exist.")}if(D=="onmousewheel"){if(window.addEventListener&&typeof F.onmousewheel=="undefined"){F.onmousewheel=null}}var C=F[D]?F[D].listenReg:null;if(!C){C={};C.orig={};C.orig.obj=F;C.orig.methName=D;if(F[D]){C.orig.methCode=F[D]}C.after=[];F[D]=function(){var K=F[D].listenReg;if(!K){if(F["_"+D+"_suppressErrors"]){return false}else{throw new Error("Cannot execute handlers for "+F+"  \""+D+"\". Something (likely another JavaScript library) has removed the fleegix.event.listen handler registry.")}}var H=[];for(var J=0;J<arguments.length;J++){H.push(arguments[J])}if(K.orig.methCode){K.orig.methCode.apply(K.orig.obj,H)}var L=null;if(F.attachEvent||F.nodeType||F.addEventListener){if(!H.length){try{switch(true){case !!(F.ownerDocument):L=F.ownerDocument.parentWindow.event;break;case !!(F.documentElement):L=F.documentElement.ownerDocument.parentWindow.event;break;case !!(F.event):L=F.event;break;default:L=window.event;break}}catch(N){L=window.event}}else{L=H[0]}if(L){if(typeof L.target=="undefined"){L.target=L.srcElement}if(typeof L.srcElement=="undefined"){L.srcElement=L.target}if(L.type=="DOMMouseScroll"||L.type=="mousewheel"){if(L.wheelDelta){L.delta=L.wheelDelta/120}else{if(L.detail){L.delta=-L.detail/3}}}H[0]=L}}for(var J=0;J<K.after.length;J++){var I=K.after[J];var M=null;var O=null;if(!I.context){M=I.method;O=window}else{M=I.context[I.method];O=I.context}if(typeof M!="function"){throw (M+" is not an executable function.")}else{M.apply(O,H)}L=H[0];if(I.stopPropagation){if(L.stopPropagation){L.stopPropagation()}else{L.cancelBubble=true}}if(I.preventDefault){if(L.preventDefault){L.preventDefault()}else{L.returnValue=false}}}};F[D].listenReg=C;B.push(F[D].listenReg);if(D=="onmousewheel"){if(window.addEventListener){F.addEventListener("DOMMouseScroll",F.onmousewheel,false)}}}C.after.push(E);F[D].listenReg=C};this.unlisten=function(){var H=arguments[0];var E=arguments[1];var D=H[E]?H[E].listenReg:null;var C=null;if(!D){return false}for(var F=0;F<D.after.length;F++){var G=D.after[F];if(typeof arguments[2]=="function"){if(G.method==arguments[2]){D.after.splice(F,1)}}else{if(G.context==arguments[2]&&G.method==arguments[3]){D.after.splice(F,1)}}}H[E].listenReg=D};this.flush=function(){for(var C=0;C<B.length;C++){var D=B[C];removeObj=D.orig.obj;removeMethod=D.orig.methName;removeObj[removeMethod]=null}};this.subscribe=function(C,D,E){if(!D){return }if(!A[C]){A[C]={};A[C].audience=[]}else{this.unsubscribe(C,D)}A[C].audience.push([D,E])};this.unsubscribe=function(E,D){if(!D){A[E]=null}else{if(A[E]){var F=A[E].audience;for(var C=0;C<F.length;C++){if(F[C][0]==D){F.splice(C,1)}}}}};this.publish=function(F,G){if(A[F]){var H=A[F].audience;for(var D=0;D<H.length;D++){var C=H[D][0];var E=H[D][1];C[E](G)}}};this.getSrcElementId=function(D){var C=null;if(D.srcElement){C=D.srcElement}else{if(D.target){C=D.target}}if(typeof C.id=="undefined"){return null}else{while(!C.id||C.nodeType==3){if(C.parentNode){C=C.parentNode}else{return null}}}return C.id};this.suppressHandlerErrors=function(D,C){D["_"+C+"_suppressErrors"]=true}};fleegix.event.listen(window,"onunload",fleegix.event,"flush");fleegix.json=new function(){this.serialize=function(B){var C="";switch(typeof B){case"object":if(B===null){return"null"}else{if(B instanceof Array){for(var A=0;A<B.length;A++){if(C){C+=","}C+=fleegix.json.serialize(B[A])}return"["+C+"]"}else{if(typeof B.toString!="undefined"){for(var A in B){if(C){C+=","}C+="\""+A+"\":";if(typeof B[A]=="undefined"){C+="\"undefined\""}else{C+=fleegix.json.serialize(B[A])}}return"{"+C+"}"}}}return C;case"unknown":case"undefined":case"function":return"\"undefined\"";case"string":C+="\""+B.replace(/(["\\])/g,"\\$1").replace(/\r/g,"").replace(/\n/g,"\\n")+"\"";return C;default:return String(B)}}};fleegix.dom=new function(){var A=function(B){if(document.all){if(document.documentElement&&document.documentElement["client"+B]){return document.documentElement["client"+B]}else{return document.body["client"+B]}}else{return window["inner"+B]}};this.getViewportWidth=function(){return A("Width")};this.getViewportHeight=function(){return A("Height")};this.center=function(E){var B=E.offsetWidth;var C=E.offsetHeight;var D=fleegix.dom.getViewportWidth();var F=fleegix.dom.getViewportHeight();E.style.left=parseInt((D/2)-(B/2),10)+"px";E.style.top=parseInt((F/2)-(C/2),10)+"px";return true}};fleegix.css=new function(){this.addClass=function(B,A){fleegix.css.removeClass(B,A);var C=B.className;C+=" "+A;C=fleegix.string.trim(C);B.className=C};this.removeClass=function(C,B){var D=C.className;var A="\\b"+B+"\\b";A=new RegExp(A,"g");D=D.replace(A,"");D=D.replace("  "," ");D=fleegix.string.trim(D);C.className=D};this.replaceClass=function(B,A,C){this.removeClass(B,A);this.addClass(B,C)}};fleegix.fx=new function(){function B(G,D,H){var F={};var M=0;var I=0;if(D.blindType=="clip"){M=H=="down"?0:G.offsetHeight;I=H=="down"?G.offsetHeight:0;M=[0,G.offsetWidth,M,0];I=[0,G.offsetWidth,I,0];F.props={clip:[M,I]}}else{if(H=="down"){if(D.endHeight){I=D.endHeight}else{G.style.height="";var J=document.createElement("div");J.position="absolute";J.style.top="-9999999999px";J.style.left="-9999999999px";var K=G.parentNode;var C=K.removeChild(G);J.appendChild(C);document.body.appendChild(J);I=C.offsetHeight;G=J.removeChild(C);var L=document.body.removeChild(J);G.style.height="0px";K.appendChild(G)}M=0}else{M=G.offsetHeight;I=0}F.props={height:[M,I]}}for(var E in D){F[E]=D[E]}F.trans="lightEaseIn";return new fleegix.fx.Effecter(G,F)}function A(F,E,C){var D=C=="in"?0:100;var H=C=="in"?100:0;var I={props:{opacity:[D,H]},trans:"lightEaseIn"};for(var G in E){I[G]=E[G]}return new fleegix.fx.Effecter(F,I)}this.fadeOut=function(D,C){return A(D,C,"out")};this.fadeIn=function(D,C){return A(D,C,"in")};this.blindUp=function(D,C){var E=C||{};E.blindType=E.blindType||"height";return B(D,E,"up")};this.blindDown=function(D,C){var E=C||{};E.blindType=E.blindType||"height";return B(D,E,"down")};this.setCSSProp=function(D,E,C){if(E=="opacity"){if(document.all){D.style.filter="alpha(opacity="+C+")"}else{var F=C/100;D.style.opacity=F}}else{if(E=="clip"||E.toLowerCase().indexOf("color")>-1){D.style[E]=C}else{D.style[E]=document.all?parseInt(C,10)+"px":C+"px"}}return true};this.hexPat=/^[#]{0,1}([\w]{1,2})([\w]{1,2})([\w]{1,2})$/;this.hex2rgb=function(G){var C=[];var F=G.match(this.hexPat);if(F){for(var D=1;D<F.length;D++){var E=F[D];E=E.length==1?E+E:E;C.push(parseInt(E,16))}return C}else{throw ("\""+G+"\" not a valid hex value.")}}};fleegix.fx.Effecter=function(C,B){var A=this;this.props=B.props;this.trans=B.trans||"lightEaseIn";this.duration=B.duration||500;this.fps=30;this.startTime=new Date().getTime();this.timeSpent=0;this.doOnStart=B.doOnStart||null;this.doAfterFinished=B.doAfterFinished||null;this.autoStart=B.autoStart===false?false:true;if(typeof this.transitions[this.trans]!="function"){throw ("\""+this.trans+"\" is not a valid transition.")}this.start=function(){A.id=setInterval(function(){A.doStep.apply(A,[C])},Math.round(1000/A.fps));if(typeof B.doOnStart=="function"){A.doOnStart()}};if(this.autoStart){this.start()}return this};fleegix.fx.Effecter.prototype.doStep=function(C){var B=new Date().getTime();var D=this.props;if(B<(this.startTime+this.duration)){this.timeSpent=B-this.startTime;for(var A in D){fleegix.fx.setCSSProp(C,A,this.calcCurrVal(A))}}else{for(var A in D){if(A=="clip"){fleegix.fx.setCSSProp(C,A,"rect("+D[A][1].join("px,")+"px)")}else{fleegix.fx.setCSSProp(C,A,D[A][1])}}clearInterval(this.id);if(typeof this.doAfterFinished=="function"){this.doAfterFinished()}}};fleegix.fx.Effecter.prototype.calcCurrVal=function(G){var A=this.props[G][0];var F=this.props[G][1];var I=this.transitions[this.trans];var B;var D;var J;var H;var E;if(G.toLowerCase().indexOf("color")>-1){B=fleegix.fx.hex2rgb(A);D=fleegix.fx.hex2rgb(F);J=[];for(var C=0;C<B.length;C++){H=B[C];E=D[C];J.push(parseInt(I(this.timeSpent,H,(E-H),this.duration),10))}return"rgb("+J.join()+")"}else{if(G=="clip"){B=A;D=F;J=[];for(var C=0;C<B.length;C++){H=B[C];E=D[C];J.push(parseInt(I(this.timeSpent,H,(E-H),this.duration),10))}return"rect("+J.join("px,")+"px)"}else{return I(this.timeSpent,A,(F-A),this.duration)}}};fleegix.fx.Effecter.prototype.transitions={linear:function(B,A,D,C){return D*(B/C)+A},lightEaseIn:function(B,A,D,C){return D*(B/=C)*B+A},lightEaseOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A},lightEaseInOut:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A}return -D/2*((--B)*(B-2)-1)+A},heavyEaseIn:function(B,A,D,C){return D*(B/=C)*B*B+A},heavyEaseOut:function(B,A,D,C){return D*((B=B/C-1)*B*B+1)+A},heavyEaseInOut:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B+A}return D/2*((B-=2)*B*B+2)+A}};fleegix.uri=new function(){var A=this;this.params={};this.getParamHash=function(I){var B=I||A.getQuery();var H={};if(B){var G=B.split("&");for(var F=0;F<G.length;F++){var E=G[F].split("=");var C=E[0];var D=E[1];if(typeof H[C]=="undefined"){H[C]=D}else{if(!(H[C] instanceof Array)){var J=H[C];H[C]=[];H[C].push(J)}H[C].push(D)}}}return H};this.getParam=function(B,E){var D=null;if(E){var C=this.getParamHash(E);D=C[B]}else{D=this.params[B]}return D};this.setParam=function(E,G,F){var D=null;if(F){var C=new RegExp("(^|&)("+E+"=[^&]*)(&|$)");var B=F.match(C);if(B){D=F.replace(B[0],B[1]+E+"="+G+B[3])}else{D=F+"&"+E+"="+G}}else{D=E+"="+G}return D};this.getQuery=function(C){var B=C?C:location.href;return B.split("?")[1]};this.getBase=function(C){var B=C?C:location.href;return B.split("?")[0]};this.params=this.getParamHash()};fleegix.cookie=new function(){this.set=function(B,H,E){var A=E||{};var K="/";var I=0;var G=0;var F=0;var D="";var J=0;if(typeof E=="object"){K=A.path||"/";I=A.days||0;G=A.hours||0;F=A.minutes||0}else{K=E||"/"}J+=I?I*24*60*60*1000:0;J+=G?G*60*60*1000:0;J+=F?F*60*1000:0;if(J){var C=new Date();C.setTime(C.getTime()+J);D="; expires="+C.toGMTString()}else{D=""}document.cookie=B+"="+H+D+"; path="+K};this.get=function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)===0){return E.substring(D.length,E.length)}}return null};this.create=this.set;this.destroy=function(A,C){var B={};B.minutes=-1;if(C){B.path=C}this.set(A,"",B)}};fleegix.xhr=new function(){var B;var A=null;function C(G){var F=0;var E=["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","Microsoft.XMLHTTP"];var D=null;if(window.XMLHttpRequest){D=new XMLHttpRequest()}else{if(window.ActiveXObject){if(A){D=new ActiveXObject(A)}else{for(var F=0;F<E.length;F++){try{D=new ActiveXObject(E[F]);A=E[F];break}catch(H){}}}}}if(D){if(G){return D}else{fleegix.xhr.transporters.push(D);var I=fleegix.xhr.transporters.length-1;return I}}else{throw new Error("Could not create XMLHttpRequest object.")}}this.transporters=[];this.maxTransporters=5;this.lastReqId=0;this.requestQueue=[];this.idleTransporters=[];this.processingMap={};this.processingArray=[];this.syncTransporter=C(true);this.syncRequest=null;this.debug=false;this.processingWatcherId=null;this.defaultTimeoutSeconds=30;this.responseFormats={TXT:"text",XML:"xml",OBJ:"object"};this.doGet=function(){var I={};var D=null;var F=Array.prototype.slice.apply(arguments);if(typeof F[0]=="function"){I.async=true;D=F.shift()}else{I.async=false}var E=F.shift();if(typeof F[0]=="object"){var G=F.shift();for(var H in G){I[H]=G[H]}}else{I.responseFormat=F.shift()||"text"}I.handleSuccess=D;I.url=E;return this.doReq(I)};this.doPost=function(){var J={};var D=null;var F=Array.prototype.slice.apply(arguments);if(typeof F[0]=="function"){J.async=true;D=F.shift()}else{J.async=false}var E=F.shift();var G=F.shift();if(typeof F[0]=="object"){var H=F.shift();for(var I in H){J[I]=H[I]}}else{J.responseFormat=F.shift()||"text"}J.handleSuccess=D;J.url=E;J.dataPayload=G;J.method="POST";return this.doReq(J)};this.doReq=function(G){var E=G||{};var D=new fleegix.xhr.Request();var H=null;for(var F in E){D[F]=E[F]}D.id=this.lastReqId;this.lastReqId++;if(D.async){if(this.idleTransporters.length){H=this.idleTransporters.shift()}else{if(this.transporters.length<this.maxTransporters){H=C()}}if(H!==null){this.processReq(D,H)}else{if(D.uber){this.requestQueue.unshift(D)}else{this.requestQueue.push(D)}}return D.id}else{return this.processReq(D)}};this.processReq=function(K,L){var M=this;var I=null;var N=null;var D="";var F=null;if(K.async){I=L;N=this.transporters[I];this.processingMap[K.id]=K;this.processingArray.unshift(K);K.transporterId=I}else{N=this.syncTransporter;this.syncRequest=K}if(K.preventCache){var E=new Date().getTime();D=K.url.indexOf("?")>-1?K.url+"&preventCache="+E:K.url+"?preventCache="+E}else{D=K.url}if(document.all){N.abort()}if(K.username&&K.password){N.open(K.method,D,K.async,K.username,K.password)}else{N.open(K.method,D,K.async)}if(K.mimeType&&navigator.userAgent.indexOf("MSIE")==-1){N.overrideMimeType(K.mimeType)}if(K.headers.length){for(var H=0;H<K.headers.length;H++){var G=K.headers[H].split(": ");N.setRequestHeader(G[H],G[1])}}else{if(K.method=="POST"){N.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}}N.send(K.dataPayload);if(this.processingWatcherId===null){this.processingWatcherId=setTimeout(fleegix.xhr.watchProcessing,10)}if(!K.async){var J=this.handleResponse(N,K);this.syncRequest=null;if(M.processingArray.length){M.processingWatcherId=setTimeout(fleegix.xhr.watchProcessing,10)}return J}};this.getResponseByType=function(D,F){var E=null;switch(F.responseFormat){case"text":E=D.responseText;break;case"xml":E=D.responseXML;break;case"object":E=D;break}return E};this.watchProcessing=function(){var E=fleegix.xhr;var D=E.processingArray;var J=new Date().getTime();if(E.syncRequest!==null){return }else{for(var G=0;G<D.length;G++){var H=D[G];var F=E.transporters[H.transporterId];var I=((J-H.startTime)>(H.timeoutSeconds*1000));switch(true){case (H.aborted||!F.readyState):E.processingArray.splice(G,1);break;case I:E.processingArray.splice(G,1);E.timeout(H);break;case (F.readyState==4):E.processingArray.splice(G,1);E.handleResponse.apply(E,[F,H]);break}}}clearTimeout(E.processingWatcherId);if(E.processingArray.length){E.processingWatcherId=setTimeout(fleegix.xhr.watchProcessing,10)}else{E.processingWatcherId=null}};this.abort=function(F){var E=this.processingMap[F];var D=this.transporters[E.transporterId];if(D){D.onreadystatechange=function(){};D.abort();E.aborted=true;this.cleanupAfterReq(E);return true}else{return false}};this.timeout=function(D){if(fleegix.xhr.abort.apply(fleegix.xhr,[D.id])){if(typeof D.handleTimeout=="function"){D.handleTimeout()}else{alert("XMLHttpRequest to "+D.url+" timed out.")}}};this.handleResponse=function(D,E){var G=this.getResponseByType(D,E);if(E.handleAll){E.handleAll(G,E.id)}else{try{switch(true){case ((D.status>199&&D.status<300)||D.status==304):if(E.async){if(!E.handleSuccess){throw new Error("No response handler defined for this request")}else{E.handleSuccess(G,E.id)}}else{return G}break;case (D.status==0):if(this.debug){throw new Error("XMLHttpRequest HTTP status is zero.")}break;case (D.status==B):if(this.debug){throw new Error("XMLHttpRequest HTTP status not set.")}break;default:if(E.handleErr){E.handleErr(G,E.id)}else{this.handleErrDefault(D)}break}}catch(F){throw F}}if(E.async){this.cleanupAfterReq(E)}return true};this.cleanupAfterReq=function(E){delete this.processingMap[E.id];if(this.requestQueue.length){var D=this.requestQueue.shift();D.startTime=new Date().getTime();this.processReq(D,E.transporterId)}else{this.idleTransporters.push(E.transporterId)}};this.handleErrDefault=function(E){var D;try{D=window.open("","errorWin");D.document.body.innerHTML=E.responseText}catch(F){alert("An error occurred, but the error message cannot be displayed because of your browser's pop-up blocker.\nPlease allow pop-ups from this Web site.")}}};fleegix.xhr.Request=function(){this.id=0;this.transporterId=null;this.url=null;this.status=null;this.statusText="";this.method="GET";this.async=true;this.dataPayload=null;this.readyState=null;this.responseText=null;this.responseXML=null;this.handleSuccess=null;this.handleErr=null;this.handleAll=null;this.handleTimeout=null;this.responseFormat=fleegix.xhr.responseFormats.TXT;this.mimeType=null;this.username="";this.password="";this.headers=[];this.preventCache=false;this.startTime=new Date().getTime();this.timeoutSeconds=fleegix.xhr.defaultTimeoutSeconds;this.uber=false;this.aborted=false};fleegix.xhr.Request.prototype.setRequestHeader=function(B,A){this.headers.push(B+": "+A)};fleegix.form={};fleegix.form.serialize=function(F,B){var E=fleegix.form.toObject(F,B);var A=B||{};var H="";var G=null;if(A.stripTags){G=/<[^>]*>/g}for(var C in E){var K="";var I=E[C];if(I){if(typeof I=="string"){K=A.stripTags?I.replace(G,""):I;H+=C+"="+encodeURIComponent(K)}else{var J="";if(A.collapseMulti){J=",";H+=C+"="}else{J="&"}for(var D=0;D<I.length;D++){K=A.stripTags?I[D].replace(G,""):I[D];K=(!A.collapseMulti)?C+"="+encodeURIComponent(K):encodeURIComponent(K);H+=K+J}H=H.substr(0,H.length-1)}H+="&"}else{if(A.includeEmpty){H+=C+"=&"}}}H=H.substr(0,H.length-1);return H};fleegix.form.toObject=function(K,D){var A=D||{};var J={};function H(R,Q){if(R){var P=null;if(typeof R=="string"){P=[];P.push(R)}else{P=R}P.push(Q);return P}else{return Q}}for(var I=0;I<K.elements.length;I++){var F=K.elements[I];if(F.name){var O=F.name.indexOf("[");var C=F.name.indexOf("]");var N="";var B="";var M;var E;if(A.hierarchical&&(O>0)&&(C>2)){N=F.name.substring(0,O);B=F.name.substring(O+1,C);if(typeof J[N]=="undefined"){J[N]={}}M=J[N];E=B}else{M=J;E=F.name}switch(F.type){case"text":case"hidden":case"password":case"textarea":case"select-one":M[E]=F.value||null;break;case"select-multiple":M[E]=null;for(var G=0;G<F.options.length;G++){var L=F.options[G];if(L.selected){M[E]=H(M[E],L.value)}}break;case"radio":if(typeof M[E]=="undefined"){M[E]=null}if(F.checked){M[E]=F.value}break;case"checkbox":if(typeof M[E]=="undefined"){M[E]=null}if(F.checked){M[E]=H(M[E],F.value)}break;case"submit":case"reset":case"file":case"image":case"button":if(A.pedantic){M[E]=F.value||null}break}}}return J};fleegix.form.toHash=fleegix.form.toObject;fleegix.string=new function(){var B=/^\s+/;var A=/\s+$/;var C=/^\s+|\s+$/g;this.toArray=function(F){var D=[];for(var E=0;E<F.length;E++){D[E]=F.substr(E,1)}return D};this.reverse=function(D){return this.toArray(D).reverse().join("")};this.ltrim=function(F,E){var D=E?new RegExp("^"+E+"+"):B;return F.replace(D,"")};this.rtrim=function(F,E){var D=E?new RegExp(E+"+$"):A;return F.replace(D,"")};this.trim=function(F,E){var D=E?new RegExp("^"+E+"+|"+E+"+$","g"):C;return F.replace(D,"")}}