	

	var win=null;

	

	var good = false;



	function NewWindow(mypage, myname, w, h, scroll, pos){



		if(pos == "random"){

		

			LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width-w)) : 100;

			

			TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height-h)-75)) : 100;

			

		} else if(pos == "center"){



			LeftPosition = (screen.width) ? (screen.width-w)/2 : 100;

			

			TopPosition=(screen.height)?(screen.height-h)/2:100;

		

		} else {

		

			LeftPosition = 0;

			

			TopPosition = 20

			

		}

		settings = 'width = ' + w + ',height = ' + h + ',top = ' + TopPosition + ',left=' + LeftPosition + ',scrollbars = ' + scroll + ',location = no,directories = no,status = yes,menubar = no,toolbar = no,resizable = yes';

		

		win = window.open(mypage, myname, settings);

		

	}

		

	function check() {

		

		reg = /\w+@\w+\.\w{2,4}/i;

		

		comp = document.order.email.value.match(reg);

		

		if(document.order.name.value == '') {	

			

			alert("Введите Ваше имя!");

			

			document.order.name.focus();



		} else if(document.order.phone.value == '') {

			

			alert("Введите Ваш телефон!");



			document.order.phone.focus();



		} else if(document.order.adress.value == '') {



			alert("Введите адрес!");



			document.order.adress.focus();



		} else if(document.order.email.value != '' && comp == null) {



			alert("Введите e-mail!");



			document.order.email.focus();



		} else {

				

			good = true;

			

		}

			

		return good;

		

	}

	



	function opin() {

		

		reg = /\w+@\w+\.\w{2,4}/i;

		

		comp = document.opinions.email.value.match(reg);

		

		if(document.opinions.name.value == '') {	

			

			alert("Введите Ваше имя!");

			

			document.opinions.name.focus();



		} else if(document.opinions.email.value != '' && comp == null) {



			alert("Введите e-mail!");



			document.opinions.email.focus();



		} else if(document.opinions.opinion.value == '') {



			alert("Введите Ваше мнение!");



			document.opinions.opinion.focus();



		} else {

				

			good = true;

			

		}

			

		return good;

		

	}



	function check_order() {

		

		reg = /\w+@\w+\.\w{2,4}/i;

		

		comp = document.order.email.value.match(reg);

		

		if(document.order.name.value == '') {	

			

			alert("Введите Ваше имя!");

			

			document.order.name.focus();



		} else if(document.order.email.value != '' && comp == null) {



			alert("Введите e-mail!");



			document.order.email.focus();



		} else if(document.order.phone.value == '') {



			alert("Введите Ваш телефон!");



			document.order.phone.focus();



		} else if(document.order.adress.value == '') {



			alert("Введите Ваш адрес!");



			document.order.adress.focus();



		} else {

				

			good = true;

			

		}

			

		return good;

		

	}


