var JSON;if(!JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};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 '}e+="<=0){return}if(a.length>1){a.each(function(e){controls.hideRegionBetweenComments($(this),b)});return}if(b==undefined){b=false}var c=a[0].nextSibling;var d=[];while(c){if(c.nodeType===8&&c.nodeValue==="END"){break}if(c.nodeType===3){d.push(c)}else{if(b){$(c).show()}else{$(c).hide()}}c=c.nextSibling}if(!b){$.each(d,function(e,f){$(f).remove()})}},set_contentVisibility:function(a,b){if(a.length){var c=a[0].nextSibling;while(c){if(c.nodeType===8&&c.nodeValue==="END"){break}if(b){$(c).hide()}else{$(c).show()}c=c.nextSibling}}return true},get_expandcollapse:function(b,a,d){var f=b.attr("state");var c=false;if(f){c=(f=="expanded");var e=a[0].nextSibling;while(e){if(e.nodeType===8&&e.nodeValue==="END"){break}if(c){$(e).hide()}else{$(e).show()}e=e.nextSibling}}else{if(d==undefined||d==null||d==""){return false}a.load(d,function(g){a.after(g)})}b.attr("state",c?"collapsed":"expanded");return true},isInitialized:function(a){a=$(a);var b=a.html();var c=b.lastIndexOf("");if((c>=b.length-20)&&(c!=-1)){return true}a.append("");return false}};var webUrl={param:function(a){var b=$.param(a);b=b.replace(/\+/g,"%20");return b},GetCurrentPageName:function(){return webUrl.GetPageName(document.location.pathname)},GetPageName:function(b){var a=b.split(/[\/?]/);return a[1]}};var webSettings={currentClientHeight:0,loadingTimeout:0,inputClass:"",inputClassFocus:"",inputLeftClass:"",inputLeftClassFocus:"",inputErrorClass:"",inputErrorLeftClass:"",buttonClass:"",buttonClassHover:"",buttonLeftClass:"",buttonLeftClassHover:"",checkedBoxClass:"",checkedBoxClassHover:"",uncheckedBoxClass:"",uncheckedBoxClassHover:"",checkedRadioClass:"",checkedRadioClassHover:"",uncheckedRadioClass:"",uncheckedRadioClassHover:"",comboboxClass:"",comboboxClassFocus:"",comboboxLeftClass:"",comboboxLeftClassFocus:"",liveInitialized:false,attributesNames:{threeStateButtonCollapseID:"tsb_cid",threeStateButtonExpandeID:"tsb_eid",threeStateButtonUnexpandedID:"tsb_uid"},get_filterUrl:function(a,c){var d="";if(!c){c="&"}var b;a.find("[filter='filter']").each(function(){b=$(this);var e;if(b.is(":checkbox")){e=b.is(":checked")}else{e=b.val()}if(e){d+=(d?"&":"")+b.attr("field")+"="+e}});if(d){d=c+d}return d},get_isGuid:function(a){if(a){return new RegExp("^({{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}}{0,1})$").test(a)}else{return false}},set_threeStateButtonState:function(a){a=$(a);var b;if(a.is("a")){b=a.children()}else{b=a}var f=b.attr("state");if(f=="unexpandable"){return}if(!f){f="collapsed"}var c=(f=="collapsed"?b.attr(webSettings.attributesNames.threeStateButtonCollapseID):b.attr(webSettings.attributesNames.threeStateButtonExpandeID));var e=b.attr("src");var d=e.split("?").pop().split("&").shift().split("=").pop();b.attr("src",e.replace(d,c));b.attr("state",(f=="collapsed"?"expanded":"collapsed"))},log:function(a){$("#logc").css({display:""});$("#log").append("
  • "+a+"
  • ")},set_mousePoint:function(){$(document).mousemove(function(a){$.coorX=a.pageX;$.coorY=a.pageY})},set_showLoadScreen:function(){$("#waitImg").center().css({visibility:"visible"});$("#waitDiv").height(document.body.clientHeight).center().css({visibility:"visible"})},set_hideLoadScreen:function(){$("#waitDiv").center().css({visibility:"hidden"});$("#waitImg").center().css({visibility:"hidden"})},set_controlsPositions:function(){var g=$("#cCPHWorkArea");if(g.length){var f=true;if($.browser.msie){var b=document.documentElement.clientHeight;if(b==webSettings.currentClientHeight){f=false}}if(f){g.height("");var c=document.documentElement.clientHeight;var a=document.body.clientHeight;var d=0;if($("#cCPHBottom").length){d=$("#cCPHBottom").outerHeight(true)}var e=g.position().top;var h=g.outerHeight(true);var i=g.height();var j=Math.max(a,c);if($.browser.mozilla||$.browser.opera){g.height(j-e-d)}else{g.height(j-e-d-(h-i))}if($.browser.msie){webSettings.currentClientHeight=document.documentElement.clientHeight}}}window.clearTimeout(webSettings.loadingTimeout);webSettings.set_hideLoadScreen();$(document.body).css("visibility","visible")},get_webMethod:function(c){if(c.async==undefined){c.async=false}if(c.cache==undefined){c.cache=false}var a=$(this);var b=null;$.ajax({type:"POST",url:"/WebMethods.aspx/"+c.method,data:c.parameters,contentType:"application/json; charset=utf-8",dataType:"json",async:c.async,cache:c.cache,success:function(d){if(c.onsucces&&c.target){c.onsucces.call(c.target,d)}b=d},error:function(f,e,d){if(c.onerror&&c.target){c.onerror.call(c.target,f,e,d)}}});return b},_handlers:[],runHandlers:function(){for(var b=0;b ";$.fn.messageBox("Обращение в службу технической поддержки",a,{width:"auto",okButtonText:"Отправить",cancelButtonText:"Отмена",okButton:true,cancelButton:true,okButtonEventHandler:support.send,contentAlignment:"left"})},send:function(){var c=$("#"+support.textboxID);var b=$("#"+support.spanID);var a=$("#"+support.selectorID);if(!a.val()){b.text("Пожалуйста, укажите тему сообщения");b.css({display:""});return false}if(!c.val()){b.text("Пожалуйста, укажите текст сообщения");b.css({display:""});return false}webSettings.get_webMethod({method:"SET_SupportMessage",parameters:'{ msgSubject: "'+a.find("option:selected").text()+'", msgMessage: "'+c.val()+'" }',async:false})}};var webUser={set_UserValue:function(f,d,e,b,a){if(b==undefined){b=true}if(a==undefined){a=true}if(!e){d=$(d);if(d.is(":checkbox")){e=d.is(":checked")}else{if(d.is("select")){e=d.val()}else{if(d.is("input")){e=d.val()}}}}webSettings.get_webMethod({method:"SET_UserValue",parameters:'{name: "'+f+'", value: "'+e+'", isSave: '+b+"}",async:false});if(d&&a){var c=$(d).attr("id");__doPostBack(c,c)}},get_UserValue:function(b,c){var a=webSettings.get_webMethod({method:"GET_UserValue",parameters:'{valueName: "'+b+'", valueType: "'+c+'"}',async:false});return a.d}};var catalog={set_t:function(b,a){$(b).removeAttr("onmouseover").attr("title",a)},set_td:function(a){catalog.set_t(a,"Перейти к просмотру детальной информации.")},set_ti:function(a){catalog.set_t(a,"Для данного товара есть изображение.")},set_tpr:function(a){catalog.set_t(a,"Для данного товара есть дополнительная информация.")},set_tc:function(a){catalog.set_t(a,"Положить в корзину.")},set_tp:function(a){catalog.set_t(a,"Внимение! В данный момент товар отсутствует на складе. Цена может измениться.")},set_tpm:function(a){catalog.set_t(a,"Внимение! В данный момент товар отсутствует на складе. Нажмите для отправки заявки на уточнение цены.")},set_ts:function(a){catalog.set_t(a,"Внимание! Данная цена является специальной.")},set_tsd:function(a){catalog.set_t(a,"Просмотреть информацию по скидкам / наценкам поставщика.")},set_rating:function(b,a,c){$.ajax({type:"POST",url:"/WebMethods.aspx/SetRatingValue",data:"{ObjectID:'"+a+"',RatingValue:"+c+"}",contentType:"application/json; charset=utf-8",dataType:"json",async:true,cache:false,success:function(d){$(b).rating(a,{maxvalue:5,curvalue:d.d[0],voicescount:d.d[1],userrating:d.d[2]})},error:function(f,e,d){$.fn.checkInternetConnection(f)}});return false}};var themedControl={init:function(a){if(!a){return}if(a.buttonClass){webSettings.buttonClass=a.buttonClass;webSettings.buttonClassHover=a.buttonClassHover;webSettings.buttonLeftClass=a.buttonLeftClass;webSettings.buttonLeftClassHover=a.buttonLeftClassHover;themedButton.apply($(document))}if(a.checkedBoxClass){webSettings.checkedBoxClass=a.checkedBoxClass;webSettings.checkedBoxClassHover=a.checkedBoxClassHover;webSettings.uncheckedBoxClass=a.uncheckedBoxClass;webSettings.uncheckedBoxClassHover=a.uncheckedBoxClassHover;themedCheckbox.apply($(document))}if(a.checkedRadioClass){webSettings.checkedRadioClass=a.checkedRadioClass;webSettings.checkedRadioClassHover=a.checkedRadioClassHover;webSettings.uncheckedRadioClass=a.uncheckedRadioClass;webSettings.uncheckedRadioClassHover=a.uncheckedRadioClassHover;themedRadio.apply($(document))}if(a.inputClass){webSettings.inputClass=a.inputClass;webSettings.inputClassFocus=a.inputClassFocus;webSettings.inputErrorClass=a.inputErrorClass;webSettings.inputErrorLeftClass=a.inputErrorLeftClass;webSettings.inputLeftClass=a.inputLeftClass;webSettings.inputLeftClassFocus=a.inputLeftClassFocus;themedInput.apply($(document))}if(a.comboboxClass){webSettings.comboboxClass=a.comboboxClass;webSettings.comboboxClassFocus=a.comboboxClassFocus;webSettings.comboboxLeftClass=a.comboboxLeftClass;webSettings.comboboxLeftClassFocus=a.comboboxLeftClassFocus;themedCombobox.apply($(document))}},setParams:function(b,c,a,d){if(!b.is(":visible")){return}if(b.parent().is("span")){if(b.is("input[type='checkbox']")||b.is("input[type='radio']")){b.parent().addClass(a).attr(d)}else{return}}else{var f=d.useLeftSpan;b.after(""+(f?""+(b.is("select")?"":"")+"":"")+"");var e=b.next(".zwc_input");e.attr(d);f?e.children().append(b):e.append(b);b.attr("themed",true)}}};var themedInput={fin:function(h){if(this&&$(this).is("span")){h=$(this)}else{h=$(h)}var e=h.attr("classLeft");var b=h.attr("classCenter");var g=h.attr("classLeftFocus");var d=h.attr("classCenterFocus");var c=h.attr("classCenterError");var f=h.attr("classLeftError");var a=h.attr("errorMode");if(f&&g&&e){h.removeClass(a?f:e).addClass(g)}if(c&&d&&b){h.children("span:first").removeClass(a?c:b).addClass(d)}},fout:function(h){if(this&&$(this).is("span")){h=$(this)}else{h=$(h)}var e=h.attr("classLeft");var b=h.attr("classCenter");var g=h.attr("classLeftFocus");var d=h.attr("classCenterFocus");var c=h.attr("classCenterError");var f=h.attr("classLeftError");var a=h.attr("errorMode");a=false;if(f&&g&&e){h.removeClass(g).addClass(a?f:e)}if(c&&d&&b){h.children("span:first").removeClass(d).addClass(a?c:b)}},apply:function(a){if(webSettings.inputClass||webSettings.inputLeftClass||webSettings.inputClassFocus||webSettings.inputLeftClassFocus||webSettings.inputErrorClass||webSettings.inputErrorLeftClass){var b=a.find("input[type='text']").each(function(){var i=$(this);var j=false;if(i.attr("classCenter")||i.attr("classCenterFocus")||i.attr("classCenterError")||i.attr("classLeftError")||i.attr("classLeft")||i.attr("classLeftFocus")){j=true}var c=(j?i.attr("classCenter"):webSettings.inputClass);var e=(j?i.attr("classCenterFocus"):webSettings.inputClassFocus);var d=(j?i.attr("classCenterError"):webSettings.inputErrorClass);var g=(j?i.attr("classLeftError"):webSettings.inputErrorLeftClass);var f=(j?i.attr("classLeft"):webSettings.inputLeftClass);var h=(j?i.attr("classLeftFocus"):webSettings.inputLeftClassFocus);themedControl.setParams(i,f,c,{classCenter:c,classCenterFocus:e,classCenterError:d,classLeftError:g,classLeft:f,classLeftFocus:h,useLeftSpan:true,errorMode:false});i.removeAttr("classCenter").removeAttr("classCenterFocus").removeAttr("classCenterError").removeAttr("classLeftError").removeAttr("classLeft").removeAttr("classLeftFocus");i.addClass("zwc_hand").css("height",i.parent().height()).css("line-height",i.parent().css("line-height")).parents("span.zwc_input").addClass("zwc_hand").focusin(themedInput.fin).focusout(themedInput.fout)})}},hide:function(a){$(a).parents(".zwc_input").replaceWith(a);$(a).css("display","none")}};var themedCombobox={fin:function(e){if(this&&$(this).is("span")){e=$(this)}else{e=$(e)}var c=e.attr("classLeft");var a=e.attr("classCenter");var d=e.attr("classLeftFocus");var b=e.attr("classCenterFocus");if(c&&d){e.removeClass(c).addClass(d)}if(a&&b){e.children("span:first").removeClass(a).addClass(b)}},fout:function(e){if(this&&$(this).is("span")){e=$(this)}else{e=$(e)}var c=e.attr("classLeft");var a=e.attr("classCenter");var d=e.attr("classLeftFocus");var b=e.attr("classCenterFocus");if(c&&d){e.removeClass(d).addClass(c)}if(a&&b){e.children("span:first").removeClass(b).addClass(a)}},change:function(f){if(this&&$(this).is("span")){f=$(this)}else{f=$(f)}var d=f.attr("classLeft");var b=f.attr("classCenter");var e=f.attr("classLeftFocus");var c=f.attr("classCenterFocus");var g=f.children("span:first").children("span:first");var a=f.children("span:first").children("select:first");g.text(a.children("option:selected").text())},apply:function(b){if(webSettings.comboboxClass||webSettings.comboboxLeftClass||webSettings.comboboxClassFocus||webSettings.comboboxLeftClassFocus){var a=b.find("select").each(function(){var g=$(this);var h=false;if(g.attr("classCenter")||g.attr("classCenterFocus")||g.attr("classLeft")||g.attr("classLeftFocus")){h=true}var c=(h?g.attr("classCenter"):webSettings.comboboxClass);var d=(h?g.attr("classCenterFocus"):webSettings.comboboxClassFocus);var e=(h?g.attr("classLeft"):webSettings.comboboxLeftClass);var f=(h?g.attr("classLeftFocus"):webSettings.comboboxLeftClassFocus);themedControl.setParams(g,e,c,{classCenter:c,classCenterFocus:d,classLeft:e,classLeftFocus:f,useLeftSpan:true});g.removeAttr("classCenter").removeAttr("classCenterFocus").removeAttr("classLeft").removeAttr("classLeftFocus");g.addClass("zwc_hand").css("height",g.parent().css("height",g.parent().height()).css("line-height")).parents("span.zwc_input").addClass("zwc_hand").focusin(themedCombobox.fin).focusout(themedCombobox.fout).change(themedCombobox.change);g.parent().children("span:first").css("height",g.parent().height()).width(g.width()).text(g.children("option:selected").text())})}},hide:function(a){$(a).parents(".zwc_input").replaceWith(a);$(a).css("display","none")}};var themedButton={over:function(e){if(this&&$(this).is("span")){e=$(this)}else{e=$(e)}var c=e.attr("classLeft");var a=e.attr("classCenter");var d=e.attr("classLeftHover");var b=e.attr("classCenterHover");if(c&&d){e.removeClass(c).addClass(d)}if(a&&b){e.children("span:first").removeClass(a).addClass(b)}},out:function(e){if(this&&$(this).is("span")){e=$(this)}else{e=$(e)}var c=e.attr("classLeft");var a=e.attr("classCenter");var d=e.attr("classLeftHover");var b=e.attr("classCenterHover");if(c&&d){e.removeClass(d).addClass(c)}if(a&&b){e.children("span:first").removeClass(b).addClass(a)}},apply:function(b){if(webSettings.buttonClass||webSettings.buttonLeftClass||webSettings.buttonClassHover||webSettings.buttonLeftClassHover){var a=b.find("input[type='button'], input[type='submit']").each(function(){var c=$(this);var h=false;if(c.attr("classCenter")||c.attr("classCenterHover")||c.attr("classLeft")||c.attr("classLeftHover")){h=true}var d=(h?c.attr("classCenter"):webSettings.buttonClass);var e=(h?c.attr("classCenterHover"):webSettings.buttonClassHover);var f=(h?c.attr("classLeft"):webSettings.buttonLeftClass);var g=(h?c.attr("classLeftHover"):webSettings.buttonLeftClassHover);themedControl.setParams(c,f,d,{classCenter:d,classCenterHover:e,classLeft:f,classLeftHover:g,useLeftSpan:true});c.removeAttr("classCenter").removeAttr("classCenterHover").removeAttr("classLeft").removeAttr("classLeftHover");c.addClass("zwc_hand").height(c.parent().height()).parents("span.zwc_input").addClass("zwc_hand").hover(themedButton.over,themedButton.out)})}},hide:function(a){$(a).parents(".zwc_input").replaceWith(a);$(a).css("display","none")}};var themedCheckbox={over:function(d){if(this&&$(this).is("span")){d=$(this)}else{d=$(d)}var b=d.attr("classCenterChecked");var c=d.attr("classCenterCheckedHover");var e=d.attr("classCenterUnchecked");var f=d.attr("classCenterUncheckedHover");var a=d.children().attr("checked");if(a){if(b&&c){d.removeClass(b).addClass(c)}}else{if(e&&f){d.removeClass(e).addClass(f)}}},out:function(d){if(this&&$(this).is("span")){d=$(this)}else{d=$(d)}var b=d.attr("classCenterChecked");var c=d.attr("classCenterCheckedHover");var e=d.attr("classCenterUnchecked");var f=d.attr("classCenterUncheckedHover");var a=d.children().attr("checked");if(a){if(b&&c){d.removeClass(c).addClass(b)}}else{if(e&&f){d.removeClass(f).addClass(e)}}},check:function(d){if(this&&$(this).is("span")){d=$(this)}else{d=$(d)}var b=d.attr("classCenterChecked");var c=d.attr("classCenterCheckedHover");var e=d.attr("classCenterUnchecked");var f=d.attr("classCenterUncheckedHover");var a=d.children().attr("checked");if(c&&f){if(a){d.removeClass(c).addClass(f);d.children().attr("checked",false)}else{d.removeClass(e).removeClass(f).addClass(c);d.children().attr("checked",true)}}},apply:function(b){if(webSettings.checkedBoxClass||webSettings.checkedBoxClassHover||webSettings.uncheckedBoxClass||webSettings.uncheckedBoxClassHover){var a=b.find("input[type='checkbox']").each(function(){var c=$(this);var h=false;var i=c.parent();if(i.attr("classCenterChecked")||i.attr("classCenterCheckedHover")||i.attr("classCenterUnchecked")||i.attr("classCenterUncheckedHover")){h=true}var d=(h?i.attr("classCenterChecked"):webSettings.checkedBoxClass);var e=(h?i.attr("classCenterCheckedHover"):webSettings.checkedBoxClassHover);var f=(h?i.attr("classCenterUnchecked"):webSettings.uncheckedBoxClass);var g=(h?i.attr("classCenterUncheckedHover"):webSettings.uncheckedBoxClassHover);themedControl.setParams(c,null,(c.attr("checked")?d:f),{classCenterChecked:d,classCenterCheckedHover:e,classCenterUnchecked:f,classCenterUncheckedHover:g,useLeftSpan:false});c.addClass("zwc_hand").parent().addClass("zwc_input").addClass("zwc_hand").hover(themedCheckbox.over,themedCheckbox.out).click(themedCheckbox.check)})}},hide:function(a){$(a).parents(".zwc_input").replaceWith(a);$(a).css("display","none")}};var themedRadio={over:function(d){if(this&&$(this).is("span")){d=$(this)}else{d=$(d)}var b=d.attr("classCenterChecked");var c=d.attr("classCenterCheckedHover");var e=d.attr("classCenterUnchecked");var f=d.attr("classCenterUncheckedHover");var a=d.children().attr("checked");if(a){if(b&&c){d.removeClass(b).addClass(c)}}else{if(e&&f){d.removeClass(e).addClass(f)}}},out:function(d){if(this&&$(this).is("span")){d=$(this)}else{d=$(d)}var b=d.attr("classCenterChecked");var c=d.attr("classCenterCheckedHover");var e=d.attr("classCenterUnchecked");var f=d.attr("classCenterUncheckedHover");var a=d.children().attr("checked");if(a){if(b&&c){d.removeClass(c).addClass(b)}}else{if(e&&f){d.removeClass(f).addClass(e)}}},check:function(e){if(this&&$(this).is("span")){e=$(this)}else{e=$(e)}var b=e.attr("classCenterChecked");var c=e.attr("classCenterCheckedHover");var f=e.attr("classCenterUnchecked");var g=e.attr("classCenterUncheckedHover");var d=e.children();var a=d.attr("checked");if(c&&g&&b&&f){if(a){if(d.is(":checkbox")){e.removeClass(c).addClass(g);d.attr("checked",false)}}else{if(d.is(":radio")){$("input[type='radio'][name='"+d.attr("name")+"']").parent().removeClass(b).removeClass(c).addClass(f);d.attr("checked",true)}e.removeClass(f).removeClass(g).addClass(c)}}},apply:function(a){if(webSettings.checkedRadioClass||webSettings.checkedRadioClassHover||webSettings.uncheckedRadioClass||webSettings.uncheckedRadioClassHover){var b=a.find("input[type='radio']").each(function(){var h=$(this);var g=false;if(h.attr("classCenterChecked")||h.attr("classCenterCheckedHover")||h.attr("classCenterUnchecked")||h.attr("classCenterUncheckedHover")){g=true}var c=(g?h.attr("classCenterChecked"):webSettings.checkedRadioClass);var d=(g?h.attr("classCenterCheckedHover"):webSettings.checkedRadioClassHover);var e=(g?h.attr("classCenterUnchecked"):webSettings.uncheckedRadioClass);var f=(g?h.attr("classCenterUncheckedHover"):webSettings.uncheckedRadioClassHover);themedControl.setParams(h,null,(h.attr("checked")?c:e),{classCenterChecked:c,classCenterCheckedHover:d,classCenterUnchecked:e,classCenterUncheckedHover:f,useLeftSpan:false});h.addClass("zwc_hand").parent().addClass("zwc_input").addClass("zwc_hand").hover(themedRadio.over,themedRadio.out).click(themedRadio.check)})}},hide:function(a){$(a).parents(".zwc_input").replaceWith(a);$(a).css("display","none")}};var collapsablePanel={toggle:function(f){var e=$(f).parents("#zw_collapsable:first");var d=e.find("#zw_collapsable_content");var c=e.attr("zw_cec");var b=e.attr("zw_ccc");if(c||b){var a=e.find("#zw_collapsable_button");if(d.is(":visible")){a.removeClass(b).addClass(c)}else{a.removeClass(c).addClass(b)}}d.slideToggle()}};var validators={validate:function(source,args){var validator=$(source);var validateField=$("#"+source.controltovalidate);var settings=validator.attr("settings").split(" ");var messages=validator.attr("errormessage");var options=validator.attr("options");if(!messages){messages={}}else{eval("messages = "+messages+";")}if(!options){options={}}else{eval("options = "+options+";")}messages=$.extend(true,validators.messages,messages);options=$.extend(true,validators.options,options);var valid=true;$.each(settings,function(){if(!valid){return}eval("valid &= validators."+this+"(source, args, options[this]);");if(valid){validateField.removeClass("error");validateField.attr("title","")}else{validateField.addClass("error");validateField.attr("title",messages[this]);return}});args.IsValid=valid},required:function required(c,a,b){if(a.Value.trim()){return true}else{return false}},email:function validate_email(c,a,b){return/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a.Value)},range:function(c,a,b){return(a.Value>=b.min&&a.Value<=b.max)},rangelength:function(d,a,c){var b=$.trim(a.Value).length;return(b>=c.min&&b<=c.max)},login:function(d,a,c){if($("#"+$(d).attr("controltovalidate")).attr("readonly")){return true}var b=webSettings.get_webMethod({method:"GET_UserLogin",parameters:'{login: "'+a.Value+'"}',async:false});if(b){return b.d}return true},password:function(e,a,d){var f=$("#"+$(e).attr("controltovalidate"));var c=f.attr("id").split("_");c[c.length-1]=d;var b="";$.each(c,function(){b+=b?"_"+this:this});return a.Value==$("#"+b).val()},minlength:function(c,a,b){return $.trim(a.Value).length>=b},nobots:function(c,a,b){if(a.Value==b){return true}noBots.init($(c).parents("div:first"));return false},messages:{required:"Поле обязателько к заполнению",email:"Неверный формат почтового адреса",range:"",rangelength:"",login:"Логин занят",minlength:"",password:"Пароли не совпадают"},options:{range:{min:2,max:10000000},rangelength:{min:2,max:10000000},minlength:2}};var noBots={first:0,second:0,operations:["+","*","-","/"],opertaion:0,check:function(a,b){if(b==result){return true}noBots.init(a);return false},init:function(captcha){noBots.first=Math.abs(Math.ceil(Math.random()*10));noBots.second=Math.abs(Math.ceil(Math.random()*10));if(noBots.first
    Пожалуйста, введите результат следующей операции: "+noBots.first.toString()+" "+noBots.operations[noBots.opertaion]+" "+noBots.second.toString()+" = ? (число).");captcha.find("[settings]").attr("options","{nobots: "+result.toString()+"}")},initSmall:function(captchaSpan,captchaValidator){noBots.first=Math.abs(Math.ceil(Math.random()*10));noBots.second=Math.abs(Math.ceil(Math.random()*10));if(noBots.first
    Пожалуйста, введите результат следующей операции: "+noBots.first.toString()+" "+noBots.operations[noBots.opertaion]+" "+noBots.second.toString()+" = ? (число).");captchaValidator.attr("options","{nobots: "+result.toString()+"}")}};jQuery.fn.center=function(a){return this.each(function(){var b=jQuery(this);b.css({position:a?"absolute":"fixed",left:"50%",top:"50%"}).css({marginLeft:"-"+(b.width()/2)+"px",marginTop:"-"+(b.height()/2)+"px"});if(a){b.css({marginTop:parseInt(b.css("marginTop"),10)+jQuery(window).scrollTop(),marginLeft:parseInt(b.css("marginLeft"),10)+jQuery(window).scrollLeft()})}})};Array.prototype.removeEmpty=function(){var b=new Array();for(var a=0;a
    ').appendTo(document.body);var i='';i+="";i+='';i+='";i+='";i+='";i+="";i+="";i+="
    ';i+=" ";i+=" ';i+="
    ";i+='Header
    ';i+="
    ';i+='Закрыть';i+="
    ";i+='';i+="";i+="";i+='";i+='";i+='";i+="";i+="";i+='";i+='";i+='";i+="";i+="";i+="
    ';i+=" ';i+='
    ';i+='';i+="";i+="";i+='";i+="";i+="";i+="
    ";i+="
    ";i+="
    ';i+="
    ';i+=" ";i+=" ';i+=" ";i+=" ';i+=" ";i+="
    ";j.append(i);j.find("#lblHeader").text(g);j.find(".pop_content").prepend(e).css({color:a.color,"text-align":a.contentAlignment});j.find("#btnOk").css("display",(a.okButton==true)?"":"none").val(a.okButtonText);j.find("#btnCancel").css("display",(a.cancelButton==true)?"":"none").val(a.cancelButtonText);j.css("width",a.width);j.find("#btnOk").bind("click",{dialogID:k,okButtonEventHandler:a.okButtonEventHandler},d);j.find("#btnCancel").bind("click",{dialogID:k,cancelButtonEventHandler:a.cancelButtonEventHandler},b);j.find("a.close").bind("click",{dialogID:k,closeButtonEventHandler:a.closeButtonEventHandler},c);themedButton.apply(j);j.center();h=j});return h};$.fn.templatedMessageBox=function(f,e){f=f||"";message=message||"";var a={color:"#666666",width:250,okButton:true,cancelButton:false,okButtonText:"Закрыть",cancelButtonText:"Отмена",okButtonEventHandler:null,cancelButtonEventHandler:null,closeButtonEventHandler:null,contentAlignment:"center"};var d=function(i){if(i.data.okButtonEventHandler){var h=i.data.okButtonEventHandler()}if(h==false){return}$("#"+i.data.dialogID).remove()};var b=function(h){$("#"+h.data.dialogID).remove();if(h.data.cancelButtonEventHandler){h.data.cancelButtonEventHandler()}};var c=function(h){$("#"+h.data.dialogID).remove();if(h.data.closeButtonEventHandler){h.data.closeButtonEventHandler()}};$.extend(a,settings);var g;$(document).ready(function(){var j=("mpa-"+(new Date()).getTime());var i=$('
    ').appendTo(document.body);var h='';h+="";h+='';h+='";h+='";h+='";h+="";h+="";h+="
    ';h+=" ";h+=" ';h+="
    ";h+='Header
    ';h+="
    ';h+='Закрыть';h+="
    ";h+='';h+="";h+="";h+='";h+='";h+='";h+="";h+="";h+='";h+='";h+='";h+="";h+="";h+="
    ';h+=" ';h+='
    ';h+='';h+="";h+="";h+='";h+="";h+="";h+="
    ";h+="
    ";h+="
    ';h+="
    ';h+=" ";h+=" ';h+=" ";h+=" ';h+=" ";h+="
    ";i.append(h);i.find("#lblHeader").text(f);i.find(".pop_content").prepend(message).css({color:a.color,"text-align":a.contentAlignment});i.find("#btnOk").css("display",(a.okButton==true)?"":"none").val(a.okButtonText);i.find("#btnCancel").css("display",(a.cancelButton==true)?"":"none").val(a.cancelButtonText);i.css("width",a.width);i.find("#btnOk").bind("click",{dialogID:j,okButtonEventHandler:a.okButtonEventHandler},d);i.find("#btnCancel").bind("click",{dialogID:j,cancelButtonEventHandler:a.cancelButtonEventHandler},b);i.find("a.close").bind("click",{dialogID:j,closeButtonEventHandler:a.closeButtonEventHandler},c);themedButton.apply(i);i.center();g=i});return g};$.fn.changecontractor=function(b){var a=$(b).find("option[selected]").val();$.ajax({type:"POST",url:"/WebMethods.aspx/ChangeContractor",data:"{sContractorID:'"+a+"'}",contentType:"application/json; charset=utf-8",dataType:"json",async:false,cache:false,success:function(c){__doPostBack(b.id,a)},error:function(e,d,c){$.fn.checkInternetConnection(e)}})};$.fn.callwebmethod=function(c,g,f,e,a,b){if(b==undefined){b=false}var d=$(this);var h=null;$.ajax({type:"POST",url:"/WebMethods.aspx/"+c,data:g,contentType:"application/json; charset=utf-8",dataType:"json",async:b,cache:false,success:function(i){if(f){f.call(d,i)}h=i},error:function(k,j,i){if(e){e.call(d,k,j,i)}}});return h};$.fn.setClass=function(a){return this.removeClass().addClass(a)};$.fn.checkInternetConnection=function(a){if(a.status==500||a.status==12029){$.fn.messageBox("Ошибка","Ошибка соединения с базой данных.
    Проверьте ваше подключение к сети Интернет.",{color:"red"})}};$.fn.formatMoney=function(g,a,b,k){g=g.toString().replace(/[^0-9,\.-]/g,"").replace(/[,\.]/,".");a=isNaN(a=Math.abs(a))?2:a;b=b==undefined?",":b;k=k==undefined?" ":k;var h=g<0?"-":"";var e=parseInt(g=Math.abs(+g||0).toFixed(a))+"";var f=e.length;f=f>3?f%3:0;return h+(f?e.substr(0,f)+k:"")+e.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+k)+(a?b+Math.abs(g-e).toFixed(a).slice(2):"")};$.fn.encodeXML=function(a){return $("
    ").text(a).html()};$.fn.decodeXML=function(a){return $("
    ").html(a).text()};$.fn.eventTarget=function(a){var b;if(!a){a=window.event}if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType==3){b=b.parentNode}return $(b)};$.fn.rating=function(g,h){var k={objectID:g,maxvalue:5,curvalue:0,voicescount:0,userrating:0};if(h){$.extend(k,h)}var b=$(this);$.extend(b,{averageRating:k.curvalue,objectID:k.objectID});b.empty();for(var f=1;f<=k.maxvalue;f++){var c='
    '+f+"
    ";b.append(c)}var a=parseInt(k.voicescount.toString().charAt(k.voicescount.toString().length-1));var e;if(a==1){e="голос"}else{if(a>1&&a<5){e="голоса"}else{e="голосов"}}var j="("+k.voicescount+" "+e+")";b.append("
    "+j);var l=$(b).children(".star");l.mouseover(function(){d.drain();d.fill(this)}).mouseout(function(){d.drain();d.reset()}).focus(function(){d.drain();d.fill(this)}).blur(function(){d.drain();d.reset()});l.click(function(){k.curvalue=l.index(this)+1;return false});var d={fill:function(i){var m=l.index(i)+1;l.children("a").css("width","100%").end();$(b).children(".star:lt("+m+")").addClass("hover").end()},drain:function(){l.filter(".on").removeClass("on").end().filter(".hover").removeClass("hover").end().filter(".onusr").removeClass("onusr").end().filter(".onusr2").removeClass("onusr2").end()},reset:function(){$(b).children(".star:lt("+k.curvalue+")").addClass("on").end();if(k.userrating>0){if(k.userrating<=k.curvalue){$(b).children(".star:eq("+(k.userrating-1).toString()+")").addClass("onusr").end()}else{$(b).children(".star:eq("+(k.userrating-1).toString()+")").addClass("onusr2").end()}}}};d.reset();return(this)};$.fn.menu=function(p){var o;var g;var i=$(this).attr("horizontal")=="true";var n=$(this);var m=function(){clearTimeout(o);if(g){k(g)}var u=$(this);var a=u.attr("dynamic");if(a){if(p.horizontalDynamicArrowHoverClass){u.find(">#menu-a").removeClass(p.horizontalDynamicArrowClass).addClass(p.horizontalDynamicArrowHoverClass)}}else{if(p.horizontalArrowHoverClass){u.find(">#menu-a").removeClass(p.horizontalArrowClass).addClass(p.horizontalArrowHoverClass)}}u.find(">ul").css({visibility:"visible",display:""})};var l=function(){g=$(this);o=setTimeout(function(){if(g){k(g)}},500)};var k=function(u){clearTimeout(o);var a=u.attr("dynamic");if(a){if(p.horizontalDynamicArrowHoverClass){u.find(">#menu-a").removeClass(p.horizontalDynamicArrowHoverClass).addClass(p.horizontalDynamicArrowClass)}}else{if(p.horizontalArrowHoverClass){u.find(">#menu-a").removeClass(p.horizontalArrowHoverClass).addClass(p.horizontalArrowClass)}}u.find("ul").css({visibility:"hidden",display:"block"});g=null};var f=function(){var u=$(this);var w=u.parent();var v=w.attr("dynamic");if(v){w.removeClass(p.horizontalDynamicHrefClass).addClass(p.horizontalDynamicHrefHoverClass);if(p.horizontalDynamicHrefLeftHoverClass){u.siblings("#menu-l").removeClass(p.horizontalDynamicHrefLeftClass).addClass(p.horizontalDynamicHrefLeftHoverClass)}}else{w.removeClass(p.horizontalHrefClass).addClass(p.horizontalHrefHoverClass);if(p.horizontalHrefLeftHoverClass){u.siblings("#menu-l").removeClass(p.horizontalHrefLeftClass).addClass(p.horizontalHrefLeftHoverClass)}}};var e=function(){var u=$(this);var w=u.parent();var v=w.attr("dynamic");if(v){w.removeClass(p.horizontalDynamicHrefHoverClass).addClass(p.horizontalDynamicHrefClass);if(p.horizontalDynamicHrefLeftHoverClass){u.siblings("#menu-l").removeClass(p.horizontalDynamicHrefLeftHoverClass).addClass(p.horizontalDynamicHrefLeftClass)}}else{w.removeClass(p.horizontalHrefHoverClass).addClass(p.horizontalHrefClass);if(p.horizontalHrefLeftHoverClass){u.siblings("#menu-l").removeClass(p.horizontalHrefLeftHoverClass).addClass(p.horizontalHrefLeftClass)}}};var r=n.find("li[static]");var h=n.find("li[dinamic]");var b;var c;var s;var t;var j;var d;r.find(">ul").each(function(){c=$(this).siblings("#menu-s").outerWidth();$(this).css({left:c})});n.find("li").each(function(){j=$(this);c=0;b=0;if(i&&j.attr("static")){b=j.outerWidth()}else{if(j.parent().parent().attr("static")&&i){b=j.parent().parent().outerWidth()}j.parent().find(">li").each(function(){c=$(this).outerWidth(true);if(c>b){b=c}})}j.css({width:b-(j.outerWidth()-j.width())});c=0;j.children(":not(ul, a)").each(function(){c+=$(this).outerWidth(true)});d=j.find(">a");d.css({width:b-c-(d.outerWidth(true)-d.width())})});n.find("a:has(br)").each(function(){d=$(this);var u=d.css("line-height","").css("line-height");var a=parseFloat(u)/(d.has("br").length+1);$(this).css("line-height",a+u.replace(/[^a-zA-Z]/g,""))});r.find(">ul").addClass(i?"zwc_menu-ul2":"zwc_menu-uln").find("ul").addClass("zwc_menu-uln");n.find("li:has(ul)").hover(m,l);if(p.horizontalHrefHoverClass){$(this).find("a").hover(f,e)}};$.fn.search=function(c){var e=$(this);e=$(e);var f=e.parents("table:first");var d=f.find("select");f.css({width:c.width});var a=function(){};var b=function(){};e.bind("focus",b).bind("blur",a)};var searchmini={startHide:function(a){},endHide:function(b){var d=b.data.susanna;var c=d.find("#qdropdown");var a=$(document.elementFromPoint($.coorX,$.coorY));if(a.attr("id")!="qdropdown"){a=a.parents("#qdropdown")}if(a[0]==c[0]){return}},onqinputFocus:function(a){var d=a.data.susanna;var c=d.find("#qinput");c.attr("focused","focused");var b=d.find("[ctrltype='searchsmall']");if(b.attr("selectedValue")==""){searchmini.showQDrop(d)}if(b.attr("userText")==""){c.val("")}},onqinputBlurHandler:function(a){searchmini.onqinputBlur(a.data.susanna)},onqinputKeyDownHandler:function(a){var d=a.data.susanna;var c=d.find("#qinput");var b=d.find("[ctrltype='searchsmall']");b.attr("userText",c.val())},onqinputBlur:function(f){var b=f.find("[ctrltype='searchsmall']");var c=f.find("#qdrop");var d=f.find("#qdropdown");var e=f.find("#qinput");e.removeAttr("focused");var a=$(document.elementFromPoint($.coorX,$.coorY));if(a.attr("id")!="qdropdown"){a=a.parents("#qdropdown")}if(a[0]==d[0]){return}searchmini.hideQDrop(f);if(b.attr("userText")!=""){e.val(b.attr("userText"));return}if(b.attr("watermarkText")!=""){e.val(b.attr("watermarkText"));return}e.val("поиск")},init:function(k,n){var e=k.find("[ctrltype='searchsmall']");var f=k.find("#qdrop");var g=k.find("#qdropdown");var h=k.find("#qinput");var j=k.find("#qquery");var i=n-24;j.css({width:n+"px"});h.css({width:i+"px"});e.attr("selectedValue","");e.attr("watermarkText","поиск");e.attr("userText","");e.attr("isVisible",false);var c=function(){this.className="qdrop_over"};var d=function(){this.className="qdrop_off"};var b=function(){searchmini.showQDrop(k)};var a=function(){searchmini.onqinputBlur(k)};g.bind("mouseleave",{susanna:k},searchmini.startHide);f.bind("mousemove",c).bind("mouseout",d).bind("click",b).bind("blur",a);h.bind("blur",{susanna:k},searchmini.onqinputBlurHandler).bind("focus",{susanna:k},searchmini.onqinputFocus).bind("keyup",{susanna:k},searchmini.onqinputKeyDownHandler);searchmini.genQDrop(k);var m=webUser.get_UserValue("SearchTypeOfSearch","string");if(m){var l=g.children("[typeid='"+m+"']");l.setClass("qdiv_on");e.attr("selectedValue",m);e.attr("watermarkText","по "+l.text())}h.val(e.attr("watermarkText"))},showQDrop:function(h){var d=h.find("[ctrltype='searchsmall']");var e=h.find("#qdrop");var f=h.find("#qdropdown");var g=h.find("#qinput");d.attr("isVisible",true);e.setClass("qdrop_on");f.show();var b=d.attr("selectedValue");f.children().setClass("qdiv_off").filter("[typeid='"+b+"']").addClass("qdiv_on");var c=e.offset();var a=e.innerHeight();var i=f.innerWidth();var j=e.innerWidth();f.css({left:(c.left-(i-j)-1)+"px",top:(c.top+a)+1+"px"})},hideQDrop:function(c){var a=c.find("[ctrltype='searchsmall']");var b=c.find("#qdropdown");a.attr("isVisible",false);b.hide()},genQDrop:function(i){var e=i.find("[ctrltype='searchsmall']");var f=i.find("#qdrop");var g=i.find("#qdropdown");var h=i.find("#qinput");var j="
    Произошла ошибка
    ";var a=$.fn.callwebmethod("GetSearchTypes","{}");j=(a.d!="")?a.d:"
    Типы поиска отсутствуют
    ";g.empty().append(j);var c=function(){if(!$(this).hasClass("qdiv_on")){$(this).setClass("qdiv_over")}};var d=function(){if(!$(this).hasClass("qdiv_on")){$(this).setClass("qdiv_off")}};var b=function(){if(h.val()==e.attr("watermarkText")||h.val()==""){h.val("");e.attr("userText","");h.focus()}e.attr("selectedValue",$(this).attr("typeid"));e.attr("watermarkText","по "+$(this).text());f.setClass("qdrop_off");searchmini.hideQDrop(i)};$("#qdropdown").children().addClass("qdiv_off").bind("mouseover",c).bind("mouseout",d).bind("click",b)}};var search={init:function(b){b.attr("focused",false);var c=b.find("input:text");var a=b.find("select");a.bind("change",function(d){c.focus()}).bind("dblclick mousedown blur",function(d){search.onevent(b,d.type,"ddl")}).find("option").bind("click",function(d){c.focus()});c.bind("focus blur",function(d){search.onevent(b,d.type,"tb")});search.set_watermark("blur","tb",c,a)},onevent:function(d,b,e){var f=d.find("input:text");var a=d.find("select");var c=d.attr("focused");if(e=="tb"&&b=="blur"&&(c=="false"||c==false)){return}var h="18px";if((b=="mousedown"||b=="dblclick")&&e=="ddl"){h="auto"}a.css({width:h});d.attr("focused",(e=="tb"&&(b=="focus"||b=="change")));search.set_watermark(b,e,f,a);var g=d.attr("sWidth")-d.find("#cellB").outerWidth()-d.find("#cellS").outerWidth();f.css({width:g})},set_watermark:function(b,c,d,a){if(((b=="focus"||b=="change")&&c=="tb")||((b=="mousedown"||b=="dblclick")&&c=="ddl")){if(a.find("option[search='"+d.val().trim()+"']").length){d.val("");d.removeClass("zwc_search_watermark")}}if(b=="blur"&&c=="tb"||b=="blur"&&c=="ddl"){if(!d.val()){d.val(a.find("option:selected").text().trim());d.addClass("zwc_search_watermark")}}}};$.fn.Watermark=function(b,a){if(!a){a="#aaa"}return this.each(function(){var e=$(this);var d=e.css("color");function c(){if(e.val()==b){e.val("")}e.css("color",d)}function f(){if(e.val().length==0||e.val()==b){e.val(b);e.css("color",a)}else{e.css("color",d)}}e.focus(c);e.blur(f);f()})};jQuery.fn.controlRoot=function(){return this.closest("["+controls.uniqueKeyAttribute()+"]")};jQuery.fn.comments=function(a,d){a=(a||false);var c=$([]);var b=false;this.each(function(e,g){var f=g.firstChild;while(f){if(f.nodeType===8){if(d){if(f.nodeValue.startsWith(d)){c=c.add($(f));b=true}}else{c=c.add($(f))}}else{if(a&&(f.nodeType===1)){c=c.add($(f).comments(true,d))}}if(b){return c}f=f.nextSibling}});return(c)};jQuery.fn.siblingComments=function(b){var a=$([]);var c=this[0].nextSibling;while(c){if(c.nodeType===8){if(b){if(c.nodeValue.startsWith(b)){a=a.add($(c));break}}else{a=a.add($(c))}}c=c.nextSibling}return(a)};if(typeof String.prototype.startsWith!="function"){String.prototype.startsWith=function(a){return this.indexOf(a)==0}}var assist={set_webFormAction:function(){$("form").attr("action","https://payments.paysecure.ru/pay/order.cfm")}};var assist2=(function(){$("[name='"+Constants.zw_Payment2.payment_submit+"']").live("click",function(a){ZetaControlRefresher.Refresh(this,{method:MvcActions.zw_Payment2.Actions.HandlePaymentRequest});return false})})();var currency={controlsIDs:{currencySelect:"#zw_currencySelect"},attributesNames:{templateid:"cs_templateid",cs_currencyid:"cs_currencyid"},selectedValues:{cs_currencyid:"",cs_currencyname:""},settings:{templateid:""},set_currencySelect:function(b){b=$(b);var a=currency.get_container(b);var c=currency.get_newcontainer(currency.controlsIDs.currencySelect,a);currency.settings.templateid=a.attr(currency.attributesNames.templateid);currency.selectedValues.cs_currencyid=b.attr(currency.attributesNames.cs_currencyid);currency.selectedValues.cs_currencyname=b.html();currency.set_result(c,"SET_CurrencySelect");window.location=window.location},get_container:function(b){var a=b.parents(currency.controlsIDs.currencySelect);return a},get_newcontainer:function(b,a){var c=$(b);if(c.length){return c}return a},set_result:function(b,a){var c={func:a};$.extend(c,currency.selectedValues);$.extend(c,currency.settings);$.post(webSettings.get_ASHXUrl("Catalog.ashx"),c,function(d,e,f){b.attr(currency.selectedValues).html(d)},"html")}};function GetImageUrl(c,e,a){var f,b;if(e!=undefined){f="&imgw="+e}else{f=""}if(a!=undefined){b="&imgh="+a}else{b=""}var d="";if((f!="")&&(b!="")){d="&imgvw=1"}return"/showimage.ashx?img="+c+f+b+d}jQuery.fn.extend({makeCollapsed:function(){var a=this.attr(webSettings.attributesNames.threeStateButtonCollapseID);return this.attr("src",GetImageUrl(a))},makeExpanded:function(){var a=this.attr(webSettings.attributesNames.threeStateButtonExpandeID);return this.attr("src",GetImageUrl(a))},makeUnexpanded:function(){var a=this.attr(webSettings.attributesNames.threeStateButtonUnexpandedID);return this.attr("src",GetImageUrl(a))}});var rating={url:{copyUrl:"/mvcget/Rating/AjaxRating?r_templateid=(0)&r_objectid=(1)&r_emptystartemplate=(2)&r_filledstartemplate=(3)&r_emptymystartemplate=(4)&r_filledmystartemplate=(5)&r_hoverstartemplate=(6)&ratingvalue=(7)"},controlsIDs:{productRating:"#zw_productRating"},attributesNames:{templateid:"r_templateid",objectid:"r_objectid",r_star:"r_star",r_state:"r_state",r_emptystartemplate:"r_emptystartemplate",r_filledstartemplate:"r_filledstartemplate",r_emptymystartemplate:"r_emptymystartemplate",r_filledmystartemplate:"r_filledmystartemplate",r_hoverstartemplate:"r_hoverstartemplate"},starHover:function(b){b=$(b);var a=rating.get_container(b);$("img["+rating.attributesNames.r_star+"]").each(function(){var c=$("#"+this.id);if(c.attr(rating.attributesNames.r_star)<=b.attr(rating.attributesNames.r_star)){var d=rating.get_idByState(a,"hover");var f=c.attr("src");var e=f.split("?").pop().split("&").shift().split("=").pop();c.attr("src",f.replace(e,d))}})},starMouseOut:function(b){b=$(b);var a=rating.get_container(b);$("img["+rating.attributesNames.r_star+"]").each(function(){var c=$("#"+this.id);var d=rating.get_idByState(a,c.attr(rating.attributesNames.r_state));var f=c.attr("src");var e=f.split("?").pop().split("&").shift().split("=").pop();c.attr("src",f.replace(e,d))})},set_rating:function(b){b=$(b);var a=rating.get_container(b);var h=a.attr(rating.attributesNames.objectid);var j=a.attr(rating.attributesNames.templateid);var d=a.attr(rating.attributesNames.r_emptystartemplate);var f=a.attr(rating.attributesNames.r_filledstartemplate);var c=a.attr(rating.attributesNames.r_emptymystartemplate);var e=a.attr(rating.attributesNames.r_filledmystartemplate);var g=a.attr(rating.attributesNames.r_hoverstartemplate);var i=b.attr(rating.attributesNames.r_star);var k=rating.url.copyUrl.replace("(0)",j).replace("(1)",h).replace("(2)",d).replace("(3)",f).replace("(4)",c).replace("(5)",e).replace("(6)",g).replace("(7)",i);a.load(k)},get_idByState:function(a,b){a=$(a);switch(b){case"empty":return a.attr(rating.attributesNames.r_emptystartemplate);case"filled":return a.attr(rating.attributesNames.r_filledstartemplate);case"emptymy":return a.attr(rating.attributesNames.r_emptymystartemplate);case"filledmy":return a.attr(rating.attributesNames.r_filledmystartemplate);case"hover":return a.attr(rating.attributesNames.r_hoverstartemplate)}return null},get_container:function(b){var a=b.parents(rating.controlsIDs.productRating);return a}};$.coorX=0;$.coorY=0;(function(a){a.fn.goTo=function(){a("html, body").animate({scrollTop:a(this).offset().top+"px"},"fast");return this}})(jQuery);function parseFloat2(a){return parseFloat(a.replace(",","."))}function Base64Decode(h){var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var l="";var a,b,c;var d,e,f,g;var j=0;do{d=k.indexOf(h.charAt(j++));e=k.indexOf(h.charAt(j++));f=k.indexOf(h.charAt(j++));g=k.indexOf(h.charAt(j++));a=(d<<2)|(e>>4);b=((e&15)<<4)|(f>>2);c=((f&3)<<6)|g;l=l+String.fromCharCode(a);if(f!=64){l=l+String.fromCharCode(b)}if(g!=64){l=l+String.fromCharCode(c)}}while(j").attr("name",d.submitButton.name).val(d.submitButton.value).appendTo(d.currentForm)}d.settings.submitHandler.call(d,d.currentForm);if(d.submitButton){g.remove()}return false}return true}if(d.cancelSubmit){d.cancelSubmit=false;return f()}if(d.form()){if(d.pendingRequest){d.formSubmitted=true;return false}return f()}else{d.focusInvalid();return false}})}return d},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var b=true;var c=a(this[0].form).validate();this.each(function(){b&=c.element(this)});return b}},removeAttrs:function(c){var d={},b=this;a.each(c.split(/\s/),function(e,f){d[f]=b.attr(f);b.removeAttr(f)});return d},rules:function(c,b){var e=this[0];if(c){var i=a.data(a.validator.getForm(e),"validator").settings;var j=i.rules;var f=a.validator.staticRules(e);switch(c){case"add":a.extend(f,a.validator.normalizeRule(b));j[e.name]=f;if(b.messages){i.messages[e.name]=a.extend(i.messages[e.name],b.messages)}break;case"remove":if(!b){delete j[e.name];return f}var g={};a.each(b.split(/\s/),function(k,l){g[l]=f[l];delete f[l]});return g}}var d=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(e),a.validator.classRules(e),a.validator.attributeRules(e),a.validator.staticRules(e)),e);if(d.required){var h=d.required;delete d.required;d=a.extend({required:h},d)}return d}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(""+b.value)},filled:function(b){return !!a.trim(""+b.value)},unchecked:function(b){return !b.checked}});a.validator=function(c,b){this.settings=a.extend(true,{},a.validator.defaults,c);this.currentForm=b;this.init()};a.validator.format=function(c,b){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(c);return a.validator.format.apply(this,d)}}if(arguments.length>2&&b.constructor!=Array){b=a.makeArray(arguments).slice(1)}if(b.constructor!=Array){b=[b]}a.each(b,function(d,e){c=c.replace(new RegExp("\\{"+d+"\\}","g"),e)});return c};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(b,c){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(b)).hide()}},onfocusout:function(b,c){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b,c){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b,c){if(b.name in this.submitted){this.element(b)}else{if(b.parentNode.name in this.submitted){this.element(b.parentNode)}}},highlight:function(b,c,d){if(b.type==="radio"){this.findByName(b.name).addClass(c).removeClass(d)}else{a(b).addClass(c).removeClass(d)}},unhighlight:function(b,c,d){if(b.type==="radio"){this.findByName(b.name).removeClass(c).addClass(d)}else{a(b).removeClass(c).addClass(d)}}},getForm:function(b){return a(b).parents("[zw_validate]")[0]},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var c=(this.groups={});a.each(this.settings.groups,function(e,f){a.each(f.split(/\s/),function(g,h){c[h]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function b(e){var g=a.data(a.validator.getForm(this[0]),"validator"),f="on"+e.type.replace(/^validate/,"");g.settings[f]&&g.settings[f].call(g,this[0],e)}a(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",b).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",b);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var c=0,b=(this.currentElements=this.elements());b[c];c++){this.check(b[c])}return this.valid()},element:function(b){b=this.validationTargetFor(this.clean(b));this.lastElement=b;this.prepareElement(b);this.currentElements=a(b);var c=this.check(b);if(c){delete this.invalid[b.name]}else{this.invalid[b.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return c},showErrors:function(b){if(b){a.extend(this.errorMap,b);this.errorList=[];for(var c in b){this.errorList.push({message:b[c],element:this.findByName(c)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var b=0;for(var c in d){b++}return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(d){d=this.validationTargetFor(this.clean(d));var i=a(d).rules();var b=false;for(var f in i){var h={method:f,parameters:i[f]};try{var g=a.validator.methods[f].call(this,d.value.replace(/\r/g,""),d,h.parameters);if(g=="dependency-mismatch"){b=true;continue}b=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(d));return}if(!g){this.formatAndAdd(d,h);return false}}catch(c){this.settings.debug&&window.console&&console.log("exception occured when checking element "+d.id+", check the '"+h.method+"' method",c);throw c}}if(b){return}if(this.objectLength(i)){this.successList.push(d)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(d,c){var b=this.settings.messages[d];return b&&(b.constructor==String?b:b[c])},findDefined:function(){for(var b=0;bWarning: No message defined for "+b.name+"")},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method),e=/\$?\{(\d+)\}/g;if(typeof c=="function"){c=c.call(this,d.parameters,b)}else{if(e.test(c)){c=jQuery.format(c.replace(e,"{$1}"),d.parameters)}}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var d=0;this.errorList[d];d++){var c=this.errorList[d];this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass);this.showLabel(c.element,c.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var d=0;this.successList[d];d++){this.showLabel(this.successList[d])}}if(this.settings.unhighlight){for(var d=0,b=this.validElements();b[d];d++){this.settings.unhighlight.call(this,b[d],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,d){var c=this.errorsFor(b);if(c.length){c.removeClass(this.settings.validClass).addClass(this.settings.errorClass);c.attr("generated")&&c.html(d)}else{c=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(b),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){c=c.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(c).length){if(this.settings.errorPlacement){this.settings.errorPlacement(c,a(b))}else{}}}if(!d&&this.settings.success){c.text("");typeof this.settings.success=="string"?c.addClass(this.settings.success):this.settings.success(c)}this.toShow=this.toShow.add(c)},errorsFor:function(b){var c=this.idOrName(b);return this.errors().filter(function(){return a(this).attr("for")==c})},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},validationTargetFor:function(b){if(this.checkable(b)){b=this.findByName(b.name).not(this.settings.ignore)[0]}return b},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(c){var b=this.currentForm;return a(document.getElementsByName(c)).map(function(e,d){return a.validator.getForm(d)==b&&d.name==c&&d||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,a.validator.getForm(b)).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();this.formSubmitted=false}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var e={};var b=a(c);for(var d in a.validator.methods){var f;if(d==="required"&&typeof a.fn.prop==="function"){f=b.prop(d)}else{f=b.attr(d)}if(f){e[d]=f}else{if(b[0].getAttribute("type")===d){e[d]=true}}}if(e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)){delete e.maxlength}return e},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(a.validator.getForm(b),"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(b){var c={};var d=a.data(a.validator.getForm(b),"validator");if(d.settings.rules){c=a.validator.normalizeRule(d.settings.rules[b.name])||{}}return c},normalizeRules:function(c,b){a.each(c,function(e,f){if(f===false){delete c[e];return}if(f.param||f.depends){var d=true;switch(typeof f.depends){case"string":d=!!a(f.depends,a.validator.getForm(b)).length;break;case"function":d=f.depends.call(b,b);break}if(d){c[e]=f.param!==undefined?f.param:true}else{delete c[e]}}});a.each(c,function(e,d){c[e]=a.isFunction(d)?d(b):d});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(b){if(typeof b=="string"){var c={};a.each(b.split(/\s/),function(){c[this]=true});b=c}return b},addMethod:function(d,c,b){a.validator.methods[d]=c;a.validator.messages[d]=b!=undefined?b:a.validator.messages[d];if(c.length<3){a.validator.addClassRules(d,a.validator.normalizeRule(d))}},methods:{required:function(e,b,c){if(!this.depend(c,b)){return"dependency-mismatch"}switch(b.nodeName.toLowerCase()){case"select":var d=a(b).val();return d&&d.length>0;case"input":if(this.checkable(b)){return this.getLength(e,b)>0}default:return a.trim(e).length>0}},remote:function(g,c,d){if(this.optional(c)){return"dependency-mismatch"}var e=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}e.originalMessage=this.settings.messages[c.name].remote;this.settings.messages[c.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[c.name]){return"pending"}if(e.old===g){return e.valid}e.old=g;var f=this;this.startRequest(c);var b={};b[c.name]=g;a.ajax(a.extend(true,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:b,success:function(j){f.settings.messages[c.name].remote=e.originalMessage;var l=j===true;if(l){var k=f.formSubmitted;f.prepareElement(c);f.formSubmitted=k;f.successList.push(c);f.showErrors()}else{var h={};var i=j||f.defaultMessage(c,"remote");h[c.name]=e.message=a.isFunction(i)?i(g):i;f.showErrors(h)}e.valid=l;f.stopRequest(c,l)}},d));return"pending"},minlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)>=c},maxlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)<=c},rangelength:function(e,b,d){var c=this.getLength(a.trim(e),b);return this.optional(b)||(c>=d[0]&&c<=d[1])},min:function(d,b,c){return this.optional(b)||d>=c},max:function(d,b,c){return this.optional(b)||d<=c},range:function(d,b,c){return this.optional(b)||(d>=c[0]&&d<=c[1])},email:function(c,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(c)},url:function(c,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(c)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},creditcard:function(h,d){if(this.optional(d)){return"dependency-mismatch"}if(/[^0-9 -]+/.test(h)){return false}var f=0,g=0,b=false;h=h.replace(/\D/g,"");for(var e=h.length-1;e>=0;e--){var c=h.charAt(e);var g=parseInt(c,10);if(b){if((g*=2)>9){g-=9}}f+=g;b=!b}return(f%10)==0},accept:function(d,b,c){c=typeof c=="string"?c.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||d.match(new RegExp(".("+c+")$","i"))},equalTo:function(e,b,c){var d=a(c).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(b).valid()});return e==d.val()}}});a.format=a.validator.format})(jQuery);(function(a){var c={};if(a.ajaxPrefilter){a.ajaxPrefilter(function(f,d,g){var e=f.port;if(f.mode=="abort"){if(c[e]){c[e].abort()}c[e]=g}})}else{var b=a.ajax;a.ajax=function(f){var d=("mode" in f?f:a.ajaxSettings).mode,e=("port" in f?f:a.ajaxSettings).port;if(d=="abort"){if(c[e]){c[e].abort()}return(c[e]=b.apply(this,arguments))}return b.apply(this,arguments)}}})(jQuery);(function(a){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){a.each({focus:"focusin",blur:"focusout"},function(d,b){a.event.special[b]={setup:function(){this.addEventListener(d,c,true)},teardown:function(){this.removeEventListener(d,c,true)},handler:function(f){arguments[0]=a.event.fix(f);arguments[0].type=b;return a.event.handle.apply(this,arguments)}};function c(f){f=a.event.fix(f);f.type=b;return a.event.handle.call(this,f)}})}a.extend(a.fn,{validateDelegate:function(b,d,c){return this.bind(d,function(e){var f=a(e.target);if(f.is(b)){return c.apply(f,arguments)}})}})})(jQuery);jQuery.extend(jQuery.validator.messages,{required:"Это поле необходимо заполнить.",remote:"Пожалуйста, введите правильное значение.",email:"Пожалуйста, введите корректный адрес электронной почты.",url:"Пожалуйста, введите корректный URL.",date:"Пожалуйста, введите корректную дату.",dateISO:"Пожалуйста, введите корректную дату в формате ISO.",number:"Пожалуйста, введите число.",digits:"Пожалуйста, вводите только цифры.",creditcard:"Пожалуйста, введите правильный номер кредитной карты.",accept:"Пожалуйста, выберите файл с правильным расширением.",maxlength:jQuery.validator.format("Пожалуйста, введите не больше {0} символов."),minlength:jQuery.validator.format("Пожалуйста, введите не меньше {0} символов."),rangelength:jQuery.validator.format("Пожалуйста, введите значение длиной от {0} до {1} символов."),range:jQuery.validator.format("Пожалуйста, введите число от {0} до {1}."),max:jQuery.validator.format("Пожалуйста, введите число, меньшее или равное {0}."),min:jQuery.validator.format("Пожалуйста, введите число, большее или равное {0}.")}); /* ** Unobtrusive validation support library for jQuery and jQuery Validate ** Copyright (C) Microsoft Corporation. All rights reserved. */ (function(a){var b=a.validator,c,e="unobtrusiveValidation";function j(m,n,o){m.rules[n]=o;if(m.message){m.messages[n]=m.message}}function k(m){return m.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(m){return m.substr(0,m.lastIndexOf(".")+1)}function d(n,m){if(n.indexOf("*.")===0){n=n.replace("*.",m)}return n}function g(n,o){var m=a(this).find("[data-valmsg-for='"+o[0].name+"']"),p=a.parseJSON(m.attr("data-valmsg-replace"))!==false;m.removeClass("field-validation-valid").addClass("field-validation-error");n.data("unobtrusiveContainer",m);o.attr("title",n.html());if(p){m.empty();n.removeClass("input-validation-error").appendTo(m)}else{n.hide()}}function h(n,p){var m=a(this).find("[data-valmsg-summary=true]"),o=m.find("ul");if(o&&o.length&&p.errorList.length){o.empty();m.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(p.errorList,function(){a("
  • ").html(this.message).appendTo(o)})}}function i(n){var m=n.data("unobtrusiveContainer"),o=a.parseJSON(m.attr("data-valmsg-replace"));if(m){m.addClass("field-validation-valid").removeClass("field-validation-error");n.removeData("unobtrusiveContainer");if(o){m.empty()}}}function l(n){var m=a(n),o=m.data(e);if(!o){o={options:{errorClass:"error",errorElement:"span",errorPlacement:a.proxy(g,n),invalidHandler:a.proxy(h,n),messages:{},rules:{},success:a.proxy(i,n)},attachValidation:function(){m.validate(this.options)},validate:function(){m.validate();return m.valid()}};m.data(e,o)}return o}b.unobtrusive={adapters:[],parseElement:function(n,s){var m=a(n),o=m.parents("[zw_validate]")[0],t,r,p;if(!o){return}t=l(o);t.options.rules[n.name]=r={};t.options.messages[n.name]=p={};a.each(this.adapters,function(){var w="data-val-"+this.name,u=m.attr(w),v={};if(u!==undefined){w+="-";a.each(this.params,function(){v[this]=m.attr(w+this)});this.adapt({element:n,form:o,message:u,params:v,rules:r,messages:p})}});jQuery.extend(r,{__dummy__:true});if(!s){t.attachValidation()}},parse:function(m){a(m).find(":input[data-val=true]").each(function(){b.unobtrusive.parseElement(this,true)});a("form").each(function(){var n=l(this);if(n){n.attachValidation()}})},zetaParse:function(m){a(m).attr("zw_validate","1");a(m).find(":input[data-val=true]").each(function(){b.unobtrusive.parseElement(this,true)});a(m).each(function(){var n=l(this);if(n){n.attachValidation()}})}};c=b.unobtrusive.adapters;c.add=function(m,o,n){if(!n){n=o;o=[]}this.push({name:m,params:o,adapt:n});return this};c.addBool=function(m,n){return this.add(m,function(o){j(o,n||m,true)})};c.addMinMax=function(m,s,o,r,p,n){return this.add(m,[p||"min",n||"max"],function(v){var u=v.params.min,t=v.params.max;if(u&&t){j(v,r,[u,t])}else{if(u){j(v,s,u)}else{if(t){j(v,o,t)}}}})};c.addSingleVal=function(m,n,o){return this.add(m,[n||"val"],function(p){j(p,o||m,p.params[n])})};b.addMethod("__dummy__",function(o,m,n){return true});b.addMethod("regex",function(p,m,o){var n;if(this.optional(m)){return true}n=new RegExp(o).exec(p);return(n&&(n.index===0)&&(n[0].length===p.length))});c.addSingleVal("accept","exts").addSingleVal("regex","pattern");c.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");c.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");c.add("equalto",["other"],function(n){var p=f(n.element.name),o=n.params.other,m=d(o,p);element=a(n.form).find(":input[name='"+m+"']")[0];j(n,"equalTo",element)});c.add("required",function(m){if(m.element.tagName.toUpperCase()!=="INPUT"||m.element.type.toUpperCase()!=="CHECKBOX"){j(m,"required",true)}});c.add("remote",["url","type","additionalfields"],function(m){var o={url:m.params.url,type:m.params.type||"GET",data:{}},n=f(m.element.name);a.each(k(m.params.additionalfields||m.element.name),function(r,p){var s=d(p,n);o.data[s]=function(){return a(m.form).find(":input[name='"+s+"']").val()}});j(m,"remote",o)});a(function(){})}(jQuery));var zw_validation=(function ZetaValidation(){var a="zw_validate";var b=function(d){$.map(d,function(f,e){$("#"+f).not("["+a+"]").each(function(){$.validator.unobtrusive.zetaParse(this)})})};var c=function(d){$(d).not("["+a+"]").each(function(){$.validator.unobtrusive.zetaParse(this)})};return{isValid:function(e){var d=ZetaControlRefresher.GetControlFromObject(e);c(d);var f=d.validate().form();return f}}}());jQuery.validator.unobtrusive.adapters.addBool("mandatory","required");jQuery.validator.unobtrusive.adapters.add("atleastonerequired",["properties"],function(a){a.rules.atleastonerequired=a.params;a.messages.atleastonerequired=a.message});jQuery.validator.addMethod("atleastonerequired",function(d,a,b){var c=b.properties.split(",");var e=$.map(c,function(g,f){var h=$("input[name='"+g+"']").val();return h!=""?h:null});return e.length>0},"");function SetDivHTML(a,b){var c=document.getElementById(a);c.innerHTML=b}function AddToFavorites(a,b,c){if(window.sidebar){window.sidebar.addPanel(b,c,"");return false}else{if(window.external){window.external.AddFavorite(c,b);return false}else{if(window.opera&&window.print){a.setAttribute("href",c);a.setAttribute("title",b);a.setAttribute("rel","sidebar");a.FireEvent("onclick");return false}}}}function SetHomePage(b){if(document.all){document.body.style.behavior="url( #default#homepage )";document.body.setHomePage(b)}else{if(window.sidebar){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(a){alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true")}}var c=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);c.setCharPref("browser.startup.homepage",b)}}}function CheckIsDecimal(){var a=event.keyCode;if(a==13||a==8||a==39||a==37||a==46||a==65){event.returnValue=true}else{if(((a<48&&a!=44)||a>57)||(event.srcElement.value.indexOf(",")>0&&a==44)||(event.srcElement.value.length==0&&a==44)){event.cancelBubble=true;event.returnValue=false}}}var SDECREASE=0;var MDECREASE=3;var UNESECONDE=1000;var UNEMINUTE=60*UNESECONDE;var HTTP_OK=200;var HTTP_RDY=4;var webConfigTimeOut=new Number();var sDecrease=SDECREASE;var mDecrease=MDECREASE;var sessionTimeOut=UNEMINUTE*webConfigTimeOut;var expireSessionAlert="Ваша сессия истекает через";var expireSessionActive="Нажмите здесь для отмены";var expireSessionMarque="";var expireSessionRoot="Нажмите для возврата на главную страницу";var expireSessionRootPath=window.location.protocol+"//"+window.location.host;var expireSessionEnd="Ваша сессия истекла.\r\nДля продолжения работы войдите\r\nпод своей учетной записью.";var MB_HEADER="Завершение сеанса работы";var stopDecount=1;var expireSessionTimeID=0;var decreaseTimeoutID=0;var internalHttpClient;var lastAccessTimestamp;var currentDate;function initExpireSession(a){a=a||getSessionTimeoutFromWebConfig();webConfigTimeOut=a;sessionTimeOut=UNEMINUTE*(webConfigTimeOut-MDECREASE);if(sessionTimeOut<=0){alert("Продолжительность сессии меньше "+MDECREASE+" мин.");mDecrease=Math.ceil(webConfigTimeOut);sDecrease=0;showPreventEndSessionDialog()}else{expireSessionTimeID=setTimeout("showPreventEndSessionDialog()",sessionTimeOut)}}function showPreventEndSessionDialog(){getLastAccessTimestamp();currentDate=new Date();webConfigTimeOut=getSessionTimeoutFromWebConfig();var a=new Date(currentDate-lastAccessTimestamp).getMinutes();var c=webConfigTimeOut-a;if(c>webConfigTimeOut-MDECREASE){window.clearTimeout(decreaseTimeoutID);window.clearTimeout(expireSessionTimeID);initExpireSession(c)}else{str='
    '+expireSessionAlert+'
    '+expireSessionActive+"
    ";var b={okButton:false,color:"red",closeButtonEventHandler:reactivateSession};$.fn.messageBox(MB_HEADER,str,b);top.window.focus();stopDecount=0;preventEndSessionDecrease()}}function showExpiredSessionMessage(){str="
    "+expireSessionEnd+'

    '+expireSessionRoot+"
    ";var a={okButton:false,color:"red",contentAlignment:"center",closeButtonEventHandler:function(){window.location.href=window.location.protocol+"//"+window.location.host}};$.fn.messageBox(MB_HEADER,str,a)}function preventEndSessionDecrease(){$("#decrease").html(mDecrease+":"+(sDecrease<10?"0"+sDecrease:sDecrease));sDecrease--;if(sDecrease==-1){sDecrease=59;mDecrease--}if(mDecrease==-1){setDefaultDecreases();$.ajax({type:"POST",url:"/WebMethods.aspx/ExpireSession",data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",async:false,cache:false,success:function(a){window.location.href=a.d},error:function(c,b,a){window.location.href=window.location.protocol+"//"+window.location.host}})}if(stopDecount==0){decreaseTimeoutID=setTimeout("preventEndSessionDecrease()",UNESECONDE)}}function setDefaultDecreases(){stopDecount=1;sDecrease=SDECREASE;mDecrease=(sessionTimeOut<=0)?webConfigTimeOut:MDECREASE}function reactivateSession(){window.clearTimeout(decreaseTimeoutID);window.clearTimeout(expireSessionTimeID);setDefaultDecreases();callReactivateSession();var a=$("#reactivateLink");a.parents("[id^='mpa-']:first").remove();if(sessionTimeOut<=0){showPreventEndSessionDialog()}else{expireSessionTimeID=setTimeout("showPreventEndSessionDialog()",sessionTimeOut)}}function callReactivateSession(){getInternalHttpClient();internalHttpClient.onreadystatechange=function(){if(internalHttpClient.readyState==HTTP_RDY&&internalHttpClient.status==HTTP_OK){}};internalHttpClient.open("GET","/do/reactivateSession",true);internalHttpClient.send(null);setLastAccessTimestamp()}function getInternalHttpClient(){if(window.XMLHttpRequest){internalHttpClient=new XMLHttpRequest()}else{if(window.ActiveXObject){try{internalHttpClient=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){internalHttpClient=new ActiveXObject("Microsoft.XMLHTTP")}}else{alert("Невозможно получить внутренний HTTP клиент");internalHttpClient=false}}}function getLastAccessTimestamp(){$.ajax({type:"POST",url:"/WebMethods.aspx/GetLastAccessTimestamp",data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",async:false,cache:false,success:function(a){lastAccessTimestamp=new Date(Date.parse(a.d))},error:function(c,b,a){$.fn.checkInternetConnection(c)}})}function setLastAccessTimestamp(){$.fn.callwebmethod("SetLastAccessTimestamp","{}",null,function(c,b,a){$.fn.checkInternetConnection(c)})}function getSessionTimeoutFromWebConfig(){var a=$.fn.callwebmethod("GetSessionTimeoutFromWebConfig","{}");return a.d}$.fn.togglepopup=function(){var d=null;if(!$(this).attr("ctrltype")){d=$(this).parents("[ctrltype]")}else{d=$(this)}var b=$(d).find("input:hidden").filter("[id*=mphf]");var c=$(d).find("input:hidden").filter("[id*=mpl]");b.val(b.val()=="true"?"false":"true");if(c.val()=="true"){var a=b.val()=="true"?"":"none";d.css("display",a)}else{c.val("true");__doPostBack(d[0].id,"")}};$.fn.closepopup=function(){var b=null;if(!$(this).attr("ctrltype")){b=$(this).parents("[ctrltype]")}else{b=$(this)}var a=$(b).find("input:hidden").filter("[id*=mphf]");a.val("false");b.css("display","none")};$.fn.sendPriceRequest=function(a){$.fn.callwebmethod("SendPriceInformationRequest","{ObjectID:'"+a+"'}",function(){$.fn.messageBox("Уточнение цены","Заявка отправлена")},function(d,c,b){$.fn.checkInternetConnection(d)})};$.fn.sendSupplierDiscountRequest=function(b){var a;a=$.fn.callwebmethod("SendSupplierDiscountRequest","{storeID:'"+b+"'}",null,null);$.fn.messageBox("Информация по скидкам / наценкам поставщика",a.d,{width:"auto",contentAlignment:"left"})};(function(a){function c(d){this.input=d;if(d.attr("type")=="password"){this.handlePassword()}a(d[0].form).submit(function(){if(d.hasClass("placeholder")&&d[0].value==d.attr("placeholder")){d[0].value=""}})}c.prototype={show:function(f){if(this.input[0].value===""||(f&&this.valueIsPlaceholder())){if(this.isPassword){try{this.input[0].setAttribute("type","text")}catch(d){this.input.before(this.fakePassword.show()).hide()}}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")){this.input.removeClass("placeholder");this.input[0].value="";if(this.isPassword){try{this.input[0].setAttribute("type","password")}catch(d){}this.input.show();this.input[0].focus()}}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var e=this.input;e.attr("realType","password");this.isPassword=true;if(a.browser.msie&&e[0].outerHTML){var d=a(e[0].outerHTML.replace(/type=(['"])?password\1/gi,"type=$1text$1"));this.fakePassword=d.val(e.attr("placeholder")).addClass("placeholder").focus(function(){e.trigger("focus");a(this).hide()});a(e[0].form).submit(function(){d.remove();e.show()})}}};var b=!!("placeholder" in document.createElement("input"));a.fn.placeholder=function(){return b?this:this.each(function(){var d=a(this);var e=new c(d);e.show(true);d.focus(function(){e.hide()});d.blur(function(){e.show(false)});if(a.browser.msie){a(window).load(function(){if(d.val()){d.removeClass("placeholder")}e.show(true)});d.focus(function(){if(this.value==""){var f=this.createTextRange();f.collapse(true);f.moveStart("character",0);f.select()}})}})}})(jQuery); /* * jQuery Form Plugin * version: 2.93 (30-NOV-2011) * @requires jQuery v1.3.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function(a){a.fn.ajaxSubmit=function(s){if(!this.length){b("ajaxSubmit: skipping submit process - no element selected");return this}var l,e,y,c=this;if(typeof s=="function"){s={success:s}}l=this.attr("method");e=this.attr("action");y=(typeof e==="string")?a.trim(e):"";y=y||window.location.href||"";if(y){y=(y.match(/^([^#]+)/)||[])[1]}s=a.extend(true,{url:y,success:a.ajaxSettings.success,type:l||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},s);var A={};this.trigger("form-pre-serialize",[this,s,A]);if(A.veto){b("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){b("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var x=s.traditional;if(x===undefined){x=a.ajaxSettings.traditional}var u,p,z,d=this.formToArray(s.semantic);if(s.data){s.extraData=s.data;u=a.param(s.data,x)}if(s.beforeSubmit&&s.beforeSubmit(d,this,s)===false){b("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[d,this,s,A]);if(A.veto){b("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var t=a.param(d,x);if(u){t=(t?(t+"&"+u):u)}if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+t;s.data=null}else{s.data=t}var f=[];if(s.resetForm){f.push(function(){c.resetForm()})}if(s.clearForm){f.push(function(){c.clearForm(s.includeHidden)})}if(!s.dataType&&s.target){var r=s.success||function(){};f.push(function(n){var v=s.replaceTarget?"replaceWith":"html";a(s.target)[v](n).each(r,arguments)})}else{if(s.success){f.push(s.success)}}s.success=function(v,D,E){var n=s.context||s;for(var B=0,C=f.length;B0;var m="multipart/form-data";var o=(c.attr("enctype")==m||c.attr("encoding")==m);var g=!!(k&&h.get(0).files&&window.FormData);b("fileAPI :"+g);var w=(k||o)&&!g;if(s.iframe!==false&&(s.iframe||w)){if(s.closeKeepAlive){a.get(s.closeKeepAlive,function(){i(d)})}else{i(d)}}else{if((k||o)&&g){s.progress=s.progress||a.noop;j(d)}else{a.ajax(s)}}this.trigger("form-submit-notify",[this,s]);return this;function j(v){var B=new FormData();for(var C=0;C');v.css({position:"absolute",top:"-1000px",left:"-1000px"})}S=v[0];ac={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(ad){var n=(ad==="timeout"?"timeout":"aborted");b("aborting upload... "+n);this.aborted=1;v.attr("src",V.iframeSrc);ac.error=n;V.error&&V.error.call(V.context,ac,n,ad);N&&a.event.trigger("ajaxError",[ac,V,n]);V.complete&&V.complete.call(V.context,ac,n)}};N=V.global;if(N&&!a.active++){a.event.trigger("ajaxStart")}if(N){a.event.trigger("ajaxSend",[ac,V])}if(V.beforeSend&&V.beforeSend.call(V.context,ac,V)===false){if(V.global){a.active--}return}if(ac.aborted){return}X=M.clk;if(X){T=X.name;if(T&&!X.disabled){V.extraData=V.extraData||{};V.extraData[T]=X.value;if(X.type=="image"){V.extraData[T+".x"]=M.clk_x;V.extraData[T+".y"]=M.clk_y}}}var E=1;var W=2;function O(ad){var n=ad.contentWindow?ad.contentWindow.document:ad.contentDocument?ad.contentDocument:ad.document;return n}var G=a("meta[name=csrf-token]").attr("content");var F=a("meta[name=csrf-param]").attr("content");if(F&&G){V.extraData=V.extraData||{};V.extraData[F]=G}function K(){var ah=c.attr("target"),ad=c.attr("action");M.setAttribute("target",R);if(!l){M.setAttribute("method","POST")}if(ad!=V.url){M.setAttribute("action",V.url)}if(!V.skipEncodingOverride&&(!l||/post/i.test(l))){c.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(V.timeout){Z=setTimeout(function(){Y=true;D(E)},V.timeout)}function ae(){try{var ai=O(S).readyState;b("state = "+ai);if(ai.toLowerCase()=="uninitialized"){setTimeout(ae,50)}}catch(n){b("Server abort: ",n," (",n.name,")");D(W);Z&&clearTimeout(Z);Z=undefined}}var af=[];try{if(V.extraData){for(var ag in V.extraData){af.push(a('').attr("value",V.extraData[ag]).appendTo(M)[0])}}if(!V.iframeTarget){v.appendTo("body");S.attachEvent?S.attachEvent("onload",D):S.addEventListener("load",D,false)}setTimeout(ae,15);M.submit()}finally{M.setAttribute("action",ad);if(ah){M.setAttribute("target",ah)}else{c.removeAttr("target")}a(af).remove()}}if(V.forceSync){K()}else{setTimeout(K,10)}var H,I,J=50,C;function D(af){if(ac.aborted||C){return}try{I=O(S)}catch(ah){b("cannot access response document: ",ah);af=W}if(af===E&&ac){ac.abort("timeout");return}else{if(af==W&&ac){ac.abort("server abort");return}}if(!I||I.location.href==V.iframeSrc){if(!Y){return}}S.detachEvent?S.detachEvent("onload",D):S.removeEventListener("load",D,false);var al="success",ag;try{if(Y){throw"timeout"}var ai=V.dataType=="xml"||I.XMLDocument||a.isXMLDoc(I);b("isXml="+ai);if(!ai&&window.opera&&(I.body==null||I.body.innerHTML=="")){if(--J){b("requeing onLoad callback, DOM not available");setTimeout(D,250);return}}var ad=I.body?I.body:I.documentElement;ac.responseText=ad?ad.innerHTML:null;ac.responseXML=I.XMLDocument?I.XMLDocument:I;if(ai){V.dataType="xml"}ac.getResponseHeader=function(an){var ao={"content-type":V.dataType};return ao[an]};if(ad){ac.status=Number(ad.getAttribute("status"))||ac.status;ac.statusText=ad.getAttribute("statusText")||ac.statusText}var ae=(V.dataType||"").toLowerCase();var ak=/(json|script|text)/.test(ae);if(ak||V.textarea){var am=I.getElementsByTagName("textarea")[0];if(am){ac.responseText=am.value;ac.status=Number(am.getAttribute("status"))||ac.status;ac.statusText=am.getAttribute("statusText")||ac.statusText}else{if(ak){var aj=I.getElementsByTagName("pre")[0];var n=I.getElementsByTagName("body")[0];if(aj){ac.responseText=aj.textContent?aj.textContent:aj.innerText}else{if(n){ac.responseText=n.textContent?n.textContent:n.innerText}}}}}else{if(ae=="xml"&&!ac.responseXML&&ac.responseText!=null){ac.responseXML=aa(ac.responseText)}}try{H=P(ac,ae,V)}catch(af){al="parsererror";ac.error=ag=(af||al)}}catch(af){b("error caught: ",af);al="error";ac.error=ag=(af||al)}if(ac.aborted){b("upload aborted");al=null}if(ac.status){al=(ac.status>=200&&ac.status<300||ac.status===304)?"success":"error"}if(al==="success"){V.success&&V.success.call(V.context,H,"success",ac);N&&a.event.trigger("ajaxSuccess",[ac,V])}else{if(al){if(ag==undefined){ag=ac.statusText}V.error&&V.error.call(V.context,ac,al,ag);N&&a.event.trigger("ajaxError",[ac,V,ag])}}N&&a.event.trigger("ajaxComplete",[ac,V]);if(N&&!--a.active){a.event.trigger("ajaxStop")}V.complete&&V.complete.call(V.context,ac,al);C=true;if(V.timeout){clearTimeout(Z)}setTimeout(function(){if(!V.iframeTarget){v.remove()}ac.responseXML=null},100)}var aa=a.parseXML||function(ad,n){if(window.ActiveXObject){n=new ActiveXObject("Microsoft.XMLDOM");n.async="false";n.loadXML(ad)}else{n=(new DOMParser()).parseFromString(ad,"text/xml")}return(n&&n.documentElement&&n.documentElement.nodeName!="parsererror")?n:null};var U=a.parseJSON||function(n){return window["eval"]("("+n+")")};var P=function(ag,af,ae){var n=ag.getResponseHeader("content-type")||"",ah=af==="xml"||!af&&n.indexOf("xml")>=0,ad=ah?ag.responseXML:ag.responseText;if(ah&&ad.documentElement.nodeName==="parsererror"){a.error&&a.error("parsererror")}if(ae&&ae.dataFilter){ad=ae.dataFilter(ad,af)}if(typeof ad==="string"){if(af==="json"||!af&&n.indexOf("json")>=0){ad=U(ad)}else{if(af==="script"||!af&&n.indexOf("javascript")>=0){a.globalEval(ad)}}}return ad}}};a.fn.ajaxForm=function(d){if(this.length===0){var c={s:this.selector,c:this.context};if(!a.isReady&&c.s){b("DOM not ready, queuing ajaxForm");a(function(){a(c.s,c.c).ajaxForm(d)});return this}b("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();a(this).ajaxSubmit(d)}}).bind("click.form-plugin",function(g){var k=g.target;var f=a(k);if(!(f.is(":submit,input:image"))){var j=f.closest(":submit");if(j.length==0){return}k=j[0]}var h=this;h.clk=k;if(k.type=="image"){if(g.offsetX!=undefined){h.clk_x=g.offsetX;h.clk_y=g.offsetY}else{if(typeof a.fn.offset=="function"){var i=f.offset();h.clk_x=g.pageX-i.left;h.clk_y=g.pageY-i.top}else{h.clk_x=g.pageX-k.offsetLeft;h.clk_y=g.pageY-k.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(r){var d=[];if(this.length===0){return d}var g=this[0];var f=r?g.getElementsByTagName("*"):g.elements;if(!f){return d}var h,l,p,s,e,o,m;for(h=0,o=f.length;h<0){return null}var c=[],l=d.options;var j=(o=="select-one");var g=(j?f+1:l.length);for(var e=(j?f:0);e")&&s[0]){}return(u>4)?u:false})();return r};g.isInternetExplorer=function(){var r=g.isInternetExplorer.cached=(typeof g.isInternetExplorer.cached!=="undefined")?g.isInternetExplorer.cached:Boolean(g.getInternetExplorerMajorVersion());return r};g.emulated={pushState:!Boolean(n.history&&n.history.pushState&&n.history.replaceState&&!((/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i).test(i.userAgent)||(/AppleWebKit\/5([0-2]|3[0-2])/i).test(i.userAgent))),hashChange:Boolean(!(("onhashchange" in n)||("onhashchange" in e))||(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8))};g.enabled=!g.emulated.pushState;g.bugs={setHash:Boolean(!g.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!g.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(g.isInternetExplorer()&&g.getInternetExplorerMajorVersion()<7)};g.isEmptyObject=function(s){for(var r in s){return false}return true};g.cloneObject=function(t){var r,s;if(t){r=h.stringify(t);s=h.parse(r)}else{s={}}return s};g.getRootUrl=function(){var r=e.location.protocol+"//"+(e.location.hostname||e.location.host);if(e.location.port||false){r+=":"+e.location.port}r+="/";return r};g.getBaseHref=function(){var s=e.getElementsByTagName("base"),r=null,t="";if(s.length===1){r=s[0];t=r.href.replace(/[^\/]+$/,"")}t=t.replace(/\/+$/,"");if(t){t+="/"}return t};g.getBaseUrl=function(){var r=g.getBaseHref()||g.getBasePageUrl()||g.getRootUrl();return r};g.getPageUrl=function(){var s=g.getState(false,false),t=(s||{}).url||e.location.href,r;r=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(v,u,w){return(/\./).test(v)?v:v+"/"});return r};g.getBasePageUrl=function(){var r=e.location.href.replace(/[#\?].*/,"").replace(/[^\/]+$/,function(t,s,u){return(/[^\/]$/).test(t)?"":t}).replace(/\/+$/,"")+"/";return r};g.getFullUrl=function(u,r){var t=u,s=u.substring(0,1);r=(typeof r==="undefined")?true:r;if(/[a-z]+\:\/\//.test(u)){}else{if(s==="/"){t=g.getRootUrl()+u.replace(/^\/+/,"")}else{if(s==="#"){t=g.getPageUrl().replace(/#.*/,"")+u}else{if(s==="?"){t=g.getPageUrl().replace(/[\?#].*/,"")+u}else{if(r){t=g.getBaseUrl()+u.replace(/^(\.\/)+/,"")}else{t=g.getBasePageUrl()+u.replace(/^(\.\/)+/,"")}}}}}return t.replace(/\#$/,"")};g.getShortUrl=function(u){var t=u,r=g.getBaseUrl(),s=g.getRootUrl();if(g.emulated.pushState){t=t.replace(r,"")}t=t.replace(s,"/");if(g.isTraditionalAnchor(t)){t="./"+t}t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,"");return t};g.store={};g.idToState=g.idToState||{};g.stateToId=g.stateToId||{};g.urlToId=g.urlToId||{};g.storedStates=g.storedStates||[];g.savedStates=g.savedStates||[];g.normalizeStore=function(){g.store.idToState=g.store.idToState||{};g.store.urlToId=g.store.urlToId||{};g.store.stateToId=g.store.stateToId||{}};g.getState=function(s,r){if(typeof s==="undefined"){s=true}if(typeof r==="undefined"){r=true}var t=g.getLastSavedState();if(!t&&r){t=g.createStateObject()}if(s){t=g.cloneObject(t);t.url=t.cleanUrl||t.url}return t};g.getIdByState=function(s){var r=g.extractId(s.url),t;if(!r){t=g.getStateString(s);if(typeof g.stateToId[t]!=="undefined"){r=g.stateToId[t]}else{if(typeof g.store.stateToId[t]!=="undefined"){r=g.store.stateToId[t]}else{while(true){r=(new Date()).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof g.idToState[r]==="undefined"&&typeof g.store.idToState[r]==="undefined"){break}}g.stateToId[t]=r;g.idToState[r]=s}}}return r};g.normalizeState=function(t){var s,r;if(!t||(typeof t!=="object")){t={}}if(typeof t.normalized!=="undefined"){return t}if(!t.data||(typeof t.data!=="object")){t.data={}}s={};s.normalized=true;s.title=t.title||"";s.url=g.getFullUrl(g.unescapeString(t.url||e.location.href));s.hash=g.getShortUrl(s.url);s.data=g.cloneObject(t.data);s.id=g.getIdByState(s);s.cleanUrl=s.url.replace(/\??\&_suid.*/,"");s.url=s.cleanUrl;r=!g.isEmptyObject(s.data);if(s.title||r){s.hash=g.getShortUrl(s.url).replace(/\??\&_suid.*/,"");if(!/\?/.test(s.hash)){s.hash+="?"}s.hash+="&_suid="+s.id}s.hashedUrl=g.getFullUrl(s.hash);if((g.emulated.pushState||g.bugs.safariPoll)&&g.hasUrlDuplicate(s)){s.url=s.hashedUrl}return s};g.createStateObject=function(r,t,u){var s={data:r,title:t,url:u};s=g.normalizeState(s);return s};g.getStateById=function(r){r=String(r);var s=g.idToState[r]||g.store.idToState[r]||m;return s};g.getStateString=function(s){var t,r,u;t=g.normalizeState(s);r={data:t.data,title:s.title,url:s.url};u=h.stringify(r);return u};g.getStateId=function(s){var t,r;t=g.normalizeState(s);r=t.id;return r};g.getHashByState=function(t){var u,r;u=g.normalizeState(t);r=u.hash;var s=r.indexOf("?");if(s>=0){r=r.substr(s)}else{r=""}return r};g.extractId=function(u){var r,s,t;s=/(.*)\&_suid=([0-9]+)$/.exec(u);t=s?(s[1]||u):u;r=s?String(s[2]||""):"";return r||false};g.isTraditionalAnchor=function(s){var r=!(/[\/\?\.]/.test(s));return r};g.extractState=function(v,r){var t=null,s,u;r=r||false;s=g.extractId(v);if(s){t=g.getStateById(s)}if(!t){u=g.getFullUrl(v);s=g.getIdByUrl(u)||false;if(s){t=g.getStateById(s)}if(!t&&r&&!g.isTraditionalAnchor(v)){t=g.createStateObject(null,null,u)}}return t};g.getIdByUrl=function(s){var r=g.urlToId[s]||g.store.urlToId[s]||m;return r};g.getLastSavedState=function(){return g.savedStates[g.savedStates.length-1]||m};g.getLastStoredState=function(){return g.storedStates[g.storedStates.length-1]||m};g.hasUrlDuplicate=function(s){var r=false,t;t=g.extractState(s.url);r=t&&t.id!==s.id;return r};g.storeState=function(r){g.urlToId[r.url]=r.id;g.storedStates.push(g.cloneObject(r));return r};g.isLastSavedState=function(t){var r=false,s,v,u;if(g.savedStates.length){s=t.id;v=g.getLastSavedState();u=v.id;r=(s===u)}return r};g.saveState=function(r){if(g.isLastSavedState(r)){return false}g.savedStates.push(g.cloneObject(r));return true};g.getStateByIndex=function(r){var s=null;if(typeof r==="undefined"){s=g.savedStates[g.savedStates.length-1]}else{if(r<0){s=g.savedStates[g.savedStates.length+r]}else{s=g.savedStates[r]}}return s};g.getHash=function(){var r=g.unescapeHash(e.location.hash);return r};g.unescapeString=function(u){var t=u,v;var s=4;while(s>0){try{v=decodeURIComponent(t)}catch(r){break}if(v===t){break}t=v;s--}return t};g.unescapeHash=function(r){var s=g.normalizeHash(r);s=g.unescapeString(s);return s};g.normalizeHash=function(r){var s=r.replace(/[^#]*#/,"").replace(/#.*/,"");return s};g.setHash=function(s,u){var r,v,t;if(u!==false&&g.busy()){g.pushQueue({scope:g,callback:g.setHash,args:arguments,queue:u});return false}r=g.escapeHash(s);g.busy(true);v=g.extractState(s,true);if(v&&!g.emulated.pushState){g.pushState(v.data,v.title,v.url,false)}else{if(e.location.hash!==r){if(g.bugs.setHash){t=g.getPageUrl();g.pushState(null,null,t+"#"+r,false)}else{e.location.hash=r}}}return g};g.escapeHash=function(r){var s=g.normalizeHash(r);if($.browser.msie){s=encodeURIComponent(s)}else{s=n.escape(s)}if(!g.bugs.hashEscape){s=s.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")}return s};g.getHashByUrl=function(s){var r=String(s).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");r=g.unescapeHash(r);return r};g.setTitle=function(t){var u=t.title,s;if(!u){s=g.getStateByIndex(0);if(s&&s.url===t.url){u=s.title||g.options.initialTitle}}try{e.getElementsByTagName("title")[0].innerHTML=u.replace("<","<").replace(">",">").replace(" & "," & ")}catch(r){}e.title=u;return g};g.queues=[];g.busy=function(s){if(typeof s!=="undefined"){g.busy.flag=s}else{if(typeof g.busy.flag==="undefined"){g.busy.flag=false}}if(!g.busy.flag){c(g.busy.timeout);var r=function(){var t,v,u;if(g.busy.flag){return}for(t=g.queues.length-1;t>=0;--t){v=g.queues[t];if(v.length===0){continue}u=v.shift();g.fireQueueItem(u);g.busy.timeout=l(r,g.options.busyDelay)}};g.busy.timeout=l(r,g.options.busyDelay)}return g.busy.flag};g.busy.flag=false;g.fireQueueItem=function(r){return r.callback.apply(r.scope||g,r.args||[])};g.pushQueue=function(r){g.queues[r.queue||0]=g.queues[r.queue||0]||[];g.queues[r.queue||0].push(r);return g};g.queue=function(r,s){if(typeof r==="function"){r={callback:r}}if(typeof s!=="undefined"){r.queue=s}if(g.busy()){g.pushQueue(r)}else{g.fireQueueItem(r)}return g};g.clearQueue=function(){g.busy.flag=false;g.queues=[];return g};g.stateChanged=false;g.doubleChecker=false;g.doubleCheckComplete=function(){g.stateChanged=true;g.doubleCheckClear();return g};g.doubleCheckClear=function(){if(g.doubleChecker){c(g.doubleChecker);g.doubleChecker=false}return g};g.doubleCheck=function(r){g.stateChanged=false;g.doubleCheckClear();if(g.bugs.ieDoubleCheck){g.doubleChecker=l(function(){g.doubleCheckClear();if(!g.stateChanged){r()}return true},g.options.doubleCheckInterval)}return g};g.safariStatePoll=function(){var s=g.extractState(e.location.href),r;if(!g.isLastSavedState(s)){r=s}else{return}if(!r){r=g.createStateObject()}g.Adapter.trigger(n,"popstate");return g};g.back=function(r){if(r!==false&&g.busy()){g.pushQueue({scope:g,callback:g.back,args:arguments,queue:r});return false}g.busy(true);g.doubleCheck(function(){g.back(false)});f.go(-1);return true};g.forward=function(r){if(r!==false&&g.busy()){g.pushQueue({scope:g,callback:g.forward,args:arguments,queue:r});return false}g.busy(true);g.doubleCheck(function(){g.forward(false)});f.go(1);return true};g.go=function(s,t){var r;if(s>0){for(r=1;r<=s;++r){g.forward(t)}}else{if(s<0){for(r=-1;r>=s;--r){g.back(t)}}else{throw new Error("History.go: History.go requires a positive or negative integer passed.")}}return g};if(g.emulated.pushState){var o=function(){};g.pushState=g.pushState||o;g.replaceState=g.replaceState||o}else{g.onPopState=function(t,u){var w=false,v=false,r,s;g.doubleCheckComplete();r=g.getHash();if(r){s=g.extractState(r||e.location.href,true);if(s){g.replaceState(s.data,s.title,s.url,false)}else{g.Adapter.trigger(n,"anchorchange");g.busy(false)}g.expectedStateId=false;return false}w=g.Adapter.extractEventData("state",t,u)||false;if(w){v=g.getStateById(w)}else{if(g.expectedStateId){v=g.getStateById(g.expectedStateId)}else{v=g.extractState(e.location.href)}}if(!v){v=g.createStateObject(null,null,e.location.href)}g.expectedStateId=false;if(g.isLastSavedState(v)){g.busy(false);return false}g.storeState(v);g.saveState(v);g.setTitle(v);g.Adapter.trigger(n,"statechange");g.busy(false);return true};g.Adapter.bind(n,"popstate",g.onPopState);g.pushState=function(r,u,v,t){if(g.getHashByUrl(v)&&g.emulated.pushState){throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).")}if(t!==false&&g.busy()){g.pushQueue({scope:g,callback:g.pushState,args:arguments,queue:t});return false}g.busy(true);var s=g.createStateObject(r,u,v);if(g.isLastSavedState(s)){g.busy(false)}else{g.storeState(s);g.expectedStateId=s.id;f.pushState(s.id,s.title,s.url);g.Adapter.trigger(n,"popstate")}return true};g.replaceState=function(r,u,v,t){if(g.getHashByUrl(v)&&g.emulated.pushState){throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).")}if(t!==false&&g.busy()){g.pushQueue({scope:g,callback:g.replaceState,args:arguments,queue:t});return false}g.busy(true);var s=g.createStateObject(r,u,v);if(g.isLastSavedState(s)){g.busy(false)}else{g.storeState(s);g.expectedStateId=s.id;f.replaceState(s.id,s.title,s.url);g.Adapter.trigger(n,"popstate")}return true}}if(j){try{g.store=h.parse(j.getItem("History.store"))||{}}catch(p){g.store={}}g.normalizeStore()}else{g.store={};g.normalizeStore()}g.Adapter.bind(n,"beforeunload",g.clearAllIntervals);g.Adapter.bind(n,"unload",g.clearAllIntervals);g.saveState(g.storeState(g.extractState(e.location.href,true)));if(j){g.onUnload=function(){var r,t;try{r=h.parse(j.getItem("History.store"))||{}}catch(s){r={}}r.idToState=r.idToState||{};r.urlToId=r.urlToId||{};r.stateToId=r.stateToId||{};for(t in g.idToState){if(!g.idToState.hasOwnProperty(t)){continue}r.idToState[t]=g.idToState[t]}for(t in g.urlToId){if(!g.urlToId.hasOwnProperty(t)){continue}r.urlToId[t]=g.urlToId[t]}for(t in g.stateToId){if(!g.stateToId.hasOwnProperty(t)){continue}r.stateToId[t]=g.stateToId[t]}g.store=r;g.normalizeStore();j.setItem("History.store",h.stringify(r))};g.intervalList.push(k(g.onUnload,g.options.storeInterval));g.Adapter.bind(n,"beforeunload",g.onUnload);g.Adapter.bind(n,"unload",g.onUnload)}if(!g.emulated.pushState){if(g.bugs.safariPoll){g.intervalList.push(k(g.safariStatePoll,g.options.safariPollInterval))}if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla"){g.Adapter.bind(n,"hashchange",function(){g.Adapter.trigger(n,"popstate")});if(g.getHash()){g.Adapter.onDomLoad(function(){g.Adapter.trigger(n,"hashchange")})}}}};g.init()})(window);(function(g,f){var b=g.document,e=g.setTimeout||e,a=g.clearTimeout||a,d=g.setInterval||d,c=g.History=g.History||{};if(typeof c.initHtml4!=="undefined"){throw new Error("History.js HTML4 Support has already been loaded...")}c.initHtml4=function(){if(typeof c.initHtml4.initialized!=="undefined"){return false}else{c.initHtml4.initialized=true}c.enabled=true;c.savedHashes=[];c.isLastHash=function(i){var j=c.getHashByIndex(),h;h=i===j;return h};c.saveHash=function(h){if(c.isLastHash(h)){return false}c.savedHashes.push(h);return true};c.getHashByIndex=function(i){var h=null;if(typeof i==="undefined"){h=c.savedHashes[c.savedHashes.length-1]}else{if(i<0){h=c.savedHashes[c.savedHashes.length+i]}else{h=c.savedHashes[i]}}return h};c.discardedHashes={};c.discardedStates={};c.discardState=function(i,l,h){var j=c.getHashByState(i),k;k={discardedState:i,backState:h,forwardState:l};c.discardedStates[j]=k;return true};c.discardHash=function(i,k,h){var j={discardedHash:i,backState:h,forwardState:k};c.discardedHashes[i]=j;return true};c.discardedState=function(i){var j=c.getHashByState(i),h;h=c.discardedStates[j]||false;return h};c.discardedHash=function(i){var h=c.discardedHashes[i]||false;return h};c.recycleState=function(h){var i=c.getHashByState(h);if(c.discardedState(h)){delete c.discardedStates[i]}return true};if(c.emulated.hashChange){c.hashChangeInit=function(){c.checkerFunction=null;var k="",j,i,l,h;if(c.isInternetExplorer()){j="historyjs-iframe";i=b.createElement("iframe");i.setAttribute("id",j);i.style.display="none";b.body.appendChild(i);i.contentWindow.document.open();i.contentWindow.document.close();l="";h=false;c.checkerFunction=function(){if(h){return false}h=true;var m=c.getHash()||"",n=c.unescapeHash(i.contentWindow.document.location.hash)||"";if(m!==k){k=m;if(n!==m){l=n=m;i.contentWindow.document.open();i.contentWindow.document.close();i.contentWindow.document.location.hash=c.escapeHash(m)}c.Adapter.trigger(g,"hashchange")}else{if(n!==l){l=n;c.setHash(n,false)}}h=false;return true}}else{c.checkerFunction=function(){var m=c.getHash();if(m!==k){k=m;c.Adapter.trigger(g,"hashchange")}return true}}c.intervalList.push(d(c.checkerFunction,c.options.hashChangeInterval));return true};c.Adapter.onDomLoad(c.hashChangeInit)}if(c.emulated.pushState){c.onHashChange=function(n){var l=((n&&n.newURL)||b.location.href),h=c.getHashByUrl(l),i=null,j=null,k=null,m;if(c.isLastHash(h)){c.busy(false);return false}c.doubleCheckComplete();c.saveHash(h);if(h&&c.isTraditionalAnchor(h)){c.Adapter.trigger(g,"anchorchange");c.busy(false);return false}i=c.extractState(c.getFullUrl(h||b.location.href,false),true);if(c.isLastSavedState(i)){c.busy(false);return false}j=c.getHashByState(i);m=c.discardedState(i);if(m){if(c.getHashByIndex(-2)===c.getHashByState(m.forwardState)){c.back(false)}else{c.forward(false)}return false}c.pushState(i.data,i.title,i.url,false);return true};c.Adapter.bind(g,"hashchange",c.onHashChange);c.pushState=function(h,o,p,n){if(c.getHashByUrl(p)){throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).")}if(n!==false&&c.busy()){c.pushQueue({scope:c,callback:c.pushState,args:arguments,queue:n});return false}c.busy(true);var j=c.createStateObject(h,o,p),k=c.getHashByState(j),l=c.getState(false),m=c.getHashByState(l),i=c.getHash();c.storeState(j);c.expectedStateId=j.id;c.recycleState(j);c.setTitle(j);if(k===m){c.busy(false);return false}if(k!==i&&k!==c.getShortUrl(b.location.href)){c.setHash(k,false);return false}c.saveState(j);c.Adapter.trigger(g,"statechange");c.busy(false);return true};c.replaceState=function(h,m,n,l){if(c.getHashByUrl(n)){throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).")}if(l!==false&&c.busy()){c.pushQueue({scope:c,callback:c.replaceState,args:arguments,queue:l});return false}c.busy(true);var i=c.createStateObject(h,m,n),j=c.getState(false),k=c.getStateByIndex(-2);c.discardState(j,i,k);c.pushState(i.data,i.title,i.url,false);return true}}if(c.emulated.pushState){if(c.getHash()&&!c.emulated.hashChange){c.Adapter.onDomLoad(function(){c.Adapter.trigger(g,"hashchange")})}}};if(typeof c.init!=="undefined"){c.init()}})(window);(function(d,c){var a=d.History=d.History||{},b=d.jQuery;if(typeof a.Adapter!=="undefined"){throw new Error("History.js Adapter has already been loaded...")}a.Adapter={bind:function(f,g,e){b(f).bind(g,e)},trigger:function(e,f,g){b(e).trigger(f,g)},extractEventData:function(g,e,f){var h=(e&&e.originalEvent&&e.originalEvent[g])||(f&&f[g])||c;return h},onDomLoad:function(e){b(e)}};if(typeof a.init!=="undefined"){a.init()}})(window);(function(a){a.elementOverlay={texts:{title:"Please wait, loading.."},translations:[]};var b={init:function(c){var d=a.extend({overlay:'
    ',spinner:'
    {{contents}}
    ',title:a.elementOverlay.texts.title},c,true);return this.each(function(){var e=a(this);var h=this;var f=e.data("griffin-element-overlay");this.reposition=function(){var i=e.offset();if(!i){i={top:0,left:0}}f.overlay.css({position:"absolute",top:i.top,left:i.left,width:e.width()+"px",height:e.height()+"px"});f.spinner.css({zindex:100,position:"absolute",top:i.top,left:i.left,width:e.width()+"px",height:e.height()+"px"});a(f.spinner).css("padding-top",((e.height()/2)-20)+"px")};if(!f){f={settings:d,self:this};var g=e.attr("id")+Math.floor((Math.random()*100)+1)+"-overlay";f.overlay=d.overlay;if(f.overlay.substr(0,1)!=="#"){f.overlay=f.overlay.replace("{{id}}",g)}f.overlay=a(f.overlay);f.spinner=d.spinner;if(f.spinner.substr(0,1)!=="#"){f.spinner=f.spinner.replace("{{contents}}",d.title)}f.spinner=a(f.spinner);a("body").append(f.overlay);a("body").append(f.spinner);this.reposition();a(this).data("griffin-element-overlay",f)}else{b.show.apply(h)}return this})},destroy:function(){return this.each(function(){var c=a(this),d=c.data("griffin-element-overlay");if(!d){return}a(window).unbind(".elementOverlay");d.overlay.remove();d.spinner.remove();c.data("griffin-element-overlay",null);c.removeData("overlay")})},show:function(){var c=a(this),d=c.data("griffin-element-overlay");d.self.reposition();d.overlay.show();d.spinner.show();return this},hide:function(){var c=a(this),d=c.data("griffin-element-overlay");d.overlay.hide();d.spinner.hide();return this}};a.fn.elementOverlay=function(c){if(b[c]){return b[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return b.init.apply(this,arguments)}else{a.error("Method "+c+" does not exist on jQuery.elementOverlay")}}}})(jQuery);var UrlHelper={splitQuery:function(k){var g=[];var j={};var d=UrlHelper.cleanQuery(k);var c=d.split("&");for(var e=0;e=0){return b.substr(a+1)}return""}};var HistoryBase=(function ZHistoryBase(){var a=[];var c=window.History;var b=function(g){var i=UrlHelper.splitQuery(g);for(var h=0;hp){return}}l.data("lastrefreshdate",u);if(v.redirect){document.location=v.redirect;return}if(j!=undefined){if(j(v)){return}}var t=$(document.activeElement).attr("id");l.html(v);webSettings.runHandlers();try{$("#"+t+":last")[0].focus()}catch(s){}if(n.afterrefresh!=undefined){n.afterrefresh(l)}},async:i,complete:function(s,t){}})};var h=[];var g=function(i){if(jQuery.inArray(i,h)!=-1){return}h.push(i);ZetaHistory.registerHandler(i+"_",function(j,l){var m=j.substr(0,j.indexOf("_"));var k=controls.findByUniqueKey(m);k.each(function(){f($(this),{data:l})})})};var b=function(){var i=$(this);var j=i.attr("href");ZetaHistory.setQuery(j);return false};var a=function(){$("["+controls.uniqueKeyAttribute()+"]").each(function(k,j){var l=controls.uniqueKey(j);g(l,$(j))})};var e=function(i,l){if(l==undefined){l={}}var j=$(i).find(":input");var m=j.serializeArray();var k={};$.each(m,function(n,p){var o=p.name;if(p.value.toLowerCase()=="false"){if(k[o]==undefined){k[o]=p.value}}else{k[o]=p.value}});if(l.addEmptyCheckbox){$(i).find(":checkbox").each(function(){var n=$(this).attr("name");if(n!=undefined){n=n.toLowerCase();if(k[n]==undefined){k[n]=""}}})}return k};var d=function(i){if(typeof(i)=="string"){i=$(i);if(i.length==0){return null}i=$(i[0])}else{if(i.length==undefined){i=$(i)}}if(i.length>0){i=$(i[0])}else{return null}if(!i.is("[cp_uniquekey]")){i=i.parents("[cp_uniquekey]");if(i.length==0){return null}i=$(i[0])}return i};return{Init:function(){a()},Refresh:function(j,n){if(typeof(j)=="string"){if(j[0]=="#"){j="[id='"+j.substring(1)+"']"}j=$(j);if(j.length==0){return null}if(j.length>1){for(var m=0;m
    "+f+"
    ";$.fn.messageBox("Cчет на оплату",d,{width:732});$("#"+e).find("#btnPrint").click(function(){$("#"+e).find(".printable").print()})},"html")}};var zw_menu={menutimeout:null,currentitem:null,init:function(){var e=Constants.zw_Menu;var b=$("");var d=null;var c=null;$(e.ID).each(function(){d=$(this);d.comments(true,"CONTENT/Menu/"+e.parentitemid+"=").each(function(){b=$("");controls.get_expandcollapse(b,$(this),"")})});$("a["+e.itemid+"]").live("mouseover",function(a){zw_menu.itemOver(this);return false});$("a["+e.itemid+"]").live("mouseout",function(a){zw_menu.itemOut(this);return false});$("span["+e.itemid+"]").live("mouseover",function(a){zw_menu.itemOver(this);return false});$("span["+e.itemid+"]").live("mouseout",function(a){zw_menu.itemOut(this);return false});$("img["+e.itemid+"]").live("mouseover",function(a){zw_menu.itemOver(this);return false});$("img["+e.itemid+"]").live("mouseout",function(a){zw_menu.itemOut(this);return false})},itemOver:function(c){clearTimeout(zw_menu.menutimeout);c=$(c);var d=Constants.zw_Menu;var b=c.parents(d.ID);var e=null;if(c.attr(d.itemdepth)>1){e=$("["+d.itemid+"="+c.attr(d.parentitemid)+"]").attr(d.itemid)}if(zw_menu.currentitem!=e&&$("["+d.itemid+"="+zw_menu.currentitem+"]").attr(d.itemdepth)>=c.attr(d.itemdepth)){zw_menu.hideMenu(c.attr(d.itemdepth),c)}var a=b.comments(true,"CONTENT/Menu/"+d.parentitemid+"="+c.attr(d.itemid));if(a.length){controls.get_expandcollapse(c,a,"")}},itemOut:function(a){a=$(a);var b=Constants.zw_Menu;zw_menu.currentitem=a.attr(b.itemid);zw_menu.menutimeout=setTimeout(function(){zw_menu.hideMenu(a.attr(b.itemdepth)-1,a)},500)},hideMenu:function(c,d){var e=Constants.zw_Menu;var b=d.parents(e.ID);var f;var a;if(c==0){c=1}b.find("[state='expanded']["+e.itemdepth+"='"+c+"']").each(function(){f=$(this);a=b.comments(true,"CONTENT/Menu/"+e.parentitemid+"="+f.attr(e.itemid));if(a.length){controls.get_expandcollapse(f,a,"")}});zw_menu.currentitem=null}};var zw_catalogSearchHistory={url:{copyUrl:"/mvcget/ViewSearchHistory/AjaxViewSearchHistory?(0)=(1)&(2)=(3)&(4)=(5)&(6)=(7)&(8)=(9)"},controlsIDs:{viewSearchHistory:"#zw_viewCatalogHistory"},init:function(){var a=Constants.zw_CatalogSearchHistory;$("input["+a.viewarchive+"]").live("change",function(b){zw_catalogSearchHistory.changeViewArchiveState(this);return false})},changeViewArchiveState:function(c){c=$(c);var d=Constants.zw_CatalogSearchHistory;var a=zw_catalogSearchHistory.get_container(c);var g=a.attr(d.templateid);var e=a.attr(d.pagerowscount);var b=a.attr(d.currentlistpage);var f=a.attr(d.searchpage);var i=c.attr(d.viewarchive);if(i=="True"){i="False"}else{i="True"}c.attr(d.viewarchive,i);var h=zw_catalogSearchHistory.url.copyUrl.replace("(0)",d.templateid).replace("(1)",g).replace("(2)",d.pagerowscount).replace("(3)",e).replace("(4)",d.currentlistpage).replace("(5)",b).replace("(6)",d.searchpage).replace("(7)",f).replace("(8)",d.viewarchive).replace("(9)",i);a.load(h)},get_container:function(b){var a=b.parents(zw_catalogSearchHistory.controlsIDs.viewSearchHistory);return a}};var zw_cart=(function(){var e=Constants.zw_CartBase;var f=Constants.zw_ProductSingle;var g=function(C){C=$(C);return C.parents("*").andSelf().filter(Constants.zw_Cart.ID+","+Constants.zw_CartConfirm.ID)};var z=function(){ZetaControlRefresher.Refresh(Constants.zw_Cart.ID,{clearErrors:false,afterrefresh:c});A()};var A=function(){ZetaControlRefresher.Refresh(Constants.zw_CartMini.ID,{clearErrors:false});ZetaControlRefresher.Refresh(Constants.zw_Debt.ID,{clearErrors:false})};$(document).ready(function(){webSettings.set_handler(function(C){try{if(C==undefined){return}if((C._activeElement.name.indexOf("btnDeleteFromCart")!=-1)||(C._activeElement.name.indexOf("btnAgreeCart")!=-1)||(C._activeElement.name.indexOf("bSubmit")!=-1)||(C._activeElement.id.indexOf("changeContractorLink")!=-1)){z()}}catch(D){var E=1}})});var n=function(C){return g(C).find("[name='"+e.cart_save+"']")};var b=function(C){A();c(C)};var c=function(C){n(C).attr("disabled","disabled");B(g(C))};var x=function(E,C){E=$(E);var D=E.parents(Constants.zw_Cart.ID);var F=[];D.find("input[type='text']["+e.cart_rowid+"][changed='changed']").each(function(){var G=$(this);F.push({RowID:G.attr(e.cart_rowid),Quantity:G.val()})});if(F.length>0){ZetaControlRefresher.Refresh(D,{async:C,contentType:"json",data:{cart_save:F},url:MvcActions.CartController.Save(),afterrefresh:b})}return false};var j=function(C){var D=[];C.find("input[type='checkbox']["+e.cart_rowid+"]:checked").each(function(){var E=$(this);var G=E.attr(e.cart_rowid);var F=C.find("input[cart_quantity]["+e.cart_rowid+"='"+G+"']").val();D.push({RowID:G,Quantity:F})});return D};var v=function(E){E=$(E);var C=E.parents(Constants.zw_Cart.ID);var D=j(C);if(D){ZetaControlRefresher.Refresh(C,{url:MvcActions.CartController.Delete(),contentType:"json",data:{cart_delete:D},afterrefresh:b})}return false};var w=function(E){E=$(E);var C=E.parents(Constants.zw_Cart.ID);var D=j(C);if(D){ZetaControlRefresher.Refresh(C,{url:MvcActions.CartController.Reserve(),contentType:"json",data:{cart_reserve:D},afterrefresh:b})}return false};var h=function(C){var D={artID:C.attr("aid"),articleDescriptionID:C.attr("adid"),storeID:C.attr("sid"),storeType:C.attr("st")};if(C.attr("r")!=undefined){D.rest=parseFloat(C.attr("r").toString().replace(",","."))}else{D.rest=0}return D};var i=function(C){var D=h(C);var E=$(f.inputquantity_name+D.artID+"_"+D.articleDescriptionID+"_"+D.storeID);return E};var a=function(E){var C=E.parents("#gvSearchArticles").find(">tbody");var D=[];C.find(">tr[aid]").each(function(){var G=$(this);var F=G.find("#q");k(D,F,G)});o(D);return false};var k=function(F,H,E){var I;if(H.length==0){I=1}else{I=H.val()}if(!I){return false}var C="";var G=parseFloat(I);if(!G||G<=0){C+="В строке введено некорректное количество";$.fn.messageBox("Система заказов",C);return false}var D=h(E);if(G>D.rest&&D.storeType=="СправочникСсылка.Склады"){C+="В строке "+(E.index()+1)+" введено количество превышающее остаток на складе
    "}D.quantity=G;F.push({ProductID:D.artID,ProductDescriptionID:D.articleDescriptionID,StoreID:D.storeID,Quantity:D.quantity});return D};var o=function(C){var D=MvcActions.CartController.Add("");$.ajax({type:"POST",url:D,dataType:"text",traditional:true,contentType:"application/json; charset=utf-8",data:JSON.stringify(C),success:function(E){$.fn.messageBox("Система заказов",E);if(E=="Товар успешно добавлен в корзину."){$("#bEvent").click()}z()},error:function(E){alert("error")}});return true};var r=function(E,C){var D=[];k(D,E,C);return o(D)};var s=function(C){C=$(C);var D=i(C);r(D,C);return false};var p=function(C){C=$(C);var E=C.parents("[aid]:first");var D=E.find("#q");return r(D,E)};var t=function(C){$(C).attr("changed","changed");n(C).removeAttr("disabled","disabled")};var B=function(C){var D=C.find("[name='"+Constants.zw_CartBase.cart_delete+"']");var E=C.find("[name='"+Constants.zw_CartBase.cart_reserve+"']");if(C.find("input[type='checkbox']["+e.cart_rowid+"]:checked").length>0){D.removeAttr("disabled","disabled");E.removeAttr("disabled","disabled")}else{D.attr("disabled","disabled");E.attr("disabled","disabled")}};var y=function(E){E=$(E);var D=E.parents(Constants.zw_Cart.ID);var C=D.find("input[type='checkbox']["+e.cart_rowid+"]");if(E.is(":checked")){C.attr("checked","checked")}else{C.removeAttr("checked")}B(D)};var m=function(F){var E=g(F);x(F,false);var C=j(E);var D=$(Constants.zw_CartConfirm.ID);if(D.length>0){ZetaControlRefresher.Refresh(D,{data:{products:C},url:MvcActions.CartController.Confirm("true"),contentType:"json"});D.show();D.goTo()}else{ZetaControlRefresher.Refresh(E,{data:{products:C},url:MvcActions.CartController.Confirm("false"),contentType:"json"})}return false};var l=function(E){var D=g(E);var C=D.attr("cp_cartpage");if(C){document.location=C}return false};var d=function(D,E){D=$(D);var F=i(D);var C=parseFloat(F.val());if(!C){C=1}if(C==1&&!E){return}F.val(C+(E?1:-1))};var u=function(D){D=$(D);var C=D.attr("docId");var E=confirm("Скопировать заказ в корзину?");if(E){E=confirm("Добавлять позиции отсутствующие на складе?");var F=MvcActions.CartController.Copy(C,E);$.post(F,null,function(G){$.fn.messageBox("Журнал заказов",G,{});A()})}return false};$("."+f.addtocart_class).live("click",function(){return s(this)});$("."+f.quantityup_class).live("click",function(){d(this,true);return false});$("."+f.quantitydown_class).live("click",function(){d(this,false);return false});$("img.bCartAdd").live("click",function(){if($(this).attr("id")=="oldcart_addbyscopebutton"){return true}return p(this)});$("[id='oldcart_addbyscopebutton']").live("click",function(){return a($(this))});$("input[type='submit'][name='"+e.cart_save+"']").live("click",function(){return x(this)});$("input[type='submit'][name='"+e.cart_delete+"']").live("click",function(){return v(this)});$("input[type='submit'][name='"+e.cart_reserve+"']").live("click",function(){return w(this)});$("input[type='checkbox'][name='"+e.cart_selectAll+"']").live("click",function(){return y(this)});$("input[type='checkbox'][cart_rowid]").live("click",function(){return B(g(this))});$("input[type='checkbox'][cart_rowid*='']").live("click",function(){return B(g(this))});$("input[type='text']["+e.cart_rowid+"]").live("keypress",function(){return t(this)});$("input[type='submit'][name='"+e.cart_confirm+"']").live("click",function(){return m(this)});$("input[type='button'][name='"+e.cart_backtoedit+"']").live("click",function(){return l(this)});$("input[type='submit'][name='"+e.cart_createorderwithoutpayment+"']").live("click",function(){ZetaControlRefresher.Refresh(g(this),{method:MvcActions.zw_CartBase.Actions.CreateOrderWithoutPayment});return false});$("input[type='submit'][name='"+e.cart_createorderwithpayment+"']").live("click",function(){ZetaControlRefresher.Refresh(g(this),{method:MvcActions.zw_CartBase.Actions.CreateOrderWithPayment});return false});$("."+Constants.zw_OrdersBase.copytocart_class).live("click",function(C){u(this);return false});$("input[selector='"+Constants.zw_DeliveryType.deliverytypeSelector+"']").live("click",function(D){var C=$(this).controlRoot().parent().controlRoot();var G=$(this).attr(Constants.zw_DeliveryType.showCompanySelector)=="True";var F=$(this).attr(Constants.zw_DeliveryType.showCompanyAddressSelector)=="True";var E=$(this).attr(Constants.zw_DeliveryType.showClientAddressSelector)=="True";C.find(Constants.zw_DeliveryAddresses.ID+", "+Constants.zw_DeliveryTypeAddresses.ID+", "+Constants.zw_DeliveryTypeContractors.ID).hide().find("input[type='radio']").prop("checked",false);if(E){C.find(Constants.zw_DeliveryAddresses.ID).show()}if(G){C.find(Constants.zw_DeliveryTypeContractors.ID+"[for='"+$(this).val()+"']").show()}else{if(F){C.find(Constants.zw_DeliveryTypeAddresses.ID+"[for='"+$(this).val()+"']").show()}}});$("input[selector='"+Constants.zw_DeliveryTypeContractors.deliverytypecontractorsSelector+"']").live("click",function(D){var C=$(this).controlRoot().parent().controlRoot();C.find(Constants.zw_DeliveryTypeAddresses.ID).hide();C.find(Constants.zw_DeliveryTypeAddresses.ID+"[for='"+$(this).val()+"']").show()});$(document).ready(function(){var C=$(Constants.zw_Cart.ID);if(C.length>0){$(Constants.zw_CartConfirm.ID).hide()}$(Constants.zw_Cart.ID).each(function(){B($(this));n($(this)).attr("disabled","disabled")})});return{}})();var zw_popup=(function(){var c=[];var b=[];var g="[id='zw_popup']";var e="."+Constants.zw_Popup.PopupContentClass;var f="."+Constants.zw_Popup.PopupOverlayClass;var a=function(k){var n=$(k);n.hide();for(var m=0;m
    ").text(k).html()},function(n){var o=$(n);$("body").append(o);i(o)})};var j=function(m,l,n){m=$(m);if(l==undefined){l=""}if(n==undefined){n=""}var k=m.clone();var o=k.html();o=o.replace(Constants.zw_Popup.DynamicContentPlaceholder,l).replace(Constants.zw_Popup.DynamicHeaderPlaceholder,n);k.html(o);$("body").append(k);i(k)};$(document).keyup(function(k){if(k.keyCode==27){$(g).each(function(m,l){a(l)})}});$(".popup_open").live("click",function(){var k=$(this).attr("popupid");i($(g+"[popupid='"+k+"']"));return false});return{Close:function(k){a(k)},Show:function(k){i(k)},ShowDynamic:function(l,k,m){j(l,k,m)},Load:function(m,l,k){return d(m,l,k)},AddCloseHandler:function(k){b.push(k)},Center:function(k){h($(k))}}})();(function(a){a.fn.extend({zwTabs:function(){var b=function(l,m){var k=a("div[id='zw_tabcontainer'][index='"+l+"']");var h=k.attr("activeTabTitleClass");var i=k.attr("inactiveTabTitleClass");var j=k.find(".zwtab_tabtitles").find("li[id='tabheader"+l+"_"+m+"']");k.find(".zwtab_activetabclass").removeClass("zwtab_activetabclass").removeClass(h).addClass("zwtab_tabclass").addClass(i);j.removeClass("zwtab_tabclass").removeClass(i).addClass("zwtab_activetabclass").addClass(h);k.find(".zwtab_tabcontentactive").removeClass("zwtab_tabcontentactive").addClass("zwtab_tabcontent");var g=j.attr("id").replace("tabheader","tab");k.find(".zwtab_tabscontent").find("div[fortab='"+g+"']").removeClass("zwtab_tabcontent").addClass("zwtab_tabcontentactive")};var c=function(h,i){var g=h.attr("id").split("_").pop();f(i,g);b(i,g)};var e=function(){var g=document.location.hash;if(g.length>0&&g[0]=="#"){g=g.substr(1)}return g};var d=function(j){var g=e();var h=new RegExp("&?tab"+j+"_(\\d+)(&|$)");var i=g.match(h);if(i==null||i.length==0){return 1}return i[1]};var f=function(j,k){var h=e();var i=new RegExp("&?tab"+j+"_(\\d+)(&|$)");h=h.replace(i,"");var g="tab"+j+"_"+k;if(h.length>0){g+="&"}h=g+h;if(e()!=h){document.location.replace("#"+h)}};return this.each(function(){var h=a(this);var i=h.attr("index");var g=d(i);b(i,g);var j=h.find(".zwtab_tabtitles").find("li");j.find("a").click(function(){c(a(this).parents("li"),i);return false});j.click(function(){c(a(this),i);return false})})}})})(jQuery);var zw_currencyselect={init:function(){},set_change:function(c){c=$(c);var a=$(Constants.zw_CurrencySelect.ID);var b=c[0].href.split("/").removeEmpty().pop();var d=MvcActions.CurrencyController.Change(b);d=d+"&"+AjaxHelper.parseControlPropertiesToUrl(a);a.load(d);window.location.reload()}};var zw_externalcatalog={StringToType:function(a){if(a=="car"){return 1}else{return 2}},init:function(){ZetaHistory.registerHandler("ec_manufacturer",zw_externalcatalog.UpdateManufecturerDependentControls);ZetaHistory.registerHandler("ec_modelid",zw_externalcatalog.UpdateModelDependentControls);ZetaHistory.registerHandler("ec_typeid",zw_externalcatalog.UpdateTypeIDDependentControls);$("a[ec_externalcatalogmodelslink]").live("click",function(a){return zw_externalcatalog.SetManufacturer(this)});$("a[ec_externalcatalogtypeslink]").live("click",function(a){return zw_externalcatalog.SetModel(this)});$('a[href*="/'+MvcActions.ExternalCatalogController.Name+"/"+MvcActions.ExternalCatalogController.Actions.Tree+'/"]').live("click",function(a){if($(this).attr(Constants.zw_ExternalCatalogTree.depth)){return true}return zw_externalcatalog.SetTypeID(this)});$('a[href*="/'+MvcActions.ExternalCatalogController.Name+"/"+MvcActions.ExternalCatalogController.Actions.Tree+'/"]['+Constants.zw_ExternalCatalogTree.depth+"]").live("click",function(a){return zw_externalcatalog.get_toggle(this)})},SetParametersOrExternalRedirect:function(a,b){if(zw_externalcatalog.ExternalLink(a)){return true}ZetaHistory.setParameters(b);return false},SetManufacturer:function(a){a=$(a);return zw_externalcatalog.SetParametersOrExternalRedirect(a,{ec_manufacturer:a.attr("ec_manufacturer"),ec_type:a.attr("ec_type"),ec_modelid:"",ec_typeid:""})},SetModel:function(a){a=$(a);return zw_externalcatalog.SetParametersOrExternalRedirect(a,{ec_modelid:a.attr("ec_modelid"),ec_typeid:""})},SetTypeID:function(a){var b=$(a)[0].href.split("/").removeEmpty();var c=b.pop();return zw_externalcatalog.SetParametersOrExternalRedirect(a,{ec_typeid:c})},UpdateManufecturerDependentControls:function(){if(!ZetaHistory.getCurrentParameters()["ec_manufacturer"]){return}ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogSelectedInfo.ID);ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogModels.ID);$(Constants.zw_ExternalCatalogTypes.ID).html("");$(Constants.zw_ExternalCatalogTree.ID).html("");$(Constants.zw_ExternalCatalogModels.ID).goTo()},UpdateModelDependentControls:function(){if(!ZetaHistory.getCurrentParameters()["ec_modelid"]){return}ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogSelectedInfo.ID);ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogTypes.ID);$(Constants.zw_ExternalCatalogTree.ID).html("");$(Constants.zw_ExternalCatalogTypes.ID).goTo()},UpdateTypeIDDependentControls:function(){if(!ZetaHistory.getCurrentParameters()["ec_typeid"]){return}ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogSelectedInfo.ID);ZetaControlRefresher.Refresh(Constants.zw_ExternalCatalogTree.ID);$(Constants.zw_ExternalCatalogTree.ID).goTo()},ExternalLink:function(a){if(webUrl.GetPageName($(a).attr("href"))!=webUrl.GetCurrentPageName()){return true}return false},get_toggle:function(d){d=$(d);var b=zw_externalcatalog.get_container(d);var e=Constants.zw_ExternalCatalogTree;var f=d[0].href.split("/").removeEmpty().pop();var c=d.attr(e.depth);var g=MvcActions.ExternalCatalogController.Tree(f,c);g=g+"&"+AjaxHelper.parseControlPropertiesToUrl(b);var a=b.comments(true,"CONTENT/ExternalCatalogTree/"+e.expandTreeID+"="+f);controls.get_expandcollapse(d,a,g);return false},get_container:function(b){var a=b.parents(Constants.zw_ExternalCatalogTree.ID);if(!a.length){a=b.parents(Constants.zw_ExternalCatalogTypes.ID)}if(!a.length){a=b.parents(Constants.zw_ExternalCatalogModels.ID)}if(!a.length){a=b.parents(Constants.zw_ExternalCatalogManufacturers.ID)}return a}};var zw_login2=(function(){var a=function(e){e=$(e);return e.parents(Constants.zw_Login2.ID)};var b=function(f){var e=a(f);if(!zw_validation.isValid(e)){return false}ZetaControlRefresher.Refresh(e,{method:MvcActions.zw_Login2.Actions.HandleLogin});return false};var d=function(f){var e=a(f);ZetaControlRefresher.Refresh(e,{method:MvcActions.zw_Login2.Actions.HandleLogout});return false};$(document).ready(function(){var e=$(document.forms[0]);e.submit(function(f){if(c!=undefined){b(c);c=undefined;return false}return true})});var c=undefined;$("[name='"+Constants.zw_Login2.login_loginbutton+"']").live("click",function(){c=this});$("[name='"+Constants.zw_Login2.login_logoutbutton+"']").live("click",function(){return d(this)});$("#"+Constants.zw_Login2.login_logoutlink+"").live("click",function(){return d(this)});return{}}());var zw_documentWriteWrapper=(function(){var d=null;var b=function(){if(d!=null){d.buffer="";return d}var e=document;d={write:e.write,open:e.open,close:e.close,buffer:""};e.write=function(f){d.buffer+=f};e.open=e.close=function(){};return d};var a=function(){d.buffer=""};var c=function(e){b();$("
    ").html(e);if(d.buffer!=""){e=e.replace(//,d.buffer);a()}return e};return{PreserveHandlers:function(){return b()},CleanBuffer:function(){a()},ProcessHtml:function(e){return c(e)}}})();function Zw_Banner(g){var c=$(g);var d=c.attr("cp_displaytime")*1000;var b=function(){zw_documentWriteWrapper.PreserveHandlers();var h=c.clone();c.before(h);c.css({opacity:0});h.css({position:"absolute"});h.show();c=h};var f=function(){setTimeout(function(){e()},d)};b();f();var a=function(h,i){h.fadeOut("slow",function(){h.remove()});i.fadeIn("slow")};var e=function(){var h=c.clone();h.css({position:"absolute"});h.css("z-index","10");h.hide();c.after(h);var i=c.find("#preloadedBanner [b_bannerguid]").attr("b_bannerguid");if(i==undefined){return}ZetaControlRefresher.Refresh(h,{url:MvcActions.BannerController.AjaxBanner2(i),callback:function(j){j=zw_documentWriteWrapper.ProcessHtml(j);if(j!=""){h.html(j);a(c,h);c=h;f()}return true}})};return{}}var zw_banners=(function(){var a=function(){$("[id='zw_banners']").not("[initialized]").each(function(){var d=$(this);d.attr("initialized","1");var c=new Zw_Banner(this)})};var b=function(){var c=$(this).attr("b_bannerguid");$.ajax({url:MvcActions.BannerController.ReportClick(c),async:false})};$("#zw_banners a[b_bannerguid]").live("click",b);return{init:function(){a()}}})();function ZetaGalleryPopup(l){var i=null;var c=l;var d=0;var g=l.attr("cp_IsCycled")=="True";var f=parseInt(l.attr(Constants.zw_ImageGalleryThumbnails.ImagesCountAttribute));var h=function(m){d=m;ZetaControlRefresher.Refresh(c,{url:MvcActions.ImageGalleryController.RenderPopupForImage(m),callback:function(n){var o=$(n);$("body").append(o);zw_popup.AddCloseHandler(b);o.find("["+Constants.zw_ImageGalleryPopup.ImageAttribute+"]").load(function(){zw_popup.Center(o);zw_popup.Show(o);a(o);if(i!=null){zw_popup.Close(i);i.remove()}i=o});return true}})};var a=function(m){m.find("["+Constants.zw_Popup.PopupCloseClass+"]").bind("click",function(){self.closePopup()});m.find("["+Constants.zw_Popup.PopupCloseClass+"*='']").bind("click",function(){self.closePopup()});if(g||(d1)){m.find("["+Constants.zw_ImageGalleryPreviewBase.PrevButtonAttribute+"]").bind("click",function(){k();return false})}m.find("["+Constants.zw_ImageGalleryPopup.ImageAttribute+"]").bind("click",function(n){e(n,$(this))})};var b=function(m){i.hide()};var j=function(){if(d1){h(d-1)}else{if(g){h(f)}}};var e=function(n,m){m=$(m);var p=n.offsetX?(n.offsetX):n.pageX-$(m).offset().left;var o=m.width();if(p>o/2){j()}else{k()}};return{popup:function(m){return h(m)}}}var ZetaGalleryPreview=function(a){this._dom=a;this._spanImageIndex=this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.ImageNumberPlaceholderAttribute+"]");this._spanImagesCount=this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.ImagesCountPlaceholderAttribute+"]");this._image=this._dom.find("["+Constants.zw_ImageGalleryPreview.PreviewImageAttribute+"]");this._images=this._dom.find("["+Constants.zw_ImageGalleryThumbnails.ImageIdAttribute+"]");this._imagesCount=this._images.length;this._currentImageIndex=1;this._groupId=this._dom.attr(Constants.zw_ImageGalleryThumbnails.ImageGroupIdAttribute)};ZetaGalleryPreview.prototype={scrollTo:function(a){this._currentImageIndex=a;this.repaint()},init:function(){var a=this;this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.PrevButtonAttribute+"]").live("click",function(){a.prev()});this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.NextButtonAttribute+"]").live("click",function(){a.next()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PopupButtonAttribute+"]").live("click",function(){a.popup()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PlayButtonAttribute+"]").live("click",function(){a.play()});this._dom.find("["+Constants.zw_ImageGalleryPreview.FullScreenButtonAttribute+"]").live("click",function(){a.fullscreen()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PreviewImageAttribute+"]").live("click",function(){a.popup()});this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.PrevButtonAttribute+"*='']").live("click",function(){a.prev()});this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.NextButtonAttribute+"*='']").live("click",function(){a.next()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PopupButtonAttribute+"*='']").live("click",function(){a.popup()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PlayButtonAttribute+"*='']").live("click",function(){a.play()});this._dom.find("["+Constants.zw_ImageGalleryPreview.FullScreenButtonAttribute+"*='']").live("click",function(){a.fullscreen()});this._dom.find("["+Constants.zw_ImageGalleryPreview.PreviewImageAttribute+"*='']").live("click",function(){a.popup()})},prev:function(){this.move(-1)},next:function(){this.move(1)},move:function(a){var b=this._currentImageIndex+a;if(b>this._imagesCount){b=1}if(b<=0){b=this._imagesCount}this.moveTo(b)},moveTo:function(a){this._currentImageIndex=a;var b=zw_imageGallery.thumbnails[this._groupId];if(b!=undefined){jQuery.each(b,function(c){b[c].scrollTo(a)})}this.repaint()},repaint:function(){ZetaControlRefresher.Refresh(this._dom,{url:MvcActions.ImageGalleryController.RenderPreviewForImage(this._currentImageIndex)})},popup:function(){var a=new ZetaGalleryPopup(this._dom);a.popup(this._currentImageIndex)},fullscreen:function(){alert("Fullscreen doesnt work yet")},play:function(){alert("play doesnt work yet")}};var ZetaGalleryThumb=function(a){this._dom=a;this._container=this._dom.find("."+Constants.zw_ImageGalleryThumbnails.ThumbnailsContainerClass);this._carousel=(this._dom.attr(Constants.zw_ImageGalleryThumbnails.OneLineAttribute)=="1");this._horizontalLine=(this._dom.attr(Constants.zw_ImageGalleryThumbnails.HorizontaLineAttribute)=="1");this._groupId=this._dom.attr(Constants.zw_ImageGalleryThumbnails.ImageGroupIdAttribute);this._images=this._dom.find("["+Constants.zw_ImageGalleryThumbnails.ImageLinkAttribute+"]");this._imagesCount=this._images.length;this._currentImageIndex=1};ZetaGalleryThumb.prototype={scrollTo:function(c){this._currentImageIndex=c;var a=this._images[c-1];var b=$(a).position();this._container.css("top",-b.top+"px");this._container.css("left",-b.left+"px")},init:function(){var c=this;this._dom.find("["+Constants.zw_ImageGalleryThumbnails.ImageLinkAttribute+"]").bind("click",function(){c.popup($(this));return false});if(!this._carousel){return}var a=this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.PrevButtonAttribute+"]");var b=this._dom.find("["+Constants.zw_ImageGalleryPreviewBase.NextButtonAttribute+"]");a.bind("click",function(){c.moveLeft();return false});b.bind("click",function(){c.moveRight();return false})},moveLeft:function(){this.move(-1)},moveRight:function(){this.move(+1)},move:function(a){var b=this._currentImageIndex+a;if(b>this._imagesCount){b=this._imagesCount}if(b<=0){b=1}this.scrollTo(b)},popup:function(a){var c=a.attr(Constants.zw_ImageGalleryThumbnails.ImageLinkAttribute);var d=parseInt(a.attr(Constants.zw_ImageGalleryThumbnails.ImageIndexAttribute),10);if(this.raiseScroll(d)){return false}var b=new ZetaGalleryPopup(this._dom);b.popup(d);return false},raiseScroll:function(a){var b=zw_imageGallery.previews();b=b[this._groupId];if(b!=undefined){jQuery.each(b,function(c){b[c].scrollTo(a)});return true}return false}};var zw_imageGallery=(function(){var b=function(){$(Constants.zw_ImageGalleryThumbnails.ID).not("[initialized]").each(function(){if(!controls.isInitialized(this)){$(this).attr("initialized",1);d(this)}});$(Constants.zw_ImageGalleryPreview.ID).not("[initialized]").each(function(){if(!controls.isInitialized(this)){$(this).attr("initialized",1);c(this)}})};var e=[];var f=[];var d=function(g){g=$(g);var h=new ZetaGalleryThumb(g);h.init();a(f,h)};var c=function(g){g=$(g);var h=new ZetaGalleryPreview(g);h.init();a(e,h)};var a=function(g,h){var i=h._groupId;var j=g[i];if(j==undefined){j=[];g[i]=j}j.push(h)};webSettings.subscribeToDocumentReady(b);return{previews:function(){return e},thumbnails:function(){return f}}})();var zw_chatWithManager={url:{copyUrl:"/mvcget/UserMessages/AjaxUserMessages?(0)=(1)&(2)=(3)"},controlsIDs:{userMessages:"#zw_chatWithManager"},init:function(){var a=Constants.zw_ChatWithManager;$("input["+a.sendMessageButton+"]").live("onclick",function(b){zw_chatWithManager.sendMessage(this);return false})},sendMessage:function(b){b=$(b);var c=Constants.zw_ChatWithManager;var a=zw_chatWithManager.get_container(b);var e=a.attr(c.templateid);var d=b.attr(c.messageText);b.attr("value","111");var f=zw_chatWithManager.url.copyUrl.replace("(0)",c.templateid).replace("(1)",e).replace("(2)",c.messageText).replace("(3)",d);a.load(f)},get_container:function(b){var a=b.parents(zw_chatWithManager.controlsIDs.userMessages);return a}};var zw_CatalogEngineSearch=(function CatalogEngineSearch(){var a=function(c){c=$(c);var b=c.parents(Constants.zw_ExternalCatalogEnginesSearch.ID);ZetaControlRefresher.SubmitControl(b)};$(Constants.zw_ExternalCatalogEnginesSearch.ID+" #"+Constants.zw_ExternalCatalogEnginesSearch.FilterButtonId).live("click",function(b){a(this);return false});return{}})();Array.prototype.unique=function(){var c={},a,b=this.length,d=[];for(a=0;a<_questionsToCheck.length;i++){_questionVisibility($(_questionsToCheck[i]),checkManages)}_questionsToCheck=[]};var _formVisibility=function(checkManages){_questionsVisibility(checkManages);_groupVisibility()};var _questionIsConditionByLinks=function(question){var linksAttr=question.attr("links");if(linksAttr){var result=null;var func=question.attr("func");if(func){result=true}else{result=false}$(Constants.zw_Forms.ID).find(linksAttr).each(function(){var isOn=_questionIsConditionByQuestion($(this));if(func){if(!isOn){result=false;return false}}else{if(isOn){result=true;return false}}});return result}return true};var _questionIsConditionByQuestion=function(question){if(question.is(":visible")){if(question.is(":checkbox")){return question.is(":checked")}if(question.is(":text")){return question.val().length>0}if(question.is("select")){return question.val().length>0}if(question.is("option")){return question.attr("selected")}if(question.is("span")){return question.text().length>0}}return false};var _questiontNullOrDefault=function(question){var def=question.attr("def");if(question.is("input")){if(question.is(":checkbox")){question.attr("checked",def=="true")}if(question.is(":text")){question.val(def==undefined?"":def)}}if(question.is("select")){question.val(def==undefined?"":def)}};var _printHandler=function(){var button=$(this);var text=_textPopup(button);_showPopup(button,text);return false};var _submitHandler=function(){var button=$(this);if(!zw_validation.isValid(Constants.zw_Forms.ID)){return false}var text=escape(_textPopup(button));var control=$(button).parents(Constants.zw_Forms.ID);ZetaControlRefresher.Refresh(control,{url:MvcActions.FormsController.SubmitForm(),data:{message:text},parseInputs:true});return false};var _showPopup=function(button,text){var content="
    "+text+"
    ";var popup=$(button).controlRoot().find(Constants.zw_Popup.ID);zw_popup.ShowDynamic(popup,content,"Распечатка анкеты")};var _textPopup=function(button){var control=$(button).parents(Constants.zw_Forms.ID);var result="";control.find("span[groupid]:visible").each(function(){var group=$(this);var groupName=group.text();var groupId=group.attr("groupid");result+="
    "+groupName+"
    ";var question=null;control.find("[fromgroupid='"+groupId+"']:visible").each(function(){question=$(this);var questionId=question.attr("id");var questionName=control.find("label[for='"+questionId+"']");var questionText=questionName.text();var questionValue=_questionValue(question);if(questionValue){result+="
       "+questionText+" "+questionValue+"
    "}})});return result};var _questionValue=function(input){input=$(input);if(!input.is(":visible")){return null}var val=null;if(input.is(":checkbox")){val=input.is(":checked")?"Да":"Нет"}else{if(input.is("span")){val=input.text()}else{val=input.val()}}if(val){val=""+val+""}return val};var _visibilityHandler=function(){_questionsToCheck=$($(this).attr("manages"));_formVisibility(true)};$("input[type='checkbox'][question]").live("click",_visibilityHandler);$("select[question]").live("change",_visibilityHandler);$("input[type='text'][question]").live("keyup",_visibilityHandler);$("#zw_printform").live("click",_printHandler);$("#zwforms_submit").live("click",_submitHandler);$(document).ready(function(){_questionsToCheck=$(Constants.zw_Forms.ID).find("[question][links]");_formVisibility(false)})})();function showhidequestion(a){checkManages(a);if(a.is("select")){a.find("option").each(checkManagesHandler)}$(a.attr("manages")).parents(".siteForms").each(function(){var b=$(this).find("table").length;var c=$(this).find("table.siteFormsHide").length;if(b==c){$(this).removeClass("siteFormsShow").addClass("siteFormsHide")}else{$(this).removeClass("siteFormsHide").addClass("siteFormsShow")}})}function checkManages(question){if(question.attr("manages")){var managesQuestions=question.attr("manages").split(", ");for(var i=0;i1){g=a[1]}var d=checkIsOnByID(a[0],g);if(b){if(!d){return false}}else{if(d){return true}}}if(b){return true}else{return false}}return true}function checkIsOnByID(c,e){var a=false;var b=$("#"+c);var d=null;if(e!=null){d=$("#"+e)}return checkIsOnByQuestion(b,d)}function checkIsOnByQuestion(a,b){if(a.is(":checkbox")){return a.is(":checked")}if(a.is(":text")){return a.val().length>0}if(a.is("select")){if(b==null){return a.val().length>0}else{return b.attr("selected")}}if(a.is("span")){return a.text().length>0}return false}function getEventName(a){if(a.is("input")){if(a.is(":checkbox")){return"click"}if(a.is(":text")){return"keyup"}}if(a.is("select")){return"change"}return"change"}function setNullOrDefault(b){var a=b.attr("def");if(b.is("input")){if(b.is(":checkbox")){b.attr("checked",a=="true")}if(b.is(":text")){b.val(a==undefined?"":a)}}if(b.is("select")){b.val(a==undefined?"":a)}}function printZwForm(a){var b=getFormPrintText3(a);printFormCommon2(a,b);return false}function printInit(){$("#btnPrint2").live("click",function(){$(this).parents(Constants.zw_Popup.ID).find(".printable").print()})}function printFormCommon2(a,d){var b="
    "+d+"
    ";var c=$(a).controlRoot().find(Constants.zw_Popup.ID);zw_popup.ShowDynamic(c,b,"Распечатка анкеты")}function printForm(a){var b=getFormPrintText2(a);return printFormCommon(b)}function printFormCommon(c){var b=("PaymentDiv-"+(new Date()).getTime());var a="
    "+c+"
    ";$.fn.messageBox("Распечатка анкеты",a,{width:750,contentAlignment:"left"});$("#"+b).find("#btnPrint").click(function(){$("#"+b).find(".printable").print()})}function submitZwForm(a){if(!zw_validation.isValid(Constants.zw_Forms.ID)){return false}var c=getFormPrintText3(a);var b=$(a).parents(Constants.zw_Forms.ID);ZetaControlRefresher.Refresh(b,{url:MvcActions.FormsController.SubmitForm(),data:{message:c},parseInputs:true});return false}function getFormPrintText3(a){var b="";$(a).parents(Constants.zw_Forms.ID).find("span[zw_siteformgroup]").each(function(){var c=$(this);var d=c.find("[groupid]").text();b+="
    "+d+"
    ";$(this).find("[questionid]").each(function(){var h=$(this).text();var g=$(this).attr("questionid");var e=c.find("#"+g);var f=replaceFormInputs(e);if(f){b+="
       "+h+" "+f+"
    "}})});return b}function getFormPrintText2(a){var d="";var c=null;var e=null;var b=null;var f=null;$(a).parents("div[form='form']").find("div:first").find("div#head").each(function(){c=$(this);d+="
    "+c.text()+"
    ";c.next().find("table").each(function(){f=null;e=$(this);b=e.find("td");f=replaceFormInputs($(b[1]).children());if(f){d+="
       "+$(b[0]).text()+" "+f+"
    "}})});return d}function getFormPrintText(a){return getFormPrintText2(a)}function replaceFormInputs(a){a=$(a);if(!a.is(":visible")){return null}var b=null;if(a.is(":checkbox")){b=a.is(":checked")?"Да":"Нет"}else{if(a.is("span")){b=a.text()}else{b=a.val()}}if(b){b=""+b+""}return b}function formatInputCurrency(a){$(a).val($.fn.formatMoney($(a).val()))}function getQuestionValue(a){var d="";if(a.is("span")){d=a.text()}if(a.is(":checkbox")){return a.is(":checked")}if(a.is(":text")||a.is("select")){d=a.val()}var b=d.replace(/[^0-9^a-z^A-Z^а-я^А-Я,\.-]/g,"").replace(/[,\.]/,".");var c=parseFloat(b);if(b==c){return c}else{return d}}jQuery.fn.print=function(){if(this.size()>1){this.eq(0).print();return}else{if(!this.size()){return}}var e=("printer-"+(new Date()).getTime());var a=$("