function getElementsByName_fix(a,b){var c=document.getElementsByTagName(b);var d=new Array();j=0;for(i=0;i<c.length;i++){if(c[i].getAttribute("name")==a){d[j]=c[i];j++}}return d}var dc=document;var offsetfromcursorY=15;var ie=dc.all&&!window.opera;var ns6=dc.getElementById&&!dc.all;var tipobj,op;function tooltip(a,b){tipobj=$('d_help');tipobj.innerHTML=b;op=0.1;tipobj.style.opacity=op;tipobj.style.display="block";a.onmousemove=positiontip;appear()}function hide_info(a){$('d_help').setStyle({display:'none'});a.onmousemove='';$('d_help').update(inner_d_help)}function ietruebody(){return(dc.compatMode&&dc.compatMode!="BackCompat")?dc.documentElement:dc.body}function positiontip(e){var a=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var b=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var c=ie&&!window.opera?ietruebody().clientWidth:window.innerWidth-20;var d=ie&&!window.opera?ietruebody().clientHeight:window.innerHeight-20;var f=ie&&!window.opera?c-event.clientX:c-e.clientX;var g=ie&&!window.opera?d-event.clientY-offsetfromcursorY:d-e.clientY-offsetfromcursorY;if(f<tipobj.offsetWidth)tipobj.style.left=a-tipobj.offsetWidth+"px";else tipobj.style.left=a+"px";if(g<tipobj.offsetHeight)tipobj.style.top=b-tipobj.offsetHeight-offsetfromcursorY+"px";else tipobj.style.top=b+offsetfromcursorY+"px"}function appear(){if(op<1){op+=0.1;tipobj.style.opacity=op;tipobj.style.filter='alpha(opacity='+op*100+')';t=setTimeout('appear()',30)}}function getCookie(a){var b=document.cookie.split("; ");for(var i=0;i<b.length;i++){var c=b[i].split("=");if(a==c[0])return unescape(c[1])}return null}function setCookie(a,b,c){var d=new Date();if(null==c)c=400;d.setDate(d.getDate()+c);var e=a+'='+escape(b)+'; path=/;';if(b!='')e+=" expires="+d.toGMTString()+';';document.cookie=e;if((a=='zakaz')&&null==getCookie(a))alert('не могу установить cookie ! заказ товара в вашем браузере не работает.')}var sStep=30;var sTime=15;var sLeft=300;var sRigh=300;var inner_d_help='<br/><br/><br/><br/><br/><br/><br/><br/><div align="center"><img src="/icon/ajax-loader.gif" alt="loading"/></div>';function review(b){var c=$('d_help');if(c.style.display!='block'){$('d_wrapper').style.display='block';if($('d_choice_nb')!=undefined)$('d_choice_nb').style.visibility='hidden';var d=2*sLeft+'px';var e=(document.body.clientWidth/2-sLeft)+'px';var g=(window.screen.availHeight-250)+'px';c.setStyle({display:'block',top:'50px',left:e,width:d,height:g});c.scrollIntoView(true);var h=(('feedback'==b)?'/review/feedback/':('/review/'+b));new Ajax.Request(h,{method:'get',onSuccess:function f(a){c.update(a.responseText)}})}}function rClose(){var a=$('d_help');{a.setStyle({display:'none',width:'auto',height:'auto'});$('d_wrapper').style.display='none';a.update(inner_d_help);if($('d_choice_nb')!=undefined)$('d_choice_nb').style.visibility='visible'}}function vote(b,c){new Ajax.Request('/review/vote/?id='+b+'&mode='+c,{evalScripts:false,onSuccess:function f(a){alert(a.responseText)}})}function onload_list(a){document.bgColor=a;$('wares_table').style.backgroundColor=a}function ajax_loading(a){if(a){$('d_ajax_loading').style.display='block'}else{$('d_ajax_loading').style.display='none'}}function menuco(a,b){a=$(a);if(a.hasClassName('current'))return;if(b)a.addClassName('active');else a.removeClassName('active')}function menuco2(b,c){b=$(b);if(c){b.addClassName('active');b.select('.second_level_menu').each(function(s,a){s.style.display='block'})}else{b.removeClassName('active');b.select('.second_level_menu').each(function(s,a){s.style.display='none'})}}function bskt_anim(a){Obj=$('basket_container');if(a){Obj.style.backgroundPosition='bottom';Obj.select('.text_passive').each(function(s){s.removeClassName("visible")});Obj.select('.text_active').each(function(s){s.addClassName("visible")})}else{Obj.style.backgroundPosition='top';Obj.select('.text_active').each(function(s){s.removeClassName("visible")});Obj.select('.text_passive').each(function(s){s.addClassName("visible")})}}function feedback(){var a;if(''==$F('feedback_title'))a='пожалуйста, напишите тему сообщения';if($F('sha1')!=SHA1($F('capt4a')))a='неправильно введены цифры с картинки';if(a){alert(a);return false}$('f_feedback').request({onComplete:function(){}});rClose();alert('Ваше сообщение передано, спасибо !');return true}function searchCO(){var a=$F('srch');if(a.lenght<3){alert('Поисковая фраза должна состоять минимум из 3-х символов !');return}repl=/[\?|\*]/ig;a=a.replace(repl,'');repl=/"/g;a=a.replace(repl,'&quot;');var b='/content/search/'+encodeURIComponent(a);load_through_ajax(b)}document.observe('dom:loaded',function(){if($('basket_container'))bsk_sum();if($('m_group')){id='m_'+$F('m_group');if($(id))$(id).addClassName('current')}if($('l_choice_on'))swit4_choice(2)});function SHA1(e){function rotate_left(n,s){var a=(n<<s)|(n>>>(32-s));return a};function lsb_hex(a){var b="";var i;var c;var d;for(i=0;i<=6;i+=2){c=(a>>>(i*4+4))&0x0f;d=(a>>>(i*4))&0x0f;b+=c.toString(16)+d.toString(16)}return b};function cvt_hex(a){var b="";var i;var v;for(i=7;i>=0;i--){v=(a>>>(i*4))&0x0f;b+=v.toString(16)}return b};function Utf8Encode(a){a=a.replace(/\r\n/g,"\n");var b="";for(var n=0;n<a.length;n++){var c=a.charCodeAt(n);if(c<128){b+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){b+=String.fromCharCode((c>>6)|192);b+=String.fromCharCode((c&63)|128)}else{b+=String.fromCharCode((c>>12)|224);b+=String.fromCharCode(((c>>6)&63)|128);b+=String.fromCharCode((c&63)|128)}}return b};var f;var i,j;var W=new Array(80);var g=0x67452301;var h=0xEFCDAB89;var k=0x98BADCFE;var l=0x10325476;var m=0xC3D2E1F0;var A,B,C,D,E;var o;e=Utf8Encode(e);var p=e.length;var q=new Array();for(i=0;i<p-3;i+=4){j=e.charCodeAt(i)<<24|e.charCodeAt(i+1)<<16|e.charCodeAt(i+2)<<8|e.charCodeAt(i+3);q.push(j)}switch(p%4){case 0:i=0x080000000;break;case 1:i=e.charCodeAt(p-1)<<24|0x0800000;break;case 2:i=e.charCodeAt(p-2)<<24|e.charCodeAt(p-1)<<16|0x08000;break;case 3:i=e.charCodeAt(p-3)<<24|e.charCodeAt(p-2)<<16|e.charCodeAt(p-1)<<8|0x80;break}q.push(i);while((q.length%16)!=14)q.push(0);q.push(p>>>29);q.push((p<<3)&0x0ffffffff);for(f=0;f<q.length;f+=16){for(i=0;i<16;i++)W[i]=q[f+i];for(i=16;i<=79;i++)W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);A=g;B=h;C=k;D=l;E=m;for(i=0;i<=19;i++){o=(rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=o}for(i=20;i<=39;i++){o=(rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=o}for(i=40;i<=59;i++){o=(rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=o}for(i=60;i<=79;i++){o=(rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=o}g=(g+A)&0x0ffffffff;h=(h+B)&0x0ffffffff;k=(k+C)&0x0ffffffff;l=(l+D)&0x0ffffffff;m=(m+E)&0x0ffffffff}var o=cvt_hex(g)+cvt_hex(h)+cvt_hex(k)+cvt_hex(l)+cvt_hex(m);return o.toLowerCase()}function load_through_ajax(b,c){var d=$('content');if(c)d=$(c);var e=Math.random()*99999999999;var g=/\?/;if(g.test(b))b+='&cache='+e;else b+='?cache='+e;if($('d_wrapper')!=null){$('d_wrapper').setStyle({'display':'block',top:'0px',left:'0px','width':'100%','height':'500%',opacity:'0.3'})}new Ajax.Request(b,{method:'get',encoding:'windows-1251',onSuccess:function f(a){d.update(a.responseText);if($('d_wrapper'))$('d_wrapper').setStyle({display:'none'})}})}nheight=0;function review_slide_down(){Obj=$('d_review_comments_inner');if(nheight<170){nheight+=7;Obj.style.height=nheight+'px';setTimeout('review_slide_down()',20)}else{Obj.style.padding='20px';Obj.scrollIntoView(true);$('d_review_add_head').hide()}}function review_add(a){if($F('txt_review')==''){alert('вы забыли написать отзыв');return false}if($F('i_review_name')==''){alert('представтесь пожалуйста');return false}if(a==null||a==undefined)a=-1;$('d_wrapper').style.display='block';$('txt_review').value=encodeURIComponent($F('txt_review'));$('i_review_name').value=encodeURIComponent($F('i_review_name'));$('f_review').action='/review/mode=comments&id='+a;$('f_review').request({onComplete:function(){location.reload()}})}function ZZ(a,b){if(undefined==b){var c=prompt('Укажите нужное количество товара','1');if(undefined==c)return;if(c<1|c!=parseInt(c)){alert('введите целое положительное число');return}var d=true;if(e!=null)if(e[a]>0)if(!confirm('Этот товар уже есть в корзине ! Изменить кол-во на '+c+' ?'))d=false;if(!d)return}else{c=1*b}var e=new Object();e=getZakazObj();e[a]=c;setCookie('zakaz',Object.toJSON(e));bsk_sum()}function getZakazObj(){var a=new Object();var b=getCookie('zakaz');if(b!=null&&b!=''){a=b.evalJSON(true)}return a}function re_calc(){var a=getElementsByName_fix('idg','input');var b=0;var c=new Object();for(i=0;i<a.length;i++){ID=a[i].value;cnt=$('cnt'+ID).value;PR=$F('pr'+ID);if(cnt>0){c[ID]=cnt}else{$("tr"+ID).style.display='none'}b+=cnt*PR;$('sum'+ID).value=nice(cnt*PR)}setCookie('zakaz',Object.toJSON(c));b=(b).floor()+'.'+((b-(b).floor())*100).round();$("itogo").value=b;if(0<b){$('border').disabled=false}else{$('border').disabled=true}bsk_sum()}function nice(a){a=parseFloat(a);return Math.round(a*100+0.04)/100}var bsk;function bskt(){new Ajax.Request('/list/basket',{method:'get',onSuccess:function f(a){$('main_block').update(a.responseText)}})}function bsk_on_load(){window.name='bsk'}function bsk_sum(){if($('basket_container')){new Ajax.Request('/order/basket_sum/',{method:'get',evalScripts:false,onSuccess:function f(a){rez=a.responseText.evalJSON();$('basket_container').select('.quantity2').each(function(s){s.update(rez.amt)});$('basket_container').select('.quantity3').each(function(s){s.update(rez.sum)})}})}}function swit4_choice(a){$Obj=$('d_choice_nb');if(undefined==$Obj)return false;if($Obj.getStyle('display')=='none'||2==a){$Obj.setStyle({display:'block'});if($('d_link_to_choice'))$('d_link_to_choice').update('<a href="#" onclick="swit4_choice()"><strong><u>СКРЫТЬ</u> ПОДБОР НОУТБУКОВ ПО ПАРАМЕТРАМ</strong></a>')}else if($Obj.getStyle('display')=='block'||3==a){$Obj.setStyle({display:'none'});if($('d_link_to_choice'))$('d_link_to_choice').update('<a href="#" onclick="swit4_choice()"><strong><u>ПОКАЗАТЬ</u> ПОДБОР НОУТБУКОВ ПО ПАРАМЕТРАМ</strong></a>')}return true}function choice_nb(){$('f_choice_nb').action=$('f_choice_nb').action+$('choice_from').value+'-'+$('choice_to').value+'/';$('f_choice_nb').request({method:'post',onComplete:function(a){$('list_content').innerHTML=a.responseText}});return false}function choice_clear(a){if(undefined==$(a))return;for(i=0;i<$(a).length;i++)$(a).options[i].selected=false}function mnu1(a,b){var c='mnu_'+b;var d='mn_'+b+a;if(null==$(d)){return}ee=getElementsByName_fix(c,'div');for(var i=0;i<ee.length;i++)ee[i].style.display='none';$(d).style.display='block';$(d).select('ul').each(function(s){s.style.display='block'});$(d).select('li').each(function(s){s.style.display=''})}function setGold(a){Obj=$('mn_'+a);if(undefined==Obj)return;Obj.style.backgroundColor="azure";Obj.style.border="1px dashed"}function srch(){var a=$F('stext');var b='';repl=/[\?|\*]/ig;a=a.replace(repl,'');repl=/\//g;a=a.replace(repl,'%2F');repl=/"/g;a=a.replace(repl,'&quot;');if(undefined!=$('r_all'))if('on'==$F('r_all'))b='all/';window.location.href='/list/search_'+encodeURIComponent(a)+'/'+b;return false}function c_c(a){if(0==a)a='cash';setCookie('currency',a);document.location.href=document.location.href}function mynavigator(a,b){if(undefined==$('f_choice_nb'))return;var c=/\/choice/;if(!c.test(document.location.href))return;c=/\/page_(\d+)/i;var d=c.exec(a.href);var e=(d)?d[1]:0;c=/\/order_(\d+)/;d=c.exec(a.href);var f=(d)?d[1]:0;$('f_choice_nb').action=$('f_choice_nb').action+((e>0)?('page_'+e+'/'):'')+((f>0)?('order_'+f+'/'):'');a.href='#';$('f_choice_nb').submit()}function selectOption(a,b){Obj=$(a);for(j=0;j<Obj.options.length;j++)if(Obj.options[j].value==b)Obj.options[j].selected=true}function giftSet(a){var a=$('sGift');var b='';var c=1*$('warezId').innerHTML;for(j=0;j<a.options.length;j++)if(a.options[j].selected)b+=a.options[j].value;new Ajax.Request('/admin/services/images2w.php?id='+c,{parameters:{gift:b}})}