function SelectAllItemsByPrefix(c,b){element_array=document.getElementsByTagName("input");if(element_array.length>0){for(var a=0;a<element_array.length;a++){if(element_array[a].name.search(b)!=-1){element_array[a].checked=c}}}}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=window.innerWidth+window.scrollMaxX;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){if(document.documentElement.clientWidth){b=document.documentElement.clientWidth}else{b=self.innerWidth}d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=c}else{pageWidth=b}arrayPageSize=new Array();arrayPageSize.pWidth=pageWidth;arrayPageSize.pHeight=pageHeight;arrayPageSize.wWidth=b;arrayPageSize.wHeight=d;return arrayPageSize}function getScrollXY(){var b=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;b=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;b=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}}}var c=new Array();c.scrollX=b;c.scrollY=a;return c}function locateSplash(){var c=new Array();c=getPageSize();var b=new Array();b=getScrollXY();var a=document.getElementById("splash");if(a){a.style.height=c.pHeight+"px";a.style.width=c.pWidth+"px"}var d=document.getElementById("splash_bar");if(d){d.style.width=c.wWidth+"px";d.style.top=Math.round(c.wHeight/2)+b.scrollY+"px"}}function showSplash(c){locateSplash();var b=document.getElementById("loader_msg");if(b){if(c!==undefined){b.innerHTML=c+"<br />пожалуйста подождите..."}else{b.innerHTML="Пожалуйста подождите..."}}var a=document.getElementById("splash_wrapper");if(a){a.style.display="block"}document.body.style.cursor="wait"}function hideSplash(){document.body.style.cursor="";var a=document.getElementById("splash_wrapper");a.style.display="none"}function callbackfunction_AddIntoCart(c){sended_request=false;if(typeof c!="undefined"){if(typeof c.cart!="undefined"){var a=c.cart;var b=document.getElementById("cart_placeholder");if(b){b.innerHTML=a}else{alert("Ошибка! Краткая корзина не найдена")}}}}function AddIntoCart(c,b,a){cmsrequest=c+"cart/?ajax_add_item_id="+b+"&count="+a;sendRequest(cmsrequest,"get",callbackfunction_AddIntoCart);return false}function RefreshCart(a){cmsrequest=a+"cart/?ajax_show_cart&rand="+Math.random();sendRequest(cmsrequest,"get",callbackfunction_AddIntoCart);return false}function sendRequest(b,d,c){var a=new JsHttpRequest();a.onreadystatechange=function(){if(a.readyState==4){hideSplash();if(typeof c!="undefined"){c(a.responseJS)}return true}};a.open(d,b,true);a.send(null);showSplash()}var prev_comment=0;function cr(a){if(prev_comment&&prev_comment!=a){document.getElementById(prev_comment).style.display="none"}var b=document.getElementById(a);if(b.style.display!="block"){b.style.display="block"}else{b.style.display="none"}prev_comment=a};