(function(An,c){var A=function(Az,A0){return new A.fn.init(Az,A0)},N=An.jQuery,t=An.$,AD=An.document,z,r=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ax=/^.[^:#\[\.,]*$/,AY=/\S/,o=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,E=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,B=navigator.userAgent,U,m=false,AF=[],Ah,AU=Object.prototype.toString,AR=Object.prototype.hasOwnProperty,G=Array.prototype.push,g=Array.prototype.slice,S=Array.prototype.indexOf;A.fn=A.prototype={init:function(Az,A2){var A1,A3,A0,A4;if(!Az){return this}if(Az.nodeType){this.context=this[0]=Az;this.length=1;return this}if(Az==="body"&&!A2){this.context=AD;this[0]=AD.body;this.selector="body";this.length=1;return this}if(typeof Az==="string"){A1=r.exec(Az);if(A1&&(A1[1]||!A2)){if(A1[1]){A4=(A2?A2.ownerDocument||A2:AD);A0=E.exec(Az);if(A0){if(A.isPlainObject(A2)){Az=[AD.createElement(A0[1])];A.fn.attr.call(Az,A2,true)}else{Az=[A4.createElement(A0[1])]}}else{A0=l([A1[1]],[A4]);Az=(A0.cacheable?A0.fragment.cloneNode(true):A0.fragment).childNodes}return A.merge(this,Az)}else{A3=AD.getElementById(A1[2]);if(A3){if(A3.id!==A1[2]){return z.find(Az)}this.length=1;this[0]=A3}this.context=AD;this.selector=Az;return this}}else{if(!A2&&/^\w+$/.test(Az)){this.selector=Az;this.context=AD;Az=AD.getElementsByTagName(Az);return A.merge(this,Az)}else{if(!A2||A2.jquery){return(A2||z).find(Az)}else{return A(A2).find(Az)}}}}else{if(A.isFunction(Az)){return z.ready(Az)}}if(Az.selector!==c){this.selector=Az.selector;this.context=Az.context}return A.makeArray(Az,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return g.call(this,0)},get:function(Az){return Az==null?this.toArray():(Az<0?this.slice(Az)[0]:this[Az])},pushStack:function(A0,A2,Az){var A1=A();if(A.isArray(A0)){G.apply(A1,A0)}else{A.merge(A1,A0)}A1.prevObject=this;A1.context=this.context;if(A2==="find"){A1.selector=this.selector+(this.selector?" ":"")+Az}else{if(A2){A1.selector=this.selector+"."+A2+"("+Az+")"}}return A1},each:function(A0,Az){return A.each(this,A0,Az)},ready:function(Az){A.bindReady();if(A.isReady){Az.call(AD,A)}else{if(AF){AF.push(Az)}}return this},eq:function(Az){return Az===-1?this.slice(Az):this.slice(Az,+Az+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(g.apply(this,arguments),"slice",g.call(arguments).join(","))},map:function(Az){return this.pushStack(A.map(this,function(A1,A0){return Az.call(A1,A0,A1)}))},end:function(){return this.prevObject||A(null)},push:G,sort:[].sort,splice:[].splice};A.fn.init.prototype=A.fn;A.extend=A.fn.extend=function(){var A4=arguments[0]||{},A3=1,A2=arguments.length,A6=false,A7,A1,Az,A0;if(typeof A4==="boolean"){A6=A4;A4=arguments[1]||{};A3=2}if(typeof A4!=="object"&&!A.isFunction(A4)){A4={}}if(A2===A3){A4=this;--A3}for(;A3<A2;A3++){if((A7=arguments[A3])!=null){for(A1 in A7){Az=A4[A1];A0=A7[A1];if(A4===A0){continue}if(A6&&A0&&(A.isPlainObject(A0)||A.isArray(A0))){var A5=Az&&(A.isPlainObject(Az)||A.isArray(Az))?Az:A.isArray(A0)?[]:{};A4[A1]=A.extend(A6,A5,A0)}else{if(A0!==c){A4[A1]=A0}}}}}return A4};A.extend({noConflict:function(Az){An.$=t;if(Az){An.jQuery=N}return A},isReady:false,ready:function(){if(!A.isReady){if(!AD.body){return setTimeout(A.ready,13)}A.isReady=true;if(AF){var A0,Az=0;while((A0=AF[Az++])){A0.call(AD,A)}AF=null}if(A.fn.triggerHandler){A(AD).triggerHandler("ready")}}},bindReady:function(){if(m){return }m=true;if(AD.readyState==="complete"){return A.ready()}if(AD.addEventListener){AD.addEventListener("DOMContentLoaded",Ah,false);An.addEventListener("load",A.ready,false)}else{if(AD.attachEvent){AD.attachEvent("onreadystatechange",Ah);An.attachEvent("onload",A.ready);var Az=false;try{Az=An.frameElement==null}catch(A0){}if(AD.documentElement.doScroll&&Az){X()}}}},isFunction:function(Az){return AU.call(Az)==="[object Function]"},isArray:function(Az){return AU.call(Az)==="[object Array]"},isPlainObject:function(A0){if(!A0||AU.call(A0)!=="[object Object]"||A0.nodeType||A0.setInterval){return false}if(A0.constructor&&!AR.call(A0,"constructor")&&!AR.call(A0.constructor.prototype,"isPrototypeOf")){return false}var Az;for(Az in A0){}return Az===c||AR.call(A0,Az)},isEmptyObject:function(A0){for(var Az in A0){return false}return true},error:function(Az){throw Az},parseJSON:function(Az){if(typeof Az!=="string"||!Az){return null}Az=A.trim(Az);if(/^[\],:{}\s]*$/.test(Az.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return An.JSON&&An.JSON.parse?An.JSON.parse(Az):(new Function("return "+Az))()}else{A.error("Invalid JSON: "+Az)}},noop:function(){},globalEval:function(A1){if(A1&&AY.test(A1)){var A0=AD.getElementsByTagName("head")[0]||AD.documentElement,Az=AD.createElement("script");Az.type="text/javascript";if(A.support.scriptEval){Az.appendChild(AD.createTextNode(A1))}else{Az.text=A1}A0.insertBefore(Az,A0.firstChild);A0.removeChild(Az)}},nodeName:function(A0,Az){return A0.nodeName&&A0.nodeName.toUpperCase()===Az.toUpperCase()},each:function(A2,A6,A1){var A0,A3=0,A4=A2.length,Az=A4===c||A.isFunction(A2);if(A1){if(Az){for(A0 in A2){if(A6.apply(A2[A0],A1)===false){break}}}else{for(;A3<A4;){if(A6.apply(A2[A3++],A1)===false){break}}}}else{if(Az){for(A0 in A2){if(A6.call(A2[A0],A0,A2[A0])===false){break}}}else{for(var A5=A2[0];A3<A4&&A6.call(A5,A3,A5)!==false;A5=A2[++A3]){}}}return A2},trim:function(Az){return(Az||"").replace(o,"")},makeArray:function(A1,A0){var Az=A0||[];if(A1!=null){if(A1.length==null||typeof A1==="string"||A.isFunction(A1)||(typeof A1!=="function"&&A1.setInterval)){G.call(Az,A1)}else{A.merge(Az,A1)}}return Az},inArray:function(A1,A2){if(A2.indexOf){return A2.indexOf(A1)}for(var Az=0,A0=A2.length;Az<A0;Az++){if(A2[Az]===A1){return Az}}return -1},merge:function(A3,A1){var A2=A3.length,A0=0;if(typeof A1.length==="number"){for(var Az=A1.length;A0<Az;A0++){A3[A2++]=A1[A0]}}else{while(A1[A0]!==c){A3[A2++]=A1[A0++]}}A3.length=A2;return A3},grep:function(A0,A4,Az){var A1=[];for(var A2=0,A3=A0.length;A2<A3;A2++){if(!Az!==!A4(A0[A2],A2)){A1.push(A0[A2])}}return A1},map:function(A0,A5,Az){var A1=[],A4;for(var A2=0,A3=A0.length;A2<A3;A2++){A4=A5(A0[A2],A2,Az);if(A4!=null){A1[A1.length]=A4}}return A1.concat.apply([],A1)},guid:1,proxy:function(A1,A0,Az){if(arguments.length===2){if(typeof A0==="string"){Az=A1;A1=Az[A0];A0=c}else{if(A0&&!A.isFunction(A0)){Az=A0;A0=c}}}if(!A0&&A1){A0=function(){return A1.apply(Az||this,arguments)}}if(A1){A0.guid=A1.guid=A1.guid||A0.guid||A.guid++}return A0},uaMatch:function(A0){A0=A0.toLowerCase();var Az=/(webkit)[ \/]([\w.]+)/.exec(A0)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(A0)||/(msie) ([\w.]+)/.exec(A0)||!/compatible/.test(A0)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(A0)||[];return{browser:Az[1]||"",version:Az[2]||"0"}},browser:{}});U=A.uaMatch(B);if(U.browser){A.browser[U.browser]=true;A.browser.version=U.version}if(A.browser.webkit){A.browser.safari=true}if(S){A.inArray=function(Az,A0){return S.call(A0,Az)}}z=A(AD);if(AD.addEventListener){Ah=function(){AD.removeEventListener("DOMContentLoaded",Ah,false);A.ready()}}else{if(AD.attachEvent){Ah=function(){if(AD.readyState==="complete"){AD.detachEvent("onreadystatechange",Ah);A.ready()}}}}function X(){if(A.isReady){return }try{AD.documentElement.doScroll("left")}catch(Az){setTimeout(X,1);return }A.ready()}function Aw(Az,A0){if(A0.src){A.ajax({url:A0.src,async:false,dataType:"script"})}else{A.globalEval(A0.text||A0.textContent||A0.innerHTML||"")}if(A0.parentNode){A0.parentNode.removeChild(A0)}}function AP(Az,A7,A5,A1,A4,A6){var A0=Az.length;if(typeof A7==="object"){for(var A2 in A7){AP(Az,A2,A7[A2],A1,A4,A5)}return Az}if(A5!==c){A1=!A6&&A1&&A.isFunction(A5);for(var A3=0;A3<A0;A3++){A4(Az[A3],A7,A1?A5.call(Az[A3],A3,A4(Az[A3],A7)):A5,A6)}return Az}return A0?A4(Az[0],A7):c}function Aq(){return(new Date).getTime()}(function(){A.support={};var A5=AD.documentElement,A4=AD.createElement("script"),Az=AD.createElement("div"),A0="script"+Aq();Az.style.display="none";Az.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var A7=Az.getElementsByTagName("*"),A6=Az.getElementsByTagName("a")[0];if(!A7||!A7.length||!A6){return }A.support={leadingWhitespace:Az.firstChild.nodeType===3,tbody:!Az.getElementsByTagName("tbody").length,htmlSerialize:!!Az.getElementsByTagName("link").length,style:/red/.test(A6.getAttribute("style")),hrefNormalized:A6.getAttribute("href")==="/a",opacity:/^0.55$/.test(A6.style.opacity),cssFloat:!!A6.style.cssFloat,checkOn:Az.getElementsByTagName("input")[0].value==="on",optSelected:AD.createElement("select").appendChild(AD.createElement("option")).selected,parentNode:Az.removeChild(Az.appendChild(AD.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};A4.type="text/javascript";try{A4.appendChild(AD.createTextNode("window."+A0+"=1;"))}catch(A2){}A5.insertBefore(A4,A5.firstChild);if(An[A0]){A.support.scriptEval=true;delete An[A0]}try{delete A4.test}catch(A2){A.support.deleteExpando=false}A5.removeChild(A4);if(Az.attachEvent&&Az.fireEvent){Az.attachEvent("onclick",function A8(){A.support.noCloneEvent=false;Az.detachEvent("onclick",A8)});Az.cloneNode(true).fireEvent("onclick")}Az=AD.createElement("div");Az.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var A1=AD.createDocumentFragment();A1.appendChild(Az.firstChild);A.support.checkClone=A1.cloneNode(true).cloneNode(true).lastChild.checked;A(function(){var A9=AD.createElement("div");A9.style.width=A9.style.paddingLeft="1px";AD.body.appendChild(A9);A.boxModel=A.support.boxModel=A9.offsetWidth===2;AD.body.removeChild(A9).style.display="none";A9=null});var A3=function(A9){var BB=AD.createElement("div");A9="on"+A9;var BA=(A9 in BB);if(!BA){BB.setAttribute(A9,"return;");BA=typeof BB[A9]==="function"}BB=null;return BA};A.support.submitBubbles=A3("submit");A.support.changeBubbles=A3("change");A5=A4=Az=A7=A6=null})();A.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var Aj="jQuery"+Aq(),Ai=0,Au={};A.extend({cache:{},expando:Aj,noData:{"embed":true,"object":true,"applet":true},data:function(A1,A0,A3){if(A1.nodeName&&A.noData[A1.nodeName.toLowerCase()]){return }A1=A1==An?Au:A1;var A4=A1[Aj],Az=A.cache,A2;if(!A4&&typeof A0==="string"&&A3===c){return null}if(!A4){A4=++Ai}if(typeof A0==="object"){A1[Aj]=A4;A2=Az[A4]=A.extend(true,{},A0)}else{if(!Az[A4]){A1[Aj]=A4;Az[A4]={}}}A2=Az[A4];if(A3!==c){A2[A0]=A3}return typeof A0==="string"?A2[A0]:A2},removeData:function(A1,A0){if(A1.nodeName&&A.noData[A1.nodeName.toLowerCase()]){return }A1=A1==An?Au:A1;var A3=A1[Aj],Az=A.cache,A2=Az[A3];if(A0){if(A2){delete A2[A0];if(A.isEmptyObject(A2)){A.removeData(A1)}}}else{if(A.support.deleteExpando){delete A1[A.expando]}else{if(A1.removeAttribute){A1.removeAttribute(A.expando)}}delete Az[A3]}}});A.fn.extend({data:function(Az,A1){if(typeof Az==="undefined"&&this.length){return A.data(this[0])}else{if(typeof Az==="object"){return this.each(function(){A.data(this,Az)})}}var A2=Az.split(".");A2[1]=A2[1]?"."+A2[1]:"";if(A1===c){var A0=this.triggerHandler("getData"+A2[1]+"!",[A2[0]]);if(A0===c&&this.length){A0=A.data(this[0],Az)}return A0===c&&A2[1]?this.data(A2[0]):A0}else{return this.trigger("setData"+A2[1]+"!",[A2[0],A1]).each(function(){A.data(this,Az,A1)})}},removeData:function(Az){return this.each(function(){A.removeData(this,Az)})}});A.extend({queue:function(A0,Az,A2){if(!A0){return }Az=(Az||"fx")+"queue";var A1=A.data(A0,Az);if(!A2){return A1||[]}if(!A1||A.isArray(A2)){A1=A.data(A0,Az,A.makeArray(A2))}else{A1.push(A2)}return A1},dequeue:function(A2,A1){A1=A1||"fx";var Az=A.queue(A2,A1),A0=Az.shift();if(A0==="inprogress"){A0=Az.shift()}if(A0){if(A1==="fx"){Az.unshift("inprogress")}A0.call(A2,function(){A.dequeue(A2,A1)})}}});A.fn.extend({queue:function(Az,A0){if(typeof Az!=="string"){A0=Az;Az="fx"}if(A0===c){return A.queue(this[0],Az)}return this.each(function(A2,A3){var A1=A.queue(this,Az,A0);if(Az==="fx"&&A1[0]!=="inprogress"){A.dequeue(this,Az)}})},dequeue:function(Az){return this.each(function(){A.dequeue(this,Az)})},delay:function(A0,Az){A0=A.fx?A.fx.speeds[A0]||A0:A0;Az=Az||"fx";return this.queue(Az,function(){var A1=this;setTimeout(function(){A.dequeue(A1,Az)},A0)})},clearQueue:function(Az){return this.queue(Az||"fx",[])}});var AQ=/[\n\t]/g,u=/\s+/,AW=/\r/g,Ar=/href|src|style/,D=/(button|input)/i,Z=/(button|input|object|select|textarea)/i,J=/^(a|area)$/i,k=/radio|checkbox/;A.fn.extend({attr:function(Az,A0){return AP(this,Az,A0,true,A.attr)},removeAttr:function(Az,A0){return this.each(function(){A.attr(this,Az,"");if(this.nodeType===1){this.removeAttribute(Az)}})},addClass:function(A6){if(A.isFunction(A6)){return this.each(function(A9){var A8=A(this);A8.addClass(A6.call(this,A9,A8.attr("class")))})}if(A6&&typeof A6==="string"){var Az=(A6||"").split(u);for(var A2=0,A1=this.length;A2<A1;A2++){var A0=this[A2];if(A0.nodeType===1){if(!A0.className){A0.className=A6}else{var A3=" "+A0.className+" ",A5=A0.className;for(var A4=0,A7=Az.length;A4<A7;A4++){if(A3.indexOf(" "+Az[A4]+" ")<0){A5+=" "+Az[A4]}}A0.className=A.trim(A5)}}}}return this},removeClass:function(A4){if(A.isFunction(A4)){return this.each(function(A8){var A7=A(this);A7.removeClass(A4.call(this,A8,A7.attr("class")))})}if((A4&&typeof A4==="string")||A4===c){var A5=(A4||"").split(u);for(var A1=0,A0=this.length;A1<A0;A1++){var A3=this[A1];if(A3.nodeType===1&&A3.className){if(A4){var A2=(" "+A3.className+" ").replace(AQ," ");for(var A6=0,Az=A5.length;A6<Az;A6++){A2=A2.replace(" "+A5[A6]+" "," ")}A3.className=A.trim(A2)}else{A3.className=""}}}}return this},toggleClass:function(A2,A0){var A1=typeof A2,Az=typeof A0==="boolean";if(A.isFunction(A2)){return this.each(function(A4){var A3=A(this);A3.toggleClass(A2.call(this,A4,A3.attr("class"),A0),A0)})}return this.each(function(){if(A1==="string"){var A5,A4=0,A3=A(this),A6=A0,A7=A2.split(u);while((A5=A7[A4++])){A6=Az?A6:!A3.hasClass(A5);A3[A6?"addClass":"removeClass"](A5)}}else{if(A1==="undefined"||A1==="boolean"){if(this.className){A.data(this,"__className__",this.className)}this.className=this.className||A2===false?"":A.data(this,"__className__")||""}}})},hasClass:function(Az){var A2=" "+Az+" ";for(var A1=0,A0=this.length;A1<A0;A1++){if((" "+this[A1].className+" ").replace(AQ," ").indexOf(A2)>-1){return true}}return false},val:function(A6){if(A6===c){var A0=this[0];if(A0){if(A.nodeName(A0,"option")){return(A0.attributes.value||{}).specified?A0.value:A0.text}if(A.nodeName(A0,"select")){var A4=A0.selectedIndex,A7=[],A8=A0.options,A3=A0.type==="select-one";if(A4<0){return null}for(var A1=A3?A4:0,A5=A3?A4+1:A8.length;A1<A5;A1++){var A2=A8[A1];if(A2.selected){A6=A(A2).val();if(A3){return A6}A7.push(A6)}}return A7}if(k.test(A0.type)&&!A.support.checkOn){return A0.getAttribute("value")===null?"on":A0.value}return(A0.value||"").replace(AW,"")}return c}var Az=A.isFunction(A6);return this.each(function(BB){var BA=A(this),BC=A6;if(this.nodeType!==1){return }if(Az){BC=A6.call(this,BB,BA.val())}if(typeof BC==="number"){BC+=""}if(A.isArray(BC)&&k.test(this.type)){this.checked=A.inArray(BA.val(),BC)>=0}else{if(A.nodeName(this,"select")){var A9=A.makeArray(BC);A("option",this).each(function(){this.selected=A.inArray(A(this).val(),A9)>=0});if(!A9.length){this.selectedIndex=-1}}else{this.value=BC}}})}});A.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(A0,Az,A5,A8){if(!A0||A0.nodeType===3||A0.nodeType===8){return c}if(A8&&Az in A.attrFn){return A(A0)[Az](A5)}var A1=A0.nodeType!==1||!A.isXMLDoc(A0),A4=A5!==c;Az=A1&&A.props[Az]||Az;if(A0.nodeType===1){var A3=Ar.test(Az);if(Az==="selected"&&!A.support.optSelected){var A6=A0.parentNode;if(A6){A6.selectedIndex;if(A6.parentNode){A6.parentNode.selectedIndex}}}if(Az in A0&&A1&&!A3){if(A4){if(Az==="type"&&D.test(A0.nodeName)&&A0.parentNode){A.error("type property can't be changed")}A0[Az]=A5}if(A.nodeName(A0,"form")&&A0.getAttributeNode(Az)){return A0.getAttributeNode(Az).nodeValue}if(Az==="tabIndex"){var A7=A0.getAttributeNode("tabIndex");return A7&&A7.specified?A7.value:Z.test(A0.nodeName)||J.test(A0.nodeName)&&A0.href?0:c}return A0[Az]}if(!A.support.style&&A1&&Az==="style"){if(A4){A0.style.cssText=""+A5}return A0.style.cssText}if(A4){A0.setAttribute(Az,""+A5)}var A2=!A.support.hrefNormalized&&A1&&A3?A0.getAttribute(Az,2):A0.getAttribute(Az);return A2===null?c:A2}return A.style(A0,Az,A5)}});var Ad=/\.(.*)$/,a=function(Az){return Az.replace(/[^\w\s\.\|`]/g,function(A0){return"\\"+A0})};A.event={add:function(A2,A6,BB,A4){if(A2.nodeType===3||A2.nodeType===8){return }if(A2.setInterval&&(A2!==An&&!A2.frameElement)){A2=An}var A0,BA;if(BB.handler){A0=BB;BB=A0.handler}if(!BB.guid){BB.guid=A.guid++}var A7=A.data(A2);if(!A7){return }var BC=A7.events=A7.events||{},A5=A7.handle,A5;if(!A5){A7.handle=A5=function(){return typeof A!=="undefined"&&!A.event.triggered?A.event.handle.apply(A5.elem,arguments):c}}A5.elem=A2;A6=A6.split(" ");var A9,A3=0,Az;while((A9=A6[A3++])){BA=A0?A.extend({},A0):{handler:BB,data:A4};if(A9.indexOf(".")>-1){Az=A9.split(".");A9=Az.shift();BA.namespace=Az.slice(0).sort().join(".")}else{Az=[];BA.namespace=""}BA.type=A9;BA.guid=BB.guid;var A1=BC[A9],A8=A.event.special[A9]||{};if(!A1){A1=BC[A9]=[];if(!A8.setup||A8.setup.call(A2,A4,Az,A5)===false){if(A2.addEventListener){A2.addEventListener(A9,A5,false)}else{if(A2.attachEvent){A2.attachEvent("on"+A9,A5)}}}}if(A8.add){A8.add.call(A2,BA);if(!BA.handler.guid){BA.handler.guid=BB.guid}}A1.push(BA);A.event.global[A9]=true}A2=null},global:{},remove:function(BE,A9,A0,A5){if(BE.nodeType===3||BE.nodeType===8){return }var BH,A4,A6,BC=0,A2,A7,BA,A3,A8,Az,BG,BD=A.data(BE),A1=BD&&BD.events;if(!BD||!A1){return }if(A9&&A9.type){A0=A9.handler;A9=A9.type}if(!A9||typeof A9==="string"&&A9.charAt(0)==="."){A9=A9||"";for(A4 in A1){A.event.remove(BE,A4+A9)}return }A9=A9.split(" ");while((A4=A9[BC++])){BG=A4;Az=null;A2=A4.indexOf(".")<0;A7=[];if(!A2){A7=A4.split(".");A4=A7.shift();BA=new RegExp("(^|\\.)"+A.map(A7.slice(0).sort(),a).join("\\.(?:.*\\.)?")+"(\\.|$)")}A8=A1[A4];if(!A8){continue}if(!A0){for(var BB=0;BB<A8.length;BB++){Az=A8[BB];if(A2||BA.test(Az.namespace)){A.event.remove(BE,BG,Az.handler,BB);A8.splice(BB--,1)}}continue}A3=A.event.special[A4]||{};for(var BB=A5||0;BB<A8.length;BB++){Az=A8[BB];if(A0.guid===Az.guid){if(A2||BA.test(Az.namespace)){if(A5==null){A8.splice(BB--,1)}if(A3.remove){A3.remove.call(BE,Az)}}if(A5!=null){break}}}if(A8.length===0||A5!=null&&A8.length===1){if(!A3.teardown||A3.teardown.call(BE,A7)===false){AI(BE,A4,BD.handle)}BH=null;delete A1[A4]}}if(A.isEmptyObject(A1)){var BF=BD.handle;if(BF){BF.elem=null}delete BD.events;delete BD.handle;if(A.isEmptyObject(BD)){A.removeData(BE)}}},trigger:function(Az,A3,A1){var A8=Az.type||Az,A2=arguments[3];if(!A2){Az=typeof Az==="object"?Az[Aj]?Az:A.extend(A.Event(A8),Az):A.Event(A8);if(A8.indexOf("!")>=0){Az.type=A8=A8.slice(0,-1);Az.exclusive=true}if(!A1){Az.stopPropagation();if(A.event.global[A8]){A.each(A.cache,function(){if(this.events&&this.events[A8]){A.event.trigger(Az,A3,this.handle.elem)}})}}if(!A1||A1.nodeType===3||A1.nodeType===8){return c}Az.result=c;Az.target=A1;A3=A.makeArray(A3);A3.unshift(Az)}Az.currentTarget=A1;var A4=A.data(A1,"handle");if(A4){A4.apply(A1,A3)}var A9=A1.parentNode||A1.ownerDocument;try{if(!(A1&&A1.nodeName&&A.noData[A1.nodeName.toLowerCase()])){if(A1["on"+A8]&&A1["on"+A8].apply(A1,A3)===false){Az.result=false}}}catch(A6){}if(!Az.isPropagationStopped()&&A9){A.event.trigger(Az,A3,A9,true)}else{if(!Az.isDefaultPrevented()){var A5=Az.target,A0,BA=A.nodeName(A5,"a")&&A8==="click",A7=A.event.special[A8]||{};if((!A7._default||A7._default.call(A1,Az)===false)&&!BA&&!(A5&&A5.nodeName&&A.noData[A5.nodeName.toLowerCase()])){try{if(A5[A8]){A0=A5["on"+A8];if(A0){A5["on"+A8]=null}A.event.triggered=true;A5[A8]()}}catch(A6){}if(A0){A5["on"+A8]=A0}A.event.triggered=false}}}},handle:function(Az){var A7,A1,A0,A2,A8;Az=arguments[0]=A.event.fix(Az||An.event);Az.currentTarget=this;A7=Az.type.indexOf(".")<0&&!Az.exclusive;if(!A7){A0=Az.type.split(".");Az.type=A0.shift();A2=new RegExp("(^|\\.)"+A0.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}var A8=A.data(this,"events"),A1=A8[Az.type];if(A8&&A1){A1=A1.slice(0);for(var A4=0,A3=A1.length;A4<A3;A4++){var A6=A1[A4];if(A7||A2.test(A6.namespace)){Az.handler=A6.handler;Az.data=A6.data;Az.handleObj=A6;var A5=A6.handler.apply(this,arguments);if(A5!==c){Az.result=A5;if(A5===false){Az.preventDefault();Az.stopPropagation()}}if(Az.isImmediatePropagationStopped()){break}}}}return Az.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(A2){if(A2[Aj]){return A2}var A0=A2;A2=A.Event(A0);for(var A1=this.props.length,A4;A1;){A4=this.props[--A1];A2[A4]=A0[A4]}if(!A2.target){A2.target=A2.srcElement||AD}if(A2.target.nodeType===3){A2.target=A2.target.parentNode}if(!A2.relatedTarget&&A2.fromElement){A2.relatedTarget=A2.fromElement===A2.target?A2.toElement:A2.fromElement}if(A2.pageX==null&&A2.clientX!=null){var A3=AD.documentElement,Az=AD.body;A2.pageX=A2.clientX+(A3&&A3.scrollLeft||Az&&Az.scrollLeft||0)-(A3&&A3.clientLeft||Az&&Az.clientLeft||0);A2.pageY=A2.clientY+(A3&&A3.scrollTop||Az&&Az.scrollTop||0)-(A3&&A3.clientTop||Az&&Az.clientTop||0)}if(!A2.which&&((A2.charCode||A2.charCode===0)?A2.charCode:A2.keyCode)){A2.which=A2.charCode||A2.keyCode}if(!A2.metaKey&&A2.ctrlKey){A2.metaKey=A2.ctrlKey}if(!A2.which&&A2.button!==c){A2.which=(A2.button&1?1:(A2.button&2?3:(A2.button&4?2:0)))}return A2},guid:100000000,proxy:A.proxy,special:{ready:{setup:A.bindReady,teardown:A.noop},live:{add:function(Az){A.event.add(this,Az.origType,A.extend({},Az,{handler:x}))},remove:function(A0){var Az=true,A1=A0.origType.replace(Ad,"");A.each(A.data(this,"events").live||[],function(){if(A1===this.origType.replace(Ad,"")){Az=false;return false}});if(Az){A.event.remove(this,A0.origType,x)}}},beforeunload:{setup:function(A1,A0,Az){if(this.setInterval){this.onbeforeunload=Az}return false},teardown:function(A0,Az){if(this.onbeforeunload===Az){this.onbeforeunload=null}}}}};var AI=AD.removeEventListener?function(A0,Az,A1){A0.removeEventListener(Az,A1,false)}:function(A0,Az,A1){A0.detachEvent("on"+Az,A1)};A.Event=function(Az){if(!this.preventDefault){return new A.Event(Az)}if(Az&&Az.type){this.originalEvent=Az;this.type=Az.type}else{this.type=Az}this.timeStamp=Aq();this[Aj]=true};function As(){return false}function F(){return true}A.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var Az=this.originalEvent;if(!Az){return }if(Az.preventDefault){Az.preventDefault()}Az.returnValue=false},stopPropagation:function(){this.isPropagationStopped=F;var Az=this.originalEvent;if(!Az){return }if(Az.stopPropagation){Az.stopPropagation()}Az.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F;this.stopPropagation()},isDefaultPrevented:As,isPropagationStopped:As,isImmediatePropagationStopped:As};var s=function(A0){var Az=A0.relatedTarget;try{while(Az&&Az!==this){Az=Az.parentNode}if(Az!==this){A0.type=A0.data;A.event.handle.apply(this,arguments)}}catch(A1){}},AZ=function(Az){Az.type=Az.data;A.event.handle.apply(this,arguments)};A.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(A0,Az){A.event.special[A0]={setup:function(A1){A.event.add(this,Az,A1&&A1.selector?AZ:s,A0)},teardown:function(A1){A.event.remove(this,Az,A1&&A1.selector?AZ:s)}}});if(!A.support.submitBubbles){A.event.special.submit={setup:function(A0,Az){if(this.nodeName.toLowerCase()!=="form"){A.event.add(this,"click.specialSubmit",function(A3){var A2=A3.target,A1=A2.type;if((A1==="submit"||A1==="image")&&A(A2).closest("form").length){return Ab("submit",this,arguments)}});A.event.add(this,"keypress.specialSubmit",function(A3){var A2=A3.target,A1=A2.type;if((A1==="text"||A1==="password")&&A(A2).closest("form").length&&A3.keyCode===13){return Ab("submit",this,arguments)}})}else{return false}},teardown:function(Az){A.event.remove(this,".specialSubmit")}}}if(!A.support.changeBubbles){var AS=/textarea|input|select/i,At,I=function(A0){var Az=A0.type,A1=A0.value;if(Az==="radio"||Az==="checkbox"){A1=A0.checked}else{if(Az==="select-multiple"){A1=A0.selectedIndex>-1?A.map(A0.options,function(A2){return A2.selected}).join("-"):""}else{if(A0.nodeName.toLowerCase()==="select"){A1=A0.selectedIndex}}}return A1},q=function q(A1){var Az=A1.target,A0,A2;if(!AS.test(Az.nodeName)||Az.readOnly){return }A0=A.data(Az,"_change_data");A2=I(Az);if(A1.type!=="focusout"||Az.type!=="radio"){A.data(Az,"_change_data",A2)}if(A0===c||A2===A0){return }if(A0!=null||A2){A1.type="change";return A.event.trigger(A1,arguments[1],Az)}};A.event.special.change={filters:{focusout:q,click:function(A1){var A0=A1.target,Az=A0.type;if(Az==="radio"||Az==="checkbox"||A0.nodeName.toLowerCase()==="select"){return q.call(this,A1)}},keydown:function(A1){var A0=A1.target,Az=A0.type;if((A1.keyCode===13&&A0.nodeName.toLowerCase()!=="textarea")||(A1.keyCode===32&&(Az==="checkbox"||Az==="radio"))||Az==="select-multiple"){return q.call(this,A1)}},beforeactivate:function(A0){var Az=A0.target;A.data(Az,"_change_data",I(Az))}},setup:function(A1,A0){if(this.type==="file"){return false}for(var Az in At){A.event.add(this,Az+".specialChange",At[Az])}return AS.test(this.nodeName)},teardown:function(Az){A.event.remove(this,".specialChange");return AS.test(this.nodeName)}};At=A.event.special.change.filters}function Ab(A0,A1,Az){Az[0].type=A0;return A.event.handle.apply(A1,Az)}if(AD.addEventListener){A.each({focus:"focusin",blur:"focusout"},function(A1,Az){A.event.special[Az]={setup:function(){this.addEventListener(A1,A0,true)},teardown:function(){this.removeEventListener(A1,A0,true)}};function A0(A2){A2=A.event.fix(A2);A2.type=Az;return A.event.handle.call(this,A2)}})}A.each(["bind","one"],function(A0,Az){A.fn[Az]=function(A6,A7,A5){if(typeof A6==="object"){for(var A3 in A6){this[Az](A3,A7,A6[A3],A5)}return this}if(A.isFunction(A7)){A5=A7;A7=c}var A4=Az==="one"?A.proxy(A5,function(A8){A(this).unbind(A8,A4);return A5.apply(this,arguments)}):A5;if(A6==="unload"&&Az!=="one"){this.one(A6,A7,A5)}else{for(var A2=0,A1=this.length;A2<A1;A2++){A.event.add(this[A2],A6,A4,A7)}}return this}});A.fn.extend({unbind:function(A3,A2){if(typeof A3==="object"&&!A3.preventDefault){for(var A1 in A3){this.unbind(A1,A3[A1])}}else{for(var A0=0,Az=this.length;A0<Az;A0++){A.event.remove(this[A0],A3,A2)}}return this},delegate:function(Az,A0,A2,A1){return this.live(A0,A2,A1,Az)},undelegate:function(Az,A0,A1){if(arguments.length===0){return this.unbind("live")}else{return this.die(A0,null,A1,Az)}},trigger:function(Az,A0){return this.each(function(){A.event.trigger(Az,A0,this)})},triggerHandler:function(Az,A1){if(this[0]){var A0=A.Event(Az);A0.preventDefault();A0.stopPropagation();A.event.trigger(A0,A1,this[0]);return A0.result}},toggle:function(A1){var Az=arguments,A0=1;while(A0<Az.length){A.proxy(A1,Az[A0++])}return this.click(A.proxy(A1,function(A2){var A3=(A.data(this,"lastToggle"+A1.guid)||0)%A0;A.data(this,"lastToggle"+A1.guid,A3+1);A2.preventDefault();return Az[A3].apply(this,arguments)||false}))},hover:function(Az,A0){return this.mouseenter(Az).mouseleave(A0||Az)}});var AX={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};A.each(["live","die"],function(A0,Az){A.fn[Az]=function(A8,A5,BA,A3){var A9,A6=0,A7,A2,BB,A4=A3||this.selector,A1=A3?this:A(this.context);if(A.isFunction(A5)){BA=A5;A5=c}A8=(A8||"").split(" ");while((A9=A8[A6++])!=null){A7=Ad.exec(A9);A2="";if(A7){A2=A7[0];A9=A9.replace(Ad,"")}if(A9==="hover"){A8.push("mouseenter"+A2,"mouseleave"+A2);continue}BB=A9;if(A9==="focus"||A9==="blur"){A8.push(AX[A9]+A2);A9=A9+A2}else{A9=(AX[A9]||A9)+A2}if(Az==="live"){A1.each(function(){A.event.add(this,M(A9,A4),{data:A5,selector:A4,handler:BA,origType:A9,origHandler:BA,preType:BB})})}else{A1.unbind(M(A9,A4),BA)}}return this}});function x(Az){var A9,A0=[],BC=[],A8=arguments,BB,A7,BA,A2,A4,A6,A3,A5,BD=A.data(this,"events");if(Az.liveFired===this||!BD||!BD.live||Az.button&&Az.type==="click"){return }Az.liveFired=this;var A1=BD.live.slice(0);for(A4=0;A4<A1.length;A4++){BA=A1[A4];if(BA.origType.replace(Ad,"")===Az.type){BC.push(BA.selector)}else{A1.splice(A4--,1)}}A7=A(Az.target).closest(BC,Az.currentTarget);for(A6=0,A3=A7.length;A6<A3;A6++){for(A4=0;A4<A1.length;A4++){BA=A1[A4];if(A7[A6].selector===BA.selector){A2=A7[A6].elem;BB=null;if(BA.preType==="mouseenter"||BA.preType==="mouseleave"){BB=A(Az.relatedTarget).closest(BA.selector)[0]}if(!BB||BB!==A2){A0.push({elem:A2,handleObj:BA})}}}}for(A6=0,A3=A0.length;A6<A3;A6++){A7=A0[A6];Az.currentTarget=A7.elem;Az.data=A7.handleObj.data;Az.handleObj=A7.handleObj;if(A7.handleObj.origHandler.apply(A7.elem,A8)===false){A9=false;break}}return A9}function M(A0,Az){return"live."+(A0&&A0!=="*"?A0+".":"")+Az.replace(/\./g,"`").replace(/ /g,"&")}A.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(A0,Az){A.fn[Az]=function(A1){return A1?this.bind(Az,A1):this.trigger(Az)};if(A.attrFn){A.attrFn[Az]=true}});if(An.attachEvent&&!An.addEventListener){An.attachEvent("onunload",function(){for(var A0 in A.cache){if(A.cache[A0].handle){try{A.event.remove(A.cache[A0].handle.elem)}catch(Az){}}}})}(function(){var BA=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,BB=0,BD=Object.prototype.toString,A5=false,A4=true;[0,0].sort(function(){A4=false;return 0});var A1=function(BM,BH,BP,BQ){BP=BP||[];var BS=BH=BH||AD;if(BH.nodeType!==1&&BH.nodeType!==9){return[]}if(!BM||typeof BM!=="string"){return BP}var BN=[],BJ,BU,BX,BI,BL=true,BK=A2(BH),BR=BM;while((BA.exec(""),BJ=BA.exec(BR))!==null){BR=BJ[3];BN.push(BJ[1]);if(BJ[2]){BI=BJ[3];break}}if(BN.length>1&&A6.exec(BM)){if(BN.length===2&&A7.relative[BN[0]]){BU=BE(BN[0]+BN[1],BH)}else{BU=A7.relative[BN[0]]?[BH]:A1(BN.shift(),BH);while(BN.length){BM=BN.shift();if(A7.relative[BM]){BM+=BN.shift()}BU=BE(BM,BU)}}}else{if(!BQ&&BN.length>1&&BH.nodeType===9&&!BK&&A7.match.ID.test(BN[0])&&!A7.match.ID.test(BN[BN.length-1])){var BT=A1.find(BN.shift(),BH,BK);BH=BT.expr?A1.filter(BT.expr,BT.set)[0]:BT.set[0]}if(BH){var BT=BQ?{expr:BN.pop(),set:A9(BQ)}:A1.find(BN.pop(),BN.length===1&&(BN[0]==="~"||BN[0]==="+")&&BH.parentNode?BH.parentNode:BH,BK);BU=BT.expr?A1.filter(BT.expr,BT.set):BT.set;if(BN.length>0){BX=A9(BU)}else{BL=false}while(BN.length){var BW=BN.pop(),BV=BW;if(!A7.relative[BW]){BW=""}else{BV=BN.pop()}if(BV==null){BV=BH}A7.relative[BW](BX,BV,BK)}}else{BX=BN=[]}}if(!BX){BX=BU}if(!BX){A1.error(BW||BM)}if(BD.call(BX)==="[object Array]"){if(!BL){BP.push.apply(BP,BX)}else{if(BH&&BH.nodeType===1){for(var BO=0;BX[BO]!=null;BO++){if(BX[BO]&&(BX[BO]===true||BX[BO].nodeType===1&&A8(BH,BX[BO]))){BP.push(BU[BO])}}}else{for(var BO=0;BX[BO]!=null;BO++){if(BX[BO]&&BX[BO].nodeType===1){BP.push(BU[BO])}}}}}else{A9(BX,BP)}if(BI){A1(BI,BS,BP,BQ);A1.uniqueSort(BP)}return BP};A1.uniqueSort=function(BI){if(BC){A5=A4;BI.sort(BC);if(A5){for(var BH=1;BH<BI.length;BH++){if(BI[BH]===BI[BH-1]){BI.splice(BH--,1)}}}}return BI};A1.matches=function(BH,BI){return A1(BH,null,null,BI)};A1.find=function(BO,BH,BP){var BN,BL;if(!BO){return[]}for(var BK=0,BJ=A7.order.length;BK<BJ;BK++){var BM=A7.order[BK],BL;if((BL=A7.leftMatch[BM].exec(BO))){var BI=BL[1];BL.splice(1,1);if(BI.substr(BI.length-1)!=="\\"){BL[1]=(BL[1]||"").replace(/\\/g,"");BN=A7.find[BM](BL,BH,BP);if(BN!=null){BO=BO.replace(A7.match[BM],"");break}}}}if(!BN){BN=BH.getElementsByTagName("*")}return{set:BN,expr:BO}};A1.filter=function(BS,BR,BV,BL){var BJ=BS,BX=[],BP=BR,BN,BH,BO=BR&&BR[0]&&A2(BR[0]);while(BS&&BR.length){for(var BQ in A7.filter){if((BN=A7.leftMatch[BQ].exec(BS))!=null&&BN[2]){var BI=A7.filter[BQ],BW,BU,BK=BN[1];BH=false;BN.splice(1,1);if(BK.substr(BK.length-1)==="\\"){continue}if(BP===BX){BX=[]}if(A7.preFilter[BQ]){BN=A7.preFilter[BQ](BN,BP,BV,BX,BL,BO);if(!BN){BH=BW=true}else{if(BN===true){continue}}}if(BN){for(var BM=0;(BU=BP[BM])!=null;BM++){if(BU){BW=BI(BU,BN,BM,BP);var BT=BL^!!BW;if(BV&&BW!=null){if(BT){BH=true}else{BP[BM]=false}}else{if(BT){BX.push(BU);BH=true}}}}}if(BW!==c){if(!BV){BP=BX}BS=BS.replace(A7.match[BQ],"");if(!BH){return[]}break}}}if(BS===BJ){if(BH==null){A1.error(BS)}else{break}}BJ=BS}return BP};A1.error=function(BH){throw"Syntax error, unrecognized expression: "+BH};var A7=A1.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(BH){return BH.getAttribute("href")}},relative:{"+":function(BN,BI){var BK=typeof BI==="string",BM=BK&&!/\W/.test(BI),BO=BK&&!BM;if(BM){BI=BI.toLowerCase()}for(var BJ=0,BH=BN.length,BL;BJ<BH;BJ++){if((BL=BN[BJ])){while((BL=BL.previousSibling)&&BL.nodeType!==1){}BN[BJ]=BO||BL&&BL.nodeName.toLowerCase()===BI?BL||false:BL===BI}}if(BO){A1.filter(BI,BN,true)}},">":function(BN,BI){var BL=typeof BI==="string";if(BL&&!/\W/.test(BI)){BI=BI.toLowerCase();for(var BJ=0,BH=BN.length;BJ<BH;BJ++){var BM=BN[BJ];if(BM){var BK=BM.parentNode;BN[BJ]=BK.nodeName.toLowerCase()===BI?BK:false}}}else{for(var BJ=0,BH=BN.length;BJ<BH;BJ++){var BM=BN[BJ];if(BM){BN[BJ]=BL?BM.parentNode:BM.parentNode===BI}}if(BL){A1.filter(BI,BN,true)}}},"":function(BK,BI,BM){var BJ=BB++,BH=BF;if(typeof BI==="string"&&!/\W/.test(BI)){var BL=BI=BI.toLowerCase();BH=Az}BH("parentNode",BI,BJ,BK,BL,BM)},"~":function(BK,BI,BM){var BJ=BB++,BH=BF;if(typeof BI==="string"&&!/\W/.test(BI)){var BL=BI=BI.toLowerCase();BH=Az}BH("previousSibling",BI,BJ,BK,BL,BM)}},find:{ID:function(BI,BJ,BK){if(typeof BJ.getElementById!=="undefined"&&!BK){var BH=BJ.getElementById(BI[1]);return BH?[BH]:[]}},NAME:function(BJ,BM){if(typeof BM.getElementsByName!=="undefined"){var BI=[],BL=BM.getElementsByName(BJ[1]);for(var BK=0,BH=BL.length;BK<BH;BK++){if(BL[BK].getAttribute("name")===BJ[1]){BI.push(BL[BK])}}return BI.length===0?null:BI}},TAG:function(BH,BI){return BI.getElementsByTagName(BH[1])}},preFilter:{CLASS:function(BK,BI,BJ,BH,BN,BO){BK=" "+BK[1].replace(/\\/g,"")+" ";if(BO){return BK}for(var BL=0,BM;(BM=BI[BL])!=null;BL++){if(BM){if(BN^(BM.className&&(" "+BM.className+" ").replace(/[\t\n]/g," ").indexOf(BK)>=0)){if(!BJ){BH.push(BM)}}else{if(BJ){BI[BL]=false}}}}return false},ID:function(BH){return BH[1].replace(/\\/g,"")},TAG:function(BI,BH){return BI[1].toLowerCase()},CHILD:function(BH){if(BH[1]==="nth"){var BI=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(BH[2]==="even"&&"2n"||BH[2]==="odd"&&"2n+1"||!/\D/.test(BH[2])&&"0n+"+BH[2]||BH[2]);BH[2]=(BI[1]+(BI[2]||1))-0;BH[3]=BI[3]-0}BH[0]=BB++;return BH},ATTR:function(BL,BI,BJ,BH,BM,BN){var BK=BL[1].replace(/\\/g,"");if(!BN&&A7.attrMap[BK]){BL[1]=A7.attrMap[BK]}if(BL[2]==="~="){BL[4]=" "+BL[4]+" "}return BL},PSEUDO:function(BL,BI,BJ,BH,BM){if(BL[1]==="not"){if((BA.exec(BL[3])||"").length>1||/^\w/.test(BL[3])){BL[3]=A1(BL[3],null,null,BI)}else{var BK=A1.filter(BL[3],BI,BJ,true^BM);if(!BJ){BH.push.apply(BH,BK)}return false}}else{if(A7.match.POS.test(BL[0])||A7.match.CHILD.test(BL[0])){return true}}return BL},POS:function(BH){BH.unshift(true);return BH}},filters:{enabled:function(BH){return BH.disabled===false&&BH.type!=="hidden"},disabled:function(BH){return BH.disabled===true},checked:function(BH){return BH.checked===true},selected:function(BH){BH.parentNode.selectedIndex;return BH.selected===true},parent:function(BH){return !!BH.firstChild},empty:function(BH){return !BH.firstChild},has:function(BJ,BI,BH){return !!A1(BH[3],BJ).length},header:function(BH){return/h\d/i.test(BH.nodeName)},text:function(BH){return"text"===BH.type},radio:function(BH){return"radio"===BH.type},checkbox:function(BH){return"checkbox"===BH.type},file:function(BH){return"file"===BH.type},password:function(BH){return"password"===BH.type},submit:function(BH){return"submit"===BH.type},image:function(BH){return"image"===BH.type},reset:function(BH){return"reset"===BH.type},button:function(BH){return"button"===BH.type||BH.nodeName.toLowerCase()==="button"},input:function(BH){return/input|select|textarea|button/i.test(BH.nodeName)}},setFilters:{first:function(BI,BH){return BH===0},last:function(BJ,BI,BH,BK){return BI===BK.length-1},even:function(BI,BH){return BH%2===0},odd:function(BI,BH){return BH%2===1},lt:function(BJ,BI,BH){return BI<BH[3]-0},gt:function(BJ,BI,BH){return BI>BH[3]-0},nth:function(BJ,BI,BH){return BH[3]-0===BI},eq:function(BJ,BI,BH){return BH[3]-0===BI}},filter:{PSEUDO:function(BN,BJ,BK,BO){var BI=BJ[1],BL=A7.filters[BI];if(BL){return BL(BN,BK,BJ,BO)}else{if(BI==="contains"){return(BN.textContent||BN.innerText||A0([BN])||"").indexOf(BJ[3])>=0}else{if(BI==="not"){var BM=BJ[3];for(var BK=0,BH=BM.length;BK<BH;BK++){if(BM[BK]===BN){return false}}return true}else{A1.error("Syntax error, unrecognized expression: "+BI)}}}},CHILD:function(BH,BK){var BN=BK[1],BI=BH;switch(BN){case"only":case"first":while((BI=BI.previousSibling)){if(BI.nodeType===1){return false}}if(BN==="first"){return true}BI=BH;case"last":while((BI=BI.nextSibling)){if(BI.nodeType===1){return false}}return true;case"nth":var BJ=BK[2],BQ=BK[3];if(BJ===1&&BQ===0){return true}var BM=BK[0],BP=BH.parentNode;if(BP&&(BP.sizcache!==BM||!BH.nodeIndex)){var BL=0;for(BI=BP.firstChild;BI;BI=BI.nextSibling){if(BI.nodeType===1){BI.nodeIndex=++BL}}BP.sizcache=BM}var BO=BH.nodeIndex-BQ;if(BJ===0){return BO===0}else{return(BO%BJ===0&&BO/BJ>=0)}}},ID:function(BI,BH){return BI.nodeType===1&&BI.getAttribute("id")===BH},TAG:function(BI,BH){return(BH==="*"&&BI.nodeType===1)||BI.nodeName.toLowerCase()===BH},CLASS:function(BI,BH){return(" "+(BI.className||BI.getAttribute("class"))+" ").indexOf(BH)>-1},ATTR:function(BM,BK){var BJ=BK[1],BH=A7.attrHandle[BJ]?A7.attrHandle[BJ](BM):BM[BJ]!=null?BM[BJ]:BM.getAttribute(BJ),BN=BH+"",BL=BK[2],BI=BK[4];return BH==null?BL==="!=":BL==="="?BN===BI:BL==="*="?BN.indexOf(BI)>=0:BL==="~="?(" "+BN+" ").indexOf(BI)>=0:!BI?BN&&BH!==false:BL==="!="?BN!==BI:BL==="^="?BN.indexOf(BI)===0:BL==="$="?BN.substr(BN.length-BI.length)===BI:BL==="|="?BN===BI||BN.substr(0,BI.length+1)===BI+"-":false},POS:function(BL,BI,BJ,BM){var BH=BI[2],BK=A7.setFilters[BH];if(BK){return BK(BL,BJ,BI,BM)}}}};var A6=A7.match.POS;for(var A3 in A7.match){A7.match[A3]=new RegExp(A7.match[A3].source+/(?![^\[]*\])(?![^\(]*\))/.source);A7.leftMatch[A3]=new RegExp(/(^(?:.|\r|\n)*?)/.source+A7.match[A3].source.replace(/\\(\d+)/g,function(BI,BH){return"\\"+(BH-0+1)}))}var A9=function(BI,BH){BI=Array.prototype.slice.call(BI,0);if(BH){BH.push.apply(BH,BI);return BH}return BI};try{Array.prototype.slice.call(AD.documentElement.childNodes,0)[0].nodeType}catch(BG){A9=function(BL,BK){var BI=BK||[];if(BD.call(BL)==="[object Array]"){Array.prototype.push.apply(BI,BL)}else{if(typeof BL.length==="number"){for(var BJ=0,BH=BL.length;BJ<BH;BJ++){BI.push(BL[BJ])}}else{for(var BJ=0;BL[BJ];BJ++){BI.push(BL[BJ])}}}return BI}}var BC;if(AD.documentElement.compareDocumentPosition){BC=function(BI,BH){if(!BI.compareDocumentPosition||!BH.compareDocumentPosition){if(BI==BH){A5=true}return BI.compareDocumentPosition?-1:1}var BJ=BI.compareDocumentPosition(BH)&4?-1:BI===BH?0:1;if(BJ===0){A5=true}return BJ}}else{if("sourceIndex" in AD.documentElement){BC=function(BI,BH){if(!BI.sourceIndex||!BH.sourceIndex){if(BI==BH){A5=true}return BI.sourceIndex?-1:1}var BJ=BI.sourceIndex-BH.sourceIndex;if(BJ===0){A5=true}return BJ}}else{if(AD.createRange){BC=function(BK,BI){if(!BK.ownerDocument||!BI.ownerDocument){if(BK==BI){A5=true}return BK.ownerDocument?-1:1}var BJ=BK.ownerDocument.createRange(),BH=BI.ownerDocument.createRange();BJ.setStart(BK,0);BJ.setEnd(BK,0);BH.setStart(BI,0);BH.setEnd(BI,0);var BL=BJ.compareBoundaryPoints(Range.START_TO_END,BH);if(BL===0){A5=true}return BL}}}}function A0(BH){var BI="",BK;for(var BJ=0;BH[BJ];BJ++){BK=BH[BJ];if(BK.nodeType===3||BK.nodeType===4){BI+=BK.nodeValue}else{if(BK.nodeType!==8){BI+=A0(BK.childNodes)}}}return BI}(function(){var BI=AD.createElement("div"),BJ="script"+(new Date).getTime();BI.innerHTML="<a name='"+BJ+"'/>";var BH=AD.documentElement;BH.insertBefore(BI,BH.firstChild);if(AD.getElementById(BJ)){A7.find.ID=function(BL,BM,BN){if(typeof BM.getElementById!=="undefined"&&!BN){var BK=BM.getElementById(BL[1]);return BK?BK.id===BL[1]||typeof BK.getAttributeNode!=="undefined"&&BK.getAttributeNode("id").nodeValue===BL[1]?[BK]:c:[]}};A7.filter.ID=function(BM,BK){var BL=typeof BM.getAttributeNode!=="undefined"&&BM.getAttributeNode("id");return BM.nodeType===1&&BL&&BL.nodeValue===BK}}BH.removeChild(BI);BH=BI=null})();(function(){var BH=AD.createElement("div");BH.appendChild(AD.createComment(""));if(BH.getElementsByTagName("*").length>0){A7.find.TAG=function(BI,BM){var BL=BM.getElementsByTagName(BI[1]);if(BI[1]==="*"){var BK=[];for(var BJ=0;BL[BJ];BJ++){if(BL[BJ].nodeType===1){BK.push(BL[BJ])}}BL=BK}return BL}}BH.innerHTML="<a href='#'></a>";if(BH.firstChild&&typeof BH.firstChild.getAttribute!=="undefined"&&BH.firstChild.getAttribute("href")!=="#"){A7.attrHandle.href=function(BI){return BI.getAttribute("href",2)}}BH=null})();if(AD.querySelectorAll){(function(){var BH=A1,BJ=AD.createElement("div");BJ.innerHTML="<p class='TEST'></p>";if(BJ.querySelectorAll&&BJ.querySelectorAll(".TEST").length===0){return }A1=function(BN,BM,BK,BL){BM=BM||AD;if(!BL&&BM.nodeType===9&&!A2(BM)){try{return A9(BM.querySelectorAll(BN),BK)}catch(BO){}}return BH(BN,BM,BK,BL)};for(var BI in BH){A1[BI]=BH[BI]}BJ=null})()}(function(){var BH=AD.createElement("div");BH.innerHTML="<div class='test e'></div><div class='test'></div>";if(!BH.getElementsByClassName||BH.getElementsByClassName("e").length===0){return }BH.lastChild.className="e";if(BH.getElementsByClassName("e").length===1){return }A7.order.splice(1,0,"CLASS");A7.find.CLASS=function(BI,BJ,BK){if(typeof BJ.getElementsByClassName!=="undefined"&&!BK){return BJ.getElementsByClassName(BI[1])}};BH=null})();function Az(BI,BN,BM,BQ,BO,BP){for(var BK=0,BJ=BQ.length;BK<BJ;BK++){var BH=BQ[BK];if(BH){BH=BH[BI];var BL=false;while(BH){if(BH.sizcache===BM){BL=BQ[BH.sizset];break}if(BH.nodeType===1&&!BP){BH.sizcache=BM;BH.sizset=BK}if(BH.nodeName.toLowerCase()===BN){BL=BH;break}BH=BH[BI]}BQ[BK]=BL}}}function BF(BI,BN,BM,BQ,BO,BP){for(var BK=0,BJ=BQ.length;BK<BJ;BK++){var BH=BQ[BK];if(BH){BH=BH[BI];var BL=false;while(BH){if(BH.sizcache===BM){BL=BQ[BH.sizset];break}if(BH.nodeType===1){if(!BP){BH.sizcache=BM;BH.sizset=BK}if(typeof BN!=="string"){if(BH===BN){BL=true;break}}else{if(A1.filter(BN,[BH]).length>0){BL=BH;break}}}BH=BH[BI]}BQ[BK]=BL}}}var A8=AD.compareDocumentPosition?function(BI,BH){return !!(BI.compareDocumentPosition(BH)&16)}:function(BI,BH){return BI!==BH&&(BI.contains?BI.contains(BH):true)};var A2=function(BH){var BI=(BH?BH.ownerDocument||BH:0).documentElement;return BI?BI.nodeName!=="HTML":false};var BE=function(BH,BO){var BK=[],BL="",BM,BJ=BO.nodeType?[BO]:BO;while((BM=A7.match.PSEUDO.exec(BH))){BL+=BM[0];BH=BH.replace(A7.match.PSEUDO,"")}BH=A7.relative[BH]?BH+"*":BH;for(var BN=0,BI=BJ.length;BN<BI;BN++){A1(BH,BJ[BN],BK)}return A1.filter(BL,BK)};A.find=A1;A.expr=A1.selectors;A.expr[":"]=A.expr.filters;A.unique=A1.uniqueSort;A.text=A0;A.isXMLDoc=A2;A.contains=A8;return ;An.Sizzle=A1})();var p=/Until$/,AA=/^(?:parents|prevUntil|prevAll)/,Am=/,/,g=Array.prototype.slice;var AK=function(A2,A1,Az){if(A.isFunction(A1)){return A.grep(A2,function(A4,A3){return !!A1.call(A4,A3,A4)===Az})}else{if(A1.nodeType){return A.grep(A2,function(A4,A3){return(A4===A1)===Az})}else{if(typeof A1==="string"){var A0=A.grep(A2,function(A3){return A3.nodeType===1});if(Ax.test(A1)){return A.filter(A1,A0,!Az)}else{A1=A.filter(A1,A0)}}}}return A.grep(A2,function(A4,A3){return(A.inArray(A4,A1)>=0)===Az})};A.fn.extend({find:function(Az){var A1=this.pushStack("","find",Az),A4=0;for(var A2=0,A0=this.length;A2<A0;A2++){A4=A1.length;A.find(Az,this[A2],A1);if(A2>0){for(var A5=A4;A5<A1.length;A5++){for(var A3=0;A3<A4;A3++){if(A1[A3]===A1[A5]){A1.splice(A5--,1);break}}}}}return A1},has:function(A0){var Az=A(A0);return this.filter(function(){for(var A2=0,A1=Az.length;A2<A1;A2++){if(A.contains(this,Az[A2])){return true}}})},not:function(Az){return this.pushStack(AK(this,Az,false),"not",Az)},filter:function(Az){return this.pushStack(AK(this,Az,true),"filter",Az)},is:function(Az){return !!Az&&A.filter(Az,this).length>0},closest:function(A8,Az){if(A.isArray(A8)){var A5=[],A7=this[0],A4,A3={},A1;if(A7&&A8.length){for(var A2=0,A0=A8.length;A2<A0;A2++){A1=A8[A2];if(!A3[A1]){A3[A1]=A.expr.match.POS.test(A1)?A(A1,Az||this.context):A1}}while(A7&&A7.ownerDocument&&A7!==Az){for(A1 in A3){A4=A3[A1];if(A4.jquery?A4.index(A7)>-1:A(A7).is(A4)){A5.push({selector:A1,elem:A7});delete A3[A1]}}A7=A7.parentNode}}return A5}var A6=A.expr.match.POS.test(A8)?A(A8,Az||this.context):null;return this.map(function(A9,BA){while(BA&&BA.ownerDocument&&BA!==Az){if(A6?A6.index(BA)>-1:A(BA).is(A8)){return BA}BA=BA.parentNode}return null})},index:function(Az){if(!Az||typeof Az==="string"){return A.inArray(this[0],Az?A(Az):this.parent().children())}return A.inArray(Az.jquery?Az[0]:Az,this)},add:function(Az,A0){var A2=typeof Az==="string"?A(Az,A0||this.context):A.makeArray(Az),A1=A.merge(this.get(),A2);return this.pushStack(Y(A2[0])||Y(A1[0])?A1:A.unique(A1))},andSelf:function(){return this.add(this.prevObject)}});function Y(Az){return !Az||!Az.parentNode||Az.parentNode.nodeType===11}A.each({parent:function(A0){var Az=A0.parentNode;return Az&&Az.nodeType!==11?Az:null},parents:function(Az){return A.dir(Az,"parentNode")},parentsUntil:function(A0,Az,A1){return A.dir(A0,"parentNode",A1)},next:function(Az){return A.nth(Az,2,"nextSibling")},prev:function(Az){return A.nth(Az,2,"previousSibling")},nextAll:function(Az){return A.dir(Az,"nextSibling")},prevAll:function(Az){return A.dir(Az,"previousSibling")},nextUntil:function(A0,Az,A1){return A.dir(A0,"nextSibling",A1)},prevUntil:function(A0,Az,A1){return A.dir(A0,"previousSibling",A1)},siblings:function(Az){return A.sibling(Az.parentNode.firstChild,Az)},children:function(Az){return A.sibling(Az.firstChild)},contents:function(Az){return A.nodeName(Az,"iframe")?Az.contentDocument||Az.contentWindow.document:A.makeArray(Az.childNodes)}},function(Az,A0){A.fn[Az]=function(A3,A1){var A2=A.map(this,A0,A3);if(!p.test(Az)){A1=A3}if(A1&&typeof A1==="string"){A2=A.filter(A1,A2)}A2=this.length>1?A.unique(A2):A2;if((this.length>1||Am.test(A1))&&AA.test(Az)){A2=A2.reverse()}return this.pushStack(A2,Az,g.call(arguments).join(","))}});A.extend({filter:function(A1,Az,A0){if(A0){A1=":not("+A1+")"}return A.find.matches(A1,Az)},dir:function(A1,A0,A3){var Az=[],A2=A1[A0];while(A2&&A2.nodeType!==9&&(A3===c||A2.nodeType!==1||!A(A2).is(A3))){if(A2.nodeType===1){Az.push(A2)}A2=A2[A0]}return Az},nth:function(A3,Az,A1,A2){Az=Az||1;var A0=0;for(;A3;A3=A3[A1]){if(A3.nodeType===1&&++A0===Az){break}}return A3},sibling:function(A1,A0){var Az=[];for(;A1;A1=A1.nextSibling){if(A1.nodeType===1&&A1!==A0){Az.push(A1)}}return Az}});var v=/ jQuery\d+="(?:\d+|null)"/g,AB=/^\s+/,j=/(<([\w:]+)[^>]*?)\/>/g,AN=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,C=/<([\w:]+)/,T=/<tbody/i,n=/<|&#?\w+;/,f=/<script|<object|<embed|<option|<style/i,L=/checked\s*(?:[^=]|=\s*.checked.)/i,P=function(A0,A1,Az){return AN.test(Az)?A0:A1+"></"+Az+">"},AE={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,"",""]};AE.optgroup=AE.option;AE.tbody=AE.tfoot=AE.colgroup=AE.caption=AE.thead;AE.th=AE.td;if(!A.support.htmlSerialize){AE._default=[1,"div<div>","</div>"]}A.fn.extend({text:function(Az){if(A.isFunction(Az)){return this.each(function(A1){var A0=A(this);A0.text(Az.call(this,A1,A0.text()))})}if(typeof Az!=="object"&&Az!==c){return this.empty().append((this[0]&&this[0].ownerDocument||AD).createTextNode(Az))}return A.text(this)},wrapAll:function(Az){if(A.isFunction(Az)){return this.each(function(A1){A(this).wrapAll(Az.call(this,A1))})}if(this[0]){var A0=A(Az,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){A0.insertBefore(this[0])}A0.map(function(){var A1=this;while(A1.firstChild&&A1.firstChild.nodeType===1){A1=A1.firstChild}return A1}).append(this)}return this},wrapInner:function(Az){if(A.isFunction(Az)){return this.each(function(A0){A(this).wrapInner(Az.call(this,A0))})}return this.each(function(){var A0=A(this),A1=A0.contents();if(A1.length){A1.wrapAll(Az)}else{A0.append(Az)}})},wrap:function(Az){return this.each(function(){A(this).wrapAll(Az)})},unwrap:function(){return this.parent().each(function(){if(!A.nodeName(this,"body")){A(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(Az){if(this.nodeType===1){this.appendChild(Az)}})},prepend:function(){return this.domManip(arguments,true,function(Az){if(this.nodeType===1){this.insertBefore(Az,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(A0){this.parentNode.insertBefore(A0,this)})}else{if(arguments.length){var Az=A(arguments[0]);Az.push.apply(Az,this.toArray());return this.pushStack(Az,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(A0){this.parentNode.insertBefore(A0,this.nextSibling)})}else{if(arguments.length){var Az=this.pushStack(this,"after",arguments);Az.push.apply(Az,A(arguments[0]).toArray());return Az}}},remove:function(Az,A2){for(var A0=0,A1;(A1=this[A0])!=null;A0++){if(!Az||A.filter(Az,[A1]).length){if(!A2&&A1.nodeType===1){A.cleanData(A1.getElementsByTagName("*"));A.cleanData([A1])}if(A1.parentNode){A1.parentNode.removeChild(A1)}}}return this},empty:function(){for(var Az=0,A0;(A0=this[Az])!=null;Az++){if(A0.nodeType===1){A.cleanData(A0.getElementsByTagName("*"))}while(A0.firstChild){A0.removeChild(A0.firstChild)}}return this},clone:function(A0){var Az=this.map(function(){if(!A.support.noCloneEvent&&!A.isXMLDoc(this)){var A2=this.outerHTML,A1=this.ownerDocument;if(!A2){var A3=A1.createElement("div");A3.appendChild(this.cloneNode(true));A2=A3.innerHTML}return A.clean([A2.replace(v,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(AB,"")],A1)[0]}else{return this.cloneNode(true)}});if(A0===true){Q(this,Az);Q(this.find("*"),Az.find("*"))}return Az},html:function(A1){if(A1===c){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(v,""):null}else{if(typeof A1==="string"&&!f.test(A1)&&(A.support.leadingWhitespace||!AB.test(A1))&&!AE[(C.exec(A1)||["",""])[1].toLowerCase()]){A1=A1.replace(j,P);try{for(var A0=0,Az=this.length;A0<Az;A0++){if(this[A0].nodeType===1){A.cleanData(this[A0].getElementsByTagName("*"));this[A0].innerHTML=A1}}}catch(A2){this.empty().append(A1)}}else{if(A.isFunction(A1)){this.each(function(A5){var A4=A(this),A3=A4.html();A4.empty().append(function(){return A1.call(this,A5,A3)})})}else{this.empty().append(A1)}}}return this},replaceWith:function(Az){if(this[0]&&this[0].parentNode){if(A.isFunction(Az)){return this.each(function(A2){var A1=A(this),A0=A1.html();A1.replaceWith(Az.call(this,A2,A0))})}if(typeof Az!=="string"){Az=A(Az).detach()}return this.each(function(){var A1=this.nextSibling,A0=this.parentNode;A(this).remove();if(A1){A(A1).before(Az)}else{A(A0).append(Az)}})}else{return this.pushStack(A(A.isFunction(Az)?Az():Az),"replaceWith",Az)}},detach:function(Az){return this.remove(Az,true)},domManip:function(A5,BA,A9){var A2,A3,A8=A5[0],A0=[],A4,A7;if(!A.support.checkClone&&arguments.length===3&&typeof A8==="string"&&L.test(A8)){return this.each(function(){A(this).domManip(A5,BA,A9,true)})}if(A.isFunction(A8)){return this.each(function(BC){var BB=A(this);A5[0]=A8.call(this,BC,BA?BB.html():c);BB.domManip(A5,BA,A9)})}if(this[0]){A7=A8&&A8.parentNode;if(A.support.parentNode&&A7&&A7.nodeType===11&&A7.childNodes.length===this.length){A2={fragment:A7}}else{A2=l(A5,this,A0)}A4=A2.fragment;if(A4.childNodes.length===1){A3=A4=A4.firstChild}else{A3=A4.firstChild}if(A3){BA=BA&&A.nodeName(A3,"tr");for(var A1=0,Az=this.length;A1<Az;A1++){A9.call(BA?A6(this[A1],A3):this[A1],A1>0||A2.cacheable||this.length>1?A4.cloneNode(true):A4)}}if(A0.length){A.each(A0,Aw)}}return this;function A6(BB,BC){return A.nodeName(BB,"table")?(BB.getElementsByTagName("tbody")[0]||BB.appendChild(BB.ownerDocument.createElement("tbody"))):BB}}});function Q(A1,Az){var A0=0;Az.each(function(){if(this.nodeName!==(A1[A0]&&A1[A0].nodeName)){return }var A6=A.data(A1[A0++]),A5=A.data(this,A6),A2=A6&&A6.events;if(A2){delete A5.handle;A5.events={};for(var A4 in A2){for(var A3 in A2[A4]){A.event.add(this,A4,A2[A4][A3],A2[A4][A3].data)}}}})}function l(A4,A2,A0){var A3,Az,A1,A5=(A2&&A2[0]?A2[0].ownerDocument||A2[0]:AD);if(A4.length===1&&typeof A4[0]==="string"&&A4[0].length<512&&A5===AD&&!f.test(A4[0])&&(A.support.checkClone||!L.test(A4[0]))){Az=true;A1=A.fragments[A4[0]];if(A1){if(A1!==1){A3=A1}}}if(!A3){A3=A5.createDocumentFragment();A.clean(A4,A5,A3,A0)}if(Az){A.fragments[A4[0]]=A1?A3:1}return{fragment:A3,cacheable:Az}}A.fragments={};A.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(Az,A0){A.fn[Az]=function(A1){var A4=[],A7=A(A1),A6=this.length===1&&this[0].parentNode;if(A6&&A6.nodeType===11&&A6.childNodes.length===1&&A7.length===1){A7[A0](this[0]);return this}else{for(var A5=0,A2=A7.length;A5<A2;A5++){var A3=(A5>0?this.clone(true):this).get();A.fn[A0].apply(A(A7[A5]),A3);A4=A4.concat(A3)}return this.pushStack(A4,Az,A7.selector)}}});A.extend({clean:function(A1,A3,BA,A5){A3=A3||AD;if(typeof A3.createElement==="undefined"){A3=A3.ownerDocument||A3[0]&&A3[0].ownerDocument||AD}var BB=[];for(var A9=0,A4;(A4=A1[A9])!=null;A9++){if(typeof A4==="number"){A4+=""}if(!A4){continue}if(typeof A4==="string"&&!n.test(A4)){A4=A3.createTextNode(A4)}else{if(typeof A4==="string"){A4=A4.replace(j,P);var BC=(C.exec(A4)||["",""])[1].toLowerCase(),A2=AE[BC]||AE._default,A8=A2[0],A0=A3.createElement("div");A0.innerHTML=A2[1]+A4+A2[2];while(A8--){A0=A0.lastChild}if(!A.support.tbody){var Az=T.test(A4),A7=BC==="table"&&!Az?A0.firstChild&&A0.firstChild.childNodes:A2[1]==="<table>"&&!Az?A0.childNodes:[];for(var A6=A7.length-1;A6>=0;--A6){if(A.nodeName(A7[A6],"tbody")&&!A7[A6].childNodes.length){A7[A6].parentNode.removeChild(A7[A6])}}}if(!A.support.leadingWhitespace&&AB.test(A4)){A0.insertBefore(A3.createTextNode(AB.exec(A4)[0]),A0.firstChild)}A4=A0.childNodes}}if(A4.nodeType){BB.push(A4)}else{BB=A.merge(BB,A4)}}if(BA){for(var A9=0;BB[A9];A9++){if(A5&&A.nodeName(BB[A9],"script")&&(!BB[A9].type||BB[A9].type.toLowerCase()==="text/javascript")){A5.push(BB[A9].parentNode?BB[A9].parentNode.removeChild(BB[A9]):BB[A9])}else{if(BB[A9].nodeType===1){BB.splice.apply(BB,[A9+1,0].concat(A.makeArray(BB[A9].getElementsByTagName("script"))))}BA.appendChild(BB[A9])}}}return BB},cleanData:function(A0){var A3,A1,Az=A.cache,A6=A.event.special,A5=A.support.deleteExpando;for(var A4=0,A2;(A2=A0[A4])!=null;A4++){A1=A2[A.expando];if(A1){A3=Az[A1];if(A3.events){for(var A7 in A3.events){if(A6[A7]){A.event.remove(A2,A7)}else{AI(A2,A7,A3.handle)}}}if(A5){delete A2[A.expando]}else{if(A2.removeAttribute){A2.removeAttribute(A.expando)}}delete Az[A1]}}}});var AT=/z-?index|font-?weight|opacity|zoom|line-?height/i,w=/alpha\([^)]*\)/,AC=/opacity=([^)]*)/,AJ=/float/i,Aa=/-([a-z])/ig,V=/([A-Z])/g,Ap=/^-?\d+(?:px)?$/i,Av=/^-?\d/,Al={position:"absolute",visibility:"hidden",display:"block"},y=["Left","Right"],Af=["Top","Bottom"],AM=AD.defaultView&&AD.defaultView.getComputedStyle,Ao=A.support.cssFloat?"cssFloat":"styleFloat",K=function(Az,A0){return A0.toUpperCase()};A.fn.css=function(Az,A0){return AP(this,Az,A0,true,function(A2,A1,A3){if(A3===c){return A.curCSS(A2,A1)}if(typeof A3==="number"&&!AT.test(A1)){A3+="px"}A.style(A2,A1,A3)})};A.extend({style:function(A3,A0,A4){if(!A3||A3.nodeType===3||A3.nodeType===8){return c}if((A0==="width"||A0==="height")&&parseFloat(A4)<0){A4=c}var A2=A3.style||A3,A5=A4!==c;if(!A.support.opacity&&A0==="opacity"){if(A5){A2.zoom=1;var Az=parseInt(A4,10)+""==="NaN"?"":"alpha(opacity="+A4*100+")";var A1=A2.filter||A.curCSS(A3,"filter")||"";A2.filter=w.test(A1)?A1.replace(w,Az):Az}return A2.filter&&A2.filter.indexOf("opacity=")>=0?(parseFloat(AC.exec(A2.filter)[1])/100)+"":""}if(AJ.test(A0)){A0=Ao}A0=A0.replace(Aa,K);if(A5){A2[A0]=A4}return A2[A0]},css:function(A2,A0,A4,Az){if(A0==="width"||A0==="height"){var A6,A1=Al,A5=A0==="width"?y:Af;function A3(){A6=A0==="width"?A2.offsetWidth:A2.offsetHeight;if(Az==="border"){return }A.each(A5,function(){if(!Az){A6-=parseFloat(A.curCSS(A2,"padding"+this,true))||0}if(Az==="margin"){A6+=parseFloat(A.curCSS(A2,"margin"+this,true))||0}else{A6-=parseFloat(A.curCSS(A2,"border"+this+"Width",true))||0}})}if(A2.offsetWidth!==0){A3()}else{A.swap(A2,A1,A3)}return Math.max(0,Math.round(A6))}return A.curCSS(A2,A0,A4)},curCSS:function(A5,A0,A1){var A8,Az=A5.style,A2;if(!A.support.opacity&&A0==="opacity"&&A5.currentStyle){A8=AC.test(A5.currentStyle.filter||"")?(parseFloat(RegExp.$1)/100)+"":"";return A8===""?"1":A8}if(AJ.test(A0)){A0=Ao}if(!A1&&Az&&Az[A0]){A8=Az[A0]}else{if(AM){if(AJ.test(A0)){A0="float"}A0=A0.replace(V,"-$1").toLowerCase();var A7=A5.ownerDocument.defaultView;if(!A7){return null}var A9=A7.getComputedStyle(A5,null);if(A9){A8=A9.getPropertyValue(A0)}if(A0==="opacity"&&A8===""){A8="1"}}else{if(A5.currentStyle){var A4=A0.replace(Aa,K);A8=A5.currentStyle[A0]||A5.currentStyle[A4];if(!Ap.test(A8)&&Av.test(A8)){var A3=Az.left,A6=A5.runtimeStyle.left;A5.runtimeStyle.left=A5.currentStyle.left;Az.left=A4==="fontSize"?"1em":(A8||0);A8=Az.pixelLeft+"px";Az.left=A3;A5.runtimeStyle.left=A6}}}}return A8},swap:function(A2,A1,A3){var Az={};for(var A0 in A1){Az[A0]=A2.style[A0];A2.style[A0]=A1[A0]}A3.call(A2);for(var A0 in A1){A2.style[A0]=Az[A0]}}});if(A.expr&&A.expr.filters){A.expr.filters.hidden=function(A2){var A0=A2.offsetWidth,Az=A2.offsetHeight,A1=A2.nodeName.toLowerCase()==="tr";return A0===0&&Az===0&&!A1?true:A0>0&&Az>0&&!A1?false:A.curCSS(A2,"display")==="none"};A.expr.filters.visible=function(Az){return !A.expr.filters.hidden(Az)}}var AH=Aq(),Ak=/<script(.|\s)*?\/script>/gi,O=/select|textarea/i,Ac=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,R=/=\?(&|$)/,d=/\?/,Ay=/(\?|&)_=.*?(&|$)/,b=/^(\w+:)?\/\/([^\/?#]+)/,H=/%20/g,W=A.fn.load;A.fn.extend({load:function(A1,A4,A5){if(typeof A1!=="string"){return W.call(this,A1)}else{if(!this.length){return this}}var A3=A1.indexOf(" ");if(A3>=0){var Az=A1.slice(A3,A1.length);A1=A1.slice(0,A3)}var A2="GET";if(A4){if(A.isFunction(A4)){A5=A4;A4=null}else{if(typeof A4==="object"){A4=A.param(A4,A.ajaxSettings.traditional);A2="POST"}}}var A0=this;A.ajax({url:A1,type:A2,dataType:"html",data:A4,complete:function(A7,A6){if(A6==="success"||A6==="notmodified"){A0.html(Az?A("<div />").append(A7.responseText.replace(Ak,"")).find(Az):A7.responseText)}if(A5){A0.each(A5,[A7.responseText,A6,A7])}}});return this},serialize:function(){return A.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?A.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||O.test(this.nodeName)||Ac.test(this.type))}).map(function(Az,A0){var A1=A(this).val();return A1==null?null:A.isArray(A1)?A.map(A1,function(A3,A2){return{name:A0.name,value:A3}}):{name:A0.name,value:A1}}).get()}});A.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(Az,A0){A.fn[A0]=function(A1){return this.bind(A0,A1)}});A.extend({get:function(Az,A1,A2,A0){if(A.isFunction(A1)){A0=A0||A2;A2=A1;A1=null}return A.ajax({type:"GET",url:Az,data:A1,success:A2,dataType:A0})},getScript:function(Az,A0){return A.get(Az,null,A0,"script")},getJSON:function(Az,A0,A1){return A.get(Az,A0,A1,"json")},post:function(Az,A1,A2,A0){if(A.isFunction(A1)){A0=A0||A2;A2=A1;A1={}}return A.ajax({type:"POST",url:Az,data:A1,success:A2,dataType:A0})},ajaxSetup:function(Az){A.extend(A.ajaxSettings,Az)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:An.XMLHttpRequest&&(An.location.protocol!=="file:"||!An.ActiveXObject)?function(){return new An.XMLHttpRequest()}:function(){try{return new An.ActiveXObject("Microsoft.XMLHTTP")}catch(Az){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(BE){var A9=A.extend(true,{},A.ajaxSettings,BE);var BJ,BD,BI,BK=BE&&BE.context||A9,A1=A9.type.toUpperCase();if(A9.data&&A9.processData&&typeof A9.data!=="string"){A9.data=A.param(A9.data,A9.traditional)}if(A9.dataType==="jsonp"){if(A1==="GET"){if(!R.test(A9.url)){A9.url+=(d.test(A9.url)?"&":"?")+(A9.jsonp||"callback")+"=?"}}else{if(!A9.data||!R.test(A9.data)){A9.data=(A9.data?A9.data+"&":"")+(A9.jsonp||"callback")+"=?"}}A9.dataType="json"}if(A9.dataType==="json"&&(A9.data&&R.test(A9.data)||R.test(A9.url))){BJ=A9.jsonpCallback||("jsonp"+AH++);if(A9.data){A9.data=(A9.data+"").replace(R,"="+BJ+"$1")}A9.url=A9.url.replace(R,"="+BJ+"$1");A9.dataType="script";An[BJ]=An[BJ]||function(BL){BI=BL;A4();A7();An[BJ]=c;try{delete An[BJ]}catch(BM){}if(A2){A2.removeChild(BG)}}}if(A9.dataType==="script"&&A9.cache===null){A9.cache=false}if(A9.cache===false&&A1==="GET"){var Az=Aq();var BH=A9.url.replace(Ay,"$1_="+Az+"$2");A9.url=BH+((BH===A9.url)?(d.test(A9.url)?"&":"?")+"_="+Az:"")}if(A9.data&&A1==="GET"){A9.url+=(d.test(A9.url)?"&":"?")+A9.data}if(A9.global&&!A.active++){A.event.trigger("ajaxStart")}var BC=b.exec(A9.url),A3=BC&&(BC[1]&&BC[1]!==location.protocol||BC[2]!==location.host);if(A9.dataType==="script"&&A1==="GET"&&A3){var A2=AD.getElementsByTagName("head")[0]||AD.documentElement;var BG=AD.createElement("script");BG.src=A9.url;if(A9.scriptCharset){BG.charset=A9.scriptCharset}if(!BJ){var BB=false;BG.onload=BG.onreadystatechange=function(){if(!BB&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){BB=true;A4();A7();BG.onload=BG.onreadystatechange=null;if(A2&&BG.parentNode){A2.removeChild(BG)}}}}A2.insertBefore(BG,A2.firstChild);return c}var A6=false;var A5=A9.xhr();if(!A5){return }if(A9.username){A5.open(A1,A9.url,A9.async,A9.username,A9.password)}else{A5.open(A1,A9.url,A9.async)}try{if(A9.data||BE&&BE.contentType){A5.setRequestHeader("Content-Type",A9.contentType)}if(A9.ifModified){if(A.lastModified[A9.url]){A5.setRequestHeader("If-Modified-Since",A.lastModified[A9.url])}if(A.etag[A9.url]){A5.setRequestHeader("If-None-Match",A.etag[A9.url])}}if(!A3){A5.setRequestHeader("X-Requested-With","XMLHttpRequest")}A5.setRequestHeader("Accept",A9.dataType&&A9.accepts[A9.dataType]?A9.accepts[A9.dataType]+", */*":A9.accepts._default)}catch(BF){}if(A9.beforeSend&&A9.beforeSend.call(BK,A5,A9)===false){if(A9.global&&!--A.active){A.event.trigger("ajaxStop")}A5.abort();return false}if(A9.global){BA("ajaxSend",[A5,A9])}var A8=A5.onreadystatechange=function(BL){if(!A5||A5.readyState===0||BL==="abort"){if(!A6){A7()}A6=true;if(A5){A5.onreadystatechange=A.noop}}else{if(!A6&&A5&&(A5.readyState===4||BL==="timeout")){A6=true;A5.onreadystatechange=A.noop;BD=BL==="timeout"?"timeout":!A.httpSuccess(A5)?"error":A9.ifModified&&A.httpNotModified(A5,A9.url)?"notmodified":"success";var BN;if(BD==="success"){try{BI=A.httpData(A5,A9.dataType,A9)}catch(BM){BD="parsererror";BN=BM}}if(BD==="success"||BD==="notmodified"){if(!BJ){A4()}}else{A.handleError(A9,A5,BD,BN)}A7();if(BL==="timeout"){A5.abort()}if(A9.async){A5=null}}}};try{var A0=A5.abort;A5.abort=function(){if(A5){A0.call(A5)}A8("abort")}}catch(BF){}if(A9.async&&A9.timeout>0){setTimeout(function(){if(A5&&!A6){A8("timeout")}},A9.timeout)}try{A5.send(A1==="POST"||A1==="PUT"||A1==="DELETE"?A9.data:null)}catch(BF){A.handleError(A9,A5,null,BF);A7()}if(!A9.async){A8()}function A4(){if(A9.success){A9.success.call(BK,BI,BD,A5)}if(A9.global){BA("ajaxSuccess",[A5,A9])}}function A7(){if(A9.complete){A9.complete.call(BK,A5,BD)}if(A9.global){BA("ajaxComplete",[A5,A9])}if(A9.global&&!--A.active){A.event.trigger("ajaxStop")}}function BA(BM,BL){(A9.context?A(A9.context):A.event).trigger(BM,BL)}return A5},handleError:function(A0,A2,Az,A1){if(A0.error){A0.error.call(A0.context||A0,A2,Az,A1)}if(A0.global){(A0.context?A(A0.context):A.event).trigger("ajaxError",[A2,A0,A1])}},active:0,httpSuccess:function(A0){try{return !A0.status&&location.protocol==="file:"||(A0.status>=200&&A0.status<300)||A0.status===304||A0.status===1223||A0.status===0}catch(Az){}return false},httpNotModified:function(A2,Az){var A1=A2.getResponseHeader("Last-Modified"),A0=A2.getResponseHeader("Etag");if(A1){A.lastModified[Az]=A1}if(A0){A.etag[Az]=A0}return A2.status===304||A2.status===0},httpData:function(A4,A2,A1){var A0=A4.getResponseHeader("content-type")||"",Az=A2==="xml"||!A2&&A0.indexOf("xml")>=0,A3=Az?A4.responseXML:A4.responseText;if(Az&&A3.documentElement.nodeName==="parsererror"){A.error("parsererror")}if(A1&&A1.dataFilter){A3=A1.dataFilter(A3,A2)}if(typeof A3==="string"){if(A2==="json"||!A2&&A0.indexOf("json")>=0){A3=A.parseJSON(A3)}else{if(A2==="script"||!A2&&A0.indexOf("javascript")>=0){A.globalEval(A3)}}}return A3},param:function(Az,A2){var A0=[];if(A2===c){A2=A.ajaxSettings.traditional}if(A.isArray(Az)||Az.jquery){A.each(Az,function(){A4(this.name,this.value)})}else{for(var A3 in Az){A1(A3,Az[A3])}}return A0.join("&").replace(H,"+");function A1(A5,A6){if(A.isArray(A6)){A.each(A6,function(A8,A7){if(A2||/\[\]$/.test(A5)){A4(A5,A7)}else{A1(A5+"["+(typeof A7==="object"||A.isArray(A7)?A8:"")+"]",A7)}})}else{if(!A2&&A6!=null&&typeof A6==="object"){A.each(A6,function(A8,A7){A1(A5+"["+A8+"]",A7)})}else{A4(A5,A6)}}}function A4(A5,A6){A6=A.isFunction(A6)?A6():A6;A0[A0.length]=encodeURIComponent(A5)+"="+encodeURIComponent(A6)}}});var h={},AG=/toggle|show|hide/,AV=/^([+-]=)?([\d+-.]+)(.*)$/,Ag,AL=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];A.fn.extend({show:function(A0,A8){if(A0||A0===0){return this.animate(Ae("show",3),A0,A8)}else{for(var A5=0,A2=this.length;A5<A2;A5++){var Az=A.data(this[A5],"olddisplay");this[A5].style.display=Az||"";if(A.css(this[A5],"display")==="none"){var A7=this[A5].nodeName,A6;if(h[A7]){A6=h[A7]}else{var A1=A("<"+A7+" />").appendTo("body");A6=A1.css("display");if(A6==="none"){A6="block"}A1.remove();h[A7]=A6}A.data(this[A5],"olddisplay",A6)}}for(var A4=0,A3=this.length;A4<A3;A4++){this[A4].style.display=A.data(this[A4],"olddisplay")||""}return this}},hide:function(A4,A5){if(A4||A4===0){return this.animate(Ae("hide",3),A4,A5)}else{for(var A3=0,A0=this.length;A3<A0;A3++){var Az=A.data(this[A3],"olddisplay");if(!Az&&Az!=="none"){A.data(this[A3],"olddisplay",A.css(this[A3],"display"))}}for(var A2=0,A1=this.length;A2<A1;A2++){this[A2].style.display="none"}return this}},_toggle:A.fn.toggle,toggle:function(A1,A0){var Az=typeof A1==="boolean";if(A.isFunction(A1)&&A.isFunction(A0)){this._toggle.apply(this,arguments)}else{if(A1==null||Az){this.each(function(){var A2=Az?A1:A(this).is(":hidden");A(this)[A2?"show":"hide"]()})}else{this.animate(Ae("toggle",3),A1,A0)}}return this},fadeTo:function(Az,A1,A0){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:A1},Az,A0)},animate:function(A3,A0,A2,A1){var Az=A.speed(A0,A2,A1);if(A.isEmptyObject(A3)){return this.each(Az.complete)}return this[Az.queue===false?"each":"queue"](function(){var A6=A.extend({},Az),A8,A7=this.nodeType===1&&A(this).is(":hidden"),A4=this;for(A8 in A3){var A5=A8.replace(Aa,K);if(A8!==A5){A3[A5]=A3[A8];delete A3[A8];A8=A5}if(A3[A8]==="hide"&&A7||A3[A8]==="show"&&!A7){return A6.complete.call(this)}if((A8==="height"||A8==="width")&&this.style){A6.display=A.css(this,"display");A6.overflow=this.style.overflow}if(A.isArray(A3[A8])){(A6.specialEasing=A6.specialEasing||{})[A8]=A3[A8][1];A3[A8]=A3[A8][0]}}if(A6.overflow!=null){this.style.overflow="hidden"}A6.curAnim=A.extend({},A3);A.each(A3,function(BA,BE){var BD=new A.fx(A4,A6,BA);if(AG.test(BE)){BD[BE==="toggle"?A7?"show":"hide":BE](A3)}else{var BC=AV.exec(BE),BF=BD.cur(true)||0;if(BC){var A9=parseFloat(BC[2]),BB=BC[3]||"px";if(BB!=="px"){A4.style[BA]=(A9||1)+BB;BF=((A9||1)/BD.cur(true))*BF;A4.style[BA]=BF+BB}if(BC[1]){A9=((BC[1]==="-="?-1:1)*A9)+BF}BD.custom(BF,A9,BB)}else{BD.custom(BF,BE,"")}}});return true})},stop:function(A0,Az){var A1=A.timers;if(A0){this.queue([])}this.each(function(){for(var A2=A1.length-1;A2>=0;A2--){if(A1[A2].elem===this){if(Az){A1[A2](true)}A1.splice(A2,1)}}});if(!Az){this.dequeue()}return this}});A.each({slideDown:Ae("show",1),slideUp:Ae("hide",1),slideToggle:Ae("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(Az,A0){A.fn[Az]=function(A1,A2){return this.animate(A0,A1,A2)}});A.extend({speed:function(A1,A2,A0){var Az=A1&&typeof A1==="object"?A1:{complete:A0||!A0&&A2||A.isFunction(A1)&&A1,duration:A1,easing:A0&&A2||A2&&!A.isFunction(A2)&&A2};Az.duration=A.fx.off?0:typeof Az.duration==="number"?Az.duration:A.fx.speeds[Az.duration]||A.fx.speeds._default;Az.old=Az.complete;Az.complete=function(){if(Az.queue!==false){A(this).dequeue()}if(A.isFunction(Az.old)){Az.old.call(this)}};return Az},easing:{linear:function(A1,A2,Az,A0){return Az+A0*A1},swing:function(A1,A2,Az,A0){return((-Math.cos(A1*Math.PI)/2)+0.5)*A0+Az}},timers:[],fx:function(A0,Az,A1){this.options=Az;this.elem=A0;this.prop=A1;if(!Az.orig){Az.orig={}}}});A.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(A.fx.step[this.prop]||A.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(A0){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var Az=parseFloat(A.css(this.elem,this.prop,A0));return Az&&Az>-10000?Az:parseFloat(A.curCSS(this.elem,this.prop))||0},custom:function(A3,A2,A1){this.startTime=Aq();this.start=A3;this.end=A2;this.unit=A1||this.unit||"px";this.now=this.start;this.pos=this.state=0;var Az=this;function A0(A4){return Az.step(A4)}A0.elem=this.elem;if(A0()&&A.timers.push(A0)&&!Ag){Ag=setInterval(A.fx.tick,13)}},show:function(){this.options.orig[this.prop]=A.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());A(this.elem).show()},hide:function(){this.options.orig[this.prop]=A.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(A2){var A7=Aq(),A3=true;if(A2||A7>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var A4 in this.options.curAnim){if(this.options.curAnim[A4]!==true){A3=false}}if(A3){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;var A1=A.data(this.elem,"olddisplay");this.elem.style.display=A1?A1:this.options.display;if(A.css(this.elem,"display")==="none"){this.elem.style.display="block"}}if(this.options.hide){A(this.elem).hide()}if(this.options.hide||this.options.show){for(var Az in this.options.curAnim){A.style(this.elem,Az,this.options.orig[Az])}}this.options.complete.call(this.elem)}return false}else{var A0=A7-this.startTime;this.state=A0/this.options.duration;var A5=this.options.specialEasing&&this.options.specialEasing[this.prop];var A6=this.options.easing||(A.easing.swing?"swing":"linear");this.pos=A.easing[A5||A6](this.state,A0,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};A.extend(A.fx,{tick:function(){var A0=A.timers;for(var Az=0;Az<A0.length;Az++){if(!A0[Az]()){A0.splice(Az--,1)}}if(!A0.length){A.fx.stop()}},stop:function(){clearInterval(Ag);Ag=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(Az){A.style(Az.elem,"opacity",Az.now)},_default:function(Az){if(Az.elem.style&&Az.elem.style[Az.prop]!=null){Az.elem.style[Az.prop]=(Az.prop==="width"||Az.prop==="height"?Math.max(0,Az.now):Az.now)+Az.unit}else{Az.elem[Az.prop]=Az.now}}}});if(A.expr&&A.expr.filters){A.expr.filters.animated=function(Az){return A.grep(A.timers,function(A0){return Az===A0.elem}).length}}function Ae(A0,Az){var A1={};A.each(AL.concat.apply([],AL.slice(0,Az)),function(){A1[this]=A0});return A1}if("getBoundingClientRect" in AD.documentElement){A.fn.offset=function(A8){var A1=this[0];if(A8){return this.each(function(A9){A.offset.setOffset(this,A8,A9)})}if(!A1||!A1.ownerDocument){return null}if(A1===A1.ownerDocument.body){return A.offset.bodyOffset(A1)}var A3=A1.getBoundingClientRect(),A7=A1.ownerDocument,A4=A7.body,Az=A7.documentElement,A2=Az.clientTop||A4.clientTop||0,A5=Az.clientLeft||A4.clientLeft||0,A6=A3.top+(self.pageYOffset||A.support.boxModel&&Az.scrollTop||A4.scrollTop)-A2,A0=A3.left+(self.pageXOffset||A.support.boxModel&&Az.scrollLeft||A4.scrollLeft)-A5;return{top:A6,left:A0}}}else{A.fn.offset=function(BA){var A4=this[0];if(BA){return this.each(function(BB){A.offset.setOffset(this,BA,BB)})}if(!A4||!A4.ownerDocument){return null}if(A4===A4.ownerDocument.body){return A.offset.bodyOffset(A4)}A.offset.initialize();var A1=A4.offsetParent,A0=A4,A9=A4.ownerDocument,A7,A2=A9.documentElement,A5=A9.body,A6=A9.defaultView,Az=A6?A6.getComputedStyle(A4,null):A4.currentStyle,A8=A4.offsetTop,A3=A4.offsetLeft;while((A4=A4.parentNode)&&A4!==A5&&A4!==A2){if(A.offset.supportsFixedPosition&&Az.position==="fixed"){break}A7=A6?A6.getComputedStyle(A4,null):A4.currentStyle;A8-=A4.scrollTop;A3-=A4.scrollLeft;if(A4===A1){A8+=A4.offsetTop;A3+=A4.offsetLeft;if(A.offset.doesNotAddBorder&&!(A.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(A4.nodeName))){A8+=parseFloat(A7.borderTopWidth)||0;A3+=parseFloat(A7.borderLeftWidth)||0}A0=A1,A1=A4.offsetParent}if(A.offset.subtractsBorderForOverflowNotVisible&&A7.overflow!=="visible"){A8+=parseFloat(A7.borderTopWidth)||0;A3+=parseFloat(A7.borderLeftWidth)||0}Az=A7}if(Az.position==="relative"||Az.position==="static"){A8+=A5.offsetTop;A3+=A5.offsetLeft}if(A.offset.supportsFixedPosition&&Az.position==="fixed"){A8+=Math.max(A2.scrollTop,A5.scrollTop);A3+=Math.max(A2.scrollLeft,A5.scrollLeft)}return{top:A8,left:A3}}}A.offset={initialize:function(){var Az=AD.body,A0=AD.createElement("div"),A3,A5,A4,A6,A1=parseFloat(A.curCSS(Az,"marginTop",true))||0,A2="<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.extend(A0.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});A0.innerHTML=A2;Az.insertBefore(A0,Az.firstChild);A3=A0.firstChild;A5=A3.firstChild;A6=A3.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(A5.offsetTop!==5);this.doesAddBorderForTableAndCells=(A6.offsetTop===5);A5.style.position="fixed",A5.style.top="20px";this.supportsFixedPosition=(A5.offsetTop===20||A5.offsetTop===15);A5.style.position=A5.style.top="";A3.style.overflow="hidden",A3.style.position="relative";this.subtractsBorderForOverflowNotVisible=(A5.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(Az.offsetTop!==A1);Az.removeChild(A0);Az=A0=A3=A5=A4=A6=null;A.offset.initialize=A.noop},bodyOffset:function(Az){var A1=Az.offsetTop,A0=Az.offsetLeft;A.offset.initialize();if(A.offset.doesNotIncludeMarginInBodyOffset){A1+=parseFloat(A.curCSS(Az,"marginTop",true))||0;A0+=parseFloat(A.curCSS(Az,"marginLeft",true))||0}return{top:A1,left:A0}},setOffset:function(A4,A0,A1){if(/static/.test(A.curCSS(A4,"position"))){A4.style.position="relative"}var A3=A(A4),A6=A3.offset(),Az=parseInt(A.curCSS(A4,"top",true),10)||0,A5=parseInt(A.curCSS(A4,"left",true),10)||0;if(A.isFunction(A0)){A0=A0.call(A4,A1,A6)}var A2={top:(A0.top-A6.top)+Az,left:(A0.left-A6.left)+A5};if("using" in A0){A0.using.call(A4,A2)}else{A3.css(A2)}}};A.fn.extend({position:function(){if(!this[0]){return null}var A1=this[0],A0=this.offsetParent(),A2=this.offset(),Az=/^body|html$/i.test(A0[0].nodeName)?{top:0,left:0}:A0.offset();A2.top-=parseFloat(A.curCSS(A1,"marginTop",true))||0;A2.left-=parseFloat(A.curCSS(A1,"marginLeft",true))||0;Az.top+=parseFloat(A.curCSS(A0[0],"borderTopWidth",true))||0;Az.left+=parseFloat(A.curCSS(A0[0],"borderLeftWidth",true))||0;return{top:A2.top-Az.top,left:A2.left-Az.left}},offsetParent:function(){return this.map(function(){var Az=this.offsetParent||AD.body;while(Az&&(!/^body|html$/i.test(Az.nodeName)&&A.css(Az,"position")==="static")){Az=Az.offsetParent}return Az})}});A.each(["Left","Top"],function(A0,Az){var A1="scroll"+Az;A.fn[A1]=function(A4){var A2=this[0],A3;if(!A2){return null}if(A4!==c){return this.each(function(){A3=AO(this);if(A3){A3.scrollTo(!A0?A4:A(A3).scrollLeft(),A0?A4:A(A3).scrollTop())}else{this[A1]=A4}})}else{A3=AO(A2);return A3?("pageXOffset" in A3)?A3[A0?"pageYOffset":"pageXOffset"]:A.support.boxModel&&A3.document.documentElement[A1]||A3.document.body[A1]:A2[A1]}}});function AO(Az){return("scrollTo" in Az&&Az.document)?Az:Az.nodeType===9?Az.defaultView||Az.parentWindow:false}A.each(["Height","Width"],function(A0,Az){var A1=Az.toLowerCase();A.fn["inner"+Az]=function(){return this[0]?A.css(this[0],A1,false,"padding"):null};A.fn["outer"+Az]=function(A2){return this[0]?A.css(this[0],A1,false,A2?"margin":"border"):null};A.fn[A1]=function(A2){var A3=this[0];if(!A3){return A2==null?null:this}if(A.isFunction(A2)){return this.each(function(A5){var A4=A(this);A4[A1](A2.call(this,A5,A4[A1]()))})}return("scrollTo" in A3&&A3.document)?A3.document.compatMode==="CSS1Compat"&&A3.document.documentElement["client"+Az]||A3.document.body["client"+Az]:(A3.nodeType===9)?Math.max(A3.documentElement["client"+Az],A3.body["scroll"+Az],A3.documentElement["scroll"+Az],A3.body["offset"+Az],A3.documentElement["offset"+Az]):A2===c?A.css(A3,A1):this.css(A1,typeof A2==="string"?A2:A2+"px")}});An.jQuery=An.$=A})(window);(function(A,C){A.ui=A.ui||{};if(A.ui.version){return }A.extend(A.ui,{version:"1.8.11",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}});A.fn.extend({_focus:A.fn.focus,focus:function(D,E){return typeof D==="number"?this.each(function(){var F=this;setTimeout(function(){A(F).focus();if(E){E.call(F)}},D)}):this._focus.apply(this,arguments)},scrollParent:function(){var D;if((A.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){D=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(A.curCSS(this,"position",1))&&(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0)}else{D=this.parents().filter(function(){return(/(auto|scroll)/).test(A.curCSS(this,"overflow",1)+A.curCSS(this,"overflow-y",1)+A.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!D.length?A(document):D},zIndex:function(G){if(G!==C){return this.css("zIndex",G)}if(this.length){var E=A(this[0]),D,F;while(E.length&&E[0]!==document){D=E.css("position");if(D==="absolute"||D==="relative"||D==="fixed"){F=parseInt(E.css("zIndex"),10);if(!isNaN(F)&&F!==0){return F}}E=E.parent()}}return 0},disableSelection:function(){return this.bind((A.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(D){D.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});A.each(["Width","Height"],function(F,D){var E=D==="Width"?["Left","Right"]:["Top","Bottom"],G=D.toLowerCase(),I={innerWidth:A.fn.innerWidth,innerHeight:A.fn.innerHeight,outerWidth:A.fn.outerWidth,outerHeight:A.fn.outerHeight};function H(L,K,J,M){A.each(E,function(){K-=parseFloat(A.curCSS(L,"padding"+this,true))||0;if(J){K-=parseFloat(A.curCSS(L,"border"+this+"Width",true))||0}if(M){K-=parseFloat(A.curCSS(L,"margin"+this,true))||0}});return K}A.fn["inner"+D]=function(J){if(J===C){return I["inner"+D].call(this)}return this.each(function(){A(this).css(G,H(this,J)+"px")})};A.fn["outer"+D]=function(J,K){if(typeof J!=="number"){return I["outer"+D].call(this,J)}return this.each(function(){A(this).css(G,H(this,J,true,K)+"px")})}});function B(D){return !A(D).parents().andSelf().filter(function(){return A.curCSS(this,"visibility")==="hidden"||A.expr.filters.hidden(this)}).length}A.extend(A.expr[":"],{data:function(F,E,D){return !!A.data(F,D[3])},focusable:function(F){var I=F.nodeName.toLowerCase(),D=A.attr(F,"tabindex");if("area"===I){var H=F.parentNode,G=H.name,E;if(!F.href||!G||H.nodeName.toLowerCase()!=="map"){return false}E=A("img[usemap=#"+G+"]")[0];return !!E&&B(E)}return(/input|select|textarea|button|object/.test(I)?!F.disabled:"a"==I?F.href||!isNaN(D):!isNaN(D))&&B(F)},tabbable:function(E){var D=A.attr(E,"tabindex");return(isNaN(D)||D>=0)&&A(E).is(":focusable")}});A(function(){var D=document.body,E=D.appendChild(E=document.createElement("div"));A.extend(E.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});A.support.minHeight=E.offsetHeight===100;A.support.selectstart="onselectstart" in E;D.removeChild(E).style.display="none"});A.extend(A.ui,{plugin:{add:function(E,F,H){var G=A.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H||!D.element[0].parentNode){return }for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},contains:function(E,D){return document.compareDocumentPosition?E.compareDocumentPosition(D)&16:E!==D&&E.contains(D)},hasScroll:function(G,E){if(A(G).css("overflow")==="hidden"){return false}var D=(E&&E==="left")?"scrollLeft":"scrollTop",F=false;if(G[D]>0){return true}G[D]=1;F=(G[D]>0);G[D]=0;return F},isOverAxis:function(E,D,F){return(E>D)&&(E<(D+F))},isOver:function(I,E,H,G,D,F){return A.ui.isOverAxis(I,H,D)&&A.ui.isOverAxis(E,G,F)}})})(jQuery);(function(B,D){if(B.cleanData){var C=B.cleanData;B.cleanData=function(E){for(var F=0,G;(G=E[F])!=null;F++){B(G).triggerHandler("remove")}C(E)}}else{var A=B.fn.remove;B.fn.remove=function(E,F){return this.each(function(){if(!F){if(!E||B.filter(E,[this]).length){B("*",this).add([this]).each(function(){B(this).triggerHandler("remove")})}}return A.call(B(this),E,F)})}}B.widget=function(F,H,E){try{var G=F.split(".")[0],K;F=F.split(".")[1];K=G+"-"+F;if(!E){E=H;H=B.Widget}B.expr[":"][K]=function(L){return !!B.data(L,F)};B[G]=B[G]||{};B[G][F]=function(L,M){try{if(arguments.length){this._createWidget(L,M)}}catch(N){}};var J=new H();J.options=B.extend(true,{},J.options);B[G][F].prototype=B.extend(true,J,{namespace:G,widgetName:F,widgetEventPrefix:B[G][F].prototype.widgetEventPrefix||F,widgetBaseClass:K},E);B.widget.bridge(F,B[G][F])}catch(I){}};B.widget.bridge=function(F,E){B.fn[F]=function(I){var G=typeof I==="string",H=Array.prototype.slice.call(arguments,1),J=this;I=!G&&H.length?B.extend.apply(null,[true,I].concat(H)):I;if(G&&I.charAt(0)==="_"){return J}if(G){this.each(function(){var K=B.data(this,F),L=K&&B.isFunction(K[I])?K[I].apply(K,H):K;if(L!==K&&L!==D){J=L;return false}})}else{this.each(function(){var K=B.data(this,F);if(K){K.option(I||{})._init()}else{B.data(this,F,new E(I,this))}})}return J}};B.Widget=function(E,F){if(arguments.length){this._createWidget(E,F)}};B.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(F,G){B.data(G,this.widgetName,this);this.element=B(G);this.options=B.extend(true,{},this.options,this._getCreateOptions(),F);var E=this;this.element.bind("remove."+this.widgetName,function(){E.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return B.metadata&&B.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(F,G){var E=F;if(arguments.length===0){return B.extend({},this.options)}if(typeof F==="string"){if(G===D){return this.options[F]}E={};E[F]=G}this._setOptions(E);return this},_setOptions:function(F){var E=this;B.each(F,function(G,H){E._setOption(G,H)});return this},_setOption:function(E,F){this.options[E]=F;if(E==="disabled"){this.widget()[F?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",F)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(F,G,H){var J=this.options[F];G=B.Event(G);G.type=(F===this.widgetEventPrefix?F:this.widgetEventPrefix+F).toLowerCase();H=H||{};if(G.originalEvent){for(var E=B.event.props.length,I;E;){I=B.event.props[--E];G[I]=G.originalEvent[I]}}this.element.trigger(G,H);return !(B.isFunction(J)&&J.call(this.element[0],G,H)===false||G.isDefaultPrevented())}}})(jQuery);(function(A){A.widget("ui.smart_input",{_def_value:function(){if(!this.element.val()){this.element.hide();if(this.options._fake.filter("textarea").length){this.options._fake.text(this.options.label)}else{this.options._fake.val(this.options.label)}this.options._fake.css(this.options.emptyCss).show()}else{this.options._fake.hide();this.element.show().css(this.options.filledCss)}},_onBlur:function(C){var B=this.element,D=this.options,E=this;this._def_value();if(typeof (D.onBlur)=="function"){D.onBlur.call(B,C)}},_onFocus:function(C){var B=this.element,D=this.options,E=this,G=B.val();try{if(G==D.label){B.val("")}B.css(D.filledCss);if(typeof (D.onFocus)=="function"){D.onFocus.call(B,C)}}catch(F){}},init:function(){this._init.apply(this,arguments)},_init:function(){var B=this;this.options._isPasswd=true;if(this.element.filter("textarea").length){this.options._fake=A("<textarea />").text(this.element.val())}else{this.options._fake=A('<input type="text" />').attr("value",this.element.val())}this.options._fake.attr("style",this.element.attr("style"));if(this.element.attr("class")){this.options._fake.attr("class",this.element.attr("class"))}if(this.element.attr("size")){this.options._fake.attr("size",this.element.attr("size"))}if(this.element.attr("tabindex")){this.options._fake.attr("tabindex",this.element.attr("tabindex"))}var C=this.options._fake.attr({id:B.element.attr("id")+"_smart",name:""});if(this.element.filter(":password").length){C.insertAfter(this.element)}else{C.insertBefore(this.element)}C.hide().bind("click focus",function(){A(this).hide();B.element.show().focus()});this.element.addClass(this.options.element_class).blur(function(D){B._onBlur.call(B,D)}).focus(function(D){B._onFocus.call(B,D)});this._def_value()},value:function(){var B=this.element.val();return B=this.options.label==B?"":this.element.val()},focus:function(){this.options._fake.trigger("click")},empty:function(){this.element.val("").trigger("blur")}});A.extend(A.ui.smart_input.prototype,{options:{element_class:"ui-smart-input",filledCss:{},emptyCss:{},onBlur:undefined,onFocus:undefined,label:"..."},getter:"value"})})(jQuery);(function(A){A.widget("ui.phone_number",{_user_value:null,_processString:function(E,C){var D=C.match(/d\{([\d\+]+)\}/g),F=new Array(),B=false;A.each(D,function(G,H){var I=/\{([\d\+]+)\}/.exec(H);if(I&&I[1]){F.push(I[1]);if(I[1]=="+"){B=true}}});F=this._parseLimits(F,E.length);A.each(F,function(I,H){var G=E.slice(0,H);if(E.length){E=E.substr(H)}C=C.replace(/%d\{[\d\+]+\}/,G)});C=C.replace(/%d\{[\d\+]+\}/g,"");this.element.val(C)},_parseLimits:function(C,F){var D=0,E=null,B=0;A.each(C,function(G,H){if(H=="+"){E=G;return }H=parseInt(H,10);C[G]=H;D+=H});B=F-D;if((B>0)&&E!==null){C[E]=B}else{C[E]=0}return C},_transform:function(E){var C=this.options,B=this.element,D=this;E=E.replace(/[^0-9\+]/g,"").replace(/(?!^)\+/g,"");if(!E.length){B.val("");return }if(C.format!==undefined&&!A.isEmptyObject(C.format)){A.each(C.format,function(G,F){var H=new RegExp(G);if(E.match(G)){D._processString(E,F);return false}})}},_init:function(){var B=this.element,C=this.options,D=this;B.keyup(function(E){D._transform(B.val())})}})})(jQuery);$.extend($.ui.phone_number.prototype,{options:{format:{"^\\d{0,2}$":"%d{+}","^\\d{3,4}$":"%d{+}-%d{2}","^\\d{5,7}$":"%d{+}-%d{2}-%d{2}","^8\\d{10}$":"%d{1} (%d{3}) %d{3}-%d{2}-%d{2}","^\\+38\\d+$":"%d{3} (%d{+}) %d{3}-%d{2}-%d{2}","^\\+\\d{11}$":"%d{2} (%d{+}) %d{3}-%d{2}-%d{2}","^8\\d{8,}$":"%d{1} (%d{+}) %d{3}-%d{2}-%d{2}","^\\d{8,}$":"%d{2} (%d{+}) %d{3}-%d{2}-%d{2}","^\\+\\d+$":"%d{2} (%d{+}) %d{3}-%d{2}-%d{2}"},"min_length":7,"max_length":14}});(function(A){A.widget("ui.modalbox",{_init:function(){var B=this.options;var C=this;C.current_url=false;C.popup=A("<div />").attr("id","modal_popup").addClass(B.popup_class).appendTo(A(document.body)).end().hide();C.close_button=A(B.close_button).attr("id","modal_close_button").appendTo(C.popup);C.close_button.click(function(D){D.preventDefault();D.stopPropagation();C.close();return false});C.container=A("<div />").attr("id","modal_container").addClass(B.container_class).appendTo(C.popup).end();C.tint=A("<div />").attr("id","modal_tint").addClass(B.tint_class).appendTo(A(document.body)).end().hide();A(document).keydown(function(D){if((D.which&&D.which==27)||(D.keyCode&&D.keyCode==27)){C.close()}})},open:function(C){var E=this;var B=A.extend({},E.options,C);if(B.callbacks&&typeof (B.callbacks.preOpen)=="function"){var D=B.callback.preOpen(E);B.callbacks.preOpen=false;if(D){return }}E.tint.show();if(!A.support.boxModel){A(document).scrollTop(0)}if(E.popup.attr("class")!=B.popup_class){E.popup.attr("class",B.popup_class)}if(B.ajax_url){if(!(E.options.cache&&E.current_url==C.ajax_url)){E.popup.slideUp("fast");E.container.html(B.content_html.replace("%%content%%",B.content));E.popup.slideDown("fast");E.container.sleep({"shroud_css":{"z-index":200,"background-color":false}});A.ajax({url:C.ajax_url,success:function(F){E.container.wakeup().end().hide();if(B.hint){F=B.hint_html.replace("%%hint%%",B.hint)+F}E.container.html(F);E.container.slideDown("fast");E.current_url=C.ajax_url},error:function(H,F,G){E.container.html('<div class="substance">Произошла ошибка, попробуйте повторить позднее.<i class="bottom"></i></div>')}})}else{E.popup.slideDown("fast")}}else{if(B.content){E.current_url=false;E.container.html(B.content_html.replace("%%content%%",B.content));E.popup.slideDown("fast")}}if(B.callbacks&&typeof (B.callbacks.postOpen)=="function"){B.callbacks.postOpen(E);E.options.callbacks.postOpen=false}},close:function(C){var E=this;var B=A.extend({},E.options,C);if(C!==undefined&&typeof (C.onClosing)=="function"&&!C.onClosing(E)){return }if(B.callbacks&&typeof (B.callbacks.preClose)=="function"){var D=B.callbacks.preClose(E);B.callbacks.preClose=false;if(D){return }}E.popup.slideUp(0,function(){E.container.wakeup();E.tint.hide();if(C!==undefined){if(typeof (C.complete)=="function"){C.complete()}}});if(B.callbacks&&typeof (B.callbacks.postClose)=="function"){B.callbacks.postClose(E);E.options.callbacks.postClose=false}},setCallback:function(C){var B=this.options;if(this.options.callbacks){A.extend(B.callbacks,C)}else{B.callbacks=C}}});A.extend(A.ui.modalbox.prototype,{options:{close_button:'<a href="javascript:void(0);" class="close">Закрыть</a>',hint_html:'<div class="hint"><p>%%hint%%</p><i class="bottom"></i></div>',hint:false,content_html:'<div class="substance">%%content%%<i class="bottom"></i></div>',content:"<br /><br /><br />",popup_class:"popup",container_class:"",tint_class:"l-tint",cache:false,callbacks:false}})})(jQuery);(function(A){A.sleep=function(B){return A.sleep.issue.init(B)};A.fn.sleep=function(B){return A.sleep.issue.init(this,B)};A.wakeup=function(B){return A.sleep.issue.destroy()};A.fn.wakeup=function(B){return A.sleep.issue.destroy(this)};A.sleep.defaults={idle_icon:"/sf/progress.gif",shroud_css:{"opacity":"0.5","position":"absolute","background-color":"#FFFFFF","vertical-align":"middle","text-align":"center"},vertical_offset:null};A.sleep.issue={config:null,init:function(I,D){if(typeof (D)!="undefined"){D.shroud_css=A.extend({},A.sleep.defaults.shroud_css,D.shroud_css)}this.config=A.extend({},A.sleep.defaults,D);this.z_index=this.config.z_index;I=I instanceof jQuery?I:A(I);if(I.position()==undefined){return I}var H=I.position().left+parseInt(I.css("margin-left")),G=I.position().top+parseInt(I.css("margin-top")),G=I.position().top+parseInt(I.css("margin-top")),F=I.width()+parseInt(I.css("padding-left"))+parseInt(I.css("padding-right")),B=I.height()+parseInt(I.css("padding-top"))+parseInt(I.css("padding-bottom")),E=I.parent(),C=(D!==undefined&&D.vertical_offset!==undefined)?parseInt(D.vertical_offset,10):(Math.round(B/2)-16);shroud=A("<div/>").css({left:H,top:G,width:F,height:B}).css(this.config.shroud_css).addClass("jq-idle-shroud").append(A("<img/>").addClass("jq-idle-icon").attr("src",this.config.idle_icon).css({"top":C,"position":"relative"})).appendTo(E);return I},destroy:function(B){B=B instanceof jQuery?B:A(B);B.parent().children(".jq-idle-shroud").remove();return B}}})(jQuery);(function(A){A.fn.silent_submit=function(C){var D=A(this);var B={url:"",method:"POST",data:{},processingClass:"_processing_",getValue:{},submitToNowhere:false};var C=A.extend(B,C);if(C.submitToNowhere){var E="form-silent-submit-nowhere-place",G="form_silent_submit_nowhere_place",F=A('<iframe style="width: 0; height: 0; display: none;" name="'+G+'" id="'+E+'"></iframe>');D.attr("target",G).attr("action","/");F.insertAfter(D)}D.submit(function(H){if(!C.submitToNowhere){H.preventDefault();H.stopPropagation()}if(D.hasClass(C.processingClass)){return false}D.addClass(C.processingClass);var K=A(this).find("input, select, textarea");var J=B.data;A.each(K,function(M,N){N=A(N);if(N.filter("input:checkbox").length&&!N.filter(":checked").length){return }if(typeof (C.getValue[N.attr("name")])=="function"){J[N.attr("name")]=C.getValue[N.attr("name")].call(N)}else{J[N.attr("name")]=N.val()}});var I=(C.container===undefined)?D.parent():C.container;I=(I instanceof jQuery)?I:A(I);var L=(C.sleepContainer===undefined)?I:C.sleepContainer;L=(L instanceof jQuery)?L:A(L);L.sleep({"shroud_css":{"z-index":200}});A.ajax({type:B.method,url:B.url,data:J,complete:function(){L.wakeup();D.removeClass(C.processingClass)},success:function(M){I.html(M);I.wakeup()}})});D.keypress(function(H){if(H.keyCode==13){A(this).submit()}});return D}})(jQuery);var config_wwwdomain="http://"+document.domain;var expecting_callback=null;(function(B){var A=this;A._is_authorized=false;B.fn.authBind=function(D,C,E){return B._auth_bind.init(this,D,C,E)};B._auth_bind={init:function(E,D,C,F){E=E instanceof jQuery?E:B(E);E.bind(D,function(G){var I=B(this);if(A._is_authorized){C.call(I,G)}else{G.stopImmediatePropagation();G.preventDefault();var H=(function(J){return function(){A._is_authorized=true;var K=new jQuery.Event(D);J.trigger(K)}})(I);B.getJSON(config_wwwdomain+"/ajax/userservice/?cmd=islogged",function(J){if(J.status==1){H()}else{expecting_callback=H;B.stupidModal("login",{executeHandler:"authComplete"},expecting_callback)}})}});return E}}})(jQuery);var expecting_callback=null;(function(B){var C=false;var A="http://"+document.domain;B.authJacket=function(D,E,F){if(E===undefined){E=(window===undefined)?window:document.window}if(C){D.call(E)}else{B.getJSON(A+"/ajax/userservice/?cmd=islogged",function(G){if(G!==undefined){if(G.status==1){C=true;D.call(E)}else{expecting_callback=function(){C=true;D.call(E)};B.stupidModal("login",{executeHandler:"authComplete"},expecting_callback)}}})}}})(jQuery);(function(C){var A=C.scrollTo=function(D,E,F){C(window).scrollTo(D,E,F)};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window)._scrollable()};C.fn._scrollable=function(){return this.map(function(){var D=this,E=!D.nodeName||C.inArray(D.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!E){return D}var F=(D.contentWindow||D).document||D.ownerDocument||D;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}if(F=="max"){F=9000000000}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this._scrollable().each(function(){var M=this,K=C(M),L=F,I,J={},G=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){I=(L=C(L)).offset()}}C.each(D.axis.split(""),function(P,Q){var S=Q=="x"?"Left":"Top",R=S.toLowerCase(),U="scroll"+S,O=M[U],N=A.max(M,Q);if(I){J[U]=I[R]+(G?0:O-K.offset()[R]);if(D.margin){J[U]-=parseInt(L.css("margin"+S))||0;J[U]-=parseInt(L.css("border"+S+"Width"))||0}J[U]+=D.offset[R]||0;if(D.over[R]){J[U]+=L[Q=="x"?"width":"height"]()*D.over[R]}}else{var T=L[R];J[U]=T.slice&&T.slice(-1)=="%"?parseFloat(T)/100*N:T}if(/^\d+$/.test(J[U])){J[U]=J[U]<=0?0:Math.min(J[U],N)}if(!P&&D.queue){if(O!=J[U]){H(D.onAfterFirst)}delete J[U]}});H(D.onAfter);function H(N){K.animate(J,E,D.easing,N&&function(){N.call(this,F,D)})}}).end()};A.max=function(F,G){var I=G=="x"?"Width":"Height",H="scroll"+I;if(!C(F).is("html,body")){return F[H]-C(F)[I.toLowerCase()]()}var J="client"+I,E=F.ownerDocument.documentElement,D=F.ownerDocument.body;return Math.max(E[H],D[H])-Math.min(E[J],D[J])};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};if(!this.JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();var JSONRequest=function(A){if(typeof (A)!="object"){console.dir(A);throw ("Error: Invalid options data type.")}if(typeof (A.method)=="undefined"){throw ("Error: No method argument given.")}if(typeof (A.params)!="undefined"&&!(A.params instanceof Array)){throw ("Error: Invalid parameters data type given.")}var C={method:A.method,params:A.params,id:Math.round(Math.random()*1000000)};C=JSON.stringify(C,function(D,E){return E});var B="/JSON/index/";if(A.url!==undefined){B=A.url}$.ajax({url:B,data:C,dataType:"json",type:"POST",cache:false,success:function(F){if(typeof (F)!="undefined"){var D=F.result;var E=F.error;var G=F.id;if(typeof (E)!="undefined"&&E!=null){if(typeof (A.failure)=="function"){A.failure(E)}}else{if(typeof (A.success)=="function"){A.success(D)}}}},error:function(F,E,D){if(typeof (A.error)=="function"){A.error(F,E,D)}},dataType:"json"})};(function(B){B.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function A(D){if(typeof D.data!=="string"){return }var C=D.handler,E=D.data.toLowerCase().split(" ");D.handler=function(L){if(this!==L.target&&(/textarea|select/i.test(L.target.nodeName)||L.target.type==="text")){return }var H=L.type!=="keypress"&&B.hotkeys.specialKeys[L.which],M=String.fromCharCode(L.which).toLowerCase(),J,K="",G={};if(L.altKey&&H!=="alt"){K+="alt+"}if(L.ctrlKey&&H!=="ctrl"){K+="ctrl+"}if(L.metaKey&&!L.ctrlKey&&H!=="meta"){K+="meta+"}if(L.shiftKey&&H!=="shift"){K+="shift+"}if(H){G[K+H]=true}else{G[K+M]=true;G[K+B.hotkeys.shiftNums[M]]=true;if(K==="shift+"){G[B.hotkeys.shiftNums[M]]=true}}for(var I=0,F=E.length;I<F;I++){if(G[E[I]]){return C.apply(this,arguments)}}}}B.each(["keydown","keyup","keypress"],function(){B.event.special[this]={add:A}})})(jQuery);var rocon=(function(){var Ar=/\.rc(\d+)\b/,Af=/\brc(\d+)\b/,AP=/\brc-shape\b/,AY="rocon__",Az="rocon",AF=[],Am={update:function(){},bindProperties:function(){var A=1;return function(D,B,C){AF.push({"id":A++,"rule":D,"bg":Ad(Ax(B),function(E){if(E.charAt(0)!="#"){E="#"+E}return AM(E)}),"border_width":C||0})}}(),process:function(A){Ai(A)}},Ak=null,Al={},AS=[],Ap=[],AN=false,A5=false,AQ=navigator.userAgent.toLowerCase(),A1={},A2={version:(AQ.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(AQ),opera:/opera/.test(AQ),msie:/msie/.test(AQ)&&!/opera/.test(AQ),mozilla:/mozilla/.test(AQ)&&!/(compatible|webkit)/.test(AQ)};function Aa(){if(!AN){AN=true;if(Ap.length){for(var A=0;A<Ap.length;A++){Ap[A].call(document)}Ap=null}}}function Ab(A){Ap.push(A)}function AL(){if(A5){return }A5=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);Aa()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);Aa()}});if(document.documentElement.doScroll&&!window.frameElement){(function(){if(AN){return }try{document.documentElement.doScroll("left")}catch(A){setTimeout(arguments.callee,0);return }Aa()})()}}}}function AO(A,D,F){if(F){for(var E=0,B=A.length;E<B;E++){if(D.call(A[E],E)===false){break}}}else{for(var E=A.length-1,C;E>=0;E--){if(D.call(A[E],E)===false){break}}}}function Ad(D,C){var B=[];for(var A=0,F=D.length;A<F;A++){var E=C(D[A],A);if(E!=null){B[B.length]=E}}return B.concat.apply([],B)}function AB(){return }function AM(B){var C;function A(F){var E=parseInt(F,10).toString(16);return(E.length==1)?E+E:E}function D(E){return A(Math.round(E*2.55))}if(C=/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/.exec(B)){return"#"+A(C[1])+A(C[2])+A(C[3])}if(C=/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*\)/.exec(B)){return"#"+D(C[1])+D(C[2])+D(C[3])}if(C=/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i.exec(B)){return"#"+C[1]+C[2]+C[3]}if(C=/#([a-f0-9])([a-f0-9])([a-f0-9])/i.exec(B)){return"#"+C[1]+C[1]+C[2]+C[2]+C[3]+C[3]}A=null;D=null;return B}function AR(C,A){var B=document.createElement(C);if(A){B.className=A}return B}function AJ(B,A){var C=new RegExp("\\b"+A+"\\b");return B.nodeType==1&&C.test(B.className||"")}function AK(D,B){var E,C={},A=function(F,G){return G.toUpperCase()};AO(B instanceof Array?B:[B],function(){var F=this,G=F.replace(/\-(\w)/g,A);if(D.style[G]){C[G]=D.style[G]}else{if(A2.msie){C[G]=D.currentStyle[G]}else{if(document.defaultView&&document.defaultView.getComputedStyle){if(!E){E=document.defaultView.getComputedStyle(D,"")}C[G]=E&&E.getPropertyValue(F)}}}});return B instanceof Array?C:C[B.replace(/\-(\w)/g,A)]}function Ax(A){var B=(A||"").split("_");switch(B.length){case 1:return[B[0],B[0],B[0],B[0]];case 2:return[B[0],B[1],B[0],B[1]];case 3:return[B[0],B[1],B[2],B[1]];case 4:return B}return null}var Ay=(function(){var B=[],A="#ffffff";function D(F){var E;do{if(F.nodeType!=1){break}if(F.rocon_bg){return F.rocon_bg}else{B.push(F);E=AK(F,"background-color");if(E!="transparent"){return AM(E)}}}while(F=F.parentNode);return A}function C(F){var E;do{if(F.nodeType!=1){break}E=AK(F,"background-color");if(E!="transparent"){return AM(E)}}while(F=F.parentNode);return A}return function(E,F){var I=E.className,G=null;var J=/\brcbg([a-f0-9_]+)\b/i.exec(I);if(J){G=Ad(Ax(J[1]),function(K){return AM("#"+K)});return G}var H=AT(E);if(H){return H.bg}if(!F){E=E.parentNode}if(Ay.use_cache){B=[];G=D(E);AO(B,function(){this.rocon_bg=G;Ay.processed_elems.push(this)});B=null}else{G=C(E)}return Ax(G)}})();Ay.use_cache=true;Ay.processed_elems=[];function AT(A){var B=A.className,C=null;AO(AF,function(){if((typeof (this.rule)=="string"&&B.indexOf(this.rule)!=-1)||B.search(this.rule)!=-1){C=this;return false}},true);return C}function Av(B,A){Ak.insertRule(B+" {"+A+"}",Ak.cssRules.length)}function AZ(A){var B;AO(document.styleSheets,function(){AO(this.cssRules||this.rules,function(){if(B=Ar.exec(this.selectorText)){A(this,parseInt(B[1],10))}})})}function AX(A,B){var C=(A.className||"").replace(new RegExp("\\s*"+Az+"[-_].+?\\b","ig"),"");if(B){C+=" "+B}A.className=C;return A}function As(A,B){AS.push(A.selectorText.substr(1))}function AV(){if(!Ak){if(document.createStyleSheet){Ak=document.createStyleSheet()}else{var A=AR("style");A.rel="rocon";document.getElementsByTagName("head")[0].appendChild(A);AO(document.styleSheets,function(){if(this.ownerNode.rel=="rocon"){Ak=this;return false}})}}return Ak}function A3(A){var B=[],C;AO((A||document).getElementsByTagName("*"),function(){if(C=Af.exec(this.className||"")){B.push({node:this,radius:parseInt(C[1],10)})}});return B}function Ai(A){var B=A3(A);if(B.length){AV();AO(B,function(){AB(this.node,this.radius)})}}function Aq(A){return A1[A]?true:false}function AG(C,B){var A=C.className||"";B=B||parseInt(A.match(Af)[1],10);var F=AP.test(A),E=AT(C);var D="";var G=E?E.border_width:(parseInt(AK(C,"border-left-width"))||0);if(G){D=AM(AK(C,"border-left-color")||"#000")}return{"radius":B,"bg_color":Ay(C,F),"border_width":(G>B)?B:G,"real_border_width":G,"border_color":D,"use_shape":F}}function AW(B,A){AO(B,function(){AO((this instanceof Array)?this:[this],A)})}function Au(A){var C={};for(var B in A){if(A.hasOwnProperty(B)){C[B]=A[B]}}return C}function AH(J,I,A){var H=AK(J,["padding-top","padding-bottom","margin-top","margin-bottom"]);function G(K){return parseInt(H[K],10)||0}var F=Math.max(G("paddingTop")-A.radius+A.border_width,0),B=Math.max(G("paddingBottom")-A.radius+A.border_width,0),E=G("marginTop")+A.radius,C=G("marginBottom")+A.radius,D=A.real_border_width-A.border_width;Av("."+I,"border-top-width:"+D+"px;border-bottom-width:"+D+"px;padding-top:"+F+"px;padding-bottom:"+B+"px;margin-top:"+E+"px;margin-bottom:"+C+"px")}Ab(Ai);Ab(function(){AO(Ay.processed_elems,function(){this.removeAttribute("rocon_bg")});Ay.use_cache=false});AL();if(A2.safari){AB=function(A,B){var C=".rc"+B;if(!Aq(C)){Av(C,"-webkit-border-radius:"+B+"px; -khtml-border-radius:"+B);A1[C]=true}};Am.update=function(){AW(arguments,function(){var A=Af.exec(this.className||"");if(A){AB(this,parseInt(A[1]))}})}}if(A2.mozilla){AB=function(A,B){var C=".rc"+B;if(!Aq(C)){Av(C,"-moz-border-radius:"+B+"px");A1[C]=true}};Am.update=function(){AW(arguments,function(){var A=Af.exec(this.className||"");if(A){AB(this,parseInt(A[1]))}})}}if(A2.opera){AV();Av("."+Az,"position:absolute;background-repeat:no-repeat;z-index:1;display:none");Av("."+Az+"-init","position:relative;");Av("."+Az+"-init>."+Az,"display:inline-block;");Av("."+Az+"-tl","top:0;left:0;background-position:100% 100%;");Av("."+Az+"-tr","top:0;right:0;background-position:0 100%;");Av("."+Az+"-bl","bottom:0;left:0;background-position:100% 0;");Av("."+Az+"-br","bottom:0;right:0;");var Aj=AR("canvas");function AU(A){A.border_width=(A.border_width>A.radius)?A.radius:A.border_width;if(A.border_width>1){A.radius-=A.border_width/2}var D=A.radius*2+A.border_width,C=D;if(A.use_shape){D=2000;if(A.border_width<A.real_border_width){C+=(A.real_border_width-A.border_width)*2}}if(A.border_width==1){D--;C--}Aj.width=A.width=D;Aj.height=A.height=C;var B=Aj.getContext("2d");B.strokeStyle=A.border_color;B.lineWidth=A.border_width;B.lineJoin="miter";B.lineCap="square";B.fillStyle=A.bg_color[0];B.clearRect(0,0,D,C);return B}function AD(C,A){var E=Math.PI/2,B=(A.border_width>1)?A.border_width:0,D=A.radius*2+B;C.beginPath();C.arc(0,0,A.radius,E,0,true);C.stroke();C.beginPath();C.arc(D,0,A.radius,E*2,E,true);C.stroke();C.beginPath();C.arc(D,D,A.radius,-E,E*2,true);C.stroke();C.beginPath();C.arc(0,D,A.radius,0,-E,true);C.stroke()}function Aw(A){A=Au(A);var B=AU(A),I=Math.PI/2,G=Math.PI*2,E=A.border_width,D=(E>1)?E:0,H=A.radius*2+D,C=0,J=(A.border_width<A.real_border_width);var F=function(L,K){B.beginPath();B.arc(L,K,A.radius,0,G,true);B.closePath();B.fill()};if(J){C=A.real_border_width-A.border_width;B.save();B.translate(0,C)}F(0,0);F(H,0);F(H,H);F(0,H);B.fillRect(H,0,A.width,A.height);if(E){AD(B,A);B.fillStyle=B.strokeStyle;B.fillRect(H,A.radius-(E>1?E/2:E),A.width,E*2);if(J){B.restore();B.fillStyle=A.border_color;B.fillRect(0,0,A.width,C);B.fillRect(0,A.height-C,A.width,C);B.fillStyle=A.bg_color}}return B.canvas.toDataURL()}function An(H){var C=H;H=Au(H);var B=AU(H),F=H.radius,A=(H.border_width>1)?H.border_width:0,D=F*2+A,E=C.radius,G=Math.PI/2;B.save();B.beginPath();B.arc(0,0,F,G,0,true);B.arc(D,0,F,G*2,G,true);B.arc(D,D,F,-G,G*2,true);B.arc(0,D,F,0,-G,true);B.closePath();B.clip();B.fillStyle=H.bg_color[2];B.fillRect(0,0,E,E);B.fillStyle=H.bg_color[3];B.fillRect(E,0,E,E);B.fillStyle=H.bg_color[0];B.fillRect(E,E,E,E);B.fillStyle=H.bg_color[1];B.fillRect(0,E,E,E);B.restore();if(H.border_width){AD(B,H)}return B.canvas.toDataURL()}function A4(C,A){var B=AT(A);return[C.radius,C.bg_color.join("-"),C.real_border_width,C.border_color,C.use_shape,B?B.id:0].join(":")}function AI(F,G){var D=A4(F,G),C=F.radius,B=F.real_border_width||0,A=(F.use_shape)?B-F.border_width:0;if(!Al[D]){var H=AY+Ak.cssRules.length;Al[D]=H;Av("."+H+">."+Az,'background-image: url("'+(F.use_shape?Aw(F):An(F))+'");width: '+C+"px;height: "+(C+A)+"px;");var E=-B,I=-B;if(F.use_shape){I=-C-A;AH(G,H,F);Av("."+H+">."+Az+"-tl, ."+H+">."+Az+"-bl","width:auto;left:0;right:"+(C-B)+"px;background-position:-"+C+"px 100%;");Av("."+H+">."+Az+"-bl","background-position:-"+C+"px 0;")}if(E||I){Av("."+H+">."+Az+"-tl","top:"+I+"px; left:"+E+"px");Av("."+H+">."+Az+"-tr","top:"+I+"px; right:"+E+"px");Av("."+H+">."+Az+"-bl","bottom:"+I+"px; left:"+E+"px");Av("."+H+">."+Az+"-br","bottom:"+I+"px; right:"+E+"px")}}return Al[D]}AB=function(D,C){if(!D.className){return }var B=false;AO(D.childNodes,function(){if(AJ(this,Az)){B=true;return false}});var A=AI(AG(D,C),D);if(!B){AO(["tl","tr","bl","br"],function(){D.appendChild(AR("span",Az+" "+Az+"-"+this))})}AX(D,A+" "+Az+"-init")};Ab(function(){document.documentElement.style.outline="none"});Am.update=function(){AW(arguments,function(){AB(AX(this))})}}if(A2.msie){Al.ix=0;Al.created={};var Ae="",At={tl:0,tr:1,br:2,bl:3};var Ao="vml-"+Az;try{if(!document.namespaces["v"]){document.namespaces.add("v","urn:schemas-microsoft-com:vml")}}catch(Ag){}AV();var AA="."+Az;Ak.cssText="."+Ao+" {behavior:url(#default#VML);display:inline-block;position:absolute}"+AA+"-init {position:relative;zoom:1;}"+AA+" {position:absolute; display:inline-block; zoom: 1; overflow:hidden}"+AA+"-tl ."+Ao+"{flip: 'y'}"+AA+"-tr ."+Ao+"{rotation: 180;right:1px;}"+AA+"-br ."+Ao+"{flip: 'x'; right:1px;}";if(A2.version<7){Ak.cssText+=AA+"-tr, "+AA+"-br {margin-left: 100%;}"}Av=function(B,A){Ae+=B+"{"+A+"}"};function AC(A){var K=A.radius,I=A.border_width,N=K+":"+I+":"+A.use_shape;if(!AC._cache[N]){var E=10;var M=AR("v:shape");M.className=Ao;M.strokeweight=I+"px";M.stroked=(I)?true:false;var D=AR("v:stroke");D.className=Ao;D.joinstyle="miter";M.appendChild(D);var G=K,L=G;M.style.width=G+"px";M.style.height=L+"px";K-=I/2;K*=E;var J=I/2*E;var H=Math.round((K+J)/G);var F=K+J;M.coordorigin=Math.round(H/2)+" "+Math.round(H/2);M.coordsize=F+" "+F;var B="";var C=F+H;if(A.use_shape){C=2000*E;B="m"+C+",0 ns l"+J+",0  qy"+F+","+K+" l"+C+","+K+" e "}else{B="m0,0 ns l"+J+",0  qy"+F+","+K+" l"+F+","+F+" l0,"+F+" e "}B+="m"+J+","+(-H)+" nf l"+J+",0 qy"+F+","+K+" l "+(C)+","+K+" e x";M.path=B;AC._cache[N]=M}return AC._cache[N].cloneNode(true)}AC._cache={};function Ah(B,A){var C=AC(B);C.fillcolor=B.bg_color[At[A]]||"#000";C.strokecolor=B.border_color||"#000";var D=AR("span",Az+" "+Az+"-"+A);D.appendChild(C);return D}function AE(A){AO(A.childNodes,function(){if(AJ(this,Az)){A.removeChild(this)}});AX(A)}function Ac(B){var A=B.radius+":"+(B.real_border_width||0)+":"+B.use_shape;if(!Al[A]){Al[A]=AY+Al.ix++}return Al[A]}function A0(A,M){var F=A.radius,E=A.real_border_width||0,D=(A.use_shape)?A.real_border_width-A.border_width:0;var K=Ac(A);if(!Al.created[K]){var H=(A2.version<7)?"."+K+" ."+Az:"."+K+">."+Az;var L=-E,J=-1-E;Av(H,"width:"+(F+E+1)+"px;height:"+(F+1)+"px");if(A.use_shape){J=-F-1-D;var C=F+A.border_width*2+D;AH(M,K,A);var G=Math.max(F-E*2,0),B=Math.min(F-E*2,0)*-1;if(A2.version<7){B+=parseInt(AK(M,"padding-left")||0)+parseInt(AK(M,"padding-right")||0)}var I="width:100%;clip:rect(auto auto auto "+G+"px);padding-right:"+B+"px;left:"+(-E-G)+"px;";Av(H+"-tl",I+"top:"+J+"px;");Av(H+"-tl ."+Ao,"left:"+G+"px");Av(H+"-bl",I+"bottom:"+J+"px;");Av(H+"-bl ."+Ao,"left:"+G+"px")}else{Av(H+"-tl","left:"+L+"px;top:"+J+"px;");Av(H+"-bl","left:"+L+"px;bottom:"+J+"px;")}if(A2.version<7){L=-F+(E?F%2-E%2:-F%2);Av(H+"-tr","left:"+L+"px;top:"+J+"px;");Av(H+"-br","left:"+L+"px;bottom:"+J+"px;")}else{Av(H+"-tr","right:"+L+"px;top:"+J+"px;");Av(H+"-br","right:"+L+"px;bottom:"+J+"px;")}Al.created[K]=true}}AB=function(A,C){var B=AG(A,C);A0(B,A);AO(["tl","tr","bl","br"],function(){A.appendChild(Ah(B,this))});A.className+=" "+Ac(B)+" "+Az+"-init"};Am.update=function(){AW(arguments,function(){AE(this);AB(this)})};Ab(function(){Ak.cssText+=Ae;Ae="";Av=Ak.addRule})}return Am})();$(function(){$("#menu li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})});(function(A){A.widget("ui.autocomplete",{_init:function(){var C=this.element,D=this.options,B=this;C.addClass("ui-autocomplete-input").bind("blur",function(){if(!A(".ui-autocomplete-active","#ui_autocomplete_container").length){A("#ui_autocomplete_container").remove()}}).keyup(function(E){B._onKeyPress(E,C,D)}).attr("autocomplete","off");C.bind("keydown","up",function(E){B._upArrowPress(E)}).bind("keydown","down",function(E){B._downArrowPress(E)}).bind("keydown","return",function(E){if(A(".ui-autocomplete-container").length){E.stopPropagation();E.stopImmediatePropagation();if(A(".ui-autocomplete-active").find("a").length==0){B._selectActive(C,D,A("#ui_autocomplete_container a").first())}else{B._selectActive(C,D,A(".ui-autocomplete-active a","#ui_autocomplete_container"))}}})},_markActive:function(C,B){A(".ui-autocomplete-active",C).removeClass("ui-autocomplete-active");B.addClass("ui-autocomplete-active")},_selectActive:function(C,B,D){var E=D.html();if(typeof (B.select)=="function"){E=B.select.call(C,D)}if(D.length){this._setValue(C,B,E)}A("#ui_autocomplete_container").remove();if(typeof (B.user_complete)=="function"){B.user_complete.call(C)}},_onArrowKeyPress:function(E){var B=A("#ui_autocomplete_container");var C=this;if(!B.length){return }var F=false;var D=B.find("li");D.each(function(G,I){I=A(I);if(F){return }if(I.hasClass("ui-autocomplete-active")){var H=(E=="down")?((G<D.length-1)?G+1:0):((G>0)?G-1:D.length-1);C._markActive(B,D.eq(H));F=true}});if(!F){C._markActive(B,D.eq(0))}},_upArrowPress:function(B){this._onArrowKeyPress("up")},_downArrowPress:function(B){this._onArrowKeyPress("down")},_onKeyPress:function(C,D,F){window.clearTimeout(this.interval);var B=this;if(typeof (F.keypress)=="function"){F.keypress.call(D,C)}var E=F.parser(D.val());if(E&&this.val!=E){this.val=E;this.interval=window.setTimeout(function(){B._loadVariants(D,F,function(G){if(G.length==1&&E==G[0]){return }var H=F.visualize.call(D,G);B._constructVisualize(D,F,H)})},F.timeout)}},_setValue:function(D,C,F){var B=D.val();replace_val=C.parser(B);var E=new RegExp(replace_val+"$","g");B=B.replace(E,F+(C.multiple?", ":""));D.val(B)},_constructVisualize:function(G,F,I){var E=this;A("#ui_autocomplete_container").remove();if(!I.children().length){return }var D=A("<div />");D.append(I).appendTo(G.parent());D.addClass("ui-autocomplete-container").attr("id","ui_autocomplete_container");D.css("left",G.position().left);var H=G.position().top+18;D.css("top",H);var B=I.find("li");B.bind("mouseover",function(J){E._markActive(I,A(this))});var C=I.find("a");C.bind("click",function(J){E._selectActive(G,F,A(this))});A(document).bind("keydown","esc",function(){D.remove()})},_loadVariants:function(B,C,D){C.getter.call(B,C.parser(B.val()),D)},disable:function(){this.element.addClass("ui-autocomplete-disabled")},enable:function(){this.element.removeClass("ui-autocomplete-disabled")}});A.extend(A.ui.autocomplete.prototype,{options:{getter:function(B,C){A.ajax({url:"/ajax",type:"GET",params:{q:B},success:C})},select:function(B){return B},parser:function(B){return B.toString()},keypress:null,timeout:350,visualize:function(B){return A(B)},multiple:true,user_complete:function(){}},getter:""})})(jQuery);function fix_ie_last_child(){var A=null;if($.browser.msie){$("li:last",".menu-main ul").addClass("last")}}function init_title_best_tours(){$("a.scroll-handler").click(function(){var A=$(this);A.parent().children(".offers-wrapper").slideToggle("fast",function(){A.toggleClass("scrolled").html(A.hasClass("scrolled")?"Свернуть":"Показать")})})}function product_prices(B,A,D){var C=D;$("#product_prices").tourSelectList({template:"tourSelectList",opts:B,value:A}).bind("select",function(){window.location=C[$(this).val()]})}(function(){var B={};this.tmpl=function A(E,D){var C=!/\W/.test(E)?B[E]=B[E]||A(document.getElementById(E).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+E.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return D?C(D):C}})();$.widget.bridge=function(B,A){$.fn[B]=function(E){var C=typeof E==="string",D=Array.prototype.slice.call(arguments,1),F=this;E=!C&&D.length?$.extend.apply(null,[true,E].concat(D)):E;if(C&&E.charAt(0)==="_"){return F}if(C){this.each(function(){var G=$.data(this,B),H=G&&$.isFunction(G[E])?G[E].apply(G,D):G;if(H!==G&&H!==undefined||E=="asPublisher"){F=H;return false}})}else{this.each(function(){var G=$.data(this,B);if(G){G.option(E||{})._init()}else{$.data(this,B,new A(E,this))}})}return F}};function getCookieVal(B){var A=document.cookie.indexOf(";",B);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(B,A))}function GetCookie(D){var B=D+"=";var F=B.length;var A=document.cookie.length;var E=0;while(E<A){var C=E+F;if(document.cookie.substring(E,C)==B){return getCookieVal(C)}E=document.cookie.indexOf(" ",E)+1;if(E==0){break}}return null}function SetCookie(C,E){var A=SetCookie.arguments;var H=SetCookie.arguments.length;var B=(H>2)?A[2]:null;var G=(H>3&&A[3])?A[3]:"/";var D=(H>4&&A[4])?A[4]:ROOT_HOST;var F=(H>5)?A[5]:false;if(B!==null&&typeof (B.toGMTString)=="function"){B=B.toGMTString()}document.cookie=C+"="+escape(E)+((B===null)?"":("; expires="+B))+((G==null)?"":("; path="+G))+((D==null)?"":("; domain="+D))+((F==true)?"; secure":"")}function add_pre_load_pic(B){var A=new Image();A.src=B}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var current,_init=false,_stop=function(A){A.preventDefault();A.stopPropagation()},_black_color="#000000",_grey_color="#999999",_lightgrey_color="#b9b9b9",_def_style={filledCss:{color:_black_color},emptyCss:{color:_grey_color}},_light_def_style={filledCss:{color:_black_color},emptyCss:{color:_lightgrey_color}},_monthLabels=["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],_monthLabelsRP=["январе","феврале","марте","апреле","мае","июне","июле","августе","сентябре","октябре","ноябре","декабре"],_monthLabelsShort=["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],_monthLabelsShortRp=["янв.","февр.","марта","апр.","мая","июня","июля","авг.","сент.","окт.","нояб.","дек."];$.fn.hideOnClckOutside=function(A){var E=$(this),B=function(F){_stop(F)},D=function(){E.hide()},C=function(){E.show()};A.click(function(F){B(F);E.filter(":hidden").length?C():D()});$(document).click(D);return E.click(B)};$.objectSize=function(B){var C=0;for(var A in B){C++}return C};$.flattenObject=function(A){var B=A;$.each(B,function(D,C){if(C&&(typeof (C)=="object")){C=$.flattenObject(C);delete B[D];$.extend(B,C)}});return B};$.fn.serializeHash=function(){var B=this.serializeArray();var A={};for(var C=0;C<B.length;C++){A[B[C].name]=B[C].value}return A};function _getNumerableStringRu(C,B,A,D){if(C<10||C>20){if((C%10)==1){return B}else{if((C%10)>=2&&(C%10)<=4){return A}else{return D}}}else{return D}}function number_format(F,C,H,E){F=(F+"").replace(/[^0-9+\-Ee.]/g,"");var B=!isFinite(+F)?0:+F,A=!isFinite(+C)?0:Math.abs(C),J=(typeof E==="undefined")?",":E,D=(typeof H==="undefined")?".":H,I="",G=function(M,L){var K=Math.pow(10,L);return""+Math.round(M*K)/K};I=(A?G(B,A):""+Math.round(B)).split(".");if(I[0].length>3){I[0]=I[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,J)}if((I[1]||"").length<A){I[1]=I[1]||"";I[1]+=new Array(A-I[1].length+1).join("0")}return I.join(D)}function strip_tags(A,C){C=(((C||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var B=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,D=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return A.replace(D,"").replace(B,function(F,E){return C.indexOf("<"+E.toLowerCase()+">")>-1?F:""})}function preg_quote(A){return A.replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g,"\\$1")}function sprintf(){var F=/%%|%(\d+\$)?([-+#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;var G=arguments,E=0,I=G[E++];var A=function(N,J,K,M){var L=(N.length>=J)?"":Array(1+J-N.length>>>0).join(K);return M?N+L:L+N};var B=function(M,L,O,J,K){var N=J-M.length;if(N>0){if(O||!K){M=A(M,J," ",O)}else{M=M.slice(0,L.length)+A("",N,"0",true)+M.slice(L.length)}}return M};var H=function(P,O,N,Q,K,J,M){var L=P>>>0;N=N&&L&&{"2":"0b","8":"0","16":"0x"}[O]||"";P=N+A(L.toString(O),J||0,"0",false);return B(P,N,Q,K,M)};var D=function(M,N,K,J,L){if(J!=null){M=M.slice(0,J)}return B(M,"",N,K,L)};var C=function(T,X,L,K,Z,Q,W){if(T=="%%"){return"%"}var M=false,V="",S=false,U=false;for(var P=0;L&&P<L.length;P++){switch(L.charAt(P)){case" ":V=" ";break;case"+":V="+";break;case"-":M=true;break;case"0":S=true;break;case"#":U=true;break}}if(!K){K=0}else{if(K=="*"){K=+G[E++]}else{if(K.charAt(0)=="*"){K=+G[K.slice(1,-1)]}else{K=+K}}}if(K<0){K=-K;M=true}if(!isFinite(K)){throw new Error("sprintf: (minimum-)width must be finite")}if(!Q){Q="fFeE".indexOf(W)>-1?6:(W=="d")?0:void (0)}else{if(Q=="*"){Q=+G[E++]}else{if(Q.charAt(0)=="*"){Q=+G[Q.slice(1,-1)]}else{Q=+Q}}}var Y=X?G[X.slice(0,-1)]:G[E++];switch(W){case"s":return D(String(Y),M,K,Q,S);case"c":return D(String.fromCharCode(+Y),M,K,Q,S);case"b":return H(Y,2,U,M,K,Q,S);case"o":return H(Y,8,U,M,K,Q,S);case"x":return H(Y,16,U,M,K,Q,S);case"X":return H(Y,16,U,M,K,Q,S).toUpperCase();case"u":return H(Y,10,U,M,K,Q,S);case"i":case"d":var O=parseInt(+Y);var R=O<0?"-":V;Y=R+A(String(Math.abs(O)),Q,"0",false);return B(Y,R,M,K,S);case"e":case"E":case"f":case"F":case"g":case"G":var O=+Y;var R=O<0?"-":V;var J=["toExponential","toFixed","toPrecision"]["efg".indexOf(W.toLowerCase())];var N=["toString","toUpperCase"]["eEfFgG".indexOf(W)%2];Y=R+Math.abs(O)[J](Q);return B(Y,R,M,K,S)[N]();default:return T}};return I.replace(F,C)}function htmlspecialchars(C,H,G,B){var E=0,D=0,F=false;if(typeof H==="undefined"||H===null){H=2}C=C.toString();if(B!==false){C=C.replace(/&/g,"&amp;")}C=C.replace(/</g,"&lt;").replace(/>/g,"&gt;");var A={"ENT_NOQUOTES":0,"ENT_HTML_QUOTE_SINGLE":1,"ENT_HTML_QUOTE_DOUBLE":2,"ENT_COMPAT":2,"ENT_QUOTES":3,"ENT_IGNORE":4};if(H===0){F=true}if(typeof H!=="number"){H=[].concat(H);for(D=0;D<H.length;D++){if(A[H[D]]===0){F=true}else{if(A[H[D]]){E=E|A[H[D]]}}}H=E}if(H&A.ENT_HTML_QUOTE_SINGLE){C=C.replace(/'/g,"&#039;")}if(!F){C=C.replace(/"/g,"&quot;")}return C}function getWindowCenter(){var A={left:0,top:0};try{_doc_width=window.screen.width,_doc_height=window.screen.height;A.left=Math.round(_doc_width/2);A.top=Math.round(_doc_height/2)}catch(B){}return A}function getPopupWindowSettings(B,D,A,E){var C=Math.round(A/2),F=Math.round(E/2);return"width="+A+",height="+E+",left="+(B-C)+",top="+(D-F)+",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no"}function iewrap(A){if($.browser.msie&&$.browser.version<=8){$(A)}else{A()}}function shareVK(A){try{VK.Share.button({description:"",title:A.title,url:A.url})}catch(B){$(this).hide()}VK.Share.click(0,this)}function shareTwi(B){var A=getWindowCenter();window.open("http://twitter.com/share?url="+B.url+"&text="+B.text,"Twitter",getPopupWindowSettings(A.left,A.top,540,280))}function shareFb(A){var B=getWindowCenter();window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(A.url),"FaceBook",getPopupWindowSettings(B.left,B.top,590,450))}function shareLj(B){var A=getWindowCenter();var C='<a href="'+B.url+'">'+B.url+"</a>";if($.browser.msie&&$.browser.version>=8){}else{if(typeof (B.info)!="undefined"){C="<br/>"+B.info+"<br/><br/>"+C}if(typeof (B.photo)!="undefined"){C='<img src="'+B.photo+'" />'+C}}window.open("http://livejournal.com/update.bml?event="+encodeURIComponent(C)+"&subject="+B.text,"LiveJournal",getPopupWindowSettings(A.left-300,A.top-300,1000,600))}function shareMail(A){$("#share-mail").trigger("click")}function share_social_media(C,B,E,D,A){$("#vk-button").click(function(F){_stop(F);shareVK.call(this,C)});$("#twi-button").click(function(F){_stop(F);shareTwi.call(this,E)});$("#fb-button").click(function(F){_stop(F);shareFb.call(this,B)});$("#lj-button").click(function(F){_stop(F);shareLj.call(this,D)});$("#mail-button").click(function(F){_stop(F);shareMail.call(this,A)})}function country_visa_form_001(B){var A=$("#visa_form_container");if(B.form_template){$("#visa_add_tourist").click(function(){$(".last",A).before(B.form_template)})}}function country_visa_info_001(){$("#visa_issue_selector, #visa_citizenship_selector").children("a.selected").click(function(A){$(this).parent().toggleClass("active");$("#visa_issue_selector, #visa_citizenship_selector").not($(this).parent()).removeClass("active");A.stopPropagation()});$("#visa_issue_selector, #visa_citizenship_selector").find("ul.scroll").delegate("li","click",function(){window.location=$(this).find("a").attr("href")});$(document).click(function(A){$("#visa_issue_selector, #visa_citizenship_selector").removeClass("active")}).keydown(function(A){if(A.keyCode==27){$("#visa_issue_selector, #visa_citizenship_selector").removeClass("active")}})}function forum_auth(){$(function(){$(".b-create-new").authBind("click",function(A){_stop(A);window.location.href=$(A.target).attr("href")},"Чтобы создать тему, войдите на сайт.");$(".b-reply a").authBind("click",function(A){_stop(A);window.location.href=$(A.target).attr("href")},"Чтобы ответить, войдите на сайт.")})}function places_search_form(A){$(function(){$("#search_name").smart_input($.extend(_def_style,{label:A}));$("#placessearch a").click(function(B){B.preventDefault();B.stopPropagation();if($("#search_name").val()){$("#error_empty_name").hide();$("#placessearch input[name=]").remove();$("#placessearch").submit()}else{if($("#error_no_places").length==0){$("#error_empty_name").show()}}});$("#placessearch input").keydown(function(B){$("#error_empty_name").hide();if(B.keyCode=="13"&&$("#search_name").val()){$("#placessearch input[name=]").remove();$("#placessearch").submit()}else{if(B.keyCode=="13"&&$("#error_no_places").length==0){$("#error_empty_name").show()}}})})}function region_weather_03(C,E,D,A){var B=$("#weather_info_region_selector");if(B.length){B.tourSelectList({template:"tourSelectList",opts:C,optGroups:E,value:D}).bind("select",function(){window.location=A[$(this).val()]});$.History.bind(function(F){if(F=="info"){$.scrollTo(B,{offset:-100,duration:800})}})}}function tour_details_head_01(C,B){var A=$("#show_tour_code");A.click(function(){A.sleep();new JSONRequest({method:"generateTourCode",params:[C],success:function(D){A.wakeup();if(D.success){A.parent().hide();$("#tour_code span").html(D.tour_code);$("#tour_code").show()}}})});$("#tour_show_form").click(function(){$("#tour_actions_block").fadeOut(function(){$("#tour_order_form_block").fadeIn()})})}function init_photo_lister(K){var J=K.num_el,B=K.photo_el,C=K.pics,I=K.prev_btn,A=K.next_btn;var H=parseInt(J.html());var F=document.createElement("div");var G=[];if(C.length<=10){G=C}else{for(var E=0;E<5;E++){G.push(C[E]);G.push(C[C.length-E-1])}}$(F).css({position:"absolute",top:"-10000px",left:"-10000px",visibility:"hidden",zIndex:-1});document.body.appendChild(F);F.innerHTML=G.join("");function D(L){if(L>C.length){L=1}else{if(L<1){L=C.length}}H=L;J.html(H);B.html(C[L-1]);if(L>=5&&L<=C.length-5-1){F.innerHTML=C[L-2]+C[L]}}A.click(function(L){L.preventDefault();D(H+1)});I.click(function(L){L.preventDefault();D(H-1)});D(H)}function tour_details_form_01(C,J,D,F,K,H,A,G,I,B,E){$(function(){var P=$("#tour_order_form"),L=$("#site_order_client_name"),O=$("#site_order_client_phone"),S=$("#site_order_client_email"),M=$("#site_order_client_more"),N=$("#site_order_errors div");_email_regexp=/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i;_phone_regexp=/^\+?[\d\-\s\(\)]{7,14}/;var Q=function(){N.fadeOut()};function R(T,U){T.html(U);T.fadeIn()}L.smart_input($.extend(_def_style,{label:C,onFocus:Q}));O.smart_input($.extend(_def_style,{label:F,onFocus:Q}));S.smart_input($.extend(_def_style,{label:K,onFocus:Q}));M.smart_input($.extend(_def_style,{label:H,onFocus:Q}));$("#tour_order_form_submit").live("click",function(U){U.preventDefault();var V=true;var Y=L.val();if(!Y){R($("#error_site_order_client_name"),A);V=false}var W=O.val();var X=S.val();if(V&&!X==""&&!X.match(_email_regexp)){R($("#error_site_order_client_email"),I);V=false}if(!X&&W&&!W.match(_phone_regexp)){R($("#error_error_site_order_global"),B);V=false}if(V&&!W&&!X){R($("#error_error_site_order_global"),G);V=false}if(V){$("#tour_order_form_submit").sleep();function T(){$.ajax({data:$("#tour_order_form").serializeArray(),type:"POST",url:P.attr("action"),complete:function(){$("#tour_order_form_submit").wakeup()},success:function(Z){$("#tour_order_form").slideUp("fast",function(){$("#tour_order_form_result").html(Z).slideDown()})}})}setUserVid(T)}})})}function country_currency_info_text(){$(function(){$("#currency_country_selector a.selected").click(function(A){$("#currency_country_selector").toggleClass("active");A.stopPropagation()});$(document).click(function(A){$("#currency_country_selector").removeClass("active")})})}function country_currency_info_products(){var C=$("#page").find("ul.product-prices");var B=C.offset();function A(){$("div.more-info").filter(":visible").addClass("hidden");$("div.more-info").filter(":visible").css("z-index","1");$(".product-prices li").css("z-index","1")}function D(F){A();var H=$(F).closest("li");var E=H.css("z-index","5");var E=H.find("div.more-info").removeClass("hidden");var I=E.offset();if(I.left-B.left<0){var G=parseInt(E.css("right"));E.css({right:G-(B.left-I.left)+"px"})}else{if((B.left+C.width())-(I.left+E.width())<0){var G=parseInt(E.css("right"));E.css({right:"-5px"})}}}$("div.l-block-image").click(function(E){E.preventDefault();D(this)});$("div.more-info").click(function(E){E.preventDefault();A()});$(document).keydown(function(E){if(E.keyCode==27){A()}})}function country_currency_info_converter(G,D,B,E,C){function F(L){if(L=="left"&&parseFloat(J.val())){var K=A.attr("rate")/J.attr("rate");A.val(parseFloat(J.val()*K).toFixed(2))}else{if(L=="right"&&parseFloat(A.val())){var K=J.attr("rate")/A.attr("rate");J.val(parseFloat(A.val()*K).toFixed(2))}}}function I(L){var K;if(L.charCode!=undefined){K=L.charCode}else{K=L.keyCode}return((K>=48&&K<=57)||K==46||K==0||(K>=37&&K<=40)||K==8||K==46||K==9)}function H(L,N,O,M,K){$("#left_currency").tourSelectList({template:"tourSelectList",itemTemplate:"item-currency-list",opts:L,value:M,optGroups:O}).bind("select",function(){var P=N[$(this).val()];J.attr("rate",P);A.keyup()});$("#right_currency").tourSelectList({template:"tourSelectList",itemTemplate:"item-currency-list",opts:L,value:K,optGroups:O}).bind("select",function(){var P=N[$(this).val()];A.attr("rate",P);J.keyup()})}var J=$("#left_currency_input");var A=$("#right_currency_input");H(G,D,B,E,C);$(J,A).keypress(function(K){if(!I(K)){return false}});J.keyup(function(K){this.value=this.value.replace(/[^0-9\.]/g,"");F("left")});A.keyup(function(K){this.value=this.value.replace(/[^0-9\.]/g,"");F("right")});J.keyup()}function countrysearch_002(A,B){$(function(){$("#country_filter").smart_input({label:B["input_label"],filledCss:{color:_black_color},emptyCss:{color:"#666666"}});$("#country_filter").simple_autocomplete({data:A,onFound:function(){$("#search_error").hide()},onSearch:function(){$("#search_error").hide()},onNotFound:function(){$("#search_error").show()},onConfirm:function(){var C=$("#ui_autocomplete_container .ui-autocomplete-active a").eq(0).attr("href");if(C){window.location.href=C}},onOpen:function(){$("#country_sort, #countries").fadeTo(0,0.5)},onClose:function(){$("#country_sort, #countries").fadeTo(0,1)},min_len:1});$("#country_filter_execute").click(function(C){if($("#country_filter").val().length){$("#country_filter").simple_autocomplete("search",$("#country_filter").val())}$("#country_filter").focus();C.stopPropagation();C.preventDefault()})})}function countrysearch_001(B){var A=["popularity","down"];var C=function(F,H){var G=$("#countries");var D;var E=B[F][H];$.each(E,function(){var J=$("#country_"+this);J.removeClass("last");if(F=="name"){var I=$.trim(J.text()).substr(0,1);if(D&&D!=I){J.addClass("last")}D=I}$(G).prepend(J)})};$("#country_sort a").click(function(D){var E=A;if(A[0]==$(this).attr("order")){if(A[1]=="down"){E[1]="up"}else{E[1]="down"}}else{E[0]=$(this).attr("order");E[1]="down";$("#country_sort a").attr("class","")}$(this).attr("class",E[1]);C(E[0],E[1]);A=E})}function init_calendar(){$("#link-drop-departure-start-calendar li._c").live("mouseenter",function(){$("#link-drop-departure-start-calendar li").removeClass("fake left");var G=$(this).addClass("fake"),C=$(this).closest("div.month").prev("div.month").find("li"),A=$(this).closest("div.month").next("div.month").find("li"),D=C.add(G.prevAll()).addClass("fake"),B=G.nextAll().add(A),F=A.filter(".selected_dates").length?A.first().nextUntil(".selected_dates").andSelf().add(G.nextUntil(".selected_dates")):G.nextUntil(".selected_dates"),E=B.filter(".selected_dates");if(E.length){G.addClass("left");E.first().addClass("left");F.addClass("fake left")}});$("#link-drop-departure-end-calendar li._c").live("mouseenter",function(){$("#link-drop-departure-end-calendar li").removeClass("fake right");var G=$(this).addClass("fake"),D=$(this).closest("div.month").prev("div.month").find("li"),B=$(this).closest("div.month").next("div.month").find("li"),E=D.add(G.prevAll()),C=G.nextAll().add(B).addClass("fake"),A=D.filter(".selected_dates").length?D.last().prevUntil(".selected_dates").andSelf().add(G.prevUntil(".selected_dates")):G.prevUntil(".selected_dates"),F=E.filter(".selected_dates");if(F.length){G.addClass("right");F.last().addClass("right");A.addClass("fake right")}})}function init_form_meta(A){$("#meta-slug").val(A);$(".meta-filler").show();$("#meta-filler-link").click(function(){$.post("/system/metaEdit/",{get_metas:1,slug:A},function(B){if(B.credentials==1){$("#meta-title").val(B.title);$("#meta-desc").val(B.description);$("#meta-keywords").val(B.keywords)}else{alert("Нет прав для редактирования мета-тегов")}});$("#popup-meta-filler").show()});$("#popup-meta-filler-close").click(function(){$("#popup-meta-filler").hide()});$("#edit-meta-form").submit(function(){data_form=$(this).serializeArray();data_form.set_metas=1;$.post("/system/metaEdit/",data_form,function(B){if(B.success==1){$(".popup-meta-filler").hide()}else{alert("Не удалось сохранить теги")}});return false})}function init_form_seo_text(A,B){$("#seo-text-init-btn-"+B).click(function(){$.post("/system/seoContentEdit/",{get_content:1,slug:A+B},function(C){if(C.credentials==1){$("#edit-seo-form-"+B+" input[name=title]").val(C.title);$("#edit-seo-form-"+B+" textarea[name=content]").text(C.content)}else{alert("Нет прав для редактирования seo текста")}});$("#popup-seo-text-"+B).show();return false});$(".popup-seo-filler-close").click(function(){$(".popup-meta-filler").hide()});$("#edit-seo-form-"+B).submit(function(){data_form=$(this).serializeArray();data_form.set_metas=1;$.post("/system/seoContentEdit/",data_form,function(C){if(C.success==1){$(".popup-meta-filler").hide()}else{alert("Не удалось сохранить теги")}});return false})}function init_form_extended(){if($.hash()){var C=$.hash();var F=C.replace(/.*DaF\=([^&]+)\&.*/,"$1");var A=C.replace(/.*DaT\=([^&]+)\&.*/,"$1");var B=F.match(/^([+-])([0-9]+)d$/);if(B){var D=new Date();var E=B[2]*86400;if(B[1]=="-"){E*=-1}D=new Date(D.getTime()+E*1000);C=C.replace(/DaF\=([^&]+)\&/,"DaF="+D.getDate()+"."+(D.getMonth()+1)+"."+D.getFullYear()+"&")}var B=A.match(/^([+-])([0-9]+)d$/);if(B){var D=new Date();var E=B[2]*86400;if(B[1]=="-"){E*=-1}D=new Date(D.getTime()+E*1000);C=C.replace(/DaT\=([^&]+)\&/,"DaT="+D.getDate()+"."+(D.getMonth()+1)+"."+D.getFullYear()+"&")}$.hash(C)}$(function(){var G=new internalFormHandler(initExtendedForm);$("#next_page:not(.btn-disabled)").live("click",function(H){_stop(H);G.nextPage()});$("#prev_page:not(.btn-disabled)").live("click",function(H){_stop(H);G.prevPage()})})}function init_form_short_internal(){$(function(){var A=new hotelFormHandler(initShortForm);$("#next_page:not(.btn-disabled)").live("click",function(B){_stop(B);A.nextPage()});$("#prev_page:not(.btn-disabled)").live("click",function(B){_stop(B);A.prevPage()})})}function _remove_tour(C,B,A){if(!B){return }if(!confirm(A)){return }var D=$(C).closest("div.x_meneger").prev("a.x");D.sleep();new JSONRequest({method:"removeTour",params:[B],success:function(){D.wakeup().fadeOut()}})}function tourstanok_tour_details(){$(function(){$("#select-city-dropdown").formWidgetCollapsable({getValue:function(D){return{phone:D.attr("phone"),city:D.attr("city")}}});var C=new subscriber({}),B=$("#tour_info_block"),A=B.children("div");C.addSubscribeHandler($("#select-city-dropdown").formWidgetCollapsable("asPublisher"),"valueChange",function(D,F){$("#phone-number-span").html(F.phone);var E=$("#tourstanok_offices").children("div").hide().filter('[city="'+F.city+'"]').show();$("#address_to_buy_block").children("div").html(E.html())});$("#address_to_buy").click(function(D){_stop(D);var E=$("#address_to_buy_block",B);E.children("div").html($("#tourstanok_offices").children("div:visible").html());if(A.filter("div:visible").length){A.hide();E.show()}else{A.hide();E.slideDown(500)}});$("#what_are_you_talking_about").click(function(D){_stop(D);if(A.filter("div:visible").length){A.hide();$("#what_are_you_talking_about_block",B).show()}else{A.hide();$("#what_are_you_talking_about_block",B).slideDown(500)}});$("#how_to_order_tour").click(function(D){_stop(D);if(A.filter("div:visible").length){A.hide();$("#how_to_order_tour_block",B).show()}else{A.hide();$("#how_to_order_tour_block",B).slideDown(500)}})})}function tour_details_gallery_01(A){$.each(A,function(C,D){var B=new Image();B.src=D});$(function(){var F=$("#hotel-images-holder"),D=F.find("img"),E=F.find("a.prev"),C=F.find("a.next"),B=0,G=function(H){if(A[B]!==undefined){D.attr("src",A[B]);if(B==0){E.hide()}else{E.show()}if(B==(A.length-1)){C.hide()}else{C.show()}}};if(A.length){E.click(function(){if(B>0){G(--B)}});C.click(function(){if(B<(A.length-1)){G(++B)}});G(B)}else{F.hide()}})}function region_info_001(){$('a[rel="region_photo"]').lightBox({fixedNavigation:true,imageLoading:"/images/lightbox-ico-loading.gif",imageBtnPrev:"/images/lightbox-btn-prev.gif",imageBtnNext:"/images/lightbox-btn-next.gif",imageBtnClose:"/images/lightbox-btn-close.gif",imageBlank:"/images/lightbox-blank.gif",txtImage:"Фото",txtOf:"из"})}function country_info_001(){$(document).ready(function(){$("#info_navigation a").each(function(){if($(this).attr("href").search("#")){$(this).attr("href",$(this).attr("href").replace("#","#j"))}})});$.History.bind(function(A){$("#info_content h2 span").removeClass("active");if(A){$.scrollTo($("#"+A.slice(1)),{offset:-100,duration:800});$("#"+A.slice(1)+" span").addClass("active");$("#info_navigation a").removeClass("active");$('#info_navigation a[href="'+window.location.href+'"]').addClass("active")}})}function country_currency_001(E){var D=$("#currency_selector"),C=E,B="left";function F(G){if(G!=undefined){B=G}if(B=="left"&&$("#left_currency").val()==parseFloat($("#left_currency").val())){$("#right_currency").val(parseFloat(($("#left_currency").val())/C).toFixed(2))}else{if(B=="right"&&$("#right_currency").val()==parseFloat($("#right_currency").val())){$("#left_currency").val(parseFloat(($("#right_currency").val())*C).toFixed(2))}}}function A(H){var G;if(H.charCode!=undefined){G=H.charCode}else{G=H.keyCode}var I=((G>=48&&G<=57)||G==46||G==0||(G>=37&&G<=40)||G==8||G==46||G==9);return I}$("#left_currency").keypress(function(G){if(!A(G)){return false}});$("#right_currency").keypress(function(G){if(!A(G)){return false}});$("#left_currency").keyup(function(G){this.value=this.value.replace(/[^0-9\.]/g,"");F("left")});$("#right_currency").keyup(function(G){this.value=this.value.replace(/[^0-9\.]/g,"");F("right")});D.find("a.selected").click(function(G){D.toggleClass("active");G.stopPropagation()});D.find("ul").click(function(G){var H=$(G.target).closest("li");if(H.length){D.find("a strong").html(H.closest("li").html());C=H.closest("li").attr("rate");F()}});$(document).click(function(G){D.removeClass("active")})}function title_user_reviews_001(B){var A=$("#review_country_selector");A.find("a.selected").click(function(C){A.toggleClass("active");C.stopPropagation()});A.find("ul").click(function(C){var D=$(C.target).closest("li");if(D.length){A.find("a strong").html(D.closest("li").html());A.attr("country_id",D.closest("li").attr("country_id"));$("#add_country_review").attr("href",B+"&country="+A.attr("country_id"))}});$(document).click(function(C){A.removeClass("active")})}function country_review_001(A){$(function(){$(".country_reviews a.add,#add_review_text").authBind("click",function(B){_stop(B);window.location.href=A},"Чтобы добавить отзыв,<br> войдите на сайт.")})}function country_review_list_actions_init(){$(".country_reviews .moderate .delete").click(function(){var A=$(this);var D=A.parent().parent();if(confirm("Точно удалить?")){D.sleep();var C=A.get(0).href;var B=C.substr(-1)!="#";JSONRequest({method:"countryReviewDelete",params:[A.attr("article_id")],success:function(E){D.wakeup();if(E.success){if(B){location.href=C}else{D.fadeOut(700);D.remove()}}}})}return false})}function country_review_form_init(B,F,H,C,P,J,K,O,I,E,G,L){var M=$("#region_id_selector").formWidgetCollapsable({name:"region",getValue:function(Q){return Q.attr("item_id")}}),N=false,D=new (function(){subscriber(this)})();D.addSubscribeHandler(M.formWidgetCollapsable("asPublisher"),"valueChange",function(Q,R){$("#article_region").val(R);N=true});var A=$("#month_id_selector").find("a.selected");A.click(function(Q){_stop(Q);$("#month_id_selector").toggleClass("active")});$(document).click(function(){$("#month_id_selector").removeClass("active")});$("#review-visit-calendar").month_calendar({onSelect:function(Q){var T=Q.getFullYear(),S=Q.getMonth()+1,R=Q.getDate(),U="в "+_monthLabelsRP[S-1]+" "+T;ys=new String(T);ms=new String(S);if(ms.length==1){ms="0"+ms}$("#article_event_month").val(ms);$("#article_event_year").val(ys);$(this).closest("div.select").find("a.selected").find("strong").html(U);$("#month_id_selector").removeClass("active")},minDate:"1990-01-01",disabledClass:"none"});$("#add_review_form").submit(function(){$(".error-bubbles div").fadeOut(500);var Q=$("#article_people_name");if(Q.length){if(!Q.val()&&!$("#article_people_email").val()){$("#no-name-email").text(G);$("#no-name-email").fadeIn(500);return false}}if(!$("#article_event_month").val()||!$("#article_event_year").val()){$.scrollTo($("#month_id_selector"),500,{offset:-80,onAfter:function(){$("#no-date").text(K);$("#no-date").fadeIn(500)}});return false}if(!$("#article_region").val()&&N!==true){$.scrollTo($("#region_id_selector"),500,{offset:-80,onAfter:function(){$("#no-region").text(O);$("#no-region").fadeIn(500)}});return false}if(!$("#article_title").val()){$.scrollTo($("#titleanchor"),500,{offset:-150,onAfter:function(){$("#no-header").text(I);$("#no-header").fadeIn(500)}});return false}if(!$("#article_content").val()){$.scrollTo($("#bodyanchor"),500,{offset:-80,onAfter:function(){$("#no-text").text(E);$("#no-text").fadeIn(500)}});return false}if($("#article_title").val().length<3){$.scrollTo($("#titleanchor"),500,{offset:-150,onAfter:function(){$("#no-header").text(P);$("#no-header").fadeIn(500)}});return false}if($("#article_content").val().length<3){$.scrollTo($("#bodyanchor"),500,{offset:-80,onAfter:function(){$("#no-text").text(J);$("#no-text").fadeIn(500)}});return false}$(this).sleep().attr("action",L);return true});$("#add_review_form input, #add_review_form textarea").focusin(function(){$(this).removeClass("inactive");$(".error-bubbles div").fadeOut(500)}).focusout(function(){$(this).addClass("inactive")});$("#article_people_name").smart_input($.extend(_def_style,{label:B}));$("#article_people_email").smart_input($.extend(_def_style,{label:F}));$("#article_title").smart_input($.extend(_def_style,{label:H}));$("#article_content").smart_input($.extend(_def_style,{label:C}));$("#add_review_form .submit_review").unbind().click(function(Q){Q.preventDefault();setUserVid(function(){$("#add_review_form").submit()})})}function article_list_select_country_js(C){C=C.replace("?","");var B=$("#country_id_selector").formWidgetCollapsable({name:"country",getValue:function(D){return D.attr("item_id")}}),A=new (function(){subscriber(this)})();A.addSubscribeHandler(B.formWidgetCollapsable("asPublisher"),"valueChange",function(D,E){$(".country_reviews").sleep();window.location.href=E?C+E+"/":C})}function article_list_select_region_js(B){B=B.replace("?","");var C=$("#region_id_selector").formWidgetCollapsable({name:"region",getValue:function(D){return D.attr("item_id")}}),A=new (function(){subscriber(this)})();A.addSubscribeHandler(C.formWidgetCollapsable("asPublisher"),"valueChange",function(D,E){$(".country_reviews").sleep();window.location.href=E?B+E+"/":B})}function country_review_comment_form_init(){var B=$("#add_comment2"),A=$("#comment-form-btn-blue");A.unbind().click(function(){B.sleep();$.post(B.attr("action"),B.serializeArray(),function(C){var D=$(C);$("textarea",B).val("");B.wakeup();$(".response_comments .comments .error").remove();$(".response_comments").show();$(".response_comments .comments").append(D);$.scrollTo(D,500)});return false});$("#add_comment_button").click(function(){$.scrollTo(B,500);return false});$("#login_and_add_comment").authBind("click",function(){this.parent().hide();B.parent().show();$("#add_comment_button").show();$("#comment_text").focus();return false},"Чтобы добавить отзыв,<br> войдите на сайт.")}function country_weather_001(){$(function(){var A=$(".whaters .select");A.click(function(B){_stop(B);var C=$(this);if(C.hasClass("active")){C.removeClass("active")}else{A.removeClass("active");$(this).addClass("active")}});$("li",A).click(function(B){$(this).find("a").click()});$(document).click(function(B){if(!$(B.target).closest(".whaters .select").length){A.removeClass("active")}});$("a",A).click(function(B){window.location.href=$(this).attr("href")})})}function winopen(A,B){window.open(A,"small_window","height=350,width=500,scrollbars=yes")}function reviews_success_001(){$(function(){$(".popup_bouncer").mouseenter(function(){$(".pop").hide();$("#pop_review_"+$(this).attr("id")).show()});$(".pop").mouseleave(function(){$(this).hide()})})}function activeCommentForm(E,C,B,A,D){$(function(){activeCommentFormDatePicker(A,B);var F=$("#when_selector");F.find("a.selected").click(function(H){_stop(H);F.toggleClass("active");$("#bad_date").fadeOut()}).end().click(function(H){H.preventDefault();H.stopPropagation()});$(document).click(function(){F.removeClass("active")});$("#comment_title").smart_input($.extend(_def_style,{label:C}));$("#comment_title").focus(function(){$("#bad_subject").fadeOut()});$("#comment_text").smart_input($.extend(_def_style,{label:D}));$("#comment_text").focus(function(){$("#bad_text").fadeOut()});var G=$("#active_comment_form .add_rait").find("a");G.click(function(H){_stop(H);var J=$(this).attr("class"),I=J.replace("r","");$("#bad_mark").fadeOut();$("#comment_mark").attr("value",I);$("#active_comment_form i.give_rating").attr("class","give_rating select"+I)});G.hover(function(){var I=$(this).attr("class");var H=I.replace("r","");$("#active_comment_form i.give_rating").attr("class","give_rating select"+H)},function(){var H=$("#comment_mark").attr("value");if(H){$("#active_comment_form i.give_rating").attr("class","give_rating select"+H)}else{$("#active_comment_form i.give_rating").attr("class","give_rating")}});$("#comment_submit").click(function(H){H.preventDefault();H.stopPropagation();if(!$("#tour_year").val()||!$("#tour_month").val()){$.bubble({obj:$("#when_selector"),body:"Укажите дату поездки"});return false}if(!$("#comment_mark").val()){$.bubble({obj:G,body:"Оцените достопримечательность"});return false}if(!$("#comment_title").attr("value")){$.bubble({obj:$("#comment_title_smart"),body:"Озаглавьте ваш отзыв"});return false}if(!$("#comment_text").val()){$.bubble({obj:$("#comment_text_smart"),body:"Опишите хотя бы немного ваши впечатления"});return false}$("#active_comment_form").sleep();$.ajax({data:{commentable_model:$("#active_comment_form").attr("commentable_model"),commentable_id:$("#active_comment_form").attr("commentable_id"),mark:$("#comment_mark").val(),text:$("#comment_text").val(),title:$("#comment_title").val(),tour_month:$("#tour_month").val(),tour_year:$("#tour_year").val()},url:E,cache:false,type:"POST",success:function(J){var I=$("<div>");$("#active_comments").prepend($(I));$(I).hide();$(I).append(J);$(I).slideDown(function(){$.scrollTo($("#active_comments"),"normal")});$("#comment_title").val("");$("#comment_text").val("");$("#comment_mark").val("");$("#tour_month").val("");$("#tour_year").attr("value","");$("#active_comment_form i.give_rating").attr("class","give_rating");$("#when_selector a.selected strong").html(B);$("#active_comment_form").slideUp();$("#add_post").slideDown()},complete:function(){$("#active_comment_form").wakeup()},error:function(){alert("Извините, произошла ошибка, попробуйте позже.")}})})})}function activeCommentFormLoged_01(){$(function(){$("#add_post, #top_add_post, #middle_add_post").click(function(A){_stop(A);$("#active_comment_form").show();if($(A.target).attr("id")=="top_add_post"){$("#add_post").hide()}$.scrollTo($("#active_comment_form"),0)})})}function activeCommentFormGuest_01(E,D,C,B,A){$(function(){$("#add_post, #top_add_post, #middle_add_post").authBind("click",function(F){_stop(F);var G=$(this);G.sleep();$.ajax({url:E,type:"GET",data:{commentable_model:$("#active_comment_form").attr("commentable_model")},success:function(H){$("#active_comment_form").html(H);$("#add_post").hide();$("#active_comment_form").slideDown();if($(F.target).attr("id")=="top_add_post"){$.scrollTo($("#active_comment_form"),0)}},complete:function(){G.wakeup()}})},A)})}function activeCommentFormDatePicker(A,B){$("#review-visit-calendar").month_calendar({onSelect:function(C){var F=C.getFullYear(),E=C.getMonth()+1,D=C.getDate(),G=A+_monthLabelsRP[E-1]+" "+F;ys=new String(F);ms=new String(E);if(ms.length==1){ms="0"+ms}$("#tour_month").val(ms);$("#tour_year").val(ys);$(this).closest("div.select").find("a.selected").find("strong").html(G);$("#when_selector").removeClass("active")},minDate:"1990-01-01",disabledClass:"none"})}function activeCommentsDetails_01(){$(function(){$('a[rel="active_photos"]').lightBox({fixedNavigation:true,imageLoading:"/images/lightbox-ico-loading.gif",imageBtnPrev:"/images/lightbox-btn-prev.gif",imageBtnNext:"/images/lightbox-btn-next.gif",imageBtnClose:"/images/lightbox-btn-close.gif",imageBlank:"/images/lightbox-blank.gif",txtImage:"Фото",txtOf:"из"})})}function formatUrlHash(A){return A.replace(/^.+?#/g,"").replace(/^#?\/?|\/?$/g,"")}function setUrlHash(A){A=formatUrlHash(A);A=A.replace(/^\/?|\/?(\?)|\/?$/g,"/$1");if(typeof window.location.hash!=="undefined"){window.location.hash=A}else{location.hash=A}return true}function getUrlHash(){var A=window.location.hash||location.hash;return formatUrlHash(A)}function contacts_managers_js_01(){$(function(){$("#managers img").each(function(){$(this).mouseenter(function(){function B(D){$(D).css("z-index",1);var C=$(D).find("img");$(C).animate({width:"69px",height:"69px",left:"0",top:"0"},100,function(){$(D).remove()})}if($("div.manager_popup").length!=0){$("div.manager_popup").each(function(){B($(this))})}A($(this));function A(D){var E=$('<div class="manager_popup" style="position: absolute; z-index: 1001;" />');var C=$('<img src="'+$(D).attr("src")+'" style="border: 2px solid #fff; width: 69px; height: 69px; position: relative; left: 0; top: 0;" />');$(E).append($(C));$(D).before($(E));$(C).animate({width:"118px",height:"118px",left:"-17px",top:"-17px"},150);$(E).mouseleave(function(){B($(this))})}})})})}function news_filter_001(){$(function(){var A=$("#news-filter");A.find("a.selected.roll-up").click(function(B){_stop(B);A.addClass("active")}).end().find("a.selected.roll-back").click(function(B){_stop(B);A.removeClass("active")}).end().find("ul li a").click(function(B){$(this).closest("ul").sleep()});$(document).click(function(B){if(!$(B.target).closest("#news-filter").length){A.removeClass("active")}})})}function vacancy_filter_001(){$(function(){var A=$("#vacancy-filter");A.find("a.selected.roll-up").click(function(B){_stop(B);A.addClass("active")}).end().find("a.selected.roll-back").click(function(B){_stop(B);A.removeClass("active")}).end().find("ul li a").click(function(B){$(this).closest("ul").sleep()});$(document).click(function(B){if(!$(B.target).closest("#vacancy-filter").length){A.removeClass("active")}})})}function vacancy_form_001(F,H,B,C,E,G,A,D){$(function(){var L=$("#respondvacancy-form"),J=$("#respondvacancy_name"),N=$("#respondvacancy_email"),M=$("#respondvacancy_additional"),I=$("#respondvacancy_details"),K=$("#respondvacancy_attachment");$("#send_resume").click(function(O){_stop(O);L.fadeIn("slow")});J.smart_input($.extend(_def_style,{label:H}));N.smart_input($.extend(_def_style,{label:B}));M.smart_input($.extend(_def_style,{label:C}));I.smart_input($.extend(_def_style,{label:E}));$("#respondvacancy-submit-button").click(function(O){_stop(O);J.prevAll("p.error").remove();if(!J.val()){$("<p>").addClass("error").text(G).insertBefore(J).show();return }N.prevAll("p.error").remove();if(!N.val()){$("<p>").addClass("error").text(A).insertBefore(N).show();return }K.prevAll("p.error").remove();if(!(I.val()||K.val())){$("<p>").addClass("error").text(D).insertBefore(K).show();return }L.attr("action",F).sleep().submit()})})}function contacts_office_success_001(){$(function(){var A=$("#office_selector");A.find("a.selected").click(function(){A.toggleClass("active")}).end().click(function(B){B.stopPropagation()});$(document).click(function(){A.removeClass("active")})})}function team_success_001(){$(function(){var A=$("#team_city_selector");A.find("a.selected").click(function(){A.toggleClass("active")}).end().click(function(B){B.stopPropagation()});$(document).click(function(){A.removeClass("active")})})}function contacts_office_description_success_001(B,G,H,E,A,D){function F(){if(!window.YMaps){return }var L=new YMaps.Map(YMaps.jQuery("#o_map_yandex")[0]);L.setCenter(new YMaps.GeoPoint(B,G),14);var K=new YMaps.Style();K.iconStyle=new YMaps.IconStyle();K.iconStyle.href=A;K.iconStyle.size=new YMaps.Point(56,50);K.iconStyle.offset=new YMaps.Point(-28,-50);var J=new YMaps.Placemark(new YMaps.GeoPoint(B,G),{style:K});J.name=H;J.description=E;L.addOverlay(J);var I=new YMaps.TypeControl([YMaps.MapType.MAP,YMaps.MapType.SATELLITE,YMaps.MapType.HYBRID],[1,2]);L.addControl(I);L.addControl(new YMaps.ToolBar());L.addControl(new YMaps.Zoom());L.addControl(new YMaps.ScaleLine());if(D=="satellite"){L.setType(YMaps.MapType.SATELLITE)}}function C(){if(!window.google||!window.google.maps){return }if(D=="satellite"){var K=google.maps.MapTypeId.SATELLITE}else{var K=google.maps.MapTypeId.ROADMAP}var M=new google.maps.LatLng(G,B),J={zoom:14,center:M,mapTypeId:K},L=new google.maps.Map(document.getElementById("o_map_google"),J),I=new google.maps.Marker({position:M,map:L,title:H+" "+E,icon:A})}$(function(){$("a.map_switcher").click(function(){if(!$(this).hasClass("map_type_active")){$("#o_map .o_map").hide();if($(this).attr("id")=="map_type_yandex"){$("#o_map_yandex").show()}else{if($(this).attr("id")=="map_type_google"){$("#o_map_google").show()}else{$("#o_map_schema").show()}}if(!$(this).hasClass("clicked")){$(this).addClass("clicked");if($(this).attr("id")=="map_type_yandex"){F()}else{if($(this).attr("id")=="map_type_google"){C()}}}$(".map_type_active").toggleClass("map_type").toggleClass("map_type_active");$(this).toggleClass("map_type").toggleClass("map_type_active")}return false})})}function popular_countries_001(){$(function(){$("#popular_country_block").find("li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})})}function bhead_js_001(B,A){$(function(){$("#login-link").click(function(G){_stop(G);var H=this.href;if(H.length&&H.search("http")==0){window.location=renderAuthHash(H)}else{$.stupidModal("login",{positioning:"top",executeHandler:"authComplete"})}});$("#register-link").click(function(G){_stop(G);$.stupidModal("register",{positioning:"top"})});var E=$("#drop_down-city-list"),C=$("#b-smallchoiser-form"),D=$("#select-city-link");D.click(function(G){_stop(G);$(this).parent().addClass("active")});$("#deselect-city-link").click(function(G){_stop(G);D.parent().removeClass("active")});$(document).click(function(G){if(!$(G.target).closest("#drop_down-city-list").length){$("#select-city-link").parent().removeClass("active")}});function F(){var H=window.location.toString();var G=H.replace(/\?my_city=[a-z]+$/i,"");window.location=G.length!=H.length?G:H.replace(/my_city=[a-z]+/i,"");window.location.reload()}$("#b-smallchoiser-ul li").click(function(G){G.preventDefault();var H=$(this).attr("c");$("#b-smallchoiser-input",C).val(H);if(H!==undefined){$("#b-smallchoiser-form").sleep();function I(){$.ajax({url:B,type:"GET",data:{uniq:Math.random(),c:H},complete:function(){F()},success:function(){F()},error:function(){$("#b-smallchoiser").wakeup()}})}setUserVid(I)}});$("#menu_main li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$(".drop_down li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")})})}function review_card_01(A,B){$(function(){var C=$("#review_info .select");C.click(function(D){_stop(D);var E=$(this);if(E.hasClass("active")){E.removeClass("active")}else{C.removeClass("active");$(this).addClass("active")}});$(document).click(function(D){if(!$(D.target).closest("#review_info .select").length){C.removeClass("active")}});$(".review_info .select.duration ul, .review_info .select.goal ul, .review_info .select.follower ul").each(function(){$(this).find("li").click(function(){var D=$(this).text(),F=$(this).attr("val"),E=$(this).closest("div.select");E.find("a.selected strong").html(D).end().find("input:hidden").val(F).end().removeClass("hover")})});$("#review-visit-calendar").month_calendar({onSelect:function(D){var G=D.getFullYear(),F=D.getMonth()+1,E=D.getDate(),H=A+B[F-1]+" "+G;ys=new String(G);ms=new String(F);ds=new String(E);if(ms.length==1){ms="0"+ms}if(ds.length==1){ds="0"+ds}_value=ys+"-"+ms+"-"+ds;$(this).closest("div.select").find("a.selected").find("strong").html(H);$("#event-date").val(_value);$("#bag_date").fadeOut()},currentDate:$("#event-date").val(),minDate:"1990-01-01",disabledClass:"none"})})}function add_review_form_js(E,D,J,G,B,F,C,H,A,I){$(function(){var N=$("#span_average_rating"),Q=$("i",N.parent()),M=$("#add-review-text-form"),P=$(".marks-mark-input:input",M);var K=function(){var T=0,U=0;P.each(function(Y,Z){var a=parseInt($(Z).val(),10);if(a>0){U=U+parseInt(a);T++}});var S=T?U/T:0;S=Math.round(S*100)/100;N.text(S);var X=Math.floor(S),V=Math.abs(S-X),W=80*(5-X);if(V<0.125){W=W+0}else{if(V<0.375){W=W-20}else{if(V<0.625){W=W-40}else{if(V<0.99){W=W-60}}}}Q.css("background-position","0 -"+W+"px")};$(".give_rating",M).review_markable({averageMark:"#add-review-mark-overall-mark-label",onUpdate:K});var O={"#marks-comment-dest":J,"#marks-comment-service":G,"#marks-comment-food":B,"#marks-comment-territor":F,"#marks-comment-beach":C,"#marks-comment-animation":H,"#marks-comment-room":A,"#marks-comment-price":I};$.each(O,function(S,T){$(S).smart_input($.extend(_def_style,{label:T}))});$("#marks-username").click(function(){$("#bag_name").fadeOut()});$("#review_subject, #review_text").click(function(){$("#bag_story").fadeOut()});var L=function(S){var T=$(S).parent();$(T).find("input.marks-comment-input").attr("value","");$(T).find("i.give_rating").attr("class","give_rating");$(T).find("div").css("display","none")};$("a.marks-field-clear").click(function(S){_stop(S);L($(this))});var R=function(V){_stop(V);var Z=$("#add-review-text-form"),T=[],f=[],g=$("#marks-username"),Y=g.val(),U=$("#review_text_review").val(),X=$("#review_subject").val(),d=$("#review_text").val(),W={},b={},S=$("#span_average_rating"),h="normal",c={top:-200};if(g.length&&!Y){$.scrollTo($("#bag_name_anchor"),h,{offset:c,onAfter:function(){$("#bag_name").show()}});return false}else{if(!$("#event-date").val()){$.scrollTo($("#bag_date_anchor"),h,{offset:c,onAfter:function(){$("#bag_date").show()}});return false}else{if(S.text()=="0"){$("#help").hide();$.scrollTo($("#bag_rait_anchor"),h,{offset:c,onAfter:function(){$("#bag_rait").show()}});return false}else{if(!d&&!X){$.scrollTo($("#bag_story_anchor"),h,{offset:c,onAfter:function(){$("#bag_story").show()}});return false}}}}Z.sleep();$("#vote_hotel-div li").each(function(){var j=$(this).find(".marks-field-input").val(),l=$(this).find(".marks-comment-input").not('[name=""]').val(),k=$(this).find(".marks-mark-input").val();if(j&&(l||k)){b[j]={comment:l,mark:k}}});$(".file",$("#upload-user-foto-container")).each(function(k,l){var j=$(l).attr("item_id");if(j){T.push(j)}});$(".file",$("#upload-user-video-container")).each(function(k,l){var j=$(l).attr("item_id");if(j){f.push(j)}});W["review_text"]=d;W["review_subject"]=X;W["cotraveler[departure_date]"]=$("#event-date").val();W["cotraveler[followers]"]=$("#event-follower").val();W["cotraveler[goal]"]=$("#event-goal").val();W["cotraveler[id]"]=$("#event-id").val();W["photos"]=T.join(",");W["videos"]=f.join(",");W["username"]=Y;W["dog_id"]=$("#review_text_dog_id").val();W["desktop_id"]=$("#review_text_desktop_id").val();if(U){W["review_id"]=U}W["marks"]=b;function a(){$.ajax({url:E,type:"POST",data:W,success:function(j){if(j&&j.error!==undefined){modal_error(j.error);Z.wakeup();return false}window.location.href=D}})}setUserVid(a)};if($(".assessment div:visible").length==0){$(".help").show()}$("a.save_review_new").click(R)})}function add_review_media_002(I,H,G,F,C,J,L,A,E,N,D,M,K,B){$(function(){var S=$("#upload-user-foto-container"),X=null,O=null,P={"upload_url":I,"file_post_name":"file","file_types":"*.jpg;*.jpeg;*.JPG;*.JPEG;*.Jpeg;*.Jpg;*.png;*.gif;*.PNG;*.GIF;*.Png;*.Gif","button_placeholder_id":"add_foto_review","button_image_url":"/images/2.7.4/button/add_review_photo.png","button_width":121,"button_height":118,"post_params":{"extravars":H},"button_action":SWFUpload.BUTTON_ACTION.SELECT_FILES,"file_queue_limit":0,"upload_start_handler":function(c){$("#media-waitnig-div").wakeup();var Z=$('<div class="file" id="'+c.id+'"><div></div></div>').insertBefore(S.children(":last"));S.find("#"+c.id).children("div").sleep();try{W()}catch(a){}var Y=$(".file",S).length,b=K.replace("%n",Y);S.find("h2").eq(0).html(b)},"file_dialog_complete_handler":function(Y){if(Y){$("#media-waitnig-div").sleep();$.authJacket(function(){X.refreshCookies();S.show();X.startUpload()},undefined,N)}},"upload_success_handler":function(a,Z){var Y=S.find("#"+a.id);new JSONRequest({method:"reloadReviewMedia",params:[C,G,"foto"],success:function(b){try{if(b.item!==undefined){$(b.item).insertAfter(Y);Y.children("div").wakeup().end().remove()}}catch(c){}}})},"upload_complete_handler":function(Y){if(Y){this.startUpload()}}},X=init_uploader(P),W=function(){O=init_uploader($.extend(P,{"button_placeholder_id":"add_more_photo","button_width":196,"button_height":249,"button_image_url":"/images/2.7.4/button/add_more_review_photo.png","file_dialog_complete_handler":function(Y){if(Y){$.authJacket(function(){O.refreshCookies();O.startUpload()},undefined,N)}}}))};if(!DetectFlashVer(9,0,0)){$("#add_review_files").css("display","none");$("#add_review_title").css("margin-left","0");$("#add_review_text").css("margin-left","0")}var U={"card":"div.file","img":"a.wrap_img","remove":"a.delite","editTitle":"a.edit_title","editTitleDiv":"div.edit_title_div","editTitleSave":"a.edit_title_div_save","defaultEditTitleLabel":A,"defaultEditTagsLabel":E,"editTags":"a.edit_tags","editTagsDiv":"div.edit_tags_div","editTagsSave":"a.edit_tags_div_save","onTitleSave":function(Z,Y){new JSONRequest({"params":[{"item_type":"foto","item_id":this.attr("item_id"),"data_type":"title","data":Z}],"method":"editMediaData","success":function(){}});Y()},"onTagsSave":function(Z,Y){new JSONRequest({"params":[{"item_type":"foto","item_id":this.attr("item_id"),"data_type":"tags","data":Z}],"method":"editMediaData","success":function(){}});Y()},"onCardRemove":function(Z){if(confirm(L)){var Y=this.attr("item_id");JSONRequest({params:[Y,G],method:"removeUserFoto",success:function(a){}});Z()}}};S.cardManager(U);$(document).keydown(function(Y){if(Y.keyCode==27){if(X){X.stopUpload()}if(O){O.stopUpload()}}});var Q=$("#upload-user-video-container"),R=function(){var Y=this;new JSONRequest({method:"getFarmSlot",success:function(Z){if(Z==undefined){return }try{Y.addPostParam("video[server_id]",Z.result["server_id"]);Y.addPostParam("video[user_id]",Z.result["user_id"]);Y.setUploadURL("http://"+Z.result["upload_url"]+"/upload?X-Progress-ID="+Z.result["slot_id"])}catch(a){throw a;return }Q.show();Y.startUpload()}})},T={"upload_url":"","file_post_name":"video[file]","file_types":"*.mov;*.avi;*.mpeg;*.flv;*.mp4;*.wmv","button_placeholder_id":"add_video_review","button_image_url":"/images/2.7.4/button/add_review_video.png","button_width":121,"button_height":118,"post_params":{"video[extra_vars]":H},"button_action":SWFUpload.BUTTON_ACTION.SELECT_FILES,"file_queue_limit":0,"file_dialog_complete_handler":function(Z){if(Z){$("#media-waitnig-div").sleep();var Y=this;$.authJacket(function(){Y.refreshCookies();R.call(Y)},undefined,M)}},"upload_success_handler":function(a,Z){var Y=Q.find("#"+a.id);new JSONRequest({method:"reloadReviewMedia",params:[C,G,"single_video"],success:function(b){try{if(b.item!==undefined){$(b.item).insertAfter(Y);Y.remove()}}catch(c){throw c}}})},"upload_start_handler":function(c){$("#media-waitnig-div").wakeup();var Z=$('<div class="file" id="'+c.id+'"></div>').insertBefore(Q.children(":last"));try{_initAdditionalVideoUploader()}catch(a){}var Y=$(".file",Q).length,b=B.replace("%n",Y);Q.find("h2").eq(0).html(b)},"upload_complete_handler":function(Y){if(Y){R.call(this)}},"upload_progress_handler":function(b,a,Y){var Z=Y?Math.round(100*a/Y):0;$("#"+b.id).html('<span style="font-size: 62px; color: #B9B9B9;">'+Z+"%<span>")}},V=init_uploader(T);_initAdditionalVideoUploader=function(){_video_upl_additional=init_uploader($.extend(T,{"button_placeholder_id":"add_more_video","button_width":196,"button_height":249,"button_image_url":"/images/2.7.4/button/add_more_review_video.png"}))};Q.cardManager($.extend(U,{"onTitleSave":function(Z,Y){new JSONRequest({"params":[{"item_type":"video","item_id":this.attr("item_id"),"data_type":"title","data":Z}],"method":"editMediaData","success":function(){}});Y()},"onTagsSave":function(Z,Y){new JSONRequest({"params":[{"item_type":"video","item_id":this.attr("item_id"),"data_type":"tags","data":Z}],"method":"editMediaData","success":function(){}});Y()},"onCardRemove":function(Z){if(confirm(L)){var Y=this.attr("item_id");JSONRequest({params:[Y,G],method:"removeUserVideo",success:function(a){}});Z()}}}))})}function add_review_text_edit_js_01(B,A){$(function(){$("#review_subject").smart_input({label:B,filledCss:{color:_black_color},emptyCss:{color:_lightgrey_color}});$("#review_text").smart_input({label:A,filledCss:{color:_black_color},emptyCss:{color:_lightgrey_color}});var C=$("#add-review-text-form");C.silent_submit({url:C.attr("action"),container:"#add-review-text-form-holder"})})}function b_all_photo_js(E,C,A,D){if(A.button_image_url!==undefined){var B=new Image();B.src=A.button_image_url}$(function(){var J=$("#b-all-photo");if(DetectFlashVer(9,0,0)){var H=function(L){if(L){$.authJacket(function(){G.refreshCookies();G.startUpload()},undefined,D)}modal_error(_message)};var I=function(N,L){var M=new FileProgress(N,this.customSettings.progressTarget);M.setComplete();M.setStatus("Complete.");M.toggleCancel(false);onUploadPhotoSuccess(N,L,C,K,M)};A.upload_success_handler=I;A.file_dialog_complete_handler=H;A.upload_error_handler=onUploadPhotoError;A.upload_complete_handler=onUploadPhotoComplete;var G=init_uploader(A,true)}else{replaceFlashUploader(A["upload_url"],"b-emptybox__profilecomm-addphoto",C,A["post_params"]["extravars"],E,"b-all-photo",D)}var K=function(){$.ajax({url:E,cache:false,complete:function(){J.wakeup()},success:function(L){J.html(L);$("#show_user_foto_only").trigger("click")}})};var F=$("#add_comment");$("#scroll-to-add-comment").click(function(L){L.preventDefault();$.scrollTo(F,300);F.find("textarea").focus()});$(".switch_photo_view").click(function(L){L.preventDefault();var M=$(".all_photo .select .check").attr("filter");if($(".photo_blog_view").length>0){window.location.href=$(this).attr("href")+"#"+M}else{window.location.href=$(this).attr("href")+"?filter="+M}})})}function b_all_photo_js_marks(A){$(function(){var F=$(".give1, .give2, .give3, .give4, .give5"),C=null,E=null,B=$(".give_help"),D="<i></i>";F.hover(function(G){if(B&&B.is(":visible")){B.fadeOut()}var H=$(this),I=H.parent().find(".raitings");C=I.attr("class");E=I.html();I.html(D+H.attr("mark"));I.removeClass().addClass("raitings r"+H.attr("mark")+"0")},function(G){var H=$(this),I=H.parent().find(".raitings");I.removeClass().addClass(C);I.html(E)});F.click(function(G){G.preventDefault();G.stopPropagation();var H=$(G.target),L=H.parent().find(".raitings"),I=L.parent().attr("foto_id"),K=H.attr("mark"),J=L.siblings().filter(".rating_info");C=L.attr("class");J.html(A+K);L.html(D);new JSONRequest({method:"markFoto",params:[I,K],success:function(M){L.removeClass().addClass("raitings r"+M.result.style);L.html(D+M.result.rating);C=L.attr("class");E=L.html()}})})})}function b_all_video_js_01(H,E,G,J,F,C,D){var A=$("#multimedia_hotel"),I=null;if(H.button_image_url!==undefined){var B=new Image();B.src=H.button_image_url}$(function(){if(!DetectFlashVer(9,0,0)&&H.button_width>160){$("#"+H.button_placeholder_id).html(D)}else{var L=init_uploader(H);L=bind_video_uploader(L);L.uploadComplete=function(N,M){$(document).modalbox("close")};L.uploadError=function(O,M,N){if(N==406){modal_error(J)}else{if(N==500){modal_error(F)}else{if(N==404){modal_error(C)}}}}}var K=$("#add_comment");$("#scroll-to-add-comment").click(function(M){M.preventDefault();$.scrollTo(K,300);K.find("textarea").focus()})})}function b_photo_js_01(_param_01,_param_02,_param_03,_param_04,holder,img,_auth_first,dimx,dimy){var _img=new Image();_img.src=_param_04+"/i/fresh/new_photo_big.png";if(img){_img.src=_param_04+img}if(!holder){holder="b-emptybox__profilecomm-addphoto"}var $holder=$("#"+holder);if(!dimx){dimx=144}if(!dimy){dimy=115}$(function(){if($holder.length){var _holder=$("#hotel_photo");var _onUploadSuccess=function(_f,_d){var progress=new FileProgress(_f,this.customSettings.progressTarget);progress.setComplete();progress.setStatus("Complete.");progress.toggleCancel(false);onUploadPhotoSuccess(_f,_d,_param_03,null,progress)};var _onFileDialogComplete=function(_cnt){if(_cnt){$.authJacket(function(){_upl.refreshCookies();_upl.startUpload()},undefined,_auth_first)}};if(DetectFlashVer(9,0,0)){var _upl=init_uploader({"upload_url":_param_01,"post_params":_param_02?{"extravars":_param_02}:null,"button_image_url":_img.src,"button_placeholder_id":holder,"button_width":dimx,"button_height":dimy,"upload_complete_handler":onUploadPhotoComplete,"upload_error_handler":onUploadPhotoError,"upload_success_handler":_onUploadSuccess,"file_dialog_complete_handler":_onFileDialogComplete},true)}else{eval("var ex_vars = "+_param_02);var deflink="/hotels/"+ex_vars.hotel_id+"/pics/";$holder.replaceWith('<a href="'+($holder.attr("href").length?$holder.attr("href"):deflink)+'" style="display:inline-block;"><div style="background-image: url('+img+"); width: "+dimx+"px; height: "+dimy+'px; display:inline-block; font-size:1px;" /></a>')}}})}function replaceFlashUploader(F,J,H,B,G,I,K){var L=$('<form action="'+F+'" method="post" target="upload_'+J+'" enctype="multipart/form-data"></form>'),D=$('<iframe name="upload_'+J+'" src="" style="display: none;"></iframe>'),E=$('<input name="file" type="file" class="preudo_ajax_upload" />'),A=$('<input id="upload_'+J+'" name="sbmt" type="submit" style="display: none;" />'),N=$('<input type="hidden" value="1" name="native" />'),C=$('<input type="hidden" value="'+H+'" name="ajxurl" />'),B=$("<input type='hidden' value='"+B+"' name='extravars' />");if(G!=undefined){var M=$('<input type="hidden" value="'+G+'" name="callback_url" />'),I=$('<input type="hidden" value="'+I+'" name="callback_holder" />');$(L).append(M).append(I)}$("#"+J).append(L);$(L).append(E).append(N).append(C).append(B).append(A).append(D);$(E).change(function(O){var P=$(this).parent().parent();$.authJacket(function(){$("#upload_"+J).trigger("click")},undefined,K)});$(E).customFile()}function onUploadPhotoError(B,A,D,C){if(!C){var C=new FileProgress(B,this.customSettings.progressTarget);C.setError();C.toggleCancel(false)}switch(A){case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:C.setStatus("Cancelled");C.setCancelled();break;default:C.setStatus("Error");modal_error("Ошибка при сохранении фото "+(B&&B.name)+":"+D)}}function onUploadPhotoComplete(A){if(this.getStats().files_queued===0){if(uploadPhotoCallbackStorage.length>1){window.location.reload()}else{(uploadPhotoCallbackStorage.pop())()}}}var uploadPhotoCallbackStorage=[];function onUploadPhotoSuccess(_f,_d,ajxurl,call_back,_progress_obj){$(function(){try{eval("var _resp = "+_d);if(typeof (_resp)=="object"){if(_resp.foto_id){if(_resp.ajxurl!=undefined){ajxurl=_resp.ajxurl}!$("#modal_popup").length&&$(document).modalbox({});if(_resp.callback_url!=undefined){var _holder=$("#"+_resp.callback_holder);var onCloseHandler=function(){$.ajax({url:_resp.callback_url,cache:false,complete:function(){_holder.wakeup()},success:function(_data){_holder.html(_data);$("#show_user_foto_only").trigger("click")}})}}else{var onCloseHandler=function(){window.location.reload(true)}}var callbackItem=function(){$(document).modalbox("setCallback",{postClose:onCloseHandler}).modalbox("open",{ajax_url:ajxurl+_resp.foto_id+"/",popup_class:"popup add_file_popup"})};uploadPhotoCallbackStorage.push(callbackItem)}else{if(_resp.error!==""){onUploadPhotoError(_f,null,_resp.error,_progress_obj)}}}}catch(e){window.console&&console.log(e)}})}function b_sideusers_js_01(B,A){$(function(){$("div.right_column ul.tabs li a[name]").click(function(){var F=$(this);var H=F.attr("name");var D=$("li",F.parent().parent());D.removeClass("active");F.parent().addClass("active");for(var C=0;C<D.length;C++){var E=$("a",D[C]);var G=$("#"+E.attr("name"));if(E.attr("name")==H){G.show()}else{G.hide()}}return false});$("#b-sideusers__ctrls-metoo, #b-bigbtn_gofirst2").authBind("click",function(C){C.preventDefault();C.stopPropagation();$.modal({"loadUrl":B,"template":A,placeInCenter:true,noScroll:true})})})}function cotraveler_card_edit_js_01(A){$(function(){$("#edit-cotraveler-card-form").silent_submit({url:A})})}function cotraveler_card_static_js_01(D,C,B,A){$(function(){$("#edit-cotraveler-card-link").click(function(E){E.preventDefault();$.ajax({url:D,type:"POST",success:function(F){$("#user-cotraveler-card-holder").html(F).wakeup()},beforeSend:function(){$("#user-cotraveler-card-holder").sleep()}})});$("#edit-review-text-link").attr("hidden_href",C);$("#add-review-text-form").attr("action",B);$("input.marks-review-input").val(A)})}function foto_init_js_js_01(E,D,C){var F=E;function B(H){var G=_foto_comments.hide().eq(H);if(G.find("#comments_wrapper div").length>0){G.show();$("h2.new-comment").show();$("h2.first-comment").hide()}else{$("h2.new-comment").hide();$("h2.first-comment").show()}initializeCommentForm(F,H)}function A(G){var H=_foto_author;H.children().filter(":visible").hide();H.children().filter("[pic_id="+G+"]").show()}$(function(){initializeCommentForm(F,D);_foto_comments=$("div.comments_js");_foto_author=$("#photo_author");B(D);A(D);var H=$("div.wrap_img");var K=H.find("img");K.load(function(){H.fadeTo("slow",1)});$("#fotoslider").fotoslider({scrollbar:"div.scroll",owner:H,frame:$("#foto-frame"),nextArrow:"#next-button",prevArrow:"#prev-button",onSelect:function(P){var O=this,N=O.attr("hidden_href");if(getUrlHash()!==O.attr("urlhash")){setUrlHash("/")}A(P);B(P);K.attr("src",N);var L=O.next("a");if(L.length){var M=new Image();M.src=L.attr("hidden_href")}},startStep:D});var J=function(M){var L=$("#fotoslider").find("div").children("a").filter(":visible").length;$("#foto-counter").html(L)};var G=function(){var O=$("#fotoslider").find("div").children("a:visible");var M=parseInt(O.eq("0").css("margin-right"),10)+parseInt(O.eq("0").css("margin-left"),10);var L=775+120*O.length;$("#foto-counter").html(O.length);$("#sliderback").css("width",L);O.eq(0).trigger("click");var N=(O.length-1)?1/(O.length-1):null;$("div.scroll").scrollbar("updateDiscreteStep",N)};$(".all_photo .select").click(function(L){_stop(L);var M=$(this);if(M.hasClass("active")){M.removeClass("active")}else{M.addClass("active")}});$(document).click(function(L){if(!$(L.target).closest(".all_photo .select").length){$(".all_photo .select").removeClass("active")}});$("#show_all_foto, #show_catalog_foto_only, #show_user_foto_only").click(function(L){_stop(L);var M=$(this).text(),N=$(this).attr("id");var P=$(this).closest("div.select");P.find("a.selected").find("strong").html(M);$(P).removeClass("hover");$(P).find("li").removeClass("check");$(this).addClass("check");$(".all_photo .select").removeClass("active");if(N=="show_all_foto"){$("#fotoslider").find("a.pic-user, a.pic-catalog").show();J($(this));G()}else{if(N=="show_user_foto_only"){var O=$("#fotoslider").find("div").children("a");O.filter(".pic-user").show();O.filter(".pic-catalog").hide();J($(this));G()}else{if(N=="show_catalog_foto_only"){var O=$("#fotoslider").find("div").children("a");O.filter(".pic-user").hide();O.filter(".pic-catalog").show();J($(this));G()}}}});var I=window.location.hash;if(I=="#user"){$("#show_user_foto_only").click()}else{if(I=="#catalog"){$("#show_catalog_foto_only").click()}else{if(I.indexOf("&comment")>0){$("#scroll-to-add-comment").click();window.location.hash=window.location.hash.replace("&comment","")}}}media_slider_history_bind();$(".wrap_img img").css("cursor","pointer");$(".wrap_img img").click(function(){$("#next-button").click()})})}function media_slider_history_bind(){$.History.bind(function(B){if(B&&B.match(/\w+/)){var A=$("#fotoslider").find("a[urlhash="+B+"]");if(A.length){if(!A.filter(":visible").length){$("#show_all_foto").trigger("click")}A.trigger("click")}}})}function media_listing_history_bind(){$.History.bind(function(A){if(A&&A.match(/\w+/)){var B=$("#hash_"+A);if(B.length){$.scrollTo(B,700)}}})}function b_main_video_js_01(E,A,B,D,C){$(function(){if(DetectFlashVer(9,0,0)){if(E){var F=new SWFObject("/js/mediaplayer/player.swf","player","590","444","9");F.addParam("allowfullscreen","true");F.addParam("allowscriptaccess","always");F.addParam("autostart","false");F.addParam("wmode","opaque");F.addVariable("id","player");F.addVariable("title","");F.addVariable("file",E);F.addVariable("image",A);F.addVariable("resizing","true");F.write("preview")}else{if(D){var F=new SWFObject("http://www.youtube.com/v/"+D+"?enablejsapi=1&playerapiid=ytplayer","player","590","444","9");F.addParam("allowfullscreen","true");F.addParam("allowscriptaccess","always");F.addParam("wmode","opaque");F.addVariable("id","player");F.addVariable("resizing","true");F.write("preview")}}}else{$("#preview").html(C)}})}function video_init_js_js_01(M,K,H,F,E,D,O){var P=M;var J="postHotelVideoComment";var L=K;var B=H;var N=F;function C(X){var W=$("#sliderback").find("a"),U=W.eq(X),T=U.attr("video_url"),V=U.attr("youtube_id"),R=U.attr("video_thmb"),S=U.attr("video_id");$("#preview").fadeTo(0,600,function(){$(this).html("");if(!T&&!V){T=L;R=B;S=N}if(DetectFlashVer(9,0,0)){if(T){var Y=new SWFObject("/js/mediaplayer/player.swf","player","712","444","9");Y.addParam("allowfullscreen","true");Y.addParam("allowscriptaccess","always");Y.addParam("autostart","false");Y.addParam("wmode","opaque");Y.addVariable("id","player");Y.addVariable("title","");Y.addVariable("file",T);Y.addVariable("image",R);Y.addVariable("resizing","true");Y.write("preview");$("#download-video-button").show()}else{if(V){var Y=new SWFObject("http://www.youtube.com/v/"+V+"?enablejsapi=1&playerapiid=ytplayer","player","712","444","9");Y.addParam("allowfullscreen","true");Y.addParam("allowscriptaccess","always");Y.addParam("wmode","opaque");Y.addVariable("id","player");Y.addVariable("resizing","true");Y.write("preview");$("#download-video-button").hide()}}}else{$("#preview").html(O)}$("#download-video-button").attr("href",T);$("#add-to-blog-video-button").unbind("click").click(function(Z){Z.preventDefault();if(!S){S=V}if(!$("#modal_popup").length){$(document).modalbox()}$(document).modalbox("open",{ajax_url:"/getVideoEmbedTags/"+S+"/",popup_class:"popup add_file_popup"})});I(X);A(X)})}function A(S){var R=_foto_comments.hide().eq(S);if(R.find("#comments_wrapper div").length>0){R.show();$("h2.new-comment").show();$("h2.first-comment").hide()}else{$("h2.new-comment").hide();$("h2.first-comment").show()}initializeCommentForm(P,S)}function I(R){var S=_video_author;S.children().filter(":visible").hide();S.children().filter("[video_id="+R+"]").show()}var G=function(S){var T=$(".all_video ul").find("li");T.each(function(U,V){$(V).removeClass("check")});$(S).addClass("check");var R=$("#sliderback").children("a").filter(":visible").length;$("#foto-counter").html(R);$(".all_video .selected_current").html($(S).children("a").html())};var Q=function(){var U=$("#sliderback").children("a:visible");var S=parseInt(U.eq("0").css("margin-right"),10)+parseInt(U.eq("0").css("margin-left"),10);var R=775+120*U.length;$("#foto-counter").html(U.length);$("#sliderback").css("width",R);U.eq(0).trigger("click");var T=(U.length-1)?1/(U.length-1):null;$("div.scroll").scrollbar("updateDiscreteStep",T)};$(".all_video .select").click(function(R){_stop(R);var S=$(this);if(S.hasClass("active")){S.removeClass("active")}else{S.addClass("active")}});$(document).click(function(){$(".all_video .select").removeClass("active")});$("#show_catalog_foto_only").click(function(R){R.preventDefault();R.stopPropagation();var S=$("#sliderback").children("a");S.filter(".video-user").hide();S.filter(".video-catalog").show();G($(this));Q()});$("#show_user_foto_only").click(function(R){R.preventDefault();R.stopPropagation();var S=$("#sliderback").children("a");S.filter(".video-user").show();S.filter(".video-catalog").hide();G($(this));Q()});$("#show_all_foto").click(function(R){R.preventDefault();R.stopPropagation();$("#sliderback").find("a.video-user, a.video-catalog").show();G($(this));Q()});$(function(){_foto_comments=$("div.comments_js");_video_author=$("div#video_author");$("#fotoslider").fotoslider({scrollbar:"div.scroll",owner:$("#preview"),frame:$("#foto-frame"),nextArrow:"#next-button",prevArrow:"#prev-button",onSelect:function(T){var S=this,R=S.attr("hidden_href");if(getUrlHash()!==S.attr("urlhash")){setUrlHash("/")}C(T)}});C(D);media_slider_history_bind()})}function startUpload(B){if(!$("#file").val()){alert(B);return false}$(".holder-right").sleep();var A=getUniqId();$("#uploadform").attr("action","/my/uploadImage/?X-Progress-ID="+A)}function getUniqId(){var A="";for(i=0;i<32;i++){A+=Math.floor(Math.random()*16).toString(16)}return A}function personal_images_success_js_01(E,B,C){var D=undefined;var A=E;$("#uploadform").submit(function(){return startUpload(C)});$(".setactive_button").live("click",function(I){if((!$.browser.msie&&I.button==0)||($.browser.msie&&I.button==1)){var G=undefined;$(".holder-left").sleep();$(".avatars-gallery-element").children().children().children().filter("input").attr("checked",0);$(this).children().filter("input").attr("checked",1);var H=$(this).attr("id").replace(/setactive_/g,"");var F=$(this);$.ajax({type:"POST",url:"/my/setActive/",data:"user_id="+A+"&image="+H,success:function(J){G=$(F).parent().parent().children().children().filter("img").attr("src").replace("/small/","/medium/");$("#big_avatar").attr("src",G);$(".holder-left").wakeup()}})}});$(".delete_button").live("click",function(J){if((!$.browser.msie&&J.button==0)||($.browser.msie&&J.button==1)){if(!confirm(B)){return false}var G=undefined;$(".holder-right").sleep();$(".avatars-gallery-element").children().children().children().filter("input").attr("checked",0);$(this).children().filter("input").attr("checked",1);var I=$(this).attr("id").replace(/delete_/g,"");G=$(this).parent().parent().children().children().filter("img").attr("src").replace("/small/","/medium/");var F=$(this);$.ajax({type:"POST",url:"/my/deleteAvatar/",data:"user_id="+A+"&image="+I,success:function(K){$(F).parent().parent().remove();G=$(F).parent().parent().children().children().filter("img").attr("src").replace("/small/","/medium/");$(".holder-right").wakeup()},error:function(K){modal_error(K);$(".holder-right").wakeup()}});if($("#big_avatar").attr("src")==G){$(".holder-left").sleep();var H=$(".delete_button:last").attr("id").replace(/delete_/g,"");if(H){$.ajax({type:"POST",url:"/my/setActive/",data:"user_id="+A+"&image="+H,success:function(K){if($(".avatars-gallery-element-image:last").size()){G=$(".avatars-gallery-element-image:last").children().filter("img").attr("src").replace("/small/","/medium/");$("#big_avatar").attr("src",G)}else{$("#big_avatar").attr("src","/img/nofoto.gif")}}})}$("#big_avatar").attr("src","/img/nofoto.gif");$(".holder-left").wakeup()}}})}function review_success_js_01(){$(function(){$("#btn-submit-addreview").click(function(){$("#frm-addreview").submit();return false})})}function hotel_info_bind_why_love_01(){$("#reason_love").hideOnClckOutside($("#why_love"));$("#reason_love").click(function(){return false})}function hotel_info_01(H,A,C,E,I,D,G,B,F){$(function(){hotel_info_favorite_click(H,undefined,undefined,undefined,undefined,A,C,E,I,D,G,B,F);$("#reason_love").click(function(){$(this).hide()});hotel_info_bind_why_love_01();$("#add_vk").click(function(J){new JSONRequest({method:"logVkFavorite",params:[H]})})})}function search_params_selected_001(){$(function(){$("#params_selected").find("a").mouseenter(function(){$("#params_selected").addClass("sp_param_clear")}).mouseleave(function(){$("#params_selected").removeClass("sp_param_clear")})})}function search_results_sorting_001(){$(function(){$("#send_love").hideOnClckOutside($("#show_favs"));$("#show_favs").click(function(){$("#send_love input").focus().select()})})}$.fn.extend({"favoriteBtnHover":function(A,B){$(this).hover(function(){var C=$(this).hasClass("favorited")?B:A;$(this).parent().children(".hint").html(C).show()},function(){$(this).parent().children(".hint").html("").hide()});return this}});$.fn.extend({"favoriteBtnClick":function(A,D,C,B){$(this).each(function(){var N=$(this);var K=this.tagName;var I=N.parent();var M=I.attr("id").match(/\d+$/);if(!M){return }var L=(A&&A.yes)?A.yes:null;var O=(A&&A.no)?A.no:null;var E=(D&&D.yes)?D.yes:null;var J=(D&&D.no)?D.no:null;var H=(D&&D.added)?D.added:null;var F=(D&&D.removed)?D.removed:null;var G=(D&&D.auth)?D.auth:null;N.authBind("click",function(P){_stop(P);var Q=N.hasClass("anonym");N.sleep();new JSONRequest({method:"toggleFavoriteHotel",params:[M[0],Q],success:function(T){if(T&&T.active!==undefined){I.html(T.active==1?L:O);var R=I.find(K).favoriteBtnHover(E,J).favoriteBtnClick(A,D,C,B);var S=I.find(".hint").html(R.hasClass("favorited")?H:F).show();setTimeout(function(){S.hide()},2000);$("#top_strip_line").trigger("favoriteHotelToggle")}}})},G)});return this}});$.fn.extend({"profileFavoriteBtnClick":function(){$(this).each(function(){var B=$(this),A=B.parent().attr("id").match(/\d+$/);if(!A){return }B.bind("click",function(C){_stop(C);profile_favorite_hotels_update(A[0])})});return this}});function profile_favorite_hotels_update(B){var F=$("#profile-hotels-list"),E=F.data("updateUrl"),D=F.data("getParams"),C={};for(var A in D){C[A]=D[A]}C.hotel_id=B;if(E){$.ajax({beforeStart:function(){F.sleep()},complete:function(){F.wakeup()},url:E,data:C,success:function(G){if(G&&!G.error){$("#top_strip_line").trigger("favoriteHotelToggle");F.replaceWith(G)}}})}}function profile_favorite_hotels_init(B,A){$("#profile-hotels-list").find(".add_hotel_to_favorite").favoriteBtnHover(null,B).profileFavoriteBtnClick();$("body").bind("authComplete",function(){profile_favorite_hotels_update()})}function search_results_001(I,G,C,F,A,D,B,E){this.readTemplate=$.Widget.prototype.readTemplate;var H=this;$(function(){H.readTemplate(I);var N=H.template.item;var L=H.template.noitem;var J=H.template.remove;var M=H.template.add;var K=H.template.tolist;$.getJSON("http://"+document.domain+"/ajax/userservice/?cmd=islogged",function(){var O=$("#hotel_search_result").find(".add_hotel_to_favorite").favoriteBtnHover(A,D).favoriteBtnClick({"yes":N,"no":L},{"yes":A,"no":D,"added":G,"removed":C,"auth":F},K,B);E&&O.addClass("anonym")})})}function search_results_tour_init(){var B=$("#hotel-select-all");var A=$("div.hotel-checkbox").children("input");B.click(function(){if($(this).attr("checked")){A.attr("checked",true)}else{A.attr("checked",false)}});A.click(function(){if($(this).attr("checked")){if(A.length==A.filter(":checked").length&&!B.attr("checked")){B.attr("checked",true)}}else{if(B.attr("checked")){B.attr("checked",false)}}});$("#find-tour-list").click(function(){var D=[];var F=A.filter(":checked").each(function(){D.push(this.value)});if(D.length){if(D.length<2){var E=F.closest("li.hotel-block").find("div.hotel-search").children("a").attr("href");E.length&&(window.location=E)}else{var C=$(this).attr("data-url");if(C){var E=C.replace("%ids%",D.join(","));if(!E.length){return }setTimeout(function(){window.location=E},0)}}}});$("div.hot-tour, div.hotel-best").find("a").hover(function(){$(this).siblings("div.hint").show()},function(){$(this).siblings("div.hint").hide()})}function hotel_search_index_guest(){$(function(){$("#login_pliz a").authBind("click",function(A){window.location.reload(true)})})}function hotel_info_favorite_click(L,I,A,F,J,H,O,E,M,D,K,C,G){var N=$("#toggle-favorite-hotel-link"),B=$("#favorite_buttons");if(A){N=A}if(I){B=I}if(F!==undefined){if(F.yes_html){H=F.yes_html}if(F.no_html){O=F.no_html}}$(N).authBind("click",function(P){_stop(P);var R=$(this).sleep();var Q=$(B);var S=$(this).hasClass("anonym");if(F!==undefined){if(J==0){$("#hotelsearch_settings").append(E)}}new JSONRequest({method:"toggleFavoriteHotel",params:[L,S],success:function(U){if(U&&U.active!==undefined){if(U.active==1){Q.html(H)}else{Q.html(O)}if(F){var T=$(I).find("a");hotel_info_favorite_click(L,I,T,F,J,H,O,E,M,D,K,C,G);search_results_001_hover_binder(I,C,G);if(!$(T).hasClass("favorited")){$(I).find("span").html(D);$(I).find("span").attr("class","red_span")}else{$(I).find("span").html(M);$(I).find("span").attr("class","green_span")}}else{hotel_info_bind_why_love_01();hotel_info_favorite_click(L,I,T,F,J,H,O,E,M,D,K,C,G)}$("#top_strip_line").trigger("favoriteHotelToggle")}}})},K)}function search_results_001_hover_binder(B,C,A){$(function(){$(B).find("a").hover(function(){if(!$(this).hasClass("favorited")){var E=C;var D="green_span"}else{var E=A;var D="red_span"}$(B).children("span").html(E).attr("class",D).show()},function(){$(B).children("span").html("").hide()})})}function choose_city_01(B,A){$(function(){$("#select_city a.city_link, #select_city a.close").click(function(C){C.preventDefault();C.stopPropagation();$("#select_city").hide("slow");var D=$(this),E=null;if(D.filter(".close").length){E={"data":{"c":A}}}else{E={"data":{"c":D.attr("c")},"complete":function(){window.location.href=window.location.href},"success":function(){window.location.reload(false)}}}E=$.extend({"url":B,"type":"GET","cache":true},E);$.ajax(E)});$("#select_city a.selected").click(function(C){C.preventDefault();C.stopPropagation();$("#select_city div.o_fix").show()});$("#select_city div.drop_down a.selected").click(function(C){C.preventDefault();C.stopPropagation();$("#select_city div.o_fix").hide()})})}function review_media_01(){$('a[rel="review_photos"]').lightBox({fixedNavigation:true,imageLoading:"/images/lightbox-ico-loading.gif",imageBtnPrev:"/images/lightbox-btn-prev.gif",imageBtnNext:"/images/lightbox-btn-next.gif",imageBtnClose:"/images/lightbox-btn-close.gif",imageBlank:"/images/lightbox-blank.gif",txtImage:"Фото",txtOf:"из"})}function change_state(B){var A=$(B).siblings("label");if($(A).attr("class")=="checked-tag"){$(A).removeClass("checked-tag")}else{$(A).addClass("checked-tag")}}function perl_user_article_form(A){$("#user-article-form-submit").authBind("click",function(B){$("#add-user-article-form").attr("action",A);$("#add-user-article-form").submit()})}function login_form_001(D,C,A,B){$(function(){$("#popup-login-form").bind("closeLoginForm",function(){$.stupidModal("close")})})}function register_form_001(D,E,A,C,B){$(function(){var F="";if(D){F="?silent=1"}$("#ui-modal-register-form").silent_submit({url:"/user/register/"+F,container:"#modal_container_reg",sleepContainer:"#popup_register .popup-inner-wrap"})})}function recovery_form_001(A,B){$(function(){var C="";if(A){C="?silent=1"}$("#ui-modal-recovery-form").silent_submit({url:"/user/recovery/"+C,container:"#modal_container_rec",sleepContainer:"#popup_recovery .popup-inner-wrap"})})}function js_iframe_001(){$.modal("close",{complete:function(){if(typeof (expecting_callback)=="function"){expecting_callback()}}})}function remove_review(B,C,D,A){if(!confirm(D)){return }JSONRequest({params:[C],method:"deleteHotelReview",success:function(E){if(A){window.location.href=A}else{$(B).closest("div.box").slideUp()}}});return false}function remove_comment(C,D,A,F,B){var E=confirm(A);if(!E){return }if(B){window.location.href=B}else{$(C).parent().parent().slideUp("normal")}JSONRequest({params:[D],method:"deleteComment",success:function(G){if(!G.success){alert(F)}}});return false}function remove_photo(E,A,G,F){var B="";var C=$(E).closest("div.active");C.sleep();JSONRequest({params:[A],method:"deleteHotelUserFoto",success:function(J){if(!J.success){C.wakeup();alert(F+J.error+"("+J.error_code+")");return }}});var I=$("a.pic-user").filter("[index="+G+"]");I.fadeTo("fast",0.1);I.attr("hidden_href","/i/fresh/tourstanok/no-photo.png");$("#photo_author").find("[pic_id="+G+"]").remove();var H=I.next("a.pic-user");if(!H.length){H=I.prev("a.pic-user")}if(H.length){B=H.attr("urlhash")}var D=String(window.location).replace(/#.*$/,"#"+B+"/");C.wakeup();window.location=D;return false}function remove_photo_list(B,E,D){var C="";var A=$(B).closest("tr");A.sleep();JSONRequest({params:[E],method:"deleteHotelUserFoto",success:function(F){if(!F.success){A.wakeup();alert(D+F.error+"("+F.error_code+")");return }}});A.wakeup();A.slideUp();if($(B).closest("table").find("tr:visible").length==1){window.location.reload()}return false}function remove_video(D,E,G,F,H){var A="";var B=$(D).closest("div.active");B.sleep();JSONRequest({params:[E],method:"deleteHotelUserVideo",success:function(K){if(!K.success){B.wakeup();alert(F+K.error+"("+K.error_code+")");return }}});var J=$("[index="+G+"]");J.fadeTo("fast",0.1);J.attr("video_url","/i/fresh/tourstanok/no-photo.png");$("#video_author").find("[video_id="+G+"]").html('<span style="color:red">'+H+"</span>");var I=J.next("div#fotoslider a");if(!I.length){I=J.prev("div#fotoslider a")}if(I.length){A=I.attr("urlhash")}var C=String(window.location).replace(/#.*$/,"#"+A+"/");B.wakeup();window.location=C;return false}function please_register(A,B){$(function(){$.authJacket(function(){window.location.reload(true)},undefined,B)})}function b_all_reviews_admin(A){$(function(){$(".post2").each(function(B,D){var C=A;_id=0;_id=$(".pop",D).attr("id").substr(11);C=C.replace("$review_id",_id).replace("%24review_id",_id);$(".post_end",D).before(C)})})}function b_all_photo_admin(A){$(function(){$("#comments_wrapper .box").each(function(B,E){var D=A,C=0;C=$(E).attr("comment_id");D=D.replace("$comment_id",C);$("p",E).after(D)})})}function b_all_video_admin(A){$(function(){$(".b-feed-comments .comment_item").each(function(B,E){var D=A,C=0;C=$(E).attr("comment_id");D=D.replace("$comment_id",C);$("p",E).after(D)})})}function modal_success(C,D,B){var A=B||{};A.message=C;$(document).modalbox("close");$.stupidModal("success",A,D);if(typeof D=="function"){D()}return true}function modal_error(C,B){var A=B||{};A.message=C;$(document).modalbox("close");$.stupidModal("error",A);return true}function modal_wait(A){if(!$("#modal_popup").length){$(document).modalbox()}$(document).modalbox("open",{content:'<table class="com"><tr><td><img src="/images/2.5.4/POP_UPgif.gif" /></td><td>'+A+"</td></tr></table>"});return true}function replace_legacy_auth(C,D,B){var A=$(C);if(A.length){A.authBind("click",function(E){E.preventDefault();E.stopPropagation();if(B==undefined){B=A.attr("href")}if(B){document.location=B;modal_wait("Выполняется вход на сайт")}},D)}}function replace_legacy_register(B){var A=$(B);if(A.length){A.click(function(C){C.preventDefault();C.stopPropagation();$.stupidModal("register")})}}function replace_legacy_forgot(B){var A=$(B);if(A.length){A.click(function(C){C.preventDefault();$.stupidModal("recovery")})}}function hotel_photo_list(){$(function(){var A=$(".all_photo .select");A.click(function(B){B.preventDefault();B.stopPropagation();var C=$(this);if(C.hasClass("active")){C.removeClass("active")}else{C.addClass("active")}});$(document).click(function(B){if(!$(B.target).closest(".all_photo .select").length){A.removeClass("active")}});$("#show_all_foto, #show_catalog_foto_only, #show_user_foto_only").click(function(B){_stop(B);var C=$(this).text(),E=$(this).attr("id"),G=$(this).attr("filter"),D=window.location.href;var F=$(this).closest("div.select");F.find("a.selected").find("strong").html(C);$(F).removeClass("hover");$(F).find("li").removeClass("check");$(this).addClass("check");A.removeClass("active");D=D.replace(/page=[0-9]+&/g,"").replace(/#[0-9a-z]+/,"").replace(/\/(\d+)\/(\d+)\//,"/$1/");if(D.indexOf("filter")>0){D=D.replace(/filter=[a-z]+/g,"filter="+G)}else{if(D.indexOf("?")>0){D+="&filter="+G}else{D+="?filter="+G}}setTimeout(function(){window.location.href=D},0)});media_listing_history_bind();$("table.photo_blog_view").find("img").click(function(B){$(".give_help").hide();var D=$(this).closest("td"),C=D.parent().next().children("td").eq(0).filter(".big_big_big_photo");if(D.is(".big_big_big_photo")){D.parent().hide().prev().show()}else{if(C.length){D.parent().hide().next().show()}}})})}function regions_content_left_01(C,B,A){$(function(){var D=$("#regions_list .box").length;$("#regions_search").smart_input($.extend(_def_style,{label:A}));$("#regions_search").keyup(function(E){var F=$("#regions_search").val().toLowerCase(),G=new RegExp(F,"gi");if(!F){$("#regions_list .box:hidden").slideDown();D=$("#regions_list .box").length;return }$("#regions_list .box").each(function(I,J){var H=$("a.region",J).text().toLowerCase();if(G.exec(H)){if($(J).is(":hidden")){$(J).slideDown();D++}}else{if($(J).is(":visible")){$(J).slideUp();D--}}});if(D==0&&$("#not_found").is(":hidden")){$("#not_found").slideDown()}else{if(D>0&&$("#not_found").is(":visible")){$("#not_found").slideUp()}}});$(".sorting").click(function(E){E.preventDefault();E.stopPropagation();var F=$(E.target),G=F.attr("sorting_type");if(!G){return }F.siblings("a").removeClass("active");F.addClass("active");$("#regions_list").sleep();$.ajax({url:C,type:"GET",data:{sorting:G,country:B},success:function(H){$("#regions_list").html(H);$("#regions_list").wakeup()},error:function(){$("#regions_list").wakeup()}})})})}function search_form_alphabet(){$(function(){$(".switch_lang a").click(function(A){A.preventDefault();A.stopPropagation();var B=$(A.target);if(B.parent().hasClass("eng")){$(".switch_lang.eng").hide();$(".switch_lang.rus").show();$(".letters.eng").hide();$(".letters.rus").show()}else{$(".switch_lang.rus").hide();$(".switch_lang.eng").show();$(".letters.rus").hide();$(".letters.eng").show()}})})}function hotels_search_form(A){$(function(){$("#search_name").smart_input($.extend(_def_style,{label:A}));$("#hotelsearch").find("a").click(function(B){B.preventDefault();if($("#search_name").val()){$("#error_empty_name").hide();$("#hotelsearch input[name=]").remove();$("#hotelsearch").submit()}else{if($("#error_no_hotels").length==0){$("#error_empty_name").show()}}});$("#hotelsearch input").keydown(function(B){$("#error_empty_name").hide();if(B.keyCode=="13"&&$("#search_name").val()){$("#hotelsearch input[name=]").remove();$("#hotelsearch").submit()}else{if(B.keyCode=="13"&&$("#error_no_hotels").length==0){$("#error_empty_name").show()}}})})}function region_weather_01(){$(function(){var A=$("#weather_region_selector");A.find("a.selected").click(function(){A.toggleClass("active")}).end().click(function(B){B.stopPropagation()});$(document).click(function(){A.removeClass("active")})})}function region_selector_01(){$(function(){var A=$("#region_selector");A.find("a.selected").click(function(){A.toggleClass("active")}).end().click(function(B){B.stopPropagation()});$(document).click(function(){A.removeClass("active")})})}function region_weather_02(){$("#weather_switch").find("li").click(function(){$("#weather_switch").find("li").removeClass("active");$(this).addClass("active");var A=$(this).find("a").attr("day");$("#weather_map").simple_map("switchDay",{day:A})})}function review_comments_js_01(B,A){initializeCommentForm(B,0);_foto_comments=$("div.response_comments");$(_foto_comments).find("a.delete_comment").each(function(){$(this).click(function(){remove_comment($(this),$(this).attr("comment_id"),A);return false})});$("#add_comment_button").click(function(C){C.preventDefault();C.stopPropagation();$.scrollTo($("#add_comment"),"normal");$("#foto_comment_text").focus()})}function main_page_foto_01(A){$(function(){$(".country_photo a.add").authBind("click",function(B){_stop(B);window.location.href=A},"Чтобы добавить фотографию, войдите на сайт.")})}function main_page_region_01(A,B){$(function(){var C=false;$(".section_more.regions_list").click(function(D){var E=$(D.target);if(!C){E.text(A);C=true;$("#regions_list_other").slideDown()}else{E.text(B);C=false;$("#regions_list_other").slideUp()}});$(".regions_list li").hover(function(D){$(this).addClass("hover")},function(D){$(this).removeClass("hover")})})}function regions_content_right_01(C,A,B){$(function(){var D=$("#regions_list .box").length;$("#regions_search").smart_input($.extend(_def_style,{label:B}));$("#regions_search").keyup(function(E){var F=$("#regions_search").val().toLowerCase(),G=new RegExp(F,"gi");if(!F){$("#regions_list .box:hidden").slideDown();D=$("#regions_list .box").length;$("#not_found").slideUp();$("#error_not_found").hide();$(".sort").slideDown();return }$("#regions_list .box").each(function(I,J){var H=$("a.region",J).text().toLowerCase();if(G.exec(H)){if($(J).is(":hidden")){$(J).slideDown();D++}}else{if($(J).is(":visible")){$(J).slideUp();D--}}});if(D==0&&$("#not_found").is(":hidden")){$("#not_found").slideDown();$("#error_not_found").show();$(".sort").slideUp()}else{if(D>0&&$("#not_found").is(":visible")){$("#not_found").slideUp();$("#error_not_found").hide();$(".sort").slideDown()}}});$(".sort").click(function(E){_stop(E);var F=$(E.target),H=F.attr("sorting_type");if(!H){return }F.siblings("a").removeClass("up").removeClass("down");var G=F.attr("class");if(G){G=(G=="up")?"down":"up"}else{G=F.attr("default_sorting")}F.removeClass("up").removeClass("down");F.addClass(G);$("#regions_list").sleep();$.ajax({url:C,type:"GET",data:{sorting:H,type:G,country:A},success:function(I){$("#regions_list").html(I);$("#regions_list").wakeup()},error:function(){$("#regions_list").wakeup()}})})})}function user_video_tags_01(B,A){$(function(){var C=$("#add-user-video-tags-form");$("#modal-submit-link").click(function(D){D.preventDefault();$("#add-user-video-tags-form").submit()});$("#add-user-video-tags-form").submit(function(E){E.preventDefault();var H=$("div.name input",C).val();var D="";var G="";$(":checkbox",C).each(function(){if(this.checked){D+=(D.length>0)?",":"";D+=this.value;var I=$(this).siblings("label");G+=(G.length>0)?", ":"";G+=$(I).text()}});var F=$("#add-user-video-tags-form").attr("el_id");C.sleep();$.post(B+F+"/",{tags:D,title:H},function(){C.wakeup();changed_photo=$("#video_item_"+F+" ul");$(changed_photo).html(G);$(document).modalbox("close")});changed_video=$("#vido_item_"+F+" span");$(changed_video).html(G)});$("#modal-delete-link").click(function(D){$("#modal-delete-link").sleep();JSONRequest({params:[$("#add-user-video-tags-form").attr("el_id")],method:"deleteHotelUserVideo",success:function(E){$(document).modalbox("setCallback",{preClose:undefined});if(!E.success){alert(A+E.error+"("+E.error_code+")")}else{$(document).modalbox("close")}}})})})}function user_photo_tags_01(D,B,A,C){$(function(){var E=$("#add-user-foto-tags-form");$("#modal-submit-link").click(function(F){F.preventDefault();$("#add-user-foto-tags-form").submit()});$("#add-user-foto-tags-form").submit(function(G){_stop(G);$("#add-user-foto-tags-form").sleep();var J=$("div.name input",E).val(),F="",I="";$("input:checkbox",E).each(function(){if(this.checked){F+=(F.length>0)?",":"";F+=this.value;var K=$(this).siblings("label");I+=(I.length>0)?", ":"";I+=$(K).text()}});var H=$("#add-user-foto-tags-form").attr("el_id");$.post(D+H+"/",{tags:F,title:J},function(K){if(A){window.location.href=B+"#"+K}$("#add-user-foto-tags-form").wakeup();$(document).modalbox("close")});changed_photo=$("#item_"+H+" span");$(changed_photo).html(I)});$("#modal-delete-link").click(function(F){$("#modal-delete-link").sleep();JSONRequest({params:[$("#add-user-foto-tags-form").attr("el_id")],method:"deleteHotelUserFoto",success:function(G){if(!G.success){modal_error(C+G.error+"("+G.error_code+")")}else{$(document).modalbox("close")}}})})})}$.fn.extend({"profileDeletePhoto":function(){$(this).click(function(C){C.preventDefault();var A=this;var B=$(A).closest("div.photo-info").parent();if(confirm("Вы действительно хотите удалить эту фотографию?")){$.ajax({url:A.href,beforeSend:function(){B.sleep()},complete:function(){B.wakeup()},success:function(D){if(D&&D.success){window.location.reload()}else{modal_error("Возникла ошибка. Позже попробуйте снова.")}}})}})}});function init_faq(){$("#client_faq a").click(function(){$(this).parent().parent().toggleClass("active")});$.History.bind(function(A){if(A){$("dl:has(#"+A+")").toggleClass("active");$.scrollTo($("#"+A),{offset:-100,duration:800})}})}function init_isic_page(){$("#iytc_container").find("a").not(".mini_contact a").click(function(){$("#isic_container").removeClass("active");$("#itic_container").removeClass("active");$("#iytc_container").toggleClass("active");return false});$("#isic_container").find("a").not(".mini_contact a").click(function(){$("#iytc_container").removeClass("active");$("#itic_container").removeClass("active");$("#isic_container").toggleClass("active");return false});$("#itic_container").find("a").not(".mini_contact a").click(function(){$("#isic_container").removeClass("active");$("#iytc_container").removeClass("active");$("#itic_container").toggleClass("active");return false})}function client_contracts_001(){_getVal=function(B){return B.attr("val")},_getLabel=function(B){return B.children("a").html()},_setLabel=function(C){var B;if(B=this.options.getLinks.call(this)){B.children("span").html(C)}this.options.getParent.call(this).find("span.container-hidden").html(C)};var A=$("#filter-contracts-city").formWidgetCollapsable({name:"contracts_office",value:$("#contracts_office").val(),getValue:_getVal,getLabel:_getLabel,setLabel:_setLabel})}function searchRequestSimpleFormInit(){if($.hash()&&$.hash().length>10){var A=parseSerializedHash($.hash());if(A.city){$("#search_request_simple_city").val(A.city)}}$("#search_request_simple").submit(function(){if(validateSearchRequestSimpleForm()){var B=$(this);$("#main-content-container").sleep({"shroud_css":{"z-index":200}});data_form=B.serializeArray();$.post("/search_request_create/",data_form,function(C){if($(C).find("div.request-order-complete").length){$("#main-content-container").html(C)}else{B.closest("div.request-form").html(C)}$("#request-explanation").hide();$("#main-content-container").wakeup()})}return false});$("#search-request-simple-submit").click(function(){$("#search_request_simple").submit();return false})}function parseSerializedHash(B){var A={};$(B.split("&")).each(function(){var C=this.split("=");A[C[0]]=C[1]});return A}function searchRequestFormInit(rooms){initSearchRequestDateWidget("from");initSearchRequestDateWidget("to");var default_valut=true,country_valut=eval("("+$("#search_request_country_valut").val()+")");$("#search_request_country_valut").val(0);$("#search_request_tour_valut").val(country_valut[$("#search_request_country").val()]);$("#search_request_country").change(function(){if(default_valut){$("#search_request_tour_valut").val(country_valut[$("#search_request_country").val()])}});$("#search_request_tour_valut").one("change",function(){default_valut=false});$("#search_request").submit(function(){if(validateSearchRequestForm()){var $f=$(this);$("#main-content-container").sleep({"shroud_css":{"z-index":200}});data_form=$f.serializeArray();$.post("/search_request_create/",data_form,function(html){if($(html).find("div.request-order-complete").length){$("#main-content-container").html(html)}else{$f.closest("div.request-form").html(html)}$("#request-explanation").hide();$("#main-content-container").wakeup()})}return false});$("#search_request_total_kids").change(function(){renderChildAge()});renderChildAge();$("#search-request-submit").click(function(){$("#search_request").submit();return false});function renderChildAge(){var total_kids=$("#search_request_total_kids").val();$(".child-age").each(function(i){if(i<total_kids){$(this).attr("class","el-select select-min child-age")}else{$(this).attr("class","el-select select-min child-age hidden")}})}if($.hash()&&$.hash().length>5){var hash=parseSerializedHash($.hash());var i=0;if(hash.country){$("#search_request_country").val(hash.country).trigger("change")}var stars={1:2,2:3,3:4,4:5};if(hash.stars&&stars[hash.stars]){var minStars=stars[hash.stars],maxStars=stars[hash.stars];if(hash.starsBetter){maxStars=5}for(i=minStars;i<=maxStars;i++){$("#search_request_hotel_rate_"+i+"_").attr("checked","checked")}}if(hash.departureFrom){$("#date-from").val(parseDate(hash.departureFrom)).trigger("select")}if(hash.departureTo){$("#date-to").val(parseDate(hash.departureTo)).trigger("select")}if(hash.durationFrom){$("#search_request_days_from").val(hash.durationFrom)}if(hash.durationTo){$("#search_request_days_to").val(hash.durationTo)}var adults=0,children=0;if(hash.room&&rooms[hash.room]){var r=rooms[hash.room];var adults=+r[0],children=+r[1];$("#search_request_total_adults").val(adults);$("#search_request_total_kids").val(children).trigger("change");for(i=1;i<=children;i++){if(hash["child"+i]){$("#search_request_child_age"+i).val(hash["child"+i])}}}if(hash.city){$("#search_request_city").val(hash.city)}if((adults+children)>0&&(hash.priceFrom||hash.priceTo)){$("#search_request_tour_valut").val(1);var priceMult=hash.priceType=="person"?(adults+children):1;if(hash.priceFrom){$("#search_request_price_from").val((+hash.priceFrom)*priceMult)}if(hash.priceTo){$("#search_request_price_to").val((+hash.priceTo)*priceMult)}}}}function parseDate(C){if(C instanceof Date){return C}if(typeof (C)!="string"){return null}var B=C.split(/\./g);var A=new Date(B[2],B[1]-1,B[0]);if(!A||!A.getTime||!A.getTime()){return false}return A}Date.prototype.toYMD=Date_toYMD;function Date_toYMD(){var B,C,A;B=String(this.getFullYear());C=String(this.getMonth()+1);if(C.length==1){C="0"+C}A=String(this.getDate());if(A.length==1){A="0"+A}return B+"-"+C+"-"+A}function initSearchRequestDateWidget(D){var C=["воскресенье","понедельник","вторник","среда","четверг","пятнитца","суббота"];var G=["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"];var B=new Date();var F=new Date();F.setFullYear(F.getFullYear()+1);var E=new Date($("#search_request_date_"+D).val());$("#date-"+D).newCalendar({minDate:B,maxDate:F,template:"calendar",value:E});$("#date-"+D+"-btn").click(function(){if(D=="from"){$("#date-to").newCalendar("close")}else{$("#date-from").newCalendar("close")}if(!$("#date-"+D).newCalendar("isOpen")){$("#date-"+D).newCalendar("open")}else{$("#date-"+D).newCalendar("close")}return false});$("#date-"+D).bind("select",function(){A(D);if($("#date-from").val()>$("#date-to").val()){if(D=="from"){$("#date-to").newCalendar("setValue",$("#date-from").val());A("to")}else{$("#date-from").newCalendar("setValue",$("#date-to").val());A("from")}}setTimeout(function(){$("#date-"+D).newCalendar("close")},100)});A(D);function A(I){var H=$("#date-"+I).val();if(H.getDay()==0||H.getDay()==6){$(".cal-"+I).attr("class","cal cal-"+I+" cal-weekend")}else{$(".cal-"+I).attr("class","cal cal-"+I)}$("#date-"+I+"-btn .day").text(C[H.getDay()]);$("#date-"+I+"-btn p:last").text(H.getDate()+" "+G[H.getMonth()]);$("#search_request_date_"+I).val(H.toYMD());if(I=="from"){$("#search_request_date_begin").val(H.toYMD())}}}function validateSearchRequestSimpleForm(){var D=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/;var C=/^[0-9\-\s\(\)\+]+$/;var A=$("#search_request_simple_client_more").val();var F=$("#search_request_simple_client_phone").val();var B=$("#search_request_simple_client_email").val();var E=$("#search_request_simple_client_name").val();if(A==null||$.trim(A)==""){$.bubble({obj:$("#search_request_simple_client_more"),type:"error",body:"Введите пожелания к туру"});return false}if((F==null||$.trim(F)=="")&&(B==null||$.trim(B)=="")){$.bubble({obj:$("#search_request_simple_client_phone"),type:"error",body:"Введите телефон ..."});$.bubble({obj:$("#search-request-simple-submit"),pos:"tr",type:"error",body:"... или email"});return false}if(F!=null&&$.trim(F)!=""&&!C.test(F)){$.bubble({obj:$("#search_request_simple_client_phone"),type:"error",body:"Неверный формат телефона"});return false}if(B!=null&&$.trim(B)!=""&&!D.test(B)){$.bubble({obj:$("#search_request_simple_client_email"),type:"error",body:"Неверный формат email"});return false}if(E==null||$.trim(E)==""){$.bubble({obj:$("#search_request_simple_client_name"),type:"error",body:"Введите ваше имя"});return false}return true}function validateSearchRequestForm(){var D=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/;var B=/^[0-9\-\s\(\)\+]+$/;var C=/^[1-9]+[0-9]*$/;var H=$("#search_request_client_phone").val();var A=$("#search_request_client_email").val();var G=$("#search_request_client_name").val();var E=$.trim($("#search_request_price_from").val());var F=$.trim($("#search_request_price_to").val());if(E&&!C.test(E)){$.bubble({obj:$("#search_request_price_from"),type:"error",body:"Неверный формат цены"});return false}if(F&&!C.test(F)){$.bubble({obj:$("#search_request_price_to"),type:"error",body:"Неверный формат цены"});return false}if((H==null||$.trim(H)=="")&&(A==null||$.trim(A)=="")){$.bubble({obj:$("#search_request_client_phone"),type:"error",body:"Введите телефон ..."});$.bubble({obj:$("#search-request-submit"),pos:"tr",type:"error",body:"... или email"});return false}if(H!=null&&$.trim(H)!=""&&!B.test(H)){$.bubble({obj:$("#search_request_client_phone"),type:"error",body:"Неверный формат телефона"});return false}if(A!=null&&$.trim(A)!=""&&!D.test(A)){$.bubble({obj:$("#search_request_client_email"),type:"error",body:"Неверный формат email"});return false}if(G==null||$.trim(G)==""){$.bubble({obj:$("#search_request_client_name"),type:"error",body:"Введите ваше имя"});return false}return true}function lottery_countdown_001(B,A){$("#lottery-timer").click(function(){location.href=A});var E=B,F=function(){if(E>0){C(E);setTimeout(F,1000);E=E-1}else{$(".lottery-timer").hide()}},D=function(G){var H=""+(typeof G!="undefined"&&G?G:"");while(H.length<2){H="0"+H}return H},C=function(I){var J=86400;var K;if(E>J){K=Math.floor(E/J).toString();I=I-K*J}var G;var H;$.each([3600,60],function(L,M){if(M==3600){G=Math.floor(I/M)}else{H=Math.floor(I/M)}I=I-Math.floor(I/M)*M});$("#lot_days").html(D(K));$("#lot_hours").html(D(G));$("#lot_mins").html(D(H));$("#lot_secs").html(D(I))};F()}function default_countdown(C,B,A){$(A["timer-container"]).click(function(){location.href=B});var F=C,G=function(){if(F>0){D(F);setTimeout(G,1000);F=F-1}else{}},E=function(H){var I=""+H;while(I.length<2){I="0"+I}return I},D=function(J){var K=86400;var L=0;if(F>K){L=Math.floor(F/K);J=J-L*K}var H=0;var I=0;$.each([3600,60],function(M,N){if(N==3600){H=Math.floor(J/N)}else{I=Math.floor(J/N)}J=J-Math.floor(J/N)*N});$(A["days"]).html(E(L.toString()));$(A["hours"]).html(E(H));$(A["minutes"]).html(E(I));$(A["seconds"]).html(E(J))};G()}function loadClientForm(B,A){$.ajax({url:B,data:A,success:function(C){$("#form_container").html(C)}})}function init_clients_auth_form(C,B,A){if(!C.office_list.selected&&window.LAST_SEARCH_PARAMS){params=parseSerializedHash(window.LAST_SEARCH_PARAMS);if("city" in params){C.office_list.selected=params["city"]}}$("#clients-select-city").tourSelectList({template:"tourSelectList",opts:C.office_list.options,value:C.office_list.selected}).bind("select",function(E,D){$("#contract_office").val(D)});$("#open").click(function(){$("#example_agreement").show();$("#open").toggleClass("close-example");$("#close").toggleClass("close-example");return false});$("#close").click(function(){$("#example_agreement").hide();$("#open").toggleClass("close-example");$("#close").toggleClass("close-example");return false});$("#contract_client_pass").show_password("#show_client_password");$("#contracts_form").submit(function(E){E.preventDefault();data_form=$(this).serializeArray();for(key in data_form){if(data_form[key].value.length==0){$("#error").html("Заполните все поля");return false}}function D(){$.ajax({type:"POST",url:B,data:data_form,success:function(F){if(F.code==1){window.location.reload()}else{$("#error").html(F.error)}},dataType:"json"})}setUserVid(D);return false}).keydown(function(D){D.keyCode==13&&$(this).submit()});$("#contract_submit").click(function(D){D.preventDefault();$("#contracts_form").trigger("submit")})}function init_client_logout(D,C,A){var B=0;$("#"+D).click(function(){var E={};E.logout=1;$.ajax({type:"POST",url:C,data:E,success:function(F){if(F.code==1){location.href=A}},error:function(F){if(B<5){$("#"+D).trigger("click");B++}},dataType:"json"})})}function init_client_card_login_form(A){$("#cards_form").submit(function(B){B.preventDefault();data_form=$("#cards_form").serializeArray();for(key in data_form){if(data_form[key].value.length==0){$("#error").html("Заполните все поля");return false}}function C(){$.ajax({type:"POST",url:A,data:data_form,success:function(D){if(D.code==1){window.location.reload()}else{$("#error").html(D.error)}},dataType:"json"})}setUserVid(C);return false}).keydown(function(B){B.keyCode==13&&$(this).submit()});$("#card_submit").click(function(B){B.preventDefault();$("#cards_form").trigger("submit")});$("#card_seria").keydown(function(B){if($(this).val().length>=2&&(B.keyCode!=8&&B.keyCode!=46&&B.keyCode!=9)){if($(this).val().length>2){$("#card_client_login").val($(this).val().substr(2));$(this).val($(this).val().substr(0,2))}$("#card_client_login").focus()}});$("#card_client_login").keydown(function(B){if($(this).val().length>=6&&(B.keyCode!=8&&B.keyCode!=46&&B.keyCode!=9)){$("#card_client_pass").focus()}if((B.keyCode==8||B.keyCode==46)&&$(this).val().length==0){$("#card_seria").focus()}});$("#card_client_pass").show_password("#show_client_password")}$.fn.extend({"show_password":function(B){var A=this;function C(D){if(D.checked){$("#"+A.inputClone).val($(A).hide().val()).show()}else{$(A).val($("#"+A.inputClone).hide().val()).show()}}this.inputClone=$(this).attr("id")+"_clone";$(this).after($('<input type="text" />').attr({"class":$(this).attr("class"),"value":$(this).val(),"id":this.inputClone}).change(function(){$(A).val($(this).val())})).change(function(){$("#"+A.inputClone).val($(this).val())});B=$(B);C(B);B.click(function(){C(this)})}});(function(A){A.stupidModalStorage=[];A.stupidModal=function(E,D,H){this.baseClass="modal_form_popup";this.callbacks=[];var C=this;var B=null;D=D||[];D.executeHandler=typeof D.executeHandler=="undefined"?null:D.executeHandler;D.positioning=typeof D.positioning=="undefined"?null:D.positioning;D.message=typeof D.message=="undefined"?null:D.message;this.executeAll=function(){while(A.stupidModalStorage.length){var I=A.stupidModalStorage.shift();try{I()}catch(J){window.console&&console.log(J)}}};this.setCloseTimeout=function(){window.popupTimeOut=setTimeout(function(){A.stupidModal("close")},3000)};this.clearCloseTimeout=function(){window.popupTimeOut&&clearTimeout(window.popupTimeOut)};var G=A("#popup_set").children("div.popup2:visible").hide();if(E=="close"){this.clearCloseTimeout();if(G.attr("id")!="popup_login"){C.executeAll()}if(G.attr("id")=="popup_register_success"){var F=window.ROOT_HOST?ROOT_HOST:window.location.host;window.location="http://"+F}}else{if(E=="quit"){A.stupidModalStorage=[]}else{if(typeof (H)=="function"){A.stupidModalStorage.push(H)}if(D.executeHandler){A("body").bind(D.executeHandler,function(I){C.executeAll();A("body").unbind(I.type)})}if(E=="login"){B=A("#popup_login").show()}else{if(E=="register"){B=A("#popup_register").show()}else{if(E=="recovery"){B=A("#popup_recovery").show()}else{if(E=="regsuccess"){B=A("#popup_register_success").show()}else{if(E=="error"){B=A("#popup_notification_error").find("span.text_place_holder").html(!D.message?"":D.message).end().show();this.setCloseTimeout()}else{B=A("#popup_notification_success").find("span.text_place_holder").html(!D.message?"":D.message).end().show();this.setCloseTimeout()}}}}}if(!D.positioning||(D.positioning!="top"&&D.positioning!="related")){B.css("top",((A(window).height()-B.outerHeight())/2)+A(window).scrollTop()+"px")}else{if(D.positioning=="related"){B.css("top",G.css("top"))}else{B.css("top","80px")}}B.find("form").find('input[value=""]:visible').filter(":first").focus()}}};A(function(){var C=window.location.hash;if(C&&C.search("auth")==1){var B=C.match(/backurl=(.+)/);A.stupidModal("login",{positioning:"top",executeHandler:"authComplete"},(B&&B.length>1?function(){var D=B[1].split("?redirect=");window.location=D.length>1?D[0]+"?redirect="+encodeURIComponent(D[1]):D}:null))}A("#popup_set").find("a.close-popup").click(function(D){D.preventDefault();A.stupidModal("close")}).end().live("keydown",function(D){if(D.keyCode==27){A.stupidModal("quit")}});A(document).keydown(function(D){if(D.keyCode==27){A.stupidModal("quit")}});A("#popup_set").find(".ui_submit_btn").live("click",function(D){D.preventDefault();A(this).closest("form").submit()}).end().find(".ui_register_link").live("click",function(D){D.preventDefault();A.stupidModal("register",{positioning:"related"})}).end().find(".ui_login_link").live("click",function(E){E.preventDefault();var D=this.href;if(D.length&&D.search("http")==0){window.location=renderAuthHash(D)}else{A.stupidModal("login",{positioning:"related",executeHandler:"authComplete"})}}).end().find(".ui_forgot_link").live("click",function(D){D.preventDefault();A.stupidModal("recovery",{positioning:"related"})});A("#vk_social_auth").socialAuthInitVk("vk_email_wrapper","Были ли Вы уже зарегистрированы на нашем сайте?","При авторизации возникла ошибка");A("#fb_social_auth").socialAuthInitFb();A("#top_strip_line").live("favoriteHotelToggle",function(){A.ajax({url:"/hotel/reloadHeaderFavorite/",success:function(D){if(D){A("#fav_hotels_count").html(D)}}})}).live("refreshReviews",function(){A.ajax({url:"/profile/reloadHeaderReviews/",success:function(D){if(D){A("#top_reviews_count").html(D)}}})});A("body").bind("authComplete",function(){init_header_widgets();renderUserCity();init_hotel_history();init_search_history()})})})(jQuery);$.fn.extend({"socialAuthInitVk":function(B,A,D){var G=$(this);var E=G.attr("data-api");$("head").append('<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?34"><\/script>');var C=setInterval(function(){if(window.VK){clearInterval(C);try{VK.init({apiId:E})}catch(H){window.console&&console.log(H)}}},50);var F=0;$(this).live("click",function(I){I.preventDefault();var H=$("#"+B);if(F++%2==0){if(window.VK){VK.Widgets.Auth(B,{width:"200px",onAuth:function(J){if(J){H.sleep();$.ajax({url:G.attr("data-auth"),data:{auth:J},complete:function(){H.wakeup()},success:function(K){if(K.success){Auth.loginOk(K.data)}else{if(K.error){H.html(D||K.message)}else{H.html(K)}}}})}}})}H.removeClass("hidden")}else{H.addClass("hidden").html("")}})}});$("head").append('<script type="text/javascript" src="http://cdn.connect.mail.ru/js/loader.js"><\/script>');$.fn.extend({"socialAuthInitMru":function(){var F=$(this);var E=F.find(".mrc__connectButton");var A=F.attr("data-api");console.log(A);var D=F.attr("data-private");console.log(D);function C(){mailru.loader.require("api",function(){console.log("1");mailru.connect.init(A,D);mailru.events.listen(mailru.connect.events.login,function(G){console.log("MailRu:");console.log(G)});mailru.events.listen(mailru.connect.events.logout,function(){console.log("MailRu logout")});mailru.connect.getLoginStatus(function(G){if(G.is_app_user!=1){console.log(2);mailru.connect.initButton()}else{console.log(3);mailru.common.users.getInfo(function(H){console.log("getInfo mailru");console.log(H)})}})})}var B=setInterval(function(){if(window.mailru&&mailru.loader){clearInterval(B);C()}},50)}});$.fn.extend({"socialAuthInitFb":function(){var C=$(this);var B=$("#popup_login");C.click(function(D){D.preventDefault();if(B.filter(":visible").length){FB.getLoginStatus(function(E){B.sleep();if(!E.authResponse){FB.login(function(F){A(F)},{scope:"email"})}else{A(E)}})}});function A(D){B.wakeup();if(D.authResponse){if(D.authResponse["userID"]){FB.api("/me",function(E){var G={};for(var F in E){G[F]=E[F]}$.ajax({url:C.attr("data-auth"),data:{auth:G},beforeSend:function(){B.sleep()},complete:function(){B.wakeup()},success:function(I){try{if(I&&I.success){Auth.loginOk(I.data)}else{if(I&&I.error){$.stupidModal("error",{message:I.message})}else{window.console&console.log(I)}}}catch(H){window.console&console.log(H);$.stupidModal("error",{message:"Возникла ошибка"})}}})})}else{$.stupidModal("error",{message:"Возникла ошибка"})}}else{if(!D.status){$.stupidModal("error",{message:"Возникла ошибка"})}}}}});$.fn.extend({"socialAuthEmailSender":function(D,B,F,C){var G=$(this);var A=$(B);var E=$(D);$(this).submit(function(I){I.preventDefault();var H=true;G.find("input:visible").filter(".required").each(function(){if(!$(this).val().length){H=false}});if(H){E.sleep();$.ajax({url:G.attr("action"),data:G.serialize(),complete:function(){E.wakeup()},success:function(J){if(J.success){Auth.loginOk(J.data)}else{if(J.error){E.html(C||J.message)}else{E.html(J)}}}})}else{A.html(F)}})}});function renderAuthHash(A){var B=window.location;return A+"#auth&backurl="+B}function renderUserCity(){if(window.cityVariants){this.trmplate=null;this.readTemplate=$.Widget.prototype.readTemplate;this.readTemplate("userCityName");if(this.template){var C=window.USER_CITY?USER_CITY:"1";var B=cityVariants["_"+C];var A=this.template.text;$("#contact_city_wrapper").html(A.replace(/%city_link%/g,B.URL).replace("%city_name%",B.NAME).replace("%phone%",B.PHONE));$("#b-smallchoiser-ul").find("li").each(function(){if($(this).attr("c")==C){$(this).addClass("current")}else{$(this).removeClass("current")}})}}}function contacts_index_001(A,C,D,B){$(function(){var G=new YMaps.Map(YMaps.jQuery("#o_map_yandex")[0]);G.setCenter(new YMaps.GeoPoint(A.lng,A.lat),C);var F=new YMaps.Style();F.iconStyle=new YMaps.IconStyle();F.iconStyle.href=B;F.iconStyle.size=new YMaps.Point(56,50);F.iconStyle.offset=new YMaps.Point(-28,-50);$.each(D,function(){var I=this;var H=new YMaps.Placemark(new YMaps.GeoPoint(this.lng,this.lat),{style:F,hasBalloon:false});YMaps.Events.observe(H,H.Events.Click,function(){window.location.href=I.url});G.addOverlay(H)});var E=new YMaps.TypeControl([YMaps.MapType.MAP,YMaps.MapType.SATELLITE,YMaps.MapType.HYBRID],[1,2]);G.addControl(E);G.addControl(new YMaps.ToolBar());G.addControl(new YMaps.Zoom());G.addControl(new YMaps.ScaleLine())})}function contacts_sms_init(G,E,H,B){var J=$("#phone_number");var C=/^\+?[\d\-\s\(\)]{7,14}/;var I=$("#message_type");var D=false;var F=null;var A=false;$("#ui-modal-sms-form").appendTo($("#modal_popup_sms").find("#modal_container"));$("#send_sms_btn").click(function(M){M.preventDefault();$("#modal_popup_sms").parent().removeClass("hidden").find("#form_content").show().siblings().hide()});$(".modal_close_button").live("click",function(M){M.preventDefault();$("#modal_popup_sms").parent().addClass("hidden")});J.smart_input({label:G,onFocus:K});I.find("input").click(K);$("#modal-submit-link").click(function(M){M.preventDefault();$(this).closest("form").submit()});$("#ui-modal-sms-form").submit(function(N){N.preventDefault();if(!D){if(J.val().match(C)){D=true;if(!I.find("input:checked").length){D=false;F=$("#message_type_error");L(F,H)}}else{F=$("#phone_error");L(F,E)}}if(D){var M=$(this).sleep();function O(){$.ajax({data:M.serialize(),type:"POST",url:M.attr("action"),beforeSend:function(){A=true},complete:function(){A=false;M.wakeup()},success:function(P){A=true;if(P&&!P.error){M.append(P).find("#form_content").hide()}else{D=false;F=$("#phone_error");L(F,B);P.phone&&J.val(P.phone)}}})}!A&&setUserVid(O)}});function K(){if(F){F.fadeOut()}}function L(M,N){M.html(N);M.fadeIn()}}function init_profile_fn(){function A(E,F){var F=F||false;var C=$(E).attr("data-rel");var B=$(E).closest(".review_block");if(C){var D=E;$.ajax({beforeSend:function(){B.sleep()},complete:function(){B.wakeup()},url:"/profile/review/delete/",data:"data="+C,type:"GET",success:function(I){if(I.success){if(F&&I.reload){window.location.reload()}else{if(I.count){var H=$("#review_count_block");if(H.length){var G=jQuery.trim(H.text());H.html(H.html().replace(G,G.replace(/\d+/,I.count)))}}$(D).closest(".review_block").wakeup().remove();$("#top_strip_line").trigger("refreshReviews")}}}})}}$("a.profile_remove_review").live("click",function(B){B.preventDefault();if(!confirm("Вы действительно хотите удалить этот отзыв/комментарий?")){return }A(this,true)});$("a.profile_remove_comment").live("click",function(B){B.preventDefault();if(!confirm("Вы действительно хотите удалить этот комментарий?")){return }A(this)});$("a.profile_remove_review_r").live("click",function(B){if(!confirm("Вы действительно хотите удалить этот отзыв?")){return false}})}function init_header_widgets(){$("#search_history_box").searchHistorySelectList({template:"historySelectList",opts:window.SEARCH_HISTORY?window.SEARCH_HISTORY:{},dataSource:ROOT_HOST+"/auth/search_history.php",bodyTemplate:"bodyTours"});$("#hotel_history_box").hotelHistorySelectList({template:"historySelectList",opts:window.HOTELS_HISTORY?HOTELS_HISTORY:{},dataSource:ROOT_HOST+"/auth/hotel_history.php",bodyTemplate:"bodyHotels"});$("a.hotel-history-clear").live("click",function(A){A.preventDefault();var B=$("#hotel_history_box").hotelHistorySelectList("close");$.ajax({url:this.href,beforeSend:function(){B.sleep()},complete:function(){B.wakeup()},success:function(D){if(D&&D.success){init_hotel_history();var C=$("#hotel-history-wrapper");if(C.length){$.ajax({url:C.attr("data-update"),beforeSend:function(){C.sleep()},complete:function(){C.wakeup()},success:function(E){E&&C.wakeup()&&C.replaceWith(E)}})}}}})});$("a.tour-history-clear").live("click",function(A){A.preventDefault();var B=$("#search_history_box").searchHistorySelectList("close");$.ajax({url:this.href,beforeSend:function(){B.sleep()},complete:function(){B.wakeup()},success:function(D){if(D&&D.success){init_search_history();var C=$("#tour-history-wrapper");if(C.length){$.ajax({url:C.attr("data-update"),beforeSend:function(){C.sleep()},complete:function(){C.wakeup()},success:function(E){E&&C.wakeup()&&C.replaceWith(E)}})}}}})})}function init_anonym_hotel_history(A){setUserVid(function(){$.ajax({url:"/hotel/"+A+"/addHistory/",success:function(){init_hotel_history()}})})}function init_hotel_history(){$("#hotel_history_box").hotelHistorySelectList("refreshOpts")}function init_search_history(){$("#search_history_box").searchHistorySelectList("refreshOpts")}function reset_hotel_history(A){$("#hotel_history_box").hotelHistorySelectList("resetOpts",A)}function reset_search_history(A){$("#search_history_box").searchHistorySelectList("resetOpts",A)}function refreshSessionVars(){$.ajax({url:"http://"+ROOT_HOST+"/auth/user_city.php",dataType:"jsonp"})}function refreshSessionCity(B,A){window.USER_CITY=B;setUserVid(function(){$.ajax({url:A,type:"GET",data:{uniq:Math.random(),c:B}})})}function init_share_links(){var A=false;var B=false;send_ajax=function(C){new JSONRequest({params:[C,$("input#what-are-you-doing").attr("value")],method:"share",success:function(){}})};waitFB=function(){if(typeof (FB)=="undefined"){window.setTimeout(waitFB,100)}else{FB.init({appId:"162154090517671",cookie:true,status:true,xfbml:true});FB.ui({method:"feed",name:"Itour",link:"http://obnovlenie.ru",picture:"http://obnovlenie.ru/images/2.7.4/v9b056.logo-obnovlenie.png",message:$("input#what-are-you-doing").attr("value")},function(C){if(C&&C.post_id){send_ajax("fb")}})}};waitVK=function(){if(typeof VK=="undefined"){window.setTimeout(waitVK,100)}else{try{VK.init({apiId:2381640,api_id:2381640});VK.Auth.login(function(D){if(D.authResponse){VK.Api.call("wall.post",{"message":$("input#what-are-you-doing").attr("value")},function(E){send_ajax("vk")})}},8192)}catch(C){window.console&&console.log(C)}}};$("#vk-button").click(function(){if(B==false){$("head").append('<script type="text/javascript" src="http://vkontakte.ru/js/api/openapi.js"><\/script>');B=true}waitVK()});$("#twi-button").click(function(){window.open("http://twitter.com/share?original_referer="+encodeURIComponent("http://obnovlenie.ru")+"&source=tweetbutton&text="+encodeURIComponent($("input#what-are-you-doing").attr("value"))+"&url="+encodeURIComponent("http://obnovlenie.ru"),"Tweet","width = 500, height = 300, status = 0, toolbar = 0, location = 0,menubar = 0, directories = 0");send_ajax("twi")});$("#fb-button").click(function(){if(A==false){$("head").append('<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"><\/script>');A=true}waitFB()})}function init_hotels_sorting_links(A,C,B){$.widget("ui.tourSelectSortingList",$.ui.tourSelectList,{getValueAsText:function(D){return"Сортировать по "+this.opts[D]}});$("#sorting_selector").tourSelectSortingList({template:"tourSelectList",opts:A,value:B}).bind("select",function(){var D=$(this);setUserVid(function(){window.location=C[D.val()]})})}function init_hotels_country_filter(A,C,B){$("#country_selector").tourSelectList({template:"tourSelectList",opts:A,value:B}).bind("select",function(){var D=$(this);setUserVid(function(){window.location=C[D.val()]})})}function init_hotels_perpage_links(A){var B=A instanceof jQuery?A:$(A);B.find("a").click(function(D){D.preventDefault();var C=this;setUserVid(function(){if(C.href){window.location=C.href}})})}function init_gplusone_btn(A){$().ready(function(){var B=document.createElement("script");B.type="text/javascript";B.async=true;B.src="https://apis.google.com/js/plusone.js";var C=document.getElementsByTagName("script")[0];C.parentNode.insertBefore(B,C)})}var User={};User.registrationSuccess=function(A){if(A){var B=$("#popup_register_success").find("a.btn");B.attr("href",B.attr("data-url").replace("userId",A));$.stupidModal("regsuccess")}};(function(A){A.widget("ui.month_calendar",{_getDay:function(B){var C=B.getDay();return(--C)<0?(C+7):C},_strToDate:function(G){var F=/(\d{4})\-(\d{1,2})\-(\d{1,2})/.exec(G);var B=new Date();if(F&&F.length==4){var E=parseInt(F[1],10),D=parseInt(F[2],10),C=parseInt(F[3],10);B.setFullYear(E);B.setMonth(D-1);B.setDate(C)}else{var F=/(\d{1,2})\.(\d{1,2})\.(\d{4})/.exec(G);if(F&&F.length==4){var E=parseInt(F[3],10),D=parseInt(F[2],10),C=parseInt(F[1],10);B.setFullYear(E);B.setMonth(D-1);B.setDate(C)}}return B},_constructYearDiv:function(F){var H=this.element,B=this.options,I=this;var J=new Date();var C=A("<div />").addClass("year");var E="<h3>"+F+"</h3>";E+="<ul>";for(var D=0;D<12;D++){var G=new Date(F,D,1);E+="<li";E+=(J-G<0)?' class="'+B.disabledClass+'"':"";E+=' date="'+F+"-"+(D+1)+'-1"';E+=">";E+=B.monthLabels[D];E+="</li>"}E+="</ul>";return C.html(E)},_fillContent:function(L,K,D){var G=this.element,B=this.options,J=this;var I=G.find("div.year");var H=[];for(var F=0;F<B.yearSimultaneously;F++){var E=J._constructYearDiv(L.getFullYear());E.hide();H.push(E);G.append(E)}if(B.animation&&typeof (D)!="undefined"){var C=-50;if(D<0){C*=-1}removed_months.eq(0).animate({marginLeft:C+"px"},100,"linear",function(){removed_months.remove();G.find("div.year").fadeIn()})}else{I.remove();G.find("div.year").show()}if(this.options._active_date.getFullYear()==this.options._current_date.getFullYear()){this.options.next_year.css("visibility","hidden")}else{this.options.next_year.css("visibility","visible")}if(typeof (B.onDisplay)=="function"){B.onDisplay.call(J)}},_selectYear:function(B){this.options._active_date.setFullYear(this.options._active_date.getFullYear()+B);this._fillContent(this.options._active_date,this.options._current_date,B)},_init:function(){var B=this.element,C=this.options,D=this;this.options._current_date=D._strToDate(C.currentDate);B.addClass(C.calendarClass).append(this.options.prev_year).append(this.options.next_year);this.options._active_date=new Date(this.options._current_date.getFullYear(),this.options._current_date.getMonth(),this.options._current_date.getDate());this.options.next_year.click(function(E){E.preventDefault();E.stopPropagation();D._selectYear(1)});this.options.prev_year.click(function(E){E.preventDefault();E.stopPropagation();D._selectYear(-1)});this.goNextYear=function(){D._selectYear(1)};this.goPrevYear=function(){D._selectYear(-1)};this.options.onSelectStack=[];if(typeof (C.onSelect=="function")){this.options.onSelectStack.push(C.onSelect)}B.click(function(E){var H=A(E.target);if(!H.filter("li:not(."+C.disabledClass+")").length){return }if(C.readOnly){return }var F=D._strToDate(H.attr("date"));D.options._current_date=F;A("li."+C.activeClass,B).removeClass(C.activeClass);H.addClass(C.activeClass);if(D.options.onSelectStack.length){for(var G=0;G<D.options.onSelectStack.length;G++){D.options.onSelectStack[G].call(H,F)}}});D._fillContent(D.options._active_date,D.options._current_date)},setMinDate:function(B){this.options.minDate=B;var D=this._strToDate(B);if(D instanceof Date&&D>this.options._current_date){this.options._active_date=this.options._current_date=D;if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},setMaxDate:function(B){this.options.maxDate=B;var D=this._strToDate(B);if(D instanceof Date&&D<this.options._current_date){this.options._active_date=this.options._current_date=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},addEventOnSelect:function(B){if(typeof (B)=="function"){this.options.onSelectStack.push(B)}},redraw:function(){this.options._active_date=new Date(this.options._current_date.getFullYear(),this.options._current_date.getMonth(),this.options._current_date.getDate());this._fillContent(this.options._active_date,this.options._current_date)}})})(jQuery);$.extend($.ui.month_calendar.prototype,{options:{minDate:null,maxDate:null,monthLabels:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],daysPlate:"",activeClass:"active",disabledClass:"disabled",onSelect:null,onDisplay:null,currentDate:null,calendarClass:"b-calendar",yearSimultaneously:1,readOnly:false,animation:false,prev_year:$('<a href="#" class="prev"/>'),next_year:$('<a href="#" class="next"/>')}});(function(A){A.widget("ui.calendar",{options:{minDate:null,maxDate:null,monthLabels:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayLabels:["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],daysPlate:"",onSelect:null,onHoverIn:null,onHoverOut:null,onDisplay:null,currentDate:null,calendarClass:"b-calendar",monthSimultaneously:2,readOnly:false,animation:false,monthScrollerDiff:1,disabledClass:"disabled",todayClass:"current_date",activeDateClass:"to_date",parityDateClass:"from_date",intermediateClass:"selected_dates",parityDate:null},_parityDate:null,_getDay:function(B){var C=B.getDay();return(--C)<0?(C+7):C},_strToDate:function(G){if(G instanceof Date){return G}var F=/(\d{4})\-(\d{1,2})\-(\d{1,2})/.exec(G);var B=new Date();if(F&&F.length==4){var E=parseInt(F[1],10),D=parseInt(F[2],10),C=parseInt(F[3],10);B.setFullYear(E);B.setMonth(D-1,1);B.setDate(C)}else{var F=/(\d{1,2})\.(\d{1,2})\.(\d{4})/.exec(G);if(F&&F.length==4){var E=parseInt(F[3],10),D=parseInt(F[2],10),C=parseInt(F[1],10);B.setFullYear(E);B.setMonth(D-1,1);B.setDate(C)}}B.setHours(0);B.setMinutes(0);B.setSeconds(0);B.setMilliseconds(0);return B},_getLastDayOfMonth:function(C){if(!(C instanceof Date)){return null}var D=C.getMonth(),B=new C.constructor(C);for(var E=28;E<=31;E++){B.setDate(E+1);if(B.getMonth()!=D){return E}}return null},_constructMonthDiv:function(T,X){var H=this.element,a=this.options,R=this;var V=A("<div />").addClass("month");var W=R._getDay(T);var Y="<h3>"+a.monthLabels[parseInt(T.getMonth())]+"</h3>";Y+=a.daysPlate;Y+="<ul>";var G=null;var F=T.getFullYear(),M=T.getMonth()+1;var P=false,O=false,J=false;if(a.minDate){var K=R._strToDate(a.minDate),C=K.getFullYear(),D=K.getMonth()+1;if(C==F&&D==M){P=true;var N=K.getDate()}else{if(C>F||(C==F&&D>M)){J=true}}}if(a.maxDate){var S=R._strToDate(a.maxDate),B=S.getFullYear(),Z=S.getMonth()+1;if(B==F&&Z==M){O=true;var U=S.getDate()}else{if(B<F||(B==F&&Z<M)){J=true}}}if((X instanceof Date)&&((X.getMonth()+1)==M)&&(X.getFullYear()==F)){G=parseInt(X.getDate(),10)}var I=new Date();var L=null;if((I.getFullYear()==F)&&((I.getMonth()+1)==M)){L=I.getDate()}var S=parseInt(R._getLastDayOfMonth(T))+W;for(var E=0;E<S;E++){var Q=((E-W)<0)?"":(1+E-W);_class="_c ";if(Q===G){_class+=a.activeDateClass}else{if(Q===L){_class+=a.todayClass}else{if(Q===""||J||(P&&parseInt(Q,10)<N)||(O&&parseInt(Q,10)>U)){_class+=a.disabledClass}}}Y+="<li";Y+=' class="'+_class+'"';Y+=(Q!="")?' date="'+F+"-"+M+"-"+Q+'"':"";Y+=">";Y+=Q;Y+="</li>"}Y+="</ul>";V.html(Y);return V},_fillContent:function(M,L,D){var I=this.element,B=this.options,K=this;var H=I.find("div.month");var E=[];for(var G=0;G<B.monthSimultaneously;G++){var F=new Date(M.getFullYear(),M.getMonth(),1,0,0,0,0);F.setMonth(F.getMonth()+G);var J=K._constructMonthDiv(F,L);J.attr("month",F.getMonth()+1);J.hide();E.push(J);I.append(J)}if(B.animation&&typeof (D)!="undefined"){var C=-50;if(D<0){C*=-1}H.eq(0).animate({marginLeft:C+"px"},100,"linear",function(){H.remove();I.find("div.month").fadeIn()})}else{H.remove();I.find("div.month").show()}var F=new Date(M.getFullYear(),M.getMonth(),1,0,0,0,0);if(F<this._strToDate(this.options.minDate)){A(".prev",this.element).addClass("disabled")}else{A(".prev",this.element).removeClass("disabled")}K._redrawSelected();if(typeof (B.onDisplay)=="function"){B.onDisplay.call(K)}},_selectMonth:function(B){this.options._active_date.setMonth(this.options._active_date.getMonth()+B);this._fillContent(this.options._active_date,this.options._current_date,B)},_redrawSelected:function(){if(!this.options.parityDate){return }var U=this.options._current_date,M=this.options.parityDate,N=null,G=null,I=new Date(),K=this.element.find(".month").find("li[date]"),J=0,R=0,F="",E="",S=this.element.find(".month"),C=S.eq(0),B=S.eq(1);K.removeClass(this.options.intermediateClass);K.removeClass(this.options.parityDateClass);K.removeClass(this.options.activeDateClass);if(U<M){N=U;G=M;F=this.options.activeDateClass;E=this.options.parityDateClass}else{if(U>=M){N=M;G=U;F=this.options.parityDateClass;E=this.options.activeDateClass}}var P=false;S.each(function(W,X){var V=A(X).attr("month")-1;P=P||N.getMonth()<=V||G.getMonth()>=V});if(!P){return }var Q=true,O=true;if(N.getMonth()<(C.attr("month")-1)){N=new N.constructor(N);N.setMonth(C.attr("month")-1);N.setDate(1);Q=false}if(G.getMonth()>(B.attr("month")-1)){G=new G.constructor(G);G.setMonth(B.attr("month")-1);G.setDate(this._getLastDayOfMonth(G));O=false}var T=N.getFullYear()+"-"+(N.getMonth()+1)+"-"+N.getDate(),D=G.getFullYear()+"-"+(G.getMonth()+1)+"-"+G.getDate(),H=K.filter("[date='"+T+"']"),L=K.filter("[date='"+D+"']");J=(G-N)/(1000*24*3600);R=N.getDate()-1;if(J&&H.closest(".month").attr("month")==L.closest(".month").attr("month")&&C.attr("month")!=L.closest(".month").attr("month")){R+=C.find("li[date]").length}if(Q){K.eq(R).addClass(F)}while(J>=0){K.eq(R++).addClass(this.options.intermediateClass);J--}if(O){K.eq(R-1).addClass(E)}},_create:function(){var B=this.element,D=this.options,E=this;this.options._current_date=E._strToDate(D.currentDate);if(D.parityDate&&!(D.parityDate instanceof Date)){D.parityDate=E._strToDate(D.parityDate)}var C=A('<a href="#" class="prev"/>');var F=A('<a href="#" class="next"/>');B.addClass(D.calendarClass).append(C).append(F);this.options._active_date=new Date(this.options._current_date.getFullYear(),this.options._current_date.getMonth(),this.options._current_date.getDate(),0,0,0);F.click(function(G){G.preventDefault();G.stopPropagation();if(A(this).hasClass("disabled")){return }E._selectMonth(E.options.monthScrollerDiff)});C.click(function(G){G.preventDefault();G.stopPropagation();if(A(this).hasClass("disabled")){return }E._selectMonth(-1*E.options.monthScrollerDiff)});this.goNextMonth=function(){E._selectMonth(1)};this.goPrevMonth=function(){E._selectMonth(-1)};this.options.onSelectStack=[];if(typeof (D.onSelect)=="function"){this.options.onSelectStack.push(D.onSelect)}B.click(function(G){var J=A(G.target);if(!J.filter("li:not(."+D.disabledClass+")").length){return }if(D.readOnly){return }var H=E._strToDate(J.attr("date"));E.options._current_date=H;A("li."+D.activeDateClass,B).removeClass(D.activeDateClass);J.addClass(D.activeDateClass);if(E.options.onSelectStack.length){for(var I=0;I<E.options.onSelectStack.length;I++){E.options.onSelectStack[I].call(J,H)}}E.redraw()});E._fillContent(E.options._active_date,E.options._current_date)},setMinDate:function(B){this.options.minDate=B;var D=this._strToDate(B);if(D instanceof Date&&D>this.options._current_date){this.options._active_date=this.options._current_date=D;if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},setMaxDate:function(B){this.options.maxDate=B;var D=this._strToDate(B);if(D instanceof Date&&D<this.options._current_date){this.options._active_date=this.options._current_date=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},moveDateUp:function(B){B=this._strToDate(B);if(B instanceof Date&&B>this.options._current_date){this.options._active_date=this.options._current_date=new Date(B.getFullYear(),B.getMonth(),B.getDate());if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},moveDateDown:function(B){B=this._strToDate(B);if(B instanceof Date&&B<this.options._current_date){this.options._active_date=this.options._current_date=new Date(B.getFullYear(),B.getMonth(),B.getDate());if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}}this._fillContent(this.options._active_date,this.options._current_date)},setDate:function(B){B=this._strToDate(B);this.options._active_date=this.options._current_date=new Date(B.getFullYear(),B.getMonth(),B.getDate());if(this.options.onSelectStack.length){for(var C=0;C<this.options.onSelectStack.length;C++){this.options.onSelectStack[C].call(this.element,this.options._current_date)}}this._fillContent(this.options._active_date,this.options._current_date)},setParityDate:function(B){this.options.parityDate=this._strToDate(B)},addEventOnSelect:function(B){if(typeof (B)=="function"){this.options.onSelectStack.push(B)}},redraw:function(){this.options._active_date=new Date(this.options._current_date.getFullYear(),this.options._current_date.getMonth(),this.options._current_date.getDate());this._fillContent(this.options._active_date,this.options._current_date)},goNextMonth:function(){this._selectMonth(1)}})})(jQuery);(function(A){A.widget("ui.simple_autocomplete",{last_search_term:"",last_result:[],_init:function(){var B=this;var D=this.options;var C=A.ui.keyCode;A(document).keydown(function(E){if(E.keyCode==C.ESCAPE){B.close()}});A(document).click(function(E){if(!A(E.target).closest("#ui_autocomplete_container").length){B.close()}});A(this.element).click(function(E){E.preventDefault();E.stopPropagation()});A("#ui_autocomplete_container li").click(function(){B._choose(A(this));B._confirm()});A(this.element).keyup(function(E){switch(E.keyCode){case C.ESCAPE:B.close();break;case C.UP:B._move("up");break;case C.TAB:case C.DOWN:B._move("down");break;case C.ENTER:B._confirm();break;default:search_term=A(B.element).val();if(search_term.length>=D.min_len&&B.last_search_term!=search_term){B.search.call(B,search_term)}else{if(search_term.length<D.min_len){B.close()}}B.last_search_term=search_term;break}})},open:function(){if(A("#ui_autocomplete_container:hidden").length){A("#ui_autocomplete_container").show();if(typeof this.options.onOpen=="function"){this.options.onOpen()}}},close:function(){if(A("#ui_autocomplete_container:visible").length){A("#ui_autocomplete_container").hide();if(typeof this.options.onClose=="function"){this.options.onClose()}}},search:function(D){D=D.toLowerCase();var C=[];var B=this;if(typeof this.options.onSearch=="function"){this.options.onSearch()}A.each(B.options.data,function(E,F){if(F===undefined){return }if(F.match(";"+D)){C.push(E);if(A.inArray(E,B.last_result)==-1){A("#ui_autocomplete_element_"+E).show()}}});A.each(B.last_result,function(E,F){if(A.inArray(F,C)==-1){A("#ui_autocomplete_element_"+F).hide().removeClass("ui-autocomplete-active")}});B.last_result=C;if(C.length){this.open();this._found()}else{this.close();this._notFound()}},_found:function(){if(typeof this.options.onFound=="function"){this.options.onFound()}},_notFound:function(){if(typeof this.options.onNotFound=="function"){this.options.onNotFound()}},_choose:function(B){if(typeof this.options.onChoose=="function"){this.options.onChoose(B)}A("#ui_autocomplete_container .ui-autocomplete-active ").removeClass("ui-autocomplete-active");B.addClass("ui-autocomplete-active")},_confirm:function(){if(typeof this.options.onConfirm=="function"){this.options.onConfirm()}},_move:function(B){if(!A("#ui_autocomplete_container .ui-autocomplete-active ").length&&B=="down"){var C=A("#ui_autocomplete_container li:visible").eq(0);this._choose(C)}else{var D=A("#ui_autocomplete_container .ui-autocomplete-active ");if(B=="up"){var C=D.prevAll("li:visible").eq(0)}else{var C=D.nextAll("li:visible").eq(0)}if(C.length){this._choose(C)}}}})})(jQuery);jQuery.extend(jQuery.ui.simple_autocomplete.prototype,{options:{data:[],min_len:2,onOpen:null,onClose:null,onFound:null,onNotFound:null,onChoose:null,onConfirm:null,onSearch:null}});(function(D){var A;var B=function(F,E){return'<div class="bubble bubble-notice"><div class="msg"><p>'+F+'</p></div><i class="t '+E+'" id="bubble_tail"><i></i></i><i class="s"></i></div>'},C=function(F,E){return'<div class="bubble bubble-error"><div class="msg"><p>'+F+'</p></div><i class="t '+E+'" id="bubble_tail"><i></i></i><i class="s"></i></div>'};D.bubble=function(E){if(A){A=null}var G="tail-"+(E.pos||"bl");if(!E.obj instanceof jQuery){throw new Error("Object must be defined and be a jQuery object")}var F=E.type||"notice",J=E.spd||"fast",H;switch(F){case"error":H=C(E.body,G);break;case"notice":H=B(E.body,G);break}if(!H){throw new Error("Invalid bubble type")}var I=D(H);I.css({visibility:"hidden",position:"absolute"}).appendTo("body");var M=E.obj.offset(),K=M.top-I.height()+(-11),L=M.left;I.css({top:parseInt(K)+"px",left:parseInt(L)+"px",display:"none",visibility:"visible"}).fadeIn(J);A=function(){D(this).unbind("mouseup",A);D(I).fadeOut(J,function(){D(I).remove()})};D(document.body).bind({mouseup:A,keydown:A})}})(jQuery);Auth=new function(){var loginTimer,self=this;this.isAuthCall=false;this.hasVid=false;this.callbackStack=[];this.onLoginFrameLoad=function(frameElem){try{var name=frameElem.contentWindow.name;if(name===undefined){throw new Error("we are on another domain")}if(name==frameElem.getAttribute("name")){return }frameElem.contentWindow.name=frameElem.getAttribute("name");onLoginMessage(name)}catch(e){frameElem.contentWindow.location=frameElem.getAttribute("src")}};this.authUser=function(domain,authUrl,checkSidUrl,checkSidCallback){if(!$("form[name=__authForm]").length){self.isAuthCall=true;self.handleCheckSid=function(){$("head").append('<script type="text/javascript" src="'+checkSidUrl+'"><\/script>')};self.handleCheckSidCallback=function(){self.hasVid=true;self.authCallback(checkSidCallback);self.isAuthCall=false};newDiv=document.createElement("div");newDiv.style.display="none";newDiv.innerHTML='<iframe style="display:none" onload="Auth.handleCheckSid()" name="__authframe"></iframe> 			<form method="POST" name="__authForm" target="__authframe" action="'+authUrl+'"></form>';newDiv2=document.createElement("div");document.body.appendChild(newDiv);var form=$("form[name=__authForm]")[0];form.submit()}else{self.authCallback(checkSidCallback)}};this.authCallback=function(checkSidCallback){if(typeof (checkSidCallback)=="function"){self.callbackStack.push(checkSidCallback)}if(self.hasVid){while(self.callbackStack.length){var fn=self.callbackStack.shift();try{fn()}catch(err){window.console&&console.log(err)}}}};function onLoginMessage(message){clearTimeout(loginTimer);var message=eval("("+message+")");if(message.error){loginError("denied",message.error);return }self.loginOk(message)}function alert_error_show(message){$("#popup-login-form").find("input:visible").each(function(){$(this).siblings(".error").html(this.name=="email"?message:"")})}function loginError(status,message){if(status=="timeout"){alert_error_show("Ошибка сервера авторизации.");return }alert_error_show(message);self.loginForm("wakeup")}this.loginOk=function(loginInfo){var callback=self.callback;loginInfo&&loginInfo.sid&&loginInfo.id&&$.cookie("sid",loginInfo.sid,{path:"/"});if(loginInfo&&!loginInfo.id){alert_error_show("Подтвердите регистрацию.<br />Инструкции высланы на email.");return }if(callback){callback(self.refreshHead)}else{self.refreshHead()}};this.reload=function(){window.location.reload(true)};this.refreshHead=function(){$("#popup-login-form").trigger("closeLoginForm");var frame=document.getElementById("refreshframe");var ie=0/*@cc_on + @_jscript_version @*/;if(!ie){frame.onload=Auth.refreshHandler;frame.contentDocument.location.reload(true)}else{if(frame.addEventListener){frame.addEventListener("load",Auth.refreshHandler,false)}else{if(frame.attachEvent){frame.attachEvent("onload",Auth.refreshHandler)}}document.frames["refreshframe"].document.location.reload(true)}};this.refreshHandler=function(){$.ajax({url:"/system/refresh/head/",data:{url:document.URL},success:function(res){if(res){var $html=$(res);$("#header_replacement").replaceWith($html.find("#header_replacement"));$("#top_strip_line").replaceWith($html.find("#top_strip_line"))}$("body").trigger("authComplete")}})};this.loginForm=function(action){$("#popup-login-form")[action]();if(!$("#popup-login-form").is(":visible")){this.callback=null}if($("#popup-login-form").is(":visible")){$("#popup-login-form input[name=email]").focus()}};this.initForm=function(){$("#loginframe-container").html('<iframe name="loginframe" id="loginframe" onload="Auth.onLoginFrameLoad(this)" src="/blank.html"></iframe>');$("#loginframe-container").append('<iframe name="refreshframe" id="refreshframe" src="/blank.html"></iframe>');$("#loginframe").load(function(){self.onLoginFrameLoad(this)});$("#popup-login-form").submit(function(){loginTimer=setTimeout(function(){loginError("timeout")},10000)});$("#login-button").click(function(){self.loginForm("sleep");self.loginForm("submit")})};this.decorate=function(callback){if(window.user_id){callback();return }this.callback=callback;this.loginForm("show")}};jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}}
