(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return!!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return!!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return+new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return!o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return-1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.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\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return!!T.firstChild},empty:function(T){return!T.firstChild},has:function(V,U,T){return!!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex"in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return!F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<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>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();;var Common={Browser:{isIE:function(){return jQuery.browser.msie},isOpera:function(){return jQuery.browser.opera},isSafari:function(){return jQuery.browser.safari},isMozilla:function(){return jQuery.browser.mozilla}},Class:{match:function(b,a){return $(b).hasClass(a)},add:function(b,a){return $(b).addClass(a)},replace:function(b,c,d,a){if(this.match(b,c)){this.remove(b,c);this.add(b,d)}else{if(a&&this.match(b,d)){this.remove(b,d);this.add(b,c)}else{this.add(b,d)}}},remove:function(b,a){return $(b).removeClass(a)}},Event:{TYPE_DOM_CONTENT_LOADED:"DOMContentLoaded",add:function(b,a,c){if(a==this.TYPE_DOM_CONTENT_LOADED){return $(document).ready(c)}$(b).bind(Common.Utils.isArray(a)?a.join(" "):a,c)},remove:function(b,a,c){$(b).unbind(Common.Utils.isArray(a)?a.join(" "):a,c)},cancel:function(a){var a=this.normalize(a);a.cancelBubble=true;a.returnValue=false;a.preventDefault();a.stopPropagation();return false},normalize:function(a){var a=jQuery.event.fix(a||window.event);a.iKeyCode=a.which;if(a.wheelDelta){a.iMouseWheelDelta=a.wheelDelta/120;if(window.opera){a.iMouseWheelDelta*=-1}}else{if(a.detail){a.iMouseWheelDelta=-a.detail/3}}return a},getAbsoluteCoords:function(a){var a=jQuery.event.fix(a||window.event);return{iLeft:a.pageX,iTop:a.pageY}}},Dom:{getUniqueId:function(a){return Common.Utils.getUniqueId(a)},getAbsoluteCoords:function(b){var a=$(b).offset();return{iTop:a.top,iLeft:a.left}},getAttribute:function(a,b){return $(a).attr(b)},createElement:function(d,c,e){var a="<"+d;if(c){$.each(c,function(g,f){if(typeof(f)!="undefined"){a+=" "+g+'="'+f+'"'}})}var b=$(a+" />");if(e){b.html(e)}return b.get(0)},setStyle:function(b,a){if(typeof(b.style.cssText)!="undefined"){b.style.cssText=a}else{b.setAttribute("style",a)}},getElementsByClassName:function(c,a,b,d){this.getElementsByClassName=function(g,e,f,h){return $(g).find((h?">":"")+(f?f:"")+"."+e)};return this.getElementsByClassName(c,a,b,d)}},Object:{extend:function(d,a,c){if(!a){return d}var d=d||{};for(var b in a){if((c||typeof(d[b])=="undefined")&&typeof(a[b])!="undefined"){d[b]=a[b]}}return d}},Observable:{aObservers:[],attach:function(d,f,c){var e=0;if(Common.Utils.isArray(d)){while(d[e]){this.attach(d[e++],f,c)}return}if(Common.Utils.isArray(f)){while(f[e]){this.attach(d,f[e++],c)}return}if(Common.Utils.isArray(c)){while(c[e]){this.attach(d,f,c[e++])}return}if(!this.aObservers[d]){this.aObservers[d]=[]}var b=this.aObservers[d],a=Common.Utils.getUniqueId(c);if(!b[a]){b[a]=[]}b[a].push(f)},detach:function(d,f,c){var e=0;if(Common.Utils.isArray(d)){while(d[e]){this.detach(d[e++],f,c)}return}if(Common.Utils.isArray(f)){while(f[e]){this.detach(d,f[e++],c)}return}if(Common.Utils.isArray(c)){while(c[e]){this.detach(d,f,c[e++])}return}var b=this.aObservers[d];if(!b){return}var a=Common.Utils.getUniqueId(c);if(b[a]){b[a].remove(f)}},notify:function(f,h,e){var c=this.aObservers[f];if(!c){return}var b=Common.Utils.getUniqueId(h);if(!c[b]){return}var d=0,a=c[b],g;while(g=a[d++]){g(f,h,e)}}},Utils:{getUniqueId:function(a){if(a.uniqueID){return a.uniqueID}if(!arguments.callee.counter){arguments.callee.counter=0}a.uniqueID="__uid-"+arguments.callee.counter++;return a.uniqueID},isArray:function(a){return Object.prototype.toString.call(a)==="[object Array]"}}};Common.Object.extend(Function.prototype,{inheritTo:function(c,e){var b=this,f=function(){if(this.__constructor){this.__constructor.apply(this,arguments)}},d=function(){};Common.Object.extend(f,b);d.prototype=this.prototype;f.prototype=new d();f.prototype.constructor=f;f.prototype.__self=f;if(c){for(var a in c){if(typeof(f.prototype[a])=="function"){(function(g){f.prototype[g]=function(){var j=this.__base;this.__base=b.prototype[g];var h=c[g].apply(this,arguments);this.__base=j;return h}})(a)}else{f.prototype[a]=c[a]}}}if(e){Common.Object.extend(f,e,true)}return f}});Common.Object.extend(Array.prototype,{isEmpty:function(){return this.length==0},remove:function(b){for(var a=0;a<this.length;a++){if(this[a]==b){this.splice(a,1);break}}},indexOf:function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return-1},indexOfByFunction:function(b,c){if(!c){return this.indexOf(b)}for(var a=0;a<this.length;a++){if(c(this[a],b)){return a}}return-1},contains:function(a,b){return this.indexOfByFunction(a,b)>-1},intersect:function(a){return $.grep(this.concat([]),function(b){return a.contains(b)})}});Common.Object.extend(String.prototype,{formatNumber:function(a,e){var a=a||" ",e=e||",",d=this.indexOf("."),c=d>-1?this.substring(d+1):"",f=d>-1?this.substring(0,d):this;if(f.length<5){return f+(d>-1?e+c:"")}var b="";while(f.length>3){b=f.substring(f.length-3)+(b.length>0?a:"")+b;f=f.substring(0,f.length-3)}b=f+a+b+(d>-1?e+c:"");return b}});Common.Object.extend(Number.prototype,{formatNumber:function(a,b){return this.toString().formatNumber(a,b)}});function Abstract(){throw("abstract class")}Common.Utils.StringBuffer=Abstract.inheritTo({__constructor:function(a){this.aBuffer=[];if(a){this.append(a)}},append:function(a){this.aBuffer.push(a);return this},get:function(){return this.aBuffer.join("")},clear:function(){this.aBuffer=[];return this}});document.documentElement.id="with-js";window.onerror=function(){$("body").addClass("with-js-error")};var ZForms={EVENT_TYPE_ON_INIT:"zf:oninit",EVENT_TYPE_ON_CHANGE:"zf:onchange",EVENT_TYPE_ON_BEFORE_SUBMIT:"zf:onbeforesubmit",EVENT_TYPE_ON_READY_CHANGE:"zf:onreadychange",createWidget:function(){return new arguments[0](arguments[1][0],arguments[1][1],arguments[1][2])},createTextInput:function(){return this.createWidget(ZForms.Widget.Text,arguments)},createNumberInput:function(){return this.createWidget(ZForms.Widget.Text.Number,arguments)},createSelectInput:function(){return this.createWidget(ZForms.Widget.Select,arguments)},createComboInput:function(){return this.createWidget(ZForms.Widget.Text.Combo,arguments)},createContainer:function(){return this.createWidget(ZForms.Widget.Container,arguments)},createDateInput:function(){return this.createWidget(ZForms.Widget.Container.Date,arguments)},createInputGroup:function(){var b=this.createWidget(arguments[0],arguments[1]);if(arguments[1][3]){for(var a=0;a<arguments[1][3].length;a++){b.addChild(this.createStateInput(arguments[1][3][a][0],arguments[1][3][a][1],arguments[1][2]))}}return b},createStateInput:function(){return this.createWidget(ZForms.Widget.Text.State,arguments)},createCheckBoxGroup:function(){return this.createInputGroup(ZForms.Widget.Container.Group.CheckBox,arguments)},createRadioButtonGroup:function(){return this.createInputGroup(ZForms.Widget.Container.Group.RadioButton,arguments)},createSlider:function(){return this.createWidget(ZForms.Widget.Container.Slider,arguments)},createSliderVertical:function(){return this.createWidget(ZForms.Widget.Container.Slider.Vertical,arguments)},createButton:function(){return this.createWidget(ZForms.Widget.Button,arguments)},createSubmitButton:function(){return this.createWidget(ZForms.Widget.Button.Submit,arguments)},createSheet:function(){return this.createWidget(ZForms.Widget.Container.Sheet,arguments)},createSheetContainer:function(){return this.createWidget(ZForms.Widget.Container.SheetContainer,arguments)},createMultiplicator:function(){return this.createWidget(ZForms.Widget.Container.Multiplicator,arguments)},createForm:function(){this.aForms.push(this.createWidget(ZForms.Widget.Container.Form,arguments));return this.aForms[this.aForms.length-1]},createEnabledDependence:function(a,b){return new this.Dependence.Enabled(a,b.rPattern,b.iLogic,b.bInverse,b.bFocusOnEnable)},createRequiredDependence:function(a,b){var b=b||{};return new this.Dependence.Required(a,b.rPattern?b.rPattern:(b.iMin>1?new RegExp("\\S.{"+(b.iMin-2)+",}\\S"):/\S+/),b.iLogic,false,b.iMin)},createValidDependence:function(a,b){var b=b||{};return new this.Dependence.Valid(a,b.rPattern,b.iLogic,b.bInverse,b.sClassName,b.bCheckForEmpty)},createValidEmailDependence:function(a,b){return this.createValidDependence(a,Common.Object.extend({rPattern:/^[a-zA-Z0-9][a-zA-Z0-9\.\-\_\~]*\@[a-zA-Z0-9\.\-\_]+\.[a-zA-Z]{2,4}$/},b))},createOptionsDependence:function(a,b){var b=b||{};return new this.Dependence.Options(this.Dependence.TYPE_OPTIONS,a,b.aPatterns||[],b.iLogic)},createClassDependence:function(a,b){var b=b||{};return new this.Dependence.Class(a,b.aPatternToClasses||[],b.iLogic)},createFunctionDependence:function(a,b){var b=b||{};return new this.Dependence.Function(b.iType||ZForms.Dependence.TYPE_VALID,a,b.fFunction||function(){return true},b.iLogic,b.bInverse)},createCompareDependence:function(a,b){var b=b||{},c=function(f,g){var e=(arguments.callee.iType==ZForms.Dependence.TYPE_VALID&&!arguments.callee.oOptions.bCheckForEmpty&&arguments.callee.oWidget.getValue().isEmpty())||arguments.callee.oWidget.getValue()[arguments.callee.sFunctionName](arguments.callee.mArgument instanceof ZForms.Widget?arguments.callee.mArgument.getValue():arguments.callee.mArgument);if(arguments.callee.iType==ZForms.Dependence.TYPE_VALID&&arguments.callee.oOptions.sClassName){g.setResult({bAdd:!e,sClassName:arguments.callee.oOptions.sClassName})}else{if(arguments.callee.iType==ZForms.Dependence.TYPE_ENABLED&&arguments.callee.oOptions.bFocusOnEnable){g.setResult({bFocusOnEnable:e})}}return e},d=new this.Dependence.Function(b.iType,a,c,b.iLogic,b.bInverse);c.iType=b.iType;c.oWidget=a;c.mArgument=b.mArgument;c.sFunctionName=this.Dependence.COMPARE_FUNCTIONS[b.sCondition||"eq"];c.oOptions=b;if(!(b.mArgument instanceof ZForms.Widget)){return d}return[d,new this.Dependence.Function(b.iType,b.mArgument,c,b.iLogic,b.bInverse)]},createValidCompareDependence:function(a,b){return this.createCompareDependence(a,Common.Object.extend({iType:this.Dependence.TYPE_VALID},b))},createEnabledCompareDependence:function(a,b){return this.createCompareDependence(a,Common.Object.extend({iType:this.Dependence.TYPE_ENABLED},b))},buildForm:function(a){return new this.Builder(a).build()},throwException:function(a){throw("ZForms: "+a)},aForms:[],getFormById:function(a){return this.aForms[a]},bInited:false,isInited:function(){return this.bInited},attachObserver:function(c,d,b,a){Common.Observable.attach(c,d,b||this);if((c==this.EVENT_TYPE_ON_INIT&&b==this&&this.isInited())||a){d(c,b)}else{if(c==this.EVENT_TYPE_ON_READY_CHANGE){d(c,b,b.isReadyForSubmit())}}},detachObserver:function(b,c,a){Common.Observable.detach(b,c,a)},notifyObservers:function(b,c,a){Common.Observable.notify(b,c,a)}};ZForms.Value=Abstract.inheritTo({__constructor:function(a){this.mValue=null;this.reset();if(a!=null){this.set(a)}},reset:function(){this.set("")},get:function(){return this.mValue},set:function(a){this.mValue=typeof(a)=="string"?a:a.toString()},match:function(a){return a.test(this.get())},clone:function(){var a=new this.__self();a.set(this.get());return a},isEqual:function(b){if(!this.checkForCompareTypes(b)){return false}var a=(b instanceof this.__self)?b:new this.__self(b);return this.mValue===a.mValue},isGreater:function(b){if(!this.checkForCompareTypes(b)){return false}var a=(b instanceof this.__self)?b:new this.__self(b);return this.get().length>a.get().length},isGreaterOrEqual:function(a){return this.isGreater(a)||this.isEqual(a)},isLess:function(a){return this.checkForCompareTypes(a)&&!this.isGreaterOrEqual(a)},isLessOrEqual:function(a){return this.checkForCompareTypes(a)&&!this.isGreater(a)},checkForCompareTypes:function(a){return a instanceof this.__self||typeof(a)=="string"},isEmpty:function(){return this.mValue===""},toStr:function(){return this.get().toString()}});ZForms.Value.Number=ZForms.Value.inheritTo({set:function(a){this.mValue=parseFloat(a.toString().replace(/[^0-9\.\,\-]/g,"").replace(/\,/g,"."))},match:function(a){return a.test(isNaN(this.mValue)?"":this.mValue.toString())},isEmpty:function(){return isNaN(this.mValue)},isEqual:function(b){if(!this.checkForCompareTypes(b)){return false}var a=(b instanceof this.__self)?b:new this.__self((b instanceof ZForms.Value)?b.get():b);return this.get()===a.get()},isGreater:function(b){if(!this.checkForCompareTypes(b)){return false}var a=(b instanceof this.__self)?b:new this.__self((b instanceof ZForms.Value)?b.get():b);return this.get()>a.get()},checkForCompareTypes:function(a){return a instanceof this.__self||(a instanceof ZForms.Value&&!isNaN(parseFloat(a.get())))||typeof(a)=="number"||(typeof(a)=="string"&&!isNaN(parseFloat(a.toString())))},toStr:function(){return isNaN(this.mValue)?"":this.mValue.toString()}});ZForms.Value.Multiple=ZForms.Value.inheritTo({reset:function(){this.set([])},set:function(a){this.mValue=a instanceof Array?a:[a]},match:function(b){if(this.isEmpty()){return b.test("")}for(var a=0;a<this.mValue.length;a++){if(b.test(this.mValue[a])){return true}}return false},clone:function(){var b=new this.__self();for(var a=0;a<this.mValue.length;a++){b.add(this.mValue[a])}return b},isEqual:function(c){if(!(c instanceof this.__self||c instanceof Array)){return this.mValue.length==1&&this.mValue[0]===(c instanceof ZForms.Value?c.get():c)}var a=c instanceof this.__self?c:new this.__self(c);if(this.mValue.length!=a.mValue.length){return false}for(var b=0;b<this.mValue.length;b++){if(this.mValue[b]!=a.mValue[b]){return false}}return true},isGreater:function(a){if(!(a instanceof this.__self||a instanceof Array)){return false}return this.get().length>(a instanceof this.__self?a:new this.__self(a)).get().length},checkForCompareTypes:function(a){return a instanceof this.__self||a instanceof Array},isEmpty:function(){return this.mValue.length==0},add:function(a){if(this.mValue.contains(a)){return}this.mValue.push(a)},remove:function(a){this.mValue.remove(a)}});ZForms.Value.Date=ZForms.Value.inheritTo({reset:function(){this.mValue=[];this.mValue[this.__self.PART_YEAR]="";this.mValue[this.__self.PART_MONTH]="";this.mValue[this.__self.PART_DAY]=""},get:function(){if(this.isEmpty()){return""}return this.getYear()+"-"+this.getMonth()+"-"+this.getDay()},set:function(b){var c=null;if(b instanceof Date){c=b}else{var a=b.match(/^(-?\d{1,4})-(\d{1,2})-(-?\d{1,2})/);if(a){c=new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10))}}if(c){this.mValue[this.__self.PART_YEAR]=c.getFullYear();this.mValue[this.__self.PART_MONTH]=c.getMonth()+1;this.mValue[this.__self.PART_DAY]=c.getDate()}else{this.reset()}},isEqual:function(a){if(a instanceof this.__self.Time){return this.get()+" 0:0:0"==a.get()}if(a instanceof this.__self){return this.get()==a.get()}if(a instanceof ZForms.Value){return this.get()==a.get()}if(a instanceof Date){return this.get()==new this.__self(a).get()}return this.get()===a},isGreater:function(b){var a=(b instanceof ZForms.Value.Date)?b:new ZForms.Value.Date((b instanceof ZForms.Value)?b.get():b);if(this.isEmpty()||a.isEmpty()){return false}if(this.getYear()>a.getYear()){return true}if(this.getYear()==a.getYear()){if(this.getMonth()>a.getMonth()){return true}return this.getMonth()==a.getMonth()&&this.getDay()>a.getDay()}return false},checkForCompareTypes:function(a){if(a instanceof this.__self||a instanceof this.__self.Time){return!a.isEmpty()}if(a instanceof ZForms.Value){return!(new ZForms.Value.Date(a.get()).isEmpty())}if(typeof(a)=="string"){return!(new ZForms.Value.Date(a).isEmpty())}return a instanceof Date},isEmpty:function(){return!this.mValue||this.mValue[this.__self.PART_YEAR]==""||this.mValue[this.__self.PART_MONTH]==""||this.mValue[this.__self.PART_DAY]==""},getYear:function(){return this.mValue[this.__self.PART_YEAR]},getMonth:function(){return this.mValue[this.__self.PART_MONTH]},getDay:function(){return this.mValue[this.__self.PART_DAY]},toStr:function(){if(this.isEmpty()){return""}return this.getYear()+"-"+(this.getMonth()<10?"0":"")+this.getMonth()+"-"+(this.getDay()<10?"0":"")+this.getDay()}},{PART_YEAR:"year",PART_MONTH:"month",PART_DAY:"day"});ZForms.Value.Date.Time=ZForms.Value.Date.inheritTo({reset:function(){this.__base();this.mValue[this.__self.PART_HOUR]="";this.mValue[this.__self.PART_MINUTE]="";this.mValue[this.__self.PART_SECOND]=""},get:function(){if(this.isEmpty()){return""}return this.__base()+" "+this.getHour()+":"+this.getMinute()+":"+this.getSecond()},set:function(b){var c=null;if(b instanceof Date){c=b}else{var a=b.match(/^(-?\d{1,4})-(\d{1,2})-(-?\d{1,2})( (-?\d{1,2}):(-?\d{1,2}):(-?\d{1,2}))?/);if(a){c=new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10),a[5]?parseInt(a[5],10):0,a[6]?parseInt(a[6],10):0,a[7]?parseInt(a[7],10):0)}}if(c){this.mValue[this.__self.PART_YEAR]=c.getFullYear();this.mValue[this.__self.PART_MONTH]=c.getMonth()+1;this.mValue[this.__self.PART_DAY]=c.getDate();this.mValue[this.__self.PART_HOUR]=c.getHours();this.mValue[this.__self.PART_MINUTE]=c.getMinutes();this.mValue[this.__self.PART_SECOND]=c.getSeconds()}else{this.reset()}},isEqual:function(a){if(a instanceof this.__self){return this.get()==a.get()}if(a instanceof ZForms.Value.Date){return this.get()==a.get()+" 0:0:0"}if(a instanceof ZForms.Value||typeof(a)=="string"){return this.isEqual(new this.__self(typeof(a)=="string"?a:a.get()))}if(a instanceof Date){return this.get()==new this.__self(a).get()}return false},isGreater:function(b){if(this.__base(b)){return true}var a=(b instanceof this.__self)?b:new this.__self((b instanceof ZForms.Value.Date?b.get()+" 0:0:0":(b instanceof ZForms.Value?b.get():b)));if(this.getDay()==a.getDay()){if(this.getHour()>a.getHour()){return true}else{if(this.getHour()==a.getHour()){if(this.getMinute()>a.getMinute()){return true}else{return this.getMinute()==a.getMinute()&&this.getSecond()>a.getSecond()}}}}return false},checkForCompareTypes:function(a){if(a instanceof this.__self||a instanceof ZForms.Value.Date){return!a.isEmpty()}if(a instanceof ZForms.Value){return!(new ZForms.Value.Date(a.get()).isEmpty())}if(typeof(a)=="string"){return!(new ZForms.Value.Date.Time(a).isEmpty())}return a instanceof Date},isEmpty:function(){return this.__base()||this.mValue[this.__self.PART_HOUR]===""||this.mValue[this.__self.PART_MINUTE]===""||this.mValue[this.__self.PART_SECOND]===""},getHour:function(){return this.mValue[this.__self.PART_HOUR]},getMinute:function(){return this.mValue[this.__self.PART_MINUTE]},getSecond:function(){return this.mValue[this.__self.PART_SECOND]},toStr:function(){if(this.isEmpty()){return""}return this.__base()+" "+(this.getHour()<10?"0":"")+this.getHour()+":"+(this.getMinute()<10?"0":"")+this.getMinute()+":"+(this.getSecond()<10?"0":"")+this.getSecond()}},{PART_HOUR:"hour",PART_MINUTE:"minute",PART_SECOND:"second"});ZForms.Widget=Abstract.inheritTo({__constructor:function(b,c,a){this.oElement=b;this.oClassElement=c||b;this.oOptions=a?Common.Object.extend(this.getDefaultOptions(),a,true):this.getDefaultOptions();this.sId=Common.Dom.getAttribute(b,"id")||Common.Dom.getUniqueId(b);this.oDependenceProcessor=new ZForms.DependenceProcessor(this);this.aObservers=[];this.oParent=null;this.oForm=null;this.bEnabled=true;this.bRequired=false;this.bValid=true;this.oMultiplier=null;this.oValue=this.createValue();this.setValueFromElement(true);this.oInitialValue=this.oValue.clone();this.oLastProcessedValue=this.oValue.clone();this.bInitialValueChanged=false;this.bInited=false;this.addHandlers()},getDefaultOptions:function(){return{bTemplate:false,bFocusOnInit:false}},createValue:function(a){return new ZForms.Value(a)},addHandlers:function(){if(this.isTemplate()){return}var a=this;function b(c){var c=Common.Event.normalize(c);c.cancelBubble=true;a.processEvents(true)}Common.Event.add(this.oElement,this.getEventList(),b)},getEventList:function(){return[]},processEvents:function(c,b,a){this.setValueFromElement();if(!(b||this.isChanged())||this.isTemplate()){return}else{this.checkForInitialValueChanged();this.updateLastProcessedValue()}this.notifyObservers();ZForms.notifyObservers(ZForms.EVENT_TYPE_ON_CHANGE,this);if(!a){if(this.oParent){this.oParent.processEvents(c,true)}else{if(c&&this.oForm){this.oForm.updateSubmit()}}}},isChanged:function(){return!this.oValue.isEqual(this.oLastProcessedValue)},updateLastProcessedValue:function(){this.oLastProcessedValue=this.oValue.clone()},isInitialValueChanged:function(){return this.bInitialValueChanged},checkForInitialValueChanged:function(){if(!this.oForm){return}if(!this.isInitialValueChanged()&&!this.compareValueWithInitialValue()){this.oForm.increaseChangedCounter();this.bInitialValueChanged=true;this.addClass(this.__self.CLASS_NAME_CHANGED)}else{if(this.isInitialValueChanged()&&this.compareValueWithInitialValue()){this.oForm.decreaseChangedCounter();this.bInitialValueChanged=false;this.removeClass(this.__self.CLASS_NAME_CHANGED)}}},compareValueWithInitialValue:function(){return this.oValue.isEqual(this.oInitialValue)},init:function(){if(this.isTemplate()){return}if(this.oElement.disabled){this.disable()}this.processEvents(false,true);if(this.oMultiplier){this.oMultiplier.init()}if(this.oOptions.bFocusOnInit){this.focus()}this.bInited=true;ZForms.notifyObservers(ZForms.EVENT_TYPE_ON_INIT,this)},isInited:function(){return this.bInited},getValue:function(){return this.oValue},setValue:function(a){if(!this.hasValue()){return}this.oValue=a;this.processEvents(true)},setValueFromElement:function(){},hasValue:function(){return true},getId:function(){return this.sId},setId:function(a){this.sId=a},getName:function(){return this.oElement.name},isTemplate:function(){return this.oOptions.bTemplate},addClass:function(a,b){Common.Class.add(b?b:this.oClassElement,a)},removeClass:function(a,b){Common.Class.remove(b?b:this.oClassElement,a)},replaceClass:function(b,c,a){Common.Class.replace(a?a:this.oClassElement,b,c)},disable:function(a){if(!this.isEnabled()){return false}this.bEnabled=false;this.oElement.disabled=true;this.oClassElement.disabled=true;this.addClass(this.__self.CLASS_NAME_DISABLED);if(a){this.processEvents(true,true,true)}if(this.oMultiplier){this.oMultiplier.disableByOuter()}return true},enable:function(a){if(!this.allowEnable()){return false}this.bEnabled=true;this.oElement.disabled=false;this.oClassElement.disabled=false;this.removeClass(this.__self.CLASS_NAME_DISABLED);if(a){this.processEvents(true,true,true);this.updateByObservable(true)}if(this.oMultiplier){this.oMultiplier.enableByOuter()}return true},allowEnable:function(){return!this.isEnabled()&&!(this.oParent&&!this.oParent.isEnabled())},isEnabled:function(){return this.bEnabled},setRequired:function(){this.replaceClass(this.__self.CLASS_NAME_REQUIRED_OK,this.__self.CLASS_NAME_REQUIRED);this.bRequired=true},unsetRequired:function(){this.replaceClass(this.__self.CLASS_NAME_REQUIRED,this.__self.CLASS_NAME_REQUIRED_OK);this.bRequired=false},isRequired:function(){return this.bRequired},setValid:function(){if(this.hasValue()&&this.getValue().isEmpty()){this.removeClass(this.bValid?this.__self.CLASS_NAME_INVALID_OK:this.__self.CLASS_NAME_INVALID)}else{this.replaceClass(this.__self.CLASS_NAME_INVALID,this.__self.CLASS_NAME_INVALID_OK)}this.bValid=true},setInvalid:function(){this.replaceClass(this.__self.CLASS_NAME_INVALID_OK,this.__self.CLASS_NAME_INVALID);this.bValid=false},isValid:function(){return this.bValid},isReadyForSubmit:function(){return!this.isEnabled()||(!this.isRequired()&&(!this.oForm.oOptions.bCheckForValid||this.isValid()))},setParent:function(a){this.oParent=a},setForm:function(a){if(this.oForm){return}this.oForm=a;a.addWidget(this)},hide:function(){this.addClass(this.__self.CLASS_NAME_INVISIBLE)},show:function(){this.removeClass(this.__self.CLASS_NAME_INVISIBLE)},focus:function(){var b=this.oParent;do{if(b instanceof ZForms.Widget.Container.Sheet){b.oParent.select(b)}b=b.oParent}while(b);try{this.oElement.focus()}catch(a){}},attachObserver:function(a){this.aObservers.push(a)},detachObserver:function(a){this.aObservers.remove(a)},detachObservers:function(){for(var d=0,a,c;d<this.aObservers.length;){if(this.aObservers[d]==this){d++;continue}c=this.aObservers[d];a=this.aObservers[d].getDependencies();for(var b=0;b<a.length;b++){if(a[b].getFrom()==this){this.aObservers[d].removeDependence(a[b])}}this.detachObserver(c);if(c.oParent){c.updateByObservable()}}},notifyObservers:function(){for(var a=0;a<this.aObservers.length;a++){this.aObservers[a].updateByObservable()}},updateByObservable:function(a){this.oDependenceProcessor.process();if(!a&&this.oParent){this.oParent.oDependenceProcessor.process()}},addDependence:function(b){if(b instanceof Array){for(var a=0;a<b.length;a++){this.addDependence(b[a])}return}b.getFrom().attachObserver(this);this.oDependenceProcessor.addDependence(b)},removeDependence:function(a){this.oDependenceProcessor.removeDependence(a)},getDependencies:function(){return this.oDependenceProcessor.getDependencies()},getMultiplier:function(){return this.oMultiplier},setMultiplier:function(a){this.oMultiplier=a},updateElements:function(a){this.oElement=document.getElementById(a>0?this.oElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+a:this.oElement.id);this.oClassElement=document.getElementById(a>0?this.oClassElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+a:this.oClassElement.id);this.updateId(this.oElement.id);if(this.oElement.attachEvent){this.addHandlers();this.addExtendedHandlers()}},updateId:function(a){this.oForm.removeWidget(this);this.setId(a);this.oForm.addWidget(this)},addId:function(a){this.setId(this.addIdToElement(this.oElement,this.__self.ID_PREFIX,a));this.addIdToElement(this.oClassElement,this.__self.ROW_ID_PREFIX,a);if(this.oMultiplier){this.oMultiplier.addId(a)}},addIdToElement:function(c,a,d){if(!!c.getAttribute("id")){return c.getAttribute("id")}var b=a+Common.Dom.getUniqueId(c)+(d>0?"_"+d:"");c.setAttribute("id",b);return b},addChild:function(a){return a},getCountChildrenByPattern:function(){return 0},destruct:function(){this.oElement=null;this.oClassElement=null;if(this.oMultiplier){this.oMultiplier.destruct()}},afterClone:function(){this.processEvents(true,true)},prepareForSubmit:function(){},addExtendedHandlers:function(){},removeChild:function(a){},removeChildren:function(a){},enableOptionsByValue:function(b,a){},clone:function(b,d,c){var a=Common.Object.extend({bTemplate:false},this.oOptions);return new this.__self(b,d,a)}},{CLASS_NAME_REQUIRED:"zf-required",CLASS_NAME_REQUIRED_OK:"zf-required-ok",CLASS_NAME_INVALID:"zf-invalid",CLASS_NAME_INVALID_OK:"zf-invalid-ok",CLASS_NAME_DISABLED:"zf-disabled",CLASS_NAME_INVISIBLE:"zf-invisible",CLASS_NAME_SELECTED:"zf-selected",CLASS_NAME_HIDDEN:"zf-hidden",CLASS_NAME_SELECTED_INITIAL:"zf-selected-initial",CLASS_NAME_CHANGED:"zf-changed",KEY_CODE_ARROW_RIGHT:39,KEY_CODE_ARROW_LEFT:37,KEY_CODE_ARROW_UP:38,KEY_CODE_ARROW_DOWN:40,KEY_CODE_PAGE_UP:33,KEY_CODE_PAGE_DOWN:34,KEY_CODE_HOME:36,KEY_CODE_END:35,KEY_CODE_ENTER:13,KEY_CODE_TAB:9,KEY_CODE_ESCAPE:27,DOM_EVENT_TYPE_KEYUP:"keyup",DOM_EVENT_TYPE_KEYDOWN:"keydown",DOM_EVENT_TYPE_KEYPRESS:"keypress",DOM_EVENT_TYPE_CLICK:"click",DOM_EVENT_TYPE_BLUR:"blur",DOM_EVENT_TYPE_FOCUS:"focus",DOM_EVENT_TYPE_CHANGE:"change",DOM_EVENT_TYPE_MOUSEDOWN:"mousedown",DOM_EVENT_TYPE_MOUSEUP:"mouseup",DOM_EVENT_TYPE_MOUSEMOVE:"mousemove",DOM_EVENT_TYPE_SELECTSTART:"selectstart",DOM_EVENT_TYPE_UNLOAD:"unload",DOM_EVENT_TYPE_BEFOREUNLOAD:"beforeunload",DOM_EVENT_TYPE_PASTE:"paste",ID_PREFIX:"input-",ROW_ID_PREFIX:"row-"});ZForms.Widget.Container=ZForms.Widget.inheritTo({__constructor:function(b,c,a){this.aChildren=[];this.__base(b,c,a)},addChild:function(b,a){if(a>-1&&a<this.aChildren.length){this.aChildren.splice(a,0,b)}else{this.aChildren.push(b)}b.setParent(this);if(this.oForm){b.setForm(this.oForm)}return b},removeChild:function(a){a.detachObservers();a.removeChildren();this.aChildren.remove(a);if(this.oForm){this.oForm.removeWidget(a);if(a.isInitialValueChanged()){this.oForm.decreaseChangedCounter()}}a.setParent(null);a=null},removeChildren:function(){while(this.aChildren.length>0){this.removeChild(this.aChildren[0])}},getChildren:function(){return this.aChildren},setForm:function(c){this.__base(c);for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].setForm(c)}},disable:function(a){if(!this.__base(a)){return false}for(var c=0,b=this.aChildren.length;c<b;c++){this.aChildren[c].disable(true)}return true},enable:function(a){if(!this.allowEnable()){return false}this.bEnabled=true;for(var c=0,b=this.aChildren.length;c<b;c++){this.aChildren[c].enable(true);this.aChildren[c].updateByObservable(true)}this.bEnabled=false;this.__base(a);return true},isValid:function(){if(!this.__base()){return false}for(var b=0,a=this.aChildren.length;b<a;b++){if(!this.aChildren[b].isValid()&&this.aChildren[b].isEnabled()){return false}}return true},isRequired:function(){if(this.__base()){return true}for(var b=0,a=this.aChildren.length;b<a;b++){if(this.aChildren[b].isRequired()&&this.aChildren[b].isEnabled()){return true}}return false},init:function(){for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].init()}this.__base()},afterClone:function(){this.__base();for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].afterClone()}},hasValue:function(){return false},isChanged:function(){return true},focus:function(){if(this.aChildren.length>0){this.aChildren[0].focus()}},getCountChildrenByPattern:function(c){var d=0;for(var b=0,a=this.aChildren.length;b<a;b++){if(!this.aChildren[b].isEnabled()){continue}if(this.aChildren[b]instanceof ZForms.Widget.Container){if(this.aChildren[b].getCountChildrenByPattern(c)>0){d++}}else{if(this.aChildren[b].getValue().match(c)){d++}}}return d},updateElements:function(c){this.__base(c);for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].updateElements(c)}},addId:function(c){this.__base(c);for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].addId(c)}},clone:function(a,d,c){var b=this.__base(a,d,c);this.cloneChildren(b,c);return b},cloneChildren:function(d,c){for(var b=0,a=this.aChildren.length;b<a;b++){d.addChild(this.aChildren[b].clone(document.getElementById(this.aChildren[b].oElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+c),document.getElementById(this.aChildren[b].oClassElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+c),c))}},destruct:function(){for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].destruct()}this.__base()},prepareForSubmit:function(){for(var b=0,a=this.aChildren.length;b<a;b++){this.aChildren[b].prepareForSubmit()}this.__base()}});ZForms.Widget.Container.Sheet=ZForms.Widget.Container.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.oLegendButton=null;this.oPrevButton=null;this.oNextButton=null;if(this.oOptions.oElementLegend){this.addLegendButton(new ZForms.Widget.Button(this.oOptions.oElementLegend,null,{bTemplate:this.oOptions.bTemplate}))}if(this.oOptions.oElementPrev){this.addPrevButton(new ZForms.Widget.Button(this.oOptions.oElementPrev,null,{bTemplate:this.oOptions.bTemplate}))}if(this.oOptions.oElementNext){this.addNextButton(new ZForms.Widget.Button(this.oOptions.oElementNext,null,{bTemplate:this.oOptions.bTemplate}))}this.bSelected=Common.Class.match(this.oClassElement,this.__self.CLASS_NAME_SELECTED)},addLegendButton:function(b){this.oLegendButton=b;this.addChild(b);var a=this;b.setHandler(function(){a.oParent.select(a);return false})},addPrevButton:function(b){this.oPrevButton=b;this.addChild(b);var a=this;b.setHandler(function(){a.oParent.prev(a);return false})},addNextButton:function(b){this.oNextButton=b;this.addChild(b);var a=this;b.setHandler(function(){a.oParent.next(a);return false})},setParent:function(a){this.__base(a);if(this.isSelected()){this.oParent.select(this)}},isSelected:function(){return this.bSelected},select:function(){this.bSelected=true;this.addClass(this.__self.CLASS_NAME_SELECTED);if(this.oLegendButton){this.oLegendButton.addClass(this.__self.CLASS_NAME_SELECTED)}},unselect:function(){this.bSelected=false;this.removeClass(this.__self.CLASS_NAME_SELECTED);if(this.oLegendButton){this.oLegendButton.removeClass(this.__self.CLASS_NAME_SELECTED)}},destruct:function(){if(this.oLegendButton){this.oLegendButton.destruct()}if(this.oPrevButton){this.oPrevButton.destruct()}if(this.oNextButton){this.oNextButton.destruct()}this.__base()}});ZForms.Widget.Container.SheetContainer=ZForms.Widget.Container.inheritTo({__constructor:function(b,c,a){this.__base(b||document.createElement("div"),c,a);this.iCurrentSheetIndex=0},addChild:function(a){if(!(a instanceof ZForms.Widget.Container.Sheet)){return}return this.__base(a)},findSheetIndex:function(a){return this.aChildren.indexOf(a)},select:function(a){this.selectByIndex(this.findSheetIndex(a))},prev:function(a){this.selectByIndex(this.findSheetIndex(a)-1)},next:function(a){this.selectByIndex(this.findSheetIndex(a)+1)},selectByIndex:function(a){if(!this.aChildren[a]){return}this.aChildren[this.iCurrentSheetIndex].unselect();this.aChildren[a].select();this.iCurrentSheetIndex=a}},{CLASS_NAME_INITED:"zf-sheetcontainer-inited"});ZForms.Widget.Container.Group=ZForms.Widget.Container.inheritTo({hasValue:function(){return true},getName:function(){return this.aChildren[0]?this.aChildren[0].oElement.name:""},addChild:function(a){if(!(a instanceof ZForms.Widget.Text.State)){return}return this.__base(a)},processEvents:function(d,b,a){this.__base(d,b,a);if(!a){for(var c=0;c<this.aChildren.length;c++){this.aChildren[c].updateLastProcessedValue();if(this.aChildren[c].isChecked()){this.aChildren[c].addClass(this.__self.CLASS_NAME_SELECTED)}else{this.aChildren[c].removeClass(this.__self.CLASS_NAME_SELECTED)}}}},enable:function(a){var b=this.__base(a);if(b&&!a){this.setValueFromElement()}return b},disable:function(a){var b=this.__base(this,a);if(b&&!a){this.setValueFromElement()}return b},isChanged:function(){return this.__base()}});ZForms.Widget.Container.Group.CheckBox=ZForms.Widget.Container.Group.inheritTo({createValue:function(a){return new ZForms.Value.Multiple(a)},setValue:function(b){for(var c=0,a=b.get();c<this.aChildren.length;c++){if(a.contains(this.aChildren[c].getValue().get())){this.aChildren[c].check()}else{this.aChildren[c].uncheck()}}this.__base(b)},setValueFromElement:function(){this.oValue.reset();for(var a=0;a<this.aChildren.length;a++){if(this.aChildren[a].isChecked()&&this.aChildren[a].isEnabled()){this.oValue.add(this.aChildren[a].getValue().get())}}this.__base()},addChild:function(a){if(!this.__base(a)){return}if(a.isChecked()){this.oValue.add(a.getValue().get());this.oInitialValue.add(a.getValue().get())}return a},enableOptionsByValue:function(g,h,b){for(var e=0,a,l,f;e<this.aChildren.length;e++){l=this.aChildren[e];f=false;for(var d=0;d<g.length;d++){a=false;for(var c=0;c<g[d].length&&!a;c++){a=l.getValue().match(g[d][c])?true:false}if(a){if(h||d==0){f=true}}else{if(!h){f=false}}}if(f){if(b){l.check()}else{if(this.isEnabled()){l.enable()}}}else{if(b){l.uncheck()}else{l.disable()}}}this.processEvents(true)}});ZForms.Widget.Container.Group.RadioButton=ZForms.Widget.Container.Group.inheritTo({setValue:function(a){for(var b=0;b<this.aChildren.length;b++){if(a.isEqual(this.aChildren[b].getValue())){this.aChildren[b].check()}}this.__base(a)},setValueFromElement:function(){this.oValue.reset();for(var a=0;a<this.aChildren.length;a++){if(this.aChildren[a].isChecked()&&this.aChildren[a].isEnabled()){this.oValue.set(this.aChildren[a].getValue().get());break}}this.__base()},addChild:function(a){if(!this.__base(a)){return}if(a.isChecked()){this.oValue.set(a.getValue().get());this.oInitialValue.set(a.getValue().get())}return a},enableOptionsByValue:function(h,l){var b=false,d=-1;for(var f=0,a,m,g;f<this.aChildren.length;f++){m=this.aChildren[f];g=false;for(var e=0;e<h.length;e++){a=false;for(var c=0;c<h[e].length&&!a;c++){a=m.getValue().match(h[e][c])?true:false}if(a){if(d<0){d=f}if(l||e==0){g=true}}else{if(!l){g=false}}}if(g&&this.isEnabled()){m.enable()}else{if(m.isEnabled()){m.disable()}}if(!m.isEnabled()&&m.isChecked()){b=true}}if(b&&d>-1){this.oValue.set(this.aChildren[d].getValue());this.aChildren[d].check()}this.processEvents(true)}});ZForms.Widget.Text=ZForms.Widget.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.bPlaceHolderEnabled=false;this.iMaxLength=this.oOptions.iMaxLength?this.oOptions.iMaxLength:(b.maxLength>0?b.maxLength:0);this.bTextArea=this.oElement.tagName.toLowerCase()=="textarea";this.bNeedReplaceType=this.hasPlaceHolder()&&this.oElement.type.toLowerCase()=="password";this.oPasswordReplacerElement=this.createPasswordElement();if(!this.isTemplate()){this.addExtendedHandlers()}},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{sPlaceHolder:""},true)},updateElementValue:function(a){if(a.isEmpty()&&this.bPlaceHolderEnabled){return}this.oElement.value=a.toStr()},setValue:function(a){if(a.isEmpty()){this.updateElementValue(a);this.enablePlaceHolder()}else{this.disablePlaceHolder();this.updateElementValue(this.processValueMaxLength(a))}this.__base(a)},getEventList:function(){return[this.__self.DOM_EVENT_TYPE_KEYUP,this.__self.DOM_EVENT_TYPE_BLUR,this.__self.DOM_EVENT_TYPE_CHANGE]},setValueFromElement:function(){if(!this.oElement){return}if(this.bPlaceHolderEnabled){return}this.oValue=this.processValueMaxLength(this.createValue(this.oElement.value));this.__base()},init:function(){if(!this.isTemplate()){this.enablePlaceHolder()}this.__base()},focus:function(){if(this.oPasswordReplacerElement&&this.bPlaceHolderEnabled){this.oPasswordReplacerElement.focus()}else{this.__base()}},afterClone:function(){this.__base();this.enablePlaceHolder()},hasPlaceHolder:function(){return!!this.oOptions.sPlaceHolder},addExtendedHandlers:function(){if(this.isTemplate()){return false}var a=this;this.addMaxLengthHandlers();Common.Event.add(this.oPasswordReplacerElement||this.oElement,this.__self.DOM_EVENT_TYPE_FOCUS,function(){a.addClass(a.__self.CLASS_NAME_FOCUSED);if(a.disablePlaceHolder()&&Common.Browser.isIE()){a.oElement.createTextRange().select()}});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_BLUR,function(){if(a.oElement){a.removeClass(a.__self.CLASS_NAME_FOCUSED);a.enablePlaceHolder()}});return true},addMaxLengthHandlers:function(){if(this.iMaxLength==0){return}if(!this.bTextArea){this.oElement.maxLength=this.iMaxLength;return}var a=this,b;if(Common.Browser.isOpera()&&this.oElement.isSameNode){Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYDOWN,function(c){b=c.keyCode})}Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYPRESS,function(d){var d=Common.Event.normalize(d);if(d.iKeyCode!=13&&(d.ctrlKey||d.metaKey||d.charCode==0||d.which==0||(b==d.keyCode&&(d.keyCode==46||d.keyCode==45||d.keyCode==36||d.keyCode==35||d.keyCode==9||d.keyCode==8)))){return}var c=document.selection?document.selection.createRange().text.length:a.oElement.selectionEnd-a.oElement.selectionStart;if(c<=0&&a.oElement.value.length>=a.iMaxLength){Common.Event.cancel(d)}});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_PASTE,function(){setTimeout(function(){a.setValue(a.createValue(a.oElement.value))},0)});if(Common.Browser.isOpera()){Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_BLUR,function(){a.setValue(a.createValue(a.oElement.value))})}},processValueMaxLength:function(a){if(this.iMaxLength==0){return a}if(a.toStr().length>this.iMaxLength){a.set(a.get().toString().substr(0,this.iMaxLength))}return a},enablePlaceHolder:function(){if(this.bPlaceHolderEnabled||!this.hasPlaceHolder()||!this.getValue().isEmpty()){return false}this.addClass(this.__self.CLASS_NAME_PLACE_HOLDER,this.oPasswordReplacerElement||this.oElement);if(!this.bTextArea&&this.iMaxLength>0){this.oElement.maxLength=this.oOptions.sPlaceHolder.length}this.setPasswordAttribute(false);if(this.oPasswordReplacerElement){this.oPasswordReplacerElement.value=this.oOptions.sPlaceHolder}else{this.oElement.value=this.oOptions.sPlaceHolder}this.bPlaceHolderEnabled=true;return true},disablePlaceHolder:function(){if(!this.bPlaceHolderEnabled||!this.hasPlaceHolder()||!this.getValue().isEmpty()){return false}this.removeClass(this.__self.CLASS_NAME_PLACE_HOLDER,this.oElement);if(!this.bTextArea&&this.iMaxLength>0){this.oElement.maxLength=this.iMaxLength}this.oElement.value="";this.setPasswordAttribute(true);if(this.bNeedReplaceType&&Common.Browser.isOpera()){this.oElement.focus()}this.bPlaceHolderEnabled=false;return true},createPasswordElement:function(){if(!this.bNeedReplaceType||!Common.Browser.isIE()){return}return Common.Dom.createElement(this.oElement.tagName,{type:"text",name:this.oElement.name,id:this.oElement.id,"class":this.oElement.className,size:this.oElement.size,maxlength:this.oElement.maxLength,value:this.oElement.value,style:this.oElement.style.cssText})},setPasswordAttribute:function(b){if(!this.bNeedReplaceType){return}if(!this.oPasswordReplacerElement){this.oElement.type=b?"password":"text";return}if(b){if(!this.oPasswordReplacerElement.parentNode){return}this.oPasswordReplacerElement.parentNode.replaceChild(this.oElement,this.oPasswordReplacerElement);var a=this;setTimeout(function(){a.oElement.focus()},0)}else{if(!this.oElement.parentNode){return}this.oElement.parentNode.replaceChild(this.oPasswordReplacerElement,this.oElement)}},addId:function(a){this.__base(a);if(this.oPasswordReplacerElement){this.addIdToElement(this.oPasswordReplacerElement,this.__self.ID_PREFIX,a)}},destruct:function(){if(this.oPasswordReplacerElement){this.oPasswordReplacerElement=null}if(this.oElement){this.disablePlaceHolder()}this.__base()},prepareForSubmit:function(){this.disablePlaceHolder();this.__base()}},{CLASS_NAME_FOCUSED:"zf-focused",CLASS_NAME_PLACE_HOLDER:"zf-placeholder"});ZForms.Widget.Text.Number=ZForms.Widget.Text.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.oHiddenElement=null;this.iTimer=null;if(this.isTemplate()){return}this.replaceElement(b)},replaceElement:function(a){this.oHiddenElement=a.parentNode.insertBefore(Common.Dom.createElement("input",{type:"hidden",value:a.value}),a);if(a.getAttribute("id")){this.oHiddenElement.setAttribute("id","value-"+a.getAttribute("id"))}if(a.getAttribute("name")){this.oHiddenElement.setAttribute("name",a.getAttribute("name"));a.removeAttribute("name")}},getName:function(){return this.oHiddenElement?this.oHiddenElement.name:this.oElement.name},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{bFloat:false,bNegative:false,iErrorTimeout:230},true)},createValue:function(a){return new ZForms.Value.Number(a)},compareValueWithInitialValue:function(){return this.__base()||(this.oValue.isEmpty()&&this.oInitialValue.isEmpty())},addExtendedHandlers:function(){if(!this.__base()){return}var a=this,b=-1;if(Common.Browser.isOpera()&&this.oElement.isSameNode){Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYDOWN,function(c){b=c.keyCode})}Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYPRESS,function(c){if(a.iTimer){clearTimeout(a.iTimer);a.removeClass(a.__self.CLASS_NAME_INVALID_KEY)}var c=Common.Event.normalize(c);if(c.ctrlKey||c.metaKey||c.charCode==0||c.which==0||(b==c.keyCode&&(c.keyCode==46||c.keyCode==45||c.keyCode==36||c.keyCode==35||c.keyCode==9||c.keyCode==8))||c.keyCode==13||(c.iKeyCode>=48&&c.iKeyCode<=57)||(a.oOptions.bFloat&&(c.iKeyCode==44||c.iKeyCode==46)&&!/\.|\,/.test(a.oElement.value))||(a.oOptions.bNegative&&c.iKeyCode==45&&a.oElement.value.charAt(0)!="-"&&a.getCursorPosition()==0)){return}Common.Event.cancel(c);a.addClass(a.__self.CLASS_NAME_INVALID_KEY);a.iTimer=setTimeout(function(){a.removeClass(a.__self.CLASS_NAME_INVALID_KEY)},a.oOptions.iErrorTimeout)});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_BLUR,function(){if(a.bPlaceHolderEnabled){return}a.setValue(a.createValue(a.oElement.value))})},getCursorPosition:function(){if("selectionStart"in this.oElement){return this.oElement.selectionStart}if(document.selection){var c=document.selection.createRange();if(!c){return 0}var a=this.oElement.createTextRange(),b=a.duplicate();a.moveToBookmark(c.getBookmark());b.setEndPoint("EndToStart",a);return b.text.length}return 0},updateElementValue:function(a){this.oHiddenElement.value=a.toStr();if(ZForms.Resources.getNumberSeparator()==","){a=new ZForms.Value(a.toStr().replace(/\./g,","))}this.__base(a)},setValue:function(a){if(!a.isEmpty()){if(!this.oOptions.bFloat){a.set(parseInt(a.get().toString().replace(/[\.\,].*/g,""),10))}if(!this.oOptions.bNegative&&a.get()<0){a.set(a.get()*-1)}}return this.__base(a)},init:function(){this.__base();if(!this.bPlaceHolderEnabled){this.setValue(this.getValue())}},disable:function(a){if(!this.__base(a)){return false}if(this.oHiddenElement){this.oHiddenElement.disabled=true}return true},enable:function(a){if(!this.__base(a)){return false}if(this.oHiddenElement){this.oHiddenElement.disabled=false}return true},destruct:function(){this.oHiddenElement=null;this.__base()}},{CLASS_NAME_INVALID_KEY:"zf-invalid-key"});ZForms.Widget.Container.Date=ZForms.Widget.Container.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);if(this.isTemplate()){return}this.oDayInput=this.createNumberInput("day",2,this.oOptions.oPlaceHolders.sDay);this.oMonthInput=this.createMonthInput("month");this.oYearInput=this.createNumberInput("year",4,this.oOptions.oPlaceHolders.sYear);if(this.oOptions.bWithTime){this.oHourInput=this.createNumberInput("hour",2,this.oOptions.oPlaceHolders.sHour);this.oMinuteInput=this.createNumberInput("minute",2,this.oOptions.oPlaceHolders.sMinute);this.oSecondInput=this.createNumberInput("second",2,this.oOptions.oPlaceHolders.sSecond)}this.addChild(this.oDayInput);this.addChild(this.oMonthInput);this.addChild(this.oYearInput);if(this.oOptions.bWithTime){this.addChild(this.oHourInput);this.addChild(this.oMinuteInput);this.addChild(this.oSecondInput)}this.replaceElement();this.setValueFromElement();this.addExtendedHandlers();this.initValue();this.oCalendar=this.oOptions.oPickerOpenerElement?new ZForms.Calendar(this):null},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{bWithTime:false,bOnlyMonths:false,oPlaceHolders:{sDay:"",sYear:"",sHour:"",sMinute:"",sSecond:""}},true)},createValue:function(a){return this.oOptions.bWithTime?new ZForms.Value.Date.Time(a):new ZForms.Value.Date(a)},hasValue:function(){return true},setValue:function(c){var d=this.oDayInput.createValue(c.getDay()),b=this.oYearInput.createValue(c.getYear());if((this.oYearInput.getValue().isEmpty()||!b.isEmpty())&&!b.isEqual(this.oYearInput.getValue())){this.oYearInput.setValue(b)}this.oMonthInput.setValue(this.oMonthInput.createValue(c.getMonth()));if((this.oDayInput.getValue().isEmpty()||!d.isEmpty())&&!d.isEqual(this.oDayInput.getValue())){this.oDayInput.setValue(d)}if(this.oOptions.bWithTime){var f=this.oHourInput.createValue(c.getHour()),e=this.oMinuteInput.createValue(c.getMinute()),a=this.oSecondInput.createValue(c.getSecond());if((this.oHourInput.getValue().isEmpty()||!f.isEmpty())&&!f.isEqual(this.oHourInput.getValue())){this.oHourInput.setValue(f)}if((this.oMinuteInput.getValue().isEmpty()||!e.isEmpty())&&!e.isEqual(this.oMinuteInput.getValue())){this.oMinuteInput.setValue(e)}if((this.oSecondInput.getValue().isEmpty()||!a.isEmpty())&&!a.isEqual(this.oSecondInput.getValue())){this.oSecondInput.setValue(a)}}this.oElement.value=c.toStr();this.__base(c)},isRequired:function(){return ZForms.Widget.prototype.isRequired.call(this)},isValid:function(){return ZForms.Widget.prototype.isValid.call(this)},isChanged:function(){return ZForms.Widget.prototype.isChanged.call(this)},replaceElement:function(){var a=Common.Dom.createElement("input",{type:"hidden",id:this.oElement.getAttribute("id"),name:this.oElement.getAttribute("name"),value:this.oElement.value});this.oElement.parentNode.replaceChild(a,this.oElement);this.oElement=a},addExtendedHandlers:function(){if(this.isTemplate()){return}var b=this,a=this.oOptions.bWithTime?[this.oDayInput.oElement,this.oMonthInput.oElement,this.oYearInput.oElement,this.oHourInput.oElement,this.oMinuteInput.oElement,this.oSecondInput.oElement]:[this.oDayInput.oElement,this.oMonthInput.oElement,this.oYearInput.oElement];Common.Event.add(a,this.__self.DOM_EVENT_TYPE_BLUR,function(){b.processDate()});Common.Event.add(a,this.__self.DOM_EVENT_TYPE_KEYDOWN,function(c){if(Common.Event.normalize(c).iKeyCode==b.__self.KEY_CODE_ENTER){b.processDate()}})},processDate:function(){var d=this.oYearInput.getValue().get(),f=this.oMonthInput.getValue().get(),c=this.oDayInput.getValue().isEmpty()&&this.oOptions.bOnlyMonths?1:this.oDayInput.getValue().get(),b=this.oOptions.bWithTime?this.oHourInput.getValue().get():0,e=this.oOptions.bWithTime?this.oMinuteInput.getValue().get():0,a=this.oOptions.bWithTime?this.oSecondInput.getValue().get():0;this.setValue(this.createValue(this.oOptions.bWithTime?d+"-"+f+"-"+c+" "+b+":"+e+":"+a:d+"-"+f+"-"+c))},createNumberInput:function(b,c,a){var d=ZForms.createNumberInput(this.oElement.parentNode.insertBefore(Common.Dom.createElement("input",{type:this.oOptions.bOnlyMonths&&b=="day"?"hidden":"text",id:this.oElement.id?b+"-"+this.oElement.id:"",size:c,maxlength:c,"class":"zf-input-"+b}),this.oElement),null,{sPlaceHolder:a});d.checkForInitialValueChanged=function(){return false};return d},createMonthInput:function(a){var c=Common.Dom.createElement("select",{id:this.oElement.id?a+"-"+this.oElement.id:"","class":"zf-input-"+a}),e=this.oOptions.bOnlyMonths?ZForms.Resources.getMonthsByType("normal"):ZForms.Resources.getMonthsByType("genitive");document.body.appendChild(c);c.options.length=0;for(var b=0;b<e.length;b++){c.options[c.options.length]=new Option(e[b],b+1)}var d=ZForms.createSelectInput(this.oElement.parentNode.insertBefore(document.body.removeChild(c),this.oElement));d.checkForInitialValueChanged=function(){return false};return d},setValueFromElement:function(){if(this.isTemplate()||!this.oYearInput){return}this.oValue.set(this.oYearInput.getValue().get()+"-"+this.oMonthInput.getValue().get()+"-"+(this.oOptions.bOnlyMonths&&this.oDayInput.getValue().isEmpty()?1:this.oDayInput.getValue().get())+(this.oOptions.bWithTime?" "+this.oHourInput.getValue().get()+":"+this.oMinuteInput.getValue().get()+":"+this.oSecondInput.getValue().get():""));ZForms.Widget.prototype.setValueFromElement.call(this)},initValue:function(){this.oInitialValue=this.createValue(this.oElement.value);this.setValue(this.oInitialValue.clone());this.oDayInput.oInitialValue=this.oDayInput.createValue(this.oValue.getDay());this.oMonthInput.oInitialValue=this.oMonthInput.createValue(this.oValue.getMonth()||1);this.oYearInput.oInitialValue=this.oYearInput.createValue(this.oValue.getYear());if(this.oOptions.bWithTime){this.oHourInput.oInitialValue=this.oHourInput.createValue(this.oValue.getHour());this.oMinuteInput.oInitialValue=this.oMinuteInput.createValue(this.oValue.getMinute());this.oSecondInput.oInitialValue=this.oSecondInput.createValue(this.oValue.getSecond())}if(!this.getValue().isEmpty()){this.addClass(this.__self.CLASS_NAME_SELECTED_INITIAL,this.oMonthInput.oElement.options[this.oMonthInput.oElement.selectedIndex])}},disable:function(a){if(this.__base(a)){return false}if(this.oCalendar){this.oCalendar.disable()}return true},enable:function(a){if(this.__base(a)){return false}if(this.oCalendar){this.oCalendar.enable()}return true},addId:function(a){this.__base(a);if(this.oOptions.oPickerOpenerElement){this.addIdToElement(this.oOptions.oPickerOpenerElement,"opener-",a)}},clone:function(a,c,b){return new this.__self(a,c,Common.Object.extend({oPickerOpenerElement:this.oOptions.oPickerOpenerElement?document.getElementById(this.oOptions.oPickerOpenerElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+b):null,bTemplate:false},this.oOptions))},destruct:function(){this.__base();if(this.oCalendar){this.oCalendar.destruct()}}});ZForms.Widget.Text.State=ZForms.Widget.Text.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.bLastProcessedChecked=null},getName:function(){},check:function(){this.oElement.checked=true},uncheck:function(){this.oElement.checked=false},isChecked:function(){return this.oElement.checked},getEventList:function(){return[this.__self.DOM_EVENT_TYPE_CLICK]},isChanged:function(){return this.bLastProcessedChecked!=this.oElement.checked},updateLastProcessedValue:function(){this.bLastProcessedChecked=this.oElement.checked},addId:function(a){var b=this.oParent.getChildren().indexOf(this)+1;this.addIdToElement(this.oElement,this.__self.ID_PREFIX+b+"-",a);this.addIdToElement(this.oClassElement,this.__self.ROW_ID_PREFIX+b+"-",a)}});ZForms.Widget.Select=ZForms.Widget.inheritTo({__constructor:function(c,d,a){this.__base(c,d,a);this.aOptions=[];for(var b=0;b<this.oElement.options.length;b++){this.aOptions[b]={sLabel:this.oElement.options[b].innerHTML,sValue:this.oElement.options[b].value}}},setValue:function(a){for(var b=0;b<this.aOptions.length;b++){if(this.aOptions[b].sValue==a.toStr()){this.oElement.selectedIndex=b;break}}this.__base(a)},getEventList:function(){return[this.__self.DOM_EVENT_TYPE_CHANGE,this.__self.DOM_EVENT_TYPE_KEYUP]},setValueFromElement:function(){if(this.oElement.selectedIndex>=0){this.oValue.set(this.oElement.options[this.oElement.selectedIndex].value)}else{this.oValue.reset()}this.__base()},enableOptionsByValue:function(g,h){this.oElement.options.length=0;for(var e=0,d,c,f;e<this.aOptions.length;e++){f=this.aOptions[e];c=false;for(var b=0;b<g.length;b++){d=false;for(var a=0;a<g[b].length&&!d;a++){d=g[b][a].test(f.sValue)}if(d){if(h||b==0){c=true}}else{if(!h){c=false}}}if(c){this.oElement.options[this.oElement.options.length]=new Option(f.sLabel,f.sValue,this.getValue().isEqual(f.sValue))}}this.processEvents(true)}});ZForms.Widget.Text.Combo=ZForms.Widget.Text.inheritTo({__constructor:function(c,f,a){if(!a.bTemplate&&Common.Browser.isOpera()){var e=Common.Dom.createElement("select",{name:a.oOptionsElement.name,id:a.oOptionsElement.id,"class":a.oOptionsElement.className});for(var b=0,d=a.oOptionsElement.options;b<d.length;b++){e.options[e.options.length]=new Option(d[b].innerHTML,d[b].value)}a.oOptionsElement.parentNode.replaceChild(e,a.oOptionsElement);a.oOptionsElement=e;a.oOptionsElement.size=this.__self.DEFAULT_PAGE_SIZE}this.oShowOptionsButton=null;if(!a.bTemplate&&a.oShowOptionsElement){a.oShowOptionsElement.tabIndex=-1;this.oShowOptionsButton=ZForms.createButton(a.oShowOptionsElement)}this.__base(c,f,a);this.oOptions.oOptionsElement=a.oOptionsElement;this.oOptions.oOptionsElement.tabIndex=-1;if(this.isTemplate()){return}this.iPageSize=this.oOptions.oOptionsElement.size||this.__self.DEFAULT_PAGE_SIZE;Common.Class.add(this.oOptions.oOptionsElement,this.__self.CLASS_NAME_COMBO_LIST);this.bOptionsShowed=false;this.aOptions=[];this.aOptionsCurrent=[];this.oElement.setAttribute("autocomplete","off");this.oOptions.oOptionsElement.setAttribute("size",this.iPageSize);this.iSelectedIndex=0;this.sLastSearchValue=null;this.initOptions();this.hideOptions();this.oOptions.oOptionsElement.options.length=0},addExtendedHandlers:function(){var b=this,c=true,a=true;Common.Event.add(this.oPasswordReplacerElement||this.oElement,this.__self.DOM_EVENT_TYPE_FOCUS,function(){b.addClass(b.__self.CLASS_NAME_FOCUSED);if(b.hasPlaceHolder()){b.disablePlaceHolder()}});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYUP,function(d){b.dispatchKeyEvent(Common.Event.normalize(d).iKeyCode)});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_FOCUS,function(){if(!c){c=true;return}if(b.disablePlaceHolder()&&Common.Browser.isIE()){b.oElement.createTextRange().select()}b.updateOptions(true)});Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_KEYPRESS,function(d){var d=Common.Event.normalize(d);if(d.iKeyCode==b.__self.KEY_CODE_ENTER&&b.bOptionsShowed){Common.Event.cancel(d)}});Common.Event.add(document,this.__self.DOM_EVENT_TYPE_CLICK,function(e){var d=Common.Event.normalize(e).target;if(d==b.oElement||(b.oOptions.oShowOptionsElement&&b.oOptions.oShowOptionsElement==d)){return}b.hideOptions();b.enablePlaceHolder()});Common.Event.add([this.oOptions.oOptionsElement,this.oElement],this.__self.DOM_EVENT_TYPE_BLUR,function(){if(a&&b.hasPlaceHolder()){b.enablePlaceHolder()}if(a&&b.oElement){b.removeClass(b.__self.CLASS_NAME_FOCUSED);b.hideOptions()}a=true});Common.Event.add(this.oOptions.oOptionsElement,this.__self.DOM_EVENT_TYPE_FOCUS,function(){b.showOptions()});Common.Event.add(this.oOptions.oOptionsElement,this.__self.DOM_EVENT_TYPE_CHANGE,function(){b.selectFromOptions();c=false;b.oElement.focus()});Common.Event.add([this.oOptions.oOptionsElement].concat(this.oOptions.oShowOptionsElement?[this.oOptions.oShowOptionsElement]:[]),this.__self.DOM_EVENT_TYPE_MOUSEDOWN,function(){a=false});if(this.oShowOptionsButton){Common.Event.add(this.oOptions.oShowOptionsElement,this.__self.DOM_EVENT_TYPE_MOUSEUP,function(){a=true});this.oShowOptionsButton.setHandler(function(e){b.updateOptions(true,"");c=false;b.disablePlaceHolder();b.oElement.focus();if(b.oElement.createTextRange&&!Common.Browser.isOpera()){var d=b.oElement.createTextRange();d.collapse(true);d.moveStart("character",1000);d.moveEnd("character",1000);d.select()}})}},initOptions:function(){var b=this.oOptions.oOptionsElement.options;for(var a=0;a<b.length;a++){this.aOptions[a]={sLabel:b[a].innerHTML,sValue:b[a].value,sSearchValue:b[a].innerHTML.toLowerCase()}}this.aOptionsCurrent=this.aOptions},dispatchKeyEvent:function(a){switch(a){case this.__self.KEY_CODE_ARROW_UP:this.selectPrevOption();break;case this.__self.KEY_CODE_ARROW_DOWN:this.selectNextOption();break;case this.__self.KEY_CODE_PAGE_UP:this.selectPrevPage();break;case this.__self.KEY_CODE_PAGE_DOWN:this.selectNextPage();break;case this.__self.KEY_CODE_HOME:this.selectFirstOption();break;case this.__self.KEY_CODE_END:this.selectLastOption();break;case this.__self.KEY_CODE_ENTER:if(this.bOptionsShowed){this.selectFromOptions()}break;case this.__self.KEY_CODE_TAB:return;break;default:this.updateOptions(false);break}},selectPrevOption:function(){if(this.iSelectedIndex>0){this.iSelectedIndex--}this.updateSelectedIndex()},selectNextOption:function(){if(this.iSelectedIndex<this.oOptions.oOptionsElement.options.length-1){this.iSelectedIndex++}this.updateSelectedIndex()},selectPrevPage:function(){var a=this.iSelectedIndex-this.iPageSize;if(a>0){this.iSelectedIndex=a}else{this.iSelectedIndex=0}this.updateSelectedIndex()},selectNextPage:function(){var a=this.iSelectedIndex+this.iPageSize;if(a<this.oOptions.oOptionsElement.options.length-1){this.iSelectedIndex=a}else{this.iSelectedIndex=this.oOptions.oOptionsElement.options.length-1}this.updateSelectedIndex()},selectFirstOption:function(){this.iSelectedIndex=0;this.updateSelectedIndex()},selectLastOption:function(){this.iSelectedIndex=this.oOptions.oOptionsElement.options.length-1;this.updateSelectedIndex()},selectFromOptions:function(){if(this.oOptions.oOptionsElement.options.length>0&&this.oOptions.oOptionsElement.selectedIndex>-1){if(this.hasPlaceHolder()){this.disablePlaceHolder()}this.iSelectedIndex=this.oOptions.oOptionsElement.selectedIndex;this.sLastSearchValue=this.oElement.value.toLowerCase();this.setValue(new ZForms.Value(this.oOptions.oOptionsElement.options[this.iSelectedIndex].innerHTML))}var a=this;setTimeout(function(){a.hideOptions()},0)},updateSelectedIndex:function(){if(this.iSelectedIndex>-1){this.oOptions.oOptionsElement.selectedIndex=this.iSelectedIndex}},updateOptions:function(f,j){var g=this.oElement.value.toLowerCase(),e=typeof(j)=="undefined"?g:j;if(!f&&this.sLastSearchValue==e){return}var c=0,b,d=0,k=false,h=this.oOptions.oOptionsElement,a=h.options;this.sLastSearchValue=e;a.length=0;h.innerHTML="";while(b=this.aOptionsCurrent[c++]){if(b.sSearchValue.indexOf(e)>-1){a[d++]=new Option(b.sLabel,b.sValue);if(g===b.sSearchValue){this.iSelectedIndex=d-1;k=true}}}if(!k){this.iSelectedIndex=-1;h.selectedIndex=-1}if(d>0){this.updateSelectedIndex();this.showOptions()}else{this.hideOptions()}},showOptions:function(){if(this.bOptionsShowed){return}this.addClass(this.__self.CLASS_NAME_COMBO_LIST_ACTIVE);this.bOptionsShowed=true},hideOptions:function(){if(!this.bOptionsShowed){return}this.removeClass(this.__self.CLASS_NAME_COMBO_LIST_ACTIVE);this.bOptionsShowed=false},enableOptionsByValue:function(g,h){this.aOptionsCurrent=[];for(var e=0,d,c,f;e<this.aOptions.length;e++){f=this.aOptions[e];c=false;for(var b=0;b<g.length;b++){d=false;for(var a=0;a<g[b].length&&!d;a++){d=g[b][a].test(f.sValue)}if(d){if(h||b==0){c=true}}else{if(!h){c=false}}}if(c){this.aOptionsCurrent.push(f)}}this.sLastSearchValue=null;this.iSelectedIndex=-1},disable:function(a){if(!this.__base(a)){return false}this.oOptions.oOptionsElement.disabled=true;if(this.oShowOptionsButton){this.oShowOptionsButton.disable()}return true},enable:function(a){if(!this.__base(a)){return false}this.oOptions.oOptionsElement.disabled=false;if(this.oShowOptionsButton){this.oShowOptionsButton.enable()}return true},updateElements:function(a){this.oOptions.oOptionsElement=document.getElementById(a>0?this.oOptions.oOptionsElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+a:this.oOptions.oOptionsElement.id);this.__base(a)},addId:function(a){this.__base(a);this.addIdToElement(this.oOptions.oOptionsElement,"options-",a);if(this.oOptions.oShowOptionsElement){this.addIdToElement(this.oOptions.oShowOptionsElement,"show-",a)}},clone:function(b,d,c){var a=Common.Object.extend({oOptionsElement:document.getElementById(this.oOptions.oOptionsElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+c),oShowOptionsElement:this.oOptions.oShowOptionsElement?document.getElementById(this.oOptions.oShowOptionsElement.id.match(ZForms.Widget.Container.Multiplicator.REG_EXP_REPLACE)[1]+"_"+c):null,bTemplate:false},this.oOptions);return new this.__self(b,d,a)},destruct:function(){this.oOptions.oOptionsElement=null;if(this.oShowOptionsButton){this.oShowOptionsButton.destruct()}this.__base()}},{DEFAULT_PAGE_SIZE:5,CLASS_NAME_COMBO_LIST:"zf-combolist",CLASS_NAME_COMBO_LIST_ACTIVE:"zf-combolist-active"});ZForms.Widget.Container.Slider=ZForms.Widget.Container.inheritTo({__constructor:function(c,d,b){b=b||{};this.aSlideRules=b.aSlideRules||this.getDefaultOptions().aSlideRules;this.dMin=this.aSlideRules[0].dValue;this.dMax=this.aSlideRules[this.aSlideRules.length-1].dValue;this.__base(c,d,b);if(this.isTemplate()){return}this.aSlideRules[0].dPercent=0;this.aSlideRules[this.aSlideRules.length-1].dPercent=100;var a=this.createElements(c);this.oContainer=a.oContainer;this.oScaleElement=a.oScaleElement;this.aControls=[];this.aMarks=this.createMarks(a.oScaleElement);this.bEnabled=true;this.iLastControlPosition=0;this.iCurrentControlIndex=-1;this.iFocusedChildIndex=-1;this.oContainerOffset=null;this.fClickHandler=null;this.fDragStartHandler=null;this.fDragHandler=null;this.fDragEndHandler=null;this.fNullHandler=null;this.fSyncHandler=null;this.addExtendedHandlers();this.iIndex=this.__self.add(this);this.oLastProcessedValue=null},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{aSlideRules:[{dValue:0,dPercent:0,dStep:1,sLabel:"0"},{dValue:100,dPercent:100,dStep:1,sLabel:"100"}]},true)},createElements:function(a){var b={oContainer:document.createElement("div"),oScaleElement:document.createElement("div"),aMarkElements:[]};Common.Class.add(b.oContainer,this.__self.CLASS_NAME_SLIDER);Common.Class.add(b.oScaleElement,this.__self.CLASS_NAME_SLIDER_SCALE);b.oContainer.appendChild(b.oScaleElement);a.insertBefore(b.oContainer,a.firstChild);return b},createMarks:function(c){var d=[];for(var b=0,a;b<this.aSlideRules.length;b++){a=document.createElement("div");Common.Class.add(a,this.__self.CLASS_NAME_MARK_ELEMENT+" "+this.__self.CLASS_NAME_MARK_ELEMENT+"-"+this.aSlideRules[b].dValue);this.setupMarkElementPosition(a,this.aSlideRules[b].dPercent);if(typeof this.aSlideRules[b].sLabel!="undefined"){a.innerHTML="<span>"+this.aSlideRules[b].sLabel+"</span>"}c.appendChild(a);d.push({oElement:a,dValue:this.aSlideRules[b].dValue,bSelected:false})}return d},setupMarkElementPosition:function(a,b){a.style.left=b+"%"},createControl:function(e,b){var d={oElement:document.createElement("div"),oValueElement:document.createElement("div")},a=this,c=this.getChildren().length-1;if(e){d.oElement.id="control-"+e}Common.Class.add(d.oElement,this.__self.CLASS_NAME_CONTROL_ELEMENT+" "+this.__self.CLASS_NAME_CONTROL_ELEMENT+"-"+c);Common.Class.add(d.oValueElement,this.__self.CLASS_NAME_VALUE_ELEMENT);b.appendChild(d.oElement);b.appendChild(d.oValueElement);Common.Event.add(d.oElement,this.__self.DOM_EVENT_TYPE_MOUSEDOWN,function(f){if(a.iFocusedChildIndex>-1){a.aChildren[a.iFocusedChildIndex].oElement.blur()}Common.Event.cancel(f);a.__self.setActiveIndex(a.iIndex);a.fDragStartHandler(c)});return d},createRangeElements:function(a){this.aControls[a].oLeftRangeElement=a==0?this.createRangeElement(a):this.aControls[a-1].oRightRangeElement;this.aControls[a].oRightRangeElement=this.createRangeElement(a+1)},createRangeElement:function(b){var a=document.createElement("div");Common.Class.add(a,this.__self.CLASS_NAME_RANGE_ELEMENT+" "+this.__self.CLASS_NAME_RANGE_ELEMENT+"-"+b);this.oContainer.insertBefore(a,this.oScaleElement);return a},addChild:function(e,d){if(!(e instanceof ZForms.Widget.Text.Number)){return}var c=this.__base(e,d);if(this.isTemplate()){return c}var a=this.createControl(e.oElement.id,this.oContainer);this.aControls.push({oElement:a.oElement,oValueElement:a.oValueElement,dPosition:null,bSelected:false});this.createRangeElements(this.aControls.length-1,this.oContainer);var b=this,d=this.getChildren().length-1;Common.Event.add(e.oElement,this.__self.DOM_EVENT_TYPE_FOCUS,function(){b.iFocusedChildIndex=d});Common.Event.add(e.oElement,this.__self.DOM_EVENT_TYPE_BLUR,function(){b.iFocusedChildIndex=-1;b.fSyncHandler(d)});e.setValue=function(f,g){if(f.isGreater(b.getMax())){f.set(b.getMax())}else{if(f.isLess(b.getMin())){f.set(b.getMin())}}ZForms.Widget.Text.Number.prototype.setValue.call(e,f);if(!g){b.fSyncHandler(d)}};e.disable=function(f){if(!ZForms.Widget.prototype.disable.call(this,f)){return false}b.disableControlByIndex(d)};e.enable=function(f){if(!ZForms.Widget.prototype.enable.call(this,f)){return false}b.enableControlByIndex(d)};this.setCurrentControlIndex(d);this.setValue(e.getValue());return c},addExtendedHandlers:function(){var a=this;this.fClickHandler=function(b){var b=Common.Event.normalize(b),c=a.getNearestControlIndex(b);if(c<0){return c}a.__self.setActiveIndex(a.iIndex);a.setCurrentControlIndex(c);a.drag(b);return c};this.fDragStartHandler=function(b){a.dragStart(b)};this.fDragHandler=function(b){a.drag(Common.Event.normalize(b))};this.fDragEndHandler=function(b){a.dragEnd(Common.Event.normalize(b))};this.fNullHandler=function(b){Common.Event.cancel(b)};this.fSyncHandler=function(b){a.setCurrentControlIndex(b);a.setValue(a.getChildren()[b].getValue(),true)};Common.Event.add(this.oContainer,this.__self.DOM_EVENT_TYPE_MOUSEDOWN,function(b){Common.Event.cancel(b);if(a.iFocusedChildIndex>-1){a.aChildren[a.iFocusedChildIndex].oElement.blur()}var c=a.fClickHandler(b);if(c>=0){a.fDragStartHandler(c)}})},getMin:function(){return this.dMin},getMax:function(){return this.dMax},getCurrentControl:function(){return this.aControls[this.iCurrentControlIndex]},getCurrentControlIndex:function(){return this.iCurrentControlIndex},setCurrentControlIndex:function(a){if(this.getCurrentControlIndex()==a){return}if(this.getCurrentControlIndex()>-1){Common.Class.remove(this.getCurrentControl().oElement,this.__self.CLASS_NAME_CONTROL_ELEMENT_SELECTED)}this.iCurrentControlIndex=a;Common.Class.add(this.getCurrentControl().oElement,this.__self.CLASS_NAME_CONTROL_ELEMENT_SELECTED)},getNearestControlIndex:function(a){this.updateContainerOffset();var b=this.calculateValueByOffset(this.calculateOffset(a)),e=-1,g=Math.abs(this.getMax()-this.getMin()),c=0,d,f;while(d=this.aChildren[c++]){if(!d.isEnabled()){continue}f=Math.abs(d.getValue().get()-b.get());if(f<g||(Math.abs(f-g)<0.00001&&d.getValue().get()<b.get())){g=f;e=c-1}}return e},dragStart:function(a){if(!this.isEnabled()||!this.getChildren()[a].isEnabled()){return false}this.setCurrentControlIndex(a);this.updateContainerOffset();Common.Event.add(document,this.__self.DOM_EVENT_TYPE_SELECTSTART,this.fNullHandler);Common.Event.add(document,this.__self.DOM_EVENT_TYPE_MOUSEMOVE,this.fDragHandler);Common.Event.add(document,this.__self.DOM_EVENT_TYPE_MOUSEUP,this.fDragEndHandler)},drag:function(a){if(!this.isEnabled()){return false}this.updateContainerOffset();this.setValue(this.calculateValueByOffset(this.calculateOffset(a)))},dragEnd:function(){Common.Event.remove(document,this.__self.DOM_EVENT_TYPE_MOUSEMOVE,this.fDragHandler);Common.Event.remove(document,this.__self.DOM_EVENT_TYPE_MOUSEUP,this.fDragEndHandler);Common.Event.remove(document,this.__self.DOM_EVENT_TYPE_SELECTSTART,this.fNullHandler)},setValue:function(g,h){if(!this.getCurrentControl()){return}var e=this.findSlideRuleIndexByValue(g),b=this.getSlideRuleByIndex(e),k=this.getSlideRuleByIndex(e-1),f=this.getSlideRuleByIndex(e+1),c=parseFloat((Math.round((g.get()-b.dValue)/b.dStep)*b.dStep+b.dValue).toFixed(8)),a=this.getChildren()[this.getCurrentControlIndex()-1],d=this.getChildren()[this.getCurrentControlIndex()+1],j;if(k&&c<k.dValue){c=k.dValue}else{if(f&&c>f.dValue){c=f.dValue}}if(c<this.getMin()){c=this.getMin()}if(a&&a.getValue().get()>c){if(h&&this.getChildren()[this.getCurrentControlIndex()-1].isEnabled()){j=this.getChildren()[this.getCurrentControlIndex()];j.setValue(j.createValue(parseFloat(c)),true);--this.iCurrentControlIndex;this.setValue(j.createValue(parseFloat(c)),h);++this.iCurrentControlIndex}c=a.getValue().get()}else{if(d&&d.getValue().get()<c){if(h&&this.getChildren()[this.getCurrentControlIndex()+1].isEnabled()){j=this.getChildren()[this.getCurrentControlIndex()];j.setValue(j.createValue(parseFloat(c)),true);++this.iCurrentControlIndex;this.setValue(j.createValue(parseFloat(c)),h);--this.iCurrentControlIndex}c=d.getValue().get()}}j=this.getChildren()[this.getCurrentControlIndex()];j.setValue(j.createValue(parseFloat(c)),true);this.syncControlElement()},syncControlElement:function(){var a=this.calculatePositionByValue(this.getChildren()[this.getCurrentControlIndex()].getValue());if(a==this.getCurrentControl().dPosition){return}this.getCurrentControl().dPosition=a;this.updateControlElement();this.updateRanges();this.updateBounds()},updateControlElement:function(){var a=this.getCurrentControl();a.oElement.style.left=Math.round(a.dPosition)+"%";a.oValueElement.style.left=Math.round(a.dPosition)+"%";a.oValueElement.innerHTML=this.getChildren()[this.getCurrentControlIndex()].getValue().get().formatNumber()},updateRanges:function(){var a=this.getCurrentControlIndex(),b=this.getCurrentControl();this.moveRangeElement(b.oLeftRangeElement,a>0?this.aControls[a-1].dPosition:0,b.dPosition);this.moveRangeElement(b.oRightRangeElement,b.dPosition,a<this.aControls.length-1?this.aControls[a+1].dPosition:100)},moveRangeElement:function(b,c,a){Common.Dom.setStyle(b,"left: "+Math.round(c)+"%;width: "+(Math.round(a)-Math.round(c))+"%")},updateBounds:function(){var a=[],d=this.getChildren(),e=function(f,g){return f.dValue==g};for(var c=0,b;c<d.length;c++){b=parseFloat(d[c].getValue().get());a.push(b);if(this.aControls[c].bSelected){if(!this.aMarks.contains(b,e)){Common.Class.remove(this.aControls[c].oValueElement,this.__self.CLASS_NAME_VALUE_ELEMENT_SELECTED);this.aControls[c].bSelected=false}}else{if(this.aMarks.contains(b,e)){Common.Class.add(this.aControls[c].oValueElement,this.__self.CLASS_NAME_VALUE_ELEMENT_SELECTED);this.aControls[c].bSelected=true}}}for(var c=0;c<this.aMarks.length;c++){if(this.aMarks[c].bSelected){if(!a.contains(this.aMarks[c].dValue)){Common.Class.remove(this.aMarks[c].oElement,this.__self.CLASS_NAME_MARK_ELEMENT_SELECTED);this.aMarks[c].bSelected=false}}else{if(a.contains(this.aMarks[c].dValue)){Common.Class.add(this.aMarks[c].oElement,this.__self.CLASS_NAME_MARK_ELEMENT_SELECTED);this.aMarks[c].bSelected=true}}}},next:function(){if(!this.isEnabled()||!this.getChildren()[this.getCurrentControlIndex()].isEnabled()){return false}var a=this.getChildren()[this.getCurrentControlIndex()].getValue();this.setValue(new ZForms.Value.Number(parseFloat(a.get())+parseFloat(this.findNextStepByValue(a))))},prev:function(){if(!this.isEnabled()||!this.getChildren()[this.getCurrentControlIndex()].isEnabled()){return false}var a=this.getChildren()[this.getCurrentControlIndex()].getValue();this.setValue(new ZForms.Value.Number(parseFloat(a.get())-parseFloat(this.findPrevStepByValue(a))))},updateContainerOffset:function(){this.oContainerOffset=Common.Dom.getAbsoluteCoords(this.oContainer)},calculateOffset:function(a){return Common.Event.getAbsoluteCoords(a).iLeft-this.oContainerOffset.iLeft},calculatePositionByValue:function(b){var c=this.findSlideRuleIndexByValue(b),d=this.getSlideRuleByIndex(c),a=this.getSlideRuleByIndex(c+1);return(b.get()-d.dValue)/(a.dValue-d.dValue)*(a.dPercent-d.dPercent)+d.dPercent},calculateValueByOffset:function(c){var e=this.calculatePercentByOffset(c);if(e>100){e=100}else{if(e<0){e=0}}var b=this.findSlideRuleIndexByPercent(e),d=this.getSlideRuleByIndex(b),a=this.getSlideRuleByIndex(b+1);return new ZForms.Value.Number((e-this.aSlideRules[b].dPercent)/(a.dPercent-d.dPercent)*(a.dValue-d.dValue)+d.dValue)},calculatePercentByOffset:function(a){return a/this.oContainer.offsetWidth*100},findSlideRuleIndexByPercent:function(b){if(b==0){return 0}for(var a=0;a<this.aSlideRules.length;a++){if(this.aSlideRules[a].dPercent>=b){return a-1}}return this.aSlideRules.length-2},findSlideRuleIndexByValue:function(a){if(a.get()==this.getMin()){return 0}for(var b=1;b<this.aSlideRules.length;b++){if(this.aSlideRules[b].dValue>=a.get()){return b-1}}return this.aSlideRules.length-2},findNextStepByValue:function(a){if(a.get()==this.getMin()){return this.aSlideRules[0].dStep}for(var b=0;b<this.aSlideRules.length;b++){if(this.aSlideRules[b].dValue==a.get()){return this.aSlideRules[b].dStep}else{if(this.aSlideRules[b].dValue>a.get()){return this.aSlideRules[b-1].dStep}}}return this.aSlideRules[this.aSlideRules.length-1].dStep},findPrevStepByValue:function(a){if(a.get()==this.getMin()){return this.aSlideRules[0].dStep}for(var b=0;b<this.aSlideRules.length;b++){if(this.aSlideRules[b].dValue>=a.get()){return this.aSlideRules[b-1].dStep}}return this.aSlideRules[this.aSlideRules.length-1].dStep},getSlideRuleByIndex:function(a){return this.aSlideRules[a]},disableControlByIndex:function(a){Common.Class.add(this.aControls[a].oElement,this.__self.CLASS_NAME_CONTROL_ELEMENT_DISABLED);Common.Class.add(this.aControls[a].oValueElement,this.__self.CLASS_NAME_VALUE_ELEMENT_DISABLED)},enableControlByIndex:function(a){Common.Class.remove(this.aControls[a].oElement,this.__self.CLASS_NAME_CONTROL_ELEMENT_DISABLED);Common.Class.remove(this.aControls[a].oValueElement,this.__self.CLASS_NAME_VALUE_ELEMENT_DISABLED)},destruct:function(){this.oContainer=null;this.oScaleElement=null;if(!this.isTemplate()){for(i=0;i<this.aMarks.length;i++){this.aMarks[i].oElement=null}for(i=0;i<this.aControls.length;i++){this.aControls[i].oElement=null;this.aControls[i].oValueElement=null;this.aControls[i].oLeftRangeElement=null;this.aControls[i].oRightRangeElement=null}}this.__base()}},{CLASS_NAME_SLIDER:"zf-slider-horizontal",CLASS_NAME_SLIDER_SCALE:"zf-slider-scale",CLASS_NAME_CONTROL_ELEMENT:"zf-slider-control",CLASS_NAME_CONTROL_ELEMENT_SELECTED:"zf-slider-control-selected",CLASS_NAME_CONTROL_ELEMENT_DISABLED:"zf-slider-control-disabled",CLASS_NAME_VALUE_ELEMENT:"zf-slider-value",CLASS_NAME_VALUE_ELEMENT_SELECTED:"zf-slider-value-selected",CLASS_NAME_VALUE_ELEMENT_DISABLED:"zf-slider-value-disabled",CLASS_NAME_MARK_ELEMENT:"zf-slider-mark",CLASS_NAME_MARK_ELEMENT_SELECTED:"zf-slider-mark-selected",CLASS_NAME_RANGE_ELEMENT:"zf-slider-range",aAll:[],iActiveIndex:0,add:function(a){if(!(a instanceof this)){return}this.aAll.push(a);return this.aAll.length-1},setActiveIndex:function(a){this.iActiveIndex=a}});ZForms.Widget.Container.Slider.Vertical=ZForms.Widget.Container.Slider.inheritTo({setupMarkElementPosition:function(a,b){a.style.bottom=b+"%"},updateControlElement:function(){var a=this.getCurrentControl();a.oElement.style.bottom=Math.round(a.dPosition)+"%";a.oValueElement.style.bottom=Math.round(a.dPosition)+"%";a.oValueElement.innerHTML=this.getChildren()[this.getCurrentControlIndex()].getValue().get().formatNumber()},moveRangeElement:function(b,c,a){var d=Math.round(a)-Math.round(c);Common.Dom.setStyle(b,"bottom: "+Math.round(c)+"%;height: "+(d>0?(b.parentNode.offsetHeight*d/100+"px;"):"0px;"))},calculateOffset:function(a){return this.oContainerOffset.iTop+this.oContainer.offsetHeight-Common.Event.getAbsoluteCoords(a).iTop},calculatePercentByOffset:function(a){return a/this.oContainer.offsetHeight*100}},{CLASS_NAME_SLIDER:"zf-slider-vertical"});ZForms.Widget.Button=ZForms.Widget.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.fHandler=null;this.fDisableHandler=function(d){Common.Event.cancel(d)}},hasValue:function(){return false},setHandler:function(a){if(this.fHandler){Common.Event.remove(this.oElement,this.__self.DOM_EVENT_TYPE_CLICK,this.fHandler)}this.fHandler=a;if(this.isEnabled()){this.enable(false,true)}},enable:function(c,b){var a=this.__base(c);if(!(a||b)){return false}if((b||a)&&this.fHandler){Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_CLICK,this.fHandler)}if(a){Common.Event.remove([this.oElement,this.oClassElement],[this.__self.DOM_EVENT_TYPE_CLICK,this.__self.DOM_EVENT_TYPE_MOUSEDOWN,this.__self.DOM_EVENT_TYPE_SELECTSTART],this.fDisableHandler)}return a},disable:function(a){if(!this.__base(a)){return false}if(this.fHandler){Common.Event.remove(this.oElement,this.__self.DOM_EVENT_TYPE_CLICK,this.fHandler)}Common.Event.add([this.oElement,this.oClassElement],[this.__self.DOM_EVENT_TYPE_CLICK,this.__self.DOM_EVENT_TYPE_MOUSEDOWN,this.__self.DOM_EVENT_TYPE_SELECTSTART],this.fDisableHandler);return true}},{CLASS_NAME_BUTTON:"zf-button"});ZForms.Widget.Button.Submit=ZForms.Widget.Button.inheritTo({getDefaultOptions:function(){return Common.Object.extend(this.__base(),{bDisableOnSubmit:true},true)},setForm:function(b){this.__base(b);this.oForm.addSubmit(this);if(!this.oOptions.bDisableOnSubmit){return}var a=this;this.setHandler(function(){a.oForm.setCurrentSubmit(a)})},prepareForSubmit:function(){if(this.oOptions.bDisableOnSubmit){this.disable()}this.__base()},addDependence:function(a){}});ZForms.Widget.Container.Form=ZForms.Widget.Container.inheritTo({__constructor:function(b,c,a){this.__base(b,c,a);this.oForm=this;this.aWidgets=[];this.aWidgets[this.getId()]=this;this.aSubmits=[];this.oCurrentSubmit=null;this.oHiddenSubmitElement=null;this.iChangedCounter=0;this.bReadyForSubmit=true;this.bSubmitted=false;this.addExtendedHandlers();ZForms.aForms[this.getId()]=this},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{bUpdatableSubmit:true,bCheckForValid:true,bCheckForChanged:false,bPreventSubmit:false},true)},addExtendedHandlers:function(){var a=this;Common.Event.add(this.oElement,this.__self.DOM_EVENT_TYPE_SUBMIT,function(b){if(!a.checkForSubmit()||a.bSubmitted){return Common.Event.cancel(b)}ZForms.notifyObservers(ZForms.EVENT_TYPE_ON_BEFORE_SUBMIT,a);if(a.oOptions.bPreventSubmit){return Common.Event.cancel(b)}a.prepareForSubmit();a.bSubmitted=true});Common.Event.add(window,Common.Browser.isIE()?this.__self.DOM_EVENT_TYPE_BEFOREUNLOAD:this.__self.DOM_EVENT_TYPE_UNLOAD,function(){a.destruct()})},checkForSubmit:function(){if(this.isReadyForSubmit()){return true}this.getFirstErrorWidget().focus();this.addClass(this.__self.CLASS_NAME_SUBMITTED);return false},init:function(){var a=this;setTimeout(function(){a.addClass(a.__self.CLASS_NAME_INITED);ZForms.Widget.Container.prototype.init.call(a);a.updateSubmit(true)},0)},setForm:function(a){},increaseChangedCounter:function(){this.iChangedCounter++},decreaseChangedCounter:function(){this.iChangedCounter--},isChanged:function(){return this.iChangedCounter>0},addChild:function(a){a.setForm(this);return this.__base(a)},addSubmit:function(a){if(!(a instanceof ZForms.Widget.Button.Submit)){return}this.aSubmits.push(a)},updateSubmit:function(a){var b=this.isReadyForSubmit(true);if(!a&&b==this.bReadyForSubmit){return}this.bReadyForSubmit=b;if(this.oOptions.bUpdatableSubmit&&this.aSubmits.length>0){if(b){this.enableSubmit()}else{this.disableSubmit()}}ZForms.notifyObservers(ZForms.EVENT_TYPE_ON_READY_CHANGE,this,b)},enableSubmit:function(){for(var a=0;a<this.aSubmits.length;a++){this.aSubmits[a].enable()}},disableSubmit:function(){for(var a=0;a<this.aSubmits.length;a++){this.aSubmits[a].disable()}},addWidget:function(a){this.aWidgets[a.getId()]=a},removeWidget:function(a){delete this.aWidgets[a.getId()]},getWidgetById:function(a){return this.aWidgets[a]},getWidgets:function(){return this.aWidgets},isReadyForSubmit:function(c){if(!c){return this.bReadyForSubmit}var a=this.aWidgets;for(var b in a){if(!a.hasOwnProperty(b)||a[b]==this){continue}if(!a[b].isReadyForSubmit()){return false}}return!this.oOptions.bCheckForChanged||this.isChanged()},getFirstErrorWidget:function(){for(var a in this.aWidgets){if(!this.aWidgets.hasOwnProperty(a)){continue}oWidget=this.aWidgets[a];if(oWidget.isEnabled()&&(oWidget.bRequired||(this.oOptions.bCheckForValid&&!oWidget.bValid))){return oWidget}}},reset:function(){this.oElement.reset()},prepareForSubmit:function(){this.__base();if(this.oHiddenSubmitElement){this.oHiddenSubmitElement.parentNode.remove(this.oHiddenSubmitElement)}if(this.oCurrentSubmit&&this.oCurrentSubmit.oOptions.bDisableOnSubmit){this.oHiddenSubmitElement=this.oElement.appendChild(Common.Dom.createElement("input",{type:"hidden",name:this.oCurrentSubmit.oElement.name,value:this.oCurrentSubmit.oElement.value}));this.oCurrentSubmit=null}},setCurrentSubmit:function(a){this.oCurrentSubmit=a}},{CLASS_NAME_INITED:"zf-inited",CLASS_NAME_SUBMITTED:"zf-submitted",DOM_EVENT_TYPE_SUBMIT:"submit"});ZForms.Widget.Container.Multiplicator=ZForms.Widget.Container.inheritTo({__constructor:function(b,c,a){this.oTemplate=null;this.sButtonAddId=a?a.sButtonAddId:null;this.sButtonRemoveId=a?a.sButtonRemoveId:null;this.sButtonUpId=a?a.sButtonUpId:null;this.sButtonDownId=a?a.sButtonDownId:null;this.sInitialChildrenHash=null;this.sLastProcessedChildrenHash=null;this.__base(b||document.createElement("div"),c,a)},getDefaultOptions:function(){return Common.Object.extend(this.__base(),{iMin:1,iMax:10,bNameHasPostfix:false},true)},addChild:function(d,c){var b=c>-1?c:this.aChildren.length,a=new ZForms.Multiplier(this,d),e=(b>0?"_"+b:"");if(this.sButtonAddId){a.addAddButton(ZForms.createButton(document.getElementById(this.sButtonAddId+e)))}if(this.sButtonRemoveId){a.addRemoveButton(ZForms.createButton(document.getElementById(this.sButtonRemoveId+e)))}if(this.sButtonUpId){a.addUpButton(ZForms.createButton(document.getElementById(this.sButtonUpId+e)))}if(this.sButtonDownId){a.addDownButton(ZForms.createButton(document.getElementById(this.sButtonDownId+e)))}d.setMultiplier(a);this.updateChildIndex(d,0,b);return this.__base(d,c)},addTemplate:function(a){this.oTemplate=a;a.setMultiplier(new ZForms.Multiplier(this,a));if(this.oForm){a.setForm(this.oForm)}return a},normalizeTemplateAttributes:function(b){var a=b.oClassElement.getElementsByTagName("script");while(a.length>0){a[0].parentNode.removeChild(a[0])}this.replacePostfixAtElement(b.oClassElement,this.oOptions.iMax+1);b.setId(b.oElement.id)},calculateCurrentChildrenHash:function(){var c="";for(var b=0,a=this.aChildren.length;b<a;b++){c+=Common.Dom.getUniqueId(this.aChildren[b].oElement)}return c},processChildrenHashChanged:function(){var a=this.calculateCurrentChildrenHash();if(this.sInitialChildrenHash==a){if(this.sLastProcessedChildrenHash!=this.sInitialChildrenHash){this.oForm.decreaseChangedCounter();this.oForm.updateSubmit()}}else{if(this.sLastProcessedChildrenHash==this.sInitialChildrenHash){this.oForm.increaseChangedCounter();this.oForm.updateSubmit()}}this.sLastProcessedChildrenHash=a},init:function(){this.__base();if(!this.oTemplate){ZForms.throwException("template not found")}for(var a=0;a<this.aChildren.length;a++){this.aChildren[a].addId(a)}this.oTemplate.hide();this.oTemplate.disable();this.oTemplate.addId(this.oOptions.iMax+1);this.normalizeTemplateAttributes(this.oTemplate);this.updateMultipliers();this.sInitialChildrenHash=this.calculateCurrentChildrenHash();this.sLastProcessedChildrenHash=this.sInitialChildrenHash},updateMultipliers:function(){for(var a=0;a<this.aChildren.length;a++){this.aChildren[a].getMultiplier().updateState(this.aChildren.length<this.oOptions.iMax,this.aChildren.length>this.oOptions.iMin,a>0,a<this.aChildren.length-1)}},add:function(e){var d=this.aChildren.indexOf(e)+1,b=this.oTemplate.oClassElement.cloneNode(true);this.increaseChildrenPostfix(d);this.removePostfixFromElement(b);this.addPostfixToElement(b,d);if(e.oClassElement.nextSibling){e.oClassElement.parentNode.insertBefore(b,e.oClassElement.nextSibling)}else{e.oClassElement.parentNode.appendChild(b)}var c=this.oTemplate.clone(document.getElementById(this.oTemplate.oElement.id.match(this.__self.REG_EXP_REPLACE)[1]+"_"+d),document.getElementById(this.oTemplate.oClassElement.id.match(this.__self.REG_EXP_REPLACE)[1]+"_"+d),d);var a=this.oTemplate.getMultiplier();if(!this.sButtonAddId&&a.oAddButton){this.sButtonAddId=a.oAddButton.oElement.id.match(this.__self.REG_EXP_REPLACE)[1]}if(!this.sButtonRemoveId&&a.oRemoveButton){this.sButtonRemoveId=a.oRemoveButton.oElement.id.match(this.__self.REG_EXP_REPLACE)[1]}if(!this.sButtonUpId&&a.oUpButton){this.sButtonUpId=a.oUpButton.oElement.id.match(this.__self.REG_EXP_REPLACE)[1]}if(!this.sButtonDownId&&a.oDownButton){this.sButtonDownId=a.oDownButton.oElement.id.match(this.__self.REG_EXP_REPLACE)[1]}this.addChild(c,d);c.disable();c.enable();c.show();this.updateMultipliers();this.addTemplateDependencies(this.oTemplate,c,c);c.afterClone();this.repaintFix();this.processChildrenHashChanged()},addTemplateDependencies:function(c,a,d){this.addDependenciesFrom(c,a,d);this.addDependenciesTo(c,a,d);if(c instanceof ZForms.Widget.Container){for(var b=0;b<c.aChildren.length;b++){this.addTemplateDependencies(c.aChildren[b],a.aChildren[b],d)}}},addDependenciesFrom:function(e,c,g){for(var d=0,a=e.getDependencies(),b,f;d<a.length;d++){b=this.findCorrespondingWidgetByTemplate(a[d].getFrom(),this.oTemplate,g)||a[d].getFrom();f=a[d].clone(b);if(f instanceof ZForms.Dependence.Function){f.getFunction().mArgument=this.findCorrespondingWidgetByTemplate(a[d].getFunction().mArgument,this.oTemplate,g)||a[d].getFunction().mArgument;f.getFunction().oWidget=this.findCorrespondingWidgetByTemplate(a[d].getFunction().oWidget,this.oTemplate,g)||a[d].getFunction().oWidget;f.getFunction().iType=a[d].getFunction().iType;f.getFunction().sFunctionName=a[d].getFunction().sFunctionName;f.getFunction().oOptions=a[d].getFunction().oOptions}c.addDependence(f);b.processEvents(true,true)}},addDependenciesTo:function(e,c,f){for(var d=0,a;d<e.aObservers.length;d++){if(this.findCorrespondingWidgetByTemplate(e.aObservers[d],this.oTemplate,f)){continue}a=e.aObservers[d].getDependencies();for(var b=0;b<a.length;b++){if(a[b].getFrom()==e){e.aObservers[d].addDependence(a[b].clone(c))}}}},findCorrespondingWidgetByTemplate:function(a,d,b){if(d==a){return b}if(d instanceof ZForms.Widget.Container){for(var c=0,e;c<d.aChildren.length;c++){e=this.findCorrespondingWidgetByTemplate(a,d.aChildren[c],b.aChildren[c]);if(e){return e}}}},remove:function(b){var a=this.aChildren.indexOf(b);b.oClassElement.parentNode.removeChild(b.oClassElement);this.decreaseChildrenPostfix(a+1);this.removeChild(b);this.processEvents(true);this.updateMultipliers();this.repaintFix();this.processChildrenHashChanged()},up:function(b){var a=this.aChildren.indexOf(b);this.aChildren[a-1].oClassElement.parentNode.insertBefore(b.oClassElement.parentNode.removeChild(b.oClassElement),this.aChildren[a-1].oClassElement);this.aChildren.remove(b);this.aChildren.splice(a-1,0,b);if(a-1>0){this.replacePostfixAtElement(this.aChildren[a].oClassElement,a)}else{this.addPostfixToElement(this.aChildren[a].oClassElement,a)}this.updateChildIndex(this.aChildren[a-1],a,a-1);this.replacePostfixAtElement(this.aChildren[a-1].oClassElement,a-1);this.aChildren[a-1].updateElements(a-1);this.updateChildIndex(this.aChildren[a],a-1,a);this.aChildren[a].updateElements(a);this.updateMultipliers();this.repaintFix();this.processChildrenHashChanged()},down:function(b){var a=this.aChildren.indexOf(b);if(this.aChildren[a+2]){this.aChildren[a+2].oClassElement.parentNode.insertBefore(b.oClassElement.parentNode.removeChild(b.oClassElement),this.aChildren[a+2].oClassElement)}else{this.aChildren[a+1].oClassElement.parentNode.insertBefore(b.oClassElement.parentNode.removeChild(b.oClassElement),this.oTemplate.oClassElement)}this.aChildren.remove(b);this.aChildren.splice(a+1,0,b);this.updateChildIndex(this.aChildren[a],a+1,a);this.replacePostfixAtElement(this.aChildren[a].oClassElement,a);this.aChildren[a].updateElements(a);this.updateChildIndex(this.aChildren[a+1],a,a+1);if(a>0){this.replacePostfixAtElement(this.aChildren[a+1].oClassElement,a+1)}else{this.addPostfixToElement(this.aChildren[a+1].oClassElement,a+1)}this.aChildren[a+1].updateElements(a+1);this.updateMultipliers();this.repaintFix();this.processChildrenHashChanged()},updateChildIndex:function(a,c,b){a.replaceClass(this.__self.CHILD_INDEX_CLASS_NAME_PREFIX+c,this.__self.CHILD_INDEX_CLASS_NAME_PREFIX+b)},increaseChildrenPostfix:function(a){for(var b=this.aChildren.length-1;b>=a;b--){this.replacePostfixAtElement(this.aChildren[b].oClassElement,b+1);this.aChildren[b].updateElements(b+1);this.updateChildIndex(this.aChildren[b],b,b+1)}},decreaseChildrenPostfix:function(a){for(var b=a;b<this.aChildren.length;b++){this.replacePostfixAtElement(this.aChildren[b].oClassElement,b-1);this.aChildren[b].updateElements(b-1);this.updateChildIndex(this.aChildren[b],b,b-1)}},replacePostfixAtElement:function(c,a){for(var b=0;b<c.childNodes.length;b++){this.replacePostfixAtElement(c.childNodes[b],a)}this.replacePostfixAtNode(c,a)},replacePostfixAtNode:function(b,a){if(b.id){b.id=b.id.replace(this.__self.REG_EXP_REPLACE,"$1"+(a>0?"_"+a:""))}if(b.htmlFor){b.htmlFor=b.htmlFor.replace(this.__self.REG_EXP_REPLACE,"$1"+(a>0?"_"+a:""))}if(this.oOptions.bNameHasPostfix&&b.name){b.name=b.name.replace(this.__self.REG_EXP_REPLACE,"$1"+(a>0?"_"+a:"")+"$2");this.fixNode(b)}},removePostfixFromElement:function(b){for(var a=0;a<b.childNodes.length;a++){this.removePostfixFromElement(b.childNodes[a])}this.removePostfixFromNode(b)},removePostfixFromNode:function(a){if(this.oOptions.bNameHasPostfix&&a.name){a.name=a.name.replace(this.__self.REG_EXP_REPLACE,"$1$2")}if(a.id){a.id=a.id.replace(this.__self.REG_EXP_REPLACE,"$1")}if(a.htmlFor){a.htmlFor=a.htmlFor.replace(this.__self.REG_EXP_REPLACE,"$1")}},addPostfixToElement:function(c,a){for(var b=0;b<c.childNodes.length;b++){this.addPostfixToElement(c.childNodes[b],a)}this.addPostfixToNode(c,a)},addPostfixToNode:function(b,a){if(b.id){b.id+="_"+a}if(b.htmlFor){b.htmlFor+="_"+a}if(this.oOptions.bNameHasPostfix&&b.name){b.name=b.name.replace(/^([^\[]+)(\[\])?$/,"$1_"+a+"$2");this.fixNode(b)}},fixNode:function(c){var a=c.type.toLowerCase();if(!Common.Browser.isIE()||!(a=="text"||a=="radio"||a=="checkbox")){return}var b={type:c.type,name:c.name,id:c.id,"class":c.className,size:c.size,maxlength:c.maxLength,value:c.value,style:c.style.cssText};if(c.checked){b.checked="checked"}c.parentNode.replaceChild(Common.Dom.createElement("input",b),c).outerHTML=""},destruct:function(){if(this.oTemplate){this.oTemplate.destruct()}this.__base()},repaintFix:function(){if(document.compatMode){return}document.body.className+=""}},{POSTFIX_ID:"_multiplicator",REG_EXP_REPLACE:/^(.+)_\d+(\[\])?$/,CHILD_INDEX_CLASS_NAME_PREFIX:"zf-child_"});ZForms.Multiplier=Abstract.inheritTo({__constructor:function(b,a){this.oMultiplicator=b;this.oWidget=a;this.bCanAdd=true;this.bCanRemove=true;this.bCanUp=true;this.bCanDown=true;this.oAddButton=null;this.oRemoveButton=null;this.oUpButton=null;this.oDownButton=null;this.bDisabledByOuter=false},addAddButton:function(b){this.oAddButton=b;var a=this;b.setHandler(function(){a.oMultiplicator.add(a.oWidget);return false})},addRemoveButton:function(b){this.oRemoveButton=b;var a=this;b.setHandler(function(){a.oMultiplicator.remove(a.oWidget);return false})},addUpButton:function(b){this.oUpButton=b;var a=this;b.setHandler(function(){a.oMultiplicator.up(a.oWidget);return false})},addDownButton:function(b){this.oDownButton=b;var a=this;b.setHandler(function(){a.oMultiplicator.down(a.oWidget);return false})},enableByOuter:function(){this.bDisabledByOuter=false;if(this.bCanAdd){this.enableAdd()}if(this.bCanRemove){this.enableRemove()}},disableByOuter:function(){this.bDisabledByOuter=true;if(this.oAddButton){this.oAddButton.disable()}if(this.oRemoveButton){this.oRemoveButton.disable()}},enableAdd:function(){this.bCanAdd=true;if(this.bDisabledByOuter){return}if(this.oAddButton){this.oAddButton.enable()}},disableAdd:function(){this.bCanAdd=false;if(this.oAddButton){this.oAddButton.disable()}},enableRemove:function(){this.bCanRemove=true;if(this.bDisabledByOuter){return}if(this.oRemoveButton){this.oRemoveButton.enable()}},disableRemove:function(){this.bCanRemove=false;if(this.oRemoveButton){this.oRemoveButton.disable()}},enableUp:function(){this.bCanUp=true;if(this.bDisabledByOuter){return}if(this.oUpButton){this.oUpButton.enable()}},disableUp:function(){this.bCanUp=false;if(this.oUpButton){this.oUpButton.disable()}},enableDown:function(){this.bCanDown=true;if(this.bDisabledByOuter){return}if(this.oDownButton){this.oDownButton.enable()}},disableDown:function(){this.bCanDown=false;if(this.oDownButton){this.oDownButton.disable()}},updateState:function(a,b,c,d){if(a){this.enableAdd()}else{this.disableAdd()}if(b){this.enableRemove()}else{this.disableRemove()}if(c){this.enableUp()}else{this.disableUp()}if(d){this.enableDown()}else{this.disableDown()}},init:function(){if(this.oAddButton){this.oAddButton.init()}if(this.oRemoveButton){this.oRemoveButton.init()}if(this.oUpButton){this.oUpButton.init()}if(this.oDownButton){this.oDownButton.init()}},addId:function(a){if(this.oAddButton){this.oAddButton.addId(a)}if(this.oRemoveButton){this.oRemoveButton.addId(a)}if(this.oUpButton){this.oUpButton.addId(a)}if(this.oDownButton){this.oDownButton.addId(a)}},destruct:function(){if(this.oAddButton){this.oAddButton.destruct()}if(this.oRemoveButton){this.oRemoveButton.destruct()}if(this.oUpButton){this.oUpButton.destruct()}if(this.oDownButton){this.oDownButton.destruct()}}});ZForms.Dependence=Abstract.inheritTo({__constructor:function(d,a,c,b,e){this.iType=d;this.oFrom=a;this.rPattern=c;this.iLogic=b||this.__self.LOGIC_OR;this.bInverse=e||false},check:function(){if(this.oFrom.isTemplate()){return true}var a=this.oFrom.getValue().match(this.rPattern);return this.isInverse()?!a:a},getType:function(){return this.iType},getFrom:function(){return this.oFrom},getPattern:function(){return this.rPattern},getLogic:function(){return this.iLogic},isInverse:function(){return this.bInverse},clone:function(a){return new this.__self(this.getType(),a,this.getPattern(),this.getLogic(),this.isInverse())},getResult:function(){}},{TYPE_REQUIRED:1,TYPE_VALID:2,TYPE_ENABLED:3,TYPE_OPTIONS:4,TYPE_CLASS:5,TYPE_CHECK:6,LOGIC_OR:1,LOGIC_AND:2,COMPARE_FUNCTIONS:{eq:"isEqual",gt:"isGreater",gte:"isGreaterOrEqual",lt:"isLess",lte:"isLessOrEqual"}});ZForms.Dependence.Enabled=ZForms.Dependence.inheritTo({__constructor:function(a,d,c,e,b){this.__base(this.__self.TYPE_ENABLED,a,d,c,e);this.bCheckResult=false;this.bFocusOnEnable=b},check:function(){if(this.oFrom.isTemplate()){return true}this.bCheckResult=this.__base();return this.bCheckResult},getResult:function(){if(!this.bFocusOnEnable){return}return{bFocusOnEnable:this.bCheckResult}}});ZForms.Dependence.Valid=ZForms.Dependence.inheritTo({__constructor:function(c,e,d,f,b,a){this.__base(this.__self.TYPE_VALID,c,e,d,f);this.bCheckResult=false;this.sClassName=b;this.bCheckForEmpty=a},check:function(){if(this.oFrom.isTemplate()||(!this.bCheckForEmpty&&this.oFrom.getValue().isEmpty())){return true}this.bCheckResult=this.__base();return this.bCheckResult},getResult:function(){if(!this.sClassName){return}return{bAdd:!this.bCheckResult,sClassName:this.sClassName}},clone:function(a){return new this.__self(a,this.getPattern(),this.getLogic(),this.isInverse(),this.sClassName,this.bCheckForEmpty)}});ZForms.Dependence.Options=ZForms.Dependence.inheritTo({__constructor:function(d,a,c,b,e){this.__base(d,a,null,b,e);this.aPatterns=c;this.aResult=[]},getPatterns:function(){return this.aPatterns},check:function(){if(this.oFrom.isTemplate()){return true}this.aResult=[];var c=this.oFrom.getValue(),b=false;for(var a=0;a<this.aPatterns.length;a++){b=c.match(this.aPatterns[a].rSource);if(this.bInverse?!b:b){this.aResult.push(this.aPatterns[a].rDestination)}}return true},getResult:function(){return this.aResult}});ZForms.Dependence.Required=ZForms.Dependence.inheritTo({__constructor:function(a,d,c,e,b){this.__base(this.__self.TYPE_REQUIRED,a,d,c,e);this.iMin=b||1;if(!(this.getFrom()instanceof ZForms.Widget.Container)){this.iMin=1}},getMin:function(){return this.iMin},check:function(){if(this.oFrom.isTemplate()){return true}var f=0,b=false,g=true,a=false;if(this.oFrom instanceof ZForms.Widget.Container.Group){for(var e=0;e<this.oFrom.aChildren.length;e++){if(this.oFrom.aChildren[e].isChecked()){f++}}}else{if(this.oFrom instanceof ZForms.Widget.Container&&!(this.oFrom instanceof ZForms.Widget.Container.Date)){g=false;for(var e=0;e<this.oFrom.aChildren.length;e++){if(this.oFrom.aChildren[e].isEnabled()){g=true}else{continue}if(this.oFrom.aChildren[e]instanceof ZForms.Widget.Container&&!(this.oFrom.aChildren[e]instanceof ZForms.Widget.Container.Date)){if(this.oFrom.aChildren[e].isRequired()){b=true}else{var d=0;if(this.oFrom.aChildren[e]instanceof ZForms.Widget.Container.Group){for(var c=0;c<this.oFrom.aChildren[e].aChildren.length;c++){if(this.oFrom.aChildren[e].aChildren[c].isChecked()){d++}}}else{d=this.oFrom.aChildren[e].getCountChildrenByPattern(this.rPattern)}if(this.oFrom.aChildren[e]instanceof ZForms.Widget.Container.Multiplicator){f+=d}else{if(d>0){f++}}}}else{if(this.oFrom.aChildren[e].isRequired()){b=true}else{if(this.oFrom.aChildren[e].getValue().match(/\S+/)){f++}}}}}else{if(this.oFrom.getValue().match(this.rPattern)){f++}}}a=!b&&(f>=this.iMin||!g);return this.isInverse()?!a:a},clone:function(a){return new this.__self(a,this.getPattern(),this.getLogic(),this.isInverse(),this.getMin())}});ZForms.Dependence.Class=ZForms.Dependence.inheritTo({__constructor:function(a,c,b){this.__base(this.__self.TYPE_CLASS,a,null,b,false);this.aPatternToClasses=c;this.aResult=[]},getPatternToClasses:function(){return this.aPatternToClasses},check:function(){if(this.oFrom.isTemplate()){return true}this.aResult=[];var b=this.oFrom.getValue(),a=0,c;while(c=this.aPatternToClasses[a++]){this.aResult.push({sClassName:c.sClassName,bMatched:b.match(c.rPattern)?!c.bInverse:c.bInverse})}return this.aResult.length>0},clone:function(a){return new this.__self(a,this.getPatternToClasses(),this.getLogic())},getResult:function(){return this.aResult}});ZForms.Dependence.Function=ZForms.Dependence.inheritTo({__constructor:function(c,a,e,b,d){this.__base(c,a,null,b,d);this.fFunction=e;this.mResult=null},getFunction:function(){return this.fFunction},check:function(){if(this.oFrom.isTemplate()){return true}this.mResult=null;var a=this.fFunction(this.oFrom,this);return this.isInverse()?!a:a},setResult:function(a){this.mResult=a},getResult:function(){return this.mResult},clone:function(oFrom){eval("var fClonedFunction = "+this.getFunction().toString());return new this.__self(this.getType(),oFrom,fClonedFunction,this.getLogic(),this.isInverse())}});ZForms.DependenceGroup=Abstract.inheritTo({__constructor:function(a){this.iType=a;this.aDependencies=[]},getType:function(){return this.iType},addDependence:function(a){this.aDependencies.push(a)},removeDependence:function(a){this.aDependencies.remove(a)},getDependencies:function(){return this.aDependencies},check:function(){var a=this.aDependencies.length==0,d=false;for(var c=0,b=false;c<this.aDependencies.length;c++){d=this.aDependencies[c].check();if(b){continue}if(d&&this.aDependencies[c].getLogic()==ZForms.Dependence.LOGIC_OR){a=true;if(!(this.getType()==ZForms.Dependence.TYPE_CLASS||this.getType()==ZForms.Dependence.TYPE_OPTIONS)){break}}else{if(!d&&this.aDependencies[c].getLogic()==ZForms.Dependence.LOGIC_AND){a=false;b=true;if(this.getType()!=ZForms.Dependence.TYPE_VALID){break}}else{a=d}}}return a},getResult:function(){for(var b=0,c=[],a;b<this.aDependencies.length;b++){c.push(this.aDependencies[b].getResult())}return c}});ZForms.DependenceProcessor=Abstract.inheritTo({__constructor:function(a){this.oWidget=a;this.aDependenceGroups=[];this.aCheckingOrder=[ZForms.Dependence.TYPE_ENABLED,ZForms.Dependence.TYPE_VALID,ZForms.Dependence.TYPE_REQUIRED,ZForms.Dependence.TYPE_OPTIONS,ZForms.Dependence.TYPE_CHECK,ZForms.Dependence.TYPE_CLASS]},addDependence:function(a){if(!this.hasDependenciesByType(a.getType())){this.aDependenceGroups[a.getType()]=new ZForms.DependenceGroup(a.getType())}this.aDependenceGroups[a.getType()].addDependence(a)},removeDependence:function(a){this.aDependenceGroups[a.getType()].removeDependence(a)},getDependencies:function(){var b=[];for(var a=0;a<this.aCheckingOrder.length;a++){if(!this.hasDependenciesByType(this.aCheckingOrder[a])){continue}b=b.concat(this.aDependenceGroups[this.aCheckingOrder[a]].getDependencies())}return b},hasDependenciesByType:function(a){return this.aDependenceGroups[a]&&this.aDependenceGroups[a].getDependencies().length>0},process:function(){if(this.oWidget.isTemplate()){return}for(var a=0;a<this.aCheckingOrder.length;a++){this.dispatchProcessDependencies(this.aCheckingOrder[a])}},dispatchProcessDependencies:function(a){if(!this.hasDependenciesByType(a)){return}switch(a){case ZForms.Dependence.TYPE_ENABLED:this.processEnableDependencies();break;case ZForms.Dependence.TYPE_VALID:this.processValidDependencies();break;case ZForms.Dependence.TYPE_REQUIRED:this.processRequiredDependencies();break;case ZForms.Dependence.TYPE_OPTIONS:case ZForms.Dependence.TYPE_CHECK:this.processOptionsDependencies(a);break;case ZForms.Dependence.TYPE_CLASS:this.processClassDependencies();break;default:break}},processEnableDependencies:function(){var c=this.aDependenceGroups[ZForms.Dependence.TYPE_ENABLED].check(),d=this.aDependenceGroups[ZForms.Dependence.TYPE_ENABLED].getResult();if(c){this.oWidget.enable()}else{this.oWidget.disable()}if(!this.oWidget.isInited()){return}var b,a=0;while(b=d[a++]){if(b.bFocusOnEnable){return this.oWidget.focus()}}},processValidDependencies:function(){var b=this.aDependenceGroups[ZForms.Dependence.TYPE_VALID].check(),c=this.aDependenceGroups[ZForms.Dependence.TYPE_VALID].getResult(),a=0;if(b){this.oWidget.setValid()}else{this.oWidget.setInvalid()}while(a<c.length){if(c[a]&&c[a].sClassName){this.oWidget[(c[a].bAdd&&!b?"add":"remove")+"Class"](c[a].sClassName)}++a}},processRequiredDependencies:function(){if(this.aDependenceGroups[ZForms.Dependence.TYPE_REQUIRED].check()&&this.oWidget.isValid()){this.oWidget.unsetRequired()}else{this.oWidget.setRequired()}},processOptionsDependencies:function(c){var a=this.aDependenceGroups[c].check(),b=this.aDependenceGroups[c].getResult();this.oWidget.enableOptionsByValue(b,this.aDependenceGroups[c].getDependencies()[0].getLogic()==ZForms.Dependence.LOGIC_OR,c==ZForms.Dependence.TYPE_CHECK)},processClassDependencies:function(){var c=this.aDependenceGroups[ZForms.Dependence.TYPE_CLASS].check(),e=this.aDependenceGroups[ZForms.Dependence.TYPE_CLASS].getResult(),a=this.aDependenceGroups[ZForms.Dependence.TYPE_CLASS].getDependencies()[0].getLogic()==ZForms.Dependence.LOGIC_AND,d=[];for(var b=0;b<e.length;b++){d=this.joinClassGroup(d,e[b],a)}if(c&&d.length==0){return}for(var b=0;b<d.length;b++){if(d[b].bMatched){this.oWidget.addClass(d[b].sClassName)}else{this.oWidget.removeClass(d[b].sClassName)}}},joinClassGroup:function(f,e,b){if(f.length==0){return e}for(var d=0,c=f.length;d<c;d++){for(var a=0;a<e.length;a++){if(f[d].sClassName==e[a].sClassName){if((!b&&e[a].bMatched)||(b&&!e[a].bMatched)){f[d]=e[a]}else{e[a]=f[d]}}else{if(!f.contains(e[a])){f[f.length]=e[a]}}}}return f}});ZForms.Calendar=Abstract.inheritTo({__constructor:function(a){this.oWidget=a;this.oPickerButton=ZForms.createButton(a.oOptions.oPickerOpenerElement);this.oElement=Common.Dom.createElement("table",{"class":this.__self.CLASS_NAME_CALENDAR+" "+this.__self.CLASS_NAME_HIDDEN}).appendChild(Common.Dom.createElement("tbody"));this.oYearTitleElement=Common.Dom.createElement("span",{"class":this.__self.CLASS_NAME_TITLE});this.oMonthTitleElement=Common.Dom.createElement("span",{"class":this.__self.CLASS_NAME_TITLE});this.oDate=new Date();this.oDateNow=new Date();this.bShowed=false;this.fClickHandler=null;this.fMouseHandler=null;this.init()},init:function(){var j=this.oElement.parentNode.insertBefore(document.createElement("thead"),this.oElement),k=j.appendChild(document.createElement("tr")).appendChild(Common.Dom.createElement("th",{colspan:7})),a=k.appendChild(Common.Dom.createElement("input",{type:"button",value:"←","class":this.__self.CLASS_NAME_ARROW_PREV+" "+ZForms.Widget.Button.CLASS_NAME_BUTTON})),h=k.appendChild(Common.Dom.createElement("input",{type:"button",value:"→","class":this.__self.CLASS_NAME_ARROW_NEXT+" "+ZForms.Widget.Button.CLASS_NAME_BUTTON})),g=j.appendChild(document.createElement("tr")).appendChild(Common.Dom.createElement("th",{colspan:7})),e=g.appendChild(Common.Dom.createElement("input",{type:"button",value:"←","class":this.__self.CLASS_NAME_ARROW_PREV+" "+ZForms.Widget.Button.CLASS_NAME_BUTTON})),b=g.appendChild(Common.Dom.createElement("input",{type:"button",value:"→","class":this.__self.CLASS_NAME_ARROW_NEXT+" "+ZForms.Widget.Button.CLASS_NAME_BUTTON})),f=j.appendChild(document.createElement("tr"));k.appendChild(this.oYearTitleElement);g.appendChild(this.oMonthTitleElement);for(var c=0;c<7;c++){f.appendChild(Common.Dom.createElement("th",{"class":c>4?this.__self.CLASS_NAME_WEEKEND:null},ZForms.Resources.getDaysOfWeek()[c]))}var d=this;this.oPickerButton.setHandler(function(){if(d.isShowed()){d.hide()}else{var l=d.oWidget.getValue();if(d.oWidget.oOptions.bWithTime&&l.isEmpty()&&!d.oWidget.oYearInput.getValue().isEmpty()){d.setDate(new Date(d.oWidget.oYearInput.getValue().get(),d.oWidget.oMonthInput.getValue().get(),d.oWidget.oDayInput.getValue().get()))}else{if(!l.isEmpty()){d.setDate(new Date(l.getYear(),l.getMonth()-1,l.getDay()))}}d.show()}});Common.Event.add(this.oElement.parentNode,"click",function(l){Common.Event.cancel(l)});Common.Event.add(document,"click",function(l){if(Common.Event.normalize(l).target!=d.oPickerButton.oElement){d.hide()}});Common.Event.add(a,"click",function(){d.setPrevYear()});Common.Event.add(h,"click",function(){d.setNextYear()});Common.Event.add(e,"click",function(){d.setPrevMonth()});Common.Event.add(b,"click",function(){d.setNextMonth()});this.oPickerButton.oElement.parentNode.appendChild(this.oElement.parentNode);this.fClickHandler=function(n){d.hide();var m=Common.Event.normalize(n).target,l=parseInt(m.innerHTML,10);d.setDate(new Date(d.oDate.getFullYear(),d.oDate.getMonth()+(Common.Class.match(m,d.__self.CLASS_NAME_ADD)?(l>15?-1:1):0),m.innerHTML));if(d.oWidget.oOptions.bWithTime){d.oDate.setHours(d.oWidget.oHourInput.getValue().isEmpty()?0:d.oWidget.oHourInput.getValue().get());d.oDate.setMinutes(d.oWidget.oMinuteInput.getValue().isEmpty()?0:d.oWidget.oMinuteInput.getValue().get());d.oDate.setSeconds(d.oWidget.oSecondInput.getValue().isEmpty()?0:d.oWidget.oSecondInput.getValue().get())}d.oWidget.setValue(d.oWidget.createValue(d.oDate))};this.fMouseHandler=function(l){if(Common.Browser.isOpera()){l.target.style.display="none";l.target.style.display="table-cell"}else{var l=Common.Event.normalize(l);Common.Class[l.type=="mouseover"?"add":"remove"](l.target,d.__self.CLASS_NAME_HOVERED)}}},setDate:function(a){this.oDate=a;if(this.isShowed()){this.render()}},isShowed:function(){return this.bShowed},show:function(){if(this.isShowed()){return}this.render();this.oWidget.addClass(this.__self.CLASS_NAME_PICKER_ACTIVE);Common.Class.remove(this.oElement.parentNode,this.__self.CLASS_NAME_HIDDEN);this.bShowed=true},hide:function(){if(!this.isShowed()){return}Common.Class.add(this.oElement.parentNode,this.__self.CLASS_NAME_HIDDEN);this.oWidget.removeClass(this.__self.CLASS_NAME_PICKER_ACTIVE);this.bShowed=false},render:function(){this.oYearTitleElement.innerHTML=this.oDate.getFullYear();this.oMonthTitleElement.innerHTML=ZForms.Resources.getMonthsByType("normal")[this.oDate.getMonth()];var c=new Date(this.oDate.getFullYear(),this.oDate.getMonth(),1),j=new Date(this.oDate.getFullYear(),this.oDate.getMonth(),-0.5).getDate(),m=(c.getDay()==0?7:c.getDay())-1,l=new Date(this.oDate.getFullYear(),this.oDate.getMonth()+1,-0.5),a=7-(l.getDay()==0?7:l.getDay()),k=new Common.Utils.StringBuffer("<table>");for(var f=1;f<=m;f++){if(f%7==1){k.append(f>1?"</tr>":"").append("<tr>")}k.append('<td class="').append(this.__self.CLASS_NAME_ADD).append('"').append(f%7==6||f%7==0?" "+this.__self.CLASS_NAME_WEEKEND:"").append('">').append(j-m+f).append("</td>")}for(var f=m+1,g=l.getDate(),e=1,d;e<=g;f++){if(f%7==1){k.append("</tr><tr>")}d="";if(e==this.oDateNow.getDate()&&this.oDate.getMonth()==this.oDateNow.getMonth()&&this.oDate.getYear()==this.oDateNow.getYear()){d=this.__self.CLASS_NAME_NOW}if(f%7==6||f%7==0){d+=(d.length>0?" ":"")+this.__self.CLASS_NAME_WEEKEND}k.append("<td");if(d.length>0){k.append(' class="').append(d).append('"')}k.append(">").append(e++).append("</td>")}for(var f=m+g+1,e=1;e<=a;f++){if(f%7==1){k.append("</tr><tr>")}k.append('<td class="').append(this.__self.CLASS_NAME_ADD).append(f%7==6||f%7==0?" "+this.__self.CLASS_NAME_WEEKEND:"").append('">').append(e++).append("</td>")}k.append("</tr></table>");var b=document.createElement("div");b.innerHTML=k.get();b=b.getElementsByTagName("tbody")[0];Common.Event.remove(this.oElement,"click",this.fClickHandler);Common.Event.add(b,"click",this.fClickHandler);if(Common.Browser.isOpera()||(Common.Browser.isIE()&&(!document.compatMode||document.compatMode=="BackCompat"||!window.XMLHttpRequest))){var h=this.oElement.getElementsByTagName("td");for(var f=0;f<h.length;f++){Common.Event.remove(h[f],["mouseover","mouseout"],this.fMouseHandler)}h=b.getElementsByTagName("td");for(var f=0;f<h.length;f++){Common.Event.add(h[f],["mouseover","mouseout"],this.fMouseHandler)}}this.oElement.parentNode.replaceChild(b,this.oElement);this.oElement=b},setPrevMonth:function(){this.setDate(new Date(this.oDate.getFullYear(),this.oDate.getMonth(),-0.5))},setNextMonth:function(){this.setDate(new Date(this.oDate.getFullYear(),this.oDate.getMonth(),33))},setPrevYear:function(){this.setDate(new Date(this.oDate.getFullYear()-1,this.oDate.getMonth(),1))},setNextYear:function(){this.setDate(new Date(this.oDate.getFullYear()+1,this.oDate.getMonth(),1))},enable:function(){this.oPickerButton.enable()},disable:function(){this.hide();this.oPickerButton.disable()},destruct:function(){this.oWidget=null;this.oElement=null;this.oYearTitleElement=null;this.oMonthTitleElement=null;this.oPickerButton.destruct()}},{CLASS_NAME_CALENDAR:"zf-calendar",CLASS_NAME_HIDDEN:ZForms.Widget.CLASS_NAME_HIDDEN,CLASS_NAME_ARROW_PREV:"zf-buttonprev",CLASS_NAME_ARROW_NEXT:"zf-buttonnext",CLASS_NAME_TITLE:"zf-title",CLASS_NAME_WEEKEND:"zf-weekend",CLASS_NAME_NOW:"zf-now",CLASS_NAME_ADD:"zf-add",CLASS_NAME_PICKER_ACTIVE:"zf-picker-active",CLASS_NAME_HOVERED:"zf-hovered"});ZForms.Resources={sLanguage:(document.documentElement.lang?document.documentElement.getAttribute("lang"):"ru"),aMonths:{ru:{normal:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],genitive:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},en:{normal:["january","february","march","april","may","june","july","august","september","october","november","december"],genitive:["january","february","march","april","may","june","july","august","september","october","november","december"]}},aDaysOfWeek:{ru:["пн","вт","ср","чт","пт","сб","вс"],en:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]},aNumberSeparators:{ru:",",en:"."},getNumberSeparator:function(){return this.aNumberSeparators[this.sLanguage]},getDaysOfWeek:function(){return this.aDaysOfWeek[this.sLanguage]},getMonthsByType:function(a){return this.aMonths[this.sLanguage][a]}};ZForms.Builder=Abstract.inheritTo({__constructor:function(a){this.oFormElement=a;this.oForm=null;this.aWidgets=[];this.aWidgetsById=[];this.aSheetContainers=[];this.aRepeatContainers=[];this.oLastRepeatRoot=null;this.aDependencies=[];var b=this;Common.Event.add(window,ZForms.Widget[Common.Browser.isIE()?"DOM_EVENT_TYPE_BEFOREUNLOAD":"DOM_EVENT_TYPE_UNLOAD"],function(){b.oFormElement=null})},$:function(a){var b=document.getElementById(a);if(!b){ZForms.throwException('Element with id "'+a+'" no exists')}return b},build:function(){this.oForm=this.createWidgetByElement(this.oFormElement);var e=Common.Dom.getElementsByClassName(this.oFormElement,this.__self.CLASS_NAME_WIDGET),d=e.length,a=[],c=0;while(c<d){a.push(this.createWidgetByElement(e[c++]))}var b,c=0;while(b=a[c++]){this.aWidgets[b.getName()]=b;this.aWidgetsById[b.getId()]=b}this.buildDependencies();if(this.oForm){this.oForm.init()}delete this.oFormElement;delete this.aWidgets;delete this.aWidgetsById;delete this.aSheetContainers;delete this.aRepeatContainers;delete this.oLastRepeatRoot;delete this.aDependencies;return this.oForm},createWidgetByElement:function(c){var b=this.extractParamsFromElement(c),f=b.sType,e=this.getParentWidget(b,f,c),d=ZForms[this.getCreateWidgetFunction(f)](c,this.getClassElement(b.sCId,f,c),this.processParams(b,e));if(b.oRepeatOptions&&b.oRepeatOptions.sGroup){this.oLastRepeatRoot=d}if(b.oRequired||b.oValid||b.oEnabled||b.oDependedOptions||b.oDependedClasses){this.aDependencies.push({oWidget:d,oParams:b})}if(e){if(b.oRepeatOptions&&b.oRepeatOptions.sGroup&&d.isTemplate()){e.addTemplate(d)}else{if(f=="buttonprev"||f=="buttonnext"){e["add"+(f=="buttonprev"?"Prev":"Next")+"Button"](d)}else{if(f=="buttonadd"||f=="buttonremove"||f=="buttonup"||f=="buttondown"){var a=f.match(/button(\w)(.+)/);e.getMultiplier()["add"+a[1].toUpperCase()+a[2]+"Button"](d)}else{e.addChild(d)}}}}return d},processParams:function(a,b){if((a.oRepeatOptions&&a.oRepeatOptions.bTemplate)||(b&&b.isTemplate())){a.oOptions=Common.Object.extend({bTemplate:true},a.oOptions)}if(!a.oOptions){return}if(a.oOptions.sPickerId){a.oOptions.oPickerOpenerElement=this.$(a.oOptions.sPickerId);delete a.oOptions.sPickerId}if(a.oOptions.sTabId){a.oOptions.oElementLegend=this.$(a.oOptions.sTabId);delete a.oOptions.sTabId}if(a.oOptions.sListId){a.oOptions.oOptionsElement=this.$(a.oOptions.sListId);delete a.oOptions.sListId}if(a.oOptions.sListShowId){a.oOptions.oShowOptionsElement=this.$(a.oOptions.sListShowId);delete a.oOptions.sListShowId}return a.oOptions},getClassElement:function(b,c,a){if(b){return this.$(b)}if(c=="form"||c=="fieldset"||c=="sheet"||c=="slider"||c=="slidervertical"||c=="checkboxgroup"||c=="radiobuttongroup"||c=="submit"||c=="button"||c=="buttonprev"||c=="buttonnext"||c=="buttonadd"||c=="buttonremove"||c=="buttonup"||c=="buttondown"){return}if(c=="state"||c=="hidden"){return a.parentNode}return a.parentNode.parentNode},getParentWidget:function(a,c,b){if(c=="sheet"){return this.getSheetContainer(a,b)}if(a.oRepeatOptions&&a.oRepeatOptions.sGroup){return this.getRepeatContainer(a,b)}if(c=="buttonprev"||c=="buttonnext"){return this.getSheet(b)}if(c=="buttonadd"||c=="buttonremove"||c=="buttonup"||c=="buttondown"){return this.getRepeatRoot(b)}if(c=="form"){return}if(a.sPId){return this.oForm.getWidgetById(a.sPId)}while(b=b.parentNode){if(b.tagName.toLowerCase()=="form"||Common.Class.match(b,this.__self.CLASS_NAME_WIDGET)){return this.oForm.getWidgetById(this.__self.getId(b))}}},getRepeatContainer:function(a,b){if(!this.aRepeatContainers[a.oRepeatOptions.sGroup]){this.aRepeatContainers[a.oRepeatOptions.sGroup]=this.getParentWidget({},null,b).addChild(ZForms.createMultiplicator(null,null,a.oRepeatOptions))}return this.aRepeatContainers[a.oRepeatOptions.sGroup]},getRepeatRoot:function(){return this.oLastRepeatRoot},getSheetContainer:function(a,b){var c=a.sSheetGroup||this.__self.getId(b.parentNode);if(!this.aSheetContainers[c]){a.sType=null;this.aSheetContainers[c]=this.getParentWidget(a,null,b).addChild(ZForms.createSheetContainer())}return this.aSheetContainers[c]},getSheet:function(a){while(a=a.parentNode){if(a.tagName.toLowerCase()=="form"||Common.Class.match(a,this.__self.CLASS_NAME_WIDGET)){var b=this.oForm.getWidgetById(this.__self.getId(a));if(b instanceof ZForms.Widget.Container.Sheet){return b}}}},extractParamsFromElement:function(a){var b=a.onclick instanceof Function?a.onclick()||{}:{};b.sType=b.sType||this.extractTypeFromElement(a);return b},extractTypeFromElement:function(d){var c=d.tagName.toLowerCase(),b;if(c=="input"){b=d.type.toLowerCase();if(b=="radio"||b=="checkbox"){return"state"}}var a=d.className.match(this.__self.rTypePattern);if(a){return a[1]}switch(c){case"input":if(b=="search"){return"text"}return b;break;case"form":case"fieldset":case"select":return c;break;case"textarea":return"text";break}ZForms.throwException("can't extract widget type from element with id \""+this.__self.getId(d)+'"')},getCreateWidgetFunction:function(a){if(!this.__self.aTypesToCreateWidgetFunction[a]){ZForms.throwException('Unsupported widget type "'+a+'"')}return"create"+this.__self.aTypesToCreateWidgetFunction[a]},getWidgetByName:function(a){return this.aWidgets[a]},getWidgetById:function(a){return this.aWidgetsById[a]},buildDependencies:function(){var a=this.aDependencies,d=this.aDependencies.length,c=0,e,b;while(c<d){e=a[c++];b=e.oParams;if(b.oRequired){this.buildRequiredDependence(e.oWidget,b.oRequired)}if(b.oValid){this.buildValidOrEnabledDependence(e.oWidget,b.oValid,ZForms.Dependence.TYPE_VALID)}if(b.oEnabled){this.buildValidOrEnabledDependence(e.oWidget,b.oEnabled,ZForms.Dependence.TYPE_ENABLED)}if(b.oDependedOptions){this.buildOptionsDependence(e.oWidget,b.oDependedOptions)}if(b.oDependedClasses){this.buildClassesDependence(e.oWidget,b.oDependedClasses)}}},buildRequiredDependence:function(b,a){var f=this.getLogic(a);a.aFrom=this.__self.prependToArray({iMin:a.iMin},a.aFrom);var e=0,c,d;while(c=a.aFrom[e++]){d=this.getWidgetFrom(c,b);if(c.fFunction){b.addDependence(ZForms.createFunctionDependence(d,{iType:ZForms.Dependence.TYPE_REQUIRE,fFunction:c.fFunction,iLogic:f,bInverse:c.bInverse}))}else{b.addDependence(ZForms.createRequiredDependence(d,{rPattern:c.rPattern,iLogic:f,iMin:c.iMin?c.iMin:1}))}}},buildValidOrEnabledDependence:function(a,c,g){var f=this.getLogic(c),h;if(c.sType){h={sType:c.sType}}else{if(typeof(c.rPattern)!="undefined"){h={rPattern:c.rPattern}}else{if(c.fFunction){h={fFunction:c.fFunction}}else{if(c.oCompare){h={oCompare:c.oCompare}}}}}if(h){Common.Object.extend(h,{sId:c.sId,sName:c.sName,bInverse:c.bInverse,sClassName:c.sClassName,bCheckForEmpty:c.bCheckForEmpty,bFocusOnEnable:c.bFocusOnEnable})}c.aFrom=this.__self.prependToArray(h,c.aFrom);var e=0,b,d;while(b=c.aFrom[e++]){d=this.getWidgetFrom(b,a);if(b.sType&&b.sType=="email"&&g==ZForms.Dependence.TYPE_VALID){a.addDependence(ZForms.createValidEmailDependence(d,{iLogic:f,bInverse:b.bInverse,sClassName:b.sClassName,bCheckForEmpty:b.bCheckForEmpty}))}else{if(b.rPattern){a.addDependence(ZForms["create"+(g==ZForms.Dependence.TYPE_VALID?"Valid":"Enabled")+"Dependence"](d,{rPattern:this.__self.toPattern(b.rPattern),iLogic:f,bInverse:b.bInverse,sClassName:b.sClassName,bCheckForEmpty:b.bCheckForEmpty,bFocusOnEnable:b.bFocusOnEnable}))}else{if(b.oCompare){if(b.oCompare.sCondition&&!ZForms.Dependence.COMPARE_FUNCTIONS[b.oCompare.sCondition]){ZForms.throwException('unsupported type of compare condition: "'+b.oCompare.sCondition+'"')}a.addDependence(ZForms["create"+(g==ZForms.Dependence.TYPE_VALID?"Valid":"Enabled")+"CompareDependence"](d,{sCondition:b.oCompare.sCondition,mArgument:b.oCompare.sId?this.getWidgetById(b.oCompare.sId):(b.oCompare.sName?this.getWidgetByName(b.oCompare.sName):b.oCompare.mValue),iLogic:f,bInverse:b.bInverse,sClassName:b.sClassName,bCheckForEmpty:b.bCheckForEmpty,bFocusOnEnable:b.bFocusOnEnable}))}else{if(b.fFunction){a.addDependence(ZForms.createFunctionDependence(d,{iType:g,fFunction:b.fFunction,iLogic:f,bInverse:b.bInverse}))}}}}}},buildOptionsDependence:function(k,g){var a=this.getLogic(g),c;if(g.aData){c={aData:g.aData}}else{if(g.fFunction){c={fFunction:g.fFunction}}}if(c){Common.Object.extend(c,{sId:g.sId,sName:g.sName})}g.aFrom=this.__self.prependToArray(c,g.aFrom);var d=0,b,e,h,f;while(e=g.aFrom[d++]){h=this.getWidgetFrom(e,k);if(e.aData){f=[];b=0;while(b<e.aData.length){f.push({rSource:this.__self.toPattern(e.aData[b][0]),rDestination:this.__self.toPattern(e.aData[b++][1])})}k.addDependence(ZForms.createOptionsDependence(h,{aPatterns:f,iLogic:a}))}else{if(e.fFunction){k.addDependence(ZForms.createFunctionDependence(h,{iType:ZForms.Dependence.TYPE_OPTIONS,fFunction:e.fFunction,iLogic:a,bInverse:e.bInverse}))}}}},buildClassesDependence:function(k,a){var b=this.getLogic(a),d;if(a.fFunction){d={fFunction:a.fFunction}}else{if(a.aData){d={aData:a.aData}}}if(d){Common.Object.extend(d,{sId:a.sId,sName:a.sName})}a.aFrom=this.__self.prependToArray(d,a.aFrom);var e=0,c,f,h,g;while(f=a.aFrom[e++]){h=this.getWidgetFrom(f,k);if(f.aData){g=[];c=0;while(c<f.aData.length){g.push({rPattern:this.__self.toPattern(f.aData[c][0]),sClassName:f.aData[c][1],bInverse:f.aData[c++][2]})}k.addDependence(ZForms.createClassDependence(h,{aPatternToClasses:g,iLogic:b}))}else{if(f.fFunction){k.addDependence(ZForms.createFunctionDependence(h,{iType:ZForms.Dependence.TYPE_CLASS,fFunction:f.fFunction,iLogic:b,bInverse:f.bInverse}))}}}},getLogic:function(a){return a.sLogic=="or"?ZForms.Dependence.LOGIC_OR:ZForms.Dependence.LOGIC_AND},getWidgetFrom:function(a,c){var b=a.sId?this.getWidgetById(a.sId):(a.sName?this.getWidgetByName(a.sName):c);if(!b){this.throwDependenceException(a.sId||a.sName)}return b},throwDependenceException:function(a){ZForms.throwException('Widget with name/id "'+a+'" no exists')}},{prependToArray:function(a,b){if(typeof(a)=="undefined"){return b}if(!(a instanceof Array)){a=[a]}if(!(b instanceof Array)){b=[]}return a.concat(b)},toPattern:function(a){return a instanceof RegExp?a:new RegExp("^"+a+"$")},getId:function(a){return Common.Dom.getAttribute(a,"id")||Common.Dom.getUniqueId(a)},aTypesToCreateWidgetFunction:{form:"Form",text:"TextInput",password:"TextInput",file:"TextInput",hidden:"TextInput",number:"NumberInput",select:"SelectInput",combo:"ComboInput",date:"DateInput",submit:"SubmitButton",fieldset:"Container",checkboxgroup:"CheckBoxGroup",radiobuttongroup:"RadioButtonGroup",state:"StateInput",sheet:"Sheet",button:"Button",buttonprev:"Button",buttonnext:"Button",buttonadd:"Button",buttonremove:"Button",buttonup:"Button",buttondown:"Button",slider:"Slider",slidervertical:"SliderVertical"},rTypePattern:/zf-(form|text|number|select|combo|date|submit|fieldset|checkboxgroup|radiobuttongroup|state|sheet|slider|slidervertical|buttonprev|buttonnext|buttonadd|buttonremove|buttonup|buttondown|button)(\s+|$)/,CLASS_NAME_WIDGET:"zf"});Common.Event.add(document,Common.Event.TYPE_DOM_CONTENT_LOADED,function(){var c=Common.Dom.getElementsByClassName(document,ZForms.Builder.CLASS_NAME_WIDGET,"form"),b,a=0;while(b=c[a++]){if(!Common.Class.match(b,ZForms.Widget.Container.Form.CLASS_NAME_INITED)){ZForms.buildForm(b)}}setTimeout(function(){ZForms.notifyObservers(ZForms.EVENT_TYPE_ON_INIT,ZForms);ZForms.bInited=true},1)});;(function(F,C){var D=function(H){var G,I=[];for(G in H){if(/string|number/.test(typeof H[G])&&H[G]!==""){I.push(G+'="'+H[G]+'"')}}return I[A]("")},E=function(I){var G,K,J=[],H;if(typeof I=="object"){for(G in I){if(typeof I[G]=="object"){H=[];for(K in I[G]){H.push([K,"=",encodeURIComponent(I[G][K])][A](""))}I[G]=H[A]("&amp;")}if(I[G]){J.push(['<param name="',G,'" value="',I[G],'" />'][A](""))}}I=J[A]("")}return I},B=false,A="join";F[C]=(function(){try{var G="0,0,0",H=navigator.plugins["Shockwave Flash"]||ActiveXObject;G=H.description||(function(){try{return(new H("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(J){}}())}catch(I){}G=G.match(/^[A-Za-z\s]*?(\d+)[\.|,](\d+)(?:\s+[d|r]|,)(\d+)/);return{available:G[1]>0,activeX:H&&!H.name,version:{major:G[1]*1,minor:G[2]*1,release:G[3]*1},hasVersion:function(K){var N=this.version,L="major",M="minor",J="release";K=(/string|number/.test(typeof K))?K.toString().split("."):K||[0,0,0];K=[K[L]||K[0]||N[L],K[M]||K[1]||N[M],K[J]||K[2]||N[J]];return(K[0]<N[L])||(K[0]==N[L]&&K[1]<N[M])||(K[0]==N[L]&&K[1]==N[M]&&K[2]<=N[J])},expressInstall:"expressInstall.swf",create:function(J){if(!F[C].available||B||!typeof J=="object"||!J.swf){return false}if(J.hasVersion&&!F[C].hasVersion(J.hasVersion)){J={swf:J.expressInstall||F[C].expressInstall,attrs:{id:J.id||"SWFObjectExprInst",name:J.name,height:Math.max(J.height||137),width:Math.max(J.width||214)},params:{flashvars:{MMredirectURL:location.href,MMplayerType:(F[C].activeX)?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}};B=true}else{J=F.extend(true,{attrs:{id:J.id,name:J.name,height:J.height||180,width:J.width||320},params:{wmode:J.wmode||"opaque",flashvars:J.flashvars}},J)}if(F[C].activeX){J.attrs.classid=J.attrs.classid||"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";J.params.movie=J.params.movie||J.swf}else{J.attrs.type=J.attrs.classid||"application/x-shockwave-flash";J.attrs.data=J.attrs.data||J.swf}return["<object ",D(J.attrs),">",E(J.params),"</object>"][A]("")}}}());F.fn[C]=function(G){if(typeof G=="object"){this.each(function(){var I=document.createElement(C);var H=F[C].create(G);if(H){I.innerHTML=H;if(I.childNodes[0]){this.appendChild(I.childNodes[0])}}})}else{if(typeof G=="function"){this.find("object").andSelf().filter("object").each(function(){var I=this,H="jsInteractionTimeoutMs";I[H]=I[H]||0;if(I[H]<660){if(I.clientWidth||I.clientHeight){G.call(this)}else{setTimeout(function(){F(I)[C](G)},I[H]+66)}}})}}return this}}(jQuery,"flash"));;(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery);;(function($){if(!document.defaultView||!document.defaultView.getComputedStyle){var oldCurCSS=jQuery.curCSS;jQuery.curCSS=function(elem,name,force){if(name==='background-position'){name='backgroundPosition';}
if(name!=='backgroundPosition'||!elem.currentStyle||elem.currentStyle[name]){return oldCurCSS.apply(this,arguments);}
var style=elem.style;if(!force&&style&&style[name]){return style[name];}
return oldCurCSS(elem,'backgroundPositionX',force)+' '+oldCurCSS(elem,'backgroundPositionY',force);};}
var oldAnim=$.fn.animate;$.fn.animate=function(prop){if('background-position'in prop){prop.backgroundPosition=prop['background-position'];delete prop['background-position'];}
if('backgroundPosition'in prop){prop.backgroundPosition='('+prop.backgroundPosition;}
return oldAnim.apply(this,arguments);};function toArray(strg){strg=strg.replace(/left|top/g,'0px');strg=strg.replace(/right|bottom/g,'100%');strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];}
$.fx.step.backgroundPosition=function(fx){if(!fx.bgPosReady){var start=$.curCSS(fx.elem,'backgroundPosition');if(!start){start='0px 0px';}
start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.options.curAnim.backgroundPosition);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];fx.bgPosReady=true;}
var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+' '+nowPosX[1];};})(jQuery);;var tmp=navigator.appName=='Microsoft Internet Explorer'&&navigator.userAgent.indexOf('Opera')<1?1:0;if(tmp)var isIE=document.namespaces?1:0;if(isIE){if(document.namespaces['v']==null){var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","roundrect","oval","rect","arc","image"],s=document.createStyleSheet();for(var i=0;i<e.length;i++){s.addRule("v\\:"+e[i],"behavior: url(#default#VML);");}document.namespaces.add("v","urn:schemas-microsoft-com:vml");}}
function getRadius(radius,width,height){var part=(Math.min(width,height)/100);radius=Math.max(Math.min(100,radius/part),0);return radius+'%';}
function getImages(className){var children=document.getElementsByTagName('img');var elements=new Array();var i=0;var child;var classNames;var j=0;for(i=0;i<children.length;i++){child=children[i];classNames=child.className.split(' ');for(var j=0;j<classNames.length;j++){if(classNames[j]==className){elements.push(child);break;}}}
return elements;}
function getClasses(classes,string){var temp='';for(var j=0;j<classes.length;j++){if(classes[j]!=string){if(temp){temp+=' '}
temp+=classes[j];}}
return temp;}
function getClassValue(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=Math.min(classes[j].substring(pos),100);break;}}
return Math.max(0,temp);}
function getClassAttribute(classes,string){var temp=0;var pos=string.length;for(var j=0;j<classes.length;j++){if(classes[j].indexOf(string)==0){temp=1;break;}}
return temp;}
function roundedRect(ctx,x,y,width,height,radius,nopath){if(!nopath)ctx.beginPath();ctx.moveTo(x,y+radius);ctx.lineTo(x,y+height-radius);ctx.quadraticCurveTo(x,y+height,x+radius,y+height);ctx.lineTo(x+width-radius,y+height);ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius);ctx.lineTo(x+width,y+radius);ctx.quadraticCurveTo(x+width,y,x+width-radius,y);ctx.lineTo(x+radius,y);ctx.quadraticCurveTo(x,y,x,y+radius);if(!nopath)ctx.closePath();}
function addGradient(ctx,x,y,w,h,color,opacity){var tmp=ctx.createLinearGradient(x,y,w,h);var val=(color>0?0.25:0.2);tmp.addColorStop(0,'rgba('+color+','+color+','+color+',0.9)');tmp.addColorStop(val,'rgba('+color+','+color+','+color+','+opacity+')');tmp.addColorStop(0.75,'rgba('+color+','+color+','+color+',0)');tmp.addColorStop(1,'rgba('+color+','+color+','+color+',0)');return tmp;}
function addRadialStyle(ctx,x1,y1,r1,x2,y2,r2,opacity){var tmp=ctx.createRadialGradient(x1,y1,r1,x2,y2,r2);var opt=Math.min(parseFloat(opacity+0.1),1.0);tmp.addColorStop(0,'rgba(0,0,0,'+opt+')');tmp.addColorStop(0.25,'rgba(0,0,0,'+opacity+')');tmp.addColorStop(1,'rgba(0,0,0,0)');return tmp;}
function addLinearStyle(ctx,x,y,w,h,opacity){var tmp=ctx.createLinearGradient(x,y,w,h);var opt=Math.min(parseFloat(opacity+0.1),1.0);tmp.addColorStop(0,'rgba(0,0,0,'+opt+')');tmp.addColorStop(0.25,'rgba(0,0,0,'+opacity+')');tmp.addColorStop(1,'rgba(0,0,0,0)');return tmp;}
function addShine(ctx,width,height,radius,opacity,extra){var style;var color=(extra!=1?254:0);style=addGradient(ctx,0,radius,radius,radius,color,opacity);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(0,height);ctx.lineTo(radius,height);ctx.lineTo(radius,radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();style=addGradient(ctx,radius,0,radius,radius,color,opacity);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(width,0);ctx.lineTo(width,radius);ctx.lineTo(radius,radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();}
function addShade(ctx,width,height,radius,opacity){var style;style=addGradient(ctx,width,radius,width-radius,radius,0,opacity);ctx.beginPath();ctx.moveTo(width,0);ctx.lineTo(width,height);ctx.lineTo(width-radius,height-radius);ctx.lineTo(width-radius,0);ctx.closePath();ctx.fillStyle=style;ctx.fill();style=addGradient(ctx,radius,height,radius,height-radius,0,opacity);ctx.beginPath();ctx.moveTo(width,height);ctx.lineTo(0,height);ctx.lineTo(0,height-radius);ctx.lineTo(width-radius,height-radius);ctx.closePath();ctx.fillStyle=style;ctx.fill();}
function roundedShadow(ctx,x,y,width,height,radius,opacity){var style;ctx.beginPath();ctx.rect(x,y+height-radius,radius,radius);ctx.closePath();style=addRadialStyle(ctx,x+radius,y+height-radius,radius-x,x+radius,y+height-radius,radius,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+radius,y+height-y,width-(radius*2.25),y);ctx.closePath();style=addLinearStyle(ctx,x+radius,y+height-y,x+radius,y+height,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-(radius*1.25),y+height-(radius*1.25),radius*1.25,radius*1.25);ctx.closePath();style=addRadialStyle(ctx,x+width-(radius*1.25),y+height-(radius*1.25),(radius*1.25)-1.5-x,x+width-(radius*1.25),y+height-(radius*1.25),radius*1.25,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-x,y+radius,x,height-(radius*2.25));ctx.closePath();style=addLinearStyle(ctx,x+width-x,y+radius,x+width,y+radius,opacity);ctx.fillStyle=style;ctx.fill();ctx.beginPath();ctx.rect(x+width-radius,y,radius,radius);ctx.closePath();style=addRadialStyle(ctx,x+width-radius,y+radius,radius-x,x+width-radius,y+radius,radius,opacity);ctx.fillStyle=style;ctx.fill();}
function addIECorners(){var theimages=getImages('corner');var image;var object;var vml;var div;var pos;var i;var classes='';var iradius=null;var ishadow=null;var ishade=null;var inverse=null;var newClasses='';var maxdim=null;var offset=null;var radius=null;var display="";var flt=null;var width=null;var height=null;var start,head,soft,shadow,fill,foot,end;var left,top,bottom,right,lt,br,linear,inset;for(i=0;i<theimages.length;i++){image=theimages[i];object=image.parentNode;classes=image.className.split(' ');iradius=getClassValue(classes,"iradius");ishadow=getClassValue(classes,"ishadow");ishade=getClassValue(classes,"ishade");inverse=getClassAttribute(classes,"inverse");newClasses=getClasses(classes,"corner");width=image.width;height=image.height;maxdim=Math.min(width,height)/2;iradius=Math.min(maxdim,iradius);offset=4;offset=(ishadow>0?(inverse>0?0:Math.min(Math.max(offset,iradius/2),16)):0);radius=getRadius(iradius,width,height);display=(image.currentStyle.display.toLowerCase()=='block')?'block':'inline-block';vml=document.createElement(['<var style="overflow:hidden;display:'+display+';width:'+width+'px;height:'+height+'px;padding:0;">'].join(''));flt=image.currentStyle.styleFloat.toLowerCase();display=(flt=='left'||flt=='right')?'inline':display;start='<v:group style="zoom:1; display:'+display+'; margin:-1px 0 0 -1px; padding:0; position:relative; width:'+width+'px;height:'+height+'px;" coordsize="'+width+','+height+'">';fill='<v:fill src="'+image.src+'" type="frame" />';foot=(iradius>0?'</v:roundrect>':'</v:rect>');end='</v:group>';soft='';shadow='';lt='';left='';top='';bottom='';right='';if(iradius<=0){if(ishadow>0){if(inverse<=0){ishadow=ishadow/50;offset=8;inset=4;soft='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+width+'px;height:'+height+'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity='+(ishadow*64)+'), progid:dxImageTransform.Microsoft.Blur(PixelRadius='+inset+', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:'+inset+'px;left:'+inset+'px;width:'+(width-(3*inset))+'px;height:'+(height-(3*inset))+'px;"><v:fill color="#000000" opacity="1" /></v:rect>';head='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+(width-offset)+'px;height:'+(height-offset)+'px;">';}else if(inverse>0){ishadow=ishadow/50;iradius=12;linear="linear";head='<v:rect filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';shadow='<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+width+','+iradius+'" path="m 0,0 l '+width+',0,'+width+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+width+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+height+'" path="m 0,0 l 0,'+height+','+iradius+','+height+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+height+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';}}else{head='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="margin:-1px 0 0 -1px;padding:0;display:'+display+';width:'+width+'px;height:'+height+'px;">';}
if(ishade>0){ishade=ishade/50;iradius=12;top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m 0,0 l '+(width-offset)+',0,'+(width-offset)+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+(width-offset)+'px; height:'+iradius+'px;"><v:fill method="linear" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m 0,0 l 0,'+(height-offset)+','+iradius+','+(height-offset)+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+(height-offset)+'px;"><v:fill method="linear" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';bottom='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m 0,'+iradius+' l '+(width-offset)+','+iradius+','+(width-offset-iradius)+',0,'+iradius+',0 x e" style="position:absolute; margin: 0; top:'+(height-offset-iradius)+'px; left: 0px; width:'+(width-offset)+'px; height:'+iradius+'px;"><v:fill method="linear" type="gradient" angle="180" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishade+'" /></v:shape>';right='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m '+iradius+',0 l '+iradius+','+(height-offset)+',0,'+(height-offset-iradius)+',0,'+iradius+' x e" style="position:absolute; margin: 0; top: 0px; left:'+(width-offset-iradius)+'px; width:'+iradius+'px; height:'+(height-offset)+'px;"><v:fill method="linear" type="gradient" angle="270" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishade+'" /></v:shape>';}}else{if(ishadow>0){linear="linear sigma";pos=2;if(inverse<=0){ishadow=ishadow/50;inset=Math.round(offset*0.5);soft='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:'+width+'px;height:'+height+'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:roundrect arcsize="'+(radius+inset)+'" strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity='+(ishadow*64)+'), progid:dxImageTransform.Microsoft.Blur(PixelRadius='+inset+', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:'+inset+'px;left:'+inset+'px;width:'+(width-(3*inset))+'px;height:'+(height-(3*inset))+'px;"><v:fill color="#000000" opacity="1" /></v:roundrect>';head='<v:roundrect arcsize="'+radius+'" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+(width-offset)+'px;height:'+(height-offset)+'px;">';}else if(inverse>0){ishadow=ishadow/50;head='<v:roundrect arcsize="'+radius+'" filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';shadow='<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+width+','+iradius+'" path="m '+iradius+','+iradius+' l '+width+','+iradius+' qy '+(width-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:'+(width+1)+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+height+'" path="m 0,'+iradius+' l 0,'+(height-iradius)+' qy '+iradius+','+height+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:'+iradius+'px; height:'+(height+1)+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';lt='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="'+iradius+','+iradius+'" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#000000" opacity="0" color2="#000000" o:opacity2="'+ishadow+'" /></v:shape>';}}else{pos=1;offset=0;head='<v:roundrect arcsize="'+radius+'" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:'+width+'px;height:'+height+'px;">';}
if(ishade>0){ishade=ishade/50;linear="linear";top='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+(width-offset)+','+iradius+'" path="m '+iradius+','+iradius+' l '+(width-offset)+','+iradius+' qy '+(width-offset-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:'+(width-offset+pos)+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';left='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+(height-offset)+'" path="m 0,'+iradius+' l 0,'+(height-iradius-offset)+' qy '+iradius+','+(height-offset)+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:'+iradius+'px; height:'+(height-offset+pos)+'px;"><v:fill method="'+linear+'" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';lt='<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="'+iradius+','+iradius+'" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:'+iradius+'px; height:'+iradius+'px;"><v:fill method="'+linear+'" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="'+ishade+'" /></v:shape>';}}
vml.innerHTML=start+soft+head+fill+shadow+foot+right+bottom+top+left+lt+end;vml.className=newClasses;vml.style.cssText=image.style.cssText;vml.style.height=image.height+'px';vml.style.width=image.width+'px';vml.height=image.height;vml.width=image.width;vml.src=image.src;vml.alt=image.alt;if(image.id!='')vml.id=image.id;if(image.title!='')vml.title=image.title;if(image.getAttribute('onclick')!='')vml.setAttribute('onclick',image.getAttribute('onclick'));if(image.getAttribute("usemap")){if(iradius>0){pos=offset;}else{pos=0;}
object.style.position='relative';object.style.height=height+'px';object.style.width=width+'px';image.left=0;image.top=0;image.style.position='absolute';image.style.height=height+'px';image.style.width=width+'px';image.style.left=0+'px';image.style.top=0+'px';image.style.filter="Alpha(opacity=0)";object.insertBefore(vml,image);}else{object.replaceChild(vml,image);}}}
function addCorners(img_c){var theimages=(typeof(img_c.length)!='undefined')?img_c:getImages('corner');var image;var object;var canvas;var context;var i;var iradius=null;var ishade=null;var ishadow=null;var inverse=null;var classes='';var newClasses='';var maxdim=null;var style=null;var offset=null;for(i=0;i<theimages.length;i++){image=theimages[i];object=image.parentNode;canvas=document.createElement('canvas');if(canvas.getContext){classes=image.className.split(' ');iradius=getClassValue(classes,"iradius");ishadow=getClassValue(classes,"ishadow");ishade=getClassValue(classes,"ishade");inverse=getClassAttribute(classes,"inverse");newClasses=getClasses(classes,"corner");canvas.className=newClasses;canvas.style.cssText=image.style.cssText;canvas.style.height=image.height+'px';canvas.style.width=image.width+'px';canvas.height=image.height;canvas.width=image.width;canvas.src=image.src;canvas.alt=image.alt;if(image.id!='')canvas.id=image.id;if(image.title!='')canvas.title=image.title;if(image.getAttribute('onclick')!='')canvas.setAttribute('onclick',image.getAttribute('onclick'));maxdim=Math.min(canvas.width,canvas.height)/2;iradius=Math.min(maxdim,iradius);offset=4;offset=(ishadow>0?(inverse>0?0:Math.min(Math.max(offset,iradius/2),16)):0);context=canvas.getContext("2d");if(image.getAttribute("usemap")){object.style.position='relative';object.style.height=image.height+'px';object.style.width=image.width+'px';canvas.left=0;canvas.top=0;canvas.style.position='absolute';canvas.style.left=0+'px';canvas.style.top=0+'px';image.left=0;image.top=0;image.style.position='absolute';image.style.height=image.height+'px';image.style.width=image.width+'px';image.style.left=0+'px';image.style.top=0+'px';image.style.opacity=0;object.insertBefore(canvas,image);}else{object.replaceChild(canvas,image);}
context.clearRect(0,0,canvas.width,canvas.height);context.save();if(ishadow>0&&inverse<=0){ishadow=ishadow/100;if(iradius>0){roundedShadow(context,offset,offset,canvas.width-offset,canvas.height-offset,iradius,ishadow);}else{offset=8;roundedShadow(context,offset,offset,canvas.width-offset,canvas.height-offset,offset,ishadow);}}
if(iradius<=0){context.beginPath();context.rect(0,0,canvas.width-offset,canvas.height-offset);context.closePath();}else{roundedRect(context,0,0,canvas.width-offset,canvas.height-offset,iradius);}
context.clip();context.fillStyle='rgba(0,0,0,0)';context.fillRect(0,0,canvas.width,canvas.height);context.drawImage(image,0,0,canvas.width-offset,canvas.height-offset);if(ishadow>0&&inverse>0){ishadow=ishadow/100;if(iradius>0){addShine(context,canvas.width,canvas.height,iradius,ishadow,1);roundedRect(context,0,0,canvas.width,canvas.height,iradius);}else{iradius=16;addShine(context,canvas.width,canvas.height,iradius,ishadow,1);context.beginPath();context.rect(0,0,canvas.width,canvas.height);context.closePath();}
context.strokeStyle='rgba(0,0,0,'+ishadow+')';context.lineWidth=2;context.stroke();}
if(ishade>0){ishade=ishade/100;if(iradius<=0)iradius=16;addShade(context,canvas.width-offset,canvas.height-offset,iradius,ishade);addShine(context,canvas.width-offset,canvas.height-offset,iradius,ishade);}
canvas.style.visibility='visible';}}}
if(window.attachEvent&&!window.opera)window.attachEvent("onload",addIECorners);else window.addEventListener("load",addCorners,false);;(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'/images/lightbox/lightbox-ico-loading.gif',imageBtnPrev:'/images/lightbox/lightbox-btn-prev.gif',imageBtnNext:'/images/lightbox/lightbox-btn-next.gif',imageBtnClose:'/images/lightbox/lightbox-btn-close.gif',imageBlank:'/images/lightbox/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Фото',txtOf:'из',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],ratingArray:[],activeImage:0,showRating:false},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.ratingArray.push(jQueryMatchedObj[i].getAttribute('id'));settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length+(settings.showRating?'<div class="photo-rate" id="'+settings.ratingArray[settings.activeImage]+'-lb">'+$('#'+settings.ratingArray[settings.activeImage].replace(/lb/,'rate')).html()+'</div>':'')).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);;var is_chrome=navigator.userAgent.toLowerCase().indexOf('chrome')>-1;var is_ie6=$.browser.msie&&($.browser.version.slice(0,1)=="6");var is_ie7=$.browser.msie&&($.browser.version.slice(0,1)=="7");var is_tupoy_ishak=is_ie6||is_ie7;$.fn.tagName=function(){return this.get(0).tagName;}
function load_top_menu(){var menu=$('#top-menu');var cashLi=menu.children();if(!cashLi.length)return;$('#top-menu li.mi ul li a').hover(function(){$(this).parent().stop().animate({'backgroundPosition':'(80px 0)'},500);if(is_tupoy_ishak){$(this).animate({'paddingLeft':'17px','paddingRight':'0px','width':'220px'},150);}else{$(this).animate({'paddingLeft':'17px','paddingRight':'0px','color':'black'},150);}},function(){$(this).parent().animate({'backgroundPosition':'(37px 0)'},500);if(is_tupoy_ishak){$(this).animate({'paddingLeft':'10px','width':'227px'},150);}else{$(this).animate({'paddingLeft':'10px','color':'#B37629'},150);}});var someTimer=null;$("#top-menu li.mi").hover(function(){var hLi=$(this);hLi.addClass("hover");$('ul:first',hLi).css('visibility','visible');if(!hLi.hasClass('hover'))$('ul:first',hLi).css({'opacity':'0'});setTimeout(function(){x=hLi.offset().left-24;y=hLi.offset().top-30;$('#flash_flower').css('left',x+'px');$('#flash_flower').css('top',y+'px');$('#flash_flower').css('display','block');if(!hLi.hasClass('hover')&&$('#flower_object').length>0)document.getElementById('flower_object').SetVariable('replay','yep');},50);$('ul:first',hLi).animate({'opacity':'1'},500);clearTimeout(someTimer);},function(){var hLi=$(this);$('ul:first',hLi).animate({'opacity':'0'},250);setTimeout(function(){$('ul:first',hLi).css('visibility','hidden');hLi.removeClass("hover");},300);someTimer=setTimeout(function(){$('#flash_flower').css('display','none');},300);});}
$(function(){load_top_menu();});$(document).ready(function(){$('.stick_banner a.x-close').each(function(){$(this).click(function(){$(this).parent().remove();return false;});});$('.content a.zoom').lightBox();if(is_tupoy_ishak&&$('body').height()<1200){$('.deco_left').hide();$('.deco_right').hide();}
$('a.text').hover(function(){if(!is_tupoy_ishak){$(this).stop().animate({'backgroundColor':'#DEB982','color':'black'},200);}},function(){if(!is_tupoy_ishak){$(this).stop().animate({'color':'#B37629'},200);}
$(this).css('background-color','transparent');});if($.flash.available){$('#flash_flower').flash({swf:swf_url+'flower.swf',width:'50',height:'50',id:'flower_object',params:{quality:'high',menu:'false',wmode:'transparent',allowscriptaccess:'always'}});}});
