/*!
 * jQuery JavaScript Library v1.4.3
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Oct 14 23:10:06 2010 -0400
 */
(function(E,A){function U(){return false}function ba(){return true}function ja(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ga(a){var b,d,e=[],f=[],h,k,l,n,s,v,B,D;k=c.data(this,this.nodeType?"events":"__events__");if(typeof k==="function")k=k.events;if(!(a.liveFired===this||!k||!k.live||a.button&&a.type==="click")){if(a.namespace)D=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var H=k.live.slice(0);for(n=0;n<H.length;n++){k=H[n];k.origType.replace(X,
"")===a.type?f.push(k.selector):H.splice(n--,1)}f=c(a.target).closest(f,a.currentTarget);s=0;for(v=f.length;s<v;s++){B=f[s];for(n=0;n<H.length;n++){k=H[n];if(B.selector===k.selector&&(!D||D.test(k.namespace))){l=B.elem;h=null;if(k.preType==="mouseenter"||k.preType==="mouseleave"){a.type=k.preType;h=c(a.relatedTarget).closest(k.selector)[0]}if(!h||h!==l)e.push({elem:l,handleObj:k,level:B.level})}}}s=0;for(v=e.length;s<v;s++){f=e[s];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;
a.handleObj=f.handleObj;D=f.handleObj.origHandler.apply(f.elem,arguments);if(D===false||a.isPropagationStopped()){d=f.level;if(D===false)b=false}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(Ha,"`").replace(Ia,"&")}function ka(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Ja.test(b))return c.filter(b,
e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function la(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var k in e[h])c.event.add(this,h,e[h][k],e[h][k].data)}}})}function Ka(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}
function ma(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?La:Ma,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function ca(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Na.test(a)?e(a,h):ca(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?
e(a,""):c.each(b,function(f,h){ca(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(na.concat.apply([],na.slice(0,b)),function(){d[this]=a});return d}function oa(a){if(!da[a]){var b=c("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";da[a]=d}return da[a]}function ea(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var u=E.document,c=function(){function a(){if(!b.isReady){try{u.documentElement.doScroll("left")}catch(i){setTimeout(a,
1);return}b.ready()}}var b=function(i,r){return new b.fn.init(i,r)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,k=/\S/,l=/^\s+/,n=/\s+$/,s=/\W/,v=/\d/,B=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,D=/^[\],:{}\s]*$/,H=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,G=/(?:^|:|,)(?:\s*\[)+/g,M=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,j=/(msie) ([\w.]+)/,o=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,
q=[],t,x=Object.prototype.toString,C=Object.prototype.hasOwnProperty,P=Array.prototype.push,N=Array.prototype.slice,R=String.prototype.trim,Q=Array.prototype.indexOf,L={};b.fn=b.prototype={init:function(i,r){var y,z,F;if(!i)return this;if(i.nodeType){this.context=this[0]=i;this.length=1;return this}if(i==="body"&&!r&&u.body){this.context=u;this[0]=u.body;this.selector="body";this.length=1;return this}if(typeof i==="string")if((y=h.exec(i))&&(y[1]||!r))if(y[1]){F=r?r.ownerDocument||r:u;if(z=B.exec(i))if(b.isPlainObject(r)){i=
[u.createElement(z[1])];b.fn.attr.call(i,r,true)}else i=[F.createElement(z[1])];else{z=b.buildFragment([y[1]],[F]);i=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,i)}else{if((z=u.getElementById(y[2]))&&z.parentNode){if(z.id!==y[2])return f.find(i);this.length=1;this[0]=z}this.context=u;this.selector=i;return this}else if(!r&&!s.test(i)){this.selector=i;this.context=u;i=u.getElementsByTagName(i);return b.merge(this,i)}else return!r||r.jquery?(r||f).find(i):b(r).find(i);
else if(b.isFunction(i))return f.ready(i);if(i.selector!==A){this.selector=i.selector;this.context=i.context}return b.makeArray(i,this)},selector:"",jquery:"1.4.3",length:0,size:function(){return this.length},toArray:function(){return N.call(this,0)},get:function(i){return i==null?this.toArray():i<0?this.slice(i)[0]:this[i]},pushStack:function(i,r,y){var z=b();b.isArray(i)?P.apply(z,i):b.merge(z,i);z.prevObject=this;z.context=this.context;if(r==="find")z.selector=this.selector+(this.selector?" ":
"")+y;else if(r)z.selector=this.selector+"."+r+"("+y+")";return z},each:function(i,r){return b.each(this,i,r)},ready:function(i){b.bindReady();if(b.isReady)i.call(u,b);else q&&q.push(i);return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(i){return this.pushStack(b.map(this,function(r,y){return i.call(r,
y,r)}))},end:function(){return this.prevObject||b(null)},push:P,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var i=arguments[0]||{},r=1,y=arguments.length,z=false,F,I,K,J,fa;if(typeof i==="boolean"){z=i;i=arguments[1]||{};r=2}if(typeof i!=="object"&&!b.isFunction(i))i={};if(y===r){i=this;--r}for(;r<y;r++)if((F=arguments[r])!=null)for(I in F){K=i[I];J=F[I];if(i!==J)if(z&&J&&(b.isPlainObject(J)||(fa=b.isArray(J)))){if(fa){fa=false;clone=K&&b.isArray(K)?K:[]}else clone=
K&&b.isPlainObject(K)?K:{};i[I]=b.extend(z,clone,J)}else if(J!==A)i[I]=J}return i};b.extend({noConflict:function(i){E.$=e;if(i)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(i){i===true&&b.readyWait--;if(!b.readyWait||i!==true&&!b.isReady){if(!u.body)return setTimeout(b.ready,1);b.isReady=true;if(!(i!==true&&--b.readyWait>0)){if(q){for(var r=0;i=q[r++];)i.call(u,b);q=null}b.fn.triggerHandler&&b(u).triggerHandler("ready")}}},bindReady:function(){if(!p){p=true;if(u.readyState==="complete")return setTimeout(b.ready,
1);if(u.addEventListener){u.addEventListener("DOMContentLoaded",t,false);E.addEventListener("load",b.ready,false)}else if(u.attachEvent){u.attachEvent("onreadystatechange",t);E.attachEvent("onload",b.ready);var i=false;try{i=E.frameElement==null}catch(r){}u.documentElement.doScroll&&i&&a()}}},isFunction:function(i){return b.type(i)==="function"},isArray:Array.isArray||function(i){return b.type(i)==="array"},isWindow:function(i){return i&&typeof i==="object"&&"setInterval"in i},isNaN:function(i){return i==
null||!v.test(i)||isNaN(i)},type:function(i){return i==null?String(i):L[x.call(i)]||"object"},isPlainObject:function(i){if(!i||b.type(i)!=="object"||i.nodeType||b.isWindow(i))return false;if(i.constructor&&!C.call(i,"constructor")&&!C.call(i.constructor.prototype,"isPrototypeOf"))return false;for(var r in i);return r===A||C.call(i,r)},isEmptyObject:function(i){for(var r in i)return false;return true},error:function(i){throw i;},parseJSON:function(i){if(typeof i!=="string"||!i)return null;i=b.trim(i);
if(D.test(i.replace(H,"@").replace(w,"]").replace(G,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(i):(new Function("return "+i))();else b.error("Invalid JSON: "+i)},noop:function(){},globalEval:function(i){if(i&&k.test(i)){var r=u.getElementsByTagName("head")[0]||u.documentElement,y=u.createElement("script");y.type="text/javascript";if(b.support.scriptEval)y.appendChild(u.createTextNode(i));else y.text=i;r.insertBefore(y,r.firstChild);r.removeChild(y)}},nodeName:function(i,r){return i.nodeName&&i.nodeName.toUpperCase()===
r.toUpperCase()},each:function(i,r,y){var z,F=0,I=i.length,K=I===A||b.isFunction(i);if(y)if(K)for(z in i){if(r.apply(i[z],y)===false)break}else for(;F<I;){if(r.apply(i[F++],y)===false)break}else if(K)for(z in i){if(r.call(i[z],z,i[z])===false)break}else for(y=i[0];F<I&&r.call(y,F,y)!==false;y=i[++F]);return i},trim:R?function(i){return i==null?"":R.call(i)}:function(i){return i==null?"":i.toString().replace(l,"").replace(n,"")},makeArray:function(i,r){var y=r||[];if(i!=null){var z=b.type(i);i.length==
null||z==="string"||z==="function"||z==="regexp"||b.isWindow(i)?P.call(y,i):b.merge(y,i)}return y},inArray:function(i,r){if(r.indexOf)return r.indexOf(i);for(var y=0,z=r.length;y<z;y++)if(r[y]===i)return y;return-1},merge:function(i,r){var y=i.length,z=0;if(typeof r.length==="number")for(var F=r.length;z<F;z++)i[y++]=r[z];else for(;r[z]!==A;)i[y++]=r[z++];i.length=y;return i},grep:function(i,r,y){var z=[],F;y=!!y;for(var I=0,K=i.length;I<K;I++){F=!!r(i[I],I);y!==F&&z.push(i[I])}return z},map:function(i,
r,y){for(var z=[],F,I=0,K=i.length;I<K;I++){F=r(i[I],I,y);if(F!=null)z[z.length]=F}return z.concat.apply([],z)},guid:1,proxy:function(i,r,y){if(arguments.length===2)if(typeof r==="string"){y=i;i=y[r];r=A}else if(r&&!b.isFunction(r)){y=r;r=A}if(!r&&i)r=function(){return i.apply(y||this,arguments)};if(i)r.guid=i.guid=i.guid||r.guid||b.guid++;return r},access:function(i,r,y,z,F,I){var K=i.length;if(typeof r==="object"){for(var J in r)b.access(i,J,r[J],z,F,y);return i}if(y!==A){z=!I&&z&&b.isFunction(y);
for(J=0;J<K;J++)F(i[J],r,z?y.call(i[J],J,F(i[J],r)):y,I);return i}return K?F(i[0],r):A},now:function(){return(new Date).getTime()},uaMatch:function(i){i=i.toLowerCase();i=M.exec(i)||g.exec(i)||j.exec(i)||i.indexOf("compatible")<0&&o.exec(i)||[];return{browser:i[1]||"",version:i[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(i,r){L["[object "+r+"]"]=r.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=
m.version}if(b.browser.webkit)b.browser.safari=true;if(Q)b.inArray=function(i,r){return Q.call(r,i)};if(!/\s/.test("\u00a0")){l=/^[\s\xA0]+/;n=/[\s\xA0]+$/}f=b(u);if(u.addEventListener)t=function(){u.removeEventListener("DOMContentLoaded",t,false);b.ready()};else if(u.attachEvent)t=function(){if(u.readyState==="complete"){u.detachEvent("onreadystatechange",t);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=u.documentElement,b=u.createElement("script"),d=u.createElement("div"),
e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],k=u.createElement("select"),l=k.appendChild(u.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),
hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:l.selected,optDisabled:false,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};k.disabled=true;c.support.optDisabled=!l.disabled;b.type="text/javascript";try{b.appendChild(u.createTextNode("window."+e+"=1;"))}catch(n){}a.insertBefore(b,
a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function s(){c.support.noCloneEvent=false;d.detachEvent("onclick",s)});d.cloneNode(true).fireEvent("onclick")}d=u.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=u.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var s=u.createElement("div");
s.style.width=s.style.paddingLeft="1px";u.body.appendChild(s);c.boxModel=c.support.boxModel=s.offsetWidth===2;if("zoom"in s.style){s.style.display="inline";s.style.zoom=1;c.support.inlineBlockNeedsLayout=s.offsetWidth===2;s.style.display="";s.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=s.offsetWidth!==2}s.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var v=s.getElementsByTagName("td");c.support.reliableHiddenOffsets=v[0].offsetHeight===
0;v[0].style.display="";v[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&v[0].offsetHeight===0;s.innerHTML="";u.body.removeChild(s).style.display="none"});a=function(s){var v=u.createElement("div");s="on"+s;var B=s in v;if(!B){v.setAttribute(s,"return;");B=typeof v[s]==="function"}return B};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",
cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var pa={},Oa=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?pa:a;var e=a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===A)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=
c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==A)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?pa:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var k in a)delete a[k]}},acceptData:function(a){if(a.nodeName){var b=
c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){if(typeof a==="undefined")return this.length?c.data(this[0]):null;else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===A){var e=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(e===A&&this.length){e=c.data(this[0],a);if(e===A&&this[0].nodeType===1){e=this[0].getAttribute("data-"+a);if(typeof e===
"string")try{e=e==="true"?true:e==="false"?false:e==="null"?null:!c.isNaN(e)?parseFloat(e):Oa.test(e)?c.parseJSON(e):e}catch(f){}else e=A}}return e===A&&d[1]?this.data(d[0]):e}else return this.each(function(){var h=c(this),k=[d[0],b];h.triggerHandler("setData"+d[1]+"!",k);c.data(this,a,b);h.triggerHandler("changeData"+d[1]+"!",k)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=c.data(a,b);if(!d)return e||
[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===A)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var qa=/[\n\t]/g,ga=/\s+/,Pa=/\r/g,Qa=/^(?:href|src|style)$/,Ra=/^(?:button|input)$/i,Sa=/^(?:button|input|object|select|textarea)$/i,Ta=/^a(?:rea)?$/i,ra=/^(?:radio|checkbox)$/i;c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,
a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(s){var v=c(this);v.addClass(a.call(this,s,v.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ga),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1)if(f.className){for(var h=" "+f.className+" ",k=f.className,l=0,n=b.length;l<n;l++)if(h.indexOf(" "+b[l]+" ")<0)k+=" "+b[l];f.className=c.trim(k)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(n){var s=
c(this);s.removeClass(a.call(this,n,s.attr("class")))});if(a&&typeof a==="string"||a===A)for(var b=(a||"").split(ga),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(qa," "),k=0,l=b.length;k<l;k++)h=h.replace(" "+b[k]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,
f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,k=c(this),l=b,n=a.split(ga);f=n[h++];){l=e?l:!k.hasClass(f);k[l?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(qa," ").indexOf(a)>-1)return true;return false},
val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var k=f[h];if(k.selected&&(c.support.optDisabled?!k.disabled:k.getAttribute("disabled")===null)&&(!k.parentNode.disabled||!c.nodeName(k.parentNode,"optgroup"))){a=c(k).val();if(b)return a;d.push(a)}}return d}if(ra.test(b.type)&&
!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Pa,"")}return A}var l=c.isFunction(a);return this.each(function(n){var s=c(this),v=a;if(this.nodeType===1){if(l)v=a.call(this,n,s.val());if(v==null)v="";else if(typeof v==="number")v+="";else if(c.isArray(v))v=c.map(v,function(D){return D==null?"":D+""});if(c.isArray(v)&&ra.test(this.type))this.checked=c.inArray(s.val(),v)>=0;else if(c.nodeName(this,"select")){var B=c.makeArray(v);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),B)>=0});if(!B.length)this.selectedIndex=-1}else this.value=v}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return A;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==A;b=e&&c.props[b]||b;if(a.nodeType===1){var h=Qa.test(b);if((b in a||a[b]!==A)&&e&&!h){if(f){b==="type"&&Ra.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Sa.test(a.nodeName)||Ta.test(a.nodeName)&&a.href?0:A;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return A;a=!c.support.hrefNormalized&&e&&
h?a.getAttribute(b,2):a.getAttribute(b);return a===null?A:a}}});var X=/\.(.*)$/,ha=/^(?:textarea|input|select)$/i,Ha=/\./g,Ia=/ /g,Ua=/[^\w\s.|`]/g,Va=function(a){return a.replace(Ua,"\\$&")},sa={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var k=a.nodeType?"events":"__events__",l=h[k],n=h.handle;if(typeof l===
"function"){n=l.handle;l=l.events}else if(!l){a.nodeType||(h[k]=h=function(){});h.events=l={}}if(!n)h.handle=n=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(n.elem,arguments):A};n.elem=a;b=b.split(" ");for(var s=0,v;k=b[s++];){h=f?c.extend({},f):{handler:d,data:e};if(k.indexOf(".")>-1){v=k.split(".");k=v.shift();h.namespace=v.slice(0).sort().join(".")}else{v=[];h.namespace=""}h.type=k;if(!h.guid)h.guid=d.guid;var B=l[k],D=c.event.special[k]||{};if(!B){B=l[k]=[];
if(!D.setup||D.setup.call(a,e,v,n)===false)if(a.addEventListener)a.addEventListener(k,n,false);else a.attachEvent&&a.attachEvent("on"+k,n)}if(D.add){D.add.call(a,h);if(!h.handler.guid)h.handler.guid=d.guid}B.push(h);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,k=0,l,n,s,v,B,D,H=a.nodeType?"events":"__events__",w=c.data(a),G=w&&w[H];if(w&&G){if(typeof G==="function"){w=G;G=G.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||
typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in G)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[k++];){v=f;l=f.indexOf(".")<0;n=[];if(!l){n=f.split(".");f=n.shift();s=RegExp("(^|\\.)"+c.map(n.slice(0).sort(),Va).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(B=G[f])if(d){v=c.event.special[f]||{};for(h=e||0;h<B.length;h++){D=B[h];if(d.guid===D.guid){if(l||s.test(D.namespace)){e==null&&B.splice(h--,1);v.remove&&v.remove.call(a,D)}if(e!=null)break}}if(B.length===0||e!=null&&B.length===1){if(!v.teardown||
v.teardown.call(a,n)===false)c.removeEvent(a,f,w.handle);delete G[f]}}else for(h=0;h<B.length;h++){D=B[h];if(l||s.test(D.namespace)){c.event.remove(a,v,D.handler,h);B.splice(h--,1)}}}if(c.isEmptyObject(G)){if(b=w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,H);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=
f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return A;a.result=A;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===
false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){e=a.target;var k,l=f.replace(X,""),n=c.nodeName(e,"a")&&l==="click",s=c.event.special[l]||{};if((!s._default||s._default.call(d,a)===false)&&!n&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[l]){if(k=e["on"+l])e["on"+l]=null;c.event.triggered=true;e[l]()}}catch(v){}if(k)e["on"+l]=k;c.event.triggered=false}}},handle:function(a){var b,d,e;
d=[];var f,h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var k=d.length;f<k;f++){var l=d[f];if(b||e.test(l.namespace)){a.handler=l.handler;a.data=
l.data;a.handleObj=l;l=l.handler.apply(this,h);if(l!==A){a.result=l;if(l===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||u;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=u.documentElement;d=u.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==A)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ga,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=u.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ba;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ba;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ba;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
var ta=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},ua=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?ua:ta,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?ua:ta)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=A;return ja("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=A;return ja("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
va=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ha.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=va(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===A||f===e))if(e!=null||f){a.type="change";a.liveFired=
A;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",va(a))}},setup:function(){if(this.type===
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ha.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ha.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}u.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){sa[b]++===0&&u.addEventListener(a,d,true)},teardown:function(){--sa[b]===
0&&u.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=A}var k=b==="one"?c.proxy(f,function(n){c(this).unbind(n,k);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var l=this.length;h<l;h++)c.event.add(this[h],d,k,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var wa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var k,l=0,n,s,v=h||this.selector;h=h?this:c(this.context);if(typeof d===
"object"&&!d.preventDefault){for(k in d)h[b](k,e,d[k],v);return this}if(c.isFunction(e)){f=e;e=A}for(d=(d||"").split(" ");(k=d[l++])!=null;){n=X.exec(k);s="";if(n){s=n[0];k=k.replace(X,"")}if(k==="hover")d.push("mouseenter"+s,"mouseleave"+s);else{n=k;if(k==="focus"||k==="blur"){d.push(wa[k]+s);k+=s}else k=(wa[k]||k)+s;if(b==="live"){s=0;for(var B=h.length;s<B;s++)c.event.add(h[s],"live."+Y(k,v),{data:e,selector:v,handler:f,origType:k,origHandler:f,preType:n})}else h.unbind("live."+Y(k,v),f)}}return this}});
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g,j,o,m,p,q){p=0;for(var t=m.length;p<t;p++){var x=m[p];if(x){x=x[g];for(var C=false;x;){if(x.sizcache===o){C=m[x.sizset];break}if(x.nodeType===1&&!q){x.sizcache=o;x.sizset=p}if(x.nodeName.toLowerCase()===j){C=x;break}x=x[g]}m[p]=C}}}function b(g,j,o,m,p,q){p=0;for(var t=m.length;p<t;p++){var x=m[p];if(x){x=x[g];for(var C=false;x;){if(x.sizcache===o){C=m[x.sizset];break}if(x.nodeType===1){if(!q){x.sizcache=o;x.sizset=p}if(typeof j!=="string"){if(x===j){C=true;break}}else if(l.filter(j,
[x]).length>0){C=x;break}}x=x[g]}m[p]=C}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,k=true;[0,0].sort(function(){k=false;return 0});var l=function(g,j,o,m){o=o||[];var p=j=j||u;if(j.nodeType!==1&&j.nodeType!==9)return[];if(!g||typeof g!=="string")return o;var q=[],t,x,C,P,N=true,R=l.isXML(j),Q=g,L;do{d.exec("");if(t=d.exec(Q)){Q=t[3];q.push(t[1]);if(t[2]){P=t[3];
break}}}while(t);if(q.length>1&&s.exec(g))if(q.length===2&&n.relative[q[0]])x=M(q[0]+q[1],j);else for(x=n.relative[q[0]]?[j]:l(q.shift(),j);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();x=M(g,x)}else{if(!m&&q.length>1&&j.nodeType===9&&!R&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){t=l.find(q.shift(),j,R);j=t.expr?l.filter(t.expr,t.set)[0]:t.set[0]}if(j){t=m?{expr:q.pop(),set:D(m)}:l.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&j.parentNode?j.parentNode:j,R);x=t.expr?l.filter(t.expr,
t.set):t.set;if(q.length>0)C=D(x);else N=false;for(;q.length;){t=L=q.pop();if(n.relative[L])t=q.pop();else L="";if(t==null)t=j;n.relative[L](C,t,R)}}else C=[]}C||(C=x);C||l.error(L||g);if(f.call(C)==="[object Array]")if(N)if(j&&j.nodeType===1)for(g=0;C[g]!=null;g++){if(C[g]&&(C[g]===true||C[g].nodeType===1&&l.contains(j,C[g])))o.push(x[g])}else for(g=0;C[g]!=null;g++)C[g]&&C[g].nodeType===1&&o.push(x[g]);else o.push.apply(o,C);else D(C,o);if(P){l(P,p,o,m);l.uniqueSort(o)}return o};l.uniqueSort=function(g){if(w){h=
k;g.sort(w);if(h)for(var j=1;j<g.length;j++)g[j]===g[j-1]&&g.splice(j--,1)}return g};l.matches=function(g,j){return l(g,null,null,j)};l.matchesSelector=function(g,j){return l(j,null,null,[g]).length>0};l.find=function(g,j,o){var m;if(!g)return[];for(var p=0,q=n.order.length;p<q;p++){var t=n.order[p],x;if(x=n.leftMatch[t].exec(g)){var C=x[1];x.splice(1,1);if(C.substr(C.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");m=n.find[t](x,j,o);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=j.getElementsByTagName("*"));
return{set:m,expr:g}};l.filter=function(g,j,o,m){for(var p=g,q=[],t=j,x,C,P=j&&j[0]&&l.isXML(j[0]);g&&j.length;){for(var N in n.filter)if((x=n.leftMatch[N].exec(g))!=null&&x[2]){var R=n.filter[N],Q,L;L=x[1];C=false;x.splice(1,1);if(L.substr(L.length-1)!=="\\"){if(t===q)q=[];if(n.preFilter[N])if(x=n.preFilter[N](x,t,o,q,m,P)){if(x===true)continue}else C=Q=true;if(x)for(var i=0;(L=t[i])!=null;i++)if(L){Q=R(L,x,i,t);var r=m^!!Q;if(o&&Q!=null)if(r)C=true;else t[i]=false;else if(r){q.push(L);C=true}}if(Q!==
A){o||(t=q);g=g.replace(n.match[N],"");if(!C)return[];break}}}if(g===p)if(C==null)l.error(g);else break;p=g}return t};l.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=l.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,j){var o=typeof j==="string",m=o&&!/\W/.test(j);o=o&&!m;if(m)j=j.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=o||q&&q.nodeName.toLowerCase()===
j?q||false:q===j}o&&l.filter(j,g,true)},">":function(g,j){var o=typeof j==="string",m,p=0,q=g.length;if(o&&!/\W/.test(j))for(j=j.toLowerCase();p<q;p++){if(m=g[p]){o=m.parentNode;g[p]=o.nodeName.toLowerCase()===j?o:false}}else{for(;p<q;p++)if(m=g[p])g[p]=o?m.parentNode:m.parentNode===j;o&&l.filter(j,g,true)}},"":function(g,j,o){var m=e++,p=b,q;if(typeof j==="string"&&!/\W/.test(j)){q=j=j.toLowerCase();p=a}p("parentNode",j,m,g,q,o)},"~":function(g,j,o){var m=e++,p=b,q;if(typeof j==="string"&&!/\W/.test(j)){q=
j=j.toLowerCase();p=a}p("previousSibling",j,m,g,q,o)}},find:{ID:function(g,j,o){if(typeof j.getElementById!=="undefined"&&!o)return(g=j.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,j){if(typeof j.getElementsByName!=="undefined"){for(var o=[],m=j.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&o.push(m[p]);return o.length===0?null:o}},TAG:function(g,j){return j.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,j,o,m,p,q){g=" "+g[1].replace(/\\/g,
"")+" ";if(q)return g;q=0;for(var t;(t=j[q])!=null;q++)if(t)if(p^(t.className&&(" "+t.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))o||m.push(t);else if(o)j[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var j=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=j[1]+(j[2]||1)-0;g[3]=j[3]-0}g[0]=e++;return g},ATTR:function(g,j,o,
m,p,q){j=g[1].replace(/\\/g,"");if(!q&&n.attrMap[j])g[1]=n.attrMap[j];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,j,o,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=l(g[3],null,null,j);else{g=l.filter(g[3],j,o,true^p);o||m.push.apply(m,g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,j,o){return!!l(o[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,j){return j===0},last:function(g,j,o,m){return j===m.length-1},even:function(g,j){return j%2===0},odd:function(g,j){return j%2===1},lt:function(g,j,o){return j<o[3]-0},gt:function(g,j,o){return j>o[3]-0},nth:function(g,j,o){return o[3]-
0===j},eq:function(g,j,o){return o[3]-0===j}},filter:{PSEUDO:function(g,j,o,m){var p=j[1],q=n.filters[p];if(q)return q(g,o,j,m);else if(p==="contains")return(g.textContent||g.innerText||l.getText([g])||"").indexOf(j[3])>=0;else if(p==="not"){j=j[3];o=0;for(m=j.length;o<m;o++)if(j[o]===g)return false;return true}else l.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,j){var o=j[1],m=g;switch(o){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(o===
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":o=j[2];var p=j[3];if(o===1&&p===0)return true;var q=j[0],t=g.parentNode;if(t&&(t.sizcache!==q||!g.nodeIndex)){var x=0;for(m=t.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++x;t.sizcache=q}m=g.nodeIndex-p;return o===0?m===0:m%o===0&&m/o>=0}},ID:function(g,j){return g.nodeType===1&&g.getAttribute("id")===j},TAG:function(g,j){return j==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
j},CLASS:function(g,j){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(j)>-1},ATTR:function(g,j){var o=j[1];o=n.attrHandle[o]?n.attrHandle[o](g):g[o]!=null?g[o]:g.getAttribute(o);var m=o+"",p=j[2],q=j[4];return o==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&o!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,j,o,m){var p=n.setFilters[j[2]];
if(p)return p(g,o,j,m)}}},s=n.match.POS,v=function(g,j){return"\\"+(j-0+1)},B;for(B in n.match){n.match[B]=RegExp(n.match[B].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[B]=RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[B].source.replace(/\\(\d+)/g,v))}var D=function(g,j){g=Array.prototype.slice.call(g,0);if(j){j.push.apply(j,g);return j}return g};try{Array.prototype.slice.call(u.documentElement.childNodes,0)}catch(H){D=function(g,j){var o=j||[],m=0;if(f.call(g)==="[object Array]")Array.prototype.push.apply(o,
g);else if(typeof g.length==="number")for(var p=g.length;m<p;m++)o.push(g[m]);else for(;g[m];m++)o.push(g[m]);return o}}var w,G;if(u.documentElement.compareDocumentPosition)w=function(g,j){if(g===j){h=true;return 0}if(!g.compareDocumentPosition||!j.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(j)&4?-1:1};else{w=function(g,j){var o=[],m=[],p=g.parentNode,q=j.parentNode,t=p;if(g===j){h=true;return 0}else if(p===q)return G(g,j);else if(p){if(!q)return 1}else return-1;
for(;t;){o.unshift(t);t=t.parentNode}for(t=q;t;){m.unshift(t);t=t.parentNode}p=o.length;q=m.length;for(t=0;t<p&&t<q;t++)if(o[t]!==m[t])return G(o[t],m[t]);return t===p?G(g,m[t],-1):G(o[t],j,1)};G=function(g,j,o){if(g===j)return o;for(g=g.nextSibling;g;){if(g===j)return-1;g=g.nextSibling}return 1}}l.getText=function(g){for(var j="",o,m=0;g[m];m++){o=g[m];if(o.nodeType===3||o.nodeType===4)j+=o.nodeValue;else if(o.nodeType!==8)j+=l.getText(o.childNodes)}return j};(function(){var g=u.createElement("div"),
j="script"+(new Date).getTime();g.innerHTML="<a name='"+j+"'/>";var o=u.documentElement;o.insertBefore(g,o.firstChild);if(u.getElementById(j)){n.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:A:[]};n.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}o.removeChild(g);
o=g=null})();(function(){var g=u.createElement("div");g.appendChild(u.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(j,o){var m=o.getElementsByTagName(j[1]);if(j[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(j){return j.getAttribute("href",2)};g=null})();u.querySelectorAll&&
function(){var g=l,j=u.createElement("div");j.innerHTML="<p class='TEST'></p>";if(!(j.querySelectorAll&&j.querySelectorAll(".TEST").length===0)){l=function(m,p,q,t){p=p||u;if(!t&&!l.isXML(p))if(p.nodeType===9)try{return D(p.querySelectorAll(m),q)}catch(x){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var C=p.id,P=p.id="__sizzle__";try{return D(p.querySelectorAll("#"+P+" "+m),q)}catch(N){}finally{if(C)p.id=C;else p.removeAttribute("id")}}return g(m,p,q,t)};for(var o in g)l[o]=g[o];
j=null}}();(function(){var g=u.documentElement,j=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,o=false;try{j.call(u.documentElement,":sizzle")}catch(m){o=true}if(j)l.matchesSelector=function(p,q){try{if(o||!n.match.PSEUDO.test(q))return j.call(p,q)}catch(t){}return l(q,null,null,[p]).length>0}})();(function(){var g=u.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===
0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(j,o,m){if(typeof o.getElementsByClassName!=="undefined"&&!m)return o.getElementsByClassName(j[1])};g=null}}})();l.contains=u.documentElement.contains?function(g,j){return g!==j&&(g.contains?g.contains(j):true)}:function(g,j){return!!(g.compareDocumentPosition(j)&16)};l.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var M=function(g,
j){for(var o=[],m="",p,q=j.nodeType?[j]:j;p=n.match.PSEUDO.exec(g);){m+=p[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;p=0;for(var t=q.length;p<t;p++)l(g,q[p],o);return l.filter(m,o)};c.find=l;c.expr=l.selectors;c.expr[":"]=c.expr.filters;c.unique=l.uniqueSort;c.text=l.getText;c.isXMLDoc=l.isXML;c.contains=l.contains})();var Wa=/Until$/,Xa=/^(?:parents|prevUntil|prevAll)/,Ya=/,/,Ja=/^.[^:#\[\.,]*$/,Za=Array.prototype.slice,$a=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("",
"find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var k=0;k<d;k++)if(b[k]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(ka(this,a,false),"not",a)},filter:function(a){return this.pushStack(ka(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,
b){var d=[],e,f,h=this[0];if(c.isArray(a)){var k={},l,n=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:n})}h=h.parentNode;n++}}return d}k=$a.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(k?k.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||
!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});
c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",
d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Wa.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||Ya.test(e))&&Xa.test(a))f=f.reverse();return this.pushStack(f,a,Za.call(arguments).join(","))}});
c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===A||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var xa=/ jQuery\d+="(?:\d+|null)"/g,
$=/^\s+/,ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,za=/<([\w:]+)/,ab=/<tbody/i,bb=/<|&#?\w+;/,Aa=/<(?:script|object|embed|option|style)/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,cb=/\=([^="'>\s]+\/)>/g,O={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],
area:[1,"<map>","</map>"],_default:[0,"",""]};O.optgroup=O.option;O.tbody=O.tfoot=O.colgroup=O.caption=O.thead;O.th=O.td;if(!c.support.htmlSerialize)O._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==A)return this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,
d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},
unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=
c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));
c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(xa,"").replace(cb,'="$1">').replace($,
"")],e)[0]}else return this.cloneNode(true)});if(a===true){la(this,b);la(this.find("*"),b.find("*"))}return b},html:function(a){if(a===A)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(xa,""):null;else if(typeof a==="string"&&!Aa.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!O[(za.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ya,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?
this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,
true)},domManip:function(a,b,d){var e,f,h=a[0],k=[],l;if(!c.support.checkClone&&arguments.length===3&&typeof h==="string"&&Ba.test(h))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(h))return this.each(function(s){var v=c(this);a[0]=h.call(this,s,b?v.html():A);v.domManip(a,b,d)});if(this[0]){e=h&&h.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);l=e.fragment;if(f=l.childNodes.length===1?l=l.firstChild:
l.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var n=this.length;f<n;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],f>0||e.cacheable||this.length>1?l.cloneNode(true):l)}k.length&&c.each(k,Ka)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:u;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===u&&!Aa.test(a[0])&&(c.support.checkClone||
!Ba.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=
d.length;f<h;f++){var k=(f>0?this.clone(true):this).get();c(d[f])[b](k);e=e.concat(k)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||u;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||u;for(var f=[],h=0,k;(k=a[h])!=null;h++){if(typeof k==="number")k+="";if(k){if(typeof k==="string"&&!bb.test(k))k=b.createTextNode(k);else if(typeof k==="string"){k=k.replace(ya,"<$1></$2>");var l=(za.exec(k)||["",""])[1].toLowerCase(),n=O[l]||O._default,
s=n[0],v=b.createElement("div");for(v.innerHTML=n[1]+k+n[2];s--;)v=v.lastChild;if(!c.support.tbody){s=ab.test(k);l=l==="table"&&!s?v.firstChild&&v.firstChild.childNodes:n[1]==="<table>"&&!s?v.childNodes:[];for(n=l.length-1;n>=0;--n)c.nodeName(l[n],"tbody")&&!l[n].childNodes.length&&l[n].parentNode.removeChild(l[n])}!c.support.leadingWhitespace&&$.test(k)&&v.insertBefore(b.createTextNode($.exec(k)[0]),v.firstChild);k=v.childNodes}if(k.nodeType)f.push(k);else f=c.merge(f,k)}}if(d)for(h=0;f[h];h++)if(e&&
c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,k=0,l;(l=a[k])!=null;k++)if(!(l.nodeName&&c.noData[l.nodeName.toLowerCase()]))if(d=l[c.expando]){if((b=e[d])&&b.events)for(var n in b.events)f[n]?
c.event.remove(l,n):c.removeEvent(l,n,b.handle);if(h)delete l[c.expando];else l.removeAttribute&&l.removeAttribute(c.expando);delete e[d]}}});var Ca=/alpha\([^)]*\)/i,db=/opacity=([^)]*)/,eb=/-([a-z])/ig,fb=/([A-Z])/g,Da=/^-?\d+(?:px)?$/i,gb=/^-?\d/,hb={position:"absolute",visibility:"hidden",display:"block"},La=["Left","Right"],Ma=["Top","Bottom"],W,ib=u.defaultView&&u.defaultView.getComputedStyle,jb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===A)return this;
return c.access(this,a,b,true,function(d,e,f){return f!==A?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),k=a.style,l=c.cssHooks[h];b=c.cssProps[h]||
h;if(d!==A){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!l||!("set"in l)||(d=l.set(a,d))!==A)try{k[b]=d}catch(n){}}}else{if(l&&"get"in l&&(f=l.get(a,false,e))!==A)return f;return k[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==A)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=
e[f]},camelCase:function(a){return a.replace(eb,jb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=ma(d,b,f);else c.swap(d,hb,function(){h=ma(d,b,f)});return h+"px"}},set:function(d,e){if(Da.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return db.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":
b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d.filter||"";d.filter=Ca.test(f)?f.replace(Ca,e):d.filter+" "+e}};if(ib)W=function(a,b,d){var e;d=d.replace(fb,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return A;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};else if(u.documentElement.currentStyle)W=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],
h=a.style;if(!Da.test(f)&&gb.test(f)){d=h.left;e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f};if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var kb=c.now(),lb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
mb=/^(?:select|textarea)/i,nb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ob=/^(?:GET|HEAD|DELETE)$/,Na=/\[\]$/,T=/\=\?(&|$)/,ia=/\?/,pb=/([?&])_=[^&]*/,qb=/^(\w+:)?\/\/([^\/?#]+)/,rb=/%20/g,sb=/#.*$/,Ea=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ea)return Ea.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=
b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(k,l){if(l==="success"||l==="notmodified")h.html(f?c("<div>").append(k.responseText.replace(lb,"")).find(f):k.responseText);d&&h.each(d,[k.responseText,l,k])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
!this.disabled&&(this.checked||mb.test(this.nodeName)||nb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),k=ob.test(h);b.url=b.url.replace(sb,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ia.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+kb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var l=E[d];E[d]=function(m){f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);if(c.isFunction(l))l(m);else{E[d]=A;try{delete E[d]}catch(p){}}v&&v.removeChild(B)}}if(b.dataType==="script"&&b.cache===null)b.cache=
false;if(b.cache===false&&h==="GET"){var n=c.now(),s=b.url.replace(pb,"$1_="+n);b.url=s+(s===b.url?(ia.test(b.url)?"&":"?")+"_="+n:"")}if(b.data&&h==="GET")b.url+=(ia.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");n=(n=qb.exec(b.url))&&(n[1]&&n[1]!==location.protocol||n[2]!==location.host);if(b.dataType==="script"&&h==="GET"&&n){var v=u.getElementsByTagName("head")[0]||u.documentElement,B=u.createElement("script");if(b.scriptCharset)B.charset=b.scriptCharset;B.src=
b.url;if(!d){var D=false;B.onload=B.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);B.onload=B.onreadystatechange=null;v&&B.parentNode&&v.removeChild(B)}}}v.insertBefore(B,v.firstChild);return A}var H=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!k||a&&a.contentType)w.setRequestHeader("Content-Type",
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}n||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(G){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
c.triggerGlobal(b,"ajaxSend",[w,b]);var M=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){H||c.handleComplete(b,w,e,f);H=true;if(w)w.onreadystatechange=c.noop}else if(!H&&w&&(w.readyState===4||m==="timeout")){H=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&g.call&&g.call(w);M("abort")}}catch(j){}b.async&&b.timeout>0&&setTimeout(function(){w&&!H&&M("timeout")},b.timeout);try{w.send(k||b.data==null?null:b.data)}catch(o){c.handleError(b,w,null,o);c.handleComplete(b,w,e,f)}b.async||M();return w}},param:function(a,b){var d=[],e=function(h,k){k=c.isFunction(k)?k():k;d[d.length]=encodeURIComponent(h)+
"="+encodeURIComponent(k)};if(b===A)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)ca(f,a[f],b,e);return d.join("&").replace(rb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a,
b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},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(a,b){var d=a.getResponseHeader("Last-Modified"),e=a.getResponseHeader("Etag");
if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});if(E.ActiveXObject)c.ajaxSettings.xhr=
function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var da={},tb=/^(?:toggle|show|hide)$/,ub=/^([+\-]=)?([\d+.\-]+)(.*)$/,aa,na=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",3),a,b,d);else{a=
0;for(b=this.length;a<b;a++){if(!c.data(this[a],"olddisplay")&&this[a].style.display==="none")this[a].style.display="";this[a].style.display===""&&c.css(this[a],"display")==="none"&&c.data(this[a],"olddisplay",oa(this[a].nodeName))}for(a=0;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",d)}for(a=
0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,d,e);if(c.isEmptyObject(a))return this.each(f.complete);
return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),k,l=this.nodeType===1,n=l&&c(this).is(":hidden"),s=this;for(k in a){var v=c.camelCase(k);if(k!==v){a[v]=a[k];delete a[k];k=v}if(a[k]==="hide"&&n||a[k]==="show"&&!n)return h.complete.call(this);if(l&&(k==="height"||k==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(oa(this.nodeName)===
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[k])){(h.specialEasing=h.specialEasing||{})[k]=a[k][1];a[k]=a[k][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(B,D){var H=new c.fx(s,h,B);if(tb.test(D))H[D==="toggle"?n?"show":"hide":D](a);else{var w=ub.exec(D),G=H.cur(true)||0;if(w){var M=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(s,B,(M||1)+g);
G=(M||1)/H.cur(true)*G;c.style(s,B,G+g)}if(w[1])M=(w[1]==="-="?-1:1)*M+G;H.custom(G,M,g)}else H.custom(G,D,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(h){return f.step(h)}
this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var f=this;a=c.fx;e.elem=this.elem;if(e()&&c.timers.push(e)&&!aa)aa=setInterval(a.tick,a.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(l,n){f.style["overflow"+n]=h.overflow[l]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
this.options.show)for(var k in this.options.curAnim)c.style(this.elem,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(aa);aa=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
b.elem}).length};var vb=/^t(?:able|d|h)$/i,Fa=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in u.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(k){c.offset.setOffset(this,a,k)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=ea(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(s){c.offset.setOffset(this,a,s)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,e=b.ownerDocument,f,h=e.documentElement,k=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;
for(var l=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==k&&b!==h;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;f=e?e.getComputedStyle(b,null):b.currentStyle;l-=b.scrollTop;n-=b.scrollLeft;if(b===d){l+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&vb.test(b.nodeName))){l+=parseFloat(f.borderTopWidth)||0;n+=parseFloat(f.borderLeftWidth)||0}d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&f.overflow!=="visible"){l+=
parseFloat(f.borderTopWidth)||0;n+=parseFloat(f.borderLeftWidth)||0}f=f}if(f.position==="relative"||f.position==="static"){l+=k.offsetTop;n+=k.offsetLeft}if(c.offset.supportsFixedPosition&&f.position==="fixed"){l+=Math.max(h.scrollTop,k.scrollTop);n+=Math.max(h.scrollLeft,k.scrollLeft)}return{top:l,left:n}};c.offset={initialize:function(){var a=u.body,b=u.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),k=c.css(a,"top"),l=c.css(a,"left"),n=e==="absolute"&&c.inArray("auto",[k,l])>-1;e={};var s={};if(n)s=f.position();k=n?s.top:parseInt(k,10)||0;l=n?s.left:parseInt(l,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+k;if(b.left!=null)e.left=b.left-h.left+l;"using"in b?b.using.call(a,
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Fa.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||u.body;a&&!Fa.test(a.nodeName)&&
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==A)return this.each(function(){if(h=ea(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=ea(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(h){var k=c(this);k[d](e.call(this,h,k[d]()))});return c.isWindow(f)?f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b]:f.nodeType===9?Math.max(f.documentElement["client"+
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]):e===A?parseFloat(c.css(f,d)):this.css(d,typeof e==="string"?e:e+"px")}})})(window);/*!
 * jQuery UI 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,
h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,
d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*
 * jQuery UI Datepicker 1.8.5
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	jquery.ui.core.js
 */
(function(d,G){function L(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function E(a,b){d.extend(a,
b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.5"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=
f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor==
Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);
d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;
for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&
this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&
!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass,b.dpDiv).add(d("td."+d.datepicker._currentClass,b.dpDiv));c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();
return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||
a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));
var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||
a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);
d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&
d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,
h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),
k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];
a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():
"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&
!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;
b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=
this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=
d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,
"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b==
"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"?4:p=="o"?
3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,w,H){p=o(p)?H:w;for(w=0;w<p.length;w++)if(b.substr(s,p[w].length).toLowerCase()==p[w].toLowerCase()){s+=p[w].length;return w+1}throw"Unknown name at position "+s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(j)if(a.charAt(z)=="'"&&!o("'"))j=false;else r();else switch(a.charAt(z)){case "d":l=m("d");
break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":k=m("m");break;case "M":k=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))r();else j=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>
-1){k=1;l=u;do{e=this._getDaysInMonth(c,k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*
60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+1<a.length&&a.charAt(j+1)==o)&&j++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},k=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var j=0;j<a.length;j++)if(u)if(a.charAt(j)==
"'"&&!i("'"))u=false;else l+=a.charAt(j);else switch(a.charAt(j)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=k("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=k("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+=
"'";else u=true;break;default:l+=a.charAt(j)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},
_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,
this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,k=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=u.exec(h);j;){switch(j[2]||"d"){case "d":case "D":g+=
parseInt(j[1],10);break;case "w":case "W":g+=parseInt(j[1],10)*7;break;case "m":case "M":l+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break;case "y":case "Y":k+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break}j=u.exec(h)}return new Date(k,l,g)};if(b=(b=b==null?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):b)&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},
_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?
"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=
this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&n<j?j:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,
"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+k+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+
n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+k+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"w":"e")+'">'+r+"</span></a>";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
y+".datepicker._gotoToday('#"+a.id+"');\">"+k+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var N=
"",D=0;D<i[1];D++){var J=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?
f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=k?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!k?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&q<j||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==J.getTime()&&g==a.selectedMonth&&
a._keyEvent||M.getTime()==q.getTime()&&M.getTime()==J.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!w?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!B||w)&&F[2]?' title="'+F[2]+'"':"")+(K?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!w?"&#xa0;":K?'<span class="ui-state-default">'+q.getDate()+
"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==J.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='<div class="ui-datepicker-title">',o="";if(h||!k)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+
a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(j+=o+(h||!(k&&l)?"&#xa0;":""));if(h||!l)j+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,
i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)j+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";j+="</select>"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?"&#xa0;":"")+o;j+="</div>";return j},_adjustInstDate:function(a,b,c){var e=
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));
return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.5";window["DP_jQuery_"+y]=d})(jQuery);
;/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */

jQuery(function($){
	$.datepicker.regional['ru'] = {
		closeText: 'Закрыть',
		prevText: '&#x3c;Пред',
		nextText: 'След&#x3e;',
		currentText: 'Сегодня',
		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
		'Июл','Авг','Сен','Окт','Ноя','Дек'],
		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
		weekHeader: 'Не',
		dateFormat: 'dd.mm.yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['ru']);
});/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 *//**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 */

(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}

			fx.elem.style[attr] = "rgb(" + [
				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
			].join(",") + ")";
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && color.length == 3 )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
	
	function getColor(elem, attr) {
		var color;

		do {
			color = jQuery.curCSS(elem, attr);

			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break; 

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};
	
	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};
	
})(jQuery);var rocon=(function(){var p=/\.rc(\d+)\b/,A=/\brc(\d+)\b/,K=/\brc-shape\b/,ae="rocon__",h="rocon",U=[],u={update:function(){},bindProperties:function(){var e=1;return function(aj,ai,ah){U.push({"id":e++,"rule":aj,"bg":B(j(ai),function(ak){if(ak.charAt(0)!="#"){ak="#"+ak;}return N(ak);}),"border_width":ah||0});};}(),process:function(e){y(e);}},w=null,v={},H=[],r=[],M=false,a=false,J=navigator.userAgent.toLowerCase(),f={},d={version:(J.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(J),opera:/opera/.test(J),msie:/msie/.test(J)&&!/opera/.test(J),mozilla:/mozilla/.test(J)&&!/(compatible|webkit)/.test(J)};function ad(){if(!M){M=true;if(r.length){for(var e=0;e<r.length;e++){r[e].call(document);}r=null;}}}function C(e){r.push(e);}function O(){if(a){return;}a=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);ad();},false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);ad();}});if(document.documentElement.doScroll&&!window.frameElement){(function(){if(M){return;}try{document.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;}ad();})();}}}}function L(ai,al,aj){if(aj){for(var ak=0,ah=ai.length;ak<ah;ak++){if(al.call(ai[ak],ak)===false){break;}}}else{for(var ak=ai.length-1,e;ak>=0;ak--){if(al.call(ai[ak],ak)===false){break;}}}}function B(e,al){var ah=[];for(var ai=0,aj=e.length;ai<aj;ai++){var ak=al(e[ai],ai);if(ak!=null){ah[ah.length]=ak;}}return ah.concat.apply([],ah);}function Y(){return;}function N(ah){var e;function ai(ak){var al=parseInt(ak,10).toString(16);return(al.length==1)?al+al:al;}function aj(ak){return ai(Math.round(ak*2.55));}if(e=/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/.exec(ah)){return"#"+ai(e[1])+ai(e[2])+ai(e[3]);}if(e=/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*\)/.exec(ah)){return"#"+aj(e[1])+aj(e[2])+aj(e[3]);}if(e=/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i.exec(ah)){return"#"+e[1]+e[2]+e[3];}if(e=/#([a-f0-9])([a-f0-9])([a-f0-9])/i.exec(ah)){return"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3];}ai=null;aj=null;return ah;}function I(e,ai){var ah=document.createElement(e);if(ai){ah.className=ai;}return ah;}function Q(ah,ai){var e=new RegExp("\\b"+ai+"\\b");return ah.nodeType==1&&e.test(ah.className||"");}function P(ak,ah){var aj,e={},ai=function(am,al){return al.toUpperCase();};L(ah instanceof Array?ah:[ah],function(){var am=this,al=am.replace(/\-(\w)/g,ai);if(ak.style[al]){e[al]=ak.style[al];}else{if(d.msie){e[al]=ak.currentStyle[al];}else{if(document.defaultView&&document.defaultView.getComputedStyle){if(!aj){aj=document.defaultView.getComputedStyle(ak,"");}e[al]=aj&&aj.getPropertyValue(am);}}}});return ah instanceof Array?e:e[ah.replace(/\-(\w)/g,ai)];}function j(ah){var e=(ah||"").split("_");switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;}return null;}var i=(function(){var ah=[],ai="#ffffff";function aj(ak){var al;do{if(ak.nodeType!=1){break;}if(ak.rocon_bg){return ak.rocon_bg;}else{ah.push(ak);al=P(ak,"background-color");if(al!="transparent"){return N(al);}}}while(ak=ak.parentNode);return ai;}function e(ak){var al;do{if(ak.nodeType!=1){break;}al=P(ak,"background-color");if(al!="transparent"){return N(al);}}while(ak=ak.parentNode);return ai;}return function(ap,ao){var al=ap.className,an=null;var ak=/\brcbg([a-f0-9_]+)\b/i.exec(al);if(ak){an=B(j(ak[1]),function(aq){return N("#"+aq);});return an;}var am=G(ap);if(am){return am.bg;}if(!ao){ap=ap.parentNode;}if(i.use_cache){ah=[];an=aj(ap);L(ah,function(){this.rocon_bg=an;i.processed_elems.push(this);});ah=null;}else{an=e(ap);}return j(an);};})();i.use_cache=true;i.processed_elems=[];function G(ai){var ah=ai.className,e=null;L(U,function(){if((typeof(this.rule)=="string"&&ah.indexOf(this.rule)!=-1)||ah.search(this.rule)!=-1){e=this;return false;}},true);return e;}function l(e,ah){w.insertRule(e+" {"+ah+"}",w.cssRules.length);}function D(ah){var e;L(document.styleSheets,function(){L(this.cssRules||this.rules,function(){if(e=p.exec(this.selectorText)){ah(this,parseInt(e[1],10));}});});}function E(ai,ah){var e=(ai.className||"").replace(new RegExp("\\s*"+h+"[-_].+?\\b","ig"),"");if(ah){e+=" "+ah;}ai.className=e;return ai;}function o(ah,e){H.push(ah.selectorText.substr(1));}function ag(){if(!w){if(document.createStyleSheet){w=document.createStyleSheet();}else{var e=I("style");e.rel="rocon";document.getElementsByTagName("head")[0].appendChild(e);L(document.styleSheets,function(){if(this.ownerNode.rel=="rocon"){w=this;return false;}});}}return w;}function c(ai){var ah=[],e;L((ai||document).getElementsByTagName("*"),function(){if(e=A.exec(this.className||"")){ah.push({node:this,radius:parseInt(e[1],10)});}});return ah;}function y(ah){var e=c(ah);
if(e.length){ag();L(e,function(){Y(this.node,this.radius);});}}function q(e){return f[e]?true:false;}function T(am,ah){var ai=am.className||"";ah=ah||parseInt(ai.match(A)[1],10);var ak=K.test(ai),al=G(am);var e="";var aj=al?al.border_width:(parseInt(P(am,"border-left-width"))||0);if(aj){e=N(P(am,"border-left-color")||"#000");}return{"radius":ah,"bg_color":i(am,ak),"border_width":(aj>ah)?ah:aj,"real_border_width":aj,"border_color":e,"use_shape":ak};}function af(e,ah){L(e,function(){L((this instanceof Array)?this:[this],ah);});}function m(ai){var e={};for(var ah in ai){if(ai.hasOwnProperty(ah)){e[ah]=ai[ah];}}return e;}function S(ah,ai,ap){var aj=P(ah,["padding-top","padding-bottom","margin-top","margin-bottom"]);function e(aq){return parseInt(aj[aq],10)||0;}var ak=Math.max(e("paddingTop")-ap.radius+ap.border_width,0),ao=Math.max(e("paddingBottom")-ap.radius+ap.border_width,0),al=e("marginTop")+ap.radius,an=e("marginBottom")+ap.radius,am=ap.real_border_width-ap.border_width;l("."+ai,"border-top-width:"+am+"px;"+"border-bottom-width:"+am+"px;"+"padding-top:"+ak+"px;"+"padding-bottom:"+ao+"px;"+"margin-top:"+al+"px;"+"margin-bottom:"+an+"px");}C(y);C(function(){L(i.processed_elems,function(){this.removeAttribute("rocon_bg");});i.use_cache=false;});O();if(d.safari){Y=function(ai,ah){var e=".rc"+ah;if(!q(e)){l(e,"-webkit-border-radius:"+ah+"px; -khtml-border-radius:"+ah);f[e]=true;}};u.update=function(){af(arguments,function(){var e=A.exec(this.className||"");if(e){Y(this,parseInt(e[1]));}});};}if(d.mozilla){Y=function(ai,ah){var e=".rc"+ah;if(!q(e)){l(e,"-moz-border-radius:"+ah+"px");f[e]=true;}};u.update=function(){af(arguments,function(){var e=A.exec(this.className||"");if(e){Y(this,parseInt(e[1]));}});};}if(d.opera){ag();l("."+h,"position:absolute;background-repeat:no-repeat;z-index:1;display:none");l("."+h+"-init","position:relative;");l("."+h+"-init>."+h,"display:inline-block;");l("."+h+"-tl","top:0;left:0;background-position:100% 100%;");l("."+h+"-tr","top:0;right:0;background-position:0 100%;");l("."+h+"-bl","bottom:0;left:0;background-position:100% 0;");l("."+h+"-br","bottom:0;right:0;");var x=I("canvas");function F(ai){ai.border_width=(ai.border_width>ai.radius)?ai.radius:ai.border_width;if(ai.border_width>1){ai.radius-=ai.border_width/2;}var aj=ai.radius*2+ai.border_width,e=aj;if(ai.use_shape){aj=2000;if(ai.border_width<ai.real_border_width){e+=(ai.real_border_width-ai.border_width)*2;}}if(ai.border_width==1){aj--;e--;}x.width=ai.width=aj;x.height=ai.height=e;var ah=x.getContext("2d");ah.strokeStyle=ai.border_color;ah.lineWidth=ai.border_width;ah.lineJoin="miter";ah.lineCap="square";ah.fillStyle=ai.bg_color[0];ah.clearRect(0,0,aj,e);return ah;}function W(e,ai){var aj=Math.PI/2,ah=(ai.border_width>1)?ai.border_width:0,ak=ai.radius*2+ah;e.beginPath();e.arc(0,0,ai.radius,aj,0,true);e.stroke();e.beginPath();e.arc(ak,0,ai.radius,aj*2,aj,true);e.stroke();e.beginPath();e.arc(ak,ak,ai.radius,-aj,aj*2,true);e.stroke();e.beginPath();e.arc(0,ak,ai.radius,0,-aj,true);e.stroke();}function k(ap){ap=m(ap);var ao=F(ap),ai=Math.PI/2,e=Math.PI*2,al=ap.border_width,am=(al>1)?al:0,aj=ap.radius*2+am,an=0,ah=(ap.border_width<ap.real_border_width);var ak=function(aq,ar){ao.beginPath();ao.arc(aq,ar,ap.radius,0,e,true);ao.closePath();ao.fill();};if(ah){an=ap.real_border_width-ap.border_width;ao.save();ao.translate(0,an);}ak(0,0);ak(aj,0);ak(aj,aj);ak(0,aj);ao.fillRect(aj,0,ap.width,ap.height);if(al){W(ao,ap);ao.fillStyle=ao.strokeStyle;ao.fillRect(aj,ap.radius-(al>1?al/2:al),ap.width,al*2);if(ah){ao.restore();ao.fillStyle=ap.border_color;ao.fillRect(0,0,ap.width,an);ao.fillRect(0,ap.height-an,ap.width,an);ao.fillStyle=ap.bg_color;}}return ao.canvas.toDataURL();}function t(aj){var an=aj;aj=m(aj);var ah=F(aj),e=aj.radius,ai=(aj.border_width>1)?aj.border_width:0,am=e*2+ai,al=an.radius,ak=Math.PI/2;ah.save();ah.beginPath();ah.arc(0,0,e,ak,0,true);ah.arc(am,0,e,ak*2,ak,true);ah.arc(am,am,e,-ak,ak*2,true);ah.arc(0,am,e,0,-ak,true);ah.closePath();ah.clip();ah.fillStyle=aj.bg_color[2];ah.fillRect(0,0,al,al);ah.fillStyle=aj.bg_color[3];ah.fillRect(al,0,al,al);ah.fillStyle=aj.bg_color[0];ah.fillRect(al,al,al,al);ah.fillStyle=aj.bg_color[1];ah.fillRect(0,al,al,al);ah.restore();if(aj.border_width){W(ah,aj);}return ah.canvas.toDataURL();}function b(e,ai){var ah=G(ai);return[e.radius,e.bg_color.join("-"),e.real_border_width,e.border_color,e.use_shape,ah?ah.id:0].join(":");}function R(e,aj){var al=b(e,aj),am=e.radius,an=e.real_border_width||0,ao=(e.use_shape)?an-e.border_width:0;if(!v[al]){var ai=ae+w.cssRules.length;v[al]=ai;l("."+ai+">."+h,'background-image: url("'+(e.use_shape?k(e):t(e))+'");'+"width: "+am+"px;"+"height: "+(am+ao)+"px;");var ak=-an,ah=-an;if(e.use_shape){ah=-am-ao;S(aj,ai,e);l("."+ai+">."+h+"-tl, ."+ai+">."+h+"-bl","width:auto;left:0;right:"+(am-an)+"px;background-position:-"+am+"px 100%;");l("."+ai+">."+h+"-bl","background-position:-"+am+"px 0;");}if(ak||ah){l("."+ai+">."+h+"-tl","top:"+ah+"px; left:"+ak+"px");l("."+ai+">."+h+"-tr","top:"+ah+"px; right:"+ak+"px");
l("."+ai+">."+h+"-bl","bottom:"+ah+"px; left:"+ak+"px");l("."+ai+">."+h+"-br","bottom:"+ah+"px; right:"+ak+"px");}}return v[al];}Y=function(aj,e){if(!aj.className){return;}var ah=false;L(aj.childNodes,function(){if(Q(this,h)){ah=true;return false;}});var ai=R(T(aj,e),aj);if(!ah){L(["tl","tr","bl","br"],function(){aj.appendChild(I("span",h+" "+h+"-"+this));});}E(aj,ai+" "+h+"-init");};C(function(){document.documentElement.style.outline="none";});u.update=function(){af(arguments,function(){Y(E(this));});};}if(d.msie){v.ix=0;v.created={};var ab="",n={tl:0,tr:1,br:2,bl:3};var s="vml-"+h;try{if(!document.namespaces["v"]){document.namespaces.add("v","urn:schemas-microsoft-com:vml");}}catch(aa){}ag();var Z="."+h;w.cssText="."+s+" {behavior:url(#default#VML);display:inline-block;position:absolute}"+Z+"-init {position:relative;zoom:1;}"+Z+" {position:absolute; display:inline-block; zoom: 1; overflow:hidden}"+Z+"-tl ."+s+"{flip: 'y'}"+Z+"-tr ."+s+"{rotation: 180;right:1px;}"+Z+"-br ."+s+"{flip: 'x'; right:1px;}";if(d.version<7){w.cssText+=Z+"-tr, "+Z+"-br {margin-left: 100%;}";}l=function(e,ah){ab+=e+"{"+ah+"}";};function X(au){var ak=au.radius,al=au.border_width,ah=ak+":"+al+":"+au.use_shape;if(!X._cache[ah]){var ap=10;var ai=I("v:shape");ai.className=s;ai.strokeweight=al+"px";ai.stroked=(al)?true:false;var aq=I("v:stroke");aq.className=s;aq.joinstyle="miter";ai.appendChild(aq);var an=ak,aj=an;ai.style.width=an+"px";ai.style.height=aj+"px";ak-=al/2;ak*=ap;var e=al/2*ap;var am=Math.round((ak+e)/an);var ao=ak+e;ai.coordorigin=Math.round(am/2)+" "+Math.round(am/2);ai.coordsize=ao+" "+ao;var at="";var ar=ao+am;if(au.use_shape){ar=2000*ap;at="m"+ar+",0 ns l"+e+",0  qy"+ao+","+ak+" l"+ar+","+ak+" e ";}else{at="m0,0 ns l"+e+",0  qy"+ao+","+ak+" l"+ao+","+ao+" l0,"+ao+" e ";}at+="m"+e+","+(-am)+" nf l"+e+",0 qy"+ao+","+ak+" l "+(ar)+","+ak+" e x";ai.path=at;X._cache[ah]=ai;}return X._cache[ah].cloneNode(true);}X._cache={};function z(ah,ai){var e=X(ah);e.fillcolor=ah.bg_color[n[ai]]||"#000";e.strokecolor=ah.border_color||"#000";var aj=I("span",h+" "+h+"-"+ai);aj.appendChild(e);return aj;}function V(e){L(e.childNodes,function(){if(Q(this,h)){e.removeChild(this);}});E(e);}function ac(e){var ah=e.radius+":"+(e.real_border_width||0)+":"+e.use_shape;if(!v[ah]){v[ah]=ae+v.ix++;}return v[ah];}function g(at,ah){var an=at.radius,ao=at.real_border_width||0,ap=(at.use_shape)?at.real_border_width-at.border_width:0;var aj=ac(at);if(!v.created[aj]){var al=(d.version<7)?"."+aj+" ."+h:"."+aj+">."+h;var ai=-ao,e=-1-ao;l(al,"width:"+(an+ao+1)+"px;height:"+(an+1)+"px");if(at.use_shape){e=-an-1-ap;var aq=an+at.border_width*2+ap;S(ah,aj,at);var am=Math.max(an-ao*2,0),ar=Math.min(an-ao*2,0)*-1;if(d.version<7){ar+=parseInt(P(ah,"padding-left")||0)+parseInt(P(ah,"padding-right")||0);}var ak="width:100%;clip:rect(auto auto auto "+am+"px);padding-right:"+ar+"px;left:"+(-ao-am)+"px;";l(al+"-tl",ak+"top:"+e+"px;");l(al+"-tl ."+s,"left:"+am+"px");l(al+"-bl",ak+"bottom:"+e+"px;");l(al+"-bl ."+s,"left:"+am+"px");}else{l(al+"-tl","left:"+ai+"px;top:"+e+"px;");l(al+"-bl","left:"+ai+"px;bottom:"+e+"px;");}if(d.version<7){ai=-an+(ao?an%2-ao%2:-an%2);l(al+"-tr","left:"+ai+"px;top:"+e+"px;");l(al+"-br","left:"+ai+"px;bottom:"+e+"px;");}else{l(al+"-tr","right:"+ai+"px;top:"+e+"px;");l(al+"-br","right:"+ai+"px;bottom:"+e+"px;");}v.created[aj]=true;}}Y=function(ai,e){var ah=T(ai,e);g(ah,ai);L(["tl","tr","bl","br"],function(){ai.appendChild(z(ah,this));});ai.className+=" "+ac(ah)+" "+h+"-init";};u.update=function(){af(arguments,function(){V(this);Y(this);});};C(function(){w.cssText+=ab;ab="";l=w.addRule;});}return u;})();/*
	Author: MindFreakTheMon.com
	jQuery 1.3.* Required
	Script was tested on IE7,8; FF3.5; Opera 10.01;
	Chrome ans Safari understands HTML5-placeholder attribute, so there is no need in this script for them.
*/

(function($)
{
	if(!$) return false;

	$.fn.extend({
		storeEvents: function(b)
		{
			return this.each(function()
			{
				var copy = function(j)
				{
					var o = {};
	
					for(i in j)
					{
						o[i] = typeof(j[i]) == 'object' ? arguments.callee(j[i]) : j[i];
					}
	
					return o;
				};
				
				$.data(this, 'storedEvents', copy($(this).data('events')));
				
				if(b)
				{
					$(this).unbind();
				}
			});
		},
		restoreEvents: function(b)
		{
			return this.each(function()
			{
				var events = $.data(this, 'storedEvents');
	
				if(events)
				{
					if(!b)
					{
						$(this).unbind();
					}
	
					for(var type in events)
					{
						for(var handler in events[type])
						{
							$.event.add(this, type, events[type][handler], events[type][handler].data);
						}
					}
				}
			});
		},
		copyAttr: function(e, p, v)
		{
			return this.each(function()
			{
				var a = {}, i, n, m;
				
				if(p === true)
				{
					for(i = 0, v = $.makeArray(v); i < this.attributes.length; i++)
					{
						n = this.attributes[i].nodeName;
						m = this.attributes[i].nodeValue;
	
						if(m && $.inArray(n, v) == -1)
						{
							a[n] =m;
						}
					}
				}
				else
				{				
					for(i = 0, p = $.makeArray(p); i < p.length; i++)
					{
						if(typeof $(this).attr(p[i]) == 'string')
						{
							a[p[i]] = $(this).attr(p[i]);
						}
					}
				}
				
				$(this).attr(a);
			});			
		},
		blurfocus: function(options)
		{
			return this.each(function()
			{
				if($.browser.safari)
				{
					return false;
				}
				
				var text = $(this).attr('placeholder');
				options = $.extend({className: 'placeholded', handle_send: true, handle_password: true}, options || {});
				
				if($(this).is(':password') && options.handle_password)
				{
					$(this).data('placeholded_type', 'password');
				}
				
				var blur = function(e)
				{
					if($(this).val().length == 0)
					{
						if($(this).data('placeholded_type') == 'password')
						{
							var input = $('<input type="text" name="' + $(this).attr('name') + '" />'), events = $(this).storeEvents(true).data('storedEvents');
							$(this).copyAttr(input, true, ['type', 'name']).replaceWith(input);
							input.blur().data('placeholded_type', 'password').data('storedEvents', events).restoreEvents();
						}
						else
						{
							var input = $(this);
						}

						input.attr('readonly', true).val(text).addClass(options.className);
					}
				}, focus = function(e)
				{
					if($(this).val() == text && $(this).hasClass(options.className))
					{
						if($(this).data('placeholded_type') == 'password')
						{
							var input = $('<input type="password" name="' + $(this).attr('name') + '" />'), events = $(this).storeEvents(true).data('storedEvents');
							$(this).copyAttr(input, true, ['type', 'name']).replaceWith(input);
							input.focus().data('placeholded_type', 'password').data('storedEvents', events).restoreEvents();
						}
						else
						{
							var input = $(this);
						}
						
						input.val('').removeAttr('readonly').removeClass(options.className);
					}
				}, click = function()
				{
					focus.call(this);
					$(this).storeEvents(true).focus().restoreEvents();
				}, keydown = function(e)
				{
					if(e.keyCode == 9)
					{
						if(!$.browser.msie)
						{
							blur.call(this);
						}
	
						e.stopPropagation();				
					}
				};
				
				if($(this).is(':password, :text, textarea'))
				{
					$(this).val($(this).val() == text ? '' : $(this).val()).blur(blur).focus(focus).click(click).keydown(keydown).blur();
					
					if(options.handle_send)
					{
						$(this).parents('form:eq(0)').each(function()
						{
							if($(this).data('placeholder_form') != 'handled')
							{
								events = $(this).data('placeholder_form', 'handled').storeEvents().data('storedEvents');
								eval('var anonfunc = function(){ ' + ($(this).attr('onsubmit') || '') + ' };');
								events.submit = $.extend(true, {'spec_sub': function(){ $(this).find('.' + options.className).focus(); }},  events.submit, {'anonfunc': anonfunc, 'spec_aft': function(e){ if(e.isDefaultPrevented()) $(this).find(':input').blur(); }});
								$(this).removeAttr('onsubmit').data('storedEvents', events).restoreEvents();
							}
						});
					}
				}
			});
		}
	});
	
	$(function()
	{
		$(":input[placeholder]").each(function(){ $(this).blurfocus($(this).attr('placeholder')); });
	});
})(jQuery);$(document).ready(function(){
	Menu.init();
	if($('.b-tabs-block').length) Tabs.init();
	if($('.b-mini-tabs').length) MiniTabs.init();
	if($('.b-zamer-button').length) Zamer.init();
	if($('.b-big-button').length) Zamer.init();
	if($('.b-switch').length) Switch.init();
	if($('.tab-content .offices-list').length) SwitchLists.init();
	if($('.b-quiz').length) Quiz.init();
	if($('.b-graphic-info').length) Graphic.init();
	if($('.b-side-button').length) ScrollToZamer.init();
	if($('.b-form-select').length) FormSelects.init();
	if($('.comment-button').length) CommentSlide.init();
	if($('.j-photo-button').length) PhotoPopup.init();
	if($('.b-slideshow').length) Slideshow.init();
	if($('.b-slides').length) Slides.init();
	if($('.g-promo-page').length) Promo.init();
	if($('.b-calculator').length) Calculator.init();
	if($('.b-catalog').length) Catalog.init();
	if($('.b-credit-calc').length) Credit.init();
	if($('#datepicker').length){
		 $("#datepicker").datepicker({
			inline: true
		});
	}
	$('.b-gallery').each(function(){
		new Gallery($(this));
	});
	
	if($('.j-subscribe').length) Subscribe.init();
	

	$('.b-button_more').hover(function(){
		$(this).addClass('more_hover');
	}, function(){
		$(this).removeClass('more_hover');
	});
	
	$('button.send').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	});
	
	$('button.b-search-button').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	});
});


Credit = {
	init:function(){
		var $this = this;
		this.creditCalc = $('.b-credit-calc');
		this.results = $('.t-results');
		this.printButton = $('.print-button');
		this.startParam = {
			sum:$('#calcSum'),
			firstPay:$('#calcFirst'),
			period:$('#calcPeriod')
		}
		this.resultParam = {
			sum:$('#creditSum'),
			yearRate:$('#creditRate'),
			firstPay:$('#firstPay'),
			monthPay:$('#monthPay'),
			paySum:$('#paySum'),
			overpayment:$('#creditAddPay'),
			overpaymentRate:$('#creditAddRate')
		}
		
		$('.b-credit-calc .value input').focus(function(){
			$(this).css({color:'#393939'});
		});
		
		// Проценты по кредиту в год
		this.resultParam.yearRate.text(yearRate+'%');
		
		this.creditCalc.find('.b-button_more').click(function(){
			$this.validate();
		});
	},
	validate:function(){
		var $this = this;
		if(this.startParam.sum.val().match(/[^\d]/) != null){
			this.startParam.sum.css({color:'red'});
			return false;
		} else {
			this.startParam.sum.css({color:'#393939'});
		}
		if(this.startParam.firstPay.val().match(/[^\d]/) != null){
			this.startParam.firstPay.css({color:'red'});
			return false;
		} else {
			this.startParam.firstPay.css({color:'#393939'});
		}
		if(this.startParam.period.val().match(/[^\d]/) != null){
			this.startParam.period.css({color:'red'});
			return false;
		} else {
			this.startParam.period.css({color:'#393939'});
		}
		if(this.startParam.sum.val()-this.startParam.firstPay.val() <= 0){
			this.startParam.sum.css({color:'red'});
			this.startParam.firstPay.css({color:'red'});
			return false;
		} else {
			this.startParam.sum.css({color:'#393939'});
			this.startParam.firstPay.css({color:'#393939'});
		}
		$this.calculate();
	},
	calculate:function(){
		// Сумма кредита
		var sum = this.startParam.sum.val()-this.startParam.firstPay.val();
		this.resultParam.sum.text(this.prettySum(  sum  ));
		
		// Сумма первого взноса
		this.resultParam.firstPay.text(this.prettySum(  this.startParam.firstPay.val()  ));
		
		// Период кредитования
		var period = this.startParam.period.val();
		
		if(this.creditCalc.is('#credit')){
			// Процент по кредиту в месяц в долях
			var monthRate =yearRate/100/12;

			// Ежемесячный платеж
			var monthPay = Math.round( sum*(monthRate*Math.pow(1+monthRate, period)/(Math.pow(1+monthRate, period)-1)) );
			this.resultParam.monthPay.text(this.prettySum( monthPay ));

			// Сумма выплат за весь период
			var paySum = monthPay*period;
			this.resultParam.paySum.text(this.prettySum( paySum ));

			// Переплата
			var overpayment = paySum - sum;
			this.resultParam.overpayment.text(this.prettySum( overpayment ));

			// Величина переплаты в % от суммы кредита
			var overpaymentRate = overpayment/sum*100;
			this.resultParam.overpaymentRate.text(this.prettyRate( overpaymentRate ));

		} else {
			// Ежемесячный платеж при рассрочке
			var monthPay = Math.round( sum/period );
			this.resultParam.monthPay.text(this.prettySum( monthPay ));
		}
		
		
		this.show();
	},
	show:function(){
		this.results.animate({height:this.results.find('table').height()}, 'fast');
		this.printButton.css({display:'block'});
	},
	prettySum:function(sum){
		// Добавляем пробел через каждые 3 знака для читабельности
		sum = sum+'';
		var newSum = [];
		for(var i=0; i<sum.length; i++){
			newSum.push(sum.charAt(i));
		}
		if(newSum.length > 3){
			newSum.splice(newSum.length-3, 0, ' ');
		}
		if(newSum.length > 7){
			newSum.splice(newSum.length-7, 0, ' ');
		}
		return newSum.join('');
	},
	prettyRate:function(sum){
		// Округляем до 1го знака после запятой
		var newSum = [];
		var oldSum = (sum+'').split('.');
		for(var i=0; i<oldSum[1].length; i++){
			newSum.push(oldSum[1].charAt(i));
		}
		return oldSum[0]+','+newSum[0];
	}
}


Calculator = {
	init:function(){
		var _self = this;
		this.calculator = $('.b-calculator');
		this.typesList = this.calculator.find('.window-types-list');
		this.typesListGroups = this.typesList.find('.type-select');
		this.windowImages = $('.window-types-images');
		this.windowTypeNames = $('.params-section .window-type');
		this.otherPrices = {
			'tarif-classic':$('#classicPrice'),
			'tarif-individual':$('#individualPrice'),
			'tarif-family':$('#familyPrice'),
			'tarif-elegant':$('#elegantPrice'),
			'tarif-egoist':$('#egoistPrice')
		}
		this.calculator.find('.b-zamer-button').click(function(){
			Tabs.showNext($('.b-tabs .tab').eq(2));
		});
		this.verticalSlider = {
			block:this.calculator.find('.slider-vertical'),
			input:this.calculator.find('.slider-vertical input.value'),
			value:this.calculator.find('.slider-vertical span.value'),
			dot:this.calculator.find('.slider-vertical .slider'),
			size:this.calculator.find('.slider-vertical .track').height(),
			min:0,
			max:0
		}
		this.horizontalSlider = {
			block:this.calculator.find('.slider-horizontal'),
			input:this.calculator.find('.slider-horizontal input.value'),
			value:this.calculator.find('.slider-horizontal span.value'),
			dot:this.calculator.find('.slider-horizontal .slider'),
			size:this.calculator.find('.slider-horizontal .track').width(),
			min:0,
			max:0
		}
		
		this.basePriceBlock = this.calculator.find('.price-block .value span');
		
		this.tarifPrices = {
			'tarif-classic':prices_classic,
			'tarif-individual':prices_individual,
			'tarif-family':prices_family,
			'tarif-elegant':prices_elegant,
			'tarif-egoist':prices_egoist
		}
		this.schemeConst = {
			'scheme-1':scheme_1,
			'scheme-2':scheme_2,
			'scheme-3':scheme_3,
			'scheme-4':scheme_4,
			'scheme-5':scheme_5,
			'scheme-6':scheme_6,
			'scheme-7':scheme_7,
			'scheme-8':scheme_8,
			'scheme-9':scheme_9,
			'scheme-10':scheme_10,
			'scheme-11':scheme_11,
			'scheme-12':scheme_12,
			'scheme-13':scheme_13,
			'scheme-14':scheme_14
		}
		
		this.params = $('.b-calculator .params-block li.param');
		this.params.find('p.name .param-name').click(function(){
			var param = $(this).parents('li.param');
			if(!param.is('.selected')){
				param.addClass('selected');
				_self.calculateWithOptions();
			}
		});
		this.params.find('p.name .icon').click(function(){
			var param = $(this).parents('li.param');
			if(!param.is('.selected')){
				param.addClass('selected');
				_self.calculateWithOptions();
			}
		});
		this.params.find('.delete').click(function(){
			var param = $(this).parents('li.param');
			if(param.is('#pLamination')){
				_self.windowOptions[3].deleteClick();
			}
			param.removeClass('selected');
			_self.calculateWithOptions();
		});
		
		this.sumBlock = $('.sum-value');
		this.windowOptions = Array();
		$('.b-calculator .params-block li.param').each(function(){
			var option = $(this);
			switch (option.attr('id')){
				case 'pMosquito':
					_self.windowOptions.push(new optionMosquito(option));
					break;
				case 'pSill':
					_self.windowOptions.push(new optionSill(option));
					break;
				case 'pEbb':
					_self.windowOptions.push(new optionEbb(option));
					break;
				case 'pLamination':
					_self.windowOptions.push(new optionLamination(option));
					break;
				case 'pMontage':
					_self.windowOptions.push(new optionMontage(option));
					break;
				case 'pFurniture':
					_self.windowOptions.push(new optionFurniture(option));
					break;
			}
			
		});
		
		this.selectType();
		this.slidersInit();
		this.initTarifPopups();
		this.setScheme(this.typesList.find('.selected .default img').attr('class'), true);
		this.setTarifPrice();
		this.updateOptions();
	},
	slidersInit:function(){
		var _self = this;
		this.horizontalSlider.dot.mousedown(function(e){
			e.preventDefault();
			_self.hSliderDrag();
		});

		this.verticalSlider.dot.mousedown(function(e){
			e.preventDefault();
			_self.vSliderDrag();
		});
		
		this.horizontalSlider.input.change(function(){
			_self.horizontalSliderUpdate();
			_self.calculate();
		});
		
		this.verticalSlider.input.change(function(){
			_self.verticalSliderUpdate();
			_self.calculate();
		});
		
	},
	vSliderDrag:function(){
		var _self = this;
		var startTop = this.verticalSlider.block.offset().top;
		var delta = _self.verticalSlider.max - _self.verticalSlider.min;
		var size;
		$(document).mousemove(function(e){
			e.preventDefault();
			var top = e.pageY - startTop + 7;
			if(top < 8){
				top = 8;
			} else if(top > _self.verticalSlider.size - 7){
				top = _self.verticalSlider.size - 7;
			}
			_self.verticalSlider.dot.css('top', top);
			size = Math.floor(_self.verticalSlider.min + (_self.verticalSlider.size-7-top)*delta/(_self.verticalSlider.size-15));
			_self.verticalSlider.input.val(size);
			_self.verticalSlider.value.text(size);
		});
		$(document).mouseup(function(){
			_self.stopSlidersDrag();
			_self.verticalSlider.input.focus();
		});
	},
	verticalSliderUpdate:function(){
		var val = this.verticalSlider.input.val();
		if(val > this.verticalSlider.max){
			val = this.verticalSlider.max;
		} else if(val < this.verticalSlider.min){
			val = this.verticalSlider.min;
		}
		var top = Math.floor(this.verticalSlider.size - 7 - (val - this.verticalSlider.min)*(this.verticalSlider.size-15)/(this.verticalSlider.max - this.verticalSlider.min));
		if(top < 8){
			top = 8;
			val = this.verticalSlider.max;
		} else if(top > this.verticalSlider.size-7){
			top = this.verticalSlider.size-7;
			val = this.verticalSlider.min;
		}
		this.verticalSlider.dot.css('top', top);
		this.verticalSlider.value.text(val);
		this.verticalSlider.input.val(val);
	},
	horizontalSliderUpdate:function(){
		var val = this.horizontalSlider.input.val();
		if(val > this.horizontalSlider.max){
			val = this.horizontalSlider.max;
		} else if(val < this.horizontalSlider.min){
			val = this.horizontalSlider.min;
		}
		var left = Math.floor(8 + (this.horizontalSlider.size-15)*(val-this.horizontalSlider.min)/(this.horizontalSlider.max - this.horizontalSlider.min));
		if(left < 8){
			left = 8;
			val = this.horizontalSlider.min;
		} else if(left > this.horizontalSlider.size-7){
			left = this.horizontalSlider.size-7;
			val = this.horizontalSlider.max;
		}
		this.horizontalSlider.dot.css('left', left);
		this.horizontalSlider.value.text(val);
		this.horizontalSlider.input.val(val);
		this.windowOptions[1].widthInput.val(val).removeAttr('readonly');
		this.windowOptions[2].widthInput.val(val).removeAttr('readonly');
	},
	hSliderDrag:function(){
		var _self = this;
		var startLeft = this.horizontalSlider.block.offset().left;
		var delta = _self.horizontalSlider.max - _self.horizontalSlider.min;
		var sillOption = this.windowOptions[1];
		var ebbOption = this.windowOptions[2];
		var size;
		$(document).mousemove(function(e){
			e.preventDefault();
			var left = e.pageX - startLeft + 10;
			if(left < 8){
				left = 8;
			} else if(left > _self.horizontalSlider.size - 7){
				left = _self.horizontalSlider.size - 7;
			}
			_self.horizontalSlider.dot.css('left', left);
			size = Math.floor(_self.horizontalSlider.min + (left-8)*delta/(_self.horizontalSlider.size-15));
			_self.horizontalSlider.input.val(size);
			_self.horizontalSlider.value.text(size);
			sillOption.widthInput.val(size);
			ebbOption.widthInput.val(size);
		});
		$(document).mouseup(function(){
			_self.stopSlidersDrag();
			_self.horizontalSlider.input.focus();
			sillOption.widthInput.val(size).removeAttr('readonly');
			ebbOption.widthInput.val(size).removeAttr('readonly');
		});
	},
	stopSlidersDrag:function(){
		$(document).unbind('mousemove');
		$(document).unbind('mouseup');
		this.calculate();
	},
	setSlidersLimits:function(){
		this.verticalSlider.min = this.currentScheme.minHeight;
		this.verticalSlider.max = this.currentScheme.maxHeight;
		this.horizontalSlider.min = this.currentScheme.minWidth;
		this.horizontalSlider.max = this.currentScheme.maxWidth;
		this.horizontalSliderUpdate();
		this.verticalSliderUpdate();
	},
	setTarifPrice:function(){
		this.currentPrices = this.tarifPrices[window.location.hash.replace('#', '')];
		if(typeof(this.currentPrices) == 'undefined')
			this.currentPrices = this.tarifPrices['tarif-classic'];
		this.windowOptions[3].setTarifPrice(this.currentPrices);
		this.calculate();
	},
	setScheme:function(scheme, isLoad){
		this.currentScheme = this.schemeConst[scheme];
		if(typeof(this.currentScheme) == 'undefined')
			this.currentScheme = this.schemeConst['scheme-4'];
		this.setSlidersLimits();
		if(!isLoad){
			this.calculate();
		}
	},
	initTarifPopups:function(){
		var _self = this;
		this.tarifBlocks = $('.tarifs-section .tarif');
		this.tarifBlocks.removeClass('hover');
		var names = this.tarifBlocks.find('.name');
		names.each(function(){
			var name = $(this);
			name.parent().find('.popup').css('left', name.width()/2-199);
		});
		// this.tarifBlocks.find('.name:last').parent().find('.popup').css('left', names.eq(0).width()/2-400);
		this.tarifBlocks.find('.popup').mouseover(function(){
			clearTimeout(_self.tarifTimeout);
			$(this).parent().addClass('hover');
		}).mouseout(function(){
			var elem = $(this);
			_self.tarifTimeout = setTimeout(function(){
				elem.parent().removeClass('hover');
			}, 50);
		});
		names.click(function(){
			_self.tarifBlocks.removeClass('hover');
			$(this).parent().addClass('hover');
		});
	},
	selectType:function(){
		var _self = this;
		this.typesListGroups.find('.center-in li').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			var li = $(this);
			_self.typesListGroups.removeClass('selected');
			var parent = li.parents('.type-select');
			parent.addClass('selected').find('.default').html(li.find('img').clone());
			var classname = li.find('img').attr('class');
			_self.windowImages.find('.selected').removeClass('selected');
			_self.windowImages.find('img').eq(classname.replace('scheme-', '')-1).addClass('selected');
			
			_self.windowTypeNames.find('.selected').removeClass('selected').end().find('.'+classname).addClass('selected');
			_self.setScheme(classname);
		});
		
		this.typesListGroups.find('.types').hover(function(){
			$(this).parents('.type-select').addClass('opened')
		}, function(){
			$(this).parents('.type-select').removeClass('opened');
		});
		
		this.typesListGroups.click(function(){
			var typesGroup = $(this);
			if(!typesGroup.is('.opened')){
				_self.typesList.find('.opened').removeClass('opened');
				typesGroup.addClass('opened');
				
			} else {
				_self.typesList.find('.opened').removeClass('opened');
			}
		});
	},
	calculate:function(){
		this.attachVars(this.currentPrices);
		this.basePrice = Math.round(this.currentScheme.price(this.currentPrices));
		this.basePriceBlock.text(this.basePrice);
		this.calculateWithOptions();
	},
	attachVars:function(prices){
		if(this.windowOptions[5].block.find('input:checked').attr('id') == 'rGU'){
			if(this.currentScheme.number == 14){
				prices.rotateAccessories = prices.s_14_GU;
			} else if(this.currentScheme.number == 13){
				prices.rotateAccessories = prices.s_13_rotateGU;
			} else {
				prices.rotateAccessories = prices.rotateGU;
				prices.rotateFoldingAccessories = prices.rotateFoldingGU;
			}
		} else {
			if(this.currentScheme.number == 14){
				prices.rotateAccessories = prices.s_14_VT;
			} else if(this.currentScheme.number == 13){
				prices.rotateAccessories = prices.s_13_rotateVT;
			} else {
				prices.rotateAccessories = prices.rotateVT;
				prices.rotateFoldingAccessories = prices.rotateFoldingVT;
			}
		}
		
//		prices.discount = 0;
		prices.outHeight = this.verticalSlider.input.val()/1000;
		prices.outWidth = this.horizontalSlider.input.val()/1000;
		return prices;
	},
	calculateWithOptions:function(){
		this.showFullPrice(this.basePrice + this.updateOptions());
	},
	calculateOtherPrices:function(){
		var familyObj = this.attachVars(prices_family);
		var classicObj = this.attachVars(prices_classic);
		var individualObj = this.attachVars(prices_individual);
		var egoistObj = this.attachVars(prices_egoist);
		var elegantObj = this.attachVars(prices_elegant);
		var familyPrice = Math.round(this.currentScheme.price(familyObj));
		var classicPrice = Math.round(this.currentScheme.price(classicObj));
		var individualPrice = Math.round(this.currentScheme.price(individualObj));
		var egoistPrice = Math.round(this.currentScheme.price(egoistObj));
		var elegantPrice = Math.round(this.currentScheme.price(elegantObj));
		
		var optionPrice = 0;
		
		this.params.parent().find('.selected').each(function(){
			var param = $(this);
			if(!param.is('#pLamination')){
				optionPrice = optionPrice + parseInt(param.find('.price span').html());
			}
		});
		
		this.otherPrices['tarif-classic'].text(this.windowOptions[3].updateOther(classicObj)+classicPrice+optionPrice);
		this.otherPrices['tarif-family'].text(this.windowOptions[3].updateOther(familyObj)+familyPrice+optionPrice);
		this.otherPrices['tarif-individual'].text(this.windowOptions[3].updateOther(individualObj)+individualPrice+optionPrice);
		this.otherPrices['tarif-elegant'].text(this.windowOptions[3].updateOther(elegantObj)+elegantPrice+optionPrice);
		this.otherPrices['tarif-egoist'].text(this.windowOptions[3].updateOther(egoistObj)+egoistPrice+optionPrice);
		// console.log(this.windowOptions[3].updateOther(familyObj));
		// console.log(this.windowOptions[3].updateOther(individualObj));
		// console.log(this.windowOptions[3].updateOther(elegantObj));
		// console.log(this.windowOptions[3].updateOther(egoistObj));
		// console.log('  ');
		
		
	},
	updateOptions:function(){
		var price = 0;
		$.each(this.windowOptions, function(i, option){
			price = price + option.update();
		});
		return price;
	},
	showFullPrice:function(price){
		this.calculateOtherPrices();
		this.sumBlock.empty();
		var price = price+'';
		for(var i=0; i<price.length; i++){
			this.sumBlock.append('<div class="num"><span class="n_'+price.charAt(i)+'"><i></i></span></div>')
		}
		if(price.length >= 4){
			this.sumBlock.find('.num').eq(price.length-4).addClass('margin');
		}
	}
}



Catalog = {
	init:function(){
		var _self = this;
		this.calculator = $('.b-catalog');
		this.typesList = this.calculator.find('.window-types-list');
		this.typesListGroups = this.typesList.find('.type-select');
		this.selectType();
		 
	},
	 
	selectType:function(){
		var _self = this;
		this.typesListGroups.find('.center-in li').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			var li = $(this);
			window.location.pathname = li.attr('rel');
			// _self.typesListGroups.removeClass('selected');
			// var parent = li.parents('.type-select');
			// parent.addClass('selected').find('.default').html(li.find('img').clone());
			// var classname = li.find('img').attr('class');
			// _self.windowImages.find('.selected').removeClass('selected');
			// _self.windowImages.find('img').eq(classname.replace('scheme-', '')-1).addClass('selected');
			// 
			// _self.windowTypeNames.find('.selected').removeClass('selected').end().find('.'+classname).addClass('selected');
			// _self.setScheme(classname);
		});
		
		this.typesListGroups.find('.types').hover(function(){
			$(this).parents('.type-select').addClass('opened')
		}, function(){
			$(this).parents('.type-select').removeClass('opened');
		});
		
		this.typesListGroups.click(function(){
			var typesGroup = $(this);
			if(!typesGroup.is('.opened')){
				_self.typesList.find('.opened').removeClass('opened');
				typesGroup.addClass('opened');
				
			} else {
				_self.typesList.find('.opened').removeClass('opened');
			}
		});
	}
	 
	 
	 
 
	 
}


function optionFurniture(block){this.init(block);}
optionFurniture.prototype = {
	init:function(block){
		var _self = this;
		this.block = block;
		this.radios = block.find('input[type=radio]');
		this.radios.click(function(){
			_self.radios.removeAttr('checked');
			$(this).attr('checked', 'checked');
			_self.calculate();
		});
	},
	calculate:function(){
		Calculator.calculate();
	},
	update:function(){
		return 0;
	}
}


function optionMosquito(block){this.init(block);}
optionMosquito.prototype = {
	init:function(block){
		this.block = block;
		this.priceBlock = block.find('p.name .price span');
	},
	update:function(){
		if(Calculator.currentScheme.number != 1 && Calculator.currentScheme.number != 12 && Calculator.currentScheme.number != 13){
			if(this.block.is('.selected')){
				this.mosquito = Math.round(Calculator.currentScheme.leafArea(Calculator.currentPrices)*mosquitoPrice);
			} else {
				this.mosquito = 0;
			}
			this.priceBlock.text(this.mosquito);
		}
		return this.mosquito;
	}
}

function optionSill(block){this.init(block);}
optionSill.prototype = {
	init:function(block){
		var _self = this;
		this.block = block;
		this.priceBlock = block.find('p.name .price span');
		this.typesBlock = $('#sillTypes');
		this.widthInput = block.find('input');
		this.widthInput.keyup(function(e){
			if(e.keyCode == 13){
				_self.calculate();
			}
		});
		this.sizesBlock = $('#sillSizes');
		this.typesBlock.find('select').live('change', function(){
			_self.sizesBlock.html(_self.generateSizes(_self.findCurrentType()));
			_self.calculate();
		});
		this.sizesBlock.find('select').live('change', function(){
			_self.calculate();
		});
		this.typesBlock.html(this.generateTypes());
		this.sizesBlock.html(this.generateSizes(this.findCurrentType()));
		this.calculate();
	},
	findCurrentType:function(){
		return this.typesBlock.find('option:selected').text();
	},
	findCurrentSizePrice:function(){
		var name = this.findCurrentType();
		for(var i=0; i<SillPrices.length; i++){
			if(SillPrices[i].name == name){
				var currentSillSizes = SillPrices[i].sizes;
				var currentSillPrices = SillPrices[i].prices;
				break
			}
		}
		var currentSize = this.sizesBlock.find('option:selected').text();
		for(var i=0; i<currentSillSizes.length; i++){
			if(currentSillSizes[i] == currentSize){
				var index = i;
				break
			}
		}
		return currentSillPrices[index];
	},
	generateTypes:function(){
		var html = '';
		for(var i=0; i<SillPrices.length; i++){
			html = html + '<option>'+SillPrices[i].name+'</option>';
		}
		html = '<select>'+html+'</select>';
		return html;
	},
	generateSizes:function(name){
		var html = '';
		
		for(var i=0; i<SillPrices.length; i++){
				if(SillPrices[i].name == name){
				var currentSillSizes = SillPrices[i].sizes;
				break
			}
		}
		for(var i=0; i<currentSillSizes.length; i++){
			html = html + '<option>'+currentSillSizes[i]+'</option>';
		}
		html = '<select>'+html+'</select>';
		return html;
	},
	calculate:function(){
		this.currentPrice = Math.round(this.findCurrentSizePrice()*this.widthInput.val()/1000);
		if(this.block.is('.selected')){
			Calculator.calculateWithOptions();
		}
	},
	update:function(){
		this.currentPrice = Math.round(this.findCurrentSizePrice()*this.widthInput.val()/1000);
		if(!this.block.is('.selected')){
			this.currentPrice = 0;
		}
		this.priceBlock.text(this.currentPrice)
		return this.currentPrice;
	}
}

function optionEbb(block){this.init(block);}
optionEbb.prototype = {
	init:function(block){
		var _self = this;
		this.block = block;
		this.priceBlock = block.find('p.name .price span');
		this.typesBlock = $('#ebbTypes');
		this.widthInput = block.find('input');
		this.widthInput.keyup(function(e){
			if(e.keyCode == 13){
				_self.calculate();
			}
		});
		this.sizesBlock = $('#ebbSizes');
		this.typesBlock.find('select').live('change', function(){
			_self.sizesBlock.html(_self.generateSizes(_self.findCurrentType()));
			_self.calculate();
		});
		this.sizesBlock.find('select').live('change', function(){
			_self.calculate();
		});
		this.typesBlock.html(this.generateTypes());
		this.sizesBlock.html(this.generateSizes(this.findCurrentType()));
		this.calculate();
	},
	findCurrentType:function(){
		return this.typesBlock.find('option:selected').text();
	},
	findCurrentSizePrice:function(){
		var name = this.findCurrentType();
		for(var i=0; i<EbbPrices.length; i++){
			if(EbbPrices[i].name == name){
				var currentEbbSizes = EbbPrices[i].sizes;
				var currentEbbPrices = EbbPrices[i].prices;
				break
			}
		}
		var currentSize = this.sizesBlock.find('option:selected').text();
		for(var i=0; i<currentEbbSizes.length; i++){
			if(currentEbbSizes[i] == currentSize){
				var index = i;
				break
			}
		}
		return currentEbbPrices[index];
	},
	generateTypes:function(){
		var html = '';
		for(var i=0; i<EbbPrices.length; i++){
			html = html + '<option>'+EbbPrices[i].name+'</option>';
		}
		html = '<select>'+html+'</select>';
		return html;
	},
	generateSizes:function(name){
		var html = '';
		for(var i=0; i<EbbPrices.length; i++){
			if(EbbPrices[i].name == name){
				var currentEbbSizes = EbbPrices[i].sizes;
				break
			}
		}
		for(var i=0; i<currentEbbSizes.length; i++){
			html = html + '<option>'+currentEbbSizes[i]+'</option>';
		}
		html = '<select>'+html+'</select>';
		return html;
	},
	calculate:function(){
		this.currentPrice = Math.round(this.findCurrentSizePrice()*this.widthInput.val()/1000);
		if(this.block.is('.selected')){
			Calculator.calculateWithOptions();
		}
	},
	update:function(){
		this.currentPrice = Math.round(this.findCurrentSizePrice()*this.widthInput.val()/1000);
		if(!this.block.is('.selected')){
			this.currentPrice = 0;
		}
		this.priceBlock.text(this.currentPrice);
		return this.currentPrice;
	}
}

function optionLamination(block){this.init(block);}
optionLamination.prototype = {
	init:function(block){
		var _self = this;
		this.block = block;
		this.insideBlock = $('#inside');
		this.outsideBlock = $('#outside');
		this.bothsideBlock = $('#bothside');
		this.priceBlock = block.find('p.name .price span');
		this.radios = block.find('input[type=radio]');
		this.radios.click(function(){
			
			_self.calculate($(this).attr('id'));
		});
		
		/*this.block.find('.delete').click(function(){
			
		 	_self.block.find('.price span').text('0');
		 	_self.block.find('input[type=checkbox]').removeAttr('checked');
		 	Calculator.calculateOtherPrices();
		 })
		 */
	},
	deleteClick:function(tarif_prices){
		this.block.find('.price span').text('0');
		this.block.find('input[type=radio]').removeAttr('checked');
		//this.block.find('input[type=radio]').addAttr('selected');
		this.block.find('#rNone').attr('checked', 'true');
		this.calculate('rNone');
		//Calculator.calculateWithOptions();
		
	},
	setTarifPrice:function(tarif_prices){
		this.insidePrice = tarif_prices['lamInside'];
		this.outsidePrice = tarif_prices['lamOutside'];
		this.bothsidesPrice = tarif_prices['lamBothSides'];
		this.insideBlock.text('+'+this.insidePrice+'%');
		this.outsideBlock.text('+'+this.outsidePrice+'%');
		this.bothsideBlock.text('+'+this.bothsidePrice+'%');
	},
	updateOther:function(tarif_prices){
		this.insidePrice = tarif_prices['lamInside'];
		this.outsidePrice = tarif_prices['lamOutside'];
		this.bothsidesPrice = tarif_prices['lamBothSides'];
		return this.calcCur();
	},
	calculate:function(id){
		//alert(id);
		this.currentPrice = this.calcPrice(id);
		if(this.block.is('.selected')){
			Calculator.calculateWithOptions();
		}
	},
	calcPrice:function(id){
		
		switch(id){
			case 'rOutside':
				var price = Math.round(Calculator.basePrice*this.outsidePrice/100);
				break;
			case 'rInside':
				var price = Math.round(Calculator.basePrice*this.insidePrice/100);
				break;
			case 'rBothsides':
				var price = Math.round(Calculator.basePrice*this.bothsidesPrice/100);
				break;
			case 'rNone':
				var price = 0;
				break;
		}
		return price;
	},
	update:function(){
		//alert('a');
		var _self = this;
		this.setTarifPrice(Calculator.currentPrices);
		this.currentPrice = this.calcCur();
		if(!this.block.is('.selected')){
			
			this.currentPrice = 0;
		}
		this.priceBlock.text(this.currentPrice);
		 
		return this.currentPrice;
	},
	calcCur:function(){
		var _self = this;
		var price = 0;
		this.radios.each(function(){
			var radio = $(this);
			if(radio.attr('checked')){
				price = _self.calcPrice(radio.attr('id'));
			}
		});
		return price;
	}
}

function optionMontage(block){this.init(block);}
optionMontage.prototype = {
	init:function(block){
		this.block = block;
		this.priceBlock = block.find('p.name .price span');
	},
	update:function(){
		if(this.block.is('.selected')){
			this.currentPrice = Math.round(Calculator.basePrice*0.2);
		} else {
			this.currentPrice = 0;
		}
		this.priceBlock.text(this.currentPrice);
		return this.currentPrice;
	}
}




Promo = {
	init:function(){
		var _self = this;
		this.blocks = $('.b-promo-info');
		this.leftArr = $('.b-select_prev');
		this.rightArr = $('.b-select_next');
		this.main = $('body.g-promo-page');
		this.outer = $('.l-outer');
		if($.browser.msie && $.browser.version < 7){
			this.outer.height($(document).height());
		}
		$(window).resize(function(){
			_self.setLeft();
		})
		this.setLeft();

		this.aniFlag = true;
		
		this.tIcons = $('.b-tabs .tab .center .icon .icons');
		this.uriFirst = 'background:url("';
		this.uriSecond = '") no-repeat; -background-image:none; -filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="';
		this.uriThird = '", sizingMethod="crop")';
		
		if(window.location.hash != ''){
			var hash = window.location.hash;
			 
			var newSrc = tarifIcons[hash.replace('#', '')];
			var uri = _self.uriFirst + newSrc + _self.uriSecond + newSrc + _self.uriThird;
			_self.tIcons.attr('style', uri);
			
			var curClass = this.main.attr('class').replace('g-promo-page ', '');
			this.main.removeClass(curClass).addClass(hash.replace('#', '')).css({backgroundImage:bgs[hash.replace('#', '')]});
			$('.promo-current').removeClass('promo-current');
			$('body .'+hash.replace('#', '')).addClass('promo-current');
			$('body .'+hash.replace('#', '')).css({ display:'block'});
			
		} else {
			window.location.hash = default_hash;
			
			var newSrc = tarifIcons[window.location.hash.replace('#', '')];
			 
			var uri = _self.uriFirst + newSrc + _self.uriSecond + newSrc + _self.uriThird;
			_self.tIcons.attr('style', uri);
			//alert(this.main);
			//alert(window.location.hash);
			this.main.addClass(default_hash).css({backgroundImage:bgs[default_hash]});
			
			
		}
		
		this.leftArr.find('.name').click(function(){
			if(_self.aniFlag == true){
				_self.aniFlag = false;
				_self.nextInit(-1);
			}
		});
		this.rightArr.find('.name').click(function(){
			if(_self.aniFlag == true){
				_self.aniFlag = false;
				_self.nextInit(1);
			}
		});
		
	},
	nextInit:function(dir){
		var _self = this;
		var current = $('.promo-current');
		var index = this.blocks.index(current);
		this.outer.addClass('bodyAni');
		var next = this.blocks.eq(index+dir);
		if(index+dir == this.blocks.length){
			var next = this.blocks.eq(0);
		} else if(index+dir == -1){
			var next = this.blocks.eq(this.blocks.length-1);
		}
		var currentClass = current.attr('class').replace('b-promo-info ', '');
		var nextClass = next.attr('class').replace('b-promo-info ', '');
		var rightPos = $(window).width() + 200;
		if(dir == 1){
			var left = -680;
			next.css({left:rightPos, display:'block'});
		} else {
			var left = rightPos;
			next.css({left:-680, display:'block'});
		}
		window.location.hash = nextClass;
		this.main.css({backgroundColor:this.main.css('backgroundColor'), backgroundImage:'none'});
		var newSrc = tarifIcons[nextClass];
		var uri = _self.uriFirst + newSrc + _self.uriSecond + newSrc + _self.uriThird;
		_self.tIcons.attr('style', uri);
		current.css('display', 'block').removeClass('promo-current').animate({left:left}, 'normal', 'easeOutQuad', function(){
			current.css({display:'none'});
		});
		next.addClass('promo-current').animate({left:this.leftDef}, 'normal', 'easeOutQuad');
		this.main.removeClass(currentClass).addClass(nextClass).animate({backgroundColor:colors[nextClass]}, 'normal', function(){
			_self.main.css({backgroundImage:bgs[nextClass]});
			
			//Переопределяем цены для нового тарифа
			Calculator.setTarifPrice();
			
			_self.aniFlag = true;
			_self.outer.removeClass('bodyAni');
		});
	},
	setLeft:function(){
		var _self = this;
		clearTimeout(timeout);
		_self.blocks.css({marginLeft:-340, left:'50%'});
		var timeout = setTimeout(function(){
			_self.leftDef = $(window).width()/2;
			_self.blocks.css({left:_self.leftDef});
		}, 100);
	}
}


Slides = {
	init:function(){
		var _self = this;
		this.block = $('.b-slides');
		this.moved = this.block.find('.items-wrap');
		this.items = this.moved.find('.item');
		$(window).load(function(){
			_self.items.each(function(){
				new Minimap($(this));
			});
		})
		this.itemWidth = this.items.eq(0).width();
		this.moved.width(this.items.length*this.itemWidth);
		this.leftArr = this.block.find('.a-left');
		this.rightArr = this.block.find('.a-right');
		this.leftArr.css({display:'none'});
		if(this.items.length == 1){
			this.rightArr.css({display:'none'});
		}
		this.items.eq(0).addClass('active');
		this.leftArr.hover(function(){
			$(this).addClass('a-left-hover');
		}, function(){
			$(this).removeClass('a-left-hover');
		}).click(function(){
			_self.show(_self.items.index(_self.moved.find('.active'))-1);
		});
		this.rightArr.hover(function(){
			$(this).addClass('a-right-hover');
		}, function(){
			$(this).removeClass('a-right-hover');
		}).click(function(){
			_self.show(_self.items.index(_self.moved.find('.active'))+1);
		});
	},
	show:function(index){
		var _self = this;
		if(index == this.items.length - 1){
			this.rightArr.css({display:'none'});
			this.leftArr.css({display:'block'});
		} else if(index == 0){
			this.rightArr.css({display:'block'});
			this.leftArr.css({display:'none'});
		} else {
			this.rightArr.css({display:'block'});
			this.leftArr.css({display:'block'});
		}
		var item = this.items.eq(index);
		this.moved.find('.active').removeClass('active').end().stop().animate({left:parseInt(this.moved.css('left')) + this.block.offset().left - item.offset().left}, 'fast', 'easeOutQuad', function(){
			item.addClass('active');
		});
	}
}

function Minimap(item){
	this.init(item);
}

Minimap.prototype = {
	init:function(item){
		this.item = item;
		this.map = item.find('.b-minimap');
		if(item.find('.image img').height() > item.height()){
			this.initMap();
		} else {
			this.map.remove();
		}
	},
	initMap:function(){
		var _self = this;
		this.itemHeight = this.item.height();
		this.mapFrame = this.map.find('.b-frame');
		this.mapInner = this.map.find('.preview');
		this.offsetTop = this.mapInner.offset().top;
		this.image = this.item.find('.image img');
		this.mapHeight = this.mapInner.find('img').height();
		this.koef = this.image.height()/this.mapHeight;
		this.topZone = this.mapFrame.find('.f-top');
		this.topZone.height(this.mapHeight);
		this.topZoneHeight = this.topZone.height();
		this.bottomZone = this.mapFrame.find('.f-bottom');
		this.bottomZone.height(this.mapHeight);
		this.bottomZoneHeight = this.bottomZone.height();
		this.zone = this.mapFrame.find('.f-border');
		this.zone.height(Math.round(this.itemHeight*this.mapHeight/this.image.height()));
		this.zoneHeight = this.zone.height();
		var top = -this.mapFrame.height()/2+this.mapHeight/2;
		this.mapFrame.css({top:top});
		this.image.css({top:-this.koef*(top+this.topZoneHeight)});
		this.center = this.mapFrame.height()/2;
		this.zone.mousedown(function(e){
			e.preventDefault();
			_self.startDrag();
		});
	},
	startDrag:function(){
		var _self = this;
		$(document).mousemove(function(e){
			e.preventDefault();
			var top = e.pageY-_self.offsetTop-_self.center;
			if(top <= -_self.topZoneHeight){
				top = -_self.topZoneHeight;
			} else if(top >= _self.mapHeight - _self.zoneHeight - _self.topZoneHeight - 2){
				top = -_self.zoneHeight - _self.topZoneHeight + _self.mapHeight - 2;
			}
			_self.mapFrame.css({top:top});
			_self.image.css({top:-_self.koef*(top+_self.topZoneHeight)});
		});
		$(document).mouseup(function(){
			_self.stopDrag();
		});
	},
	stopDrag:function(){
		$(document).unbind('mousemove');
		$(document).unbind('mouseup');
	}
}

Slideshow = {
	init:function(){
		var _self = this;
		this.block = $('.b-slideshow');
		this.moved = this.block.find('.items-wrap');
		this.items = this.moved.find('.item');
		this.itemWidth = this.items.eq(0).width();
		this.moved.width(this.items.length*this.itemWidth);
		$(window).resize(function(){
			_self.setDefault();
		});
		this.setDefault();
		this.leftArr = this.block.find('.a-left');
		this.rightArr = this.block.find('.a-right');
		this.show((this.items.length > 2) ? 1 : 0);
		this.leftArr.hover(function(){
			$(this).addClass('a-left-hover');
		}, function(){
			$(this).removeClass('a-left-hover');
		}).click(function(){
			_self.show(_self.items.index(_self.moved.find('.active'))-1);
		});
		this.rightArr.hover(function(){
			$(this).addClass('a-right-hover');
		}, function(){
			$(this).removeClass('a-right-hover');
		}).click(function(){
			_self.show(_self.items.index(_self.moved.find('.active'))+1);
		});
		
	},
	show:function(index){
		var _self = this;
		if(index == this.items.length - 1){
			this.rightArr.css({display:'none'});
			this.leftArr.css({display:'block'});
		} else if(index == 0){
			this.rightArr.css({display:'block'});
			this.leftArr.css({display:'none'});
		} else {
			this.rightArr.css({display:'block'});
			this.leftArr.css({display:'block'});
		}
		var item = this.items.eq(index);
		this.moved.find('.active').removeClass('active').end().stop().animate({left:parseInt(this.moved.css('left'))-item.offset().left + this.leftDefault}, 'fast', 'easeOutQuad', function(){
			item.addClass('active');
		});
	},
	setDefault:function(){
		this.leftDefault = ($(window).width()-this.itemWidth)/2;
		
	}
}


PhotoPopup = {
	init:function(){
		var _self = this;
		this.layer = $('.whiteLayer');
		$(window).load(function(){
			_self.layer.height($(document).height());
		})
		this.popup = $('.b-photo-popup');
		this.close = this.popup.find('.close');
		$('.j-photo-button').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			_self.showPopup($(this));
		});
		this.close.click(function(){
			_self.hidePopup();
		});
		this.items = this.popup.find('.item');
		this.itemsLength = this.items.length;
		this.items.click(function(){
			_self.togglePhotos($(this));
		});
	},
	togglePhotos:function(photo){
		var index = this.items.index(photo);
		if(index == -1){
			index = 0;
			photo = this.items.eq(0);
		}
		this.toCenter(photo);
		if(index-1 >=0){
			this.toLeft(this.items.eq(index-1));
		}
		if(index-2 >=0){
			this.toLeftOut(this.items.eq(index-2));
		}
		if(index+1 <= this.itemsLength -1){
			this.toRight(this.items.eq(index+1));
		}
		if(index+2 <= this.itemsLength -1){
			this.toRightOut(this.items.eq(index+2));
		}
	},
	toRightOut:function(photo){
		photo.animate({left:1000, top:198}, 'fast', function(){
			photo.removeClass('right');
		});
	},
	toLeftOut:function(photo){
		photo.animate({left:-150, top:198}, 'fast', function(){
			photo.removeClass('left');
		});
	},
	toRight:function(photo){
		photo.find('.text').css({display:'none'});
		photo.animate({width:145, top:198, left:798}, 'fast', function(){
			photo.removeClass('center').addClass('left');
		});
	},
	toLeft:function(photo){
		photo.find('.text').css({display:'none'});
		photo.animate({width:145, top:198, left:38}, 'fast', function(){
			photo.removeClass('center').addClass('left');
		});
	},
	toCenter:function(photo){
		photo.find('.text').css({display:'block'});
		photo.animate({width:406, top:0, left:290}, 'fast', function(){
			photo.removeClass('left right').addClass('center');
		});
	},
	showPopup:function(link){
		var _self = this;
		this.layer.fadeIn('fast', function(){
			_self.popup.find('.center').removeClass('center');
			_self.popup.css({top:$(document).scrollTop()+50, display:'block'});
			_self.togglePhotos(_self.items.eq($('.j-photo-button').index(link)));
		});
	},
	hidePopup:function(){
		this.popup.css({display:'none'});
		this.layer.fadeOut('fast');
	}
}


CommentSlide = {
	init:function(){
		var _self = this;
		this.block = $('.b-leave-comment');
		this.commentForm = this.block.find('.b-form');
		this.defHeight = this.block.height();
		this.block.height(this.defHeight);
		this.commentForm.css({display:'block'});
		if($.browser.msie && $.browser.version < 7){
			var delta = 10;
		} else {
			var delta = 0;
		}
		this.stopHeight = 100+this.defHeight + this.commentForm.height() + parseInt(this.commentForm.css('paddingTop')) + parseInt(this.commentForm.css('paddingBottom')) + delta;
		this.block.find('div.submit button.send').click(function(){
			$(this).parents('form').submit();
		});
		$('.comment-button span').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			_self.toggleForm();
		});
	},
	toggleForm:function(){
		if(this.block.is('.opened')){
			this.block.stop().removeClass('opened').animate({height:this.defHeight}, 'fast');
		} else {
			this.block.stop().addClass('opened').animate({height:this.stopHeight}, 'fast');
			//this.block.css({visibility:'visible', height:'auto'});
		}
	}
}


function Gallery(gallery){
	this.init(gallery);
}

Gallery.prototype = {
	init:function(gallery){
		var _self = this;
		this.gallery = gallery;
		this.leftArr = this.gallery.find('.previews .left');
		this.rightArr = this.gallery.find('.previews .right');
		this.bigPhoto = $('#bigImg');
		this.captionText = this.gallery.find('.image .info p');
		this.moved = this.gallery.find('.moved');
		this.mask = this.gallery.find('.static');
		this.maskWidth = this.mask.width();
		this.previews = this.gallery.find('.preview');
		this.previewWidth = this.previews.eq(0).width() + parseInt(this.previews.eq(0).css('marginRight'));
		this.moved.width(this.previews.length*this.previewWidth);
		this.movedWidth = this.moved.width();
		this.slideFlag = true;
		if(this.mask.width() >= this.movedWidth){
			this.leftArr.css('display', 'none');
			this.rightArr.css('display', 'none');
			this.slideFlag = false;
		}
		this.leftArr.click(function(){
			_self.slideNext(-1);
		});
		this.rightArr.click(function(){
			_self.slideNext(1);
		});
		this.previews.mousedown(function(){
			return false;
		}).click(function(){
			_self.show($(this));
		});
	},
	show:function(preview){
		var _self = this;
		this.moved.find('.select').removeClass('select');
		preview.addClass('select');
		$.get(preview.attr('rel'), function(data){
			if(data){
				var obj = $.parseJSON(data);
				_self.bigPhoto.attr('src', obj.url);
				// console.log(obj.text)
				_self.captionText.html(obj.text);
			}
		});
		if(this.slideFlag){
			var left = parseInt(this.moved.css('left'))-preview.offset().left + this.mask.offset().left + this.previewWidth;
			if(left <= 0 && left > this.maskWidth - this.movedWidth){
				if(this.previews.index(preview) > 1){
					this.leftArr.css({display:'block'});
				} else {
					this.leftArr.css({display:'none'});
				}
				this.rightArr.css({display:'block'});
			} else if(left > 0){
				left = 0;
				this.leftArr.css({display:'none'});
				this.rightArr.css({display:'block'});
			} else {
				left = this.maskWidth - this.movedWidth;
				this.leftArr.css({display:'block'});
				this.rightArr.css({display:'none'});
			}
			this.moved.animate({left:left}, 'fast', 'easeOutQuad');
		}
	},
	slideNext:function(dir){
		var curLeft = parseInt(this.moved.css('left'));
		var left = curLeft-dir*this.previewWidth;
		if(left <= 0 && left > this.maskWidth - this.movedWidth){
			this.leftArr.css({display:'block'});
			if(left == 0){
				this.leftArr.css({display:'none'});
			}
			this.rightArr.css({display:'block'});
		} else if(left > 0){
			left = 0;
			this.leftArr.css({display:'none'});
			this.rightArr.css({display:'block'});
		} else {
			left = this.maskWidth - this.movedWidth;
			this.leftArr.css({display:'block'});
			this.rightArr.css({display:'none'});
		}
		this.moved.stop().animate({left:left}, 'fast', 'easeOutQuad');
	}
}




FormSelects = {
	init:function(){
		var _self = this;
		this.selects = Array();
		$('.b-form-select').each(function(i){
			_self.selects.push(new SelectItem($(this), i));
		});
	},
	hideOthers:function(index){
		for(var i=0; i<this.selects.length; i++){
			if(i != index){
				var select = this.selects[i];
				select.hide();
			}
		}
	}
}

SelectItem = function(elem, index){this.init(elem, index)}
SelectItem.prototype = {
	init:function(elem, index){
		var _self = this;
		this.i = index;
		this.select = elem;
		this.parent = elem.parent();
		this.li = this.select.find('li');
		this.flag = true;
		this.hiddenInput = elem.find('input');
		this.moved = elem.find('.form-select');
		this.li.hover(function(){
			if(!$(this).is('.placeholder'))
				$(this).addClass('hover');
		}, function(){
			if(!$(this).is('.placeholder'))
				$(this).removeClass('hover');
		}).click(function(){
			var cur = $(this);
			if(cur.is('.placeholder')){
				if(_self.flag){
					_self.flag = false;
					if(!_self.moved.is('.open')){
						FormSelects.hideOthers(_self.i);
						_self.moved.addClass('open');
						_self.parent.css({zIndex:2});
						_self.moved.animate({height:_self.moved.find('.list li').length*25}, 'fast');
					}
				}
			} else {
				if(_self.li.index(cur) != 0){
					var massiv = cur.attr('id').split('_');
					_self.hiddenInput.attr('value', massiv[massiv.length-1]);
				} else {
					_self.hiddenInput.removeAttr('value');
				}
				_self.moved.find('.placeholder').removeClass('placeholder');
				cur.addClass('placeholder').removeClass('hover');
				_self.hide();
			}
		});
	},
	hide:function(){
		var _self = this;
		this.moved.height(25).removeClass('open');
		this.parent.css({zIndex:0});
		this.flag = true;
	}
}

ScrollToZamer = {
	init:function(){
		$('.b-side-button .link span').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			$(window).scrollTo('.b-call-zamer', 500, {onAfter:function(){
				Zamer.toggleZamer(1);
			}});
		});
	}
}

Graphic = {
	init:function(){
		var _self = this;
		this.block = $('.b-graphic-info');
		this.popups = $('.b-graphic-info .b-info-popup');
		this.close = $('.b-info-popup .close');
		this.dots = this.block.find('.b-dot');
		this.dots.mouseover(function(){
			_self.showPopup($(this).attr('rel'));
		});
		this.close.click(function(){
			$(this).parents('.b-info-popup').removeClass('visible');
		});
	},
	showPopup:function(id){
		var next = $('#'+id);
		if(next.is('.visible')){
			next.removeClass('visible');
		} else {
			this.popups.removeClass('visible');
			next.addClass('visible');
		}
	}
}

Quiz = {
	init:function(){
		var _self = this;
		this.quiz = $('.b-quiz');
		this.quizForm = this.quiz.find('form');
		this.resultWrap = this.quiz.find('.results');
		this.result = this.resultWrap.find('.in');
		this.preload = this.resultWrap.find('.preload');
		this.li = this.quiz.find('ul.answers li');
		this.li.click(function(){
			var li = $(this);
			if(!li.is('.selected')){
				li.parent().addClass('clicked').find('.selected').removeClass('selected');
				li.addClass('selected');
				_self.writeAnswer(li);
				_self.checkAnswers();
			}
		});
	  this.quizForm.live('submit', function(){
			var $form = $(this);
			$.post($form.attr("action"), _self.serializedForm($form), function(data){
				_self.preload.css({display:'none'});
				_self.result.css({display:'none'}).html(data);
				var height = _self.result.height();
				_self.resultWrap.animate({height:height}, 'fast', function(){
					_self.result.fadeIn('fast');
				});
			});
			return false;
		});
	},
	writeAnswer:function(li){
		var item = li.parents('.item');
		item.find('input').val(li.parent().find('li').index(li));
	},
	checkAnswers:function(){
		var _self = this;
		if(this.li.length/2 == this.quiz.find('.selected').length){
			this.resultWrap.css({display:'block'});
			this.showPreload();
		}
	},
	serializedForm:function(form){
		var serialized = {};
		$.each(form.serializeArray(), function(i, val){
			serialized[val['name']] = val['value'];
		});
    return serialized;
	},
	showPreload:function(){
		var _self = this;
		var height = this.preload.height();
		this.preload.css({display:'none'});
		this.resultWrap.animate({height:height}, 'fast', function(){
			_self.quizForm.submit();
			_self.preload.css({display:'block'});
			// setTimeout(function(){
			// 	var height = _self.result.height();
			// 	_self.preload.css({display:'none'});
			// 	_self.result.css({display:'none'});
			// 	_self.resultWrap.animate({height:height}, 'fast', function(){
			// 		_self.result.fadeIn('fast');
			// 	});
			// }, 1000);
		});
	},
	showResult:function(){

	}
}

SwitchLists = {
	init:function(){
		var _self = this;
		this.browser = true;
		if($.browser.msie){
			this.browser = false;
		}
		this.outer = $('.offices-wrap');
		this.li = $('.offices-list li');
		this.li.hover(function(){
			if(!$(this).is('.active')) $(this).addClass('hover');
		}, function(){
			if(!$(this).is('.active')) $(this).removeClass('hover');
		}).click(function(){
			if(!$(this).is('.active')){
				_self.showNext($(this));
			}
		});
	},
	showNext:function(li){
		var index = this.li.index(li);
		var _self = this;
		this.li.parent().find('.active').removeClass('active hover');
		li.addClass('active');
		var next = this.outer.find('.offices').eq(index);
		this.outer.height(this.outer.find('.showed').height());
		this.outer.find('.showed').fadeOut('fast', function(){
			$(this).removeClass('showed');
			_self.outer.animate({height:next.height()}, 'fast', function(){
				next.fadeIn('fast').addClass('showed');
				_self.outer.css({height:'auto'});
			});
		});
	}
}

Switch = {
	init:function(){
		var _self = this;
		this.browser = true;
		if($.browser.msie){
			this.browser = false;
		}
		this.li = $('.b-switch li');
		this.li.find('span').hover(function(){
			var li = $(this).parents('li');
			if(!li.is('.select'))	li.addClass('hover'); 
		}, function(){
			var li = $(this).parents('li');
			if(!li.is('.select'))	li.removeClass('hover'); 
		}).click(function(){
			var li = $(this).parents('li');
			if(!li.is('.select') && !$('body').is('.g-promo-page')){
				li.parent().find('.select').removeClass('select hover');
				_self.setHeight(li.parents('.offices'));
				li.addClass('select');
				if(li.parent().find('li').index(li) == 0){
					_self.showNext(0, li.parents('.offices'));
				} else {
					_self.showNext(1, li.parents('.offices'));
				}
			}
		});
	},
	setHeight:function(parent){
		content = parent.find('.b-switch-content');
		content.height(content.height());
	},
	showNext:function(i, parent){
		var _self = this;
		var mapView = parent.find('.b-map-view');
		var listView = parent.find('.b-list-view');
		if(this.browser){
			if(i == 0){
				mapView.fadeOut('fast', function(){
					listView.css({opacity:0, display:'block'});
					content.animate({height:listView.height()}, 'fast', function(){
						listView.animate({opacity:1}, 'fast');
					}); 
				});
			} else {
				listView.fadeOut('fast', function(){
					mapView.css({opacity:0, display:'block'});
					content.animate({height:mapView.height()+35}, 'fast', function(){
						mapView.animate({opacity:1}, 'fast');
					}); 
				});
			}
		} else {
			if(i == 0){
				mapView.fadeOut('fast', function(){
					listView.css({visibility:'hidden', display:'block'});
					content.animate({height:listView.height()}, 'fast', function(){
						listView.css({visibility:'visible', display:'block'});;
					}); 
				});
			} else {
				listView.fadeOut('fast', function(){
					mapView.css({visibility:'hidden', display:'block'});
					content.animate({height:mapView.height()+35}, 'fast', function(){
						mapView.css({visibility:'visible', display:'block'});
					}); 
				});
			}
		}
	}
}
Zamer = {
	init:function(){
		var _self = this;
		this.browser = true;
		if($.browser.msie){
			this.browser = false;
		}
		this.state = 0;
		this.blockWrap = $('.zamer-block');
		this.block = $('.zamer-block .in');
		this.flag = true;
		$('.b-button-in').hover(function(){
			$(this).parent().addClass('b-big-button_hover');
		}, function(){
			$(this).parent().removeClass('b-big-button_hover');
		}).mousedown(function(){
			if(_self.flag){
				_self.flag = false;
				var elem = $(this).parent();
				elem.addClass('b-big-button_click');
				$(document).mouseup(function(){
					elem.removeClass('b-big-button_click');
					$(document).unbind('mouseup');
					if(_self.block.length){
						_self.toggleZamer();
					} else {
						_self.flag = true;
					}
				});
			}
			return false;
		});
	},
	toggleZamer:function(i){
		var _self = this;
		if(this.browser){
			if(this.state == 0){
				this.state = 1;
				var height = this.block.height();
				this.block.css({display:'none'});
				this.blockWrap.animate({height:height}, 'fast', function(){
					$(this).css({visibility:'visible', height:'auto'});
					_self.block.fadeIn('fast', function(){
						_self.flag = true;
					});
				});
			} else {
				this.state = 0;
				this.block.fadeOut('fast', function(){
					_self.blockWrap.css({visibility:'hidden'}).animate({height:0}, 'fast', function(){
						_self.flag = true;
					});
				});
			}
		} else {
			if(this.state == 0){
				this.state = 1;
				var height = this.block.height();
				this.block.css({display:'none'});
				this.blockWrap.animate({height:height}, 'fast', function(){
					$(this).css({visibility:'visible'});
					_self.block.css({display:'block'});
					_self.flag = true;
				});
			} else {
				this.state = 0;
				this.block.css({display:'none'});
				this.blockWrap.css({visibility:'hidden'}).animate({height:0}, 'fast', function(){
					_self.flag = true;
				});
			}
		}
	}
}

Tabs = {
	init:function(){
		var _self = this;
		this.browser = true;
		if($.browser.msie){
			this.browser = false;
		}
		this.tabWrap = $('.b-main_content');
		this.tabs = $('.b-tabs .tab');
		this.tabContents = this.tabWrap.find('.tab-content');
		this.tabButtons = this.tabs.find('.name');
		this.flag = true;
		this.tabButtons.hover(function(){
			if(!$(this).parents('.tab').is('.selected')) $(this).addClass('hover');
		}, function(){
			if(!$(this).parents('.tab').is('.selected')) $(this).removeClass('hover');
		}).click(function(){
			if(!$(this).parents('.tab').is('.selected') && _self.flag){
				$(this).removeClass('hover');
				_self.flag = false;
				_self.showNext($(this).parents('.tab'));
			}
		});
		
		$('.ajaxForm').submit(function(){
			var $form = $(this);
			var serialized = {};
			$.each($form.serializeArray(), function(i, val){
				serialized[val['name']] = val['value'];
			});
			$.post($form.attr("action"), serialized, function(data){
				
			});

			return false;
		});
	},
	showNext:function(tab){
		var _self = this;
		this.tabs.each(function(){
			$(this).removeClass('selected').addClass('white-tabs');
		});
		tab.addClass('selected').removeClass('white-tabs');
		$(window).scrollTo('.b-tabs', 200);
		var index = this.tabs.index(tab);
		var next = this.tabContents.eq(index);
		this.tabWrap.height(this.tabWrap.height());
		if(this.browser){
			$('.tab-content_active').fadeOut('fast', function(){
				$(this).removeClass('tab-content_active');
				_self.tabWrap.animate({height:next.height()+parseInt(next.css('paddingTop'))+parseInt(next.css('paddingBottom'))}, 'fast', function(){
					next.fadeIn('fast', function(){
						next.addClass('tab-content_active');
						_self.tabWrap.css({height:'auto'});
						_self.flag = true;
					});
				});
			});
		} else {
			$('.tab-content_active').removeClass('tab-content_active');
			this.tabWrap.animate({height:next.height()+parseInt(next.css('paddingTop'))+parseInt(next.css('paddingBottom'))}, 'fast', function(){
				next.addClass('tab-content_active');
				_self.tabWrap.css({height:'auto'});
				_self.flag = true;
			});
		}
	}
}

MiniTabs = {
	init:function(){
		var _self = this;
		this.browser = true;
		if($.browser.msie){
			this.browser = false;
		}
		this.tabWrap = $('.mini-tab_content');
		this.tabs = $('.b-mini-tabs .mini-tab');
		this.tabContents = this.tabWrap.find('.tab-content');
		this.flag = true;
		this.tabButtons = this.tabs.find('.name');
		this.tabButtons.hover(function(){
			if(!$(this).parents('.mini-tab').is('.selected')) $(this).addClass('hover');
		}, function(){
			if(!$(this).parents('.mini-tab').is('.selected')) $(this).removeClass('hover');
		}).click(function(){
			$(window).scrollTo('.b-mini-tabs', 500);
			if(!$(this).parents('.mini-tab').is('.selected') && _self.flag){
				$(this).removeClass('hover');
				_self.flag = false;
				_self.showNext($(this).parents('.mini-tab'));
			}
		});
	},
	showNext:function(tab){
		var _self = this;
		this.tabs.each(function(){
			$(this).removeClass('selected');
		});
		tab.addClass('selected');
		var index = this.tabs.index(tab);
		var next = this.tabContents.eq(index);
		this.tabWrap.height(this.tabWrap.height());
		if(this.browser){
			$('.tab-content_active').fadeOut('fast', function(){
				$(this).removeClass('tab-content_active');
				_self.tabWrap.animate({height:next.height()+parseInt(next.css('paddingTop'))+parseInt(next.css('paddingBottom'))}, 'fast', function(){
					next.fadeIn('fast', function(){
						next.addClass('tab-content_active');
						_self.tabWrap.css({height:'auto'});
						_self.flag = true;
					});
				});
			});
		} else {
			$('.tab-content_active').removeClass('tab-content_active');
			this.tabWrap.animate({height:next.height()+parseInt(next.css('paddingTop'))+parseInt(next.css('paddingBottom'))}, 'fast', function(){
				next.addClass('tab-content_active');
				_self.tabWrap.css({height:'auto'});
				_self.flag = true;
			});
		}
	}
}

Menu = {
	init:function(){
		var _self = this;
		this.dark = $('.darkLayer');
		this.dark.height($(document).height()+100);
		this.popup = $('.b-contacts-popup');
		this.popupd = $('.b-discounts-popup');
		this.popupp = $('.b-promo-popup');
		this.close = this.popup.find('.close');
		this.closed = this.popupd.find('.close');
		this.closep = this.popupp.find('.close');
		this.close.click(function(){
			_self.hideContacts();
		});
		this.closed.click(function(){
			_self.hideDiscounts();
		});
		this.closep.click(function(){
			_self.hidePromo();
		});
		$('.b-phone-button span').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			_self.showContacts();
		});
		
		$('#discount-button').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			_self.showDiscounts();
		});
		
		$('#promo-button').hover(function(){
			$(this).addClass('hover');
		}, function(){
			$(this).removeClass('hover');
		}).click(function(){
			_self.showPromo();
		});
		
		
		$('.b-menu-item a').hover(function(){
			$(this).parents('.b-menu-item').addClass('b-menu-item_hover');
		}, function(){
			$(this).parents('.b-menu-item').removeClass('b-menu-item_hover');
		});
	},
	hideContacts:function(){
		this.popup.css({display:'none'});
		this.dark.animate({opacity:0}, 'fast', function(){
			$(this).css({display:'none'});
		});
	},
	showContacts:function(){
		var _self = this;
		this.dark.css({opacity:0, display:'block'}).animate({opacity:0.58}, 'fast', function(){
			_self.popup.css({display:'block'});
		});
	},
	hideDiscounts:function(){
		this.popupd.css({display:'none'});
		this.dark.animate({opacity:0}, 'fast', function(){
			$(this).css({display:'none'});
		});
	},
	showDiscounts:function(){
		var _self = this;
		this.dark.css({opacity:0, display:'block'}).animate({opacity:0.58}, 'fast', function(){
			_self.popupd.css({display:'block'});
		});
	},
	
	hidePromo:function(){
		this.popupp.css({display:'none'});
		this.dark.animate({opacity:0}, 'fast', function(){
			$(this).css({display:'none'});
		});
	},
	showPromo:function(){
		var _self = this;
		this.dark.css({opacity:0, display:'block'}).animate({opacity:0.58}, 'fast', function(){
			_self.popupp.css({display:'block'});
		});
	}
	
}


Subscribe = {
	init:function(){
		var _self = this;
		this.layer = $('.whiteLayer');
		this.layer.height($(document).height());
		this.popup = $('.b-newsletter-popup');
		this.newsForm = this.popup.find('.subscribe-form');
		this.close = this.popup.find('.close');
		this.button = this.popup.find('.b-button a');
		this.button.click(function(e){
			e.preventDefault();
			_self.sendForm();
		});
		$('.j-subscribe').hover(function(){
			$(this).addClass('j-subscribe-hover');
		}, function(){
			$(this).removeClass('j-subscribe-hover');
		}).click(function(){
			_self.showPopup();
		});
		this.close.click(function(){
			_self.hidePopup();
		});
	},
	sendForm:function(){
		var _self = this;
		var $form = this.newsForm;
		var serialized = {};
		$.each($form.serializeArray(), function(i, val){
			serialized[val['name']] = val['value'];
		});
		$.post($form.attr("action"), serialized, function(data){
			if(data == true){
				$form.parents('.content').css({display:'none'});
				_self.popup.find('.hidden').css({display:'block'});
			}
		});

		return false;
	},
	hidePopup:function(){
		this.popup.css({display:'none'});
		this.layer.fadeOut('fast');
	},
	showPopup:function(){
		var _self = this;
		this.layer.fadeIn('fast', function(){
			_self.popup.css({display:'block'});
		});
	}
}


