/* Конструктор Шкафа-купе v1.2

 * by IonDen
 * v3.3.3
 * 27.07.2010
 * rev. 70
 * depends on jQuery 1.4
 * UTF-8
 */

$(document).ready(function(){
	//костыль, т.к. все функции определены внутри $(document).ready()
	$('#cheatlink').click(function(fake){
		fake.preventDefault();
		aa();
		$("#hot_link,#hot_link2").attr("value",f);
	});
	
	
	
	perCent = 0.75;function ra(){
	$.ajax({type:"POST",url:"http://sunboat.ru/view/link.php",data:"link="+f,success:function(b){
		$("#saveLink").attr("value",b);
		$("#hot_link, .hot_link").attr("value",b);
		$("#saveLink").css("display","inline-block");
		/*$("#save_btn_text > span").css("display","none");/* alert(b);*/
		/*
		var offset = $("#link_to_sh").offset();
		$("#link_div").css("left", offset.left + "px");
		$("#link_div").css("top", offset.top + "px");
		*/
		$("#link_div").css("display", "block");

}})}function L(){for(var b=0,d=0,g=0,h=a.sekt+1;h<=9;h++){$("#sekt_"+h).hide();$("#sw_"+h).hide()}for(h=1;h<=a.sekt;h++){$("#sekt_"+h).show();$("#sw_"+h).show();if(a["fixed_"+h]===1){d+=1;b+=a["sekt_"+h]}g=Math.floor((a.width-b)/(a.sekt-d))}for(h=1;h<=a.sekt;h++){if(a["fixed_"+h]===0)a["sekt_"+h]=g;if(a["sekt_"+h]<35)a["sekt_"+h]=35;
$("#sekt_"+h).width(Math.ceil(a["sekt_"+h]*1.42));$("#sw_"+h).width(Math.ceil(a["sekt_"+h]*1.42))}b=0;for(h=1;h<=a.sekt;h++)b+=parseInt(a["sekt_"+h]);if(a.width<b)a.width=b;else if(a.width>b)a.width=b;h=Math.floor(a.width*1.42);$("#f1").width(-1+h);$("#c1").width(4+h);$("#bw1").width(3+h);$("#rightwall").css("left",61+h);$("#size_height").attr("value",a.height);$("#size_width").attr("value",a.width);$("#size_depth").attr("value",a.depth);$("#sekt_num").attr("value",a.sekt);q=Math.floor(a.width*1.39);
$("#slideBar").css("left",q);$("#slidePol").width(q)}function t(b,d){if(b==="switch_floor")if(d===1){$("#floor").removeClass("no_floor");$("#floor").addClass("has_floor");a.has_floor=1}else{$("#floor").removeClass("has_floor");$("#floor").addClass("no_floor");a.has_floor=0}if(b==="switch_ceil")if(d===1){$("#ceil").removeClass("no_ceil");$("#ceil").addClass("has_ceil");a.has_ceil=1}else{$("#ceil").removeClass("has_ceil");$("#ceil").addClass("no_ceil");a.has_ceil=0}if(b==="switch_leftWall")if(d===1){$("#leftwall").removeClass("no_left_wall");
$("#leftwall").addClass("has_left_wall");a.has_left_wall=1}else{$("#leftwall").removeClass("has_left_wall");$("#leftwall").addClass("no_left_wall");a.has_left_wall=0}if(b==="switch_rightWall")if(d===1){$("#rightwall").removeClass("no_right_wall");$("#rightwall").addClass("has_right_wall");a.has_right_wall=1}else{$("#rightwall").removeClass("has_right_wall");$("#rightwall").addClass("no_right_wall");a.has_right_wall=0}if(b==="switch_backWall")if(d===1){$("#backwall").removeClass("no_back_wall");$("#backwall").addClass("has_back_wall");
a.has_back_wall=1}else{$("#backwall").removeClass("has_back_wall");$("#backwall").addClass("no_back_wall");a.has_back_wall=0}if(b==="switch_doors_4"){if(d===0)a.doors=2;else{$("#backwall").removeClass("has_back_wall");a.doors=4}r()}if(b==="0"){if(d===0)a.doors=3;else{$("#backwall").removeClass("has_back_wall");a.doors=6}r()}if(b==="switch_doors_8"){if(d===0)a.doors=4;else{$("#backwall").removeClass("has_back_wall");a.doors=8}r()}if(b.substr(0,3)==="fix"){var g=b.substr(4);a["fixed_"+g]=d===0?0:1;
L();Q()}if(b.substr(0,4)==="vesh"){g=b.substr(5);a["content_"+g]=d===0?0:d===1?1:2;R(g)}M();$("#"+b+" a").removeClass("selected");$("#"+b+" a:eq("+d+")").addClass("selected")}function w(){if(n==="size_height"){if(i<45)i=45;else if(i>275)i=275;a.height=i}if(n==="size_width"){if(i<35)i=35;else if(i>450)i=450;a.width=i}if(n==="size_depth"){if(i<30)i=30;else if(i>120)i=120;a.depth=i}if(n==="sekt_num"){for(var b=0,d=1;d<=a.sekt;d++)b+=parseInt(a["sekt_"+d]);b=450-b;G=Math.floor(b/35);G+=a.sekt;if(G>9)G=
9;if(i<2)i=2;else if(i>G)i=G;a.sekt=i;S()}d=n.substr(0,3);b=n.slice(9);if(d==="skt"){a["sekt_"+b]=i;var g=0;for(d=1;d<=a.sekt;d++)g+=a["sekt_"+d];if(g>450)i-=g-450;if(i<36)i=35;a["fixed_"+b]=1;$("#fix_"+b+" a").removeClass("selected");$("#fix_"+b+" a:eq(1)").addClass("selected")}d=0;d=n.substr(0,4);b=n.slice(9);if(d==="polk"){d=b;g=parseInt(a["polk_"+d]);g=parseInt(a["box_"+d]);if(i>parseInt(12-g))i=12-g;a["polk_"+b]=i;R(d)}d=n.substr(0,3);b=n.slice(8);if(d==="box"){d=b;g=parseInt(a["polk_"+d]);parseInt(a["box_"+
d]);g=Math.floor(g-6);if(g<0)g=0;if(i>6-g)i=6-g;a["box_"+b]=i;R(d)}$("#"+n).attr("value",i);L()}function S(){if(a.sekt===2){$("table.swDoors div.switch").hide();$("#switch_doors_4").show();a.doors=2;r()}if(a.sekt===3){$("table.swDoors div.switch").hide();$("#switch_doors_3").show();a.doors=3;r()}if(a.sekt===4){$("table.swDoors div.switch").hide();$("#switch_doors_4").show();a.doors=2;r()}if(a.sekt===5){$("table.swDoors div.switch").hide();$("#switch_doors_5").show();a.doors=5;r()}if(a.sekt===6){$("table.swDoors div.switch").hide();
$("#switch_doors_6").show();a.doors=3;r()}if(a.sekt===7){$("table.swDoors div.switch").hide();$("#switch_doors_7").show();a.doors=7;r()}if(a.sekt===8){$("table.swDoors div.switch").hide();$("#switch_doors_8").show();a.doors=4;r()}if(a.sekt===9){$("table.swDoors div.switch").hide();$("#switch_doors_9").show();a.doors=3;r()}$("div.sk").removeClass("sk_off");for(var b=a.sekt+1;b<=9;b++)$("#sk_"+b).addClass("sk_off")}function r(){$("div.door").addClass("door_off");for(var b=1;b<=a.doors;b++)$("#door_"+
b).removeClass("door_off")}function Q(){for(var b=1;b<=9;b++)$("#skt_size_"+b).attr("value",a["sekt_"+b]);M()}function H(){if(T.indexOf(i[0])!==-1||T.indexOf(i[1])!==-1||T.indexOf(i[2])!==-1){i=1;$("#"+n).attr("value",i)}}function R(b){$("#sekt_"+b).html("");for(var d=254-22*a["box_"+b],g=Math.floor(d/(a["polk_"+b]+1)),h=0,l=1;l<=a["polk_"+b];l++){$("#sekt_"+b).append('<div class="polk"><b style="height:'+g+'px"></b></div>');h+=g}$("#sekt_"+b).append('<div class="empty" style="height:'+(g+d-(h+g))+
'px"></div>');for(l=1;l<=a["box_"+b];l++)$("#sekt_"+b).append('<div class="box"><b></b></div>');a["box_"+b]===0&&$("#sekt_"+b+" .empty").css("background","none");if(parseInt(a["content_"+b])===1)$("#sekt_"+b).append('<div class="vesh v1"></div>');else parseInt(a["content_"+b])===2&&$("#sekt_"+b).append('<div class="vesh v2"></div>');M()}function U(){$("#pop_menu").remove()}function aa(){f=window.location.href+"?";var b=window.location.href.indexOf("?");f=f.slice(0,b)+"?";f+=a.height+":";f+=a.width+
":";f+=a.depth+":";f+=a.sekt+":";f+=a.doors+":";f+=a.has_floor+":";f+=a.has_ceil+":";f+=a.has_left_wall+":";f+=a.has_right_wall+":";f+=a.has_back_wall+":";f+=a.sekt_1+":";f+=a.sekt_2+":";f+=a.sekt_3+":";f+=a.sekt_4+":";f+=a.sekt_5+":";f+=a.sekt_6+":";f+=a.sekt_7+":";f+=a.sekt_8+":";f+=a.sekt_9+":";f+=a.polk_1+":";f+=a.polk_2+":";f+=a.polk_3+":";f+=a.polk_4+":";f+=a.polk_5+":";f+=a.polk_6+":";f+=a.polk_7+":";f+=a.polk_8+":";f+=a.polk_9+":";f+=a.box_1+":";f+=a.box_2+":";f+=a.box_3+":";f+=a.box_4+":";
f+=a.box_5+":";f+=a.box_6+":";f+=a.box_7+":";f+=a.box_8+":";f+=a.box_9+":";f+=a.content_1+":";f+=a.content_2+":";f+=a.content_3+":";f+=a.content_4+":";f+=a.content_5+":";f+=a.content_6+":";f+=a.content_7+":";f+=a.content_8+":";f+=a.content_9+":";f+=a.fixed_1+":";f+=a.fixed_2+":";f+=a.fixed_3+":";f+=a.fixed_4+":";f+=a.fixed_5+":";f+=a.fixed_6+":";f+=a.fixed_7+":";f+=a.fixed_8+":";f+=a.fixed_9+":";f+=a.sd_1+":";f+=a.sd_2+":";f+=a.sd_3+":";f+=a.sd_4+":";f+=a.sd_5+":";f+=a.sd_6+":";f+=a.sd_7+":";f+=a.sd_8;
ra(f);$("#saveLink").attr("value",f)}function M(){function b(m,u,o){u=profile_array_1[m][o];var x=profile_array_2[m][o],y=profile_array_3[m][o],z=profile_array_4[m][o],A=profile_array_5[m][o],B=profile_array_6[m][o],C=profile_array_7[m][o],D=profile_array_8[m][o],E=profile_array_9[m][o],F=profile_array_10[m][o],ba=profile_array_11[m][o];m=profile_array_12[m][o];if(u===0)k[0]=0;if(x===0)k[1]=0;if(y===0)k[2]=0;if(z===0)k[3]=0;if(A===0)k[4]=0;if(B===0)k[5]=0;if(C===0)k[6]=0;if(D===0)k[7]=0;if(E===0)k[8]=
0;if(F===0)k[9]=0;if(ba===0)k[10]=0;if(m===0)k[11]=0;ca+=u;da+=x;ea+=y;fa+=z;ga+=A;ha+=B;ia+=C;ja+=D;ka+=E;la+=F;ma+=ba;na+=m;m=Math.round(p+ca)*k[0];o=Math.round(p+da)*k[1];u=Math.round(p+ea)*k[2];x=Math.round(p+fa)*k[3];y=Math.round(p+ga)*k[4];z=Math.round(p+ha)*k[5];A=Math.round(p+ia)*k[6];B=Math.round(p+ja)*k[7];C=Math.round(p+ka)*k[8];D=Math.round(p+la)*k[9];E=Math.round(p+ma)*k[10];F=Math.round(p+na)*k[11];if(m===0||m==NaN)m="\u2014";if(o===0||o==NaN)o="\u2014";if(u===0||u==NaN)u="\u2014";if(x===
0||x==NaN)x="\u2014";if(y===0||y==NaN)y="\u2014";if(z===0||z==NaN)z="\u2014";if(A===0||A==NaN)A="\u2014";if(B===0||B==NaN)B="\u2014";if(C===0||C==NaN)C="\u2014";if(D===0||D==NaN)D="\u2014";if(E===0||E==NaN)E="\u2014";if(F===0||F==NaN)F="\u2014";$("#price_profile_1").text(Math.floor(m*perCent));$("#price_profile_2").text(Math.floor(o*perCent));$("#price_profile_3").text(Math.floor(u*perCent));$("#price_profile_4").text(Math.floor(x*perCent));$("#price_profile_5").text(Math.floor(y*perCent));$("#price_profile_6").text(Math.floor(z*perCent));$("#price_profile_7").text(Math.floor(A*perCent));$("#price_profile_8").text(Math.floor(B*perCent));$("#price_profile_9").text(Math.floor(C*perCent));
$("#price_profile_10").text(Math.floor(D*perCent));$("#price_profile_11").text(Math.floor(E*perCent));$("#price_profile_12").text(Math.floor(F*perCent))}var d=0,g=0;g=a.has_floor===1?a.width*a.depth/1E4:a.width*10/1E4;var h=0;h=a.has_ceil===1?a.width*a.depth/1E4:a.width*10/1E4;var l=0;l=a.has_left_wall===1?a.height*a.depth/1E4:a.height*10/1E4;var I=0;I=a.has_right_wall===1?a.height*a.depth/1E4:a.height*10/1E4;var j=0;j=a.has_back_wall===1?a.width*a.height/1E4:0;var v=0;v=a.height*a.depth/1E4*(a.sekt-1);v=Math.round(v*100)/100;var J=0;for(d=1;d<=a.sekt;d++){J+=
a["sekt_"+d]*a.depth/1E4*a["polk_"+d];if(a["box_"+d]!==0)J+=a["sekt_"+d]*a.depth/1E4}J=Math.round(J*100)/100;d=g+h+l+I+v+J;d=Math.round(d*100)/100;var p=0;p=d*price_base+j*price_dop;j=0;for(d=1;d<=a.sekt;d++)j+=a["sekt_"+d]<=60?price_box1*a["box_"+d]:price_box2*a["box_"+d];p+=j;j=0;for(d=1;d<=a.sekt;d++)if(a["content_"+d]===1)if(a.depth<=30)j+=price_vesh_1;else if(a.depth<=35)j+=price_vesh_2;else if(a.depth<=40)j+=price_vesh_3;else if(a.depth<=45)j+=price_vesh_4;else if(a.depth<=50)j+=price_vesh_5;
else{if(a.depth>50)j+=price_vesh_6}else if(a["content_"+d]===2)j+=a["sekt_"+d]/100*price_vesh;p+=j;p=Math.round(p*100)/100;var ca=j=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0;for(d=1;d<=a.doors;d++){j=Math.round(a.width/a.doors*100)/100;j<=50&&b(a["sd_"+d],d,0);j>50&&j<=60&&b(a["sd_"+d],d,1);j>60&&j<=70&&b(a["sd_"+d],d,2);j>70&&j<=80&&b(a["sd_"+d],d,3);j>80&&j<=90&&b(a["sd_"+d],d,4);j>90&&j<=100&&b(a["sd_"+d],d,5);j>100&&j<=110&&b(a["sd_"+d],d,6);j>110&&b(a["sd_"+d],d,7)}}var a=[],e=
[],c=[],s=window.location.href;if(s.indexOf("?")!==-1){c=s.indexOf("?");s=s.slice(c+1);c=[];c=s.split(":")}else c=Array(150,250,70,3,3,1,1,1,1,1,50,50,50,50,50,50,50,50,50,2,0,2,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=Array(1,1,1,1,1,1,1,1,1,1,1,1);a.height=parseInt(c[0]);e.height=parseInt(c[0]);a.width=parseInt(c[1]);e.width=parseInt(c[1]);a.depth=parseInt(c[2]);e.depth=parseInt(c[2]);a.sekt=parseInt(c[3]);e.sekt=parseInt(c[3]);a.doors=parseInt(c[4]);
e.doors=parseInt(c[4]);a.has_floor=parseInt(c[5]);e.has_floor=parseInt(c[5]);a.has_ceil=parseInt(c[6]);e.has_ceil=parseInt(c[6]);a.has_left_wall=parseInt(c[7]);e.has_left_wall=parseInt(c[7]);a.has_right_wall=parseInt(c[8]);e.has_right_wall=parseInt(c[8]);a.has_back_wall=parseInt(c[9]);e.has_back_wall=parseInt(c[9]);a.sekt_1=parseInt(c[10]);e.sekt_1=parseInt(c[10]);a.sekt_2=parseInt(c[11]);e.sekt_2=parseInt(c[11]);a.sekt_3=parseInt(c[12]);e.sekt_3=parseInt(c[12]);a.sekt_4=parseInt(c[13]);e.sekt_4=
parseInt(c[13]);a.sekt_5=parseInt(c[14]);e.sekt_5=parseInt(c[14]);a.sekt_6=parseInt(c[15]);e.sekt_6=parseInt(c[15]);a.sekt_7=parseInt(c[16]);e.sekt_7=parseInt(c[16]);a.sekt_8=parseInt(c[17]);e.sekt_8=parseInt(c[17]);a.sekt_9=parseInt(c[18]);e.sekt_9=parseInt(c[18]);a.polk_1=parseInt(c[19]);e.polk_1=parseInt(c[19]);a.polk_2=parseInt(c[20]);e.polk_2=parseInt(c[20]);a.polk_3=parseInt(c[21]);e.polk_3=parseInt(c[21]);a.polk_4=parseInt(c[22]);e.polk_4=parseInt(c[22]);a.polk_5=parseInt(c[23]);e.polk_5=parseInt(c[23]);
a.polk_6=parseInt(c[24]);e.polk_6=parseInt(c[24]);a.polk_7=parseInt(c[25]);e.polk_7=parseInt(c[25]);a.polk_8=parseInt(c[26]);e.polk_8=parseInt(c[26]);a.polk_9=parseInt(c[27]);e.polk_9=parseInt(c[27]);a.box_1=parseInt(c[28]);e.box_1=parseInt(c[28]);a.box_2=parseInt(c[29]);e.box_2=parseInt(c[29]);a.box_3=parseInt(c[30]);e.box_3=parseInt(c[30]);a.box_4=parseInt(c[31]);e.box_4=parseInt(c[31]);a.box_5=parseInt(c[32]);e.box_5=parseInt(c[32]);a.box_6=parseInt(c[33]);e.box_6=parseInt(c[33]);a.box_7=parseInt(c[34]);
e.box_7=parseInt(c[34]);a.box_8=parseInt(c[35]);e.box_8=parseInt(c[35]);a.box_9=parseInt(c[36]);e.box_9=parseInt(c[36]);a.content_1=parseInt(c[37]);e.content_1=parseInt(c[37]);a.content_2=parseInt(c[38]);e.content_2=parseInt(c[38]);a.content_3=parseInt(c[39]);e.content_3=parseInt(c[39]);a.content_4=parseInt(c[40]);e.content_4=parseInt(c[40]);a.content_5=parseInt(c[41]);e.content_5=parseInt(c[41]);a.content_6=parseInt(c[42]);e.content_6=parseInt(c[42]);a.content_7=parseInt(c[43]);e.content_7=parseInt(c[43]);
a.content_8=parseInt(c[44]);e.content_8=parseInt(c[44]);a.content_9=parseInt(c[45]);e.content_9=parseInt(c[45]);a.fixed_1=parseInt(c[46]);e.fixed_1=parseInt(c[46]);a.fixed_2=parseInt(c[47]);e.fixed_2=parseInt(c[47]);a.fixed_3=parseInt(c[48]);e.fixed_3=parseInt(c[48]);a.fixed_4=parseInt(c[49]);e.fixed_4=parseInt(c[49]);a.fixed_5=parseInt(c[50]);e.fixed_5=parseInt(c[50]);a.fixed_6=parseInt(c[51]);e.fixed_6=parseInt(c[51]);a.fixed_7=parseInt(c[52]);e.fixed_7=parseInt(c[52]);a.fixed_8=parseInt(c[53]);
e.fixed_8=parseInt(c[53]);a.fixed_9=parseInt(c[54]);e.fixed_9=parseInt(c[54]);a.sd_1=parseInt(c[55]);e.sd_1=parseInt(c[55]);a.sd_2=parseInt(c[56]);e.sd_2=parseInt(c[56]);a.sd_3=parseInt(c[57]);e.sd_3=parseInt(c[57]);a.sd_4=parseInt(c[58]);e.sd_4=parseInt(c[58]);a.sd_5=parseInt(c[59]);e.sd_5=parseInt(c[59]);a.sd_6=parseInt(c[60]);e.sd_6=parseInt(c[60]);a.sd_7=parseInt(c[61]);e.sd_7=parseInt(c[61]);a.sd_8=parseInt(c[62]);e.sd_8=parseInt(c[62]);(function(){t("switch_floor",parseInt(e.has_floor));t("switch_ceil",
parseInt(e.has_ceil));t("switch_leftWall",parseInt(e.has_left_wall));t("switch_rightWall",parseInt(e.has_right_wall));t("switch_backWall",parseInt(e.has_back_wall));for(var b=1;b<=9;b++)t("fix_"+b,parseInt(e["fixed_"+b]));$("#size_height").attr("value",e.height);$("#size_width").attr("value",e.width);$("#size_depth").attr("value",e.depth);$("#sekt_num").attr("value",e.sekt);$("#doors_num").attr("value",e.doors);for(b=1;b<=9;b++){$("#polk_num_"+b).attr("value",e["polk_"+b]);$("#box_num_"+b).attr("value",
e["box_"+b])}for(b=1;b<=9;b++)t("vesh_"+b,parseInt(e["content_"+b]));for(b=1;b<=9;b++){$("#door_"+b+" div.select li").removeClass("selected");$("#door_"+b+" div.select li:eq("+e["sd_"+b]+")").addClass("selected")}Q()})();L();S();var V=false,W=$("#slide").offset(),X=0,q=0,K=0;$("#slideBar").mousedown(function(){$(this).addClass("active");K=$(this).position();K=K.left;q=Math.round(X-W.left);K-=q;V=true;$("body").append('<div id="noselect"></div>')});$(document).bind("mouseup",function(){V=false;$("#slideBar").removeClass("active");
$("#noselect").remove();Q()});$(document).bind("mousemove",function(b){X=b.pageX;W=$("#slide").offset();q=Math.round(X-W.left);q+=K;if(q<49)q=49;if(q>624)q=624;if(V===true){$("#slideBar").css("left",q);$("#slidePol").width(q);a.width=Math.floor(q*0.722);L()}});$("div.switch").mouseenter(function(){$(this).addClass("current_switch");var b=$(this).attr("id");$("div.current_switch a").click(function(d){d.preventDefault();$("div.current_switch a").removeClass("selected");$(this).addClass("selected");
for(var g=d=0;g<$("div.current_switch a").length;g++)if($("div.current_switch a:eq("+g+")").hasClass("selected"))d=g;t(b,d)})});$("div.switch").mouseleave(function(){$(this).removeClass("current_switch")});var Y,N=0,n,i,G=9;$("div.calcNum > a").mousedown(function(b){if(!$.browser.msie){b.preventDefault();$(this).focus()}});$("div.calcNum > a").click(function(b){$(this).blur();b.preventDefault();clearInterval(Y);N=0});$("div.calcNum > a").focus(function(){var b=1;n=$(this).parent().find("input").attr("id");
i=parseInt($("#"+n).attr("value"));if($(this).hasClass("cnTop")){i++;b=1}else{i>0&&i--;b=-1}Y=setInterval(function(){N++;if(N>5&&i>0){i+=b;w()}},50);w()});$(document).bind("mouseup",function(){clearInterval(Y);N=0});$("#size_height").change(function(){n="size_height";i=$(this).attr("value");H();w()});$("#size_width").change(function(){n="size_width";i=$(this).attr("value");H();w()});$("#size_depth").change(function(){n="size_depth";i=$(this).attr("value");H();w()});$("#sekt_num").change(function(){n=
"sekt_num";i=$(this).attr("value");H();w();S()});for(s=1;s<=a.sekt;s++)$("#skt_size_"+s).change(function(){n=$(this).attr("id");i=$(this).attr("value");H();w()});var T="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\u0451\u0439\u0446\u0443\u043a\u0435\u043d\u0433\u0448\u0449\u0437\u0445\u044a\u0444\u044b\u0432\u0430\u043f\u0440\u043e\u043b\u0434\u0436\u044d\u044f\u0447\u0441\u043c\u0438\u0442\u044c\u0431\u044e\u0401\u0419\u0426\u0423\u041a\u0415\u041d\u0413\u0428\u0429\u0417\u0425\u042a\u0424\u042b\u0412\u0410\u041f\u0420\u041e\u041b\u0414\u0416\u042d\u042f\u0427\u0421\u041c\u0418\u0422\u042c\u0411\u042e[]{};:<>,.?/|()-=+!@#$%^&*`~\u2116",
oa="",O="",Z=0,pa=0,P=true,qa=0;$("div.select a").click(function(b){b.preventDefault();U();oa=$(this).parent().parent().parent().html();O=$(this).parent().parent().parent().parent().attr("id").slice(5);Z=$(this).parent().parent().parent().offset();b='<div id="pop_menu">';b+=oa;b+="</div>";$("body").append(b);pa=$("#pop_menu").height();$("#pop_menu").css("top",Z.top-pa-4).css("left",Z.left+5);$("#pop_menu a").click(function(d){d.preventDefault()});$("#pop_menu li").click(function(){for(var d=0;d<12;d++)k[d]=
1;$("#pop_menu li").removeClass("selected");$(this).addClass("selected");qa=$("#pop_menu li").length;for(d=0;d<qa;d++)if($("#pop_menu li:eq("+d+")").hasClass("selected")){a["sd_"+O]=d;$("#door_"+O+" ul > li").removeClass("selected");$("#door_"+O+" ul > li:eq("+d+")").addClass("selected")}P=true;U();M()});$("#pop_menu").hover(function(){P=false},function(){P=true});$(window).mousedown(function(){P===true&&U()})});var f="";$("#save").click(function(b){b.preventDefault();$("#saveLink").attr("value",
"");aa()});$("#saveLink").attr("value","\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0432\u0430\u0448 \u0448\u043a\u0430\u0444");$("#print").click(function(b){b.preventDefault();var d=$("#main").height();b="";$("#main").height(0).css("overflow","hidden");b='<img src="img/white.gif" id="pr_img" /><div id="pr"><div id="pr_cont">';b+='<div id="pr_head">';b+='<div id="pr_logo"><img src="img/logo.png" alt="" /></div><div id="pr_logo_txt">\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f \u00ab\u0421\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f \u043b\u0430\u0434\u044c\u044f\u00bb</div><div id="pr_top_tel">\u041c\u043e\u0441\u043a\u0432\u0430: (495) 518-16-45<br />\u0412\u043e\u043b\u0433\u043e\u0433\u0440\u0430\u0434: (8442) 96-39-16<br />\u041a\u0440\u0430\u0441\u043d\u043e\u0434\u0430\u0440: (861) 274-37-33</div><div id="pr_slogan">\u0420\u0430\u0441\u0447\u0435\u0442 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0448\u043a\u0430\u0444\u0430-\u043a\u0443\u043f\u0435</div>';
b+='<a id="print_close" href="#">\u0412\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434</a><a id="go_print" href="#">\u0420\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c</a></div>';b+='<div id="pr_content">';b+="<h1>\u041f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0448\u043a\u0430\u0444\u0430-\u043a\u0443\u043f\u0435</h1>";b+="<h2>\u0420\u0430\u0437\u043c\u0435\u0440\u044b</h2>";
b+="<p>\u0412\u044b\u0441\u043e\u0442\u0430: <b>"+a.height+"</b> \u0441\u043c <i>&bull;</i> ";b+="\u0414\u043b\u0438\u043d\u0430: <b>"+a.width+"</b> \u0441\u043c <i>&bull;</i> ";b+="\u0413\u043b\u0443\u0431\u0438\u043d\u0430: <b>"+a.depth+"</b> \u0441\u043c <i>&bull;</i> ";b+="\u0421\u0435\u043a\u0446\u0438\u0439: <b>"+a.sekt+"</b> <i>&bull;</i> ";b+="\u041a\u043e\u043b-\u0432\u043e \u0434\u0432\u0435\u0440\u0435\u0439: <b>"+a.doors+"</b></p>";var g="",h="",l="",I="",j="";g=a.has_floor===1?"\u0415\u0441\u0442\u044c":
"\u0424\u0430\u043b\u044c\u0448-\u043f\u043e\u043b";h=a.has_ceil===1?"\u0415\u0441\u0442\u044c":"\u0424\u0430\u043b\u044c\u0448-\u043f\u043e\u0442\u043e\u043b\u043e\u043a";l=a.has_left_wall===1?"\u0415\u0441\u0442\u044c":"\u0424\u0430\u043b\u044c\u0448-\u0441\u0442\u0435\u043d\u043a\u0430";I=a.has_right_wall===1?"\u0415\u0441\u0442\u044c":"\u0424\u0430\u043b\u044c\u0448-\u0441\u0442\u0435\u043d\u043a\u0430";j=a.has_back_wall===1?"\u0415\u0441\u0442\u044c":"\u041d\u0435\u0442";b+="<h2>\u0422\u0438\u043f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u043e\u0441\u0442\u0438</h2>";
b+="<p>\u041f\u043e\u043b: <b>"+g+"</b> <i>&bull;</i> ";b+="\u041f\u043e\u0442\u043e\u043b\u043e\u043a: <b>"+h+"</b> <i>&bull;</i> ";b+="\u041b\u0435\u0432\u0430\u044f \u0441\u0442\u0435\u043d\u043a\u0430: <b>"+l+"</b> <i>&bull;</i> ";b+="\u041f\u0440\u0430\u0432\u0430\u044f \u0441\u0442\u0435\u043d\u043a\u0430: <b>"+I+"</b> <i>&bull;</i> ";b+="\u0417\u0430\u0434\u043d\u044f\u044f \u0441\u0442\u0435\u043d\u043a\u0430: <b>"+j+"</b></p>";b+="<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0439</h2>";
for(g=1;g<=a.sekt;g++){h="";h=a["content_"+g]===0?"\u041d\u0435\u0442":a["content_"+g]===1?"\u0422\u043e\u0440\u0446\u0435\u0432\u043e\u0435":"\u0428\u0442\u0430\u043d\u0433\u0430";b+="<p><b>\u0421\u0435\u043a\u0446\u0438\u044f "+g+"</b> <i>&bull;</i> ";b+="\u0428\u0438\u0440\u0438\u043d\u0430: <b>"+a["sekt_"+g]+"</b> \u0441\u043c <i>&bull;</i> ";b+="\u041f\u043e\u043b\u043e\u043a: <b>"+a["polk_"+g]+"</b> <i>&bull;</i> ";b+="\u042f\u0449\u0438\u043a\u043e\u0432: <b>"+a["box_"+g]+"</b> <i>&bull;</i> ";
b+="\u0412\u0435\u0448\u0430\u043b\u043e: <b>"+h+"</b></p>"}b+="<h2>\u0414\u0432\u0435\u0440\u0438</h2>";for(g=1;g<=a.doors;g++){h="";if(a["sd_"+g]===0)h="\u0414\u0421\u041f (Kronopol, \u00abEgger\u00bb)";else if(a["sd_"+g]===1)h="\u0414\u0421\u041f (\u0433\u043b\u044f\u043d\u0446\u0435\u0432\u043e\u0435, Thermopal)";else if(a["sd_"+g]===2)h="\u0417\u0435\u0440\u043a\u0430\u043b\u043e (\u0441\u0435\u0440\u0435\u0431\u0440\u043e, \u0441\u0442\u0435\u043a\u043b\u043e, \u043f\u0440.)";else if(a["sd_"+
g]===3)h="\u0417\u0435\u0440\u043a\u0430\u043b\u043e (\u0431\u0440\u043e\u043d\u0437\u0430, \u0433\u0440\u0430\u0444\u0438\u0442, \u0437\u0435\u043b\u0435\u043d\u043e\u0435)";else if(a["sd_"+g]===4)h="\u041a\u043e\u0436\u0430 (\u043a\u043e\u0436\u0430 2)";else if(a["sd_"+g]===5)h="\u041f\u043b\u0430\u0441\u0442\u0438\u043a (Kamellit, Frizzz)";else if(a["sd_"+g]===6)h="\u0428\u043f\u043e\u043d (\u0412\u0435\u043d\u0433\u0435, \u0417\u0435\u0431\u0440\u0430\u043d\u043e, \u0421\u0430\u043f\u0435\u0440\u043b\u0438)";
else if(a["sd_"+g]===7)h="C\u0442\u0435\u043a\u043b\u043e \u0441 \u043f\u043b\u0435\u043d\u043a\u043e\u0439 (1 \u043f\u043b\u0435\u043d\u043a\u0430 \u041e\u0440\u0430\u043a\u0430\u043b)";else if(a["sd_"+g]===7)h="\u041c\u0414\u0424 \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0440\u043e\u0442\u0430\u043d\u0433";else if(a["sd_"+g]===7)h="\u041c\u0414\u0424 \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0431\u0430\u043c\u0431\u0443\u043a";b+="<p><b>\u0414\u0432\u0435\u0440\u044c "+
g+"</b> <i>&bull;</i> ";b+="\u041d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435: <b>"+h+"</b></p>"}b+='<p class="comment"><b>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u0438\u0434\u044b \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439:</b><br />\u0414\u0421\u041f (Kronopol, \u00abEgger\u00bb) <i>&bull;</i> \u0414\u0421\u041f (\u0433\u043b\u044f\u043d\u0446\u0435\u0432\u043e\u0435, Thermopal) <i>&bull;</i> \u0417\u0435\u0440\u043a\u0430\u043b\u043e (\u0441\u0435\u0440\u0435\u0431\u0440\u043e, \u0441\u0442\u0435\u043a\u043b\u043e, \u043f\u0440.) <i>&bull;</i> \u0417\u0435\u0440\u043a\u0430\u043b\u043e (\u0431\u0440\u043e\u043d\u0437\u0430, \u0433\u0440\u0430\u0444\u0438\u0442, \u0437\u0435\u043b\u0435\u043d\u043e\u0435) <i>&bull;</i> \u041a\u043e\u0436\u0430 (\u043a\u043e\u0436\u0430 2) <i>&bull;</i> \u041f\u043b\u0430\u0441\u0442\u0438\u043a (Kamellit, Frizzz) <i>&bull;</i> \u0428\u043f\u043e\u043d (\u0412\u0435\u043d\u0433\u0435, \u0417\u0435\u0431\u0440\u0430\u043d\u043e, \u0421\u0430\u043f\u0435\u0440\u043b\u0438) <i>&bull;</i> \u0421\u0442\u0435\u043a\u043b\u043e \u0441 \u043f\u043b\u0435\u043d\u043a\u043e\u0439 (1 \u043f\u043b\u0435\u043d\u043a\u0430 \u041e\u0440\u0430\u043a\u0430\u043b) <i>&bull;</i> \u041c\u0414\u0424 \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0440\u043e\u0442\u0430\u043d\u0433 <i>&bull;</i> \u041c\u0414\u0424 \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0431\u0430\u043c\u0431\u0443\u043a</p>';
b+="<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0435 \u0446\u0435\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439</h2>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041b\u0430\u0433\u0443\u043d\u0430, \u0430\u043d\u0430\u0434\u0438\u0440\u043e\u0432\u043a\u0430&raquo; <i>&bull;</i> <b>"+$("#price_profile_1").text()+"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041b\u0430\u0433\u0443\u043d\u0430, \u041f\u0412\u0425 (\u0434\u0435\u0440\u0435\u0432\u043e)&raquo; <i>&bull;</i> <b>"+
$("#price_profile_2").text()+"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041b\u0430\u0433\u0443\u043d\u0430, \u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432&raquo; <i>&bull;</i> <b>"+$("#price_profile_3").text()+"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041a\u043e\u0440\u0430\u043b, \u0430\u043d\u0430\u0434\u0438\u0440\u043e\u0432\u043a\u0430&raquo; <i>&bull;</i> <b>"+$("#price_profile_4").text()+
"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041a\u043e\u0440\u0430\u043b, \u041f\u0412\u0425 (\u0434\u0435\u0440\u0435\u0432\u043e)&raquo; <i>&bull;</i> <b>"+$("#price_profile_5").text()+"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u041a\u043e\u0440\u0430\u043b, \u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432&raquo; <i>&bull;</i> <b>"+$("#price_profile_6").text()+"</b> \u0440\u0443\u0431.</p>";
b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u0420\u0430\u0443\u043c \u041f\u043b\u044e\u0441, \u0430\u043d\u0430\u0434\u0438\u0440\u043e\u0432\u043a\u0430&raquo; <i>&bull;</i> <b>"+$("#price_profile_7").text()+"</b> \u0440\u0443\u0431.</p>";b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u0420\u0430\u0443\u043c \u041f\u043b\u044e\u0441, \u041f\u0412\u0425 (\u0434\u0435\u0440\u0435\u0432\u043e)&raquo; <i>&bull;</i> <b>"+$("#price_profile_8").text()+"</b> \u0440\u0443\u0431.</p>";
b+="<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;\u0420\u0430\u0443\u043c \u041f\u043b\u044e\u0441, \u0413\u0430\u043b\u044c\u0432\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435&raquo; <i>&bull;</i> <b>"+$("#price_profile_9").text()+"</b> \u0440\u0443\u0431.</p>";b+='<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;Cosmos Alum/ITAL, \u0413\u0430\u043b\u044c\u0432\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0413\u043b\u044f\u043d\u0435\u0446 ("BRILL")&raquo; <i>&bull;</i> <b>'+
$("#price_profile_10").text()+"</b> \u0440\u0443\u0431.</p>";b+='<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;Cosmos Alum/ITAL, \u0410\u043d\u0430\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0427\u0435\u0440\u043d\u044b\u0439 ("BL\u0410\u0421K")&raquo; <i>&bull;</i> <b>'+$("#price_profile_11").text()+"</b> \u0440\u0443\u0431.</p>";b+='<p>\u0412 \u043f\u0440\u043e\u0444\u0438\u043b\u0435 &laquo;Cosmos Alum/ITAL, \u0410\u043d\u0430\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0421\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u043d\u044b\u0439 ("SILVER")&raquo; <i>&bull;</i> <b>'+
$("#price_profile_12").text()+"</b> \u0440\u0443\u0431.</p>";l=new Date;g=l.getFullYear();h=l.getMonth();l=l.getDate();if(l<10)l="0"+l;b+='<p class="current_date">\u0414\u0430\u0442\u0430: <b>'+l+" "+["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",
"\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"][h]+" "+g+"</b></p>";b+="</div></div></div>";$("body").append(b);$("#print_close").click(function(v){v.preventDefault();$("#pr").remove();$("#pr_img").remove();$("#main").height(d)});$("#go_print").click(function(v){v.preventDefault();window.print()})});$("#order").click(function(b){b.preventDefault();b=$("#main").height();$("#order_black").show();$("#order_base").show();
$("#order_black").height()<b&&$("#order_black").height(b);aa();$("#hot_link").attr("value",f);$("#order_close").click(function(d){d.preventDefault();$("#order_black").hide();$("#order_base").hide()})})});
