/* Copyright(c) 2010 One.Com */
/*
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(aQ,S){function a2(){if(!aj.isReady){try{U.documentElement.doScroll("left")}catch(c){setTimeout(a2,1);return}aj.ready()}}function H(w,c){c.src?aj.ajax({url:c.src,async:false,dataType:"script"}):aj.globalEval(c.text||c.textContent||c.innerHTML||"");c.parentNode&&c.parentNode.removeChild(c)}function ar(w,c,L,G,J,A){var F=w.length;if(typeof c==="object"){for(var K in c){ar(w,K,c[K],G,J,L)}return w}if(L!==S){G=!A&&G&&aj.isFunction(L);for(K=0;K<F;K++){J(w[K],c,G?L.call(w[K],K,J(w[K],c)):L,A)}return w}return F?J(w[0],c):S}function aH(){return(new Date).getTime()}function aq(){return false}function ao(){return true}function aM(w,c,A){A[0].type=w;return aj.event.handle.apply(c,A)}function ai(P){var O,N=[],K=[],L=arguments,G,J,w,F,A,c;J=aj.data(this,"events");if(!(P.liveFired===this||!J||!J.live||P.button&&P.type==="click")){P.liveFired=this;var Q=J.live.slice(0);for(F=0;F<Q.length;F++){J=Q[F];J.origType.replace(aB,"")===P.type?K.push(J.selector):Q.splice(F--,1)}G=aj(P.target).closest(K,P.currentTarget);A=0;for(c=G.length;A<c;A++){for(F=0;F<Q.length;F++){J=Q[F];if(G[A].selector===J.selector){w=G[A].elem;K=null;if(J.preType==="mouseenter"||J.preType==="mouseleave"){K=aj(P.relatedTarget).closest(J.selector)[0]}if(!K||K!==w){N.push({elem:w,handleObj:J})}}}}A=0;for(c=N.length;A<c;A++){G=N[A];P.currentTarget=G.elem;P.data=G.handleObj.data;P.handleObj=G.handleObj;if(G.handleObj.origHandler.apply(G.elem,L)===false){O=false;break}}return O}}function B(w,c){return"live."+(w&&w!=="*"?w+".":"")+c.replace(/\./g,"`").replace(/ /g,"&")}function m(c){return !c||!c.parentNode||c.parentNode.nodeType===11}function bl(w,c){var A=0;c.each(function(){if(this.nodeName===(w[A]&&w[A].nodeName)){var J=aj.data(w[A++]),K=aj.data(this,J);if(J=J&&J.events){delete K.handle;K.events={};for(var F in J){for(var G in J[F]){aj.event.add(this,F,J[F][G],J[F][G].data)}}}}})}function a5(w,c,J){var F,G,A;c=c&&c[0]?c[0].ownerDocument||c[0]:U;if(w.length===1&&typeof w[0]==="string"&&w[0].length<512&&c===U&&!aR.test(w[0])&&(aj.support.checkClone||!am.test(w[0]))){G=true;if(A=aj.fragments[w[0]]){if(A!==1){F=A}}}if(!F){F=c.createDocumentFragment();aj.clean(w,c,F,J)}if(G){aj.fragments[w[0]]=A?F:1}return{fragment:F,cacheable:G}}function aE(w,c){var A={};aj.each(E.concat.apply([],E.slice(0,c)),function(){A[this]=w});return A}function p(c){return"scrollTo" in c&&c.document?c:c.nodeType===9?c.defaultView||c.parentWindow:false}var aj=function(w,c){return new aj.fn.init(w,c)},q=aQ.jQuery,d=aQ.$,U=aQ.document,av,a9=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,aV=/^.[^:#\[\.,]*$/,ap=/\S/,I=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,r=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,az=navigator.userAgent,b=false,ax=[],aD,a3=Object.prototype.toString,aX=Object.prototype.hasOwnProperty,aA=Array.prototype.push,aw=Array.prototype.slice,a8=Array.prototype.indexOf;aj.fn=aj.prototype={init:function(w,c){var F,A;if(!w){return this}if(w.nodeType){this.context=this[0]=w;this.length=1;return this}if(w==="body"&&!c){this.context=U;this[0]=U.body;this.selector="body";this.length=1;return this}if(typeof w==="string"){if((F=a9.exec(w))&&(F[1]||!c)){if(F[1]){A=c?c.ownerDocument||c:U;if(w=r.exec(w)){if(aj.isPlainObject(c)){w=[U.createElement(w[1])];aj.fn.attr.call(w,c,true)}else{w=[A.createElement(w[1])]}}else{w=a5([F[1]],[A]);w=(w.cacheable?w.fragment.cloneNode(true):w.fragment).childNodes}return aj.merge(this,w)}else{if(c=U.getElementById(F[2])){if(c.id!==F[2]){return av.find(w)}this.length=1;this[0]=c}this.context=U;this.selector=w;return this}}else{if(!c&&/^\w+$/.test(w)){this.selector=w;this.context=U;w=U.getElementsByTagName(w);return aj.merge(this,w)}else{return !c||c.jquery?(c||av).find(w):aj(c).find(w)}}}else{if(aj.isFunction(w)){return av.ready(w)}}if(w.selector!==S){this.selector=w.selector;this.context=w.context}return aj.makeArray(w,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return aw.call(this,0)},get:function(c){return c==null?this.toArray():c<0?this.slice(c)[0]:this[c]},pushStack:function(w,c,F){var A=aj();aj.isArray(w)?aA.apply(A,w):aj.merge(A,w);A.prevObject=this;A.context=this.context;if(c==="find"){A.selector=this.selector+(this.selector?" ":"")+F}else{if(c){A.selector=this.selector+"."+c+"("+F+")"}}return A},each:function(w,c){return aj.each(this,w,c)},ready:function(c){aj.bindReady();if(aj.isReady){c.call(U,aj)}else{ax&&ax.push(c)}return this},eq:function(c){return c===-1?this.slice(c):this.slice(c,+c+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(aw.apply(this,arguments),"slice",aw.call(arguments).join(","))},map:function(c){return this.pushStack(aj.map(this,function(w,A){return c.call(w,A,w)}))},end:function(){return this.prevObject||aj(null)},push:aA,sort:[].sort,splice:[].splice};aj.fn.init.prototype=aj.fn;aj.extend=aj.fn.extend=function(){var w=arguments[0]||{},c=1,L=arguments.length,G=false,J,A,F,K;if(typeof w==="boolean"){G=w;w=arguments[1]||{};c=2}if(typeof w!=="object"&&!aj.isFunction(w)){w={}}if(L===c){w=this;--c}for(;c<L;c++){if((J=arguments[c])!=null){for(A in J){F=w[A];K=J[A];if(w!==K){if(G&&K&&(aj.isPlainObject(K)||aj.isArray(K))){F=F&&(aj.isPlainObject(F)||aj.isArray(F))?F:aj.isArray(K)?[]:{};w[A]=aj.extend(G,F,K)}else{if(K!==S){w[A]=K}}}}}}return w};aj.extend({noConflict:function(c){aQ.$=d;if(c){aQ.jQuery=q}return aj},isReady:false,ready:function(){if(!aj.isReady){if(!U.body){return setTimeout(aj.ready,13)}aj.isReady=true;if(ax){for(var w,c=0;w=ax[c++];){w.call(U,aj)}ax=null}aj.fn.triggerHandler&&aj(U).triggerHandler("ready")}},bindReady:function(){if(!b){b=true;if(U.readyState==="complete"){return aj.ready()}if(U.addEventListener){U.addEventListener("DOMContentLoaded",aD,false);aQ.addEventListener("load",aj.ready,false)}else{if(U.attachEvent){U.attachEvent("onreadystatechange",aD);aQ.attachEvent("onload",aj.ready);var w=false;try{w=aQ.frameElement==null}catch(c){}U.documentElement.doScroll&&w&&a2()}}}},isFunction:function(c){return a3.call(c)==="[object Function]"},isArray:function(c){return a3.call(c)==="[object Array]"},isPlainObject:function(w){if(!w||a3.call(w)!=="[object Object]"||w.nodeType||w.setInterval){return false}if(w.constructor&&!aX.call(w,"constructor")&&!aX.call(w.constructor.prototype,"isPrototypeOf")){return false}var c;for(c in w){}return c===S||aX.call(w,c)},isEmptyObject:function(w){for(var c in w){return false}return true},error:function(c){throw c},parseJSON:function(c){if(typeof c!=="string"||!c){return null}c=aj.trim(c);if(/^[\],:{}\s]*$/.test(c.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return aQ.JSON&&aQ.JSON.parse?aQ.JSON.parse(c):(new Function("return "+c))()}else{aj.error("Invalid JSON: "+c)}},noop:function(){},globalEval:function(w){if(w&&ap.test(w)){var c=U.getElementsByTagName("head")[0]||U.documentElement,A=U.createElement("script");A.type="text/javascript";if(aj.support.scriptEval){A.appendChild(U.createTextNode(w))}else{A.text=w}c.insertBefore(A,c.firstChild);c.removeChild(A)}},nodeName:function(w,c){return w.nodeName&&w.nodeName.toUpperCase()===c.toUpperCase()},each:function(w,c,K){var G,J=0,A=w.length,F=A===S||aj.isFunction(w);if(K){if(F){for(G in w){if(c.apply(w[G],K)===false){break}}}else{for(;J<A;){if(c.apply(w[J++],K)===false){break}}}}else{if(F){for(G in w){if(c.call(w[G],G,w[G])===false){break}}}else{for(K=w[0];J<A&&c.call(K,J,K)!==false;K=w[++J]){}}}return w},trim:function(c){return(c||"").replace(I,"")},makeArray:function(w,c){c=c||[];if(w!=null){w.length==null||typeof w==="string"||aj.isFunction(w)||typeof w!=="function"&&w.setInterval?aA.call(c,w):aj.merge(c,w)}return c},inArray:function(w,c){if(c.indexOf){return c.indexOf(w)}for(var F=0,A=c.length;F<A;F++){if(c[F]===w){return F}}return -1},merge:function(w,c){var G=w.length,A=0;if(typeof c.length==="number"){for(var F=c.length;A<F;A++){w[G++]=c[A]}}else{for(;c[A]!==S;){w[G++]=c[A++]}}w.length=G;return w},grep:function(w,c,J){for(var F=[],G=0,A=w.length;G<A;G++){!J!==!c(w[G],G)&&F.push(w[G])}return F},map:function(w,c,K){for(var G=[],J,A=0,F=w.length;A<F;A++){J=c(w[A],A,K);if(J!=null){G[G.length]=J}}return G.concat.apply([],G)},guid:1,proxy:function(w,c,A){if(arguments.length===2){if(typeof c==="string"){A=w;w=A[c];c=S}else{if(c&&!aj.isFunction(c)){A=c;c=S}}}if(!c&&w){c=function(){return w.apply(A||this,arguments)}}if(w){c.guid=w.guid=w.guid||c.guid||aj.guid++}return c},uaMatch:function(c){c=c.toLowerCase();c=/(webkit)[ \/]([\w.]+)/.exec(c)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(c)||/(msie) ([\w.]+)/.exec(c)||!/compatible/.test(c)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(c)||[];return{browser:c[1]||"",version:c[2]||"0"}},browser:{}});az=aj.uaMatch(az);if(az.browser){aj.browser[az.browser]=true;aj.browser.version=az.version}if(aj.browser.webkit){aj.browser.safari=true}if(a8){aj.inArray=function(w,c){return a8.call(c,w)}}av=aj(U);if(U.addEventListener){aD=function(){U.removeEventListener("DOMContentLoaded",aD,false);aj.ready()}}else{if(U.attachEvent){aD=function(){if(U.readyState==="complete"){U.detachEvent("onreadystatechange",aD);aj.ready()}}}}(function(){aj.support={};var N=U.documentElement,L=U.createElement("script"),K=U.createElement("div"),G="script"+aH();K.style.display="none";K.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var J=K.getElementsByTagName("*"),A=K.getElementsByTagName("a")[0];if(!(!J||!J.length||!A)){aj.support={leadingWhitespace:K.firstChild.nodeType===3,tbody:!K.getElementsByTagName("tbody").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(A.getAttribute("style")),hrefNormalized:A.getAttribute("href")==="/a",opacity:/^0.55$/.test(A.style.opacity),cssFloat:!!A.style.cssFloat,checkOn:K.getElementsByTagName("input")[0].value==="on",optSelected:U.createElement("select").appendChild(U.createElement("option")).selected,parentNode:K.removeChild(K.appendChild(U.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};L.type="text/javascript";try{L.appendChild(U.createTextNode("window."+G+"=1;"))}catch(F){}N.insertBefore(L,N.firstChild);if(aQ[G]){aj.support.scriptEval=true;delete aQ[G]}try{delete L.test}catch(c){aj.support.deleteExpando=false}N.removeChild(L);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function w(){aj.support.noCloneEvent=false;K.detachEvent("onclick",w)});K.cloneNode(true).fireEvent("onclick")}K=U.createElement("div");K.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";N=U.createDocumentFragment();N.appendChild(K.firstChild);aj.support.checkClone=N.cloneNode(true).cloneNode(true).lastChild.checked;aj(function(){var O=U.createElement("div");O.style.width=O.style.paddingLeft="1px";U.body.appendChild(O);aj.boxModel=aj.support.boxModel=O.offsetWidth===2;U.body.removeChild(O).style.display="none"});N=function(O){var Q=U.createElement("div");O="on"+O;var P=O in Q;if(!P){Q.setAttribute(O,"return;");P=typeof Q[O]==="function"}return P};aj.support.submitBubbles=N("submit");aj.support.changeBubbles=N("change");N=L=K=J=A=null}})();aj.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var aJ="jQuery"+aH(),e=0,aU={};aj.extend({cache:{},expando:aJ,noData:{embed:true,object:true,applet:true},data:function(w,c,G){if(!(w.nodeName&&aj.noData[w.nodeName.toLowerCase()])){w=w==aQ?aU:w;var A=w[aJ],F=aj.cache;if(!A&&typeof c==="string"&&G===S){return null}A||(A=++e);if(typeof c==="object"){w[aJ]=A;F[A]=aj.extend(true,{},c)}else{if(!F[A]){w[aJ]=A;F[A]={}}}w=F[A];if(G!==S){w[c]=G}return typeof c==="string"?w[c]:w}},removeData:function(w,c){if(!(w.nodeName&&aj.noData[w.nodeName.toLowerCase()])){w=w==aQ?aU:w;var G=w[aJ],A=aj.cache,F=A[G];if(c){if(F){delete F[c];aj.isEmptyObject(F)&&aj.removeData(w)}}else{if(aj.support.deleteExpando){delete w[aj.expando]}else{w.removeAttribute&&w.removeAttribute(aj.expando)}delete A[G]}}}});aj.fn.extend({data:function(w,c){if(typeof w==="undefined"&&this.length){return aj.data(this[0])}else{if(typeof w==="object"){return this.each(function(){aj.data(this,w)})}}var F=w.split(".");F[1]=F[1]?"."+F[1]:"";if(c===S){var A=this.triggerHandler("getData"+F[1]+"!",[F[0]]);if(A===S&&this.length){A=aj.data(this[0],w)}return A===S&&F[1]?this.data(F[0]):A}else{return this.trigger("setData"+F[1]+"!",[F[0],c]).each(function(){aj.data(this,w,c)})}},removeData:function(c){return this.each(function(){aj.removeData(this,c)})}});aj.extend({queue:function(w,c,F){if(w){c=(c||"fx")+"queue";var A=aj.data(w,c);if(!F){return A||[]}if(!A||aj.isArray(F)){A=aj.data(w,c,aj.makeArray(F))}else{A.push(F)}return A}},dequeue:function(w,c){c=c||"fx";var F=aj.queue(w,c),A=F.shift();if(A==="inprogress"){A=F.shift()}if(A){c==="fx"&&F.unshift("inprogress");A.call(w,function(){aj.dequeue(w,c)})}}});aj.fn.extend({queue:function(w,c){if(typeof w!=="string"){c=w;w="fx"}if(c===S){return aj.queue(this[0],w)}return this.each(function(){var A=aj.queue(this,w,c);w==="fx"&&A[0]!=="inprogress"&&aj.dequeue(this,w)})},dequeue:function(c){return this.each(function(){aj.dequeue(this,c)})},delay:function(w,c){w=aj.fx?aj.fx.speeds[w]||w:w;c=c||"fx";return this.queue(c,function(){var A=this;setTimeout(function(){aj.dequeue(A,c)},w)})},clearQueue:function(c){return this.queue(c||"fx",[])}});var bg=/[\n\t]/g,ad=/\s+/,bc=/\r/g,aO=/href|src|style/,aW=/(button|input)/i,ay=/(button|input|object|select|textarea)/i,ac=/^(a|area)$/i,a0=/radio|checkbox/;aj.fn.extend({attr:function(w,c){return ar(this,w,c,true,aj.attr)},removeAttr:function(c){return this.each(function(){aj.attr(this,c,"");this.nodeType===1&&this.removeAttribute(c)})},addClass:function(N){if(aj.isFunction(N)){return this.each(function(P){var O=aj(this);O.addClass(N.call(this,P,O.attr("class")))})}if(N&&typeof N==="string"){for(var L=(N||"").split(ad),K=0,G=this.length;K<G;K++){var J=this[K];if(J.nodeType===1){if(J.className){for(var A=" "+J.className+" ",F=J.className,c=0,w=L.length;c<w;c++){if(A.indexOf(" "+L[c]+" ")<0){F+=" "+L[c]}}J.className=aj.trim(F)}else{J.className=N}}}}return this},removeClass:function(w){if(aj.isFunction(w)){return this.each(function(N){var O=aj(this);O.removeClass(w.call(this,N,O.attr("class")))})}if(w&&typeof w==="string"||w===S){for(var c=(w||"").split(ad),L=0,G=this.length;L<G;L++){var J=this[L];if(J.nodeType===1&&J.className){if(w){for(var A=(" "+J.className+" ").replace(bg," "),F=0,K=c.length;F<K;F++){A=A.replace(" "+c[F]+" "," ")}J.className=aj.trim(A)}else{J.className=""}}}}return this},toggleClass:function(w,c){var F=typeof w,A=typeof c==="boolean";if(aj.isFunction(w)){return this.each(function(J){var G=aj(this);G.toggleClass(w.call(this,J,G.attr("class"),c),c)})}return this.each(function(){if(F==="string"){for(var L,J=0,K=aj(this),N=c,G=w.split(ad);L=G[J++];){N=A?N:!K.hasClass(L);K[N?"addClass":"removeClass"](L)}}else{if(F==="undefined"||F==="boolean"){this.className&&aj.data(this,"__className__",this.className);this.className=this.className||w===false?"":aj.data(this,"__className__")||""}}})},hasClass:function(w){w=" "+w+" ";for(var c=0,A=this.length;c<A;c++){if((" "+this[c].className+" ").replace(bg," ").indexOf(w)>-1){return true}}return false},val:function(w){if(w===S){var c=this[0];if(c){if(aj.nodeName(c,"option")){return(c.attributes.value||{}).specified?c.value:c.text}if(aj.nodeName(c,"select")){var L=c.selectedIndex,G=[],J=c.options;c=c.type==="select-one";if(L<0){return null}var A=c?L:0;for(L=c?L+1:J.length;A<L;A++){var F=J[A];if(F.selected){w=aj(F).val();if(c){return w}G.push(w)}}return G}if(a0.test(c.type)&&!aj.support.checkOn){return c.getAttribute("value")===null?"on":c.value}return(c.value||"").replace(bc,"")}return S}var K=aj.isFunction(w);return this.each(function(N){var Q=aj(this),P=w;if(this.nodeType===1){if(K){P=w.call(this,N,Q.val())}if(typeof P==="number"){P+=""}if(aj.isArray(P)&&a0.test(this.type)){this.checked=aj.inArray(Q.val(),P)>=0}else{if(aj.nodeName(this,"select")){var O=aj.makeArray(P);aj("option",this).each(function(){this.selected=aj.inArray(aj(this).val(),O)>=0});if(!O.length){this.selectedIndex=-1}}else{this.value=P}}}})}});aj.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(w,c,J,F){if(!w||w.nodeType===3||w.nodeType===8){return S}if(F&&c in aj.attrFn){return aj(w)[c](J)}F=w.nodeType!==1||!aj.isXMLDoc(w);var G=J!==S;c=F&&aj.props[c]||c;if(w.nodeType===1){var A=aO.test(c);if(c in w&&F&&!A){if(G){c==="type"&&aW.test(w.nodeName)&&w.parentNode&&aj.error("type property can't be changed");w[c]=J}if(aj.nodeName(w,"form")&&w.getAttributeNode(c)){return w.getAttributeNode(c).nodeValue}if(c==="tabIndex"){return(c=w.getAttributeNode("tabIndex"))&&c.specified?c.value:ay.test(w.nodeName)||ac.test(w.nodeName)&&w.href?0:S}return w[c]}if(!aj.support.style&&F&&c==="style"){if(G){w.style.cssText=""+J}return w.style.cssText}G&&w.setAttribute(c,""+J);w=!aj.support.hrefNormalized&&F&&A?w.getAttribute(c,2):w.getAttribute(c);return w===null?S:w}return aj.style(w,c,J)}});var aB=/\.(.*)$/,t=function(c){return c.replace(/[^\w\s\.\|`]/g,function(w){return"\\"+w})};aj.event={add:function(Q,P,N,K){if(!(Q.nodeType===3||Q.nodeType===8)){if(Q.setInterval&&Q!==aQ&&!Q.frameElement){Q=aQ}var L,G;if(N.handler){L=N;N=L.handler}if(!N.guid){N.guid=aj.guid++}if(G=aj.data(Q)){var J=G.events=G.events||{},w=G.handle;if(!w){G.handle=w=function(){return typeof aj!=="undefined"&&!aj.event.triggered?aj.event.handle.apply(w.elem,arguments):S}}w.elem=Q;P=P.split(" ");for(var F,A=0,c;F=P[A++];){G=L?aj.extend({},L):{handler:N,data:K};if(F.indexOf(".")>-1){c=F.split(".");F=c.shift();G.namespace=c.slice(0).sort().join(".")}else{c=[];G.namespace=""}G.type=F;G.guid=N.guid;var R=J[F],O=aj.event.special[F]||{};if(!R){R=J[F]=[];if(!O.setup||O.setup.call(Q,K,c,w)===false){if(Q.addEventListener){Q.addEventListener(F,w,false)}else{Q.attachEvent&&Q.attachEvent("on"+F,w)}}}if(O.add){O.add.call(Q,G);if(!G.handler.guid){G.handler.guid=N.guid}}R.push(G);aj.event.global[F]=true}Q=null}}},global:{},remove:function(T,R,P,N){if(!(T.nodeType===3||T.nodeType===8)){var O,K=0,L,F,J,G,c,V,Q=aj.data(T),w=Q&&Q.events;if(Q&&w){if(R&&R.type){P=R.handler;R=R.type}if(!R||typeof R==="string"&&R.charAt(0)==="."){R=R||"";for(O in w){aj.event.remove(T,O+R)}}else{for(R=R.split(" ");O=R[K++];){G=O;L=O.indexOf(".")<0;F=[];if(!L){F=O.split(".");O=F.shift();J=new RegExp("(^|\\.)"+aj.map(F.slice(0).sort(),t).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(c=w[O]){if(P){G=aj.event.special[O]||{};for(A=N||0;A<c.length;A++){V=c[A];if(P.guid===V.guid){if(L||J.test(V.namespace)){N==null&&c.splice(A--,1);G.remove&&G.remove.call(T,V)}if(N!=null){break}}}if(c.length===0||N!=null&&c.length===1){if(!G.teardown||G.teardown.call(T,F)===false){aI(T,O,Q.handle)}delete w[O]}}else{for(var A=0;A<c.length;A++){V=c[A];if(L||J.test(V.namespace)){aj.event.remove(T,G,V.handler,A);c.splice(A--,1)}}}}}if(aj.isEmptyObject(w)){if(R=Q.handle){R.elem=null}delete Q.events;delete Q.handle;aj.isEmptyObject(Q)&&aj.removeData(T)}}}}},trigger:function(O,N,L,J){var K=O.type||O;if(!J){O=typeof O==="object"?O[aJ]?O:aj.extend(aj.Event(K),O):aj.Event(K);if(K.indexOf("!")>=0){O.type=K=K.slice(0,-1);O.exclusive=true}if(!L){O.stopPropagation();aj.event.global[K]&&aj.each(aj.cache,function(){this.events&&this.events[K]&&aj.event.trigger(O,N,this.handle.elem)})}if(!L||L.nodeType===3||L.nodeType===8){return S}O.result=S;O.target=L;N=aj.makeArray(N);N.unshift(O)}O.currentTarget=L;(J=aj.data(L,"handle"))&&J.apply(L,N);J=L.parentNode||L.ownerDocument;try{if(!(L&&L.nodeName&&aj.noData[L.nodeName.toLowerCase()])){if(L["on"+K]&&L["on"+K].apply(L,N)===false){O.result=false}}}catch(F){}if(!O.isPropagationStopped()&&J){aj.event.trigger(O,N,J,true)}else{if(!O.isDefaultPrevented()){J=O.target;var G,c=aj.nodeName(J,"a")&&K==="click",A=aj.event.special[K]||{};if((!A._default||A._default.call(L,O)===false)&&!c&&!(J&&J.nodeName&&aj.noData[J.nodeName.toLowerCase()])){try{if(J[K]){if(G=J["on"+K]){J["on"+K]=null}aj.event.triggered=true;J[K]()}}catch(w){}if(G){J["on"+K]=G}aj.event.triggered=false}}}},handle:function(w){var c,K,G,J;w=arguments[0]=aj.event.fix(w||aQ.event);w.currentTarget=this;c=w.type.indexOf(".")<0&&!w.exclusive;if(!c){K=w.type.split(".");w.type=K.shift();G=new RegExp("(^|\\.)"+K.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}J=aj.data(this,"events");K=J[w.type];if(J&&K){K=K.slice(0);J=0;for(var A=K.length;J<A;J++){var F=K[J];if(c||G.test(F.namespace)){w.handler=F.handler;w.data=F.data;w.handleObj=F;F=F.handler.apply(this,arguments);if(F!==S){w.result=F;if(F===false){w.preventDefault();w.stopPropagation()}}if(w.isImmediatePropagationStopped()){break}}}}return w.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(w){if(w[aJ]){return w}var c=w;w=aj.Event(c);for(var F=this.props.length,A;F;){A=this.props[--F];w[A]=c[A]}if(!w.target){w.target=w.srcElement||U}if(w.target.nodeType===3){w.target=w.target.parentNode}if(!w.relatedTarget&&w.fromElement){w.relatedTarget=w.fromElement===w.target?w.toElement:w.fromElement}if(w.pageX==null&&w.clientX!=null){c=U.documentElement;F=U.body;w.pageX=w.clientX+(c&&c.scrollLeft||F&&F.scrollLeft||0)-(c&&c.clientLeft||F&&F.clientLeft||0);w.pageY=w.clientY+(c&&c.scrollTop||F&&F.scrollTop||0)-(c&&c.clientTop||F&&F.clientTop||0)}if(!w.which&&(w.charCode||w.charCode===0?w.charCode:w.keyCode)){w.which=w.charCode||w.keyCode}if(!w.metaKey&&w.ctrlKey){w.metaKey=w.ctrlKey}if(!w.which&&w.button!==S){w.which=w.button&1?1:w.button&2?3:w.button&4?2:0}return w},guid:100000000,proxy:aj.proxy,special:{ready:{setup:aj.bindReady,teardown:aj.noop},live:{add:function(c){aj.event.add(this,c.origType,aj.extend({},c,{handler:ai}))},remove:function(w){var c=true,A=w.origType.replace(aB,"");aj.each(aj.data(this,"events").live||[],function(){if(A===this.origType.replace(aB,"")){return c=false}});c&&aj.event.remove(this,w.origType,ai)}},beforeunload:{setup:function(w,c,A){if(this.setInterval){this.onbeforeunload=A}return false},teardown:function(w,c){if(this.onbeforeunload===c){this.onbeforeunload=null}}}}};var aI=U.removeEventListener?function(w,c,A){w.removeEventListener(c,A,false)}:function(w,c,A){w.detachEvent("on"+c,A)};aj.Event=function(c){if(!this.preventDefault){return new aj.Event(c)}if(c&&c.type){this.originalEvent=c;this.type=c.type}else{this.type=c}this.timeStamp=aH();this[aJ]=true};aj.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ao;var c=this.originalEvent;if(c){c.preventDefault&&c.preventDefault();c.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=ao;var c=this.originalEvent;if(c){c.stopPropagation&&c.stopPropagation();c.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ao;this.stopPropagation()},isDefaultPrevented:aq,isPropagationStopped:aq,isImmediatePropagationStopped:aq};var ag=function(w){var c=w.relatedTarget;try{for(;c&&c!==this;){c=c.parentNode}if(c!==this){w.type=w.data;aj.event.handle.apply(this,arguments)}}catch(A){}},y=function(c){c.type=c.data;aj.event.handle.apply(this,arguments)};aj.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(w,c){aj.event.special[w]={setup:function(A){aj.event.add(this,c,A&&A.selector?y:ag,w)},teardown:function(A){aj.event.remove(this,c,A&&A.selector?y:ag)}}});if(!aj.support.submitBubbles){aj.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){aj.event.add(this,"click.specialSubmit",function(w){var c=w.target,A=c.type;if((A==="submit"||A==="image")&&aj(c).closest("form").length){return aM("submit",this,arguments)}});aj.event.add(this,"keypress.specialSubmit",function(w){var c=w.target,A=c.type;if((A==="text"||A==="password")&&aj(c).closest("form").length&&w.keyCode===13){return aM("submit",this,arguments)}})}else{return false}},teardown:function(){aj.event.remove(this,".specialSubmit")}}}if(!aj.support.changeBubbles){var u=/textarea|input|select/i,g,k=function(w){var c=w.type,A=w.value;if(c==="radio"||c==="checkbox"){A=w.checked}else{if(c==="select-multiple"){A=w.selectedIndex>-1?aj.map(w.options,function(F){return F.selected}).join("-"):""}else{if(w.nodeName.toLowerCase()==="select"){A=w.selectedIndex}}}return A},bf=function(w,c){var G=w.target,A,F;if(!(!u.test(G.nodeName)||G.readOnly)){A=aj.data(G,"_change_data");F=k(G);if(w.type!=="focusout"||G.type!=="radio"){aj.data(G,"_change_data",F)}if(!(A===S||F===A)){if(A!=null||F){w.type="change";return aj.event.trigger(w,c,G)}}}};aj.event.special.change={filters:{focusout:bf,click:function(w){var c=w.target,A=c.type;if(A==="radio"||A==="checkbox"||c.nodeName.toLowerCase()==="select"){return bf.call(this,w)}},keydown:function(w){var c=w.target,A=c.type;if(w.keyCode===13&&c.nodeName.toLowerCase()!=="textarea"||w.keyCode===32&&(A==="checkbox"||A==="radio")||A==="select-multiple"){return bf.call(this,w)}},beforeactivate:function(c){c=c.target;aj.data(c,"_change_data",k(c))}},setup:function(){if(this.type==="file"){return false}for(var c in g){aj.event.add(this,c+".specialChange",g[c])}return u.test(this.nodeName)},teardown:function(){aj.event.remove(this,".specialChange");return u.test(this.nodeName)}};g=aj.event.special.change.filters}U.addEventListener&&aj.each({focus:"focusin",blur:"focusout"},function(w,c){function A(F){F=aj.event.fix(F);F.type=c;return aj.event.handle.call(this,F)}aj.event.special[c]={setup:function(){this.addEventListener(w,A,true)},teardown:function(){this.removeEventListener(w,A,true)}}});aj.each(["bind","one"],function(w,c){aj.fn[c]=function(L,G,J){if(typeof L==="object"){for(var A in L){this[c](A,G,L[A],J)}return this}if(aj.isFunction(G)){J=G;G=S}var F=c==="one"?aj.proxy(J,function(N){aj(this).unbind(N,F);return J.apply(this,arguments)}):J;if(L==="unload"&&c!=="one"){this.one(L,G,J)}else{A=0;for(var K=this.length;A<K;A++){aj.event.add(this[A],L,F,G)}}return this}});aj.fn.extend({unbind:function(w,c){if(typeof w==="object"&&!w.preventDefault){for(var F in w){this.unbind(F,w[F])}}else{F=0;for(var A=this.length;F<A;F++){aj.event.remove(this[F],w,c)}}return this},delegate:function(w,c,F,A){return this.live(c,F,A,w)},undelegate:function(w,c,A){return arguments.length===0?this.unbind("live"):this.die(c,null,A,w)},trigger:function(w,c){return this.each(function(){aj.event.trigger(w,c,this)})},triggerHandler:function(w,c){if(this[0]){w=aj.Event(w);w.preventDefault();w.stopPropagation();aj.event.trigger(w,c,this[0]);return w.result}},toggle:function(w){for(var c=arguments,A=1;A<c.length;){aj.proxy(w,c[A++])}return this.click(aj.proxy(w,function(F){var G=(aj.data(this,"lastToggle"+w.guid)||0)%A;aj.data(this,"lastToggle"+w.guid,G+1);F.preventDefault();return c[G].apply(this,arguments)||false}))},hover:function(w,c){return this.mouseenter(w).mouseleave(c||w)}});var bj={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};aj.each(["live","die"],function(w,c){aj.fn[c]=function(P,N,O,K){var L,F=0,J,G,A=K||this.selector,Q=K?this:aj(this.context);if(aj.isFunction(N)){O=N;N=S}for(P=(P||"").split(" ");(L=P[F++])!=null;){K=aB.exec(L);J="";if(K){J=K[0];L=L.replace(aB,"")}if(L==="hover"){P.push("mouseenter"+J,"mouseleave"+J)}else{G=L;if(L==="focus"||L==="blur"){P.push(bj[L]+J);L+=J}else{L=(bj[L]||L)+J}c==="live"?Q.each(function(){aj.event.add(this,B(L,A),{data:N,selector:A,handler:O,origType:L,origHandler:O,preType:G})}):Q.unbind(B(L,A),O)}}return this}});aj.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(w,c){aj.fn[c]=function(A){return A?this.bind(c,A):this.trigger(c)};if(aj.attrFn){aj.attrFn[c]=true}});aQ.attachEvent&&!aQ.addEventListener&&aQ.attachEvent("onunload",function(){for(var w in aj.cache){if(aj.cache[w].handle){try{aj.event.remove(aj.cache[w].handle.elem)}catch(c){}}}});(function(){function X(ba){for(var ab="",aa,Z=0;ba[Z];Z++){aa=ba[Z];if(aa.nodeType===3||aa.nodeType===4){ab+=aa.nodeValue}else{if(aa.nodeType!==8){ab+=X(aa.childNodes)}}}return ab}function W(bn,bb,ba,ab,Z,aa){Z=0;for(var bp=ab.length;Z<bp;Z++){var bq=ab[Z];if(bq){bq=bq[bn];for(var bo=false;bq;){if(bq.sizcache===ba){bo=ab[bq.sizset];break}if(bq.nodeType===1&&!aa){bq.sizcache=ba;bq.sizset=Z}if(bq.nodeName.toLowerCase()===bb){bo=bq;break}bq=bq[bn]}ab[Z]=bo}}}function V(bn,bb,ba,ab,Z,aa){Z=0;for(var bp=ab.length;Z<bp;Z++){var bq=ab[Z];if(bq){bq=bq[bn];for(var bo=false;bq;){if(bq.sizcache===ba){bo=ab[bq.sizset];break}if(bq.nodeType===1){if(!aa){bq.sizcache=ba;bq.sizset=Z}if(typeof bb!=="string"){if(bq===bb){bo=true;break}}else{if(O.filter(bb,[bq]).length>0){bo=bq;break}}}bq=bq[bn]}ab[Z]=bo}}}var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,T=0,P=Object.prototype.toString,Q=false,L=true;[0,0].sort(function(){L=false;return 0});var O=function(bp,bo,bb,ba){bb=bb||[];var aa=bo=bo||U;if(bo.nodeType!==1&&bo.nodeType!==9){return[]}if(!bp||typeof bp!=="string"){return bb}for(var ab=[],bu,bv,br,bn,bt=true,bq=w(bo),bs=bp;(R.exec(""),bu=R.exec(bs))!==null;){bs=bu[3];ab.push(bu[1]);if(bu[2]){bn=bu[3];break}}if(ab.length>1&&J.exec(bp)){if(ab.length===2&&N.relative[ab[0]]){bv=Y(ab[0]+ab[1],bo)}else{for(bv=N.relative[ab[0]]?[bo]:O(ab.shift(),bo);ab.length;){bp=ab.shift();if(N.relative[bp]){bp+=ab.shift()}bv=Y(bp,bv)}}}else{if(!ba&&ab.length>1&&bo.nodeType===9&&!bq&&N.match.ID.test(ab[0])&&!N.match.ID.test(ab[ab.length-1])){bu=O.find(ab.shift(),bo,bq);bo=bu.expr?O.filter(bu.expr,bu.set)[0]:bu.set[0]}if(bo){bu=ba?{expr:ab.pop(),set:c(ba)}:O.find(ab.pop(),ab.length===1&&(ab[0]==="~"||ab[0]==="+")&&bo.parentNode?bo.parentNode:bo,bq);bv=bu.expr?O.filter(bu.expr,bu.set):bu.set;if(ab.length>0){br=c(bv)}else{bt=false}for(;ab.length;){var Z=ab.pop();bu=Z;if(N.relative[Z]){bu=ab.pop()}else{Z=""}if(bu==null){bu=bo}N.relative[Z](br,bu,bq)}}else{br=[]}}br||(br=bv);br||O.error(Z||bp);if(P.call(br)==="[object Array]"){if(bt){if(bo&&bo.nodeType===1){for(bp=0;br[bp]!=null;bp++){if(br[bp]&&(br[bp]===true||br[bp].nodeType===1&&F(bo,br[bp]))){bb.push(bv[bp])}}}else{for(bp=0;br[bp]!=null;bp++){br[bp]&&br[bp].nodeType===1&&bb.push(bv[bp])}}}else{bb.push.apply(bb,br)}}else{c(br,bb)}if(bn){O(bn,aa,bb,ba);O.uniqueSort(bb)}return bb};O.uniqueSort=function(aa){if(K){Q=L;aa.sort(K);if(Q){for(var Z=1;Z<aa.length;Z++){aa[Z]===aa[Z-1]&&aa.splice(Z--,1)}}}return aa};O.matches=function(aa,Z){return O(aa,null,null,Z)};O.find=function(bn,bb,ba){var ab,Z;if(!bn){return[]}for(var aa=0,bp=N.order.length;aa<bp;aa++){var bq=N.order[aa];if(Z=N.leftMatch[bq].exec(bn)){var bo=Z[1];Z.splice(1,1);if(bo.substr(bo.length-1)!=="\\"){Z[1]=(Z[1]||"").replace(/\\/g,"");ab=N.find[bq](Z,bb,ba);if(ab!=null){bn=bn.replace(N.match[bq],"");break}}}}ab||(ab=bb.getElementsByTagName("*"));return{set:ab,expr:bn}};O.filter=function(bq,bp,bn,ba){for(var aa=bq,ab=[],bw=bp,bx,bt,bo=bp&&bp[0]&&w(bp[0]);bq&&bp.length;){for(var bv in N.filter){if((bx=N.leftMatch[bv].exec(bq))!=null&&bx[2]){var br=N.filter[bv],bu,Z;Z=bx[1];bt=false;bx.splice(1,1);if(Z.substr(Z.length-1)!=="\\"){if(bw===ab){ab=[]}if(N.preFilter[bv]){if(bx=N.preFilter[bv](bx,bw,bn,ab,ba,bo)){if(bx===true){continue}}else{bt=bu=true}}if(bx){for(var bb=0;(Z=bw[bb])!=null;bb++){if(Z){bu=br(Z,bx,bb,bw);var bs=ba^!!bu;if(bn&&bu!=null){if(bs){bt=true}else{bw[bb]=false}}else{if(bs){ab.push(Z);bt=true}}}}}if(bu!==S){bn||(bw=ab);bq=bq.replace(N.match[bv],"");if(!bt){return[]}break}}}}if(bq===aa){if(bt==null){O.error(bq)}else{break}}aa=bq}return bw};O.error=function(Z){throw"Syntax error, unrecognized expression: "+Z};var N=O.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(Z){return Z.getAttribute("href")}},relative:{"+":function(ba,ab){var aa=typeof ab==="string",Z=aa&&!/\W/.test(ab);aa=aa&&!Z;if(Z){ab=ab.toLowerCase()}Z=0;for(var bb=ba.length,bn;Z<bb;Z++){if(bn=ba[Z]){for(;(bn=bn.previousSibling)&&bn.nodeType!==1;){}ba[Z]=aa||bn&&bn.nodeName.toLowerCase()===ab?bn||false:bn===ab}}aa&&O.filter(ab,ba,true)},">":function(ba,ab){var aa=typeof ab==="string";if(aa&&!/\W/.test(ab)){ab=ab.toLowerCase();for(var Z=0,bb=ba.length;Z<bb;Z++){var bn=ba[Z];if(bn){aa=bn.parentNode;ba[Z]=aa.nodeName.toLowerCase()===ab?aa:false}}}else{Z=0;for(bb=ba.length;Z<bb;Z++){if(bn=ba[Z]){ba[Z]=aa?bn.parentNode:bn.parentNode===ab}}aa&&O.filter(ab,ba,true)}},"":function(ba,ab,aa){var Z=T++,bb=V;if(typeof ab==="string"&&!/\W/.test(ab)){var bn=ab=ab.toLowerCase();bb=W}bb("parentNode",ab,Z,ba,bn,aa)},"~":function(ba,ab,aa){var Z=T++,bb=V;if(typeof ab==="string"&&!/\W/.test(ab)){var bn=ab=ab.toLowerCase();bb=W}bb("previousSibling",ab,Z,ba,bn,aa)}},find:{ID:function(ab,aa,Z){if(typeof aa.getElementById!=="undefined"&&!Z){return(ab=aa.getElementById(ab[1]))?[ab]:[]}},NAME:function(ba,ab){if(typeof ab.getElementsByName!=="undefined"){var aa=[];ab=ab.getElementsByName(ba[1]);for(var Z=0,bb=ab.length;Z<bb;Z++){ab[Z].getAttribute("name")===ba[1]&&aa.push(ab[Z])}return aa.length===0?null:aa}},TAG:function(aa,Z){return Z.getElementsByTagName(aa[1])}},preFilter:{CLASS:function(bb,ba,aa,Z,bn,bo){bb=" "+bb[1].replace(/\\/g,"")+" ";if(bo){return bb}bo=0;for(var ab;(ab=ba[bo])!=null;bo++){if(ab){if(bn^(ab.className&&(" "+ab.className+" ").replace(/[\t\n]/g," ").indexOf(bb)>=0)){aa||Z.push(ab)}else{if(aa){ba[bo]=false}}}}return false},ID:function(Z){return Z[1].replace(/\\/g,"")},TAG:function(Z){return Z[1].toLowerCase()},CHILD:function(aa){if(aa[1]==="nth"){var Z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(aa[2]==="even"&&"2n"||aa[2]==="odd"&&"2n+1"||!/\D/.test(aa[2])&&"0n+"+aa[2]||aa[2]);aa[2]=Z[1]+(Z[2]||1)-0;aa[3]=Z[3]-0}aa[0]=T++;return aa},ATTR:function(ba,ab,aa,Z,bb,bn){ab=ba[1].replace(/\\/g,"");if(!bn&&N.attrMap[ab]){ba[1]=N.attrMap[ab]}if(ba[2]==="~="){ba[4]=" "+ba[4]+" "}return ba},PSEUDO:function(ba,ab,aa,Z,bb){if(ba[1]==="not"){if((R.exec(ba[3])||"").length>1||/^\w/.test(ba[3])){ba[3]=O(ba[3],null,null,ab)}else{ba=O.filter(ba[3],ab,aa,true^bb);aa||Z.push.apply(Z,ba);return false}}else{if(N.match.POS.test(ba[0])||N.match.CHILD.test(ba[0])){return true}}return ba},POS:function(Z){Z.unshift(true);return Z}},filters:{enabled:function(Z){return Z.disabled===false&&Z.type!=="hidden"},disabled:function(Z){return Z.disabled===true},checked:function(Z){return Z.checked===true},selected:function(Z){return Z.selected===true},parent:function(Z){return !!Z.firstChild},empty:function(Z){return !Z.firstChild},has:function(ab,aa,Z){return !!O(Z[3],ab).length},header:function(Z){return/h\d/i.test(Z.nodeName)},text:function(Z){return"text"===Z.type},radio:function(Z){return"radio"===Z.type},checkbox:function(Z){return"checkbox"===Z.type},file:function(Z){return"file"===Z.type},password:function(Z){return"password"===Z.type},submit:function(Z){return"submit"===Z.type},image:function(Z){return"image"===Z.type},reset:function(Z){return"reset"===Z.type},button:function(Z){return"button"===Z.type||Z.nodeName.toLowerCase()==="button"},input:function(Z){return/input|select|textarea|button/i.test(Z.nodeName)}},setFilters:{first:function(aa,Z){return Z===0},last:function(ba,ab,aa,Z){return ab===Z.length-1},even:function(aa,Z){return Z%2===0},odd:function(aa,Z){return Z%2===1},lt:function(ab,aa,Z){return aa<Z[3]-0},gt:function(ab,aa,Z){return aa>Z[3]-0},nth:function(ab,aa,Z){return Z[3]-0===aa},eq:function(ab,aa,Z){return Z[3]-0===aa}},filter:{PSEUDO:function(ba,ab,aa,Z){var bb=ab[1],bn=N.filters[bb];if(bn){return bn(ba,aa,ab,Z)}else{if(bb==="contains"){return(ba.textContent||ba.innerText||X([ba])||"").indexOf(ab[3])>=0}else{if(bb==="not"){ab=ab[3];aa=0;for(Z=ab.length;aa<Z;aa++){if(ab[aa]===ba){return false}}return true}else{O.error("Syntax error, unrecognized expression: "+bb)}}}},CHILD:function(bb,ba){var aa=ba[1],Z=bb;switch(aa){case"only":case"first":for(;Z=Z.previousSibling;){if(Z.nodeType===1){return false}}if(aa==="first"){return true}Z=bb;case"last":for(;Z=Z.nextSibling;){if(Z.nodeType===1){return false}}return true;case"nth":aa=ba[2];var bn=ba[3];if(aa===1&&bn===0){return true}ba=ba[0];var bo=bb.parentNode;if(bo&&(bo.sizcache!==ba||!bb.nodeIndex)){var ab=0;for(Z=bo.firstChild;Z;Z=Z.nextSibling){if(Z.nodeType===1){Z.nodeIndex=++ab}}bo.sizcache=ba}bb=bb.nodeIndex-bn;return aa===0?bb===0:bb%aa===0&&bb/aa>=0}},ID:function(aa,Z){return aa.nodeType===1&&aa.getAttribute("id")===Z},TAG:function(aa,Z){return Z==="*"&&aa.nodeType===1||aa.nodeName.toLowerCase()===Z},CLASS:function(aa,Z){return(" "+(aa.className||aa.getAttribute("class"))+" ").indexOf(Z)>-1},ATTR:function(ba,ab){var aa=ab[1];ba=N.attrHandle[aa]?N.attrHandle[aa](ba):ba[aa]!=null?ba[aa]:ba.getAttribute(aa);aa=ba+"";var Z=ab[2];ab=ab[4];return ba==null?Z==="!=":Z==="="?aa===ab:Z==="*="?aa.indexOf(ab)>=0:Z==="~="?(" "+aa+" ").indexOf(ab)>=0:!ab?aa&&ba!==false:Z==="!="?aa!==ab:Z==="^="?aa.indexOf(ab)===0:Z==="$="?aa.substr(aa.length-ab.length)===ab:Z==="|="?aa===ab||aa.substr(0,ab.length+1)===ab+"-":false},POS:function(ba,ab,aa,Z){var bb=N.setFilters[ab[2]];if(bb){return bb(ba,aa,ab,Z)}}}},J=N.match.POS;for(var A in N.match){N.match[A]=new RegExp(N.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);N.leftMatch[A]=new RegExp(/(^(?:.|\r|\n)*?)/.source+N.match[A].source.replace(/\\(\d+)/g,function(aa,Z){return"\\"+(Z-0+1)}))}var c=function(aa,Z){aa=Array.prototype.slice.call(aa,0);if(Z){Z.push.apply(Z,aa);return Z}return aa};try{Array.prototype.slice.call(U.documentElement.childNodes,0)}catch(G){c=function(ba,ab){ab=ab||[];if(P.call(ba)==="[object Array]"){Array.prototype.push.apply(ab,ba)}else{if(typeof ba.length==="number"){for(var aa=0,Z=ba.length;aa<Z;aa++){ab.push(ba[aa])}}else{for(aa=0;ba[aa];aa++){ab.push(ba[aa])}}}return ab}}var K;if(U.documentElement.compareDocumentPosition){K=function(aa,Z){if(!aa.compareDocumentPosition||!Z.compareDocumentPosition){if(aa==Z){Q=true}return aa.compareDocumentPosition?-1:1}aa=aa.compareDocumentPosition(Z)&4?-1:aa===Z?0:1;if(aa===0){Q=true}return aa}}else{if("sourceIndex" in U.documentElement){K=function(aa,Z){if(!aa.sourceIndex||!Z.sourceIndex){if(aa==Z){Q=true}return aa.sourceIndex?-1:1}aa=aa.sourceIndex-Z.sourceIndex;if(aa===0){Q=true}return aa}}else{if(U.createRange){K=function(ba,ab){if(!ba.ownerDocument||!ab.ownerDocument){if(ba==ab){Q=true}return ba.ownerDocument?-1:1}var aa=ba.ownerDocument.createRange(),Z=ab.ownerDocument.createRange();aa.setStart(ba,0);aa.setEnd(ba,0);Z.setStart(ab,0);Z.setEnd(ab,0);ba=aa.compareBoundaryPoints(Range.START_TO_END,Z);if(ba===0){Q=true}return ba}}}}(function(){var ab=U.createElement("div"),aa="script"+(new Date).getTime();ab.innerHTML="<a name='"+aa+"'/>";var Z=U.documentElement;Z.insertBefore(ab,Z.firstChild);if(U.getElementById(aa)){N.find.ID=function(ba,bb,bn){if(typeof bb.getElementById!=="undefined"&&!bn){return(bb=bb.getElementById(ba[1]))?bb.id===ba[1]||typeof bb.getAttributeNode!=="undefined"&&bb.getAttributeNode("id").nodeValue===ba[1]?[bb]:S:[]}};N.filter.ID=function(ba,bb){var bn=typeof ba.getAttributeNode!=="undefined"&&ba.getAttributeNode("id");return ba.nodeType===1&&bn&&bn.nodeValue===bb}}Z.removeChild(ab);Z=ab=null})();(function(){var Z=U.createElement("div");Z.appendChild(U.createComment(""));if(Z.getElementsByTagName("*").length>0){N.find.TAG=function(ba,ab){ab=ab.getElementsByTagName(ba[1]);if(ba[1]==="*"){ba=[];for(var aa=0;ab[aa];aa++){ab[aa].nodeType===1&&ba.push(ab[aa])}ab=ba}return ab}}Z.innerHTML="<a href='#'></a>";if(Z.firstChild&&typeof Z.firstChild.getAttribute!=="undefined"&&Z.firstChild.getAttribute("href")!=="#"){N.attrHandle.href=function(aa){return aa.getAttribute("href",2)}}Z=null})();U.querySelectorAll&&function(){var ab=O,aa=U.createElement("div");aa.innerHTML="<p class='TEST'></p>";if(!(aa.querySelectorAll&&aa.querySelectorAll(".TEST").length===0)){O=function(ba,bo,bp,bb){bo=bo||U;if(!bb&&bo.nodeType===9&&!w(bo)){try{return c(bo.querySelectorAll(ba),bp)}catch(bn){}}return ab(ba,bo,bp,bb)};for(var Z in ab){O[Z]=ab[Z]}aa=null}}();(function(){var Z=U.createElement("div");Z.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!Z.getElementsByClassName||Z.getElementsByClassName("e").length===0)){Z.lastChild.className="e";if(Z.getElementsByClassName("e").length!==1){N.order.splice(1,0,"CLASS");N.find.CLASS=function(ba,ab,aa){if(typeof ab.getElementsByClassName!=="undefined"&&!aa){return ab.getElementsByClassName(ba[1])}};Z=null}}})();var F=U.compareDocumentPosition?function(aa,Z){return !!(aa.compareDocumentPosition(Z)&16)}:function(aa,Z){return aa!==Z&&(aa.contains?aa.contains(Z):true)},w=function(Z){return(Z=(Z?Z.ownerDocument||Z:0).documentElement)?Z.nodeName!=="HTML":false},Y=function(ba,ab){var aa=[],Z="",bb;for(ab=ab.nodeType?[ab]:ab;bb=N.match.PSEUDO.exec(ba);){Z+=bb[0];ba=ba.replace(N.match.PSEUDO,"")}ba=N.relative[ba]?ba+"*":ba;bb=0;for(var bn=ab.length;bb<bn;bb++){O(ba,ab[bb],aa)}return O.filter(Z,aa)};aj.find=O;aj.expr=O.selectors;aj.expr[":"]=aj.expr.filters;aj.unique=O.uniqueSort;aj.text=X;aj.isXMLDoc=w;aj.contains=F})();var f=/Until$/,bd=/^(?:parents|prevUntil|prevAll)/,aY=/,/;aw=Array.prototype.slice;var aN=function(w,c,F){if(aj.isFunction(c)){return aj.grep(w,function(J,G){return !!c.call(J,G,J)===F})}else{if(c.nodeType){return aj.grep(w,function(G){return G===c===F})}else{if(typeof c==="string"){var A=aj.grep(w,function(G){return G.nodeType===1});if(aV.test(c)){return aj.filter(c,A,!F)}else{c=aj.filter(c,A)}}}}return aj.grep(w,function(G){return aj.inArray(G,c)>=0===F})};aj.fn.extend({find:function(w){for(var c=this.pushStack("","find",w),K=0,G=0,J=this.length;G<J;G++){K=c.length;aj.find(w,this[G],c);if(G>0){for(var A=K;A<c.length;A++){for(var F=0;F<K;F++){if(c[F]===c[A]){c.splice(A--,1);break}}}}}return c},has:function(w){var c=aj(w);return this.filter(function(){for(var F=0,A=c.length;F<A;F++){if(aj.contains(this,c[F])){return true}}})},not:function(c){return this.pushStack(aN(this,c,false),"not",c)},filter:function(c){return this.pushStack(aN(this,c,true),"filter",c)},is:function(c){return !!c&&aj.filter(c,this).length>0},closest:function(N,L){if(aj.isArray(N)){var K=[],G=this[0],J,A={},F;if(G&&N.length){J=0;for(var c=N.length;J<c;J++){F=N[J];A[F]||(A[F]=aj.expr.match.POS.test(F)?aj(F,L||this.context):F)}for(;G&&G.ownerDocument&&G!==L;){for(F in A){J=A[F];if(J.jquery?J.index(G)>-1:aj(G).is(J)){K.push({selector:F,elem:G});delete A[F]}}G=G.parentNode}}return K}var w=aj.expr.match.POS.test(N)?aj(N,L||this.context):null;return this.map(function(P,O){for(;O&&O.ownerDocument&&O!==L;){if(w?w.index(O)>-1:aj(O).is(N)){return O}O=O.parentNode}return null})},index:function(c){if(!c||typeof c==="string"){return aj.inArray(this[0],c?aj(c):this.parent().children())}return aj.inArray(c.jquery?c[0]:c,this)},add:function(w,c){w=typeof w==="string"?aj(w,c||this.context):aj.makeArray(w);c=aj.merge(this.get(),w);return this.pushStack(m(w[0])||m(c[0])?c:aj.unique(c))},andSelf:function(){return this.add(this.prevObject)}});aj.each({parent:function(c){return(c=c.parentNode)&&c.nodeType!==11?c:null},parents:function(c){return aj.dir(c,"parentNode")},parentsUntil:function(w,c,A){return aj.dir(w,"parentNode",A)},next:function(c){return aj.nth(c,2,"nextSibling")},prev:function(c){return aj.nth(c,2,"previousSibling")},nextAll:function(c){return aj.dir(c,"nextSibling")},prevAll:function(c){return aj.dir(c,"previousSibling")},nextUntil:function(w,c,A){return aj.dir(w,"nextSibling",A)},prevUntil:function(w,c,A){return aj.dir(w,"previousSibling",A)},siblings:function(c){return aj.sibling(c.parentNode.firstChild,c)},children:function(c){return aj.sibling(c.firstChild)},contents:function(c){return aj.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:aj.makeArray(c.childNodes)}},function(w,c){aj.fn[w]=function(G,A){var F=aj.map(this,c,G);f.test(w)||(A=G);if(A&&typeof A==="string"){F=aj.filter(A,F)}F=this.length>1?aj.unique(F):F;if((this.length>1||aY.test(A))&&bd.test(w)){F=F.reverse()}return this.pushStack(F,w,aw.call(arguments).join(","))}});aj.extend({filter:function(w,c,A){if(A){w=":not("+w+")"}return aj.find.matches(w,c)},dir:function(w,c,F){var A=[];for(w=w[c];w&&w.nodeType!==9&&(F===S||w.nodeType!==1||!aj(w).is(F));){w.nodeType===1&&A.push(w);w=w[c]}return A},nth:function(w,c,F){c=c||1;for(var A=0;w;w=w[F]){if(w.nodeType===1&&++A===c){break}}return w},sibling:function(w,c){for(var A=[];w;w=w.nextSibling){w.nodeType===1&&w!==c&&A.push(w)}return A}});var ak=/ jQuery\d+="(?:\d+|null)"/g,au=/^\s+/,C=/(<([\w:]+)[^>]*?)\/>/g,aF=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,n=/<([\w:]+)/,ae=/<tbody/i,v=/<|&#?\w+;/,aR=/<script|<object|<embed|<option|<style/i,am=/checked\s*(?:[^=]|=\s*.checked.)/i,bm=function(w,c,A){return aF.test(A)?w:c+"></"+A+">"},aL={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};aL.optgroup=aL.option;aL.tbody=aL.tfoot=aL.colgroup=aL.caption=aL.thead;aL.th=aL.td;if(!aj.support.htmlSerialize){aL._default=[1,"div<div>","</div>"]}aj.fn.extend({text:function(c){if(aj.isFunction(c)){return this.each(function(w){var A=aj(this);A.text(c.call(this,w,A.text()))})}if(typeof c!=="object"&&c!==S){return this.empty().append((this[0]&&this[0].ownerDocument||U).createTextNode(c))}return aj.text(this)},wrapAll:function(w){if(aj.isFunction(w)){return this.each(function(A){aj(this).wrapAll(w.call(this,A))})}if(this[0]){var c=aj(w,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&c.insertBefore(this[0]);c.map(function(){for(var A=this;A.firstChild&&A.firstChild.nodeType===1;){A=A.firstChild}return A}).append(this)}return this},wrapInner:function(c){if(aj.isFunction(c)){return this.each(function(w){aj(this).wrapInner(c.call(this,w))})}return this.each(function(){var w=aj(this),A=w.contents();A.length?A.wrapAll(c):w.append(c)})},wrap:function(c){return this.each(function(){aj(this).wrapAll(c)})},unwrap:function(){return this.parent().each(function(){aj.nodeName(this,"body")||aj(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.appendChild(c)})},prepend:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.insertBefore(c,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(w){this.parentNode.insertBefore(w,this)})}else{if(arguments.length){var c=aj(arguments[0]);c.push.apply(c,this.toArray());return this.pushStack(c,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(w){this.parentNode.insertBefore(w,this.nextSibling)})}else{if(arguments.length){var c=this.pushStack(this,"after",arguments);c.push.apply(c,aj(arguments[0]).toArray());return c}}},remove:function(w,c){for(var F=0,A;(A=this[F])!=null;F++){if(!w||aj.filter(w,[A]).length){if(!c&&A.nodeType===1){aj.cleanData(A.getElementsByTagName("*"));aj.cleanData([A])}A.parentNode&&A.parentNode.removeChild(A)}}return this},empty:function(){for(var w=0,c;(c=this[w])!=null;w++){for(c.nodeType===1&&aj.cleanData(c.getElementsByTagName("*"));c.firstChild;){c.removeChild(c.firstChild)}}return this},clone:function(w){var c=this.map(function(){if(!aj.support.noCloneEvent&&!aj.isXMLDoc(this)){var F=this.outerHTML,A=this.ownerDocument;if(!F){F=A.createElement("div");F.appendChild(this.cloneNode(true));F=F.innerHTML}return aj.clean([F.replace(ak,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(au,"")],A)[0]}else{return this.cloneNode(true)}});if(w===true){bl(this,c);bl(this.find("*"),c.find("*"))}return c},html:function(w){if(w===S){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ak,""):null}else{if(typeof w==="string"&&!aR.test(w)&&(aj.support.leadingWhitespace||!au.test(w))&&!aL[(n.exec(w)||["",""])[1].toLowerCase()]){w=w.replace(C,bm);try{for(var c=0,F=this.length;c<F;c++){if(this[c].nodeType===1){aj.cleanData(this[c].getElementsByTagName("*"));this[c].innerHTML=w}}}catch(A){this.empty().append(w)}}else{aj.isFunction(w)?this.each(function(K){var G=aj(this),J=G.html();G.empty().append(function(){return w.call(this,K,J)})}):this.empty().append(w)}}return this},replaceWith:function(c){if(this[0]&&this[0].parentNode){if(aj.isFunction(c)){return this.each(function(w){var F=aj(this),A=F.html();F.replaceWith(c.call(this,w,A))})}if(typeof c!=="string"){c=aj(c).detach()}return this.each(function(){var w=this.nextSibling,A=this.parentNode;aj(this).remove();w?aj(w).before(c):aj(A).append(c)})}else{return this.pushStack(aj(aj.isFunction(c)?c():c),"replaceWith",c)}},detach:function(c){return this.remove(c,true)},domManip:function(P,O,N){function K(Q){return aj.nodeName(Q,"table")?Q.getElementsByTagName("tbody")[0]||Q.appendChild(Q.ownerDocument.createElement("tbody")):Q}var L,G,J=P[0],w=[],F;if(!aj.support.checkClone&&arguments.length===3&&typeof J==="string"&&am.test(J)){return this.each(function(){aj(this).domManip(P,O,N,true)})}if(aj.isFunction(J)){return this.each(function(Q){var R=aj(this);P[0]=J.call(this,Q,O?R.html():S);R.domManip(P,O,N)})}if(this[0]){L=J&&J.parentNode;L=aj.support.parentNode&&L&&L.nodeType===11&&L.childNodes.length===this.length?{fragment:L}:a5(P,this,w);F=L.fragment;if(G=F.childNodes.length===1?(F=F.firstChild):F.firstChild){O=O&&aj.nodeName(G,"tr");for(var A=0,c=this.length;A<c;A++){N.call(O?K(this[A],G):this[A],A>0||L.cacheable||this.length>1?F.cloneNode(true):F)}}w.length&&aj.each(w,H)}return this}});aj.fragments={};aj.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(w,c){aj.fn[w]=function(K){var G=[];K=aj(K);var J=this.length===1&&this[0].parentNode;if(J&&J.nodeType===11&&J.childNodes.length===1&&K.length===1){K[c](this[0]);return this}else{J=0;for(var A=K.length;J<A;J++){var F=(J>0?this.clone(true):this).get();aj.fn[c].apply(aj(K[J]),F);G=G.concat(F)}return this.pushStack(G,w,K.selector)}}});aj.extend({clean:function(P,O,N,K){O=O||U;if(typeof O.createElement==="undefined"){O=O.ownerDocument||O[0]&&O[0].ownerDocument||U}for(var L=[],G=0,J;(J=P[G])!=null;G++){if(typeof J==="number"){J+=""}if(J){if(typeof J==="string"&&!v.test(J)){J=O.createTextNode(J)}else{if(typeof J==="string"){J=J.replace(C,bm);var w=(n.exec(J)||["",""])[1].toLowerCase(),F=aL[w]||aL._default,A=F[0],c=O.createElement("div");for(c.innerHTML=F[1]+J+F[2];A--;){c=c.lastChild}if(!aj.support.tbody){A=ae.test(J);w=w==="table"&&!A?c.firstChild&&c.firstChild.childNodes:F[1]==="<table>"&&!A?c.childNodes:[];for(F=w.length-1;F>=0;--F){aj.nodeName(w[F],"tbody")&&!w[F].childNodes.length&&w[F].parentNode.removeChild(w[F])}}!aj.support.leadingWhitespace&&au.test(J)&&c.insertBefore(O.createTextNode(au.exec(J)[0]),c.firstChild);J=c.childNodes}}if(J.nodeType){L.push(J)}else{L=aj.merge(L,J)}}}if(N){for(G=0;L[G];G++){if(K&&aj.nodeName(L[G],"script")&&(!L[G].type||L[G].type.toLowerCase()==="text/javascript")){K.push(L[G].parentNode?L[G].parentNode.removeChild(L[G]):L[G])}else{L[G].nodeType===1&&L.splice.apply(L,[G+1,0].concat(aj.makeArray(L[G].getElementsByTagName("script"))));N.appendChild(L[G])}}}return L},cleanData:function(N){for(var L,K,G=aj.cache,J=aj.event.special,A=aj.support.deleteExpando,F=0,c;(c=N[F])!=null;F++){if(K=c[aj.expando]){L=G[K];if(L.events){for(var w in L.events){J[w]?aj.event.remove(c,w):aI(c,w,L.handle)}}if(A){delete c[aj.expando]}else{c.removeAttribute&&c.removeAttribute(aj.expando)}delete G[K]}}}});var h=/z-?index|font-?weight|opacity|zoom|line-?height/i,a6=/alpha\([^)]*\)/,aS=/opacity=([^)]*)/,aG=/float/i,af=/-([a-z])/ig,bh=/([A-Z])/g,a1=/^-?\d+(?:px)?$/i,aK=/^-?\d/,ah={position:"absolute",visibility:"hidden",display:"block"},z=["Left","Right"],l=["Top","Bottom"],bk=U.defaultView&&U.defaultView.getComputedStyle,an=aj.support.cssFloat?"cssFloat":"styleFloat",x=function(w,c){return c.toUpperCase()};aj.fn.css=function(w,c){return ar(this,w,c,true,function(G,A,F){if(F===S){return aj.curCSS(G,A)}if(typeof F==="number"&&!h.test(A)){F+="px"}aj.style(G,A,F)})};aj.extend({style:function(w,c,G){if(!w||w.nodeType===3||w.nodeType===8){return S}if((c==="width"||c==="height")&&parseFloat(G)<0){G=S}var A=w.style||w,F=G!==S;if(!aj.support.opacity&&c==="opacity"){if(F){A.zoom=1;c=parseInt(G,10)+""==="NaN"?"":"alpha(opacity="+G*100+")";w=A.filter||aj.curCSS(w,"filter")||"";A.filter=a6.test(w)?w.replace(a6,c):c}return A.filter&&A.filter.indexOf("opacity=")>=0?parseFloat(aS.exec(A.filter)[1])/100+"":""}if(aG.test(c)){c=an}c=c.replace(af,x);if(F){A[c]=G}return A[c]},css:function(w,c,K,G){if(c==="width"||c==="height"){var J,A=c==="width"?z:l;function F(){J=c==="width"?w.offsetWidth:w.offsetHeight;G!=="border"&&aj.each(A,function(){G||(J-=parseFloat(aj.curCSS(w,"padding"+this,true))||0);if(G==="margin"){J+=parseFloat(aj.curCSS(w,"margin"+this,true))||0}else{J-=parseFloat(aj.curCSS(w,"border"+this+"Width",true))||0}})}w.offsetWidth!==0?F():aj.swap(w,ah,F);return Math.max(0,Math.round(J))}return aj.curCSS(w,c,K)},curCSS:function(w,c,J){var F,G=w.style;if(!aj.support.opacity&&c==="opacity"&&w.currentStyle){F=aS.test(w.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return F===""?"1":F}if(aG.test(c)){c=an}if(!J&&G&&G[c]){F=G[c]}else{if(bk){if(aG.test(c)){c="float"}c=c.replace(bh,"-$1").toLowerCase();G=w.ownerDocument.defaultView;if(!G){return null}if(w=G.getComputedStyle(w,null)){F=w.getPropertyValue(c)}if(c==="opacity"&&F===""){F="1"}}else{if(w.currentStyle){J=c.replace(af,x);F=w.currentStyle[c]||w.currentStyle[J];if(!a1.test(F)&&aK.test(F)){c=G.left;var A=w.runtimeStyle.left;w.runtimeStyle.left=w.currentStyle.left;G.left=J==="fontSize"?"1em":F||0;F=G.pixelLeft+"px";G.left=c;w.runtimeStyle.left=A}}}}return F},swap:function(w,c,G){var A={};for(var F in c){A[F]=w.style[F];w.style[F]=c[F]}G.call(w);for(F in c){w.style[F]=A[F]}}});if(aj.expr&&aj.expr.filters){aj.expr.filters.hidden=function(w){var c=w.offsetWidth,F=w.offsetHeight,A=w.nodeName.toLowerCase()==="tr";return c===0&&F===0&&!A?true:c>0&&F>0&&!A?false:aj.curCSS(w,"display")==="none"};aj.expr.filters.visible=function(c){return !aj.expr.filters.hidden(c)}}var a4=aH(),aP=/<script(.|\s)*?\/script>/gi,al=/select|textarea/i,D=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,aC=/=\?(&|$)/,j=/\?/,o=/(\?|&)_=.*?(&|$)/,a=/^(\w+:)?\/\/([^\/?#]+)/,a7=/%20/g,aT=aj.fn.load;aj.fn.extend({load:function(w,c,J){if(typeof w!=="string"){return aT.call(this,w)}else{if(!this.length){return this}}var F=w.indexOf(" ");if(F>=0){var G=w.slice(F,w.length);w=w.slice(0,F)}F="GET";if(c){if(aj.isFunction(c)){J=c;c=null}else{if(typeof c==="object"){c=aj.param(c,aj.ajaxSettings.traditional);F="POST"}}}var A=this;aj.ajax({url:w,type:F,dataType:"html",data:c,complete:function(K,L){if(L==="success"||L==="notmodified"){A.html(G?aj("<div />").append(K.responseText.replace(aP,"")).find(G):K.responseText)}J&&A.each(J,[K.responseText,L,K])}});return this},serialize:function(){return aj.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?aj.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||al.test(this.nodeName)||D.test(this.type))}).map(function(w,c){w=aj(this).val();return w==null?null:aj.isArray(w)?aj.map(w,function(A){return{name:c.name,value:A}}):{name:c.name,value:w}}).get()}});aj.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(w,c){aj.fn[c]=function(A){return this.bind(c,A)}});aj.extend({get:function(w,c,F,A){if(aj.isFunction(c)){A=A||F;F=c;c=null}return aj.ajax({type:"GET",url:w,data:c,success:F,dataType:A})},getScript:function(w,c){return aj.get(w,null,c,"script")},getJSON:function(w,c,A){return aj.get(w,c,A,"json")},post:function(w,c,F,A){if(aj.isFunction(c)){A=A||F;F=c;c={}}return aj.ajax({type:"POST",url:w,data:c,success:F,dataType:A})},ajaxSetup:function(c){aj.extend(aj.ajaxSettings,c)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:aQ.XMLHttpRequest&&(aQ.location.protocol!=="file:"||!aQ.ActiveXObject)?function(){return new aQ.XMLHttpRequest}:function(){try{return new aQ.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(ab){function aa(){Y.success&&Y.success.call(Q,L,T,w);Y.global&&X("ajaxSuccess",[w,Y])}function Z(){Y.complete&&Y.complete.call(Q,w,T);Y.global&&X("ajaxComplete",[w,Y]);Y.global&&!--aj.active&&aj.event.trigger("ajaxStop")}function X(bb,bn){(Y.context?aj(Y.context):aj.event).trigger(bb,bn)}var Y=aj.extend(true,{},aj.ajaxSettings,ab),R,T,L,Q=ab&&ab.context||Y,N=Y.type.toUpperCase();if(Y.data&&Y.processData&&typeof Y.data!=="string"){Y.data=aj.param(Y.data,Y.traditional)}if(Y.dataType==="jsonp"){if(N==="GET"){aC.test(Y.url)||(Y.url+=(j.test(Y.url)?"&":"?")+(Y.jsonp||"callback")+"=?")}else{if(!Y.data||!aC.test(Y.data)){Y.data=(Y.data?Y.data+"&":"")+(Y.jsonp||"callback")+"=?"}}Y.dataType="json"}if(Y.dataType==="json"&&(Y.data&&aC.test(Y.data)||aC.test(Y.url))){R=Y.jsonpCallback||"jsonp"+a4++;if(Y.data){Y.data=(Y.data+"").replace(aC,"="+R+"$1")}Y.url=Y.url.replace(aC,"="+R+"$1");Y.dataType="script";aQ[R]=aQ[R]||function(bb){L=bb;aa();Z();aQ[R]=S;try{delete aQ[R]}catch(bn){}c&&c.removeChild(G)}}if(Y.dataType==="script"&&Y.cache===null){Y.cache=false}if(Y.cache===false&&N==="GET"){var J=aH(),A=Y.url.replace(o,"$1_="+J+"$2");Y.url=A+(A===Y.url?(j.test(Y.url)?"&":"?")+"_="+J:"")}if(Y.data&&N==="GET"){Y.url+=(j.test(Y.url)?"&":"?")+Y.data}Y.global&&!aj.active++&&aj.event.trigger("ajaxStart");J=(J=a.exec(Y.url))&&(J[1]&&J[1]!==location.protocol||J[2]!==location.host);if(Y.dataType==="script"&&N==="GET"&&J){var c=U.getElementsByTagName("head")[0]||U.documentElement,G=U.createElement("script");G.src=Y.url;if(Y.scriptCharset){G.charset=Y.scriptCharset}if(!R){var K=false;G.onload=G.onreadystatechange=function(){if(!K&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){K=true;aa();Z();G.onload=G.onreadystatechange=null;c&&G.parentNode&&c.removeChild(G)}}}c.insertBefore(G,c.firstChild);return S}var F=false,w=Y.xhr();if(w){Y.username?w.open(N,Y.url,Y.async,Y.username,Y.password):w.open(N,Y.url,Y.async);try{if(Y.data||ab&&ab.contentType){w.setRequestHeader("Content-Type",Y.contentType)}if(Y.ifModified){aj.lastModified[Y.url]&&w.setRequestHeader("If-Modified-Since",aj.lastModified[Y.url]);aj.etag[Y.url]&&w.setRequestHeader("If-None-Match",aj.etag[Y.url])}J||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",Y.dataType&&Y.accepts[Y.dataType]?Y.accepts[Y.dataType]+", */*":Y.accepts._default)}catch(ba){}if(Y.beforeSend&&Y.beforeSend.call(Q,w,Y)===false){Y.global&&!--aj.active&&aj.event.trigger("ajaxStop");w.abort();return false}Y.global&&X("ajaxSend",[w,Y]);var W=w.onreadystatechange=function(bn){if(!w||w.readyState===0||bn==="abort"){F||Z();F=true;if(w){w.onreadystatechange=aj.noop}}else{if(!F&&w&&(w.readyState===4||bn==="timeout")){F=true;w.onreadystatechange=aj.noop;T=bn==="timeout"?"timeout":!aj.httpSuccess(w)?"error":Y.ifModified&&aj.httpNotModified(w,Y.url)?"notmodified":"success";var bo;if(T==="success"){try{L=aj.httpData(w,Y.dataType,Y)}catch(bb){T="parsererror";bo=bb}}if(T==="success"||T==="notmodified"){R||aa()}else{aj.handleError(Y,w,T,bo)}Z();bn==="timeout"&&w.abort();if(Y.async){w=null}}}};try{var V=w.abort;w.abort=function(){w&&V.call(w);W("abort")}}catch(P){}Y.async&&Y.timeout>0&&setTimeout(function(){w&&!F&&W("timeout")},Y.timeout);try{w.send(N==="POST"||N==="PUT"||N==="DELETE"?Y.data:null)}catch(O){aj.handleError(Y,w,null,O);Z()}Y.async||W();return w}},handleError:function(w,c,F,A){if(w.error){w.error.call(w.context||w,c,F,A)}if(w.global){(w.context?aj(w.context):aj.event).trigger("ajaxError",[c,w,A])}},active:0,httpSuccess:function(w){try{return !w.status&&location.protocol==="file:"||w.status>=200&&w.status<300||w.status===304||w.status===1223||w.status===0}catch(c){}return false},httpNotModified:function(w,c){var F=w.getResponseHeader("Last-Modified"),A=w.getResponseHeader("Etag");if(F){aj.lastModified[c]=F}if(A){aj.etag[c]=A}return w.status===304||w.status===0},httpData:function(w,c,G){var A=w.getResponseHeader("content-type")||"",F=c==="xml"||!c&&A.indexOf("xml")>=0;w=F?w.responseXML:w.responseText;F&&w.documentElement.nodeName==="parsererror"&&aj.error("parsererror");if(G&&G.dataFilter){w=G.dataFilter(w,c)}if(typeof w==="string"){if(c==="json"||!c&&A.indexOf("json")>=0){w=aj.parseJSON(w)}else{if(c==="script"||!c&&A.indexOf("javascript")>=0){aj.globalEval(w)}}}return w},param:function(w,c){function J(K,L){if(aj.isArray(L)){aj.each(L,function(N,O){c||/\[\]$/.test(K)?F(K,O):J(K+"["+(typeof O==="object"||aj.isArray(O)?N:"")+"]",O)})}else{!c&&L!=null&&typeof L==="object"?aj.each(L,function(N,O){J(K+"["+N+"]",O)}):F(K,L)}}function F(K,L){L=aj.isFunction(L)?L():L;G[G.length]=encodeURIComponent(K)+"="+encodeURIComponent(L)}var G=[];if(c===S){c=aj.ajaxSettings.traditional}if(aj.isArray(w)||w.jquery){aj.each(w,function(){F(this.name,this.value)})}else{for(var A in w){J(A,w[A])}}return G.join("&").replace(a7,"+")}});var bi={},be=/toggle|show|hide/,aZ=/^([+-]=)?([\d+-.]+)(.*)$/,at,E=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];aj.fn.extend({show:function(w,c){if(w||w===0){return this.animate(aE("show",3),w,c)}else{w=0;for(c=this.length;w<c;w++){var G=aj.data(this[w],"olddisplay");this[w].style.display=G||"";if(aj.css(this[w],"display")==="none"){G=this[w].nodeName;var A;if(bi[G]){A=bi[G]}else{var F=aj("<"+G+" />").appendTo("body");A=F.css("display");if(A==="none"){A="block"}F.remove();bi[G]=A}aj.data(this[w],"olddisplay",A)}}w=0;for(c=this.length;w<c;w++){this[w].style.display=aj.data(this[w],"olddisplay")||""}return this}},hide:function(w,c){if(w||w===0){return this.animate(aE("hide",3),w,c)}else{w=0;for(c=this.length;w<c;w++){var A=aj.data(this[w],"olddisplay");!A&&A!=="none"&&aj.data(this[w],"olddisplay",aj.css(this[w],"display"))}w=0;for(c=this.length;w<c;w++){this[w].style.display="none"}return this}},_toggle:aj.fn.toggle,toggle:function(w,c){var A=typeof w==="boolean";if(aj.isFunction(w)&&aj.isFunction(c)){this._toggle.apply(this,arguments)}else{w==null||A?this.each(function(){var F=A?w:aj(this).is(":hidden");aj(this)[F?"show":"hide"]()}):this.animate(aE("toggle",3),w,c)}return this},fadeTo:function(w,c,A){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:c},w,A)},animate:function(w,c,G,A){var F=aj.speed(c,G,A);if(aj.isEmptyObject(w)){return this.each(F.complete)}return this[F.queue===false?"each":"queue"](function(){var K=aj.extend({},F),L,N=this.nodeType===1&&aj(this).is(":hidden"),J=this;for(L in w){var O=L.replace(af,x);if(L!==O){w[O]=w[L];delete w[L];L=O}if(w[L]==="hide"&&N||w[L]==="show"&&!N){return K.complete.call(this)}if((L==="height"||L==="width")&&this.style){K.display=aj.css(this,"display");K.overflow=this.style.overflow}if(aj.isArray(w[L])){(K.specialEasing=K.specialEasing||{})[L]=w[L][1];w[L]=w[L][0]}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=aj.extend({},w);aj.each(w,function(Q,P){var V=new aj.fx(J,K,Q);if(be.test(P)){V[P==="toggle"?N?"show":"hide":P](w)}else{var T=aZ.exec(P),W=V.cur(true)||0;if(T){P=parseFloat(T[2]);var R=T[3]||"px";if(R!=="px"){J.style[Q]=(P||1)+R;W=(P||1)/V.cur(true)*W;J.style[Q]=W+R}if(T[1]){P=(T[1]==="-="?-1:1)*P+W}V.custom(W,P,R)}else{V.custom(W,P,"")}}});return true})},stop:function(w,c){var A=aj.timers;w&&this.queue([]);this.each(function(){for(var F=A.length-1;F>=0;F--){if(A[F].elem===this){c&&A[F](true);A.splice(F,1)}}});c||this.dequeue();return this}});aj.each({slideDown:aE("show",1),slideUp:aE("hide",1),slideToggle:aE("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(w,c){aj.fn[w]=function(F,A){return this.animate(c,F,A)}});aj.extend({speed:function(w,c,F){var A=w&&typeof w==="object"?w:{complete:F||!F&&c||aj.isFunction(w)&&w,duration:w,easing:F&&c||c&&!aj.isFunction(c)&&c};A.duration=aj.fx.off?0:typeof A.duration==="number"?A.duration:aj.fx.speeds[A.duration]||aj.fx.speeds._default;A.old=A.complete;A.complete=function(){A.queue!==false&&aj(this).dequeue();aj.isFunction(A.old)&&A.old.call(this)};return A},easing:{linear:function(w,c,F,A){return F+A*w},swing:function(w,c,F,A){return(-Math.cos(w*Math.PI)/2+0.5)*A+F}},timers:[],fx:function(w,c,A){this.options=c;this.elem=w;this.prop=A;if(!c.orig){c.orig={}}}});aj.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(aj.fx.step[this.prop]||aj.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(c){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}return(c=parseFloat(aj.css(this.elem,this.prop,c)))&&c>-10000?c:parseFloat(aj.curCSS(this.elem,this.prop))||0},custom:function(w,c,G){function A(J){return F.step(J)}this.startTime=aH();this.start=w;this.end=c;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var F=this;A.elem=this.elem;if(A()&&aj.timers.push(A)&&!at){at=setInterval(aj.fx.tick,13)}},show:function(){this.options.orig[this.prop]=aj.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());aj(this.elem).show()},hide:function(){this.options.orig[this.prop]=aj.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(w){var c=aH(),G=true;if(w||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var A in this.options.curAnim){if(this.options.curAnim[A]!==true){G=false}}if(G){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;w=aj.data(this.elem,"olddisplay");this.elem.style.display=w?w:this.options.display;if(aj.css(this.elem,"display")==="none"){this.elem.style.display="block"}}this.options.hide&&aj(this.elem).hide();if(this.options.hide||this.options.show){for(var F in this.options.curAnim){aj.style(this.elem,F,this.options.orig[F])}}this.options.complete.call(this.elem)}return false}else{F=c-this.startTime;this.state=F/this.options.duration;w=this.options.easing||(aj.easing.swing?"swing":"linear");this.pos=aj.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||w](this.state,F,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};aj.extend(aj.fx,{tick:function(){for(var w=aj.timers,c=0;c<w.length;c++){w[c]()||w.splice(c--,1)}w.length||aj.fx.stop()},stop:function(){clearInterval(at);at=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(c){aj.style(c.elem,"opacity",c.now)},_default:function(c){if(c.elem.style&&c.elem.style[c.prop]!=null){c.elem.style[c.prop]=(c.prop==="width"||c.prop==="height"?Math.max(0,c.now):c.now)+c.unit}else{c.elem[c.prop]=c.now}}}});if(aj.expr&&aj.expr.filters){aj.expr.filters.animated=function(c){return aj.grep(aj.timers,function(w){return c===w.elem}).length}}aj.fn.offset="getBoundingClientRect" in U.documentElement?function(w){var c=this[0];if(w){return this.each(function(G){aj.offset.setOffset(this,w,G)})}if(!c||!c.ownerDocument){return null}if(c===c.ownerDocument.body){return aj.offset.bodyOffset(c)}var F=c.getBoundingClientRect(),A=c.ownerDocument;c=A.body;A=A.documentElement;return{top:F.top+(self.pageYOffset||aj.support.boxModel&&A.scrollTop||c.scrollTop)-(A.clientTop||c.clientTop||0),left:F.left+(self.pageXOffset||aj.support.boxModel&&A.scrollLeft||c.scrollLeft)-(A.clientLeft||c.clientLeft||0)}}:function(O){var N=this[0];if(O){return this.each(function(P){aj.offset.setOffset(this,O,P)})}if(!N||!N.ownerDocument){return null}if(N===N.ownerDocument.body){return aj.offset.bodyOffset(N)}aj.offset.initialize();var L=N.offsetParent,J=N,K=N.ownerDocument,F,G=K.documentElement,c=K.body;J=(K=K.defaultView)?K.getComputedStyle(N,null):N.currentStyle;for(var A=N.offsetTop,w=N.offsetLeft;(N=N.parentNode)&&N!==c&&N!==G;){if(aj.offset.supportsFixedPosition&&J.position==="fixed"){break}F=K?K.getComputedStyle(N,null):N.currentStyle;A-=N.scrollTop;w-=N.scrollLeft;if(N===L){A+=N.offsetTop;w+=N.offsetLeft;if(aj.offset.doesNotAddBorder&&!(aj.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(N.nodeName))){A+=parseFloat(F.borderTopWidth)||0;w+=parseFloat(F.borderLeftWidth)||0}J=L;L=N.offsetParent}if(aj.offset.subtractsBorderForOverflowNotVisible&&F.overflow!=="visible"){A+=parseFloat(F.borderTopWidth)||0;w+=parseFloat(F.borderLeftWidth)||0}J=F}if(J.position==="relative"||J.position==="static"){A+=c.offsetTop;w+=c.offsetLeft}if(aj.offset.supportsFixedPosition&&J.position==="fixed"){A+=Math.max(G.scrollTop,c.scrollTop);w+=Math.max(G.scrollLeft,c.scrollLeft)}return{top:A,left:w}};aj.offset={initialize:function(){var w=U.body,c=U.createElement("div"),J,F,G,A=parseFloat(aj.curCSS(w,"marginTop",true))||0;aj.extend(c.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});c.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";w.insertBefore(c,w.firstChild);J=c.firstChild;F=J.firstChild;G=J.nextSibling.firstChild.firstChild;this.doesNotAddBorder=F.offsetTop!==5;this.doesAddBorderForTableAndCells=G.offsetTop===5;F.style.position="fixed";F.style.top="20px";this.supportsFixedPosition=F.offsetTop===20||F.offsetTop===15;F.style.position=F.style.top="";J.style.overflow="hidden";J.style.position="relative";this.subtractsBorderForOverflowNotVisible=F.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=w.offsetTop!==A;w.removeChild(c);aj.offset.initialize=aj.noop},bodyOffset:function(w){var c=w.offsetTop,A=w.offsetLeft;aj.offset.initialize();if(aj.offset.doesNotIncludeMarginInBodyOffset){c+=parseFloat(aj.curCSS(w,"marginTop",true))||0;A+=parseFloat(aj.curCSS(w,"marginLeft",true))||0}return{top:c,left:A}},setOffset:function(w,c,K){if(/static/.test(aj.curCSS(w,"position"))){w.style.position="relative"}var G=aj(w),J=G.offset(),A=parseInt(aj.curCSS(w,"top",true),10)||0,F=parseInt(aj.curCSS(w,"left",true),10)||0;if(aj.isFunction(c)){c=c.call(w,K,J)}K={top:c.top-J.top+A,left:c.left-J.left+F};"using" in c?c.using.call(w,K):G.css(K)}};aj.fn.extend({position:function(){if(!this[0]){return null}var w=this[0],c=this.offsetParent(),F=this.offset(),A=/^body|html$/i.test(c[0].nodeName)?{top:0,left:0}:c.offset();F.top-=parseFloat(aj.curCSS(w,"marginTop",true))||0;F.left-=parseFloat(aj.curCSS(w,"marginLeft",true))||0;A.top+=parseFloat(aj.curCSS(c[0],"borderTopWidth",true))||0;A.left+=parseFloat(aj.curCSS(c[0],"borderLeftWidth",true))||0;return{top:F.top-A.top,left:F.left-A.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||U.body;c&&!/^body|html$/i.test(c.nodeName)&&aj.css(c,"position")==="static";){c=c.offsetParent}return c})}});aj.each(["Left","Top"],function(w,c){var A="scroll"+c;aj.fn[A]=function(G){var J=this[0],F;if(!J){return null}if(G!==S){return this.each(function(){if(F=p(this)){F.scrollTo(!w?G:aj(F).scrollLeft(),w?G:aj(F).scrollTop())}else{this[A]=G}})}else{return(F=p(J))?"pageXOffset" in F?F[w?"pageYOffset":"pageXOffset"]:aj.support.boxModel&&F.document.documentElement[A]||F.document.body[A]:J[A]}}});aj.each(["Height","Width"],function(w,c){var A=c.toLowerCase();aj.fn["inner"+c]=function(){return this[0]?aj.css(this[0],A,false,"padding"):null};aj.fn["outer"+c]=function(F){return this[0]?aj.css(this[0],A,false,F?"margin":"border"):null};aj.fn[A]=function(F){var G=this[0];if(!G){return F==null?null:this}if(aj.isFunction(F)){return this.each(function(J){var K=aj(this);K[A](F.call(this,J,K[A]()))})}return"scrollTo" in G&&G.document?G.document.compatMode==="CSS1Compat"&&G.document.documentElement["client"+c]||G.document.body["client"+c]:G.nodeType===9?Math.max(G.documentElement["client"+c],G.body["scroll"+c],G.documentElement["scroll"+c],G.body["offset"+c],G.documentElement["offset"+c]):F===S?aj.css(G,A):this.css(A,typeof F==="string"?F:F+"px")}});aQ.jQuery=aQ.$=aj})(window);var display;function Display(f){f.page=f.page<=0?1:f.page;this.domainName=f.domainName;this.galleryLocation=f.galleryLocation;this.galleryId=f.galleryId;this.aLangs=f.aLangs;this.albumId=f.albumId;this.albumName=f.albumName;this.albumPrivacyLevel=f.albumPrivacyLevel;this.imageIndex=f.imageIndex;this.page=f.page?f.page:1;this.tag=f.tag;this.album=f.album;this.aAlbums=f.aAlbums;this.aImages=f.aImages;this.aLoaded=[];this.albumsViewable=f.albumsViewable;this.imagesViewable=f.imagesViewable;this.newComment=f.permitNewComment;this.delComment=f.permitDelComment;this.softLog=f.softLog;this.numAlbumsPerPage=f.numAlbumsPerPage?f.numAlbumsPerPage:4;this.domShareDiv=f.domShareDiv;this.domInfoComments=f.domInfoComments;this.domInfoCaption=f.domInfoCaption;this.aRestrict=new Array(1024,920,784,720,640,540,464,400);this.container=$(this.ID_CONTAINER_DIV);this.thumbnails=$(this.ID_THUMBNAILS);this.pageNumbers=$(this.ID_PAGE_NUMBERS);this.albumDescription=$(this.ID_ALBUM_DESCRIPTION);this.functions=$(this.ID_FUNCTIONS_DIV);this.loadingImg=$(this.ID_LOADING_IMG);this.controls=$("#controls li");this.sidePanel=$("div.sidePanel");this.mainPanel=$(this.ID_MAIN_PANEL_DIV);this.imageDiv=$(this.ID_IMAGE_DIV);this.imageMain=$("#imageDiv img.mainDivImage");this.exifDiv=$(this.ID_EXIF_DIV);this.exifTable=$("table",this.exifDiv);this.exifImageIndex=$("span",this.exifDiv);this.commentAnchor=$(this.ID_COMMENT_ANCHOR);this.commentBlock=$(this.ID_COMMENT_BLOCK_DIV);this.comments=$(this.ID_COMMENTS_DIV);this.commentMessage=$("#msgInput");this.domAlbumList=document.getElementById(this.ID_ALBUM_LIST);this.domDownloadLink=document.getElementById("downloadLink");this.domExifLink=document.getElementById("exifLink");this.domNextLink=document.getElementById("nextImageLink");this.domPrevLink=document.getElementById("prevImageLink");this.domLogin=document.getElementById("loginDiv");this.domRegister=document.getElementById("registerDiv");this.newPage=f.page;this.numPagesPerScreen=5;this.cacheExpiry=f.cacheExpiry?f.cacheExpiry:300000;this.newImageIndex=f.imageIndex?f.imageIndex:0;this.numImagesShortPage=f.numImagesShortPage?f.numImagesShortPage:3;this.numImagesPerPage=f.numImagesPerPage?f.numImagesPerPage:18;var h=jQuery.browser;if(h.msie){this.isIE=true;if(parseInt(h.version)<7){this.isIE6=true}}var e=this.imageDiv.get(0);e.style.overflow="hidden";var c=this;this.GetWindowSize();this.ResizeContainer();if(this.imageMain.length){var g=this.imageMain.get(0);this.url=g.src;this.xImageOrig=g.width;this.yImageOrig=g.height;this.ResizeImage()}this.loadingImg.fadeIn("slow");this.isAjaxReady=false;this.canBeResized=true;$(window).resize(function(){if(!c.canBeResized){return}c.GetWindowSize();var n=c.yWindow;c.ResizeImage();c.ResizeContainer();c.GetWindowSize();if(c.yWindow!=n){c.ResizeContainer()}c.canBeResized=false;setTimeout(function(){c.canBeResized=true},50)});if(this.galleryId==null){return}$("#slideshowDiv").css("z-index","20");$("div.sidePanel").click(function(r){var r=r||window.event;var q=r.target||r.srcElement;if(q.tagName.toLowerCase()!="img"&&q.parentNode.tagName.toLowerCase()!="h2"&&!$(q).hasClass("coverImage")){if(c.softLog&&(q.className=="albumInfoEdit"||q.className=="albumInfoDelete")){if(c.domRegister){if(c.domRegister.collapsed){c.domRegister.collapsed=false;c.domRegister.Slide()}}else{if(c.domLogin.collapsed){c.domLogin.collapsed=false;c.domLogin.Slide()}}return false}return}var o;if(q.src){o=q.parentNode.href?q.parentNode.href:q.parentNode.parentNode.href}else{if(q.href){o=q.href}else{return}}if(!c.isAjaxReady){return false}$("div.albumInfo a").blur();c.HideOverlays();c.loadingImg.fadeIn("slow");c.isAjaxReady=false;var n=parseInt(o.match(/\d+$/));if(c.mode==c.MODE_IMAGES){var p=c.albumName;c.loadAlbums(function(u){var t=false;$("#thumbnailsList div.slidingPage").animate({height:"hide",opacity:"hide"},"normal",function(){if(t){return}t=true;var v=0;var x=c.toJSON(u);for(var w=0;w<x.albums.length;++w){if(n==x.albums[w].id){v=w}}c.newPage=Math.floor(v/c.numAlbumsPerPage)+1;document.getElementById("thumbnailsList").innerHTML="";c.Process(u);$("#album"+n+" h2 a").html(p);c.isAjaxReady=true})})}else{$("#slideshowDiv").css("z-index","20");c.newPage=1;c.newImageIndex=0;c.albumId=n;c.loadAlbum(function(v){document.getElementById("thumbnailsList").innerHTML="";c.thumbnails.css("display","block");var t=$("div.albumInfo");if(t.length>1){var u=false;if(!c.isIE6){t.css("marginBottom","-1px")}t.not(document.getElementById("album"+n)).animate({height:"0",opacity:"0"},"normal",function(){$(this).remove();if($("div.albumInfo").length==1&&!u){u=true;c.Process(v);c.isAjaxReady=true}})}else{c.Process(v);c.isAjaxReady=true}})}return false});$(this.ID_THUMBNAILS).click(function(q){var q=q||top.event;var p=q.target||q.srcElement;if((p.tagName.toLowerCase()!="img"&&p.tagName.toLowerCase()!="a")||$(p).hasClass("selectedThumbnail")){return false}if(p.tagName.toLowerCase()=="a"){p=p.firstChild}$("#thumbnailsList a").removeClass("selectedThumbnail");if(p.parentNode.href){$(p.parentNode).addClass("selectedThumbnail")}else{$(p.parentNode.parentNode).addClass("selectedThumbnail")}p.parentNode.blur();if(c.imageIndex==p.imageIndex){return false}if(!c.isAjaxReady){return false}c.loadingImg.fadeIn("slow");c.isAjaxReady=false;c.HideOverlays(true);c.ShowImage(c.aImages[p.imageIndex]);var o=c.GetImageId(p.imageIndex);if(c.tag!=null&&c.tag!=""){var n=c.galleryLocation+"?TagXML&tag="+c.tag+"&image="+o;c.jQueryGetCache(n,function(r){c.Process(r);c.isAjaxReady=true})}else{c.setImage(p.imageIndex)}if(document.getElementById("slideshowObj")&&document.getElementById("slideshowObj").sendToActionScript){document.getElementById("slideshowObj").sendToActionScript(c.albumId,o)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(c.albumId,o)}}return false});$(this.ID_IMAGE_DIV).click(function(q){var q=q||top.event;var p=q.target||q.srcElement;if(p.className!="mainDivImage"){return}if(!c.isAjaxReady){return false}c.loadingImg.fadeIn("slow");c.isAjaxReady=false;if(c.mode==c.MODE_ALBUMS){c.HideOverlays();var o=c.aAlbums[(c.page-1)*c.numAlbumsPerPage];c.imageId=o.coverImage.id;c.albumId=o.id;var n=$("#album"+c.albumId);c.loadAlbum(function(t){$("#thumbnailsList *").unbind();c.thumbnails.empty();c.thumbnails.css("display","block");var r=$("div.albumInfo");if(r.length>1){if(!c.isIE6){r.css("marginBottom","-1px")}r.not(n).animate({height:"hide",opacity:"hide"},"normal",function(){$(this).remove();if($("div.albumInfo").length==1){c.Process(t);c.isAjaxReady=true}})}else{c.Process(t);c.isAjaxReady=true}})}else{if(c.mode==c.MODE_IMAGES){c.HideOverlays(true);c.UseControl("nextImageLink")}}});this.imageDiv.mouseover(function(o){var p=Math.max(parseInt(c.imageMain.css("width")),c.X_IMAGE_MINIMUM);var n=parseInt((parseInt(c.imageMain.css("width"))+parseInt(p))/2)-31;$("#slideshowDiv").stop(true);$("#slideshowDiv").animate({top:"0px",left:n+"px"},"fast")});this.imageDiv.mouseout(function(o){var p=Math.max(parseInt(c.imageMain.css("width")),c.X_IMAGE_MINIMUM);var n=parseInt((parseInt(c.imageMain.css("width"))+parseInt(p))/2)-31+50;$("#slideshowDiv").stop(true);$("#slideshowDiv").delay(500).animate({top:"-54px",left:n+50+"px"},"fast")});$(this.ID_PAGE_NUMBERS).click(function(u){var u=u||top.event;var t=u.target||u.srcElement;if(t.tagName.toLowerCase()!="a"||t.className=="selectedPage"){return false}if(!c.isAjaxReady){return false}c.loadingImg.fadeIn("slow");c.isAjaxReady=false;var r;if(t.id=="nextThumbPageLink"){r=parseInt(c.page)+c.numPagesPerScreen}else{if(t.id=="prevThumbPageLink"){r=parseInt(c.page)-c.numPagesPerScreen}else{r=$(t).text()}}var p=1;if(c.mode==c.MODE_ALBUMS){var o=c.aAlbums;var q=o.length;p=Math.ceil(q/c.numAlbumsPerPage)}else{if(c.mode==c.MODE_IMAGES){var v=c.aImages;var n=v.length;p=Math.ceil((n+(c.albumDescription?c.numImagesPerPage-c.numImagesShortPage:0))/c.numImagesPerPage)}}if(r<1){r=1}if(r>p){r=p}if(c.mode==c.MODE_ALBUMS){c.HideOverlays();c.setPage(r)}else{if(c.mode==c.MODE_IMAGES){c.HideOverlays(true);c.newImageIndex=(r-1)*c.numImagesPerPage-(r>1&&c.albumDescription?c.numImagesPerPage-c.numImagesShortPage:0);c.newPage=r;c.loadAlbum(function(w){c.Process(w);if(document.flashSlideshow&&document.flashSlideshow.sendToActionScript){document.flashSlideshow.sendToActionScript(c.albumId,c.imageId)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(c.albumId,c.imageId)}}})}else{if(c.tag!=null&&c.tag!=""){c.jQueryGetCache(c.galleryLocation+"?TagXML&tag="+c.tag+"&page="+r,function(x){c.Process(x,true);c.isAjaxReady=true;var w=c.GetImageId(c.imageIndex);if(document.flashSlideshow&&document.flashSlideshow.sendToActionScript){document.flashSlideshow.sendToActionScript(c.albumId,c.imageId)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(c.albumId,c.imageId)}}})}}}return false});$(document).keydown(function(o){var o=o||top.event;var n=o.charCode?o.charCode:o.keyCode?o.keyCode:0;if((n==37||n==39)&&!c.commentFocused){if(c.domLogin){if(c.domLogin.style.display=="none"){return false}}else{return false}}return});$(document).keyup(function(o){var o=o||top.event;var n=o.charCode?o.charCode:o.keyCode?o.keyCode:0;if((n!=37&&n!=39)||c.commentFocused||(c.domLogin&&(c.domLogin.style.display=="block"))){return}if(!c.isAjaxReady){return false}c.loadingImg.fadeIn("slow");c.isAjaxReady=false;c.HideOverlays(true);switch(n){case 39:c.UseControl("nextImageLink");break;case 37:c.UseControl("prevImageLink");break}return});$("#prevImageLink, #nextImageLink").click(function(p){var p=p||top.event;var o=p.target||p.srcElement;var n=o.id;if(o.tagName.toLowerCase()!="a"||(n!="nextImageLink"&&n!="prevImageLink")){return}o.blur();if(!c.isAjaxReady){return false}c.loadingImg.fadeIn("slow");c.isAjaxReady=false;c.HideOverlays(true);c.UseControl(n);return false});$("#functionsAnchor").click(function(n){$("#albumListDiv div.slidingPage").toggle();c.thumbnails.toggle();c.pageNumbers.toggle();if(c.page==1){$(c.ID_ALBUM_DESCRIPTION).toggle()}c.functions.toggle();return false});$(this.ID_COMMENT_ANCHOR).click(function(){if(c.newComment){$("#commentForm").css("display","block");var n=$('#commentForm input[type="image"]');if(n){n.attr("src",c.getNewCaptchaURL())}}else{$("#commentForm").css("display","none")}c.commentBlock.toggle();return false});$("#commentForm").submit(function(){c.AddComment();return false});$(this.ID_COMMENTS_DIV).click(function(n){c.DeleteComment(n);return false});$('#commentForm input[type="image"]').click(function(n){this.src=c.getNewCaptchaURL();return false});$("#msgInput").focus(function(){c.commentFocused=true});$("#msgInput").blur(function(){c.commentFocused=false});$("a.share").click(function(){$(c.domShareDiv).toggle();return false});$("body:not(a.share)").click(function(){$(c.domShareDiv).hide();return});$(this.domShareDiv).click(function(n){return false});if(this.albumId!=null||(this.tag!=null&&this.tag!="")){this.mode=this.MODE_ALBUMS;this.thumbnails.empty();if(this.newImageIndex){this.newPage=this.getPage()}var k=function(n){c.Process(n);c.isAjaxReady=true;c.PreloadMain(c.imageIndex*1+1)};var d=this.GetImageId(this.imageIndex);this.pageNew=this.getPage();if(this.tag!=null&&this.tag!=""){var b=this.galleryLocation+"?TagXML&tag="+this.tag+"&image="+d;this.jQueryGetCache(b,k)}else{this.loadAlbum(k)}setTimeout(function(){if(document.getElementById("slideshowObj")&&document.getElementById("slideshowObj").sendToActionScript){document.getElementById("slideshowObj").sendToActionScript(c.albumId,d)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(c.albumId,d)}}},500)}else{this.mode=this.MODE_IMAGES;if(this.imageMain.length<1){var a=$("div.sidePanel");var m=a.css("border-top-width");var l=a.css("border-bottom-width");var j=parseInt(m)+parseInt(l);this.imageDiv.height(this.Y_NOIMAGE_MINIMUM+j)}$("div.albumInfo").remove();this.loadAlbums(function(n){c.Process(n);c.isAjaxReady=true});this.imageMain.css("cursor","pointer")}}Display.prototype={ID_CONTAINER_DIV:"#containerDiv",ID_LOADING_IMG:"#loadingImg",ID_ALBUM_LIST:"albumListDiv",ID_THUMBNAILS:"#thumbnailsList",ID_PAGE_NUMBERS:"#pageNumPara",ID_ALBUM_DESCRIPTION:"#albumDescriptionPara",ID_FUNCTIONS_DIV:"#functionsDiv",ID_MAIN_PANEL_DIV:"#mainPanelDiv",ID_IMAGE_DIV:"#imageDiv",ID_EXIF_DIV:"#exifDiv",ID_COMMENT_ANCHOR:"#commentAnchor",ID_COMMENT_BLOCK_DIV:"#commentBlockDiv",ID_COMMENTS_DIV:"#commentsDiv",X_IMAGE_MINIMUM:320,Y_IMAGE_MINIMUM:425,Y_IMAGE_OFFSET:130,Y_NOIMAGE_MINIMUM:460,X_CONTAINER_MINIMUM:950,W_SPRITE:70,H_SPRITE:70,NUM_SPRITE_ROWS:10,NUM_SPRITE_COLS:10,NUM_SPRITES:100,MODE_ALBUMS:"albums",MODE_IMAGES:"images",FLASH_VERSION_REQUIRED:9,isIE:false,isIE6:false,commentFocused:false,isAjaxReady:true,isDataParsed:false,isImageLoaded:false,albumDescription:"",Cleanup:function(){$("*").unbind();for(var a in this){this[a]=null}},Process:function(F){var m=this;var D=this.toJSON(F);if(D.albums){$("#slideshowDiv").css("z-index","-100");this.aAlbums=new Array();this.aImages=new Array();document.getElementById("commentAnchorPara").style.display="none";this.commentBlock.css("display","none");for(var C=0;C<D.albums.length;C++){this.aAlbums.push(D.albums[C])}this.ShowAlbums();if(this.mode==this.MODE_IMAGES){this.controls.css("visibility","hidden");$("#embedShareSpan").css("display","none");this.albumDescription="";var c=$("#infoCaptionDiv");document.getElementById("numAlbums").style.display="block";if(!document.getElementById("numImages")){var o=document.createElement("p");o.id="numImages";var v=parseInt(this.imageMain.width());var g=parseInt(this.imageMain.css("border-left-width"))+parseInt(this.imageMain.css("border-right-width"));$(o).width(v+g);o.innerHTML='<img src="http://ilostatic.one.com/iloapp/gallery/Images/system/transparent.gif" alt="'+this.aLangs.images+'"/>';o.innerHTML+="<span>"+this.imagesViewable+"</span>";c.empty();c.append(o)}}var a=((this.newPage?this.newPage:1)-1)*this.numAlbumsPerPage;if(this.aAlbums[a]){var d=this.aAlbums[a].coverImage;var q=new Image;q.onload=function(){$(this).unbind();m.ShowImage(d,false)};q.src=d.urlThumbnail}else{this.isImageLoaded=true}this.mode=this.MODE_ALBUMS}if(D.album){this.album=D.album;this.albumPrivacyLevel=D.album.privacyLevel}if(D.album&&D.album.images){this.albumId=D.album.id;this.albumName=D.album.name;this.albumDescription=D.album.description;var A=new Array();if(!D.album.isDecompressed){var h=D.album.privacyLevel=="public"||D.album.privacyLevel=="private";for(var C=0;C<D.album.images.length;++C){D.album.images[C].index=C;if(D.album.images[C].comments){for(var B=0;B<D.album.images[C].comments.length;++B){if(!D.album.images[C].comments[B][1]){continue}var w=D.album.images[C].comments[B];D.album.images[C].comments[B]={id:w[0],postedBy:w[1],message:w[2]}}}}D.album.isDecompressed=true}$("#slideshowDiv").css("z-index","20");var E;this.indexFirst=-1;this.aImages=D.album.images;var k=this.getPage(),f=k;var e=(k-1)*this.numImagesPerPage-(k>1&&D.album.description?this.numImagesPerPage-this.numImagesShortPage:0);var p=e+(k==1&&D.album.description?this.numImagesShortPage:this.numImagesPerPage)-1;this.imageIndexFirst=e;this.imageIndexLast=p;for(var C=0;C<this.aImages.length;++C){var u=this.aImages[C];if(e<=u.index&&u.index<=p){A[u.index]=u}if(this.newImageIndex!=null){if(this.newImageIndex==C){this.imageIndex=u.index;E=u.caption;this.newImageIndex=null}}else{if(u.selected){this.imageIndex=u.index;E=u.caption}}}this.domInfoCaption.innerHTML=E?E.replace(/\n/g,"<br/>"):"";if(this.mode==this.MODE_ALBUMS){$("#album"+this.albumId+" h2 a").html("&#xab; "+this.albumName);Reset();document.getElementById("numAlbums").style.display="none";this.controls.css("visibility","visible");Reset();if(D.album.embedable){$("#embedShareSpan").css("display","inline")}if(!D.album.downloadable){$("#downloadLink").parents("li").css("visibility","hidden")}var l=this.imageIndex+1;var y=this.aLangs.image+" <span>"+l+"</span> "+this.aLangs.imageXofY+" "+D.album.imageCount+"<br/>";var b=D.album.ownerName;if(b!==""){y+=this.aLangs.albumCreated+" "+b}$("p",this.exifDiv).html(y);this.ShowThumbnails(A,f);this.ShowImage(A[this.imageIndex]);this.imageId=A[this.imageIndex].id;var m=this;if(document.getElementById("slideshowObj")&&document.getElementById("slideshowObj").sendToActionScript){document.getElementById("slideshowObj").sendToActionScript(D.album.id,m.imageId)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(D.album.id,m.imageId)}}}else{if(f<this.page){this.ShowImage(A[this.imageIndex]);this.ShowThumbPage(A,"left")}else{if(f>this.page){this.ShowImage(A[this.imageIndex]);this.ShowThumbPage(A,"right")}}}this.page=f;this.newPage=null;this.mode=this.MODE_IMAGES}if(this.newPage){this.page=this.newPage;this.newPage=null}this.ShowPages();var u=D.album&&D.album.images?D.album.images[this.imageIndex]:null;if(u&&u.exif){this.exifTable.empty();for(var z in u.exif){var x=u.exif[z];var r=document.createElement("tr");var n=document.createElement("td");var t=document.createElement("td");n.className="exifVariable";n.innerHTML=z+":";t.className="exifValue";t.innerHTML=x;this.exifTable.append(r);r.appendChild(n);r.appendChild(t)}$("span",this.exifDiv).text(parseInt(this.imageIndex)+1)}if(D.album){document.getElementById("commentAnchorPara").style.display="block";this.ShowComments(u&&u.comments?u.comments:[])}if(this.albumDescription===""||this.page!=1){$(this.ID_ALBUM_DESCRIPTION).remove()}this.isDataParsed=true;if(this.isImageLoaded){this.isImageLoaded=false;this.isDataParsed=false;this.loadingImg.stop(true,true);this.loadingImg.hide()}},ShowAlbums:function(){var E=this.newPage<this.page?"left":"right";var B=this.mode!=this.MODE_IMAGES;var c=this.aAlbums;var y=c.length;if(y==0){return}var o=0;for(var C=0;C<c.length;C++){var F=c[C].mod;o=F>o?F:o}var j=(this.newPage-1)*this.numAlbumsPerPage;var g=j+this.numAlbumsPerPage;g=g<y?g:y;var H="album"+this.albumId;var q=document.getElementById(H);var G=true;var A;var p;if(B){var A=$("div.slidingPage",this.domAlbumList);var d=document.createElement("div");d.className="slidingPage";p=$(d)}else{var p=$("div.slidingPage",this.domAlbumList)}for(var C=j,x;(x=c[C])&&C<g;C++){if(H=="album"+x.id){G=false;continue}if(C==j&&x.coverImage){var v=new Image;v.src=x.coverImage.urlThumbnail}var u=document.createElement("div");u.id="album"+x.id;u.className="albumInfo";if(!B){u.style.display="none"}if(q&&G){$(u).insertBefore(q)}else{p.append(u)}var f=document.createElement("h2");var t=document.createElement("a");var r=document.createElement("a");var h=document.createElement("img");var k=document.createElement("p");u.appendChild(f);u.appendChild(r);u.appendChild(k);f.appendChild(t);r.appendChild(h);t.innerHTML=x.name;t.href=this.galleryLocation+"?Album&album="+x.id;var e=x.coverImage;r.href=this.galleryLocation+"?Album&album="+x.id;r.className="coverImage";h.alt="Thumbnail";h.style.display="none";var b=(x.privacyLevel=="public"||x.privacyLevel=="private")&&x.spriteIndex!=null;if(b){var D=Math.floor(x.spriteIndex/200);var a=x.spriteIndex%200;h.style.width="45px";h.style.height="45px";h.style.backgroundImage="url(../data/_gallery/"+x.privacyLevel+"/cover-sprites-"+D+".jpg"+(o?"?_m="+o:"")+")";h.style.backgroundPosition=(-1*a*45)+"px 0px";h.style.backgroundRepeat="no-repeat"}else{if(e.height>0){var n=e.width/e.height}else{var n=1}var m=$(r);if(parseInt(e.width)>parseInt(e.height)){m.addClass("landscape");var z=45;var w=parseInt(z*n);h.style.marginLeft="-"+((w-45)/2)+"px"}else{m.addClass("portrait");var w=45;var z=parseInt(w/n);h.style.marginTop="-"+((z-45)/2)+"px"}}h.onload=function(){$(this).unbind();$(this).fadeIn("normal");this.style.display="block";var I=this;setTimeout(function(){$(I).css("opacity",null);I.style.filter=null},500)};if(b){h.src="http://ilostatic.one.com/iloapp/gallery/Images/system/transparent.gif"}else{h.src=x.coverImage.urlThumbnail}k.innerHTML=x.timeCreated+"<br/>"+x.numImages+"<br/>";if(x.editable){k.innerHTML+='<a class="albumInfoEdit" href="'+this.galleryLocation+"?EditAlbum&album="+x.id+'">'+this.aLangs.editAlbum+"</a>";if(x.deletable){k.innerHTML+='<a class="albumInfoDelete" href="'+this.galleryLocation+"?DeleteAlbum&album="+x.id+'">'+this.aLangs.deleteAlbum+"</a>"}}else{k.innerHTML+="<br/>"}}if(!B){if(this.isIE){setTimeout(function(){$("div.albumInfo").each(function(){$(this).show("normal")})},200)}else{$("div.albumInfo").each(function(){$(this).show("normal")})}}else{this.domAlbumList.style.width=2*A.width()+"px";var l=this;setTimeout(function(){if(E=="left"){p.insertBefore(A);$("div.slidingPage").css("left","-185px");$("div.slidingPage").animate({left:"+=185px"},500,function(){A.remove();p.css("left","0px");l.isAjaxReady=true})}else{if(E=="right"){p.insertAfter(A);$("div.slidingPage").animate({left:"-=185px"},500,function(){A.remove();p.css("left","0px");l.isAjaxReady=true})}}},500)}this.albumId=null},ShowThumbnails:function(A,f,G){var D=G?true:false;if(!D){document.getElementById("thumbnailsList").innerHTML=""}else{var C=$("div.slidingPage",this.thumbnails)}var b=document.createElement("div");b.className="slidingPage";var H=document.createElement("ul");this.thumbnails.append(b);b.appendChild(H);var o=this;var r=this.aImages.length%this.NUM_SPRITES;var q=this.NUM_SPRITE_ROWS*this.W_SPRITE;var l=true;for(var E in A){var w=A[E];var k=w.index;if(l){this.imageIndexFirst=parseInt(k);l=false}var a=(this.albumPrivacyLevel=="public"||this.albumPrivacyLevel=="private")&&w.spriteIndex!=null;var d=document.createElement("li");var j=document.createElement("a");var h;var z=document.createElement("img");if(this.tag!=null&&this.tag!=""){j.href=this.galleryLocation+"?Tags&tag="+this.tag+"&image="+w.id}else{j.href=this.galleryLocation+"?Album&album="+this.albumId+"&image="+w.id}if(k==this.imageIndex){j.className="selectedThumbnail"}if(a){h=document.createElement("div");h.style.position="relative";h.style.width="45px";h.style.height="45px";h.style.overflow="hidden";var F=Math.floor(w.spriteIndex/this.NUM_SPRITES);var p=w.spriteIndex%this.NUM_SPRITE_ROWS;var J=Math.floor(w.spriteIndex/this.NUM_SPRITE_COLS)-F*this.NUM_SPRITE_ROWS;var t=parseInt(w.width);var v=parseInt(w.height);if(t>v){var n=t/v;var K=this.W_SPRITE/n;var I=45/K}else{var n=v/t;var c=this.H_SPRITE/n;var I=45/c}var g=Math.floor((this.W_SPRITE*I-45)/2);if(this.aImages.length-w.spriteIndex<=r){var e=Math.ceil(r/this.NUM_SPRITE_COLS);var u=Math.floor(this.H_SPRITE*I*e)}else{var u=Math.floor(q*I)}z.style.position="absolute";z.style.left=(-g-Math.ceil(p*this.W_SPRITE*I))+"px";z.style.top=(-g-Math.ceil(J*this.H_SPRITE*I))+"px";z.style.height=u+"px"}else{if(w.height>0){var n=w.width/w.height}else{var n=1}var m=$(j);if(parseInt(w.width)>parseInt(w.height)){m.addClass("landscape");var B=45;var x=parseInt(B*n);z.style.marginLeft="-"+((x-45)/2)+"px"}else{m.addClass("portrait");var x=45;var B=parseInt(x/n);z.style.marginTop="-"+((B-45)/2)+"px"}}z.imageIndex=k;z.alt="Thumbnail";z.title="";if(a){h.appendChild(z);j.appendChild(h)}else{j.appendChild(z)}d.appendChild(j);H.appendChild(d);if(a){z.src="../data/_gallery/"+this.albumPrivacyLevel+"/"+this.albumId+"/thumb-sprites-"+F+".jpg"+(this.album&&this.album.mod?"?_m="+this.album.mod:"")}else{z.src=w.urlThumbnail}z=null}this.imageIndexLast=parseInt(k);if(!D){this.ShowDescription(f)}else{this.thumbnails.width(2*C.width());var y=$("div.slidingPage",this.thumbnails);setTimeout(function(){if(G=="left"){$(b).insertBefore(C);y.css("left","-185px");y.animate({left:"+=185px"},500,"swing",function(){C.remove();b.style.left="0px";o.ShowDescription(o.page);o.isAjaxReady=true})}else{if(G=="right"){$(b).insertAfter(C);y.animate({left:"-=185px"},500,"swing",function(){C.remove();b.style.left="0px";o.ShowDescription(o.page);o.isAjaxReady=true})}}},500)}},ShowThumbPage:function(b,a){return this.ShowThumbnails(b,null,a)},ShowPages:function(m){this.pageNumbers.empty();var j;var l;if(this.mode==this.MODE_ALBUMS){j=this.galleryLocation+"?Home&page=";m=[];var a=this.aAlbums;var n=a.length;l=Math.ceil(n/this.numAlbumsPerPage)}else{if(this.mode==this.MODE_IMAGES){j=this.galleryLocation+"?Album&album="+this.albumId+"&page=";var b=this.aImages;var o=b.length;l=Math.ceil((o+(this.albumDescription?this.numImagesPerPage-this.numImagesShortPage:0))/this.numImagesPerPage)}else{if(this.tag!=null&&this.tag!=""){j=this.galleryLocation+"?Tags&tag="+this.tag+"&page="}}}if(this.mode==this.MODE_ALBUMS||this.mode==this.MODE_IMAGES){var d=Math.floor(this.numPagesPerScreen/2);this.page=this.page*1;var f=this.page-d+(this.numPagesPerScreen%2-1);f=f>1?f:1;var c=this.page+d;c=c<=l?c:l;var t=d+(this.numPagesPerScreen%2-1)-(this.page-f);if(t>0){c+=t;c=c<=l?c:l}else{var k=d-(c-this.page);if(k>0){f-=k;f=f>1?f:1}}m=[];for(var r=f;r<=c;++r){m.push({number:r,selected:r==this.page})}}if(m.length<=1){return}if(this.page!=1){var e=parseInt(this.page)-this.numPagesPerScreen;if(e<1){e=1}var h=document.createElement("a");h.id="prevThumbPageLink";h.href=j+e;h.innerHTML="&#xab;";this.pageNumbers.append(h)}this.pageNumbers.append("&nbsp;|&nbsp;");var q;for(var r=0,g;g=m[r];r++){q=g.number;var h=document.createElement("a");if(g.selected){h.className="selectedPage"}h.href=j+g.number;h.innerHTML=g.number;this.pageNumbers.append(h);this.pageNumbers.append("&nbsp;|&nbsp;")}if(this.page!=q){var p=parseInt(this.page)+this.numPagesPerScreen;if(p>l){p=l}var h=document.createElement("a");h.id="nextThumbPageLink";h.href=j+p;h.innerHTML="&#xbb;";this.pageNumbers.append(h)}},ShowComments:function(e){this.comments.empty();var b=this.GetImageId(this.imageIndex);var c,g="";if(this.delComment){var c='<a class="delCommentAnchor" href="'+this.galleryLocation+"?Album&album="+this.albumId+"&image="+b+"&delete=";var j='"><img class="delCommentBtn sprite" src="http://ilostatic.one.com/iloapp/gallery/Images/system/transparent.gif" alt="trash can" title="'+this.aLangs.deleteComment+'"/></a>'}if(e.length>0||this.newComment||this.album.anonCommentEnabled){this.commentAnchor.text(this.aLangs.comments+" ("+e.length+")");this.commentAnchor.css("visibility","visible")}else{this.commentAnchor.css("visibility","hidden")}for(var d=0,f;f=e[d];d++){var a="";if(this.delComment){a=c+f.id+j}var h=document.createElement("div");h.commentId=f.id;h.className="comment";h.innerHTML='<h3 class="time">'+f.postedBy+a+'</h3><p class="commentText">'+f.message+"</p>";this.comments.prepend(h)}},showImageId:null,ShowImage:function(d){if(!d){d=this.getCurrentImage()}if(!d){return}this.showImageId=d.id;this.url=d.url;this.xImageOrig=d.width;this.yImageOrig=d.height;if(this.albumId!=null){document.cookie="gmsg"+this.galleryId+"="+this.albumId+"."+d.id+";path=/;domain=."+this.domainName}else{if(this.page>1){document.cookie="gmsg"+this.galleryId+"=home."+this.page+";path=/;domain=."+this.domainName}else{document.cookie="gmsg"+this.galleryId+"=home;path=/;domain=."+this.domainName}}if(this.tag!=null&&this.tag!=""){this.domDownloadLink.href=this.galleryLocation+"?Download&album="+this.albumId+"&image="+d.originalId;if($("#imageDiv .jsSlideShow").length){document.getElementById("slideshowObj").href=this.galleryLocation+"?SlideShow&tag="+this.tag+"&image="+d.id}var N=this.galleryLocation+"?Tags&tag="+this.tag+"&image="}else{this.domDownloadLink.href=this.galleryLocation+"?Download&album="+this.albumId+"&image="+d.id;if($("#imageDiv .jsSlideShow").length){document.getElementById("slideshowObj").href=this.galleryLocation+"?SlideShow&album="+this.albumId+"&image="+d.id}var N=this.galleryLocation+"?Album&album="+this.albumId+"&image="}var c=this.aImages;var f=d.index-1;f=!c[f]?c.length:f;var p=d.index+1;p=!c[p]?0:p;var z=this.GetImageId(f);var b=this.GetImageId(p);this.domExifLink.href=N+d.id+"&show=exif";this.domPrevLink.href=N+z;this.domNextLink.href=N+b;var j=document.createElement("img");j.style.display="none";j.style.visibility="hidden";j.className="mainDivImage";var t=this.FitImage(this.xImageOrig,this.yImageOrig);var e=Math.max(t.width,this.X_IMAGE_MINIMUM);var g=Math.max(t.height,this.Y_IMAGE_MINIMUM);$("img.mainDivImage").each(function(){if(this.loaded){$(this).unbind();$(this).remove()}else{this.style.display="none"}});var l;var a;var h=(this.albumPrivacyLevel=="public"||this.albumPrivacyLevel=="private")&&d.spriteIndex!=null;var C=false;if(this.aLoaded[(this.albumId?this.albumId:this.getAlbumId())+"-"+d.id]){C=true}var K=document.getElementById("fakeMainImage");if(h&&!C){j.style.position="absolute";j.style.left="-9999em";j.style.zIndex="5";l=document.createElement("div");l.id="fakeMainImage";l.style.position="relative";l.style.margin="auto";l.style.width=(parseInt(t.width)+2)+"px";l.style.height=(parseInt(t.height)+2)+"px";l.style.overflow="hidden";l.style.height=t.height+"px";l.style.border="1px solid black";l.style.marginBottom=-1*t.height-2+"px";var m=Math.floor(d.spriteIndex/this.NUM_SPRITES);var E=d.spriteIndex%this.NUM_SPRITE_ROWS;var o=Math.floor(d.spriteIndex/this.NUM_SPRITE_COLS)-m*this.NUM_SPRITE_ROWS;var n=parseInt(d.width);var A=parseInt(d.height);if(n>A){var P=n/A;var r=this.W_SPRITE/P;var H=t.height/r;var y=Math.floor((t.height*P-t.width)/2);var B=Math.floor((t.height*P-t.height)/2)}else{var P=A/n;var u=this.H_SPRITE/P;var H=t.width/u;var y=Math.floor((t.width*P-t.width)/2);var B=Math.floor((t.width*P-t.height)/2)}var Q=this.aImages.length%this.NUM_SPRITES;var O=700;var k=700;if(this.aImages.length-d.spriteIndex<=Q){var q;if(Q>this.NUM_SPRITE_COLS){q=Math.floor(this.W_SPRITE*H*this.NUM_SPRITE_COLS)}else{q=Math.floor(this.W_SPRITE*H*Q)}var G=Math.ceil(Q/this.NUM_SPRITE_COLS);var w=Math.floor(this.H_SPRITE*H*G)}else{var q=Math.floor(O*H);var w=Math.floor(k*H)}a=document.createElement("img");a.style.position="absolute";a.style.left=(-y-Math.ceil(E*this.W_SPRITE*H))+"px";a.style.top=(-B-Math.ceil(o*this.H_SPRITE*H))+"px";a.style.width=q+"px";a.style.height=w+"px";a.src="../data/_gallery/"+this.albumPrivacyLevel+"/"+this.albumId+"/thumb-sprites-"+m+".jpg"+(this.album&&this.album.mod?"?_m="+this.album.mod:"");l.appendChild(a)}else{if(!C){l=document.createElement("img");l.id="fakeMainImage";l.src=d.urlThumbnail;l.width=t.width;l.height=t.height;l.style.display="inline";l.style.marginBottom=-1*t.height-2+"px"}}if(!C){if(K){$(K).unbind();$(K).replaceWith(l)}else{this.imageDiv.append(l)}}var L=$("div.sidePanel");var J=parseInt(L.css("padding-bottom"))+parseInt(L.css("padding-top"));var v=this.imageMain.css("border-left-width");var D=this.imageMain.css("border-right-width");var T=this.imageMain.css("border-top-width");var R=this.imageMain.css("border-bottom-width");var F=0;var I=0;if(typeof v!="undefined"&&typeof D!="undefined"){F=parseInt(v)+parseInt(D)}if(typeof T!="undefined"&&typeof R!="undefined"){I=parseInt(T)+parseInt(R)}$("#numImages").width(t.width+F);this.imageDiv.width(e+F);this.imageDiv.height(g+I);var U=$("div.overlay");var x=$("div.formOverlay");U.height(g);x.width(e);x.height(g);if(typeof this.container.get(0).style.maxHeight!="undefined"){L.css("min-height",g-J+"px")}else{L.css("height",g-J+"px")}var V=this;var S=(new Date()).getTime();j.id=d.id;j.onload=function(){var W=parseInt(this.id);if(W==V.showImageId){this.loaded=true;j.style.left="0em";S=(new Date()).getTime()-S;if(!V.aLoaded[(V.albumId?V.albumId:V.getAlbumId())+"-"+W]&&l){$(l).fadeOut("fast",function(){$(this).unbind();$(this).remove()})}else{if(l){$(l).unbind();$(l).remove()}}V.aLoaded[(V.albumId?V.albumId:V.getAlbumId())+"-"+W]=true}else{$(this).unbind();$(this).remove();if(l){$(l).unbind();$(l).remove()}}};if(t.width==this.xImageOrig&&t.height==this.yImageOrig){j.src=this.url}else{j.src=this.url+"?width="+t.width+"&height="+t.height}this.imageMain=$(j);j.style.position="relative";this.imageDiv.append(j);if(document.all||jQuery.browser.opera){this.ResizeImage();j.style.display="inline";j.style.visibility="visible";this.isImageLoaded=true;if(this.isDataParsed){this.isImageLoaded=false;this.isDataParsed=false;this.loadingImg.stop(true,true);this.loadingImg.hide()}}else{(function(){if(j.width<1||j.height<1){setTimeout(arguments.callee,20);return}V.GetWindowSize();V.ResizeImage();j.style.display="inline";j.style.visibility="visible";V.isImageLoaded=true;if(V.isDataParsed){V.isImageLoaded=false;V.isDataParsed=false;V.loadingImg.stop(true,true);V.loadingImg.hide()}})()}},ShowDescription:function(b){if(!document.getElementById("albumDescriptionPara")&&this.albumDescription!==""&&b==1){var a=document.createElement("p");a.id="albumDescriptionPara";a.innerHTML=this.albumDescription.replace(/\n/g,"<br/>");$(a).insertAfter(this.pageNumbers)}},Preload:function(){var a=0;var b=this;(function(){if(b.aImages[a]&&b.aImages[a].thumbnail){if(b.aImages[a].thumbnail.width){a++}else{setTimeout(arguments.callee,25);return}}if(a>=b.imageIndexFirst&&a<=b.imageIndexLast){a++}if(a<b.aImages.length&&b.aImages[a].urlThumbnail){b.aImages[a].thumbnail=new Image();b.aImages[a].thumbnail.src=b.aImages[a].urlThumbnail;setTimeout(arguments.callee,25)}})()},PreloadMain:function(a){var b=a;if(!this.aImages[b]){b=0}var d=this.aImages[b];var g=d.url;if(d.width!=null&&d.height!=null){this.GetWindowSize();var c=this.FitImage(d.width,d.height);if(c.width!=d.width&&c.height!=d.height){g+="?width="+c.width+"&height="+c.height}}var f=this;if(document.all){var h=document.createElement("img");h.id=d.id;h.onload=function(){$(this).unbind();$(this).remove();f.aLoaded[(f.albumId?f.albumId:f.getAlbumId())+"-"+this.id]=true};h.style.position="absolute";h.style.left="-9999em";h.width="1px";h.height="1px";h.src=g}else{var e=new Image();e.src=g;e.id=d.id;e.onload=function(){f.aLoaded[(f.albumId?f.albumId:f.getAlbumId())+"-"+this.id]=true}}},AddComment:function(){if(!this.isAjaxReady){return}var e=this.commentMessage.val();if(e==""){$("#commentForm span").text(this.aLangs.commentError);return}this.loadingImg.fadeIn("slow");this.isAjaxReady=false;$("#commentForm span").text("");$("#submitBtn").attr("disabled","disabled");var g={message:e};var c=$('#commentForm input[name="author"]');var d=$('#commentForm input[name="code"]');if(c&&d){g.author=c.val();g.code=d.val()}var b=this.GetImageId(this.imageIndex);var a=this.galleryLocation+"?AlbumJSON&album="+this.albumId+"&image="+b;this.jQueryClearCache();this.newImageIndex=this.imageIndex;var f=this;jQuery.post(a,g,function(k){var j=f.toJSON(k);if(j.error){var h=j.error;if(h.parameter=="author"){$("#commentForm span").text(f.aLangs.authorError);c.focus()}else{if(h.parameter=="code"){$("#commentForm span").text(f.aLangs.codeError);d.focus()}else{if(h.parameter=="message"){$("#commentForm span").text(f.aLangs.commentError);f.commentMessage.focus()}}}f.loadingImg.stop(true,true);f.loadingImg.hide()}else{f.isImageLoaded=true;f.Process(k);f.commentMessage.val("");if(c){c.val("")}}if(d){d.val("");$('#commentForm input[type="image"]').attr("src",f.getNewCaptchaURL())}f.isAjaxReady=true;$("#submitBtn").removeAttr("disabled")})},DeleteComment:function(f){var f=f||top.event;var d=f.target||f.srcElement;if(d.className!="delCommentBtn sprite"&&d.className!="delCommentAnchor"){return}var h=$(d).parents(".comment");if(h.length!=1){return}if(!this.isAjaxReady){return}if(!confirm(this.aLangs.deleteCommentConfirm)){return false}this.loadingImg.fadeIn("slow");this.isAjaxReady=false;var c=h.get(0).commentId;var b=this.GetImageId(this.imageIndex);var a=this.galleryLocation+"?AlbumJSON&album="+this.albumId+"&image="+b;var g=this;this.jQueryClearCache();this.newImageIndex=this.imageIndex;jQuery.post(a,{"delete":c},function(e){g.isImageLoaded=true;g.Process(e);g.isAjaxReady=true})},UseControl:function(c){var h=this;var b;switch(c){case"nextImageLink":var a=parseInt(this.imageIndex)+1;if(!this.aImages[a]){a=0}this.newImageIndex=this.imageIndex=a;b=a+1;break;case"prevImageLink":var e=parseInt(this.imageIndex)-1;if(!this.aImages[e]){e=this.aImages.length-1}this.newImageIndex=this.imageIndex=e;b=e-1;break;default:return;break}if(this.imageIndex>=this.imageIndexFirst&&this.imageIndex<=this.imageIndexLast){this.ShowImage(this.aImages[this.imageIndex]);$("#thumbnailsList a").removeClass("selectedThumbnail");var g=$("img[imageIndex="+this.imageIndex+"]").parent();if(g.is("a")){g.addClass("selectedThumbnail")}else{if(g.parent()){g.parent().addClass("selectedThumbnail")}}}var f=this.GetImageId(this.imageIndex);if(this.tag!=null&&this.tag!=""){var d=this.galleryLocation+"?TagXML&tag="+this.tag+"&image="+f;this.jQueryGetCache(d,function(j){h.Process(j);h.isAjaxReady=true})}else{this.loadAlbum(function(j){h.Process(j);h.isAjaxReady=true})}if(document.flashSlideshow&&document.flashSlideshow.sendToActionScript){document.flashSlideshow.sendToActionScript(this.albumId,f)}else{if(window.flashSlideshow&&window.flashSlideshow.sendToActionScript){window.flashSlideshow.sendToActionScript(this.albumId,f)}}this.PreloadMain(b)},HideOverlays:function(a){if(a){textSlider.HideAllExceptExif()}else{textSlider.HideAll()}$("#albumListDiv div.slidingPage").css("display","block");this.thumbnails.css("display","block");this.pageNumbers.css("display","block");if(this.page==1){$(this.ID_ALBUM_DESCRIPTION).css("display","block")}this.functions.css("display","none");return false},IsFlashCapable:function(){var b=0;var a="";if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash"]&&navigator.plugins["Shockwave Flash"].description){a=navigator.plugins["Shockwave Flash"].description}}else{if(jQuery.browser.msie){try{var c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");a=c.GetVariable("$version")}catch(d){return 0}}}b=a.match(/\d+/);return(b>=this.FLASH_VERSION_REQUIRED)},FitImage:function(q,a){var f=q/a;if(typeof(q)=="undefined"||typeof(a)=="undefined"){return{width:0,height:0}}var j=this.imageMain.css("border-left-width");var g=this.imageMain.css("border-right-width");var d=this.imageMain.css("border-top-width");var y=this.imageMain.css("border-bottom-width");var e=0;var r=0;if(typeof j!="undefined"&&typeof g!="undefined"&&j!=""&&g!=""){j=parseInt(j);g=parseInt(g);e=j+g}else{j=0;g=0}if(typeof d!="undefined"&&typeof y!="undefined"){d=parseInt(d);y=parseInt(y);r=d+y}else{d=0;y=0}var l=parseInt(this.mainPanel.css("padding-left"))+parseInt(this.mainPanel.css("padding-right"));var p=this.mainPanel.width()-l-e;var m=this.yWindow-this.Y_IMAGE_OFFSET;if(this.isIE6){p-=42;m-=42}var n,t;if(q<p&&a<m){return{width:q,height:a}}var w,x;var k=false;for(var u=0,h;h=this.aRestrict[u];u++){w=h;x=h/f;if(p>=w&&m>=x){k=true;break}}if(!k){w=this.aRestrict[this.aRestrict.length-1];x=w/f}var b,c;var k=false;for(var u=0,h;h=this.aRestrict[u];u++){c=h;b=h*f;if(p>=b&&m>=c){k=true;break}}if(!k){c=this.aRestrict[this.aRestrict.length-1];b=c*f}if((w<=p&&x<=m)==(b<=p&&c<=m)){var v=w*x;var o=b*c;if(v>=o){n=w;t=x}else{n=b;t=c}}else{var v=w*x;var o=b*c;if(v<o){n=w;t=x}else{n=b;t=c}}n=parseInt(n);t=parseInt(t);return{width:n,height:t}},ResizeImage:function(){var t=$("div.overlay");var p=$("div.formOverlay");var h=$("div.sidePanel");var u=this.imageMain.get(0);if(!u){return}var c=$("img.mainDivImage, #fakeMainImage",this.imageDiv);var l=parseInt(h.css("padding-bottom"))+parseInt(h.css("padding-top"));var k=this.imageMain.css("border-left-width");var j=this.imageMain.css("border-right-width");var d=this.imageMain.css("border-top-width");var v=this.imageMain.css("border-bottom-width");var e=0;var q=0;if(typeof k!="undefined"&&typeof j!="undefined"){k=parseInt(k);j=parseInt(j);e=k+j}else{k=0;j=0}if(typeof d!="undefined"&&typeof v!="undefined"){d=parseInt(d);v=parseInt(v);q=d+v}else{d=0;v=0}var n=this.FitImage(this.xImageOrig,this.yImageOrig);var m=n.width;var r=n.height;var f="";if(m==this.xImageOrig&&r==this.yImageOrig){f=this.url}else{f=this.url+"?width="+m+"&height="+r}if(m!=u.width||r!=u.height){u.src=f;c.width(m);c.height(r)}$("#numImages").width(m+e);var o=Math.max(m,this.X_IMAGE_MINIMUM);var b=Math.max(r,this.Y_NOIMAGE_MINIMUM);this.imageDiv.width(o+e);this.imageDiv.height(b+q);var g=parseInt((parseInt(m)+parseInt(o))/2)-31;$("#slideshowDiv").css("left",g+"px");t.height(b);p.width(o);p.height(b);var a=Math.max(r,this.Y_NOIMAGE_MINIMUM);if(typeof u.style.maxHeight!="undefined"){h.css("min-height",a-l+"px")}else{h.css("height",a-l+"px")}return},ResizeContainer:function(){var e=this.container.offset();var c=parseInt(this.container.css("padding-bottom"))+parseInt(this.container.css("padding-top"));var d=e.left*2;var f=e.top*2+c;var a=this.xWindow-d;var b=this.yWindow-f;if(typeof document.getElementById("containerDiv").style.maxHeight!="undefined"){this.container.css("min-height",b+"px")}else{if((a-2)<this.X_CONTAINER_MINIMUM){this.container.width(this.X_CONTAINER_MINIMUM)}else{this.container.css("width",a-2)}this.container.height(b)}},GetWindowSize:function(){if(self.opera){this.xWindow=(window.innerWidth||document.documentElement.clientWidth);this.yWindow=(window.innerHeight||document.documentElement.clientHeight)}else{this.xWindow=(document.documentElement.clientWidth||window.innerWidth);this.yWindow=(document.documentElement.clientHeight||window.innerHeight)}},GetImageId:function(a){if(this.aImages[a]){return this.aImages[a].id}},Share:function(b){var c="http://iloapp."+this.domainName+"/gallery/"+this.galleryLocation+"?Album&album="+this.albumId;var a=this.albumName;switch(b){case"facebook":window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(c)+"&t="+encodeURIComponent(a),"sharer","toolbar=0,status=0,width=626,height=436");break;case"myspace":window.open("http://www.myspace.com/index.cfm?fuseaction=postto&t="+encodeURIComponent(a)+"&c=&u="+encodeURIComponent(c)+"&l=","PostToMyspace","toolbar=0,status=0,width=800,height=650");break;case"linkedin":window.open("http://www.linkedin.com/shareArticle?mini=true&url="+encodeURIComponent(c)+"&title="+encodeURIComponent(a)+"&summary=&source=","share","toolbar=0,status=0,width=626,height=436");break;case"twitter":window.open("http://twitter.com/home?status="+encodeURIComponent(c),"share","toolbar=0,status=0,width=626,height=436");break;default:break}},toString:function(){return"[object Display]"},jQueryCache:{},jQueryGetCache:function(c,b){var d=this;var a=this.jQueryCache[c];if(a&&(new Date()).getTime()-a.time<this.cacheExpiry){b(a.data)}else{jQuery.get(c,function(e){d.jQueryCache[c]={time:(new Date()).getTime(),data:e};b(e)})}},jQueryClearCache:function(){this.jQueryCache={}},setPage:function(a){this.newPage=a;var b=this;this.loadAlbums(function(c){b.Process(c)})},getPage:function(){var f=1;var a=this.newImageIndex;if(a==null&&this.imageId!=null){for(var e=0;e<this.aImages.length;++e){if(this.aImages[e].id==this.imageId){a=e}}this.newImageIndex=a}if(typeof this.albumDescription!="string"){this.albumDescription=""}if(a!=null){var d=1*a+(this.albumDescription?this.numImagesPerPage-this.numImagesShortPage:0);f=Math.floor(d/this.numImagesPerPage)+1}else{if(this.newPage){f=this.newPage}else{f=this.page}}var c=this.aImages.length;var b=Math.ceil((c+(this.albumDescription?this.numImagesPerPage-this.numImagesShortPage:0))/this.numImagesPerPage);if(f>b){f=b}if(f<0){f=0}return f},getAlbumId:function(){var b=this.albumId;if(!b&&this.aAlbums){var c=this.page?this.page:this.getPage();var a=this.aAlbums[(c-1)*this.numAlbumsPerPage];return a?a.id:null}return b},setImage:function(a){this.newImageIndex=a;var c=this;var b=c.GetImageId(a);c.loadAlbum(function(d){c.Process(d);c.isAjaxReady=true})},getCurrentImage:function(){var a=this.newImageIndex!=null?this.newImageIndex:this.imageIndex;if(a&&this.aImages.length>a){return this.aImages[a]}return null},toJSON:function(data){var json={};if(!data.xmlVersion){if(data.split){eval("json = "+data+";")}else{json=data}}else{if($("albums",data).length){json.albums=[];$("album",data).each(function(){json.albums.push({id:parseInt($("id:first",this).text()),name:$("name",this).text(),timeCreated:$("timeCreated",this).text(),privacyLevel:$("privacyLevel",this).text(),spriteIndex:$("spriteIndex",this).text(),numImages:$("numImages",this).text(),editable:($("editable",this).text()=="true")?true:false,deletable:($("deletable",this).text()=="true")?true:false,coverImage:{id:parseInt($("coverImage id:first",this).text()),url:$("coverImage url",this).text(),urlThumbnail:$("coverImage urlThumbnail",this).text(),width:parseInt($("coverImage width",this).text()),height:parseInt($("coverImage height",this).text())}})})}if($("album",data).length){json.album={id:parseInt($("album > id",data).text()),name:$("album > name",data).text(),description:$("description",data).text(),privacyLevel:$("album privacyLevel",data).text(),ownerName:$("ownerName",data).text(),imageCount:$("imageCount",data).text(),embedable:$("embedable",data).text()=="true",downloadable:$("downloadable",data).text()=="true"};if($("album images",data).length){if($("album images",data).length){json.album.images=[];$("album images image",data).each(function(){var image={id:parseInt($("id:first",this).text()),url:$("url",this).text(),urlThumbnail:$("urlThumbnail",this).text(),width:$("width",this).text(),height:$("height",this).text(),spriteIndex:$("spriteIndex",this).text(),caption:$("caption",this).text(),originalId:parseInt($("originalImageId",this).text()),albumId:parseInt($("albumId",this).text()),exif:[],comments:[]};if($("exif",this).length){$("exif value",this).each(function(){image.exif[$(this).attr("variable")]=$(this).text()})}if($("comments",this).length){$("comment",this).each(function(){image.comments.push({id:parseInt($("id",this).text()),postedBy:$("postedBy",this).text(),message:$("message",this).text()})})}json.album.images.push(image)})}}}}return json},loadAlbumsTime:null,loadAlbums:function(a){var b=(new Date()).getTime();if(this.loadAlbumsTime===null){this.loadAlbumsTime=b}if(!this.aAlbums||(b-this.loadAlbumsTime)>this.cacheExpiry){this.loadAlbumsTime=b;this.jQueryGetCache(this.galleryLocation+"?AlbumsJSON",a)}else{a({albums:this.aAlbums})}},loadAlbumTime:null,loadAlbum:function(a){var b=(new Date()).getTime();if(this.loadAlbumTime==null){this.loadAlbumTime=b}if(!this.album||this.album.id!=this.albumId||(b-this.loadAlbumTime)>this.cacheExpiry){this.loadAlbumTime=b;this.jQueryGetCache(this.galleryLocation+"?AlbumJSON&album="+this.albumId,a)}else{a({album:this.album});this.jQueryCache[this.galleryLocation+"?AlbumJSON&album="+this.album.id]={time:b,data:{album:this.album}}}},getNewCaptchaURL:function(){return this.galleryLocation+"?Captcha&"+new Date().getTime()}};function rgbToHex(f){var e=f.match(/rgb\((.+),(.+),(.+)\)/i);if(e==null){return f}var c=parseInt(e[1]),d=parseInt(e[2]),h=parseInt(e[3]);var b=c.toString(16);if(b.length<2){b+=b}var j=d.toString(16);if(j.length<2){j+=j}var a=h.toString(16);if(a.length<2){a+=a}var g="#"+b+j+a;return g}function IsColorDark(a){var b=a.match(/^\#([0-9A-Fa-f]+)$/);a=b[1];red=parseInt(a.substring(0,2),16);green=parseInt(a.substring(2,4),16);if(red<=220||green<=220){return true}else{return false}}function OpenFlashInNewWin(a){var b=window.open(a,"","toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, fullScreen=yes")}function ShowSelectedImage(b,a){$("#slideshowObj").blur();display.newImageIndex=a;display.ShowImage(display.aImages[a]);display.loadAlbum(function(c){display.Process(c);display.isAjaxReady=true})}var textSlider;var oldWidth=464;var oldHeight=348;function TextSlider(){this.halfPI=Math.PI/2;this.step=this.maxSteps;this.aOverlays=new Array();var c=document.getElementById("aboutGalleryAnchor");var g=document.getElementById("aboutMeAnchor");var k=document.getElementById("exifLink");var j=document.getElementById("embedLink");var d=document.getElementById("loginAnchor");var n=$("#userInfoDiv a").get(0);var m=document.getElementById("aboutGalleryDiv");var h=document.getElementById("aboutMeDiv");var a=document.getElementById("exifDiv");var f=document.getElementById("embedDiv");var l=document.getElementById("loginDiv");var o=document.getElementById("unsubscribeDiv");var b=document.getElementById("registerDiv");var e=document.getElementById("welcomeDiv");if(c&&m){this.AddOverlay(c,m)}if(g&&h){this.AddOverlay(g,h)}if(k&&a){this.AddOverlay(k,a)}if(j&&f){this.AddOverlay(j,f)}if(d&&l){this.AddOverlay(d,l)}if(o){this.AddOverlay(false,o)}if(b){if(n){this.AddOverlay(n,b)}else{this.AddOverlay(false,b)}}if(e){this.AddOverlay(false,e)}}TextSlider.prototype={tickSpeed:10,maxSteps:30,Cleanup:function(){$("*").unbind();for(var a in this){this[a]=null}},AddOverlay:function(b,d){if(d.collapsed){d.step=this.maxSteps}else{d.step=0}d.interval=null;d.contentDiv=$("div.content",d).get(0);if(!d.contentDiv){d.contentDiv=d}d.Slide=Slide;var c=this;if(b){b.onclick=function(f){c.Trigger(f);return false}}$("img.overlayCloser",d).click(function(f){c.Trigger(f);return false});var a=new Array(b,d);this.aOverlays[this.aOverlays.length]=a},HideAll:function(){var f=this;var c=false;var e=this.aOverlays.length;for(var b=0,a;a=this.aOverlays[b];b++){var d=a[1];if(!d.collapsed){d.collapsed=true;d.Slide();c=true}}return c},HideAllExceptExif:function(){var f=this;var c=false;var e=this.aOverlays.length;for(var b=0,a;a=this.aOverlays[b];b++){var d=a[1];if(!d.collapsed&&d.id!="exifDiv"){d.collapsed=true;d.Slide();c=true}}return c},Trigger:function(g){g=g||window.event;var f=g.target||g.srcElement;var d=this.aOverlays.length;for(var b=0,a;a=this.aOverlays[b];b++){var c=a[1];if(a[0].id==f.id||!c.collapsed){c.collapsed=!c.collapsed;c.Slide()}}return false},toString:function(){return"[object TextSlider]"}};function Slide(){var c=this;if(this.collapsed){this.step+=1}else{this.step-=1}this.style.display="block";var a=Math.sin(textSlider.halfPI*(this.step/textSlider.maxSteps));var b=a*this.offsetWidth;this.style.left="-"+b+"px";this.contentDiv.style.overflowX="hidden";if(self.opera){this.contentDiv.style.overflow="auto";if(this.id=="exifDiv"||this.id=="loginDiv"){this.contentDiv.style.overflow="hidden"}}if(this.step==0){this.contentDiv.style.overflowY="auto";clearInterval(this.interval);this.interval=null;if(this.id=="loginDiv"){document.getElementById("loginEmailInput").focus();if(jQuery.browser.msie&&jQuery.browser.version==8){$("input","#loginDiv").keydown(function(d){var d=d||window.event;if(d.keyCode==13&&document.getElementById("loginPwdInput").value!=""){this.parentNode.submit();return false}})}}}else{if(this.step==textSlider.maxSteps){this.style.display="none";clearInterval(this.interval);this.interval=null}else{if(this.interval==null){this.interval=setInterval(function(){c.Slide()},textSlider.tickSpeed);if(navigator.userAgent.indexOf("Firefox")!=-1){this.contentDiv.style.overflowY="hidden"}else{this.contentDiv.style.overflowY="auto"}}}}}function SelectEmbedCode(){document.getElementById("embedInput").focus();document.getElementById("embedInput").select()}function SetWidth(b){if(parseInt(b)!=NaN&&parseInt(b)>=200){oldWidth=parseInt(b);var a=document.getElementById("embedHeight").value;if(parseInt(b)<a){a=parseInt(b);document.getElementById("embedHeight").value=a}SetEmbedInput(b,a)}else{document.getElementById("embedWidth").value=oldWidth}SelectEmbedCode()}function SetHeight(a){if(parseInt(a)!=NaN&&parseInt(a)>=200){oldHeight=parseInt(a);var b=document.getElementById("embedWidth").value;if(parseInt(a)>b){b=parseInt(a);document.getElementById("embedWidth").value=b}SetEmbedInput(b,a)}else{document.getElementById("embedHeight").value=oldHeight}SelectEmbedCode()}function Reset(){oldWidth=width=464;oldHeight=height=348;document.getElementById("embedWidth").value=width;document.getElementById("embedHeight").value=height;SetEmbedInput(width,height)}function SetEmbedInput(b,a){if(!display){setTimeout(function(){SetEmbedInput(b,a)},1000);return}document.getElementById("embedInput").value='<object width="'+parseInt(b)+'" height="'+parseInt(a)+'" type="application/x-shockwave-flash" data="http://iloapp.'+display.domainName+"/gallery/swf/embedFlashGallery.swf?albumId="+display.albumId+"&galleryLocation="+display.galleryLocation+"&domainName="+display.domainName+'" name ="embedFlashGallery"><param name="movie" value="http://iloapp.'+display.domainName+"/gallery/swf/embedFlashGallery.swf?albumId="+display.albumId+"&galleryLocation="+display.galleryLocation+"&domainName="+display.domainName+'"/><param name="quality" value="high"/><param name="bgcolor" value="#000000"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><a href="http://'+display.galleryLocation+"."+display.domainName+"/#"+display.albumId+'">http://'+display.galleryLocation+"."+display.domainName+"/#"+display.albumId+"</a></object>"}function ImageUpload(c){this.albumId=c.albumId;this.aGroups=c.aGroups;this.authFlash=c.authFlash;this.domContainer=c.domContainer;this.domHelpText=c.domHelpText;this.domBrowseBtn=c.domBrowseBtn;this.domUploadBtn=c.domUploadBtn;this.domBatchList=c.domBatchList;this.domForm=c.domForm;this.domZoomSlider=c.domZoomSlider;this.wZoomSlider=$(this.domZoomSlider).width()-13;this.moreOptionsAnchor=$("#moreOptionsAnchor");this.moreOptionsDiv=$("#moreOptionsDiv");this.defaultSettingAnchor=$("#defaultSettingAnchor");this.defaultSettingDiv=$("#defaultSettingDiv");this.zoomSlider=$("#zoomSliderDiv img");this.aLangs=c.aLangs;this.isIE=jQuery.browser.msie;var b=this;b.GetImageList();document.getElementById("batchSubmitBtn").disabled=true;if(this.authFlash){this.swfu=new SWFUpload({button_placeholder_id:"uploadImageBtn",button_window_mode:"transparent",button_width:90,button_height:18,upload_url:"../"+galleryLocation+"?UploadImage"+this.authFlash,flash_url:"swf/swfupload.swf",file_size_limit:25165824,file_types:"*.jpg;*.jpeg;*.png;*.gif;*.JPG;*.JPEG;*.PNG;*.GIF",file_types_description:"Image files",swfupload_loaded_handler:function(){$(".swfupload").css("position","absolute");document.getElementById("batchSubmitBtn").disabled=false;$("#uploadImageInput").remove();$(b.domBatchList).unbind("click");b.domBatchList.onclick=function(g){var g=g||window.event;var f=g.target||g.srcElement;if(f.tagName.toLowerCase()=="a"){var d=f.id.slice(4,f.id.length);b.swfu.cancelUpload(d);b.domBatchList.removeChild(f)}return false}},file_queued_handler:function(d){b.QueueFile(d)},upload_start_handler:function(d){b.StartUpload(d);return true},upload_progress_handler:function(d,e){b.UpdateProgress(d,e)},upload_success_handler:function(d,e){b.SaveServerData(d,e)},upload_complete_handler:function(d){b.CompleteUpload(d)},upload_error_handler:function(e,f,d){b.HandleError(e,f,d)},debug:false})}this.items=$(this.domContainer).children();this.items.wrap('<div class="'+this.CLASS_SORTABLE_ITEM+'"></div');this.items.addClass(this.CLASS_SORTABLE_ITEM);document.getElementById("uploadImageInput").onchange=function(){var d=document.createElement("a");d.id="fileSelected";d.href="#";d.className="imageFile";d.innerHTML=b.aLangs.image;b.domBatchList.appendChild(d);document.getElementById("batchSubmitBtn").disabled=false};b.domBatchList.onclick=function(f){var f=f||window.event;var d=f.target||f.srcElement;if(d.id=="fileSelected"){document.getElementById("batchSubmitBtn").disabled=true;b.domBatchList.removeChild(d)}return false};$("#permissionsDiv input").click(function(){var d;switch(this.value){case"public":d="public";$('input[name="groupView[]"]').attr("checked",true);$('input[name="groupView[]"]').attr("disabled",true);$('input[name="groupEdit[]"]').attr("disabled","");break;case"private":d="private";$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("disabled","");break;case"hidden":d="hidden";$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("checked",false);$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("disabled","disabled");break;case"mixed":$('input[name="groupView[]"]').attr("disabled","");if(b.albumId==null){jQuery.get(galleryLocation+"?UploadHelperXML",function(e){b.UpdateGroupSelections(e)})}else{jQuery.get(galleryLocation+"?UploadHelperXML",{album:b.albumId},function(e){b.UpdateGroupSelections(e)})}default:break}if(d!=null){if(b.albumId==null){jQuery.post(galleryLocation+"?UploadHelperXML",{allPrivacy:d,"image-ids[]":b.aImageIds},function(e){b.UpdateThumbnails(e)})}else{jQuery.post(galleryLocation+"?UploadHelperXML&album="+b.albumId,{allPrivacy:d,"image-ids[]":b.aImageIds},function(e){b.UpdateThumbnails(e)})}}});$('input[name="groupEdit[]"]').click(function(){if(this.checked){$('input[name="groupView[]"]',$(this).parents("tr")).attr("checked",true)}});$('input[name="groupView[]"]').click(function(){if(!this.checked){$('input[name="groupEdit[]"]',$(this).parents("tr")).attr("checked",false)}});$("#albumGroupSettingsDiv").click(function(h){if(h.target.tagName.toLowerCase()!="a"){return}var g=h.target;var f=parseInt(g.href.match(/\d+$/));if(b.aGroups[f]){b.group=b.aGroups[f]}else{return false}b.ClearPopup();$('.jsPopup input[name="groupName"]').attr("value",b.group.name);for(var d in b.group.aUserIds){$('.jsPopup input[name="groupUsers['+b.group.aUserIds[d]+']"]').attr("checked",true)}b.ShowPopup(document.getElementById("jsGroupPopupDiv"),300,400);return false});$("#newGroupBtn").click(function(){b.group=new Object();b.group.id="new";b.ClearPopup();b.ShowPopup(document.getElementById("jsGroupPopupDiv"),300,400)});$('#jsGroupPopupDiv input[name="update"]').click(function(){var f=$('input[name="groupName"]',this.domGroupPopup).attr("value");if(f.length==0){return false}var d=new Array();$("#jsGroupPopupDiv input.groupUsers").each(function(){if(this.checked){d.push(this.value)}});var e={update:"update",groupName:f,"groupUsers[]":d};if(b.group.id=="new"){e.newgroup="true"}jQuery.post(galleryLocation+"?UserManager&show=ajax&group="+b.group.id,e,function(j){if(j=="ERROR"){alert("Error saving changes")}else{if(b.group.id=="new"){var g=j;b.aGroups.splice(g,0,{id:g,name:f,aUserIds:d});var k='<tr id="groupRow'+g+'"><td class="textColumn"><a href="#'+g+'">'+f;k+=" ("+d.length+")</a></td>";k+='<td class="inputColumn"><input type="checkbox" name="groupView[]" value="'+g+'"/></td>';k+='<td class="inputColumn"><input type="checkbox" name="groupEdit[]" value="'+g+'"/></td>';k+="</tr>";$("#albumGroupSettingsDiv table").append(k)}else{b.aGroups[b.group.id].aUserIds=d;var h=$("#groupRow"+b.group.id);$("td.textColumn a",h).text(b.group.name+" ("+d.length+")")}b.HidePopup()}});return false});$("#coverDiv").click(function(){b.HidePopup()});$(".jsPopup .closeBtn").click(function(){b.HidePopup()});$('#jsGroupPopupDiv input[name="cancel"]').click(function(){b.HidePopup();return false});this.domZoomSlider.ondragstart=function(){return false};this.domZoomSlider.onmousedown=function(h){b.zoomSlider.attr("movable","true");h=h||window.event;b.xMouseStart=(h.pageX||h.clientX);b.xCaretStart=parseInt(b.zoomSlider.css("left"));var d=b.zoomSlider.offset().left;var f=b.xMouseStart-d;var g=b.xCaretStart+f;if(g<0){g=0}else{if(g>b.wZoomSlider){g=b.wZoomSlider}}b.zoomSlider.css("left",g+"px");b.xCaretStart=g;if(h.preventDefault){h.preventDefault();h.stopPropagation()}return false};this.domZoomSlider.onmousemove=function(g){if(b.zoomSlider.attr("movable")!="true"){return}g=g||window.event;var d=(g.pageX||g.clientX);var f=d-b.xMouseStart+b.xCaretStart;if(f<0){f=0}else{if(f>b.wZoomSlider){f=b.wZoomSlider}}b.zoomSlider.css("left",f+"px");if(g.preventDefault){g.preventDefault();g.stopPropagation()}};this.domZoomSlider.onclick=function(f){f=f||window.event;var d=(f.pageX||f.clientX)};this.domContainer.ondragstart=function(){return false};this.domContainer.onmouseover=function(k){k=k||window.event;var g=k.target||k.srcElement;var l=$(g);if(!l.hasClass(b.CLASS_SORTABLE_ITEM)||g.tagName.toLowerCase()!="img"||b.domDragItem!=null){return}if(l.width()<128){return}var j=l.siblings(".optionsText");if(j.length>0){j.stop();j.animate({height:"20px",top:"114px"},"fast");j.animate({height:"18px",top:"116px"},"fast");return}var d=document.createElement("div");var m=document.createElement("a");var f=$(d);var h=$(m);d.className="optionsText";d.style.height="0px";m.href="#";m.className="optionsText";m.innerHTML=b.aLangs.photoOptions;m.style.height="0px";l.after(d);l.after(m);f.animate({height:"20px",top:"114px"},"fast");h.animate({height:"20px",top:"114px"},"fast");f.animate({height:"18px",top:"116px"},"fast");h.animate({height:"18px",top:"116px"},"fast");var n=g.parentNode;n.onmouseout=function(p){p=p||window.event;var o=p.relatedTarget;while(o&&o!=n){try{o=o.parentNode}catch(e){o=g}}if(o==n){return true}f.stop();h.stop();f.animate({height:"0px",top:"134px"},"normal");h.animate({height:"0px",top:"134px"},"normal",function(){h.remove();f.remove()})}};this.domContainer.onclick=function(g){g=g||window.event;var d=g.target||g.srcElement;var f=$(d);if(d.tagName.toLowerCase()=="img"&&f.hasClass("editThumbnail")){b.ShowImageDetails(d)}else{if(f.hasClass("optionsText")){d=f.siblings("img.editThumbnail").get(0);b.ShowImageDetails(d);return false}}};var a=$("#tagListDiv");$("#tagsInput").keyup(function(){var l=this.value;var k=l.split(",");var j=jQuery.trim(k[k.length-1]);a.empty();if(j===""){return}var g=b.aTags.length;var h=0;for(var f=0;f<g;f++){var d=b.aTags[f];var e=d.slice(0,j.length);if(e>j||h>=5){break}else{if(e==j){a.append('<a href="#">'+d+"</a>");h++}}}});a.click(function(k){k=k||window.event;var j=k.target||k.srcElement;if(j.tagName.toLowerCase()!="a"){return false}var d=j.innerHTML;var g=document.getElementById("tagsInput");var l=g.value;var h=l.split(",");h[h.length-1]=d;for(var f=0,d;d=h[f];f++){h[f]=jQuery.trim(d)}g.value=h.join(", ");return false});this.domContainer.onmousedown=function(d){b.StartThumbnailDrag(d)};document.onmousemove=function(d){b.ContinueThumbnailDrag(d)};document.onmouseup=function(g){b.StopThumbnailDrag(g);b.zoomSlider.attr("movable","false");var h=$("img.editThumbnail");var f=$("div.editThumbnail");var d=parseInt(b.zoomSlider.css("left"));if(d<33){b.zoomSlider.css("left","0px");h.css("width","64px");h.css("height","64px");f.css("margin-bottom","0px");b.zoom=b.ZOOM_MIN;$(".privacyLevel, .caption").css("display","none")}else{if(d>=33&&d<=66){b.zoomSlider.css("left","50px");h.css("width","96px");h.css("height","96px");f.css("margin-bottom","0px");b.zoom=b.ZOOM_MID;$(".privacyLevel, .caption").css("display","none")}else{b.zoomSlider.css("left",b.wZoomSlider+"px");h.css("width","128px");h.css("height","128px");f.css("margin-bottom","10px");b.zoom=b.ZOOM_MAX;$(".privacyLevel, .caption").css("display","block")}}};if(this.authFlash){this.domUploadBtn.onclick=function(){b.swfu.startUpload();return false}}document.getElementById("tabList").onclick=function(f){f=f||window.event;var d=f.target||f.srcElement;switch(d.id){case"privacyTabLink":$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#privacyTabLink").addClass("active");$("#privacyTabDiv").css("display","block");break;case"captionTabLink":$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#captionTabLink").addClass("active");$("#captionTabDiv").css("display","block");break;case"coverTabLink":$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#coverTabLink").addClass("active");$("#coverTabDiv").css("display","block");break;case"tagsTabLink":$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#tagsTabLink").addClass("active");$("#tagsTabDiv").css("display","block");default:break}return false};this.defaultSettingAnchor.click(function(){b.defaultSettingDiv.toggle();return false});this.moreOptionsAnchor.click(function(){if(b.moreOptionsDiv.css("display")=="none"){b.moreOptionsAnchor.removeClass("moreOptionsPlus");b.moreOptionsAnchor.addClass("moreOptionsMinus");b.moreOptionsDiv.animate({opacity:1,height:"toggle"},"fast")}else{b.moreOptionsAnchor.removeClass("moreOptionsMinus");b.moreOptionsAnchor.addClass("moreOptionsPlus");b.moreOptionsDiv.animate({opacity:0,height:"toggle"},"fast")}return false});this.domForm.onsubmit=function(){for(var f=0,e;e=b.aImageIds[f];f++){var d=document.createElement("input");d.type="hidden";d.name="image-ids[]";d.value=e;b.domForm.appendChild(d)}return true}}ImageUpload.prototype={SRC_UNAVAILABLE_IMG:"Images/system/private_image.gif",CLASS_SORTABLE_ITEM:"editThumbnail",X_OFFSET:5,Y_OFFSET:5,ZOOM_MIN:"min",ZOOM_MID:"mid",ZOOM_MAX:"max",ROTATE_CW:"cw",ROTATE_CCW:"ccw",animation:{width:0,marginLeft:0,marginRight:0,borderLeft:0,borderRight:0},galleryLocation:null,albumId:null,aImageIds:new Array(),aErrors:new Array(),domContainer:null,domHelpText:null,domLoadIcon:null,domBrowseBtn:null,domUploadBtn:null,domBatchList:null,zoom:this.ZOOM_MAX,Cleanup:function(){$("*").unbind();for(var a in this){this[a]=null}},GetImageList:function(){if(!window.ActiveXObject&&this.domLoadIcon){this.domLoadIcon.style.display="none"}var a=this;if(this.albumId==null){jQuery.get(galleryLocation+"?UploadHelperXML",function(b){a.UpdateThumbnails(b)})}else{jQuery.get(galleryLocation+"?UploadHelperXML",{album:this.albumId},function(b){a.UpdateThumbnails(b)})}},UpdateThumbnails:function(x){var g=$("image",x);var p=g.length;var b=0;groupInputDisabled=false;var q=$("albumPrivacy",x);if(q.length){$("#permissionsDiv input").attr("checked",false);q=q.text();switch(q){case"private":document.getElementById("permPrivateInput").checked=true;$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("disabled","");break;case"hidden":document.getElementById("permHiddenInput").checked=true;$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("checked",false);$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("disabled","disabled");groupInputDisabled=true;break;case"mixed":document.getElementById("permMixedInput").checked=true;$('input[name="groupView[]"], input[name="groupEdit[]"]').attr("disabled","");break;case"public":default:document.getElementById("permPublicInput").checked=true;$('input[name="groupView[]"]').attr("checked",true);$('input[name="groupView[]"]').attr("disabled",true);$('input[name="groupEdit[]"]').attr("disabled","");break}}if(p<1){this.domContainer.innerHTML='<span class="error">'+aLangs.noImages+".</span>";this.domHelpText.style.display="none";return}this.aImageIds=new Array();this.domContainer.innerHTML="";var h,l,u,o;if(this.zoom==this.ZOOM_MIN){h=l="64px";u="0px";o=false}else{if(this.zoom==this.ZOOM_MID){h=l="96px";u="0px";o=false}else{h=l="128px";u="10px";o=true}}for(var t=0;t<p;t++){var n=g[t];var v=$("id",n).text();var A=$("square",n).text();var k=$("caption",n).text();var z=$("privacy",n).text();var w=$("isCover",n).text();var j=$("tags",n).text();if(!v){continue}var r=document.createElement("div");var d=document.createElement("img");var c=document.createElement("input");var a=document.createElement("div");var m=document.createElement("input");r.imageId=v;r.className=this.CLASS_SORTABLE_ITEM;r.style.marginBottom=u;m.type="button";m.className="button caption";c.type="button";c.className="button privacyLevel";a.className="privacyLevel";var f=this;m.onclick=function(){var B=$(this).siblings("img.editThumbnail").get(0);f.ShowImageDetails(B,"caption")};c.onclick=function(){var B=$(this).siblings("img.editThumbnail").get(0);f.ShowImageDetails(B,"privacy")};this.aImageIds[t]=v;d.imageId=v;d.alt="Image "+v;d.title="";d.index=t;d.style.width=h;d.style.height=l;if(A){d.src=A}else{d.src=SRC_UNAVAILABLE_IMG}if(k){d.caption=k;if(k.length>18){k=k.slice(0,17)+"..."}m.value=k;m.style.fontStyle="normal"}else{d.caption="";m.value=this.aLangs.addCaption;m.style.fontStyle="italic"}if(z){d.privacyLevel=z;if(z=="public"){c.value=this.aLangs.pvcyPublic}else{if(z=="private"){c.value=this.aLangs.pvcyPrivate}else{c.value=this.aLangs.pvcyHidden;if(!groupInputDisabled){$('input[name="groupEdit[]"]').attr("checked",false);$('input[name="groupEdit[]"]').attr("disabled","disabled");groupInputDisabled=true}}}}else{d.privacyLevel="";c.value="Privacy"}if(w&&w=="true"){d.isCover=true}else{d.isCover=false}if(j){d.tags=j}else{d.tags=""}d.className=this.CLASS_SORTABLE_ITEM;if(t==(p-1)){d.className+=" last"}r.appendChild(d);if(o){r.insertBefore(a,d);r.insertBefore(c,d);r.appendChild(m)}this.domContainer.appendChild(r)}if(p>0){this.domHelpText.style.display="block"}this.aTags=new Array();var j=$("tag",x);var e=j.length;var y;for(var t=0;t<e;t++){y=j[t];this.aTags[t]=y.textContent}},UpdateGroupSelections:function(d){var b=$("image",d);var a=false;for(var c=0,e;e=b[c];c++){if($("privacy",e).text()=="hidden"){$('input[name="groupEdit[]"]').attr("checked",false);$('input[name="groupEdit[]"]').attr("disabled","disabled");a=true;break}}if(!a){$('input[name="groupEdit[]"]').attr("disabled","")}},ShowPopup:function(j,a,n){var g=document.innerHeight||document.documentElement.clientHeight;var k=document.getElementById("editAlbumDiv");var b=$(k).offset();var m=b.top;var e=b.left;var h=k.offsetWidth;var f=k.offsetHeight;j.style.position="absolute";var d=(g-n)/2+(document.documentElement.scrollTop||document.body.scrollTop);var c=(h-a)/2+e;j.style.top=d+"px";j.style.left=c+"px";var l=document.getElementById("coverDiv");l.style.position="absolute";l.style.top=m+"px";l.style.left=e+"px";l.style.width=h+"px";l.style.height=f+"px";if(!this.isIE){$(l).fadeIn("fast");$(j).fadeIn("fast",function(){$('input[type="text"]',j).get(0).focus()})}else{l.style.display="block";j.style.display="block";$('input[type="text"]',j).get(0).focus()}},HidePopup:function(){$(".jsPopup").fadeOut("fast");$("#coverDiv").fadeOut("fast")},ClearPopup:function(){$('.jsPopup input[type="text"]').attr("value","");$('.jsPopup input[type="checkbox"]').attr("checked",false)},ShowImageDetails:function(q,g){var r=document.innerHeight||document.documentElement.clientHeight;var e=document.getElementById("editAlbumDiv");var C=$(e).offset();var b=C.top;var h=C.left;var d=e.offsetWidth;var k=e.offsetHeight;var f=document.getElementById("jsImageDetailsDiv");f.imageId=q.imageId;f.linkedApps=q.linkedApps;f.style.position="absolute";var j=(r-200)/2+(document.documentElement.scrollTop||document.body.scrollTop);var B=(d-600)/2+h;f.style.top=j+"px";f.style.left=B+"px";var y=document.getElementById("detailImage");y.src=q.src;var x=document.getElementById("captionInput");x.value=q.caption;if(q.privacyLevel=="public"){document.getElementById("imagePermPublic").checked=true}else{if(q.privacyLevel=="private"){document.getElementById("imagePermPrivate").checked=true}else{if(q.privacyLevel=="hidden"){document.getElementById("imagePermHidden").checked=true}}}var t=document.getElementById("isCoverInput");if(q.isCover){t.checked=true}else{t.checked=false}$("#tagListDiv").empty();var v=document.getElementById("tagsInput");v.value=q.tags;var p=document.getElementById("rotateCCWBtn");p.alt=aLangs.rotateLeft;p.title=aLangs.rotateLeft;var c=document.getElementById("rotateCWBtn");c.alt=aLangs.rotateRight;c.title=aLangs.rotateRight;var o=document.getElementById("closeBtn");var n=document.getElementById("deleteBtn");var w=document.getElementById("submitBtn");var u=document.getElementById("prevBtn");var a=document.getElementById("nextBtn");var A=document.getElementById("p");var z=document.getElementById("coverDiv");z.style.position="absolute";z.style.top=b+"px";z.style.left=h+"px";z.style.width=d+"px";z.style.height=k+"px";if(!this.isIE){$(z).fadeIn("fast");$(f).fadeIn("fast")}else{z.style.display="block";f.style.display="block"}switch(g){case"privacy":$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#privacyTabLink").addClass("active");$("#privacyTabDiv").css("display","block");break;case"caption":default:$(".jsTab").css("display","none");$("#tabList a").removeClass("active");$("#captionTabLink").addClass("active");$("#captionTabDiv").css("display","block");break}var m=this;c.onclick=function(){m.Rotate(m.ROTATE_CW)};p.onclick=function(){m.Rotate(m.ROTATE_CCW)};if(q.linkedApps>0){n.onclick=function(){var D=aLangs.delImageExist+" "+f.linkedApps;D+=" "+aLangs.delImageForce;A.innerHTML=D;n.onclick=function(){m.DeleteImage();m.HideImageDetails()}}}else{n.onclick=function(){m.DeleteImage();m.HideImageDetails()}}var l=document.getElementById("activityImg");w.onclick=function(){l.style.display="inline";m.SubmitDetails("update","");m.HideImageDetails()};u.onclick=function(){l.style.display="inline";m.SubmitDetails("prev",q.imageId)};a.onclick=function(){l.style.display="inline";m.SubmitDetails("next",q.imageId)}},HideImageDetails:function(){var a=document.getElementById("jsImageDetailsDiv");var b=document.getElementById("coverDiv");if(!this.isIE){$(b).fadeOut("fast");$(a).fadeOut("fast")}else{$(".jsTab").css("display","none");b.style.display="none";a.style.display="none"}},ShowNextImage:function(k,c){var b=this;var h;for(i=0;i<this.aImageIds.length;i++){if(this.aImageIds[i]==c){h=i}}if(k=="prev"){var j=h-1;if(j<0){j=this.aImageIds.length-1}}if(k=="next"){var j=h+1;if(j>=this.aImageIds.length){j=0}}domTarget=$($(this.domContainer).children().get(j)).children("img").get(0);var d=document.getElementById("jsImageDetailsDiv");d.imageId=domTarget.imageId;d.linkedApps=domTarget.linkedApps;var f=document.getElementById("detailImage");f.src=domTarget.src;var n=document.getElementById("captionInput");n.value=domTarget.caption;if(domTarget.privacyLevel=="public"){document.getElementById("imagePermPublic").checked=true}else{if(domTarget.privacyLevel=="private"){document.getElementById("imagePermPrivate").checked=true}else{if(domTarget.privacyLevel=="hidden"){document.getElementById("imagePermHidden").checked=true}}}var a=document.getElementById("isCoverInput");if(domTarget.isCover){a.checked=true}else{a.checked=false}var m=document.getElementById("tagsInput");m.value=domTarget.tags;$("#tagListDiv").empty();if($("#captionTabDiv").css("display")!="none"){n.focus()}else{if($("#tagTabDiv").css("display")!="none"){m.focus()}}var g=document.getElementById("prevBtn");var e=document.getElementById("nextBtn");var l=document.getElementById("activityImg");g.onclick=function(){l.style.display="inline";b.SubmitDetails("prev",domTarget.imageId)};e.onclick=function(){l.style.display="inline";b.SubmitDetails("next",domTarget.imageId)};l.style.display="none"},StartThumbnailDrag:function(d){d=d||window.event;var b=d.target||d.srcElement;var c=$(b);if(!c.hasClass(this.CLASS_SORTABLE_ITEM)){return}var a=c.parents("."+this.CLASS_SORTABLE_ITEM);if(a.length){c=a;b=a.get(0)}this.domOriginalItem=b;this.domDragItem=document.createElement("img");this.domDragItem.src=c.children("img").get(0).src;this.domDragItem.className="editThumbnail jsDragClone";document.body.appendChild(this.domDragItem);if(d.preventDefault){d.preventDefault();d.stopPropagation()}},ContinueThumbnailDrag:function(g){g=g||window.event;var c=g.target||g.srcElement;if(this.domDragItem==null){return}var j=this.domDragItem.style;j.display="block";$(".optionsText").remove();$(this.domOriginalItem).css("opacity","0.4");var b=(g.pageX||g.clientX);var f=(g.pageY||g.clientY);if(document.all){j.top=f+(document.documentElement.scrollTop)+this.Y_OFFSET+"px";j.left=b+(document.documentElement.scrollLeft||document.body.scrollLeft)+this.X_OFFSET+"px"}else{j.top=f+this.Y_OFFSET+"px";j.left=b+this.X_OFFSET+"px"}var h=$(c);if(h.hasClass(this.CLASS_SORTABLE_ITEM)){var d=h.parents("."+this.CLASS_SORTABLE_ITEM);if(d.length){h=d;c=d.get(0)}if(this.IsMouseOnLeft(c,b)){c.style.paddingLeft="10px";c.style.paddingRight="0px";h.children(".privacyLevel").css("right","1px");var k=h.prev();k.css("padding-left","0px");k.css("padding-right","10px");k.children(".privacyLevel").css("right","11px")}else{c.style.paddingLeft="0px";c.style.paddingRight="10px";h.children(".optionsText, .privacyLevel").css("right","11px");var l=h.next();l.css("padding-left","10px");l.css("padding-right","0px");l.children(".privacyLevel").css("right","1px")}var a=this;c.onmouseout=function(){c.style.paddingLeft="5px";c.style.paddingRight="5px";h.children(".optionsText, .privacyLevel").css("right","6px");var e=h.next();e.css("padding-left","5px");e.css("padding-right","5px");e.children(".privacyLevel").css("right","6px");var m=h.prev();if(m.length&&m.get(0).className==a.CLASS_SORTABLE_ITEM){m.css("padding-left","5px");m.css("padding-right","5px");m.children(".privacyLevel").css("right","6px")}}}},StopThumbnailDrag:function(h){h=h||window.event;var f=h.target||h.srcElement;var g=$(f);if(!this.domDragItem){return}if(this.domDragItem){$(this.domDragItem).remove();this.domDragItem=null}this.items=$(this.domContainer).children();this.items.css({paddingLeft:"5px",paddingRight:"5px",opacity:""});$(".privacyLevel").css("right","6px");if(!g.hasClass(this.CLASS_SORTABLE_ITEM)||f.imageId==this.domOriginalItem.imageId){return}var c=g.parents("."+this.CLASS_SORTABLE_ITEM);if(c.length){g=c;f=c.get(0)}var b=this.items.index(this.domOriginalItem);var d;var j=this.aImageIds[b];this.aImageIds.splice(b,1);var a=(h.pageX||h.clientX);if(this.IsMouseOnLeft(f,a)){g.before(this.domOriginalItem);d=this.items.index(f);if(d>b){d--}}else{g.after(this.domOriginalItem);d=this.items.index(f);if(d<b){d++}}this.aImageIds.splice(d,0,j)},QueueFile:function(a){var b=document.createElement("a");b.id="file"+a.id;b.href="#";b.className="imageFile";b.innerHTML=a.name;this.domBatchList.appendChild(b)},StartUpload:function(a){this.uploading=true;return true},UpdateProgress:function(e,g){var h=g/e.size;var a=document.getElementById("jsStatusPara");if(!a){a=document.createElement("p");a.id="jsStatusPara";$("#uploadDiv").before(a)}$("#uploadDiv p").css("display","none");a.innerHTML=aLangs.uploading+": "+e.name;if(h==1){var d=document.createElement("img");d.id="loadingImgEdit";d.className="loadingEdit";d.src="Images/system/transparent.gif";this.domContainer.appendChild(d)}var c=document.getElementById("progressDiv");var j=document.getElementById("progressBar");var f=document.getElementById("closeAnchor");if(!c){c=document.createElement("div");c.id="progressDiv";j=document.createElement("div");j.id="progressBar";f=document.createElement("a");f.id="closeAnchor";f.href="#";var b=this;f.onclick=function(n){n=n||window.event;var m=n.target||n.srcElement;if(m.tagName.toLowerCase()!="a"){return}b.swfu.stopUpload();b.swfu.cancelUpload();b.uploading=false;b.domBrowseBtn.style.display="inline";b.domUploadBtn.style.display="inline";var l=document.getElementById("editThumbnailsDiv");var k=document.getElementById("loadingImgEdit");if(k){l.removeChild(k)}return false};$("#editThumbnailsDiv span.error").css("display","none");a.appendChild(f);c.appendChild(j);a.appendChild(c)}this.domBrowseBtn.style.display="none";this.domUploadBtn.style.display="none";j.style.width=Math.floor(h*c.offsetWidth)+"px";location.hash="#"+Math.floor(h*c.offsetWidth)+"px"},SaveServerData:function(a,b){if(b!=null&&b.match(/NOT OK/)){this.HandleError(a,-250)}return},CompleteUpload:function(e){this.GetImageList();var f=document.getElementById("file"+e.id);$(f).remove();var a=document.getElementById("jsStatusPara");if(document.getElementById("progressDiv")){a.removeChild(document.getElementById("progressDiv"))}if(this.swfu.getStats().files_queued>0&&this.uploading){this.swfu.startUpload()}else{this.uploading=false;$(a).remove();this.domBrowseBtn.style.display="inline";this.domUploadBtn.style.display="inline";$("#uploadDiv p").css("display","block");if(this.aErrors.length>20){alert(aLangs.errorLots)}else{if(this.aErrors.length>0){var d=aLangs.errorSome+":\r\n";for(var c=0,b;b=this.aErrors[c];c++){d+=b+"\r\n"}alert(d)}}this.aErrors=new Array()}},DeleteImage:function(){var b=document.getElementById("notifyArea");b.innerHTML="";if(confirm(aLangs.delConfirm)){var a=document.getElementById("jsImageDetailsDiv");var f=document.getElementById("coverDiv");var d=a.imageId;var c=0,d;while(d!=this.aImageIds[c]){c++}this.aImageIds.splice(c,1);var e=this;if(this.albumId==null){jQuery.post(galleryLocation+"?UploadHelperXML&image="+d,{"delete":"true","image-ids[]":this.aImageIds},function(g){e.UpdateThumbnails(g)})}else{jQuery.post(galleryLocation+"?UploadHelperXML&album="+this.albumId+"&image="+d,{"delete":"true","image-ids[]":this.aImageIds},function(g){e.UpdateThumbnails(g)})}}},SubmitDetails:function(e,c){var e=e;var c=c;var d=document.getElementById("jsImageDetailsDiv");var j=document.getElementById("coverDiv");var k=document.getElementById("captionInput").value;var a=document.getElementById("isCoverInput");var f,h;var l=document.getElementById("tagsInput").value;var c=d.imageId;if(document.getElementById("imagePermPublic").checked){f="public"}else{if(document.getElementById("imagePermPrivate").checked){f="private"}else{if(document.getElementById("imagePermHidden").checked){f="hidden"}}}if(a.checked){h="true"}else{h="false"}var b=this;if(this.albumId==null){jQuery.post(galleryLocation+"?UploadHelperXML&image="+c,{caption:k,privacy:f,isCover:h,tags:l,"image-ids[]":this.aImageIds},function(m){b.UpdateThumbnails(m);if(e!=="update"){b.ShowNextImage(e,c)}})}else{jQuery.post(galleryLocation+"?UploadHelperXML&album="+this.albumId+"&image="+c,{caption:k,privacy:f,isCover:h,tags:l,"image-ids[]":this.aImageIds},function(m){b.UpdateThumbnails(m);if(e!=="update"){b.ShowNextImage(e,c)}})}if(e=="update"){var g=document.getElementById("activityImg");g.style.display="none"}},Rotate:function(c){var a=document.getElementById("jsImageDetailsDiv");var b=this;if(this.albumId==null){jQuery.post(galleryLocation+"?UploadHelperXML&image="+a.imageId,{rotate:c,"image-ids[]":this.aImageIds},function(d){b.RefreshDetailImage(d,a.imageId);b.UpdateThumbnails(d)})}else{jQuery.post(galleryLocation+"?UploadHelperXML&album="+this.albumId+"&image="+a.imageId,{rotate:c,"image-ids[]":this.aImageIds},function(d){b.RefreshDetailImage(d,a.imageId);b.UpdateThumbnails(d)})}},RefreshDetailImage:function(e,c){var f=document.getElementById("detailImage");var h=$("error",e);if(h.length>0){h=h.get(0);var j=$("error-id",h).text();var a=$("error-image-id",h).text();if(a==c){var b=document.getElementById("errorSpan");if(b){b.innerHTML=""}else{b=document.createElement("span");b.id="errorSpan";b.className="error";f.parentNode.insertBefore(b,f)}if(j=="INVALID_IMAGE_ROTATE"){b.innerHTML=aLangs.errorRotate}}}var g=$("image[selected]",e);if(!g.length){return null}var d=$("square",g).text();f.src=d},HandleError:function(b,c,a){if(c==-280||c==-290){return}this.aErrors.push(b.name)},IsMouseOnLeft:function(c,a){var d=$(c);var b=d.offset().left;var e=d.width();if(a<=b+e/2){return true}else{return false}},toString:function(){return"[Object ImageUpload]"}};function resize_sidepanel(){if(document.all&&document.noResize){return}var d=document.getElementById("albumInfoDiv");var c=document.getElementById("editAlbumDiv");var b=parseInt($(d).css("padding-top"))+parseInt($(d).css("padding-bottom"));var a=parseInt($(c).css("border-top-width"))+parseInt($(c).css("border-bottom-width"));if(typeof d.style.maxHeight!="undefined"){d.style.minHeight=c.offsetHeight-b-a+"px"}else{d.style.height=c.offsetHeight-b-a+"px"}}function resize_container(){if(document.all&&document.noResize){return}var a=document.getElementById("containerDiv");if(a){if(typeof a.style.maxHeight!="undefined"){a.style.minHeight=$(window).height()-67+"px"}else{a.style.height=(document.innerHeight||document.documentElement.clientHeight)-67+"px";if(a.offsetWidth<950){a.style.width="950px"}else{a.style.width="auto"}}document.noResize=true;setTimeout(function(){document.noResize=false},50)}}var swfu;var uploading=false;var batchListDiv;var aErrors=new Array();function FlashUpload(a){$(".swfFallback").addClass("swfUploadUI");swfu=new SWFUpload({upload_url:"../"+galleryLocation+"?UploadImage"+a,flash_url:"swf/swfupload_f9.swf",file_size_limit:8388608,file_types:"*.jpg;*.jpeg;*.png;*.gif",file_types_description:"Image files",swfupload_element_id:"swfUploadUI",degraded_element_id:"swfFallback",swfupload_loaded_handler:GetImageList,file_queued_handler:QueueFile,upload_start_handler:StartUpload,upload_progress_handler:UpdateProgress,upload_success_handler:SaveServerData,upload_complete_handler:CompleteUpload,upload_error_handler:HandleError,debug:false});swfu.customSettings.notLoaded=true;setTimeout(function(){if(swfu.customSettings.notLoaded){$(".swfFallback").removeClass("swfUploadUI")}},1000);batchListDiv=$("#batchListDiv");batchListDiv.click(function(f){f=f||event;var d=f.target||f.srcElement;if(d.tagName.toLowerCase()!="a"){return}var b=d.id;var c=document.getElementById(b);swfu.cancelUpload(b.substring(4));$(c).remove();return false});document.getElementById("browseBtn").onclick=function(){swfu.selectFiles();return false};document.getElementById("batchSubmitBtn").onclick=function(){swfu.startUpload();return false}}function QueueFile(a){var b=document.createElement("a");b.id="file"+a.id;b.href="#";b.className="imageFile";b.innerHTML=a.name;batchListDiv.append(b);ResizeSidePanel()}function StartUpload(a){uploading=true;return true}function UpdateProgress(d,f){var g=f/d.size;var a=document.getElementById("jsStatusPara");if(!a){a=document.createElement("p");a.id="jsStatusPara";$("#uploadDiv").before(a)}$("#uploadDiv p").css("display","none");a.innerHTML=aLangs.uploading+": "+d.name;if(g==1){var h=document.getElementById("editThumbnailsDiv");var c=document.createElement("img");c.id="loadingImgEdit";c.className="loadingEdit";c.src="Images/system/transparent.gif";h.appendChild(c);ResizeSidePanel()}var b=document.getElementById("progressDiv");var j=document.getElementById("progressBar");var e=document.getElementById("closeAnchor");if(!b){b=document.createElement("div");b.id="progressDiv";j=document.createElement("div");j.id="progressBar";e=document.createElement("a");e.id="closeAnchor";e.href="#";e.onclick=function(n){n=n||window.event;var m=n.target||n.srcElement;if(m.tagName.toLowerCase()!="a"){return}swfu.stopUpload();swfu.cancelUpload();uploading=false;document.getElementById("browseBtn").style.display="inline";document.getElementById("batchSubmitBtn").style.display="inline";var l=document.getElementById("editThumbnailsDiv");var k=document.getElementById("loadingImgEdit");if(k){l.removeChild(k)}return false};$("#editThumbnailsDiv span.error").css("display","none");a.appendChild(e);b.appendChild(j);a.appendChild(b)}document.getElementById("browseBtn").style.display="none";document.getElementById("batchSubmitBtn").style.display="none";j.style.width=Math.floor(g*b.offsetWidth)+"px";location.hash="#"+Math.floor(g*b.offsetWidth)+"px"}function SaveServerData(a,b){if(b!=null&&b.match(/NOT OK/)){HandleError(a,-250)}return}function CompleteUpload(e){GetImageList();var f=document.getElementById("file"+e.id);$(f).remove();var a=document.getElementById("jsStatusPara");if(document.getElementById("progressDiv")){a.removeChild(document.getElementById("progressDiv"))}if(swfu.getStats().files_queued>0&&uploading){swfu.startUpload()}else{uploading=false;$(a).remove();document.getElementById("browseBtn").style.display="inline";document.getElementById("batchSubmitBtn").style.display="inline";$("#uploadDiv p").css("display","block");if(aErrors.length>20){alert(aLangs.errorLots)}else{if(aErrors.length>0){var d=aLangs.errorSome+":\r\n";for(var c=0,b;b=aErrors[c];c++){d+=aLangs.errorSome+"\r\n"}alert(d)}}aErrors=new Array()}ResizeSidePanel()}function HandleError(b,c,a){if(c==-280||c==-290){return}aErrors.push(b.name)}var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 Beta 3";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault("upload_url","");this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){if(this.settings.button_placeholder_id!==""){this.replaceWithFlash()}else{this.appendFlash()}};SWFUpload.prototype.appendFlash=function(){var b,a;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}b=document.getElementsByTagName("body")[0];if(b==undefined){throw"Could not find the 'body' element."}a=document.createElement("div");a.style.width="1px";a.style.height="1px";a.style.overflow="hidden";b.appendChild(a);a.innerHTML=this.getFlashHTML();if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.replaceWithFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}a=document.getElementById(this.settings.button_placeholder_id);if(a==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}b=document.createElement("div");b.innerHTML=this.getFlashHTML();a.parentNode.insertBefore(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString();var a=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(a),"&amp;params=",encodeURIComponent(b),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params;var b=[];if(typeof(c)==="object"){for(var a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+"="+encodeURIComponent(c[a].toString()))}}}return b.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null;a=this.getMovieElement();if(a&&typeof(a.CallFunction)==="unknown"){for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(a){this.callFlash("StartUpload",[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash("CancelUpload",[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(a){this.callFlash("SetStats",[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)==="number"){return this.callFlash("GetFileByIndex",[a])}else{return this.callFlash("GetFile",[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash("AddFileParam",[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash("RemoveFileParam",[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash("SetUploadURL",[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash("SetPostParams",[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings.post_params[a];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash("SetFileTypes",[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash("SetFileSizeLimit",[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash("SetFileUploadLimit",[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash("SetFileQueueLimit",[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash("SetFilePostName",[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash("SetUseQueryString",[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_error=a;this.callFlash("SetRequeueOnError",[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a==="string"){a=a.replace(" ","").split(",")}this.settings.http_success=a;this.callFlash("SetHTTPSuccess",[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash("SetDebugEnabled",[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=""}this.settings.button_image_url=a;this.callFlash("SetButtonImageURL",[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+"px";b.style.height=a+"px"}this.callFlash("SetButtonDimensions",[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash("SetButtonText",[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash("SetButtonTextPadding",[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash("SetButtonTextStyle",[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash("SetButtonDisabled",[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash("SetButtonAction",[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash("SetButtonCursor",[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]==="function"){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw"Event handler "+b+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)==="function"){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i;var f={};var d;if(c!=undefined){for(var a in c.post){if(c.post.hasOwnProperty(a)){d=a;var b;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt("0x"+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug("Flash called back ready but the flash movie can't be found.");return}this.cleanUp(a);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(a){try{if(this.movieElement&&typeof(a.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var c in a){try{if(typeof(a[c])==="function"){a[c]=null}}catch(b){}}}}catch(d){}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("file_queued_handler",a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("file_queue_error_handler",[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(a,b){this.queueEvent("file_dialog_complete_handler",[a,b])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("return_upload_start_handler",a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler==="function"){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(b===undefined){b=true}b=!!b;this.callFlash("ReturnUploadStart",[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_progress_handler",[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent("upload_error_handler",[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a){b=this.unescapeFilePostParams(b);this.queueEvent("upload_success_handler",[b,a])};SWFUpload.prototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent("upload_complete_handler",a)};SWFUpload.prototype.debug=function(a){this.queueEvent("debug_handler",a)};SWFUpload.prototype.debugMessage=function(c){if(this.settings.debug){var a,d=[];if(typeof c==="object"&&typeof c.name==="string"&&typeof c.message==="string"){for(var b in c){if(c.hasOwnProperty(b)){d.push(b+": "+c[b])}}a=d.join("\n")||"";d=a.split("\n");a="EXCEPTION: "+d.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(a)}else{SWFUpload.Console.writeLine(c)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var b,a;try{b=document.getElementById("SWFUpload_Console");if(!b){a=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(a);b=document.createElement("textarea");b.id="SWFUpload_Console";b.style.fontFamily="monospace";b.setAttribute("wrap","off");b.wrap="off";b.style.overflow="auto";b.style.width="700px";b.style.height="350px";b.style.margin="5px";a.appendChild(b)}b.value+=d+"\n";b.scrollTop=b.scrollHeight-b.clientHeight}catch(c){alert("Exception: "+c.name+" Message: "+c.message)}};var SWFUpload;if(typeof(SWFUpload)==="function"){SWFUpload.gracefulDegradation={};SWFUpload.prototype.initSettings=(function(a){return function(){if(typeof(a)==="function"){a.call(this)}this.ensureDefault=function(c,b){this.settings[c]=(this.settings[c]==undefined)?b:this.settings[c]};this.ensureDefault("swfupload_element_id","swfupload_container");this.ensureDefault("degraded_element_id","degraded_container");this.settings.user_swfupload_loaded_handler=this.settings.swfupload_loaded_handler;this.settings.swfupload_loaded_handler=SWFUpload.gracefulDegradation.swfUploadLoadedHandler;delete this.ensureDefault}})(SWFUpload.prototype.initSettings);SWFUpload.gracefulDegradation.swfUploadLoadedHandler=function(){var d,b,c,a;this.customSettings.notLoaded=false;d=this.settings.swfupload_element_id;c=this.settings.degraded_element_id;b=$("."+d);if(b.length>0){b.removeClass(d);a=$("."+c);if(a.length>0){a.addClass(d)}}if(typeof(this.settings.user_swfupload_loaded_handler)==="function"){this.settings.user_swfupload_loaded_handler.apply(this)}}}function Organize(c){this.albumId=c.albumId;this.domAlbums=c.domAlbums;this.domAlbumSort=c.domAlbumSort;this.domAlbumOrder=c.domAlbumOrder;this.domFilter=c.domFilter;this.domNewAlbum=c.domNewAlbum;this.domDeleteImage=c.domDeleteImage;this.domTagImage=c.domTagImage;this.domImageSort=c.domImageSort;this.domImageOrder=c.domImageOrder;this.domThumbnailTitle=c.domThumbnailTitle;this.domThumbnails=c.domThumbnails;this.domHelpText=c.domHelpText;this.domForm=c.domForm;this.authFlash=c.authFlash;this.aLangs=c.aLangs;this.container=$(this.domThumbnails);this.items=this.container.children();this.items.wrap('<div class="'+this.CLASS_SORTABLE_ITEM+'"></div');this.items.addClass(this.CLASS_SORTABLE_ITEM);var a;var j;var d;var g;var k=false;var f;var e=false;this.albumIndexLastSelected=0;this.domNewAlbum.style.display="block";if(this.domDeleteImage){this.domDeleteImage.style.display="block"}if(this.domTagImage){this.domTagImage.style.display="block"}if(typeof this.domAlbums.style.maxHeight!="undefined"){this.domAlbums.style.maxHeight="180px"}else{this.domAlbums.style.height="180px"}this.domThumbnails.style.maxHeight="228px";this.isIE=jQuery.browser.msie;var b=this;this.domAlbumSort.onchange=function(){var m=new Object;m.orderAlbum=b.orderAlbum;m.sortImage=b.sortImage;m.orderImage=b.orderImage;if(b.filterAlbum!=null){m.filterAlbum=b.filterAlbum}switch(this.value){case"name":m.sortAlbum="name";break;case"count":m.sortAlbum="images";break;case"date":case"default":m.sortAlbum="date";break}jQuery.get(galleryLocation+"?OrganizeXML",m,function(n){b.UpdateAlbums(n)})};this.domAlbumOrder.onclick=function(m){b.orderAlbum=!b.orderAlbum;if(this.className=="descending"){this.className="ascending";this.title=b.aLangs.langAscending}else{this.className="descending";this.title=b.aLangs.langDescending}var n=new Object;n.orderAlbum=b.orderAlbum;n.sortAlbum=b.sortAlbum;if(b.filterAlbum!=null){n.filterAlbum=b.filterAlbum}jQuery.get(galleryLocation+"?OrganizeXML",n,function(o){b.UpdateAlbums(o)})};if(this.domFilter){this.domFilter.onclick=function(p){p=p||window.event;var n=p.target||p.srcElement;if(n.tagName.toLowerCase()!="a"){return}n.blur();var o=$("div."+b.CLASS_ALBUM_INFO);if(o.length>0&&o.queue().length>0){return false}var m=n.id;if(m=="jsPublicOption"||m=="jsPrivateOption"||m=="jsHiddenOption"){if(document.getElementById("jsPublicOption")){document.getElementById("jsPublicOption").className=""}if(document.getElementById("jsPrivateOption")){document.getElementById("jsPrivateOption").className=""}if(document.getElementById("jsHiddenOption")){document.getElementById("jsHiddenOption").className=""}}var q=new Object;q.orderAlbum=b.orderAlbum;if(b.sortAlbum!=null){q.sortAlbum=b.sortAlbum}switch(m){case"jsPublicOption":if(b.filterAlbum!="public"){b.filterAlbum="public";q.filterAlbum="public";n.className="selected"}break;case"jsPrivateOption":if(b.filterAlbum!="private"){b.filterAlbum="private";q.filterAlbum="private";n.className="selected"}break;case"jsHiddenOption":if(b.filterAlbum!="hidden"){b.filterAlbum="private";q.filterAlbum="hidden";n.className="selected"}break;default:break}jQuery.get(galleryLocation+"?OrganizeXML",q,function(r){b.UpdateAlbums(r)});return false}}this.domImageSort.onchange=function(){var m=new Object;m.album=b.albumId;m.sortAlbum=b.sortAlbum;m.orderAlbum=b.orderAlbum;m.orderImage=b.orderImage;if(b.filterAlbum!=null){m.filterAlbum=b.filterAlbum}switch(this.value){case"taken":m.sortImage="taken";break;case"filename":m.sortImage="filename";break;case"actual":case"default":m.sortImage="actual";break}jQuery.get(galleryLocation+"?OrganizeXML",m,function(n){b.UpdateImages(n)})};this.domImageOrder.onclick=function(n){n=n||window.event;var m=n.target||n.srcElement;if(m.id!="imageOrderImg"){return}b.orderImage=!b.orderImage;if(this.className=="descending"){this.className="ascending";this.title=b.aLangs.langAscending}else{this.className="descending";this.title=b.aLangs.langDescending}var o=new Object;o.album=b.albumId;o.sortAlbum=b.sortAlbum;o.orderAlbum=b.orderAlbum;o.sortImage=b.sortImage;o.orderImage=b.orderImage;if(b.filterAlbum!=null){o.filterAlbum=b.filterAlbum}jQuery.get(galleryLocation+"?OrganizeXML",o,function(p){b.UpdateImages(p)})};$("#jsMoveNewBtn, #jsCopyNewBtn","#"+this.ID_NEW_ALBUM_POPUP).click(function(q){var p=b.GetSelectedImageIds();var m=document.getElementById(b.ID_NEW_ALBUM_POPUP);if(document.getElementById("jsNameInput").value==""){alert(b.aLangs.langAlbumNameError+".");return false}var r=new Object;var o;if(document.getElementById("albumPublicInput").checked){o=document.getElementById("albumPublicInput").value}else{if(document.getElementById("albumPrivateInput").checked){o=document.getElementById("albumPrivateInput").value}else{if(document.getElementById("albumHiddenInput").checked){o=document.getElementById("albumHiddenInput").value}else{if(document.getElementById("albumMixedInput").checked){o=document.getElementById("albumMixedInput").value}}}}var n;if(this.id=="jsMoveNewBtn"){n="move"}else{if(this.id=="jsCopyNewBtn"){n="copy"}}jQuery.post(galleryLocation+"?OrganizeXML&album="+b.albumId+"&orderAlbum=false",{type:n,albumName:document.getElementById("jsNameInput").value,albumVersion:b.albumVersion,description:document.getElementById("jsDescriptionInput").value,privacy:o,"aImageIds[]":p,"aImageIdsSource[]":b.aImageIds},function(t){if(!b.HandleErrors(t)){return}b.UpdateImages(t);b.UpdateAlbums(t);b.RemovePopupForm(m)});return false});this.domThumbnails.onclick=function(m){b.Select(m)};this.domThumbnails.ondragstart=function(){return false};this.domAlbums.ondragstart=function(){return false};this.domThumbnails.onmousedown=function(m){b.StartDrag(m)};document.onmousemove=function(m){if(b.domDragItem){if(b.domDragItem.className==="jsDragAlbumClone"){b.ContinueAlbumDrag(m)}else{b.ContinueDrag(m)}}};document.onmouseup=function(m){if(b.domDragItem){if(b.domDragItem.className==="jsDragAlbumClone"){b.StopAlbumDrag(m)}else{b.StopDrag(m)}}};var l=$("div.jsPopup img");l.click(function(){var m=$(this).parents("div").get(0);b.RemovePopupForm(m)});var h=$("#tagListDiv");$("#tagsInput").keyup(function(){var u=this.value;var t=u.split(",");var r=jQuery.trim(t[t.length-1]);h.empty();if(r===""){return}var p=b.aTags.length;var q=0;for(var o=0;o<p;o++){var m=b.aTags[o];var n=m.slice(0,r.length);if(n>r||q>=5){break}else{if(n==r){h.append('<a href="#">'+m+"</a>");q++}}}});h.click(function(r){r=r||window.event;var q=r.target||r.srcElement;if(q.tagName.toLowerCase()!="a"){return false}var m=q.innerHTML;var o=document.getElementById("tagsInput");var t=o.value;var p=t.split(",");p[p.length-1]=m;for(var n=0,m;m=p[n];n++){p[n]=jQuery.trim(m)}o.value=p.join(", ");return false});this.domForm.onsubmit=function(){for(var q=0,p;p=b.aImageIds[q];q++){var n=document.createElement("input");n.type="hidden";n.name="aImageIdsSource[]";n.value=p;b.domForm.appendChild(n)}for(var q=0,m;m=b.itemAlbums[q];q++){albumId=parseInt(m.id.match(/\d+/));var r=document.createElement("input");r.type="hidden";r.name="aAlbumIdsSource[]";r.value=albumId;b.domForm.appendChild(r)}if(b.aImageIds.length>0){var r=document.createElement("input");r.type="hidden";r.name="album";r.value=b.albumId;b.domForm.appendChild(r)}var o=document.createElement("input");o.type="hidden";o.name="albumVersion";o.value=b.albumVersion;b.domForm.appendChild(o);return true};var c=new Object;c.sortAlbum=this.sortAlbum;c.orderAlbum=this.orderAlbum;jQuery.get(galleryLocation+"?OrganizeXML&album="+this.albumId,c,function(n){b.UpdateAlbums(n);b.UpdateImages(n);var m=$('album[selected="true"] name',n).text();b.domThumbnailTitle.innerHTML=b.aLangs.langPhotos+" - "+m})}Organize.prototype={SRC_UNAVAILABLE_IMG:"Images/system/private_image.gif",CLASS_ALBUM_INFO:"albumInfo",CLASS_SORTABLE_ITEM:"editThumbnail",CLASS_SORTABLE_ITEM_ALBUM:"editThumbnailAlbum",CLASS_DROPPABLE_ITEM:"coverImage",CLASS_SELECTED_ITEM:"selected",X_OFFSET:5,Y_OFFSET:5,WIDTH_ALBUM_INFO:141,ID_NEW_ALBUM_POPUP:"jsNewAlbumPopupDiv",ID_TAGS_POPUP:"jsTagPopupDiv",ROTATE_CW:"cw",ROTATE_CCW:"ccw",MAX_EFFECTS_SELECTED_IMAGES:20,animation:{width:0,marginLeft:0,marginRight:0,borderLeft:0,borderRight:0},albumId:null,aImageIds:new Array(),aErrors:new Array(),aTags:new Array(),domThumbnails:null,domHelpText:null,domLoadIcon:null,domBrowseBtn:null,domUploadBtn:null,domBatchList:null,isIE:false,indexLastSelected:0,sortAlbum:"date",filterAlbum:null,orderAlbum:false,sortImage:"actual",orderImage:false,isBrowserIE6:(jQuery.browser.msie&&jQuery.browser.version<7),Cleanup:function(){$("*").unbind();for(var a in this){this[a]=null}},UpdateAlbums:function(e){var b=$("div."+this.CLASS_ALBUM_INFO);this.albumContainer=$(this.domAlbums);this.aAlbumIds=new Array();var f=0;var c=$("albums",e);this.sortAlbum=c.attr("sort");this.filterAlbum=c.attr("filter");var k=c.attr("order");if(k=="false"){this.orderAlbum=false}else{this.orderAlbum=true}var a=this;if(jQuery.browser.msie&&jQuery.browser.version<7){b.remove();c=$("album",e);c.each(function(){var t=$(this);var p=$("id",this).text();var n=document.createElement("div");g="album"+p;n.id=g;if(p==a.albumId){n.className="albumInfo selected"}else{n.className="albumInfo"}var r=document.createElement("h2");var m=document.createElement("a");m.href=galleryLocation+"?Organize&album="+p;m.innerHTML=$("name",this).text();r.appendChild(m);n.appendChild(r);var q=document.createElement("a");q.href=m.href;var o=document.createElement("img");o.className="coverImage thumbnail";o.src=$("coverImage",this).text();o.title="";q.appendChild(o);n.appendChild(q);var u=document.createElement("p");u.innerHTML=$("createdTime",this).text();u.innerHTML+="<br/>";u.innerHTML+=$("privacy",this).text();u.innerHTML+=' - <span class="imageCount">'+$("imageCount",this).text()+"</span>";u.innerHTML+="<br/>";u.innerHTML+='<a class="albumInfoEdit" href="'+galleryLocation+"?EditAlbum&album="+p+'">'+a.aLangs.langEdit+"</a>";u.innerHTML+='<a class="albumInfoDelete" href="'+galleryLocation+"?DeleteAlbum&album="+p+'">'+a.aLangs.langDelete+"</a>";u.innerHTML+="<br/>";n.appendChild(u);this.albumContainer.append(n)});$("div."+a.CLASS_ALBUM_INFO).click(function(m){return a.SelectAlbum(m,this)});return}var l=this.albumContainer.height();if(l){this.albumContainer.height(l)}var h=this.albumContainer.offset();b.each(function(){var n=$(this);var m=n.offset();n.css("top",m.top-h.top);n.css("left",m.left-h.left)});b.css("position","absolute");b.addClass("deleting");b.animate({top:"0px",left:"0px",opacity:"0.0"},500,null,function(){$(this).remove()});var g;var j=$("#newAlbumDiv");c=$("album",e);c.each(function(){var u=$(this);var t=$("id",this).text();var n=document.createElement("div");g="album"+t;n.id=g;if(t==a.albumId){n.className="albumInfo selected";itemAlbumsRange=n}else{n.className="albumInfo"}a.aAlbumIds[f]=t;f++;n.style.visibility="hidden";var p=document.createElement("h2");var q=document.createElement("a");q.href=galleryLocation+"?Organize&album="+t;q.innerHTML=$("name",this).text();p.appendChild(q);n.appendChild(p);var r=document.createElement("a");r.href=q.href;var v=document.createElement("img");v.className="coverImage thumbnail";v.src=$("coverImage",this).text();v.title="";r.appendChild(v);n.appendChild(r);var m=document.createElement("p");m.innerHTML=$("createdTime",this).text();m.innerHTML+="<br/>";m.innerHTML+=$("privacy",this).text();m.innerHTML+=' - <span class="imageCount">'+$("imageCount",this).text()+"</span>";m.innerHTML+="<br/>";m.innerHTML+='<a class="albumInfoEdit" href="'+galleryLocation+"?EditAlbum&album="+t+'">'+a.aLangs.langEdit+"</a>";m.innerHTML+='<a class="albumInfoDelete" href="'+galleryLocation+"?DeleteAlbum&album="+t+'">'+a.aLangs.langDelete+"</a>";m.innerHTML+="<br/>";n.appendChild(m);a.albumContainer.append(n);var o=$(n).offset();n.topTrue=o.top-h.top+"px";n.leftTrue=o.left-h.left+"px"});this.itemAlbums=this.albumContainer.children("."+this.CLASS_ALBUM_INFO);a.domAlbums.scrollTop=0;if(b.length==0){var b=this.albumContainer}var d=false;b.queue(function(){if(d){return}var m=$("div."+a.CLASS_ALBUM_INFO+":not(.deleting)");m.css({position:"absolute",display:"block",visibility:"visible",opacity:"0.0"});m.each(function(){$(this).animate({top:this.topTrue,left:this.leftTrue,opacity:"1.0"},500,null,function(){if(this.id==g){m.css({position:"relative",top:"0px",left:"0px"})}})});m.click(function(n){return a.SelectAlbum(n,this)});m.mousedown(function(n){return a.StartAlbumDrag(n,this)});d=true;$(this).dequeue})},UpdateImages:function(g){var m=$('album[selected="true"] version',g).text();if(m!=""){this.albumVersion=parseInt(m)}var n=$("images",g);this.sortImage=n.attr("sort");var o=n.attr("order");if(o=="false"){this.orderImage=false}else{this.orderImage=true}n=$("image",g);var l=n.length;var k=0;if(l<1){this.domThumbnails.innerHTML='<span class="error">'+this.aLangs.langNoImages+".</span>";this.domHelpText.style.display="none";this.UpdateAlbums(g);this.aImageIds=new Array();return}this.domThumbnails.scrollTop=0;this.aImageIds=new Array();var b=$(this.domThumbnails).height();this.domThumbnails.style.height=b+"px";this.domThumbnails.innerHTML="";for(var h=0,e;e=n[h];h++){var d=$("id",e).text();var c=$("square",e).text();if(!d){continue}var a=document.createElement("img");var f=document.createElement("div");f.imageId=d;f.className=this.CLASS_SORTABLE_ITEM;this.aImageIds[h]=d;a.imageId=d;a.alt="Image "+d;a.title="";a.index=h;a.style.display="none";a.onload=function(){$(this).fadeIn("normal")};if(c){a.src=c}else{a.src=SRC_UNAVAILABLE_IMG}a.className=this.CLASS_SORTABLE_ITEM;if(h==(l-1)){a.className+=" last"}f.appendChild(a);this.domThumbnails.appendChild(f)}if(l>0){this.domHelpText.style.display="block"}if(this.isBrowserIE6){this.domThumbnails.style.height="202px"}else{this.domThumbnails.style.height="auto"}this.aTags=new Array();var q=$("tag",g);var j=q.length;var p;for(var h=0;h<j;h++){p=q[h];this.aTags[h]=p.textContent}$("#editThumbnailsDiv").css("visibility","visible");resize_container()},Scroll:function(c,f){c=c||window.event;var b=c.target||c.srcElement;var d=this;var a;if(b.className=="jsScrollUp"||b.className=="jsScrollDown"){if(b.tagName.toLowerCase()!="img"){return}b.blur();if(b.className=="jsScrollUp"){a=-20}else{a=20}b.onmouseout=function(){clearInterval(d.intvlScroll)};b.onmouseup=function(){clearInterval(d.intvlScroll)};this.intvlScroll=setInterval(function(){f.scrollTop+=a},50)}else{if(b!=this.domAlbumScroll&&b!=this.domThumbScroll&&(c.detail||c.wheelDelta)){if(c.detail>0||c.wheelDelta<0){a=40}else{if(c.detail<0||c.wheelDelta>0){a=-40}}f.scrollTop+=a}else{return}}return false},StartAlbumDrag:function(g,a){g=g||window.event;var d=g.target||g.srcElement;var f=$(d);if(!$(a).hasClass(this.CLASS_SELECTED_ITEM)){this.SelectAlbum(g,a);if(g.ctrlKey){this.isCtrlClicked=true}}var b=f.parents("."+this.CLASS_ALBUM_INFO);if(b.length){f=b;d=b.get(0)}this.domOriginalAlbumItem=a;this.domDragItem=document.createElement("img");this.domDragItem.src=$("a",a).children().get(0).src;this.domDragItem.className="jsDragAlbumClone";var c=$(this.domDragItem);c.css({display:"none",position:"absolute",opacity:"0.75"});document.body.appendChild(this.domDragItem);if(g.preventDefault){g.preventDefault();g.stopPropagation()}},SelectAlbum:function(j,m){j=j||window.event;var g=j.target||j.srcElement;var d=g.tagName.toLowerCase();if(d!="a"&&d!="h2"&&d!="img"&&d!="div"&&d!="p"){return}if(d=="a"){if(g.parentNode.tagName.toLowerCase()!="h2"){return}}$("#jsOptionsDiv").remove();var b=this.itemAlbums.index(m);var a;var h;if(j.shiftKey){if(this.albumIndexLastSelected<b){itemAlbumsRange=this.itemAlbums.slice(this.albumIndexLastSelected,b+1);itemAlbumsRange.addClass(this.CLASS_SELECTED_ITEM);itemAlbumsRange.children().addClass(this.CLASS_SELECTED_ITEM);a=this.itemAlbums.slice(0,this.albumIndexLastSelected);h=this.itemAlbums.slice(b+1)}else{if(this.albumIndexLastSelected>b){itemAlbumsRange=this.itemAlbums.slice(b,this.albumIndexLastSelected+1);itemAlbumsRange.addClass(this.CLASS_SELECTED_ITEM);a=this.itemAlbums.slice(0,b);h=this.itemAlbums.slice(this.albumIndexLastSelected+1)}}a.removeClass(this.CLASS_SELECTED_ITEM);h.removeClass(this.CLASS_SELECTED_ITEM);$("#editThumbnailsDiv").css("visibility","hidden")}else{if(j.ctrlKey){if($(m).hasClass(this.CLASS_SELECTED_ITEM)&&!this.isCtrlClicked){$(m).removeClass(this.CLASS_SELECTED_ITEM)}else{$(m).addClass(this.CLASS_SELECTED_ITEM);this.albumIndexLastSelected=b;this.domLastSelected=this.itemAlbums[this.albumIndexLastSelected]}itemAlbumsRange=this.albumContainer.children("."+this.CLASS_SELECTED_ITEM);this.isCtrlClicked=false;$("#editThumbnailsDiv").css("visibility","hidden")}else{var k=parseInt(m.id.match(/\d+/));var l=$("h2",m).text();this.domThumbnailTitle.innerHTML=this.aLangs.langPhotos+" - "+l;itemAlbumsRange=m;$(m).addClass(this.CLASS_SELECTED_ITEM);this.albumId=k;this.albumIndexLastSelected=b;this.domLastSelected=this.itemAlbums[this.albumIndexLastSelected];a=this.itemAlbums.filter(function(e){return(e!=b)});var f=new Object;f.album=this.albumId;f.sortImage=this.sortImage;f.orderImage=this.orderImage;var c=this;jQuery.get(galleryLocation+"?OrganizeXML",f,function(e){c.UpdateImages(e)});a.removeClass(this.CLASS_SELECTED_ITEM)}}$("p.error").remove();return false},ContinueAlbumDrag:function(g){g=g||window.event;var d=g.target||g.srcElement;if(this.domDragItem==null){return}$("#editThumbnailsDiv").css("visibility","hidden");var h=this.domDragItem.style;h.display="block";var b=(g.pageX||g.clientX);var a=(g.pageY||g.clientY);if(document.all){h.top=a+(document.documentElement.scrollTop)+this.Y_OFFSET+"px";h.left=b+(document.documentElement.scrollLeft||document.body.scrollLeft)+this.X_OFFSET+"px"}else{h.top=a+this.Y_OFFSET+"px";h.left=b+this.X_OFFSET+"px"}var f=$(d);if(!f.hasClass(this.CLASS_ALBUM_INFO)){return}var c=f.parents("."+this.CLASS_ALBUM_INFO);if(c.length){f=c;d=c.get(0)}},StopAlbumDrag:function(f){f=f||window.event;var c=f.target||f.srcElement;var d=$(c);if(!this.domDragItem){return}else{if(this.domDragItem.style.display=="none"){$(this.domDragItem).remove();this.domDragItem=null;return}}if(this.domDragItem){$(this.domDragItem).remove();this.domDragItem=null}var b=d.parents("."+this.CLASS_ALBUM_INFO);if(b.length){d=b;c=b.get(0)}var g=this;if($(c).hasClass(this.CLASS_ALBUM_INFO)&&$(c).hasClass(this.CLASS_SELECTED_ITEM)){while($(c).hasClass(this.CLASS_SELECTED_ITEM)){c=c.previousSibling}$(c).after(itemAlbumsRange)}else{if($(c).hasClass(this.CLASS_ALBUM_INFO)){var a=(f.pageX||f.clientX);if(this.IsMouseOnLeft($(c),a)){$(c).before(itemAlbumsRange)}else{$(c).after(itemAlbumsRange)}}}this.itemAlbums=this.albumContainer.children("."+this.CLASS_ALBUM_INFO);this.albumIndexLastSelected=this.itemAlbums.index(this.domLastSelected);if(itemAlbumsRange.length>1){$("#editThumbnailsDiv").css("visibility","hidden")}else{$("#editThumbnailsDiv").css("visibility","visible")}this.isCtrlClicked=false},StartDrag:function(f){f=f||window.event;var c=f.target||f.srcElement;var d=$(c);if(!d.hasClass(this.CLASS_SORTABLE_ITEM)){return}var a=d.parents("."+this.CLASS_SORTABLE_ITEM);if(a.length){d=a;c=a.get(0)}this.domOriginalItem=c;$("#jsOptionsDiv").remove();this.domDragItem=document.createElement("img");this.domDragItem.src=d.children().get(0).src;this.domDragItem.className="jsDragClone";var b=$(this.domDragItem);b.css({display:"none",position:"absolute",opacity:"0.75"});document.body.appendChild(this.domDragItem);$("#newAlbumImg, #deleteImage, #tagImage").css("cursor","pointer");if(f.preventDefault){f.preventDefault();f.stopPropagation()}},Select:function(g){g=g||window.event;var d=g.target||g.srcElement;var f=$(d);if(!f.hasClass(this.CLASS_SORTABLE_ITEM)){return}var b=f.parents("."+this.CLASS_SORTABLE_ITEM);if(b.length){f=b;d=b.get(0)}var a=this.items.index(f);if(g.shiftKey){if(this.indexLastSelected<a){var c=this.items.slice(this.indexLastSelected,a);c.addClass(this.CLASS_SELECTED_ITEM);c.children().addClass(this.CLASS_SELECTED_ITEM)}else{if(this.indexLastSelected>a){var c=this.items.slice(a+1,this.indexLastSelected);c.addClass(this.CLASS_SELECTED_ITEM);c.children().addClass(this.CLASS_SELECTED_ITEM)}}var h=this.items.filter(function(e){return(e!=a)})}else{if(g.ctrlKey){}else{var h=this.items.filter(function(e){return(e!=a)});h.removeClass(this.CLASS_SELECTED_ITEM);h.children().removeClass(this.CLASS_SELECTED_ITEM)}}if(f.hasClass(this.CLASS_SELECTED_ITEM)){f.removeClass(this.CLASS_SELECTED_ITEM);$("img",f).removeClass(this.CLASS_SELECTED_ITEM)}else{f.addClass(this.CLASS_SELECTED_ITEM);$("img",f).addClass(this.CLASS_SELECTED_ITEM)}this.indexLastSelected=a},ContinueDrag:function(g){g=g||window.event;var c=g.target||g.srcElement;if(this.domDragItem==null){return}var j=this.domDragItem.style;j.display="block";$(this.domOriginalItem).css("opacity","0.4");var b=(g.pageX||g.clientX);var f=(g.pageY||g.clientY);if(document.all){j.top=f+(document.documentElement.scrollTop)+this.Y_OFFSET+"px";j.left=b+(document.documentElement.scrollLeft||document.body.scrollLeft)+this.X_OFFSET+"px"}else{j.top=f+this.Y_OFFSET+"px";j.left=b+this.X_OFFSET+"px"}var h=$(c);if(!h.hasClass(this.CLASS_SORTABLE_ITEM)){return}var d=h.parents("."+this.CLASS_SORTABLE_ITEM);if(d.length){h=d;c=d.get(0)}if(this.IsMouseOnLeft(c,b)){c.style.paddingLeft="10px";c.style.paddingRight="0px";var k=h.prev();k.css("padding-left","0px");k.css("padding-right","10px")}else{c.style.paddingLeft="0px";c.style.paddingRight="10px";var l=h.next();l.css("padding-left","10px");l.css("padding-right","0px")}var a=this;c.onmouseout=function(){c.style.paddingLeft="5px";c.style.paddingRight="5px";var e=h.next();e.css("padding-left","5px");e.css("padding-right","5px");var m=h.prev();if(m.hasClass(a.CLASS_SORTABLE_ITEM)){m.css("padding-left","5px");m.css("padding-right","5px")}}},StopDrag:function(m){m=m||window.event;var d=m.target||m.srcElement;var t=$(d);if(!this.domDragItem){return}if(this.domDragItem){$(this.domDragItem).remove();this.domDragItem=null}this.items=$(this.domThumbnails).children();this.items.css({paddingLeft:"5px",paddingRight:"5px",opacity:"1.0"});$("#newAlbumImg").css("cursor","default");$("#deleteImage").css("cursor","default");var c=this;if(t.hasClass(this.CLASS_SORTABLE_ITEM)&&d.imageId!=this.domOriginalItem.imageId){var a=t.parents("."+this.CLASS_SORTABLE_ITEM);if(a.length){t=a;d=a.get(0)}var h=this.items.index(this.domOriginalItem);var f;var u=this.aImageIds[h];this.aImageIds.splice(h,1);var j=(m.pageX||m.clientX);if(this.IsMouseOnLeft(d,j)){t.before(this.domOriginalItem);f=this.items.index(d);if(f>h){f--}}else{t.after(this.domOriginalItem);f=this.items.index(d);if(f<h){f++}}this.aImageIds.splice(f,0,u)}else{if(t.hasClass(this.CLASS_DROPPABLE_ITEM)){var r=t.parents("div.albumInfo");var o=r.attr("id").match(/\d+/);var b=o[0];if(b==this.albumId){return}var k=this.GetSelectedImageIds();var g=document.createElement("div");g.id="jsOptionsDiv";var n=document.createElement("input");n.type="button";n.value="Move";n.className="button";var l=document.createElement("input");l.type="button";l.value="Copy";l.className="button";var p={desAlbumId:b,albumVersion:c.albumVersion,"aImageIds[]":k,"aImageIdsSource[]":c.aImageIds};n.onclick=function(){var v=$("span.imageCount",r);var e=parseInt(v.text());e+=k.length;v.text(e);var w=$("#album"+c.albumId+" span.imageCount");if(w.length==1){e=parseInt(w.text());e-=k.length;if(e>0){w.text(e)}}p.type="move";jQuery.post(galleryLocation+"?OrganizeXML&orderAlbum=false&album="+c.albumId,p,function(y){if(!c.HandleErrors(y)){return}var x=$("coverChange",y);if(x.text()=="true"){c.UpdateAlbums(y)}c.UpdateImages(y);$(g).remove()})};l.onclick=function(){var v=$("span.imageCount",r);var e=parseInt(v.text());e+=k.length;v.text(e);p.type="copy";jQuery.post(galleryLocation+"?OrganizeXML&orderAlbum=false&album="+c.albumId,p,function(x){if(!c.HandleErrors(x)){return}var w=$("coverChange",x);if(w.text()=="true"){c.UpdateAlbums(x)}c.UpdateImages(x);$(g).remove()})};g.appendChild(n);g.appendChild(l);r.append(g)}else{if(d.id=="newAlbumImg"){var k=this.GetSelectedImageIds();var q=document.getElementById(this.ID_NEW_ALBUM_POPUP);this.DisplayPopup(q)}else{if(d.id=="deleteImage"){if(!confirm(this.aLangs.langDelImagesConfirm+"?")){return false}var k=this.GetSelectedImageIds();jQuery.post(galleryLocation+"?OrganizeXML&album="+c.albumId+"&orderAlbum=false",{type:"delete",albumVersion:c.albumVersion,"aImageIds[]":k},function(w){if(!c.HandleErrors(w)){return}c.albumVersion=$('album[selected="true"] version',w).text();var x=$("#album"+c.albumId+" span.imageCount");if(x.length==1){numAlbumImages=parseInt(x.text());numAlbumImages-=k.length;if(numAlbumImages>0){x.text(numAlbumImages)}}var e=$("coverChange",w);if(e.text()=="true"){c.UpdateAlbums(w)}if(x.length==1&&numAlbumImages==0){c.UpdateImages(w)}if(k.length<c.MAX_EFFECTS_SELECTED_IMAGES){var v;if(c.isIE){v={width:"0px",opacity:"0.0"}}else{v={margin:"0px",paddingRight:"0px",paddingLeft:"0px",width:"0px",opacity:"0.0"}}$("."+c.CLASS_SELECTED_ITEM,c.domThumbnails).animate(v,300,function(){$("."+c.CLASS_SELECTED_ITEM,c.domThumbnails).remove()});$(c.domOriginalItem).animate(v,300,function(){$(c.domOriginalItem).remove()})}else{$("."+c.CLASS_SELECTED_ITEM,c.domThumbnails).remove();$(c.domOriginalItem).remove()}});return false}else{if(d.id=="tagImage"){var k=this.GetSelectedImageIds();var q=document.getElementById(this.ID_TAGS_POPUP);this.DisplayPopup(q);$("#jsTagAddBtn, #jsTagReplaceBtn").click(function(x){var v=document.getElementById("tagsInput").value;var w;if(this.id=="jsTagAddBtn"){w="addtag"}else{if(this.id=="jsTagReplaceBtn"){w="replacetag"}}jQuery.post(galleryLocation+"?OrganizeXML&album="+c.albumId+"&orderAlbum=false",{type:w,albumVersion:albumVersion,"aImageIds[]":k,tags:v},function(e){if(!c.HandleErrors(e)){return}c.UpdateImages(e);c.RemovePopupForm(q)});return false})}}}}}},DisplayPopup:function(d){var g=this.GetSelectedImageIds();var c=document.createElement("div");c.id="jsCoverDiv";if(this.isBrowserIE6){var l=$("#organizeDiv");var h=parseInt(l.css("padding-left"))+parseInt(l.css("padding-right"));c.style.width=l.width()+h+"px";c.style.height=l.height()+h+"px"}document.getElementById("organizeDiv").appendChild(c);var e=document.createElement("div");e.id="jsFauxDiv";var b=document.innerHeight||document.documentElement.clientHeight;var j=$(d).height();var f=document.documentElement.scrollTop||document.body.scrollTop;var k=parseInt(b/2-200+f);d.style.top=k+"px";e.appendChild(d);document.getElementById("organizeDiv").appendChild(e);$(d).fadeIn("normal");var a=this;e.onclick=function(n){n=n||window.event;var m=n.target||n.srcElement;if(m.id==this.id){a.RemovePopupForm(d)}}},RemovePopupForm:function(a){var c=document.getElementById("jsCoverDiv");var b=document.getElementById("jsFauxDiv");$(c).remove();$(".formField",a).attr("value","");$("#albumPublicInput",a).attr("checked","checked");$("#tagListDiv").empty();$(a).fadeOut("normal",function(){document.getElementById("newAlbumDiv").appendChild(a);a.style.display="none";$(b).remove()})},HandleErrors:function(c){if($("error",c).length>0&&$("error-id",c).text()=="REVISION_NUMBER_CHANGED"){var b=$("#organizeSection p.error");if(b.length>0){b.text(this.aLangs.langRevisionChanged)}else{var a=document.createElement("p");a.className="error";a.innerHTML=this.aLangs.langRevisionChanged;$("#imageSortOptionsDiv").before(a)}return false}else{return true}},IsMouseOnLeft:function(c,a){var d=$(c);var b=d.offset().left;var e=d.width();if(a<=b+e/2){return true}else{return false}},GetSelectedImageIds:function(){var d=new Array();var b=0;$("img."+this.CLASS_SELECTED_ITEM).each(function(){d[b++]=this.imageId});var c=false;for(var b=0,a;a=d[b];b++){if(this.domOriginalItem.imageId==a){c=true;break}}if(!c){d[b]=this.domOriginalItem.imageId}return d}};function resize_container(){if(document.all&&document.noResize){return}var a=document.getElementById("containerDiv");if(typeof a.style.maxHeight!="undefined"){a.style.minHeight=$(window).height()-67+"px"}else{a.style.height=(document.innerHeight||document.documentElement.clientHeight)-67+"px";if(a.offsetWidth<950){a.style.width="950px"}else{a.style.width="auto"}}document.noResize=true;setTimeout(function(){document.noResize=false},50)}function UserManager(b){this.aUsers=b.aUsers;this.aGroups=b.aGroups;this.aLangs=b.aLangs;this.domDetailsDiv=b.domDetailsDiv;this.domUserGroupsDiv=b.domUserGroupsDiv;this.domUserPopup=b.domUserPopup;this.domGroupPopup=b.domGroupPopup;var a=this;$("table").click(function(f){if(f.target.tagName.toLowerCase()!="a"){return}var d=f.target;if($(d).parent("td.groupname").length){var c=parseInt(d.href.match(/\d+$/));a.ShowGroup(c,f);return false}});$("td.username a").click(function(d){var c=parseInt(this.href.match(/\d+$/));a.ShowUser(c,d);return false});$('input[name="newgroup"]').click(function(c){a.group=new Object();a.group.id="new";a.ClearPopup();a.ShowPopup(document.getElementById("jsGroupPopupDiv"),c);return false});$('input.button[name="delete"]',this.domUserPopup).click(function(){if(!confirm(a.aLangs.confirmDelUser)){return false}var c={"delete":"true"};jQuery.post(galleryLocation+"?UserManager&show=ajax&user="+a.user.id,c,function(d){if(d=="ERROR"){alert(a.aLangs.ajaxError)}else{$("#userRow"+a.user.id).remove();a.HidePopup()}});return false});$('input.button[name="delete"]',this.domGroupPopup).click(function(){if(!confirm(a.aLangs.confirmDelGroup)){return false}var c={"delete":"true"};jQuery.post(galleryLocation+"?UserManager&show=ajax&group="+a.group.id,c,function(d){if(d=="ERROR"){alert(a.aLangs.ajaxError)}else{$("#groupRow"+a.group.id).remove();delete a.aGroups[a.group.id];a.HidePopup()}});return false});$('input.button[name="update"]',this.domUserPopup).click(function(){a.UpdateUser();if(a.user.name.length==0){return false}var c={update:"update",username:a.user.name,"userGroups[]":a.user.aGroupIds};if(a.user.permEditAlbum){c.permEditAlbum="true"}if(a.user.permNewComment){c.permNewComment="true"}if(a.user.permDelComment){c.permDelComment="true"}if(a.user.permInvite){c.permInvite="true"}if(a.user.permSuperuser){c.permSuperuser="true"}jQuery.post(galleryLocation+"?UserManager&show=ajax&user="+a.user.id,c,function(g){if(g=="ERROR"){alert(a.aLangs.ajaxError)}else{var d=$("#userRow"+a.user.id);$("td.username a",d).text(a.user.name);$('input[type="checkbox"]',d).attr("checked",false);var f='input[name="userPermissionsMatrix['+a.user.id+"]";if(a.user.permEditAlbum){$(f+'[editAlbum]"]',d).attr("checked",true)}if(a.user.permNewComment){$(f+'[newComment]"]',d).attr("checked",true)}if(a.user.permDelComment){$(f+'[delComment]"]',d).attr("checked",true)}if(a.user.permInvite){$(f+'[invite]"]',d).attr("checked",true)}if(a.user.permSuperuser){$(f+'[superuser]"]',d).attr("checked",true)}f='input[name="userGroupMatrix[';for(var e in a.user.aGroupIds){$(f+a.user.aGroupIds[e]+'][]"]',d).attr("checked",true)}a.HidePopup()}});return false});$('input.button[name="update"]',this.domGroupPopup).click(function(){a.UpdateGroup();if(a.group.name.length==0){return false}var c={update:"update",groupName:a.group.name,"groupUsers[]":a.group.aUserIds};if(a.group.id=="new"){c.newgroup="true"}jQuery.post(galleryLocation+"?UserManager&show=ajax&group="+a.group.id,c,function(f){if(f=="ERROR"){alert(a.aLangs.ajaxError)}else{if(a.group.id=="new"){var d=f;a.group.id=d;a.aGroups.splice(d,0,a.group);var g='<tr id="groupRow'+d+'"><td class="groupname"><a href="#'+d+'">'+a.group.name;g+='<td class="checkbox userCount">'+a.group.aUserIds.length+"</td>";g+='<td class="checkbox">0</td>';g+="</tr>";$("table").append(g)}else{var e=$("#groupRow"+a.group.id);$("td.groupname a",e).text(a.group.name);$("td.userCount",e).text(a.group.aUserIds.length)}a.HidePopup()}});return false});$("#coverDiv").click(function(){a.HidePopup()});$(".jsPopup .closeBtn").click(function(){a.HidePopup()})}UserManager.prototype={aUsers:new Array(),aGroups:new Array(),user:null,Cleanup:function(){$("*").unbind();for(var a in this){this[a]=null}},ShowUser:function(a,b){if(this.aUsers[a]){this.user=this.aUsers[a]}else{return}this.ClearPopup();this.SelectUser(this.user);this.ShowPopup(document.getElementById("jsUserPopupDiv"),b)},ShowGroup:function(a,b){if(this.aGroups[a]){this.group=this.aGroups[a]}else{return}this.ClearPopup();this.SelectGroup(this.group);this.ShowPopup(document.getElementById("jsGroupPopupDiv"),b)},UpdateUser:function(){var a=this.user;a.name=$('input[name="username"]',this.domUserPopup).attr("value");a.permEditAlbum=$('input[name="permEditAlbum"]',this.domUserPopup).attr("checked");a.permNewComment=$('input[name="permNewComment"]',this.domUserPopup).attr("checked");a.permDelComment=$('input[name="permDelComment"]',this.domUserPopup).attr("checked");a.permInvite=$('input[name="permInvite"]',this.domUserPopup).attr("checked");a.permSuperuser=$('input[name="permSuperuser"]',this.domUserPopup).attr("checked");a.aGroupIds=new Array();$("input.userGroups",this.domUserPopup).each(function(){if(this.checked){a.aGroupIds.push(this.value)}})},UpdateGroup:function(){var a=this.group;a.name=$('input[name="groupName"]',this.domGroupPopup).attr("value");a.aUserIds=new Array();$("input.groupUsers",this.domGroupPopup).each(function(){if(this.checked){a.aUserIds.push(this.value)}})},ClearPopup:function(){$('.jsPopup input[type="text"]').attr("value","");$('.jsPopup input[type="checkbox"]').attr("checked",false)},SelectUser:function(a){$('input[name="username"]').attr("value",a.name);if(a.permEditAlbum){$('input[name="permEditAlbum"]').attr("checked",true)}if(a.permNewComment){$('input[name="permNewComment"]').attr("checked",true)}if(a.permDelComment){$('input[name="permDelComment"]').attr("checked",true)}if(a.permInvite){$('input[name="permInvite"]').attr("checked",true)}if(a.permSuperuser){$('input[name="permSuperuser"]').attr("checked",true)}for(var d in this.aGroups){var c=this.aGroups[d].id;var e=false;for(var b in a.aGroupIds){if(c==a.aGroupIds[b]){e=true}}if(e){$('input[name="userGroups['+c+']"]').attr("checked",true)}}},SelectGroup:function(b){$('input[name="groupName"]').attr("value",b.name);for(var a in b.aUserIds){$('input[name="groupUsers['+b.aUserIds[a]+']"]',"#jsGroupPopupDiv").attr("checked",true)}},ShowPopup:function(j,l){l=l||window.event;var h=document.innerHeight||document.documentElement.clientHeight;var m=document.getElementById("organizeDiv");var b=$(m).offset();var o=b.top;var f=b.left;var k=m.offsetWidth;var g=m.offsetHeight;var a=(l.pageX||l.clientX);j.style.position="absolute";var d=(h-400)/2+(document.documentElement.scrollTop||document.body.scrollTop);var c=a+(document.documentElement.scrollLeft||document.body.scrollLeft)+50;j.style.top=d+"px";j.style.left=c+"px";var n=document.getElementById("coverDiv");n.style.position="absolute";n.style.top=o+"px";n.style.left=f+"px";n.style.width=k+"px";n.style.height=g+"px";if(!this.isIE){$(n).fadeIn("fast");$(j).fadeIn("fast",function(){$('input[type="text"]',j).get(0).focus()})}else{n.style.display="block";j.style.display="block";$('input[type="text"]',j).get(0).focus()}},HidePopup:function(){this.user=null;this.group=null;this.resizeContainer();$(".jsPopup").fadeOut("fast");$("#coverDiv").fadeOut("fast")},resizeContainer:function(){if(document.all&&document.noResize){return}var c=document.getElementById("containerDiv");var a=$("div.userManagerSection");var e=$("div.sidePanel");if(typeof c.style.maxHeight!="undefined"){c.style.minHeight=$(window).height()-67+"px"}else{c.style.height=(document.innerHeight||document.documentElement.clientHeight)-67+"px";if(c.offsetWidth<950){c.style.width="950px"}else{c.style.width="auto"}}var d=$("#organizeDiv").outerHeight();var b=parseInt(e.css("padding-bottom"))+parseInt(e.css("padding-top"));e.css("height",d-b-2+"px");document.noResize=true;setTimeout(function(){document.noResize=false},50)}};M={dom:{addClass:function(c,a){if(!M.dom.hasClass(c,a)){var b=c.className.split(" ");b.push(a);c.className=b.join(" ")}},removeClass:function(d,a){var c=d.className.split(" ");for(var b=c.length-1;b>=0;b--){if(c[b]==a){c.splice(b,1)}}d.className=c.join(" ")},hasClass:function(d,a){var c=d.className.split(" ");for(var b=c.length-1;b>=0;b--){if(c[b]==a){return true}}return false},getOffset:function(b,a){var c=b[a];while(b=b.offsetParent){c+=b[a]}return parseInt(c)}},postObj:function(c){var b=document.createElement("form");b.action=document.location.href;b.method="post";b.target="_self";for(property in c){var a=document.createElement("input");a.type="hidden";a.name=property;a.value=c[property];b.appendChild(a)}document.body.appendChild(b);b.submit()}};function detectBrowser(){var BO=new Object();BO.ie=false
/*@cc_on || true @*/
;BO.ie4=BO.ie&&(document.getElementById==null);BO.ie5=BO.ie&&(document.namespaces==null)&&(!BO.ie4);BO.ie6=BO.ie&&(document.implementation!=null)&&(document.implementation.hasFeature!=null);BO.ie55=BO.ie&&(document.namespaces!=null)&&(!BO.ie6);
/*@cc_on
    BO["ie7"]       = @_jscript_version == '5.7';
    @*/
BO.ns4=!BO.ie&&(document.layers!=null)&&(window.confirm!=null)&&(document.createElement==null);BO.opera=(self.opera!=null);BO.gecko=(document.getBoxObjectFor!=null);BO.khtml=(navigator.vendor=="KDE");BO.konq=((navigator.vendor=="KDE")||(document.childNodes)&&(!document.all)&&(!navigator.taintEnabled));BO.safari=(document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(!navigator.accentColorName);BO["safari1.2"]=(parseInt(0).toFixed==null)&&(BO.safari&&(window.XMLHttpRequest!=null));BO["safari2.0"]=(parseInt(0).toFixed!=null)&&BO.safari&&!BO["safari1.2"];BO["safari1.1"]=BO.safari&&!BO["safari1.2"]&&!BO["safari2.0"];return BO}var BO=new detectBrowser();Events={_events:new Array(),_cleanup:new Array(),attach:function(c,b,a){if(c===window&&b=="unload"){this._cleanup[this._cleanup.length]={obj:c,type:b,fn:a}}else{if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c["e"+b+a]=a;c[b+a]=function(){var d=window.event;d.target=d.srcElement;c["e"+b+a](d)};c.attachEvent("on"+b,c[b+a])}}this._events[this._events.length]={obj:c,type:b,fn:a}}},detach:function(e,d,c,b){if(e.removeEventListener){e.removeEventListener(d,c,false)}else{if(e.detachEvent){e.detachEvent("on"+d,e[d+c]);e[d+c]=null;e["e"+d+c]=null}}if(!b){for(var a=0;a<this._events.length;a++){if(this._events[a].obj==e&&this._events[a].type==d&&this._events[a].fn==c){this._events.splice(a,1);break}}}},cleanup:function(b){while(this._events.length){var a=this._events.pop();this.detach(a.obj,a.type,a.fn,true);a=null}while(this._cleanup.length){this._cleanup.pop().fn(b)}},stop:function(a){a=a||window.event;if(a){a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}}};window.onunload=function(a){Events.cleanup(a)};HideFileInput.prototype={toString:function(){return"[object HideFileInput]"},xMin:0,xMax:0,yMin:0,yMax:0,fileInput:null,fileInputOffset:0,fileInputWidth:0,alternateElementRef:null,register:function(c){var c=c||window.event;var b=c.target||c.srcElement;var a=$(b).offset();this.xMin=a.left;this.yMin=a.top;this.xMax=this.xMin+b.offsetWidth;this.yMax=this.yMin+b.offsetHeight;this.fileInput.style.display="block";this.fileInputOffset=Math.floor(this.fileInput.offsetHeight/2);this.fileInputWidth=this.fileInput.offsetWidth},mousemove:function(c){var c=c||window.event;var a=c.pageX||c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft);var d=c.pageY||c.clientY+(document.documentElement.scrollTop||document.body.scrollTop);if(this.fileInput.style.display!="none"&&(a<this.xMin||a>this.xMax||d<this.yMin||d>this.yMax)){this.fileInput.style.display="none"}if(this.fileInput.offsetParent&&!BO.safari){var b=$(this.fileInput).offsetParent().offset();a-=b.left;d-=b.top}this.fileInput.style.left=a-this.fileInputWidth+this.fileInputOffset+"px";this.fileInput.style.top=d-this.fileInputOffset+"px"},destruct:function(){this.alternateElementRef.onmouseover=null;this.fileInput.onmousedown=null;this.fileInput.onmouseup=null;this.fileInput.onmouseover=null;this.fileInput.onclick=null;Events.detach(document,"mousemove",this.closure);this.fileInput.style.display="";this.fileInput.style.top="";this.fileInput.style.left="";this.fileInput.className="";this.fileInput=null;this.closure=null}};function HideFileInput(b,a){if(BO&&(BO.ie5||BO.ie4||BO.khtml)){return false}this.alternateElementRef=a;this.fileInput=b;M.dom.addClass(this.alternateElementRef,"active");M.dom.addClass(this.fileInput,"moving");this.fileInput.style.display="none";var c=this;this.alternateElementRef.onmouseover=function(d){c.register(d)};this.closure=function(d){return function(f){d.mousemove(f)}}(this);Events.attach(document,"mousemove",this.closure)}(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this}})(jQuery);(function(d){d.fn.extend({renderCalendar:function(q){var B=function(r){return document.createElement(r)};q=d.extend({month:null,year:null,renderCallback:null,showHeader:d.dpConst.SHOW_HEADER_SHORT,dpController:null,hoverClass:"dp-hover"},q);if(q.showHeader!=d.dpConst.SHOW_HEADER_NONE){var n=d(B("tr"));for(var v=Date.firstDayOfWeek;v<Date.firstDayOfWeek+7;v++){var h=v%7;var u=Date.dayNames[h];n.append(jQuery(B("th")).attr({scope:"col",abbr:u,title:u,"class":(h==0||h==6?"weekend":"weekday")}).html(q.showHeader==d.dpConst.SHOW_HEADER_SHORT?u.substr(0,1):u))}}var e=d(B("table")).attr({cellspacing:2,className:"jCalendar"}).append((q.showHeader!=d.dpConst.SHOW_HEADER_NONE?d(B("thead")).append(n):B("thead")));var f=d(B("tbody"));var y=(new Date()).zeroTime();var A=q.month==undefined?y.getMonth():q.month;var o=q.year||y.getFullYear();var l=new Date(o,A,1);var k=Date.firstDayOfWeek-l.getDay()+1;if(k>1){k-=7}var p=Math.ceil(((-1*k+1)+l.getDaysInMonth())/7);l.addDays(k-1);var z=function(){if(q.hoverClass){d(this).addClass(q.hoverClass)}};var g=function(){if(q.hoverClass){d(this).removeClass(q.hoverClass)}};var m=0;while(m++<p){var t=jQuery(B("tr"));for(var v=0;v<7;v++){var j=l.getMonth()==A;var x=d(B("td")).text(l.getDate()+"").attr("className",(j?"current-month ":"other-month ")+(l.isWeekend()?"weekend ":"weekday ")+(j&&l.getTime()==y.getTime()?"today ":"")).hover(z,g);if(q.renderCallback){q.renderCallback(x,l,A,o)}t.append(x);l.addDays(1)}f.append(t)}e.append(f);return this.each(function(){d(this).empty().append(e)})},datePicker:function(e){if(!d.event._dpCache){d.event._dpCache=[]}e=d.extend({month:undefined,year:undefined,startDate:undefined,endDate:undefined,inline:false,renderCallback:[],createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,clickInput:false,verticalPosition:d.dpConst.POS_TOP,horizontalPosition:d.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:"dp-hover"},e);return this.each(function(){var g=d(this);var j=true;if(!this._dpId){this._dpId=d.event.guid++;d.event._dpCache[this._dpId]=new a(this);j=false}if(e.inline){e.createButton=false;e.displayClose=false;e.closeOnSelect=false;g.empty()}var f=d.event._dpCache[this._dpId];f.init(e);if(!j&&e.createButton){f.button=d('<a href="#" class="dp-choose-date" title="'+d.dpText.TEXT_CHOOSE_DATE+'">'+d.dpText.TEXT_CHOOSE_DATE+"</a>").bind("click",function(){g.dpDisplay(this);this.blur();return false});g.after(f.button)}if(!j&&g.is(":text")){g.bind("dateSelected",function(l,k,m){this.value=k.asString()}).bind("change",function(){var k=Date.fromString(this.value);if(k){f.setSelected(k,true,true)}});if(e.clickInput){g.bind("click",function(){g.dpDisplay()})}var h=Date.fromString(this.value);if(this.value!=""&&h){f.setSelected(h,true,true)}}g.addClass("dp-applied")})},dpSetDisabled:function(e){return b.call(this,"setDisabled",e)},dpSetStartDate:function(e){return b.call(this,"setStartDate",e)},dpSetEndDate:function(e){return b.call(this,"setEndDate",e)},dpGetSelected:function(){var e=c(this[0]);if(e){return e.getSelected()}return null},dpSetSelected:function(g,f,e){if(f==undefined){f=true}if(e==undefined){e=true}return b.call(this,"setSelected",Date.fromString(g),f,e)},dpSetDisplayedMonth:function(e,f){return b.call(this,"setDisplayedMonth",Number(e),Number(f))},dpDisplay:function(f){return b.call(this,"display",f)},dpSetRenderCallback:function(e){return b.call(this,"setRenderCallback",e)},dpSetPosition:function(e,f){return b.call(this,"setPosition",e,f)},dpSetOffset:function(e,f){return b.call(this,"setOffset",e,f)},dpClose:function(){return b.call(this,"_closeCalendar",false,this[0])},_dpDestroy:function(){}});var b=function(h,g,e,j){return this.each(function(){var f=c(this);if(f){f[h](g,e,j)}})};function a(e){this.ele=e;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.selectMultiple=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context="#dp-popup"}d.extend(a.prototype,{init:function(e){this.setStartDate(e.startDate);this.setEndDate(e.endDate);this.setDisplayedMonth(Number(e.month),Number(e.year));this.setRenderCallback(e.renderCallback);this.showYearNavigation=e.showYearNavigation;this.closeOnSelect=e.closeOnSelect;this.displayClose=e.displayClose;this.selectMultiple=e.selectMultiple;this.verticalPosition=e.verticalPosition;this.horizontalPosition=e.horizontalPosition;this.hoverClass=e.hoverClass;this.setOffset(e.verticalOffset,e.horizontalOffset);this.inline=e.inline;if(this.inline){this.context=this.ele;this.display()}},setStartDate:function(e){if(e){this.startDate=Date.fromString(e)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(e){if(e){this.endDate=Date.fromString(e)}if(!this.endDate){this.endDate=(new Date("12/31/2999"))}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setPosition:function(e,f){this.verticalPosition=e;this.horizontalPosition=f},setOffset:function(e,f){this.verticalOffset=parseInt(e)||0;this.horizontalOffset=parseInt(f)||0},setDisabled:function(e){$e=d(this.ele);$e[e?"addClass":"removeClass"]("dp-disabled");if(this.button){$but=d(this.button);$but[e?"addClass":"removeClass"]("dp-disabled");$but.attr("title",e?"":d.dpText.TEXT_CHOOSE_DATE)}if($e.is(":text")){$e.attr("disabled",e?"disabled":"")}},setDisplayedMonth:function(f,k){if(this.startDate==undefined||this.endDate==undefined){return}var h=new Date(this.startDate.getTime());h.setDate(1);var j=new Date(this.endDate.getTime());j.setDate(1);var g;if((!f&&!k)||(isNaN(f)&&isNaN(k))){g=new Date().zeroTime();g.setDate(1)}else{if(isNaN(f)){g=new Date(k,this.displayedMonth,1)}else{if(isNaN(k)){g=new Date(this.displayedYear,f,1)}else{g=new Date(k,f,1)}}}if(g.getTime()<h.getTime()){g=h}else{if(g.getTime()>j.getTime()){g=j}}this.displayedMonth=g.getMonth();this.displayedYear=g.getFullYear()},setSelected:function(g,e,f){if(this.selectMultiple==false){this.selectedDates={};d("td.selected",this.context).removeClass("selected")}if(f){this.setDisplayedMonth(g.getMonth(),g.getFullYear())}this.selectedDates[g.toString()]=e},isSelected:function(e){return this.selectedDates[e.toString()]},getSelected:function(){var e=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){e.push(Date.parse(s))}}return e},display:function(e){if(d(this.ele).is(".dp-disabled")){return}e=e||this.ele;var m=this;var h=d(e);var l=h.offset();var n;var o;var g;var j;if(m.inline){n=d(this.ele);o={id:"calendar-"+this.ele._dpId,className:"dp-popup dp-popup-inline"};j={}}else{n=d("body");o={id:"dp-popup",className:"dp-popup"};j={top:l.top+m.verticalOffset,left:l.left+m.horizontalOffset};var k=function(r){var p=r.target;var q=d("#dp-popup")[0];while(true){if(p==q){return true}else{if(p==document){m._closeCalendar();return false}else{p=d(p).parent()[0]}}}};this._checkMouse=k;this._closeCalendar(true)}n.append(d("<div></div>").attr(o).css(j).append(d("<h2></h2>"),d('<div class="dp-nav-prev"></div>').append(d('<a class="dp-nav-prev-year" href="#" title="'+d.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,-1)}),d('<a class="dp-nav-prev-month" href="#" title="'+d.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,-1,0)})),d('<div class="dp-nav-next"></div>').append(d('<a class="dp-nav-next-year" href="#" title="'+d.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,0,1)}),d('<a class="dp-nav-next-month" href="#" title="'+d.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind("click",function(){return m._displayNewMonth.call(m,this,1,0)})),d("<div></div>").attr("className","dp-calendar")).bgIframe());var f=this.inline?d(".dp-popup",this.context):d("#dp-popup");if(this.showYearNavigation==false){d(".dp-nav-prev-year, .dp-nav-next-year",m.context).css("display","none")}if(this.displayClose){f.append(d('<a href="#" id="dp-close">'+d.dpText.TEXT_CLOSE+"</a>").bind("click",function(){m._closeCalendar();return false}))}m._renderCalendar();d(this.ele).trigger("dpDisplayed",f);if(!m.inline){if(this.verticalPosition==d.dpConst.POS_BOTTOM){f.css("top",l.top+h.height()-f.height()+m.verticalOffset)}if(this.horizontalPosition==d.dpConst.POS_RIGHT){f.css("left",l.left+h.width()-f.width()+m.horizontalOffset)}d(document).bind("mousedown",this._checkMouse)}},setRenderCallback:function(e){if(e&&typeof(e)=="function"){e=[e]}this.renderCallback=this.renderCallback.concat(e)},cellRender:function(k,e,h,g){var l=this.dpController;var j=new Date(e.getTime());k.bind("click",function(){var n=d(this);if(!n.is(".disabled")){l.setSelected(j,!n.is(".selected")||!l.selectMultiple);var m=l.isSelected(j);d(l.ele).trigger("dateSelected",[j,k,m]);d(l.ele).trigger("change");if(l.closeOnSelect){l._closeCalendar()}else{n[m?"addClass":"removeClass"]("selected")}}});if(l.isSelected(j)){k.addClass("selected")}for(var f=0;f<l.renderCallback.length;f++){l.renderCallback[f].apply(this,arguments)}},_displayNewMonth:function(f,e,g){if(!d(f).is(".disabled")){this.setDisplayedMonth(this.displayedMonth+e,this.displayedYear+g);this._clearCalendar();this._renderCalendar();d(this.ele).trigger("dpMonthChanged",[this.displayedMonth,this.displayedYear])}f.blur();return false},_renderCalendar:function(){d("h2",this.context).html(Date.monthNames[this.displayedMonth]+" "+this.displayedYear);d(".dp-calendar",this.context).renderCalendar({month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass});if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){d(".dp-nav-prev-year",this.context).addClass("disabled");d(".dp-nav-prev-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())>20){h.addClass("disabled")}});var g=this.startDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var h=d(this);if(Number(h.text())<g){h.addClass("disabled")}})}else{d(".dp-nav-prev-year",this.context).removeClass("disabled");d(".dp-nav-prev-month",this.context).removeClass("disabled");var g=this.startDate.getDate();if(g>20){var f=new Date(this.startDate.getTime());f.addMonths(1);if(this.displayedYear==f.getFullYear()&&this.displayedMonth==f.getMonth()){d("dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())<g){h.addClass("disabled")}})}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){d(".dp-nav-next-year",this.context).addClass("disabled");d(".dp-nav-next-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())<14){h.addClass("disabled")}});var g=this.endDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var h=d(this);if(Number(h.text())>g){h.addClass("disabled")}})}else{d(".dp-nav-next-year",this.context).removeClass("disabled");d(".dp-nav-next-month",this.context).removeClass("disabled");var g=this.endDate.getDate();if(g<13){var e=new Date(this.endDate.getTime());e.addMonths(-1);if(this.displayedYear==e.getFullYear()&&this.displayedMonth==e.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())>g){h.addClass("disabled")}})}}}},_closeCalendar:function(e,f){if(!f||f==this.ele){d(document).unbind("mousedown",this._checkMouse);this._clearCalendar();d("#dp-popup a").unbind();d("#dp-popup").empty().remove();if(!e){d(this.ele).trigger("dpClosed",[this.getSelected()])}}},_clearCalendar:function(){d(".dp-calendar td",this.context).unbind();d(".dp-calendar",this.context).empty()}});d.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1};d.dpText={TEXT_PREV_YEAR:"Previous year",TEXT_PREV_MONTH:"Previous month",TEXT_NEXT_YEAR:"Next year",TEXT_NEXT_MONTH:"Next month",TEXT_CLOSE:"Close",TEXT_CHOOSE_DATE:"Choose date"};d.dpVersion="$Id: jquery.datePicker.js 3739 2007-10-25 13:55:30Z kelvin.luck $";function c(e){if(e._dpId){return d.event._dpCache[e._dpId]}return false}if(d.fn.bgIframe==undefined){d.fn.bgIframe=function(){return this}}d(window).bind("unload",function(){var f=d.event._dpCache||[];for(var e in f){d(f[e].ele)._dpDestroy()}})})(jQuery);Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.abbrDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.abbrMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.firstDayOfWeek=1;Date.format="dd/mm/yyyy";Date.fullYearStart="20";(function(){function b(c,d){if(!Date.prototype[c]){Date.prototype[c]=d}}b("isLeapYear",function(){var c=this.getFullYear();return(c%4==0&&c%100!=0)||c%400==0});b("isWeekend",function(){return this.getDay()==0||this.getDay()==6});b("isWeekDay",function(){return !this.isWeekend()});b("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]});b("getDayName",function(c){return c?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});b("getMonthName",function(c){return c?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]});b("getDayOfYear",function(){var c=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-c.getTime())/86400000)});b("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});b("setDayOfYear",function(c){this.setMonth(0);this.setDate(c);return this});b("addYears",function(c){this.setFullYear(this.getFullYear()+c);return this});b("addMonths",function(d){var c=this.getDate();this.setMonth(this.getMonth()+d);if(c>this.getDate()){this.addDays(-this.getDate())}return this});b("addDays",function(c){this.setDate(this.getDate()+c);return this});b("addHours",function(c){this.setHours(this.getHours()+c);return this});b("addMinutes",function(c){this.setMinutes(this.getMinutes()+c);return this});b("addSeconds",function(c){this.setSeconds(this.getSeconds()+c);return this});b("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});b("asString",function(){var c=Date.format;return c.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear()+"").substring(2)).split("mmm").join(this.getMonthName(true)).split("mm").join(a(this.getMonth()+1)).split("dd").join(a(this.getDate()))});Date.fromString=function(g){var h=Date.format;var k=new Date("01/01/1977");var l=h.indexOf("yyyy");if(l>-1){k.setFullYear(Number(g.substr(l,4)))}else{k.setFullYear(Number(Date.fullYearStart+g.substr(h.indexOf("yy"),2)))}var c=h.indexOf("mmm");if(c>-1){var j=g.substr(c,3);for(var e=0;e<Date.abbrMonthNames.length;e++){if(Date.abbrMonthNames[e]==j){break}}k.setMonth(e)}else{k.setMonth(Number(g.substr(h.indexOf("mm"),2))-1)}k.setDate(Number(g.substr(h.indexOf("dd"),2)));if(isNaN(k.getTime())){return false}return k};var a=function(c){var d="0"+c;return d.substring(d.length-2)}})();