var GLOBAL_ACTIVE_CAT;var ACTIVE_CLASS_NAME="ext";var NOTACTIVE_CLASS_NAME="";var ACTIVE_SUBCAT_CLASS_NAME="second";var NOT_ACTIVE_SUBCAT_CLASS_NAME=ACTIVE_SUBCAT_CLASS_NAME+" hidden";function openCategory(c){if(GLOBAL_ACTIVE_CAT==c){return false}GLOBAL_ACTIVE_CAT=c;var b=document.getElementById("catalog");var a=b.getElementsByTagName("li");$i=0;while($i<a.length){if(a[$i].getElementsByTagName("a")[0].innerHTML==c){a[$i].className=ACTIVE_CLASS_NAME;$i++;while($i<a.length&&a[$i].className==NOT_ACTIVE_SUBCAT_CLASS_NAME){a[$i].className=ACTIVE_SUBCAT_CLASS_NAME;$i++}}else{if($i<a.length&&a[$i].className==ACTIVE_CLASS_NAME){a[$i].className=NOTACTIVE_CLASS_NAME;$i++;while($i<a.length&&a[$i].className==ACTIVE_SUBCAT_CLASS_NAME){a[$i].className=NOT_ACTIVE_SUBCAT_CLASS_NAME;$i++}}else{if(a[$i].className==NOTACTIVE_CLASS_NAME){$i++;while($i<a.length&&a[$i].className==NOT_ACTIVE_SUBCAT_CLASS_NAME){$i++}}else{$i++}}}}return false}function addInBasket(a){document.getElementById("form_basket_"+a).submit()}function checkOrderForm(){var a="#FF8356";var d=document.getElementById("frm");var c=new RegExp("^[^@]+@.*\\.[0-9A-Za-z^\\.]{1,5}$");var b=new RegExp("^[0-9\\-\\+\\s]{10,}$");if(!c.test(d.email.value)&&!b.test(d.phone.value)){alert("Заполните, пожалуйста, поле `E-mail` или `Телефон`");d.email.focus();d.email.style.background=a;return false}else{if(d.delivery.value==1&&d.lastname.value.length==0){alert("При выборе доставки почтой, нужно заполнить поле `Фамилия`");d.lastname.focus();d.lastname.style.background=a;return false}else{if(d.address.value.length<9){alert("Заполните, пожалуйста, поле `Адрес`");d.address.focus();d.address.style.background=a;return false}}}return true}function checkField(d){var a="#CAFF7C";var b="#FF8356";switch(d.name){case"email":var c=new RegExp("^[a-zA-Z0-9-._]*@[a-zA-Z0-9-._]+.[a-zA-Z0-9]{2,6}$");if(!c.test(d.value)){d.focus();d.style.background=b;return false}else{d.style.background=a}break;case"phone":var c=new RegExp("^[0-9\\-\\+\\s]{10,}$");if(!c.test(d.value)){d.focus();d.style.background=b;return false}else{d.style.background=a}break;case"lastname":if(d.value.length<1){d.focus();d.style.background=b;return false}else{d.style.background=a}break;case"address":if(d.value.length<9){d.focus();d.style.background=b;return false}else{d.style.background=a}break;default:break}}function showForm(b){var a=document.getElementById(b);a.style.display=(a.style.display=="none"?"":"none")};
