function openWindow(e,d,b,f,a,c,g){newWindow=window.open(e,d,"width="+b+",height="+f+",resizable="+(c?"1":"0")+",toolbar="+(g?"1":"0")+",location=0,status=0,menubar="+(g?"1":"0")+",directories=0,scrollbars="+(a?"1":"0"));newWindow.focus()}function submit_form(b,a){document.forms[b].elements.act.value=a;document.forms[b].target="";return true}function setField(b,a){if(b.value==a){b.value=""}}function setFlash(c,e,a,f,b,d){if(c){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '+(d?d:'width="'+e+'" height="'+a+'"')+">");document.write('<param name="movie" value="'+c+(f?"?link="+f:"")+'">');document.write('<param name="quality" value="high">');document.write('<param name="wmode" value="opaque">');document.write('<embed src="'+c+(f?"?link="+f:"")+'" wmode="opaque" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" '+(d?d:'width="'+e+'" height="'+a+'"')+"></embed>");document.write("</object>")}else{if(b){document.write((f?'<a href="'+f+'">':"")+'<img src="'+b+'" '+(d?d:'width="'+e+'" height="'+a+'"')+' border="0">'+(f?"</a>":""))}}}function prm_init(){$("a.help").live("mouseover mouseout click",function(a){if(a.type=="mouseover"){prm_show(this)}else{if(a.type=="mouseout"){$("#prm").remove()}else{prm_click(this);return false}}});$("div.exp").live("click",function(a){if($(this).css("height")!="15px"){$(this).css("height","15px")}else{$(this).css("height","100%")}})}function prm_show(a){var d=a.href;a.id=a.href;var f=a.id;var h=document.documentElement;var c=self.innerWidth||(h&&h.clientWidth)||document.body.clientWidth;pW=350;if(c-getAbsoluteLeft(f)>((pW*1)+75)){$("body").append("<div id='prm' style='width:"+pW*1+"px'><div id='prm_left'></div><div id='prm_copy'><div class='loader'><div></div></div>");var b=getElementWidth(f)+17;var g=getAbsoluteLeft(f)+b}else{$("body").append("<div id='prm' style='width:"+pW*1+"px'><div id='prm_right' style='left:"+((pW*1)+1)+"px'></div><div id='prm_copy'><div class='loader'><div></div></div>");var g=getAbsoluteLeft(f)-((pW*1)+18)}var e=getAbsoluteTop(f)-3;regp=/^.+\/([^\/\?]+).*$/;d=d.replace(regp,"/glossary/$1");$("#prm").css({left:g+"px",top:e+"px"});$("#prm").show();$("#prm_copy").load(d+".phtml")}function prm_click(a){if(a.alt){window.location.href=a.alt}else{var b=a.href;regp=/^.+\/([^\/]+)$/;b=b.replace(regp,"$1");window.location.href="/glossary/?b=468&limit=1&flt[293][v]="+b;return false}}function getElementWidth(a){x=document.getElementById(a);return x.offsetWidth}function getAbsoluteLeft(a){o=document.getElementById(a);oLeft=o.offsetLeft;while(o.offsetParent!=null){oParent=o.offsetParent;oLeft+=oParent.offsetLeft;o=oParent}return oLeft}function getAbsoluteTop(a){o=document.getElementById(a);oTop=o.offsetTop;while(o.offsetParent!=null){oParent=o.offsetParent;oTop+=oParent.offsetTop;o=oParent}return oTop}$(function(){var b=null;var c=(jQuery.browser.msie&&jQuery.browser.version=="6.0")?1:0;$(".buy").click(function(g){var f=$(this);var d=$(this).find("span:eq(0)").attr("prod");f.addClass("addOB_Loader");$.ajax({type:"GET",url:"/order/add/?productid="+d+"&addbox=1",cache:false,success:function(e){e=$.parseJSON(e);$("#addOB").find("span:eq(0)").html(e.pCount);$("#addOB").find("span:eq(1)").html(e.pTotal);f.removeClass("addOB_Loader")}});if(b){clearTimeout(b)}if(c){$("#addOB").addClass("addOB_IE")}$("#addOB").css({top:(g.pageY-90)+"px",left:(g.pageX+-50)+"px",display:"block"}).animate({top:"-=10px",opacity:1},300,"swing")});$("#addOB").hover(function(d){if(b){clearTimeout(b)}},function(){if(b){clearTimeout(b)}b=setTimeout(function(){$("#addOB").animate({top:"-=10px",opacity:0},250,"swing",function(){$("#addOB").css("display","none")})},3000)});$("#formOB_link").click(function(d){$("#addOB").css("display","none");if(c){$("#formOB").addClass("formOB_IE")}$("#formOB").css({top:(d.pageY-200)+"px",left:(d.pageX-400)+"px",display:"block"}).animate({top:"-=50px",opacity:1},300,"swing");$("#formOB form").load("/order/ob/index.phtml",function(){})});$("#formOB form").submit(function(){var d=$(this).serialize();var e={};$.ajax({type:"POST",url:"/order/ob/",data:d,cache:false,success:function(f){if(f.search("<h1")!=-1){$("#formOB form").html(f)}else{$("#formOB_msg").html(f)}},error:function(){$("#formOB_msg").html("Critical error")}});return false});$(".OB_close").click(function(d){$("#formOB").animate({top:"-=10px",opacity:0},250,"swing",function(){$("#formOB").css("display","none")})});$("#OB_count").live("keyup keypress change",function(g){var f=parseInt($(this).val());if(isNaN(f)||f==0){f=0;$("#OB_total").text("")}else{var e=parseFloat($("#OB_price").val());var d=(Math.round((f*e*100))).toString();$("#OB_total").text(a(d))}});function a(e){x1=e.substr(0,e.length-2);var d=/(\d+)(\d{3})/;while(d.test(x1)){x1=x1.replace(d,"$1 $2")}return x1+"."+e.substr(e.length-2,2)+" руб."}prm_init()});
