var wndDisclaimer;
function Disclamer(){
	var s;
	s="";
	txt=document.order_form.email.value; 
	dog = txt.indexOf("@");
	if (document.order_form.name.value==""){
		s = "Пожалуйста, заполните поле \"Контактное лицо\"\n\n" + s;
		alert(s);
	}
	else if (txt == "") {
		alert("Пожалуйста, введите ваш e-mail адрес");
		return(false) 
	}
	else if (txt.indexOf(".") == -1) {
		showerror();
		return(false)
	}
	else if (dog == -1) { 
		showerror();
		return(false) 
	}
	else if ((dog <1) || (dog> txt.length - 5)) {
		showerror();
		return(false) 
	} 
	else if ((txt.charAt(dog - 1) == '.') || (txt.charAt(dog + 1) == '.')) {
		showerror(); 
		return(false) }
	else {
		document.order_form.submit()  
	}
}

function showerror() { 
	alert("E-mail адрес некорректный");
} 

function openPrintVersion(type, pr1) {
	url = "print.php?type="+type+"&pr1="+pr1;
	params = "width=640,height=400,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=50";
	winPV = window.open(url, "winPrintVersion", params);
	winPV.focus();
}

function openPriceItem(param1, param2) {
	url = "info.php?fid="+param1+"&prid="+param2;
	params = "width=530,height=430,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=50";
	winPI = window.open(url, "winPriceItem", params);
	winPI.focus();
}

function openOrderItem(param1, param2) {
	url = "order.php?type=sng_ord&fid="+param1+"&prid="+param2;
	params = "width=400,height=350,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=200";
	winOI = window.open(url, "winOrderItem", params);
	winOI.focus();
}

function openMultiOrderItem() {
	url = "order.php?type=multi_ord";
	for (i=0; i<document.price.length; i++){
		if (document.price.elements[i].type == "checkbox"){
			if (document.price.elements[i].name.indexOf("item_") == 0){
				if (document.price.elements[i].checked == true){
					url = url+"&"+document.price.elements[i].name+"="+document.price.elements[i].value;
				}
			}
		}
	}
	params = "width=400,height=350,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=200";
	winMOI = window.open(url, "winMultiOrderItem", params);
	winMOI.focus();
}

function openCompare(){
	url = "info.php?type=compare";
	for (i=0; i<document.price.length; i++){
		if (document.price.elements[i].type == "checkbox"){
			if (document.price.elements[i].name.indexOf("item_") == 0){
				if (document.price.elements[i].checked == true){
					url = url+"&"+document.price.elements[i].name+"="+document.price.elements[i].value;
				}
			}
		}
	}
	params = "width=600,height=350,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=50,left=200";
	winCmp = window.open(url, "winCompare", params);
	winCmp.focus();
}

function selectAll(){
	for (i=0; i<document.price.length; i++){
		if (document.price.elements[i].type == "checkbox"){
			if (document.price.elements[i].name.indexOf("item_") == 0){
				document.price.elements[i].checked = true;
			}
		}
	}
}

function clearAll(){
	for (i=0; i<document.price.length; i++){
		if (document.price.elements[i].type == "checkbox"){
			if (document.price.elements[i].name.indexOf("item_") == 0){
				document.price.elements[i].checked = false;
			}
		}
	}
}

function invertAll(){
	for (i=0; i<document.price.length; i++){
		if (document.price.elements[i].type == "checkbox"){
			if (document.price.elements[i].name.indexOf("item_") == 0){
				if (document.price.elements[i].checked == true){
					document.price.elements[i].checked = false;
				}
				else {
					document.price.elements[i].checked = true;
				}
			}
		}
	}
}
