(function(){var W=this,ab,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ac=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ab?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ab){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ab}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ac.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ab&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ab){var i=this[0];if(i){if(T.nodeName(i,"option")){return(i.attributes.value||{}).specified?i.value:i.text}if(T.nodeName(i,"select")){var e=i.selectedIndex,b=[],a=i.options,f=i.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=T(g).val();if(f){return c}b.push(c)}}return b}return(i.value||"").replace(/\r/g,"")}return ab}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var j=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,j)>=0||T.inArray(this.text,j)>=0)});if(!j.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ab?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(T.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=T.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,i=this.length;g<i;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){T.each(h,E)}}return this;function c(k,j){return a&&T.nodeName(k,"table")&&T.nodeName(j,"tr")?(k.getElementsByTagName("tbody")[0]||k.appendChild(k.ownerDocument.createElement("tbody"))):k}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ad(){return +new Date}T.extend=T.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!T.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ab){c[g]=a}}}}}return c};var ag=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&T.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(T.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ab){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ab){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ag.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ab?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,i=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(i,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&i&&i[h]){b=i[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(k,j){return j.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=i.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;i.left=b||0;b=i.pixelLeft+"px";i.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");T.each(g,function(l,i){if(typeof i==="number"){i+=""}if(!i){return}if(typeof i==="string"){i=i.replace(/(<(\w+)[^>]*?)\/>/g,function(r,q,s){return s.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?r:q+"></"+s+">"});var m=i.replace(/^\s+/,"").substring(0,10).toLowerCase();var k=!m.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!m.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||m.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!m.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!m.indexOf("<td")||!m.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!m.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=k[1]+i+k[2];while(k[0]--){a=a.lastChild}if(!T.support.tbody){var j=/<tbody/i.test(i),o=!m.indexOf("<table")&&!j?a.firstChild&&a.firstChild.childNodes:k[1]=="<table>"&&!j?a.childNodes:[];for(var p=o.length-1;p>=0;--p){if(T.nodeName(o[p],"tbody")&&!o[p].childNodes.length){o[p].parentNode.removeChild(o[p])}}}if(!T.support.leadingWhitespace&&/^\s/.test(i)){a.insertBefore(b.createTextNode(i.match(/^\s*/)[0]),a.firstChild)}i=T.makeArray(a.childNodes)}if(i.nodeType){f.push(i)}else{f=T.merge(f,i)}});if(d){for(var c=0;f[c];c++){if(T.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(T.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ab}var e=!T.isXMLDoc(c),a=b!==ab;f=e&&T.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ab}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ab:h}if(!T.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(j,i){return i.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||T.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!T.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=T.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ad(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ab){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ab){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ab){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ab&&this.length){c=T.data(this[0],d)}return c===ab&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ab){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,l=Object.prototype.toString;var o=function(s,x,ak,aj){ak=ak||[];x=x||document;if(x.nodeType!==1&&x.nodeType!==9){return[]}if(!s||typeof s!=="string"){return ak}var r=[],u,C,z,y,ai,w,t=true;b.lastIndex=0;while((u=b.exec(s))!==null){r.push(u[1]);if(u[2]){w=RegExp.rightContext;break}}if(r.length>1&&g.exec(s)){if(r.length===2&&k.relative[r[0]]){C=j(r[0]+r[1],x)}else{C=k.relative[r[0]]?[x]:o(r.shift(),x);while(r.length){s=r.shift();if(k.relative[s]){s+=r.shift()}C=j(s,C)}}}else{var D=aj?{expr:r.pop(),set:p(aj)}:o.find(r.pop(),r.length===1&&x.parentNode?x.parentNode:x,c(x));C=o.filter(D.expr,D.set);if(r.length>0){z=p(C)}else{t=false}while(r.length){var A=r.pop(),B=A;if(!k.relative[A]){A=""}else{B=r.pop()}if(B==null){B=x}k.relative[A](z,B,c(x))}}if(!z){z=C}if(!z){throw"Syntax error, unrecognized expression: "+(A||s)}if(l.call(z)==="[object Array]"){if(!t){ak.push.apply(ak,z)}else{if(x.nodeType===1){for(var q=0;z[q]!=null;q++){if(z[q]&&(z[q]===true||z[q].nodeType===1&&i(x,z[q]))){ak.push(C[q])}}}else{for(var q=0;z[q]!=null;q++){if(z[q]&&z[q].nodeType===1){ak.push(C[q])}}}}}else{p(z,ak)}if(w){o(w,x,ak,aj);if(m){hasDuplicate=false;ak.sort(m);if(hasDuplicate){for(var q=1;q<ak.length;q++){if(ak[q]===ak[q-1]){ak.splice(q--,1)}}}}}return ak};o.matches=function(r,q){return o(r,null,null,q)};o.find=function(q,y,z){var r,t;if(!q){return[]}for(var u=0,w=k.order.length;u<w;u++){var s=k.order[u],t;if((t=k.match[s].exec(q))){var x=RegExp.leftContext;if(x.substr(x.length-1)!=="\\"){t[1]=(t[1]||"").replace(/\\/g,"");r=k.find[s](t,y,z);if(r!=null){q=q.replace(k.match[s],"");break}}}}if(!r){r=y.getElementsByTagName("*")}return{set:r,expr:q}};o.filter=function(ai,aj,B,u){var w=ai,z=[],q=aj,s,y,r=aj&&aj[0]&&c(aj[0]);while(ai&&aj.length){for(var ak in k.filter){if((s=k.match[ak].exec(ai))!=null){var x=k.filter[ak],A,C;y=false;if(q==z){z=[]}if(k.preFilter[ak]){s=k.preFilter[ak](s,q,B,z,u,r);if(!s){y=A=true}else{if(s===true){continue}}}if(s){for(var t=0;(C=q[t])!=null;t++){if(C){A=x(C,s,t,q);var D=u^!!A;if(B&&A!=null){if(D){y=true}else{q[t]=false}}else{if(D){z.push(C);y=true}}}}}if(A!==ab){if(!B){q=z}ai=ai.replace(k.match[ak],"");if(!y){return[]}break}}}if(ai==w){if(y==null){throw"Syntax error, unrecognized expression: "+ai}else{break}}w=ai}return q};var k=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(q){return q.getAttribute("href")}},relative:{"+":function(q,y,r){var t=typeof y==="string",z=t&&!/\W/.test(y),s=t&&!z;if(z&&!r){y=y.toUpperCase()}for(var u=0,w=q.length,x;u<w;u++){if((x=q[u])){while((x=x.previousSibling)&&x.nodeType!==1){}q[u]=s||x&&x.nodeName===y?x||false:x===y}}if(s){o.filter(y,q,true)}},">":function(w,s,u){var y=typeof s==="string";if(y&&!/\W/.test(s)){s=u?s:s.toUpperCase();for(var r=0,t=w.length;r<t;r++){var x=w[r];if(x){var q=x.parentNode;w[r]=q.nodeName===s?q:false}}}else{for(var r=0,t=w.length;r<t;r++){var x=w[r];if(x){w[r]=y?x.parentNode:x.parentNode===s}}if(y){o.filter(s,w,true)}}},"":function(q,s,u){var r=h++,t=a;if(!s.match(/\W/)){var w=s=u?s:s.toUpperCase();t=d}t("parentNode",s,r,q,w,u)},"~":function(q,s,u){var r=h++,t=a;if(typeof s==="string"&&!s.match(/\W/)){var w=s=u?s:s.toUpperCase();t=d}t("previousSibling",s,r,q,w,u)}},find:{ID:function(s,r,q){if(typeof r.getElementById!=="undefined"&&!q){var t=r.getElementById(s[1]);return t?[t]:[]}},NAME:function(r,w,u){if(typeof w.getElementsByName!=="undefined"){var s=[],x=w.getElementsByName(r[1]);for(var q=0,t=x.length;q<t;q++){if(x[q].getAttribute("name")===r[1]){s.push(x[q])}}return s.length===0?null:s}},TAG:function(r,q){return q.getElementsByTagName(r[1])}},preFilter:{CLASS:function(q,s,r,t,w,u){q=" "+q[1].replace(/\\/g,"")+" ";if(u){return q}for(var y=0,x;(x=s[y])!=null;y++){if(x){if(w^(x.className&&(" "+x.className+" ").indexOf(q)>=0)){if(!r){t.push(x)}}else{if(r){s[y]=false}}}}return false},ID:function(q){return q[1].replace(/\\/g,"")},TAG:function(r,s){for(var q=0;s[q]===false;q++){}return s[q]&&c(s[q])?r[1]:r[1].toUpperCase()},CHILD:function(r){if(r[1]=="nth"){var q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(r[2]=="even"&&"2n"||r[2]=="odd"&&"2n+1"||!/\D/.test(r[2])&&"0n+"+r[2]||r[2]);r[2]=(q[1]+(q[2]||1))-0;r[3]=q[3]-0}r[0]=h++;return r},ATTR:function(x,s,r,t,w,u){var q=x[1].replace(/\\/g,"");if(!u&&k.attrMap[q]){x[1]=k.attrMap[q]}if(x[2]==="~="){x[4]=" "+x[4]+" "}return x},PSEUDO:function(w,s,r,t,u){if(w[1]==="not"){if(w[3].match(b).length>1||/^\w/.test(w[3])){w[3]=o(w[3],null,null,s)}else{var q=o.filter(w[3],s,r,true^u);if(!r){t.push.apply(t,q)}return false}}else{if(k.match.POS.test(w[0])||k.match.CHILD.test(w[0])){return true}}return w},POS:function(q){q.unshift(true);return q}},filters:{enabled:function(q){return q.disabled===false&&q.type!=="hidden"},disabled:function(q){return q.disabled===true},checked:function(q){return q.checked===true},selected:function(q){q.parentNode.selectedIndex;return q.selected===true},parent:function(q){return !!q.firstChild},empty:function(q){return !q.firstChild},has:function(q,r,s){return !!o(s[3],q).length},header:function(q){return/h\d/i.test(q.nodeName)},text:function(q){return"text"===q.type},radio:function(q){return"radio"===q.type},checkbox:function(q){return"checkbox"===q.type},file:function(q){return"file"===q.type},password:function(q){return"password"===q.type},submit:function(q){return"submit"===q.type},image:function(q){return"image"===q.type},reset:function(q){return"reset"===q.type},button:function(q){return"button"===q.type||q.nodeName.toUpperCase()==="BUTTON"},input:function(q){return/input|select|textarea|button/i.test(q.nodeName)}},setFilters:{first:function(q,r){return r===0},last:function(r,s,t,q){return s===q.length-1},even:function(q,r){return r%2===0},odd:function(q,r){return r%2===1},lt:function(q,r,s){return r<s[3]-0},gt:function(q,r,s){return r>s[3]-0},nth:function(q,r,s){return s[3]-0==r},eq:function(q,r,s){return s[3]-0==r}},filter:{PSEUDO:function(w,r,q,u){var s=r[1],y=k.filters[s];if(y){return y(w,q,r,u)}else{if(s==="contains"){return(w.textContent||w.innerText||"").indexOf(r[3])>=0}else{if(s==="not"){var x=r[3];for(var q=0,t=x.length;q<t;q++){if(x[q]===w){return false}}return true}}}},CHILD:function(y,u){var r=u[1],x=y;switch(r){case"only":case"first":while(x=x.previousSibling){if(x.nodeType===1){return false}}if(r=="first"){return true}x=y;case"last":while(x=x.nextSibling){if(x.nodeType===1){return false}}return true;case"nth":var w=u[2],z=u[3];if(w==1&&z==0){return true}var s=u[0],A=y.parentNode;if(A&&(A.sizcache!==s||!y.nodeIndex)){var t=0;for(x=A.firstChild;x;x=x.nextSibling){if(x.nodeType===1){x.nodeIndex=++t}}A.sizcache=s}var q=y.nodeIndex-z;if(w==0){return q==0}else{return(q%w==0&&q/w>=0)}}},ID:function(q,r){return q.nodeType===1&&q.getAttribute("id")===r},TAG:function(q,r){return(r==="*"&&q.nodeType===1)||q.nodeName===r},CLASS:function(q,r){return(" "+(q.className||q.getAttribute("class"))+" ").indexOf(r)>-1},ATTR:function(w,q){var r=q[1],t=k.attrHandle[r]?k.attrHandle[r](w):w[r]!=null?w[r]:w.getAttribute(r),u=t+"",x=q[2],s=q[4];return t==null?x==="!=":x==="="?u===s:x==="*="?u.indexOf(s)>=0:x==="~="?(" "+u+" ").indexOf(s)>=0:!s?u&&t!==false:x==="!="?u!=s:x==="^="?u.indexOf(s)===0:x==="$="?u.substr(u.length-s.length)===s:x==="|="?u===s||u.substr(0,s.length+1)===s+"-":false},POS:function(w,s,r,u){var t=s[2],q=k.setFilters[t];if(q){return q(w,r,s,u)}}}};var g=k.match.POS;for(var e in k.match){k.match[e]=RegExp(k.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var p=function(q,r){q=Array.prototype.slice.call(q);if(r){r.push.apply(r,q);return r}return q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){p=function(u,q){var s=q||[];if(l.call(u)==="[object Array]"){Array.prototype.push.apply(s,u)}else{if(typeof u.length==="number"){for(var r=0,t=u.length;r<t;r++){s.push(u[r])}}else{for(var r=0;u[r];r++){s.push(u[r])}}}return s}}var m;if(document.documentElement.compareDocumentPosition){m=function(r,s){var q=r.compareDocumentPosition(s)&4?-1:r===s?0:1;if(q===0){hasDuplicate=true}return q}}else{if("sourceIndex" in document.documentElement){m=function(r,s){var q=r.sourceIndex-s.sourceIndex;if(q===0){hasDuplicate=true}return q}}else{if(document.createRange){m=function(q,s){var r=q.ownerDocument.createRange(),t=s.ownerDocument.createRange();r.selectNode(q);r.collapse(true);t.selectNode(s);t.collapse(true);var u=r.compareBoundaryPoints(Range.START_TO_END,t);if(u===0){hasDuplicate=true}return u}}}}(function(){var r=document.createElement("form"),q="script"+(new Date).getTime();r.innerHTML="<input name='"+q+"'/>";var s=document.documentElement;s.insertBefore(r,s.firstChild);if(!!document.getElementById(q)){k.find.ID=function(x,w,u){if(typeof w.getElementById!=="undefined"&&!u){var t=w.getElementById(x[1]);return t?t.id===x[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===x[1]?[t]:ab:[]}};k.filter.ID=function(u,t){var w=typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id");return u.nodeType===1&&w&&w.nodeValue===t}}s.removeChild(r)})();(function(){var q=document.createElement("div");q.appendChild(document.createComment(""));if(q.getElementsByTagName("*").length>0){k.find.TAG=function(t,u){var w=u.getElementsByTagName(t[1]);if(t[1]==="*"){var r=[];for(var s=0;w[s];s++){if(w[s].nodeType===1){r.push(w[s])}}w=r}return w}}q.innerHTML="<a href='#'></a>";if(q.firstChild&&typeof q.firstChild.getAttribute!=="undefined"&&q.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var r=o,q=document.createElement("div");q.innerHTML="<p class='TEST'></p>";if(q.querySelectorAll&&q.querySelectorAll(".TEST").length===0){return}o=function(w,x,t,s){x=x||document;if(!s&&x.nodeType===9&&!c(x)){try{return p(x.querySelectorAll(w),t)}catch(u){}}return r(w,x,t,s)};o.find=r.find;o.filter=r.filter;o.selectors=r.selectors;o.matches=r.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var q=document.createElement("div");q.innerHTML="<div class='test e'></div><div class='test'></div>";if(q.getElementsByClassName("e").length===0){return}q.lastChild.className="e";if(q.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(t,s,r){if(typeof s.getElementsByClassName!=="undefined"&&!r){return s.getElementsByClassName(t[1])}}})()}function d(x,r,s,z,q,A){var B=x=="previousSibling"&&!A;for(var u=0,w=z.length;u<w;u++){var y=z[u];if(y){if(B&&y.nodeType===1){y.sizcache=s;y.sizset=u}y=y[x];var t=false;while(y){if(y.sizcache===s){t=z[y.sizset];break}if(y.nodeType===1&&!A){y.sizcache=s;y.sizset=u}if(y.nodeName===r){t=y;break}y=y[x]}z[u]=t}}}function a(x,r,s,z,q,A){var B=x=="previousSibling"&&!A;for(var u=0,w=z.length;u<w;u++){var y=z[u];if(y){if(B&&y.nodeType===1){y.sizcache=s;y.sizset=u}y=y[x];var t=false;while(y){if(y.sizcache===s){t=z[y.sizset];break}if(y.nodeType===1){if(!A){y.sizcache=s;y.sizset=u}if(typeof r!=="string"){if(y===r){t=true;break}}else{if(o.filter(r,[y]).length>0){t=y;break}}}y=y[x]}z[u]=t}}}var i=document.compareDocumentPosition?function(q,r){return q.compareDocumentPosition(r)&16}:function(q,r){return q!==r&&(q.contains?q.contains(r):true)};var c=function(q){return q.nodeType===9&&q.documentElement.nodeName!=="HTML"||!!q.ownerDocument&&c(q.ownerDocument)};var j=function(t,w){var q=[],y="",x,r=w.nodeType?[w]:w;while((x=k.match.PSEUDO.exec(t))){y+=x[0];t=t.replace(k.match.PSEUDO,"")}t=k.relative[t]?t+"*":t;for(var u=0,s=r.length;u<s;u++){o(t,r[u],q)}return o.filter(y,q)};T.find=o;T.filter=o.filter;T.expr=o.selectors;T.expr[":"]=T.expr.filters;o.selectors.filters.hidden=function(q){return q.offsetWidth===0||q.offsetHeight===0};o.selectors.filters.visible=function(q){return q.offsetWidth>0||q.offsetHeight>0};o.selectors.filters.animated=function(q){return T.grep(T.timers,function(r){return q===r.elem}).length};T.multiFilter=function(q,s,r){if(r){q=":not("+q+")"}return o.matches(q,s)};T.dir=function(r,s){var t=[],q=r[s];while(q&&q!=document){if(q.nodeType==1){t.push(q)}q=q[s]}return t};T.nth=function(u,t,r,q){t=t||1;var s=0;for(;u;u=u[r]){if(u.nodeType==1&&++s==t){break}}return u};T.sibling=function(q,r){var s=[];for(;q;q=q.nextSibling){if(q.nodeType==1&&q!=r){s.push(q)}}return s};return;W.Sizzle=o})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ab){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ab});b.elem=c;T.each(f.split(/\s+/),function(k,j){var i=j.split(".");j=i.shift();d.type=i.slice().sort().join(".");var h=g[j];if(T.event.specialAll[j]){T.event.specialAll[j].setup.call(c,a,i)}if(!h){h=g[j]={};if(!T.event.special[j]||T.event.special[j].setup.call(c,a,i)===false){if(c.addEventListener){c.addEventListener(j,b,false)}else{if(c.attachEvent){c.attachEvent("on"+j,b)}}}}h[d.guid]=d;T.event.global[j]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ab||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}T.each(e.split(/\s+/),function(m,k){var i=k.split(".");k=i.shift();var l=RegExp("(^|\\.)"+i.slice().sort().join(".*\\.")+"(\\.|$)");if(f[k]){if(c){delete f[k][c.guid]}else{for(var j in f[k]){if(l.test(f[k][j].type)){delete f[k][j]}}}if(T.event.specialAll[k]){T.event.specialAll[k].teardown.call(b,i)}for(g in f[k]){break}if(!g){if(!T.event.special[k]||T.event.special[k].teardown.call(b,i)===false){if(b.removeEventListener){b.removeEventListener(k,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+k,T.data(b,"handle"))}}}g=null;delete f[k]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ab}d.result=ab;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(T.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ab){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.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(c){if(c[aa]){return c}var e=c;c=T.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],af)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],af)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ad();this[aa]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ah=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ah,b)},teardown:function(){T.event.remove(this,a,ah)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function af(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.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(a,b){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.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 d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}T.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(i,h){if(h=="success"||h=="notmodified"){f.html(g?T("<div/>").append(i.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):i.responseText)}if(a){f.each(a,[i.responseText,h,i])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.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(c,b){var a=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ad();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.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(k){k=T.extend(true,k,T.extend(true,{},T.ajaxSettings,k));var a,s=/=\?(&|$)/g,f,b,r=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string"){k.data=T.param(k.data)}if(k.dataType=="jsonp"){if(r=="GET"){if(!k.url.match(s)){k.url+=(k.url.match(/\?/)?"&":"?")+(k.jsonp||"callback")+"=?"}}else{if(!k.data||!k.data.match(s)){k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?"}}k.dataType="json"}if(k.dataType=="json"&&(k.data&&k.data.match(s)||k.url.match(s))){a="jsonp"+N++;if(k.data){k.data=(k.data+"").replace(s,"="+a+"$1")}k.url=k.url.replace(s,"="+a+"$1");k.dataType="script";W[a]=function(w){b=w;p();l();W[a]=ab;try{delete W[a]}catch(u){}if(q){q.removeChild(d)}}}if(k.dataType=="script"&&k.cache==null){k.cache=false}if(k.cache===false&&r=="GET"){var t=ad();var c=k.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+t+"$2");k.url=c+((c==k.url)?(k.url.match(/\?/)?"&":"?")+"_="+t:"")}if(k.data&&r=="GET"){k.url+=(k.url.match(/\?/)?"&":"?")+k.data;k.data=null}if(k.global&&!T.active++){T.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(k.url);if(k.dataType=="script"&&r=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var q=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=k.url;if(k.scriptCharset){d.charset=k.scriptCharset}if(!a){var i=false;d.onload=d.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){i=true;p();l();d.onload=d.onreadystatechange=null;q.removeChild(d)}}}q.appendChild(d);return ab}var m=false;var o=k.xhr();if(k.username){o.open(r,k.url,k.async,k.username,k.password)}else{o.open(r,k.url,k.async)}try{if(k.data){o.setRequestHeader("Content-Type",k.contentType)}if(k.ifModified){o.setRequestHeader("If-Modified-Since",T.lastModified[k.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(e){}if(k.beforeSend&&k.beforeSend(o,k)===false){if(k.global&&!--T.active){T.event.trigger("ajaxStop")}o.abort();return false}if(k.global){T.event.trigger("ajaxSend",[o,k])}var j=function(x){if(o.readyState==0){if(h){clearInterval(h);h=null;if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!m&&o&&(o.readyState==4||x=="timeout")){m=true;if(h){clearInterval(h);h=null}f=x=="timeout"?"timeout":!T.httpSuccess(o)?"error":k.ifModified&&T.httpNotModified(o,k.url)?"notmodified":"success";if(f=="success"){try{b=T.httpData(o,k.dataType,k)}catch(u){f="parsererror"}}if(f=="success"){var w;try{w=o.getResponseHeader("Last-Modified")}catch(u){}if(k.ifModified&&w){T.lastModified[k.url]=w}if(!a){p()}}else{T.handleError(k,o,f)}l();if(x){o.abort()}if(k.async){o=null}}}};if(k.async){var h=setInterval(j,13);if(k.timeout>0){setTimeout(function(){if(o&&!m){j("timeout")}},k.timeout)}}try{o.send(k.data)}catch(e){T.handleError(k,o,null,e)}if(!k.async){j()}function p(){if(k.success){k.success(b,f)}if(k.global){T.event.trigger("ajaxSuccess",[o,k])}}function l(){if(k.complete){k.complete(o,f)}if(k.global){T.event.trigger("ajaxComplete",[o,k])}if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==T.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(ae.concat.apply([],ae.slice(0,c)),function(){a[this]=b});return a}T.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=T.data(this[e],"olddisplay");this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),i,f=this.nodeType==1&&T(this).is(":hidden"),h=this;for(i in a){if(a[i]=="hide"&&f||a[i]=="show"&&!f){return g.complete.call(this)}if((i=="height"||i=="width")&&this.style){g.display=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(p,k){var l=new T.fx(h,g,p);if(/toggle|show|hide/.test(k)){l[k=="toggle"?f?"show":"hide":k](a)}else{var m=k.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),j=l.cur(true)||0;if(m){var q=parseFloat(m[2]),o=m[3]||"px";if(o!="px"){h.style[p]=(q||1)+o;j=((q||1)/l.cur(true))*j;h.style[p]=j+o}if(m[1]){q=((m[1]=="-="?-1:1)*q)+j}l.custom(j,q,o)}else{l.custom(j,k,"")}}});return true})},stop:function(b,c){var a=T.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ad();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ab}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ad();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var f=this[0],i=f.offsetParent,j=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,k=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===i){b+=f.offsetTop,g+=f.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}j=i,i=f.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=c}if(k.position==="relative"||k.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(k.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}T.offset={initialize:function(){if(this.initialized){return}var c=document.body,i=document.createElement("div"),g,h,a,f,b,j,e=c.style.marginTop,d='<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>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(j in b){i.style[j]=b[j]}i.innerHTML=d;c.insertBefore(i,c.firstChild);g=i.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(i);this.initialized=true},bodyOffset:function(c){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ab?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ab?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();(function($){$.fn.autocomplete=function(options){return this.each(function(){return new Autocomplete(this,options)})};var reEscape=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");var fnFormatResult=function(value,data,currentValue){var pattern="("+currentValue.replace(reEscape,"\\$1")+")";return value.replace(new RegExp(pattern,"gi"),"<strong>$1</strong>")};var Autocomplete=function(el,options){this.el=$(el);this.el.attr("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.val();this.intervalId=0;this.cachedResponse=[];this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=options.serviceUrl;this.isLocal=false;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0,width:0,highlight:true,params:{},fnFormatResult:fnFormatResult,delimiter:null};if(options){$.extend(this.options,options)}if(this.options.lookup){this.isLocal=true;if($.isArray(this.options.lookup)){this.options.lookup={suggestions:this.options.lookup,data:[]}}}this.initialize()};Autocomplete.prototype={killerFn:null,initialize:function(){var me,zindex;me=this;zindex=Math.max.apply(null,$.map($("body > *"),function(e,n){if($(e).css("position")==="absolute"){return parseInt($(e).css("z-index"),10)||1}}));this.killerFn=function(e){if($(e.target).parents(".autocomplete").size()===0){me.killSuggestions();me.disableKillerFn()}};var uid=new Date().getTime();var autocompleteElId="Autocomplete_"+uid;if(!this.options.width){this.options.width=this.el.width()}this.mainContainerId="AutocompleteContainter_"+uid;$('<div id="'+this.mainContainerId+'" style="position:absolute;z-index='+zindex+'"><div class="autocomplete-w1"><div class="autocomplete" id="'+autocompleteElId+'" style="display:none; width:'+this.options.width+'px;"></div></div></div>').appendTo("body");this.container=$("#"+autocompleteElId);this.fixPosition();if(window.opera){this.el.keypress(function(e){me.onKeyPress(e)})}else{this.el.keydown(function(e){me.onKeyPress(e)})}this.el.keyup(function(e){me.onKeyUp(e)});this.el.blur(function(){me.enableKillerFn()});this.el.focus(function(){me.fixPosition()});this.container.css({maxHeight:this.options.maxHeight+"px"})},fixPosition:function(){var offset=this.el.offset();$("#"+this.mainContainerId).css({top:(offset.top+this.el.innerHeight())+"px",left:offset.left+"px"})},enableKillerFn:function(){var me=this;$(document).bind("click",me.killerFn)},disableKillerFn:function(){var me=this;$(document).unbind("click",me.killerFn)},killSuggestions:function(){var me=this;this.stopKillSuggestions();this.intervalId=window.setInterval(function(){me.hide();me.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(e){if(!this.enabled){return}switch(e.keyCode){case 27:this.el.val(this.currentValue);this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(e.keyCode===9){return}break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}e.stopImmediatePropagation();e.preventDefault()},onKeyUp:function(e){switch(e.keyCode){case 38:case 40:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val()){if(this.options.deferRequestBy>0){var me=this;this.onChangeInterval=setInterval(function(){me.onValueChange()},this.options.deferRequestBy)}else{this.onValueChange()}}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.val();var q=this.getQuery(this.currentValue);this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=false;return}if(q===""||q.length<this.options.minChars){this.hide()}else{this.getSuggestions(q)}},getQuery:function(val){var d,arr;d=this.options.delimiter;if(!d){return $.trim(val)}arr=val.split(d);return $.trim(arr[arr.length-1])},getSuggestionsLocal:function(q){var ret,arr,len,val;arr=this.options.lookup;len=arr.suggestions.length;ret={suggestions:[],data:[]};for(var i=0;i<len;i++){val=arr.suggestions[i];if(val.toLowerCase().indexOf(q.toLowerCase())===0){ret.suggestions.push(val);ret.data.push(arr.data[i])}}return ret},getSuggestions:function(q){var cr,me,ls;cr=this.isLocal?this.getSuggestionsLocal(q):this.cachedResponse[q];if(cr&&$.isArray(cr.suggestions)){this.suggestions=cr.suggestions;this.data=cr.data;this.suggest()}else{if(!this.isBadQuery(q)){me=this;me.options.params.query=q;$.get(this.serviceUrl,me.options.params,function(txt){me.processResponse(txt)},"text")}}},isBadQuery:function(q){var i=this.badQueries.length;while(i--){if(q.indexOf(this.badQueries[i])===0){return true}}return false},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide()},suggest:function(){if(this.suggestions.length===0){this.hide();return}var me,len,div,f;me=this;len=this.suggestions.length;f=this.options.fnFormatResult;v=this.getQuery(this.currentValue);this.container.hide().empty();for(var i=0;i<len;i++){div=$((me.selectedIndex===i?'<div class="selected"':"<div")+' title="'+this.suggestions[i]+'">'+f(this.suggestions[i],this.data[i],v)+"</div>");div.mouseover((function(xi){return function(){me.activate(xi)}})(i));div.click((function(xi){return function(){me.select(xi)}})(i));this.container.append(div)}this.enabled=true;this.container.show()},processResponse:function(text){var response;try{response=eval("("+text+")")}catch(err){return}if(!$.isArray(response.data)){response.data=[]}this.suggestions=response.suggestions;this.data=response.data;this.cachedResponse[response.query]=response;if(response.suggestions.length===0){this.badQueries.push(response.query)}if(response.query===this.getQuery(this.currentValue)){this.suggest()}},activate:function(index){var divs=this.container.children();var activeItem;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){$(divs.get(this.selectedIndex)).attr("class","")}this.selectedIndex=index;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){activeItem=divs.get(this.selectedIndex);$(activeItem).attr("class","selected")}return activeItem},deactivate:function(div,index){div.className="";if(this.selectedIndex===index){this.selectedIndex=-1}},select:function(i){var selectedValue=this.suggestions[i];if(selectedValue){this.el.val(selectedValue);if(this.options.autoSubmit){var f=this.el.parents("form");if(f.length>0){f.get(0).submit()}}this.ignoreValueChange=true;this.hide();this.onSelect(i)}},moveUp:function(){if(this.selectedIndex===-1){return}if(this.selectedIndex===0){this.container.children().get(0).className="";this.selectedIndex=-1;this.el.val(this.currentValue);return}this.adjustScroll(this.selectedIndex-1)},moveDown:function(){if(this.selectedIndex===(this.suggestions.length-1)){return}this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(i){var activeItem,offsetTop,upperBound,lowerBound;activeItem=this.activate(i);offsetTop=activeItem.offsetTop;upperBound=this.container.scrollTop();lowerBound=upperBound+this.options.maxHeight-25;if(offsetTop<upperBound){this.container.scrollTop(offsetTop)}else{if(offsetTop>lowerBound){this.container.scrollTop(offsetTop-this.options.maxHeight+25)}}},onSelect:function(i){var me,onSelect,getValue,s,d;me=this;onSelect=me.options.onSelect;getValue=function(value){var del,currVal;del=me.options.delimiter;currVal=me.currentValue;if(!del){return value}var arr=currVal.split(del);if(arr.length===1){return value}return currVal.substr(0,currVal.length-arr[arr.length-1].length)+value};s=me.suggestions[i];d=me.data[i];me.el.val(getValue(s));if($.isFunction(onSelect)){onSelect(s,d)}}}})(jQuery);(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var c=a.data(this[0],"validator");if(c){return c}c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=true});this.submit(function(d){if(c.settings.debug){d.preventDefault()}function e(){if(c.settings.submitHandler){c.settings.submitHandler.call(c,c.currentForm);return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return e()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return e()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var c=false;var b=a(this[0].form).validate();this.each(function(){c|=b.element(this)});return c}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(e,f){b[f]=c.attr(f);c.removeAttr(f)});return b},rules:function(e,b){var g=this[0];if(e){var d=a.data(g.form,"validator").settings;var i=d.rules;var j=a.validator.staticRules(g);switch(e){case"add":a.extend(j,a.validator.normalizeRule(b));i[g.name]=j;if(b.messages){d.messages[g.name]=a.extend(d.messages[g.name],b.messages)}break;case"remove":if(!b){delete i[g.name];return j}var h={};a.each(b.split(/\s/),function(k,l){h[l]=j[l];delete j[l]});return h}}var f=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(g),a.validator.classRules(g),a.validator.attributeRules(g),a.validator.staticRules(g)),g);if(f.required){var c=f.required;delete f.required;f=a.extend({required:c},f)}return f}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(b.value)},filled:function(b){return !!a.trim(b.value)},unchecked:function(b){return !b.checked}});a.format=function(b,c){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.format.apply(this,d)}}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!=Array){c=[c]}a.each(c,function(d,e){b=b.replace(new RegExp("\\{"+d+"\\}","g"),e)});return b};a.validator=function(b,c){this.settings=a.extend({},a.validator.defaults,b);this.currentForm=c;this.init()};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass);this.errorsFor(b).hide()}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b){if(b.name in this.submitted){this.element(b)}},highlight:function(c,b){a(c).addClass(b)},unhighlight:function(c,b){a(c).removeClass(b)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.format("Please enter no more than {0} characters."),minlength:a.format("Please enter at least {0} characters."),rangelength:a.format("Please enter a value between {0} and {1} characters long."),range:a.format("Please enter a value between {0} and {1}."),max:a.format("Please enter a value less than or equal to {0}."),min:a.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=(this.groups={});a.each(this.settings.groups,function(e,f){a.each(f.split(/\s/),function(h,g){b[g]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function c(f){var e=a.data(this[0].form,"validator");e.settings["on"+f.type]&&e.settings["on"+f.type].call(e,this[0])}a(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",c).delegate("click",":radio, :checkbox",c);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var b=0,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b])}return this.valid()},element:function(c){c=this.clean(c);this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c);if(b){delete this.invalid[c.name]}else{this.invalid[c.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in c)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var c=0;for(var b in d){c++}return c},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.formSubmitted=false;this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(c){c=this.clean(c);if(this.checkable(c)){c=this.findByName(c.name)[0]}var h=a(c).rules();var d=false;for(method in h){var g={method:method,parameters:h[method]};try{var b=a.validator.methods[method].call(this,c.value.replace(/\r/g,""),c,g.parameters);if(b=="dependency-mismatch"){d=true;continue}d=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return}if(!b){this.formatAndAdd(c,g);return false}}catch(f){this.settings.debug&&window.console&&console.log("exception occured when checking element "+c.id+", check the '"+g.method+"' method");throw f}}if(d){return}if(this.objectLength(h)){this.successList.push(c)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor==String?b:b[d])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method);if(typeof c=="function"){c=c.call(this,d.parameters,b)}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parents(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var c=0;this.errorList[c];c++){var b=this.errorList[c];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass);this.showLabel(b.element,b.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var c=0;this.successList[c];c++){this.showLabel(this.successList[c])}}if(this.settings.unhighlight){for(var c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],this.settings.errorClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass().addClass(this.settings.errorClass);b.attr("generated")&&b.html(d)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(b).length){this.settings.errorPlacement?this.settings.errorPlacement(b,a(c)):b.insertAfter(c)}}if(!d&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b)}this.toShow=this.toShow.add(b)},errorsFor:function(b){return this.errors().filter("[for='"+this.idOrName(b)+"']")},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,e){return e.form==c&&e.name==b&&e||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit()}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var e={};var b=a(c);for(method in a.validator.methods){var d=b.attr(method);if(d){e[method]=d}}if(e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)){delete e.maxlength}return e},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{}}return d},normalizeRules:function(c,b){a.each(c,function(f,e){if(e===false){delete c[f];return}if(e.param||e.depends){var d=true;switch(typeof e.depends){case"string":d=!!a(e.depends,b.form).length;break;case"function":d=e.depends.call(b,b);break}if(d){c[f]=e.param!==undefined?e.param:true}else{delete c[f]}}});a.each(c,function(d,e){c[d]=a.isFunction(e)?e(b):e});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(c){if(typeof c=="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true});c=b}return c},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c;if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(d,c,e){if(!this.depend(e,c)){return"dependency-mismatch"}switch(c.nodeName.toLowerCase()){case"select":var b=a("option:selected",c);return b.length>0&&(c.type=="select-multiple"||(a.browser.msie&&!(b[0].attributes.value.specified)?b[0].text:b[0].value).length>0);case"input":if(this.checkable(c)){return this.getLength(d,c)>0}default:return a.trim(d).length>0}},remote:function(f,c,g){if(this.optional(c)){return"dependency-mismatch"}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}this.settings.messages[c.name].remote=typeof d.message=="function"?d.message(f):d.message;g=typeof g=="string"&&{url:g}||g;if(d.old!==f){d.old=f;var b=this;this.startRequest(c);var e={};e[c.name]=f;a.ajax(a.extend(true,{url:g,mode:"abort",port:"validate"+c.name,dataType:"json",data:e,success:function(i){if(i){var h=b.formSubmitted;b.prepareElement(c);b.formSubmitted=h;b.successList.push(c);b.showErrors()}else{var j={};j[c.name]=i||b.defaultMessage(c,"remote");b.showErrors(j)}d.valid=i;b.stopRequest(c,i)}},g));return"pending"}else{if(this.pending[c.name]){return"pending"}}return d.valid},minlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)>=d},maxlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)<=d},rangelength:function(d,b,e){var c=this.getLength(a.trim(d),b);return this.optional(b)||(c>=e[0]&&c<=e[1])},min:function(c,b,d){return this.optional(b)||c>=d},max:function(c,b,d){return this.optional(b)||c<=d},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1])},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},dateDE:function(c,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},numberDE:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(f,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9-]+/.test(f)){return false}var g=0,e=0,b=false;f=f.replace(/\D/g,"");for(n=f.length-1;n>=0;n--){var d=f.charAt(n);var e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)==0},accept:function(c,b,d){d=typeof d=="string"?d:"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+d+")$","i"))},equalTo:function(c,b,d){return c==a(d).val()}}})})(jQuery);(function(c){var b=c.ajax;var a={};c.ajax=function(e){e=c.extend(e,c.extend({},c.ajaxSettings,e));var d=e.port;if(e.mode=="abort"){if(a[d]){a[d].abort()}return(a[d]=b.apply(this,arguments))}return b.apply(this,arguments)}})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){if(a.browser.msie){return false}this.addEventListener(c,a.event.special[b].handler,true)},teardown:function(){if(a.browser.msie){return false}this.removeEventListener(c,a.event.special[b].handler,true)},handler:function(d){arguments[0]=a.event.fix(d);arguments[0].type=b;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{delegate:function(d,c,b){return this.bind(d,function(e){var f=a(e.target);if(f.is(c)){return b.apply(f,arguments)}})},triggerEvent:function(b,c){return this.triggerHandler(b,[a.event.fix({type:b,target:c})])}})})(jQuery);(function(){var a=function(e,d){var c=this;c.point=e;c.opts=d||{};c.isActive=false;c.opts=$.extend({id:"",orgId:"",isBranch:true,img:"",icon:c.icon},this.opts);d=c.opts;GMarker.apply(c,arguments);return c};var b=a.prototype=new GMarker(new GLatLng(0,0));$.extend(b,{image:"/img/pbank.png",activeImage:"/img/pbank-active.png",mainOfficeImage:"/img/pbank-main.png",shadowImage:"/img/pbank_shadow.png"});b.initialize=function(f){var d=this;var g="m"+d.opts.orgId;var c=commandManager;d.map=f;GMarker.prototype.initialize.apply(d,arguments);var e=function(){d.map.panTo(d.point)};c.addEventHandler(c.getPostCommandEventName(c.names.ACTIVATE_MAP_MARKER),function(h){d.isActive=false;h.id!=g&&d.setImage(b.image)});c.subscribe(c.names.ACTIVATE_MAP_MARKER,g,function(){d.isActive=true;d.setImage(b.activeImage)});GEvent.addListener(d,"click",function(){setTimeout(e,200);!d.isActive&&c.fireAsync(c.names.ACTIVATE_MAP_MARKER,g,{});c.fire(c.names.SHOW_BANK_INFO,d.opts.id,{params:{isBranch:d.opts.isBranch,orgId:d.opts.orgId}})})};(function(){var e=new GIcon(G_DEFAULT_ICON);var d=25;var c=36;e.image=b.image;e.shadow=b.shadowImage;e.iconSize=new GSize(d,c);e.shadowSize=new GSize(47,c);e.iconAnchor=new GPoint(12,c);this.icon=e}).call(b);b.redraw=function(c){GMarker.prototype.redraw.apply(this,arguments)};b.copy=function(){return new a(this.point,this.opts)};b.remove=function(){GMarker.prototype.remove.apply(this,arguments);delete arguments.callee};b.constructor=a;window.GBankMarker=a})();var qTipTag="acronym,img,a,span";var qTipX=0;var qTipY=15;tooltip={name:"qtip",offsetX:qTipX,offsetY:qTipY,width:0,height:0,bodyW:0,bodyH:0,scrollX:0,scrollY:0,doc:null,tip:null};tooltip.init=function(){var c="http://www.w3.org/1999/xhtml";if(!d){var d="qtip"}var g=document.getElementById(d);if(!g){g=document.createElementNS?document.createElementNS(c,"div"):document.createElement("div");g.setAttribute("id",d);document.getElementsByTagName("body").item(0).appendChild(g)}if(!document.getElementById){return}this.tip=document.getElementById(this.name);if(this.tip){document.onmousemove=function(a){tooltip.move(a)}}var k,l,b;var h=qTipTag.split(",");for(var e=0;e<h.length;e++){b=document.getElementsByTagName(h[e]);if(b){for(var f=0;f<b.length;f++){k=b[f];l=k.getAttribute("title");if(l){k.setAttribute("tiptitle",l);k.removeAttribute("title");k.removeAttribute("alt");k.onmouseover=function(){tooltip.show(this.getAttribute("tiptitle"))};k.onmouseout=function(){tooltip.hide()}}}}}};tooltip.move=function(b){var a=0,c=0;if(document.all){a=(document.documentElement&&document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft;c=(document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop;a+=window.event.clientX;c+=window.event.clientY}else{a=b.pageX;c=b.pageY}a=a+this.offsetX;c=c+this.offsetY;if((a-this.scrollX+this.width)>this.bodyW){if(this.width>150){a=a-Math.round(this.width*2/3)-10}else{a=a-this.width}}if((c-this.scrollY+this.height)>this.bodyH){c=c-this.height-20}this.tip.style.left=a+"px";this.tip.style.top=c+"px"};tooltip.show=function(c){if(!this.tip){return}this.tip.innerHTML=c;this.tip.style.display="block";var a=$(this.tip);this.height=a.innerHeight();this.width=a.innerWidth();var b=$(document.body);this.bodyW=b.innerWidth();this.bodyH=b.innerHeight();this.scrollX=this.doc.scrollLeft();this.scrollY=this.doc.scrollTop();if(window.screen&&window.screen.availHeight&&this.bodyH>window.screen.availHeight){this.bodyH=window.screen.availHeight-window.screenTop-20}};tooltip.hide=function(){if(!this.tip){return}this.tip.innerHTML="";this.tip.style.display="none"};window.onload=function(){tooltip.doc=$(document);tooltip.init()};$.fn.seo=function(){if(!this||!this.length){return this}var a=function(d){var b=true;var c=d.find("div.hidden");d.find("a.open").click(function(){$(this).text(b?"скрыть":"раскрыть полностью");c[b?"slideDown":"slideUp"]("normal");b=!b})};return this.each(function(){a($(this))})};(function(){function a(){var b=[];this.EVENT_SHOW_COMPARISON=1;this.EVENT_CLOSE_COMPARISON=2;this.EVENT_CHANGE_COMPARISON=3;this.EVENT_LOAD_COMPARISON=4;this.EVENT_SHOW_CALCULATE_FORM=5;this.EVENT_CHANGE_CURRENCY=6;this.EVENT_DELETE_COMPARISON_ITEM=7;this.EVENT_ADD_COMPARISON_ITEM=8;this.add=function(c,d){b[c]=b[c]||[];$.isFunction(d)?b[c].push(d):""};this.remove=function(d,e){if(!b[d]){return}b[d]=b[d]||[];for(var c in b[d]){if(b[d][c]==e){b[d].splice(c,1);break}}};this.call=function(d,e){if(!b[d]){return}for(var c in b[d]){b[d][c](e)}}}window.Listener=new a();$.fn.updater=function(b){if(!this||!this.length){return this}b=b||{};b=$.extend({event:0,onUpdate:function(){}},b);var c=function(d){window.Listener.add(b.event,function(e){b.onUpdate(d,e)})};return this.each(function(){c($(this))})}})();(function(){function a(){var b=this;var f=true;var c={width:306,left:0,top:0,content:"",header:"",positionObj:null};var e=null;var d=function(){e=$(document.body).append('<div id="popup"><h3></h3><a class="delete-button" href="javascript:void(0);">delete</a><div class="popupcontent"></div></div>').find("#popup");e.find(".delete-button").click(function(){b.close()})};this.close=function(){e?e.hide():""};this.show=function(g){g=g||{};g=$.extend(c,g);if(!e){d()}e.hide();e.find("h3").text(g.header);e.find(".popupcontent").html(g.content);e.css({width:g.width+"px"});if(c.positionObj){var i=$(c.positionObj);var h=i.offset();g.left=h.left;g.top=h.top+i.outerHeight();g.left=g.left+e.width()>$(document.body).width()?g.left-e.outerWidth()+i.outerWidth():g.left;g.top=g.top+e.height()>$(document.body).height()+$(document).scrollTop()?g.top-e.outerHeight()-i.outerHeight():g.top}e.css({left:g.left+"px",top:g.top+"px"});e.show()}}$.popup=new a()})();(function(b){function c(g,i,f){f=f||{};f=b.extend({activeClass:"current"},f);if(!g||!g.length||!i||!i.length){return this}utils.observable.call(this);var e=this;var h=null;var d=function(){h=g.find("a:eq(0)").click(function(){e.notifyObservers("click",e);return false})};d();var j=h.contents();this.activate=function(){h.replaceWith(j);i.show();g.addClass(f.activeClass)};this.deactivate=function(){g.prepend('<a href="javascript:void(0);"></a>').find("a:eq(0)").append(j);g.find("a:gt(0)").remove();d();i.hide();g.removeClass(f.activeClass)};return this}function a(f,e){var g=[];e=e||{};e=b.extend({selected:0},e);var d=this;this.activateItem=function(i){b(g).each(function(){this!=i?this.deactivate():this.activate()})};this.activateByIndex=function(i){e.selected=g[i]?i:e.selected;this.activateItem(g[e.selected])};var h=function(){f.find("li").each(function(j,l){var p=b(l);var m=p.find("a:eq(0)").attr("href");if(m&&b(m).length){var k=new c(p,b(m),e);k.addEventHandler("click",d.activateItem);g.push(k)}});if(!g.length){return}e.selected=g[e.selected]?e.selected:0;d.activateItem(g[e.selected])};h();return this}b.fn.tabs=function(d){if(!this||!this.length){return this}d=d||{};return this.each(function(){this.tabs=new a(b(this),d)})}})(jQuery);$.fn.popupInfo=function(c){if(!this&&!this.length){return this}var b=this;c=c||{};c=$.extend({url:"/ajax/getCreditCondition",header:"Заглавие",params:{}},c);var a=function(e,d){$.popup.show({header:c.header,content:e,positionObj:d})};this.click(function(){var e=this;var d=c.url+utils.objectToKey(c.params);if(globalCache&&globalCache[d]){a(globalCache[d],e)}else{$.post(c.url,c.params,function(f){if(f){globalCache[d]=f;a(f,e)}},"text")}return false})};(function(){var a=function(e,c,d){this.options=d||{};this.options=$.extend({title:null,infoShow:true,infoHtml:null,id:"",orgId:"",isBranch:true},this.options);this.init(e,c,d);return this};a.prototype={map:null,marker:null,infoHtml:null,point:null,options:{},init:function(f,c,e){var d=this;d.map=f;d.marker=new GBankMarker(c,e);d.point=c;d.map.addOverlay(d.marker)},setToCenter:function(){var c=this;var d=function(){c.map.panTo(c.point)};setTimeout(d,200)},addClickHandler:function(c){c&&$.isFunction(c)&&GEvent.addListener(this.marker,"click",c)}};var b=googleMap=function(c,d){this.$container=c;this.id=d||"";return this};googleMap.prototype=googleMap.fn={gm:null,markers:[],dataCache:[],$container:null,addMarker:function(f){if(!f||!f.x||!f.y){return}var d=this;var c=new GLatLng(f.x,f.y);var e={id:d.id,orgId:f.id};if(f.info){e.title=f.info.name}if(f.isBranch!==undefined){e.isBranch=f.isBranch}d.markers.push(new a(d.gm,c,e));return this},addMarkers:function(d){var c=this;$(d).each(function(){c.addMarker(this)});return this},initFromData:function(f){var c=this;if(!f||(!f.cities&&!f.markers)||!f.bounds){return c}var e=new GLatLngBounds(new GLatLng(f.bounds.sw.x,f.bounds.sw.y),new GLatLng(f.bounds.ne.x,f.bounds.ne.y));c.gm=new GMap2(this.$container[0]);var d=c.gm.getDefaultUI();d.maptypes.physical=false;d.maptypes.hybrid=false;c.gm.setUI(d);GEvent.addListener(c.gm,"load",function(){if(f.headOffice&&f.headOffice.inRegion){c.addMarker($.extend({isBranch:false},f.headOffice))}c.addMarkers(f.markers)});c.gm.setCenter(e.getCenter(),c.gm.getBoundsZoomLevel(e));return this},initFromUrl:function(d,g,h){var c=this;var e=d+utils.objectToKey(g);var f=function(i){c.initFromData(i);$.isFunction(h)&&h(i)};if(!c.dataCache[e]){$.post(d,g,f,"json")}else{f(c.dataCache[e])}return this},hide:function(){this.$container.hide();return this},show:function(){this.$container.show();return this}};b.fn.constructor=b;window.googleMapManager={gMaps:[],createGMap:function(d,e,c){if(!d.find("#gmap_"+e).length){c=c||{};c=$.extend({display:"none",height:"300px",width:"297px"},c);d=d.append('<div id="gmap_'+e+'" class="map active-map"></div>').find("#gmap_"+e).css(c);this.gMaps[e]=new googleMap(d,e);d[0].gmap=this.gMaps[e]}return this.gMaps[e]},get:function(c){return this.gMaps[c]||null}};$.fn.gMapLink=function(c){if(!this||!this.length){return this}var e=this;var d=null;c=c||{};c=$.extend(true,{url:"/ajax/getBranches",params:{orgId:1,regionId:32,cityId:7}},c);e.find("a").click(function(){if(d){return}d=googleMapManager.createGMap(e.parents("td:eq(0)"),c.params.orgId);d.show();d.initFromUrl(c.url,c.params)})};$.fn.gMapListItem=function(i,d,h){if(!this||!this.length){return this}d=d||{};d=$.extend(true,{url:"/ajax/getBranches",params:{orgId:1,regionId:32,cityId:7}},d);var g=this;var c=commandManager;var f=null;var e="gm_"+i;h=h||null;c.subscribe(c.names.SHOW_CATALOG_INFO_ITEM,e,function(){if(h){h.show();return}h=g.after('<li id="'+e+'" style="height: 300px;" class="clearfloat org-list-info"></li>').next();h.append('<div class="info" style="float: left; width: 306px;"><p>Кликните по маркеру на карте, чтобы увидеть информацию о филиале</p></div>');f=googleMapManager.createGMap(h,e,{"float":"right"});f.show();f.initFromUrl(d.url,d.params);h.find("div.info").remoteUpdater(e,c.names.SHOW_BANK_INFO,"/ajax/getOrgInfo")});c.subscribe(c.names.HIDE_CATALOG_INFO_ITEM,e,function(){h&&h.hide()});c.addEventHandler(c.getPreCommandEventName(c.names.SHOW_CATALOG_INFO_ITEM),function(j){j.id!=i&&c.fire(c.names.HIDE_CATALOG_INFO_ITEM,e)})}})();(function(a){function b(f,c,e,o){var k=f.find(">li");var h=k.length;if(!h){return this}o=o||{};o=a.extend({width:89,viewCount:6,position:0,moveStep:2},o);var l=o.position%h;l=l<0?l+h:l;if(h<=o.viewCount){a([c,e]).each(function(){this.css("visibility","hidden")});return this}var m=this;var i=-h*o.width;var j=-h;var g=2*h;f.append(k.clone());f.prepend(k.clone());f.css({width:h*3*o.width+"px",position:"relative",left:i+"px"});var d=function(p,r){if(p==l){return}r=r==undefined?true:r;i=-(p+h)*o.width;l=p;var q={left:i+"px"};!r?f.css(q):f.animate(q,"slow","swing")};this.move=function(p){p=p==undefined?1:p;p=p%h;if(l+p+o.viewCount>g){d(l-h,false)}if(l+p<j){d(l+h,false)}d(l+p)};c.click(function(){m.move(-o.moveStep);return false});e.click(function(){m.move(o.moveStep);return false});return this}a.fn.carousel=function(c){if(!this||!this.length){return this}c=c||{};c=a.extend({prevButtonHtml:'<p class="prev"><a href="javascript:void(0);">prev</a></p>',nextButtonHtml:'<p class="next"><a href="javascript:void(0);">next</a></p>',containerSearchString:"div.overFl:eq(0)"},c);var d=function(i){var f=i.find(c.containerSearchString);if(!f.length){return}var e=f.after(c.nextButtonHtml).next();var g=f.before(c.prevButtonHtml).prev();var h=f.find("ul:eq(0)");new b(h,g,e)};return this.each(function(){d(a(this))})}})(jQuery);$.fn.locationPicker=function(d){if(!this||!this.length){return this}d=d||{};d=$.extend({regionSearch:"select.region",citySearch:"select.city",cityContainerSearch:".city-cont",cityUrl:"/ajax/getCities",regionId:null,cityId:null,emptyCity:"Любой город",isEnName:false},d);var b=[];var c=function(i,h,j){var g='<option value="">Любой город</option>';$(i).each(function(){g+='<option value="'+this.id+'" '+(j==this.id?'selected="selected"':"")+">"+this.name+"</option>"});h.empty().append(g)};var e=function(h,g,i){if(i){h.empty().append('<option value="">Выберите регион</option>').attr("disabled","disabled");g.addClass("disable")}else{h.removeAttr("disabled");g.removeClass("disable")}};var a=function(g,j,i,k){k=k||"";if(!g.val()){e(j,i,true);return}if(!b[g.val()]){var h={};h[!d.isEnName?"region_id":"region_name"]=g.val();$.post(d.cityUrl,h,function(l){if(l){b[g.val()]=l;c(l,j,k);e(j,i,false)}},"json")}else{c(b[g.val()],j,k);e(j,i,false)}};var f=function(j){var g=j.find(d.regionSearch);var i=j.find(d.citySearch);var h=j.find(d.cityContainerSearch);a(g,i,h,d.cityId);g.change(function(){a(g,i,h)})};return this.each(function(g,h){f($(h))})};$.fn.catalogFilter=function(a){if(!this||!this.length){return this}a=a||{};a=$.extend({isEnName:false},a);var b=function(c){c.locationPicker({cityId:c.find("#city_id").val(),isEnName:a.isEnName});c.find("input.org").autocomplete({serviceUrl:"/ajax/getOrgs",minChars:2,delimiter:/(,|;)\s*/,maxHeight:400,width:300,deferRequestBy:500})};return this.each(function(c,d){b($(d))})};$.fn.catalogTable=function(a){if(!this||!this.length){return this}a=a||{};a=$.extend({params:{},conditionUrl:"/ajax/getCreditCondition",requestUrl:"/ajax/getCreditRequest"},a);var c=this;var b=function(){c.find("table tr").hover(function(){$(this).addClass("actRowd")},function(){$(this).removeClass("actRowd")});c.find("table tr").each(function(d,f){var e=$(f);var h=e.find(".td-but");var g={id:Number(h.find(".offer_id").val())};h.find(".condition > a").popupInfo({url:a.conditionUrl,header:"Условия кредита",params:g});h.find(".request > a").popupInfo({url:a.requestUrl,header:"Требования к заемщику",params:g});h.find(".quest").addToComparison({id:g.id,params:a.params});h.find(".gmap").gMapLink({params:$.extend(a.params,{orgId:g.id})})});Listener.add(Listener.EVENT_SHOW_COMPARISON,function(){c.hide()});Listener.add(Listener.EVENT_CLOSE_COMPARISON,function(){c.show()})};b();return this};$.fn.catalogOrgTable=function(b){if(!this||!this.length){return this}b=b||{};b=$.extend({params:{},conditionUrl:"/ajax/getCreditCondition",requestUrl:"/ajax/getCreditRequest"},b);var f=this;var a=commandManager;var d=function(){$(this).addClass("actRowd")};var c=function(){$(this).removeClass("actRowd")};var e=function(){f.find("ul > li.basic-info").hover(d,c).each(function(h,g){var m=$(g);var l=Number(g.id.substr(3));if(l==NaN){return}var j=["oi_"+l,"gm_"+l];a.subscribe(a.names.SHOW_CATALOG_INFO_ITEM,j,function(){m.addClass("org-open")});a.subscribe(a.names.HIDE_CATALOG_INFO_ITEM,j,function(){m.removeClass("org-open")});m.find("span.org-info-link > a").switchCommandLink("oi_"+l,a.names.SHOW_CATALOG_INFO_ITEM,a.names.HIDE_CATALOG_INFO_ITEM,{postSwitchOnCommand:function(){$(this).text("Скрыть")},postSwitchOffCommand:function(){$(this).text("Краткая информация")}});m.find("a.org-branch-link").switchCommandLink("oi_"+l,a.names.SHOW_CATALOG_INFO_ITEM,a.names.HIDE_CATALOG_INFO_ITEM);m.find("a.stat-link").switchCommandLink("oi_"+l,a.names.SHOW_CATALOG_INFO_ITEM,a.names.HIDE_CATALOG_INFO_ITEM,{postSwitchOnCommand:function(){$(this).text("Скрыть статистику")},postSwitchOffCommand:function(){$(this).text("Статистика по региону")}});var k=$.extend(b.params,{orgId:l});m.gMapListItem(l,{params:k});m.find("span.org-branch-link > a").switchCommandLink("gm_"+l,a.names.SHOW_CATALOG_INFO_ITEM,a.names.HIDE_CATALOG_INFO_ITEM,{postSwitchOnCommand:function(){$(this).text("Скрыть")},postSwitchOffCommand:function(){$(this).text("Отделений и филиалов")}})});f.find("ul > li.org-list-info").each(function(h,g){var k=$(g);var j=g.id;if(!j){return}a.subscribe(a.names.SHOW_CATALOG_INFO_ITEM,j,function(){k.show()});a.subscribe(a.names.HIDE_CATALOG_INFO_ITEM,j,function(){k.hide()});a.addEventHandler(a.getPreCommandEventName(a.names.SHOW_CATALOG_INFO_ITEM),function(i){i.id!=j&&a.fire(a.names.HIDE_CATALOG_INFO_ITEM,j)})})};e();return this};$.fn.orgInfo=function(a){if(!this||!this.length){return this}var b=function(d){var c=d.find("div.info").contents();d.find("h4 a").click(function(){$.popup.show({header:$(this).text(),content:c,positionObj:this});return false})};return this.each(function(c,d){b($(d))})};$.fn.comparisonTable=function(b){if(!this||!this.length){return this}var e=this;var a=null;b=b||{};b=$.extend({listUrl:"/ajax/getCreditComparison",deleteUrl:"/ajax/deleteCreditComparison",addUrl:"/ajax/addCreditComparison",params:{}},b);var c=function(){a=e.empty().find("table").empty().hide();a=!a.length?e.append('<table class="compareSel"></table>').find("table"):a};var f=function(){$.post(b.listUrl,b.params,function(j){if(!j||!j.ids||!j.table){return}Listener.call(Listener.EVENT_LOAD_COMPARISON,{data:j});if(j.ids&&j.ids.length){c()}else{e.empty().append('<p>Список сравнения пуст. <a href="javascript:void(0);">Вернуться к предложениям</a></p>');e.find("a").click(function(){Listener.call(Listener.EVENT_CLOSE_COMPARISON,{})});return}var i=a.append("<thead>").find("thead").append("<tr>").find("tr").append('<th class="description">Описание</th>');var h=a.append("<tfoot>").find("tfoot").append('<tr class="description"></tr>').find("tr").append('<td class="description">Описание</td>');var g=a.append("<tbody>").find("tbody");$(j.ids).each(function(k,l){i.append('<th><a href="javascript:void(0);">убрать</a></th>');h.append('<td><a href="javascript:void(0);">убрать</a></td>');a.find("thead tr th:last-child a, tfoot tr td:last-child a").click(function(){Listener.call(Listener.EVENT_DELETE_COMPARISON_ITEM,{id:l});return false})});$(j.table).each(function(k,m){var l=g.append("<tr>").find("tr:last-child");$(m).each(function(p,o){l.append("<td>"+o+"</td>")})});g.find("tr td:first-child").addClass("description");g.find("tr").hover(function(k){$(this).addClass("current")},function(k){$(this).removeClass("current")})},"json")};var d=function(){e.hide();f();Listener.add(Listener.EVENT_SHOW_COMPARISON,function(){e.show()});Listener.add(Listener.EVENT_CLOSE_COMPARISON,function(){e.hide()});Listener.add(Listener.EVENT_CHANGE_COMPARISON,f);$(["EVENT_DELETE_COMPARISON_ITEM","EVENT_ADD_COMPARISON_ITEM"]).each(function(g,h){Listener.add(Listener[h],function(i){$.post(b[g?"addUrl":"deleteUrl"],$.extend({id:i.id},b.params),function(j){if(j&&j.sc){Listener.call(Listener.EVENT_CHANGE_COMPARISON,{})}},"json")})})};d();return this};$.fn.addToComparison=function(a){if(!this||!this.length){return this}var d=this;var c=false;a=a||{};a=$.extend({url:"/ajax/addCreditComparison",params:{},id:1},a);a.id=Number(a.id);var b=d.find("a");b.click(function(){Listener.call(c?Listener.EVENT_DELETE_COMPARISON_ITEM:Listener.EVENT_ADD_COMPARISON_ITEM,{id:a.id});return false});Listener.add(Listener.EVENT_LOAD_COMPARISON,function(e){c=e&&e.data&&e.data.ids&&($.inArray(a.id,e.data.ids)!=-1);d.css("visibility",c?"hidden":"inherit")});return this};$.fn.toggleComparisonButton=function(){if(!this||!this.length){return this}var e=this;var b=e.find("a");var a=false;var d=0;var c=function(){b.text(a?"Возврат к предложениям":("Сравнение ("+(d?d:"сейчас нет")+")"))};b.click(function(){Listener.call(!a?Listener.EVENT_SHOW_COMPARISON:Listener.EVENT_CLOSE_COMPARISON,{});return false});$([Listener.EVENT_CLOSE_COMPARISON,Listener.EVENT_SHOW_COMPARISON]).each(function(f,g){Listener.add(g,(function(h){return function(){if(h){e.removeClass("orange")}else{if(d>0){e.addClass("orange")}}e[!h?"removeClass":"addClass"]("current");a=h;c()}})(!!f))});Listener.add(Listener.EVENT_LOAD_COMPARISON,function(f){d=f&&f.data&&f.data.ids?f.data.ids.length:0;if(!a){e[d?"addClass":"removeClass"]("orange")}c()});return this};$.fn.catalogCredit=function(){if(!this||!this.length){return this}var c=this;var a=c.find("#type_id").val();a=a?a:0;var b=function(){c.find(".catalog-filter").catalogFilter();c.find(".catalog").catalogTable({params:{type:a}});c.find("ul.menu-big-button li.last").toggleComparisonButton();c.find(".comparison").comparisonTable({listUrl:"/ajax/getCreditComparison",deleteUrl:"/ajax/deleteCreditComparison",addUrl:"/ajax/addCreditComparison",params:{type:a}})};b()};(function(){var b=function(e){var c=this;c.$container=e;c.regionId=e.find("#regionId").val();c.cityId=e.find("#cityId").val();var d=function(){e.find(".catalog-filter").catalogFilter({isEnName:true});e.find(".catalog").catalogOrgTable({params:{regionId:c.regionId,cityId:c.cityId}})};d.call(c);return c};var a=function(f){var c=this;c.page=f.find("#pager").val();c.orgId=f.find("#orgId").val();b.call(c,f);var d=c.$container.find("div.gm");if(!d||!d.length){return}var e=googleMapManager.createGMap(d,"branches");e.show();e.initFromUrl("/ajax/getBranches",{regionId:c.regionId,cityId:c.cityId,page:c.page,orgId:c.orgId},function(h){var g=commandManager;$(e.markers).each(function(j,l){if(!l.options.orgId){return}var k="oi_"+l.options.orgId;g.subscribe(g.names.SHOW_CATALOG_INFO_ITEM,k,function(){l.setToCenter()});l.addClickHandler(function(){g.fire(g.names.SHOW_CATALOG_INFO_ITEM,k)})})})};$.fn.catalogOrg=function(){if(!this||!this.length){return this}new b(this)};$.fn.catalogOrgBranches=function(){if(!this||!this.length){return this}new a(this)}})();(function(){function c(){this.options={};this.initValidateForm=function(h){};var e=function(){var h=this;$.post("/ajax/getCurrency",{},function(i){h.options.currency=i||h.options.currency},"json")};var f=function(l,j,k){var i=this;var h=Number(l);if(!i.options.currency[j]||!i.options.currency[k]||isNaN(h)||h==0){return l}return Math.round(h*i.options.currency[j]/i.options.currency[k])};var d=function(k){var h=this;e.call(h);var i=k.find("select.curr");i.change(function(){h.options.oldCurrency=h.options.currentCurrency;h.options.currentCurrency=$(this).val();Listener.call(Listener.EVENT_CHANGE_CURRENCY,{currency:$(this).val()})});h.options.currentCurrency=i.val();var j=function(l,m){l.html(h.options.currencySigns[m.currency||"rub"])};k.find("span.curr").updater({event:Listener.EVENT_CHANGE_CURRENCY,onUpdate:j}).each(function(){j($(this),{currency:h.options.currentCurrency})});k.find("input.curr").updater({event:Listener.EVENT_CHANGE_CURRENCY,onUpdate:function(m,l){m.val(f.call(h,m.val(),h.options.oldCurrency,h.options.currentCurrency))}})};var g=function(m){var j=function(o,s,p,q,r){valN=Number(s);if(isNaN(valN)||!o||!o.length){return}o.text(utils.slovo(valN,p,q,r))};var i=function(o,p){j(o,p,"год","года","лет")};var l=function(o,p){j(o,p,"месяц","месяца","месяцев")};var k=m.find("select.years");var h=m.find("select.month");i(k.change(function(){i($(this).next(),$(this).val())}).next(),k.val());l(h.change(function(){l($(this).next(),$(this).val())}).next(),h.val())};this.initForm=function(h){h.locationPicker({cityId:h.find("#city_id").val()});this.initValidateForm(h)};this.init=function(j,i){this.options=i||{};this.options=$.extend({type:0,currencySigns:{rub:"руб.",dol:"$",eur:"&euro;"},currency:{rub:1,dol:1,eur:1},currentCurrency:"rub",oldCurrency:"rub"},this.options);var h=j.find("form.forms");d.call(this,h);g.call(this,h);this.initForm(h);Listener.add(Listener.EVENT_SHOW_CALCULATE_FORM,function(k){k.show?j.show():j.hide()})};return this}function b(q){var p=this;this.options=this.options||{};this.options=$.extend({type:0},this.options,q);var g=5;var h=6;var o=7;var m=8;var e=9;var d=11;var j=12;this.initValidateForm=function(r){var t={"filters[summ]":{required:true,digits:true},"filters[cost]":{required:true,digits:true},"filters[currency]":"required","filters[fpay]":{required:true,digits:true},"filters[dohod]":{required:true,digits:true},"filters[podtv]":"required","filters[sex]":"required","filters[age]":{required:true,digits:true},"filters[child]":"required","filters[army_type]":{required:{depends:function(u){return r.find("#filters_sex_m:checked")}}},"filters[region_id]":"required","filters[city_id]":"required","filters[stag]":"required"};var s={"filters[summ]":{required:"Пожалуйста, введите сумму кредита",digits:"Пожалуйста, введите целое число"},"filters[cost]":{required:p.options.type==g?"Пожалуйста, введите стоимость недвижимости":"Пожалуйста, введите стоимость автомобиля",digits:"Пожалуйста, введите целое число"},"filters[currency]":"Пожалуйста, выберите валюту","filters[fpay]":{required:"Пожалуйста, укажите первый взнос",digits:"Пожалуйста, введите целое число"},"filters[dohod]":{required:"Пожалуйста, укажите ваш доход",digits:"Пожалуйста, введите целое число"},"filters[podtv]":"Пожалуйста, выберите один из вариантов","filters[sex]":"Пожалуйста, укажите ваш пол","filters[age]":{required:"Пожалуйста, укажите ваш возраст",digits:"Пожалуйста, введите целое число"},"filters[child]":"Пожалуйста, выберите один из вариантов","filters[army_type]":"Пожалуйста, укажите ваше отношение к воинской обязанности","filters[region_id]":"Пожалуйста, выберите регион","filters[city_id]":"Пожалуйста, выберите город","filters[stag]":"Пожалуйста, выберите один из вариантов"};if(p.options.type==g){$.extend(t,{"filters[realty_type]":"required"});$.extend(s,{"filters[realty_type]":"Пожалуйста, выберите тип недвижимости"})}else{if(p.options.type==h){$.extend(t,{"filters[auto_type]":"required","filters[auto_owner]":"required"});$.extend(s,{"filters[auto_type]":"Пожалуйста, выберите вид автомобиля","filters[auto_owner]":"Пожалуйста, выберите, у кого вы хотите купить автомобиль"})}else{if(p.options.type==j){$.extend(t,{"filters[target_purp]":"required"});$.extend(s,{"filters[target_purp]":"Пожалуйста, выберите цель кредита"})}else{if(p.options.type==d){$.extend(t,{"filters[purp]":"required"});$.extend(s,{"filters[purp]":"Пожалуйста, выберите объект залога"})}else{if(p.options.type==e){$.extend(t,{"filters[ref_zalog_obj]":"required","filters[bank_id]":"required"});$.extend(s,{"filters[ref_zalog_obj]":"Пожалуйста, выберите объект залога","filters[bank_id]":"Пожалуйста, выберите банк"})}else{if(p.options.type==m){$.extend(t,{"filters[card_type][]":"required"});$.extend(s,{"filters[card_type][]":"Пожалуйста, выберите тип карты"})}}}}}}r.validate({errorElement:"span",errorPlacement:function(u,w){u.appendTo(w.parent("p"))},rules:t,messages:s})};var i=function(r,s){var t=r.length<2?r.val():"";t=r.filter(":checked").length?r.filter(":checked").val():"";s[t=="m"?"show":"hide"]().find("select").attr("disabled",t!="m")};var l=function(r){var s=r.find("p.army");i(r.find(':radio[name="filters[sex]"]').click(function(){i($(this),s)}),s)};var f=function(r){r.find(':text[name="filters[summ]"]').watermark("5000000")};var k=this.initForm;this.initForm=function(r){k.call(this,r);l.call(this,r)}}b.prototype=new c();b.prototype.constructor=b;function a(){this.initValidateForm=function(e){var h=function(){return !!(e.find("#filters_fillin_1:checked").length&&e.find("#filters_fillin_often").length&&e.find("#filters_fillin_often").val())};var g=function(){return !!(e.find("#filters_exp_operation_1:checked").length&&e.find("#filters_exp_often").length&&e.find("#filters_exp_often").val())};var i={"filters[summ]":{required:true,digits:true},"filters[percent]":{required:true,decimal:true},"filters[period_year]":{datePicker:{years:e.find("#filters_period_year"),month:e.find("#filters_period_month")}},"filters[currency]":"required","filters[fillin_summ]":{digits:{depends:h},required:{depends:h}},"filters[exp_summ]":{digits:{depends:g},required:{depends:g}}};var f={"filters[summ]":{required:"Пожалуйста, введите сумму вклада",digits:"Пожалуйста, введите целое число"},"filters[percent]":{required:"Пожалуйста, введите процентную ставку",decimal:"Пожалуйста, введите целое или дробное положительное число"},"filters[currency]":"Пожалуйста, выберите валюту","filters[fillin_summ]":{required:"Пожалуйста, укажите на какую сумму вы хотите пополнять вклад",digits:"Пожалуйста, введите целое число"},"filters[exp_summ]":{required:"Пожалуйста, укажите какую сумму вы хотите снимать",digits:"Пожалуйста, введите целое число"},"filters[region_id]":"Пожалуйста, выберите регион","filters[city_id]":"Пожалуйста, выберите город"};e.validate({errorElement:"span",errorPlacement:function(j,k){j.appendTo(k.parent("p"))},rules:i,messages:f})};var d=this.initForm;this.initForm=function(e){d.call(this,e);e.find("div.additing").checkingHidebar({checkBoxYes:"#filters_fillin_1",checkBoxNo:"#filters_fillin",labelString:"мне нужна возможность пополнения вклада",id:"fillin_checkbox"});e.find("div.diminishing").checkingHidebar({checkBoxYes:"#filters_exp_operation_1",checkBoxNo:"#filters_exp_operation",labelString:"мне нужна возможность снятия денег",id:"exp_checkbox"})}}a.prototype=b.prototype;a.prototype.constructor=a;$.fn.calculateCreditForm=function(d){if(!this||!this.length){return this}return this.each(function(e,f){(new b()).init($(f),d)})};$.fn.calculateDepositForm=function(d){if(!this||!this.length){return this}return this.each(function(e,f){(new a()).init($(f),d)})};$.fn.checkingHidebar=function(g){if(!this||!this.length){return this}var i=this;g=g||{};g=$.extend({checkBoxYes:"#filters_fillin_1",checkBoxNo:"#filters_fillin",labelString:"",id:"fillin_checkbox"},g);var f=i.before('<p class="check-fieldset clearfloat" style="display:none; "><input type="checkbox" id="'+g.id+'" class="w-auto no-bord" /><label for="'+g.id+'" class="inline">'+g.labelString+"</label></p>").prev();var j=f.find("input");var h=i.find(g.checkBoxYes);var e=i.find(g.checkBoxNo);var d=function(){if(h[0].checked){f.hide();i.show();j[0].checked=true}else{f.show();i.hide();j[0].checked=false}};d();i.find("input:radio").click(d);j.click(function(){h[0].checked=this.checked;e[0].checked=!this.checked;d()});return i}})();$.fn.calculateCreditPage=function(b){if(!this||!this.length){return this}var e=this;var d=e.find("#filters_type_id").val();d=d?d:0;this.find("#catalog_credit").catalogCredit();this.find("#edit").calculateCreditForm({type:d});this.find("#edit .show_calculation").click(function(){Listener.call(Listener.EVENT_SHOW_CALCULATE_FORM,{show:true});return false});this.find("#edit .hide_calculation").click(function(){Listener.call(Listener.EVENT_SHOW_CALCULATE_FORM,{show:false});return false});var c=this.find("#edit .calculation_info");var a=this.find("#edit .calculation_form");Listener.add(Listener.EVENT_SHOW_CALCULATE_FORM,function(f){if(!f){return}c[f.show?"hide":"show"]();a[!f.show?"hide":"show"]()});this.find("#catalog_credit .credit-box div.credit-info").each(function(){if($(this).hasClass("current")||$(this).hasClass("inactive")){return}$(this).click(function(){location.href=$(this).find("a").attr("href")});$(this).hover(function(){$(this).addClass("active")},function(){$(this).removeClass("active")})});return this};$.fn.catalogDeposit=function(){if(!this||!this.length){return this}var b=this;var a=function(){b.find(".catalog-filter").catalogFilter();b.find(".catalog").catalogTable({params:{},conditionUrl:"/ajax/getDepositCondition",addToComparisonUrl:"/ajax/addDepositComparison"});b.find("ul.menu-big-button li.last").toggleComparisonButton();b.find(".comparison").comparisonTable({listUrl:"/ajax/getDepositComparison",deleteUrl:"/ajax/deleteDepositComparison",addUrl:"/ajax/addDepositComparison",params:{}})};a()};$.fn.depositIndex=function(a){if(!this||!this.length){return this}var b=this;a=a||{};a=$.extend({},a);b.find(".catalog").catalogTable({params:{},conditionUrl:"/ajax/getDepositCondition",addToComparisonUrl:"/ajax/addDepositComparison"});b;var b=this;return this};$.fn.calculateDepositPage=function(a){if(!this||!this.length){return this}var c=this;this.find("#tab").catalogDeposit();this.find("#edit").calculateDepositForm();this.find("#tab a.show_calculation").click(function(){Listener.call(Listener.EVENT_SHOW_CALCULATE_FORM,{show:true});return false});this.find("#edit a.hide_calculation").click(function(){Listener.call(Listener.EVENT_SHOW_CALCULATE_FORM,{show:false});return false});var b=this.find("#tab div.baner-1 .calculation_info");Listener.add(Listener.EVENT_SHOW_CALCULATE_FORM,function(d){d&&d.show?b.hide():b.show()});return this};$.fn.newsBlock=function(){if(!this||!this.length){return this}var a=function(e,c,d,f){e.eq(f).hide();e.eq(d).show();c.eq(f+1).removeClass("current");c.eq(d+1).addClass("current")};var b=function(f){var d=0;var e=f.find("> dl");var c=f.find("> ul > li");c.find("a").each(function(g,h){if(g==0){$(this).click(function(){d?a(e,c,d-1,d--):""});return}if(g==c.length-1){$(this).click(function(){d<e.length-1?a(e,c,d+1,d++):""});return}$(this).click(function(){a(e,c,g-1,d);d=g-1})})};return this.each(function(){b($(this))})};$.fn.mainPage=function(a){if(!this||!this.length){return this}a=a||{};a=$.extend({},a);this.find("div.carrousel").carousel();var b=this;return this};$.fn.creditIndex=function(a){if(!this||!this.length){return this}a=a||{};a=$.extend({},a);var b=this;b.find(".catalog").catalogTable();var b=this;return this};$.fn.profilePage=function(c){if(!this||!this.length){return this}c=c||{};c=$.extend({},c);var e=this;var b=e.find("#unionTitle").text();var a=e.find("#unionText").contents();var d=function(){e.locationPicker({cityId:e.find("#city_id").val()});e.find("#unionLink").click(function(){$.popup.show({header:b,content:a,positionObj:this,width:500})})};d();return this};$.fn.registrationPage=function(c){if(!this||!this.length){return this}c=c||{};c=$.extend({},c);var f=this;var b=f.find("#unionTitle").text();var a=f.find("#unionText").contents();var g=f.find("#union2Title").text();var d=f.find("#union2Text").contents();var e=function(){f.find("#unionLink").click(function(){$.popup.show({header:b,content:a,positionObj:this,width:500})});f.find("#union2Link").click(function(){$.popup.show({header:g,content:d,positionObj:this,width:500})})};e();return this};$().ready(function(){if($&&$.validator){$.validator.addMethod("decimal",function(b,a){return this.optional(a)||/^\d+(?:[,.]\d+)?$/.test(b)},"Введите, пожалуйста, целое или дробное число");$.validator.addMethod("datePicker",function(e,c,a){var b=a&&a.years?Number(a.years.val()):0;var d=a&&a.month?Number(a.month.val()):0;return this.optional(c)||(!isNaN(b+d)&&b+d!=0)},"Укажите, пожалуйста, срок")}$("div.lastAdv ul.nav, div.inner ul.nav, div.lastAns ul.nav, div.partners ul.nav").tabs();$(".orgInfo").orgInfo();$("#bookmarklink").click(bookmark);$("div.seo").seo();$("div.catalog#tab").catalogCredit();$("div.deposit#tab").catalogDeposit();$("div.org#tab").catalogOrg();$("div.org#org-branches").catalogOrgBranches();$("div.calculation.credit2").calculateCreditPage();$("div.calculation.deposit").calculateDepositPage();$("div.advices > div").newsBlock();$("div.mainPage").mainPage();$("div.creditIndex").creditIndex();$("div.deposit#index").depositIndex();$("div.profilePage").profilePage();$("div.registrationPage").registrationPage()});var globalCache={};var utils={objectToKey:function(c){var b="";c=c||{};if(typeof(c)=="object"){for(var a in c){b+=a+c[a]}}else{b=c.toString()}return b},slovo:function(b,a,c,d){return(b%10>4)||((b>5)&&(b%100<20))||(b%10==0)?d:(b%10==1?a:c)},observable:function(){var a=[];this.notifyObservers=function(b,c){if(a[b]){$(a[b]).each(function(){this(c)})}};this.addEventHandler=function(b,c){a[b]=a[b]||[];$.isFunction(c)?a[b].push(c):""};this.remove=function(b,d){if(!a[b]){return}a[b]=a[b]||[];for(var c in a[b]){if(a[b][c]==d){a[b].splice(c,1);break}}}},toPixel:function(a){return a+"px"}};var ajaxPost=$.post;$.post=function(a,c){if(!jQuery.isFunction(c)){c=c||{};for(var b in c){typeof c[b]==="boolean"&&(c[b]=Number(c[b]))}}return ajaxPost.apply(this,arguments)};function getBrowserInfo(){var c,b=undefined;if(window.opera){c="Opera"}else{if(document.all){c="IE";var a=navigator.appVersion;var d=a.indexOf("MSIE")+5;b=a.substring(d,d+1)}else{if(navigator.userAgent.toLowerCase().indexOf("webkit")!=-1){c="Safari"}else{if(navigator.appName){c="Netscape"}}}}return{type:c,version:b}}function bookmark(c){var d=window.document.location.protocol+"//"+window.document.location.host;var e="Умные Деньги.ru";var a=getBrowserInfo();if(a.type=="IE"&&8>=a.version&&a.version>=4){window.external.AddFavorite(d,e)}else{if(a.type=="Opera"){this.href=d;this.rel="sidebar";this.title=e;return true}else{if(a.type=="Netscape"){window.sidebar.addPanel(e,d,"")}else{alert("К сожалению, Ваш браузер не поддерживает такой метод.\nВам придется добавить страницу в избранное вручную.")}}}return false}var commandManager={commands:[],names:{SHOW_CATALOG_INFO_ITEM:"ShowCatalogInfoItem",HIDE_CATALOG_INFO_ITEM:"HideCatalogInfoItem",SHOW_BANK_INFO:"ShowBankInfo",ACTIVATE_MAP_MARKER:"ActivateMapMarker"},subscribe:function(b,d,c){if(!$.isFunction(c)){return}var a=this;d=$.isArray(d)?d:[d];a.commands[b]=a.commands[b]||[];$(d).each(function(){a.commands[b][this]=a.commands[b][this]||[];a.commands[b][this].push(c)})},getPreCommandEventName:function(a){return"pre"+a},getPostCommandEventName:function(a){return"post"+a}};utils.observable.call(commandManager);commandManager.fire=function(b,d,c){var a=this;a.notifyObservers(a.getPreCommandEventName(b),{id:d,params:c});a.commands[b]&&a.commands[b][d]&&$(a.commands[b][d]).each(function(){this(c)});setTimeout(function(){a.notifyObservers(a.getPostCommandEventName(b),{id:d,params:c})},0)};commandManager.fireAsync=function(c,e,d){var b=arguments;var a=this;setTimeout(function(){a.fire.apply(a,b)},0)};$.fn.commandLink=function(c,b,a){c=c||null;b=b||null;if(!this||!this.length||!c||!b){return this}a=a||{};a=$.extend(true,{preCommand:function(){},postCommand:function(){},params:{}},a);$(this).click(function(){a.preCommand(a.params);commandManager.fire(b,c,a.params);a.postCommand(a.params)})};$.fn.switchCommandLink=function(f,d,b,c){f=f||null;d=d||null;b=b||null;if(!this||!this.length||!f||!d||!b){return this}var e=this;var a=commandManager;c=c||{};c=$.extend(true,{isOn:false,preSwitchOnCommand:function(){},postSwitchOnCommand:function(){},preSwitchOffCommand:function(){},postSwitchOffCommand:function(){},params:{}},c);$([[d,c.preSwitchOnCommand,c.postSwitchOnCommand,true],[b,c.preSwitchOffCommand,c.postSwitchOffCommand,false]]).each(function(g,h){a.addEventHandler(a.getPreCommandEventName(h[0]),function(i){if(i.id!=f){return}h[1].call(e,c.params)});a.addEventHandler(a.getPostCommandEventName(h[0]),function(i){if(i.id!=f){return}h[2].call(e,c.params);c.isOn=h[3]})});this.click(function(){a.fire(!c.isOn?d:b,f,c.params)})};$.fn.remoteUpdater=function(g,e,d,c){g=g||null;e=e||null;d=d||null;if(!this||!this.length||!g||!e||!d){return this}var f=this;var b=[];c=c||{};c=$.extend(true,{params:{}},c);var a=function(h){f.html(h)};commandManager.subscribe(e,g,function(h){h.params=(h&&h.params)||{};var i=$.extend(c.params,h.params);key=utils.objectToKey(i)+d;if(!b[key]){$.post(d,i,function(j){b[key]=j;a(j)})}else{a(b[key])}})};