function foto(src) {
	window.open("/image.php?src="+src,"","width=100,height=100,resizable");
}


function enterForm(login, password) {
	document.user_forma.login.value = login;
	document.user_forma.password.value = password;
	document.user_forma.submit();
}



		function isRu (InString) {
			var out=true;
			var RefString="абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦШЩЪЫЬЭЮЯ- ";
			for (Count=0; Count < InString.length; Count++) {
				TempChar= InString.substring (Count, Count+1);
				if (RefString.indexOf (TempChar, 0)==-1) out=false;
			}
			return (out);
		}
		function isRuNum (InString) {
			var out=true;
			var RefString="0123456789абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦШЩЪЫЬЭЮЯ-. ";
			for (Count=0; Count < InString.length; Count++) {
				TempChar= InString.substring (Count, Count+1);
				if (RefString.indexOf (TempChar, 0)==-1) out=false;
			}
			return (out);
		}
		function isEnNum (InString) {
			var out=true;
			var RefString="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
			for (Count=0; Count < InString.length; Count++) {
				TempChar= InString.substring (Count, Count+1);
				if (RefString.indexOf (TempChar, 0)==-1) out=false;
			}
			return (out);
		}
		function checkAllForm() {
			var error="";
			if (document.users_data.login_new.value=="") {
				error+="Введите желаемый логин! \n";
			} else {
				if (!isEnNum(document.users_data.login_new.value)) error+="Поле \"Логин\" содержит недопустимые символы! \n";
				if ((document.users_data.login_new.value.length<4) || (document.users_data.login_new.value.length>20)) error+="Поле \"Логин\" должно содержать от 4 до 20 символов! \n";
			}
			if (document.users_data.password_new.value=="") {
				error+="Введите пароль! \n";
			} else {
				if (!isEnNum(document.users_data.password_new.value)) error+="Поле \"Пароль\" содержит недопустимые символы! \n";
				if ((document.users_data.password_new.value.length<4) || (document.users_data.password_new.value.length>20)) error+="Поле \"Пароль\" должно содержать от 4 до 20 символов! \n";
			}
			if (document.users_data.password_new2.value=="") {
				error+="Введите подтверждение пароля! \n";
			} else {
				if (!isEnNum(document.users_data.password_new2.value)) error+="Поле \"Подтверждение пароля\" содержит недопустимые символы! \n";
			}
			if (document.users_data.password_new.value!=document.users_data.password_new2.value) error+="Поля \"Пароль\" и \"Подтверждение пароля\" содержат различные данные! \n";
			if (document.users_data.name1_new.value=="") {
				error+="Введите вашу фамилию! \n";
			} else {
				if (!isRu(document.users_data.name1_new.value)) error+="Поле \"Фамилия\" содержит недопустимые символы! \n";
			}
			if (document.users_data.name2_new.value=="") {
				error+="Введите ваше имя! \n";
			} else {
				if (!isRu(document.users_data.name2_new.value)) error+="Поле \"Имя\" содержит недопустимые символы! \n";
			}
			if (document.users_data.name3_new.value=="") {
				error+="Введите ваше отчество! \n";
			} else {
				if (!isRu(document.users_data.name3_new.value)) error+="Поле \"Отчество\" содержит недопустимые символы! \n";
			}
			if (document.users_data.mail_new.value=="") {
				error+="Введите ваш e-mail! \n";
			} else {
				if ((document.users_data.mail_new.value.indexOf("@")==-1) || (document.users_data.mail_new.value.indexOf("@")==-1)) {
					error+="Введенный e-mail имеет недопустимый формат! \n";
				}
			}
			if ((document.users_data.tel13_new.value+document.users_data.tel23_new.value+document.users_data.tel33_new.value+document.users_data.tel43_new.value+document.users_data.tel53_new.value)=="") { error+="Введите хотя бы один номер телефона! \n"; }
			var adr="";
			if (document.users_data.home_city_new.value!="") { adr+="г."+document.users_data.home_city_new.value+", "; }
			if (document.users_data.home_metro_new.value!="") { adr+="метро &#8220;"+document.users_data.home_metro_new.value+"&#8221;, "; }
			if (document.users_data.home_street_new.value!="") { adr+="ул."+document.users_data.home_street_new.value+", "; }
			if (document.users_data.home_house_new.value!="") { adr+="д."+document.users_data.home_house_new.value+", "; }
			if (document.users_data.home_korpus_new.value!="") { adr+="кор."+document.users_data.home_korpus_new.value+", "; }
			if (document.users_data.home_stroenie_new.value!="") { adr+="стр."+document.users_data.home_stroenie_new.value+", "; }
			if (document.users_data.home_podezd_new.value!="") { adr+=document.users_data.home_podezd_new.value+"подъезд, "; }
			if (document.users_data.home_etaj_new.value!="") { adr+=document.users_data.home_etaj_new.value+" эт., "; }
			if (document.users_data.home_flat_new.value!="") { adr+="кв."+document.users_data.home_flat_new.value+", "; }
			if (document.users_data.home_kod_new.value!="") { adr+="код домофона: "+document.users_data.home_kod_new.value; }

			var adr2="";
			if (document.users_data.home2_city_new.value!="") { adr2+="г."+document.users_data.home2_city_new.value+", "; }
			if (document.users_data.home2_metro_new.value!="") { adr2+="метро &#8220;"+document.users_data.home2_metro_new.value+"&#8221;, "; }
			if (document.users_data.home2_street_new.value!="") { adr2+="ул."+document.users_data.home2_street_new.value+", "; }
			if (document.users_data.home2_house_new.value!="") { adr2+="д."+document.users_data.home2_house_new.value+", "; }
			if (document.users_data.home2_korpus_new.value!="") { adr2+="кор."+document.users_data.home2_korpus_new.value+", "; }
			if (document.users_data.home2_stroenie_new.value!="") { adr2+="стр."+document.users_data.home2_stroenie_new.value+", "; }
			if (document.users_data.home2_podezd_new.value!="") { adr2+=document.users_data.home2_podezd_new.value+"подъезд, "; }
			if (document.users_data.home2_etaj_new.value!="") { adr2+=document.users_data.home2_etaj_new.value+" эт., "; }
			if (document.users_data.home2_flat_new.value!="") { adr2+="кв."+document.users_data.home2_flat_new.value+", "; }
			if (document.users_data.home2_kod_new.value!="") { adr2+="код домофона: "+document.users_data.home2_kod_new.value; }

			var adrW="";
			if (document.users_data.work_city_new.value!="") { adrW+="г."+document.users_data.work_city_new.value+", "; }
			if (document.users_data.work_metro_new.value!="") { adrW+="метро &#8220;"+document.users_data.work_metro_new.value+"&#8221;, "; }
			if (document.users_data.work_street_new.value!="") { adrW+="ул."+document.users_data.work_street_new.value+", "; }
			if (document.users_data.work_house_new.value!="") { adrW+="д."+document.users_data.work_house_new.value+", "; }
			if (document.users_data.work_korpus_new.value!="") { adrW+="кор."+document.users_data.work_korpus_new.value+", "; }
			if (document.users_data.work_stroenie_new.value!="") { adrW+="стр."+document.users_data.work_stroenie_new.value+", "; }
			if (document.users_data.work_podezd_new.value!="") { adrW+=document.users_data.work_podezd_new.value+"подъезд, "; }
			if (document.users_data.work_etaj_new.value!="") { adrW+=document.users_data.work_etaj_new.value+" эт., "; }
			if (document.users_data.work_office_new.value!="") { adrW+="оф."+document.users_data.work_office_new.value+", "; }
			if (document.users_data.work_org_new.value!="") { adrW+="&#8220;"+document.users_data.work_org_new.value+"&#8221;"; }

			if ((adr=="") && (adrW=="")) { error+="Введите хотя бы один адрес! \n"; }
			if (adr2!="") {
				if (document.users_data.home2_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home2_city_new.value=="other") {
						if (document.users_data.home2_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home2_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home2_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home2_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home2_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
			}
			if ((adr!="") && (adrW=="")) {
				if (document.users_data.home_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home_city_new.value=="other") {
						if (document.users_data.home_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
			}
			if ((adr=="") && (adrW!="")) {
				if (document.users_data.work_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.work_city_new.value=="other") {
						if (document.users_data.work_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.work_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.work_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.work_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.work_org_new.value=="") { error+="Введите название организации! \n"; }
			}
			if ((adr!="") && (adrW!="")) {
				if (document.users_data.home_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home_city_new.value=="other") {
						if (document.users_data.home_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
				if (document.users_data.work_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.work_city_new.value=="other") {
						if (document.users_data.work_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.work_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.work_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.work_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.work_org_new.value=="") { error+="Введите название организации! \n"; }
			}
			if (document.users_data.otkuda_new.value=="") { error+="Отметьте поле \"Как вы узнали о нас\"! \n"; }
			if (document.users_data.job_new.value=="") { error+="Отметьте поле \"Ваш род занятий\"! \n"; }
			if (document.users_data.key.value=="") { error+="Введите число, указанное на картинке! \n"; }
			if (error!="") {
				alert(error);
			} else {
				var tel="";
				tel=document.users_data.tel11.value+";"+document.users_data.tel12.value+";"+document.users_data.tel13.value+";"+document.users_data.tel14.value+"|"+document.users_data.tel21.value+";"+document.users_data.tel22.value+";"+document.users_data.tel23.value+";"+document.users_data.tel24.value+"|"+document.users_data.tel31.value+";"+document.users_data.tel32.value+";"+document.users_data.tel33.value+";"+document.users_data.tel34.value+"|"+document.users_data.tel41.value+";"+document.users_data.tel42.value+";"+document.users_data.tel43.value+";"+document.users_data.tel44.value+"|"+document.users_data.tel51.value+";"+document.users_data.tel52.value+";"+document.users_data.tel53.value+";"+document.users_data.tel54.value;
				document.users_data.tel_new.value=tel;
				var adres="";
				adres="1;"+adr+"|2;"+adrW;
				document.users_data.adres_new.value=adres;
				document.users_data.users_data.Submit();
			}
		}			
		function addDopAdr() {
			var error="";
			var adr="";
			if (document.users_data.home_city_new.value!="") { adr+="г."+document.users_data.home_city_new.value+", "; }
			if (document.users_data.home_metro_new.value!="") { adr+="метро &#8220;"+document.users_data.home_metro_new.value+"&#8221;, "; }
			if (document.users_data.home_street_new.value!="") { adr+="ул."+document.users_data.home_street_new.value+", "; }
			if (document.users_data.home_house_new.value!="") { adr+="д."+document.users_data.home_house_new.value+", "; }
			if (document.users_data.home_korpus_new.value!="") { adr+="кор."+document.users_data.home_korpus_new.value+", "; }
			if (document.users_data.home_stroenie_new.value!="") { adr+="стр."+document.users_data.home_stroenie_new.value+", "; }
			if (document.users_data.home_podezd_new.value!="") { adr+=document.users_data.home_podezd_new.value+"подъезд, "; }
			if (document.users_data.home_etaj_new.value!="") { adr+=document.users_data.home_etaj_new.value+" эт., "; }
			if (document.users_data.home_flat_new.value!="") { adr+="кв."+document.users_data.home_flat_new.value+", "; }
			if (document.users_data.home_kod_new.value!="") { adr+="код домофона: "+document.users_data.home_kod_new.value; }

			var adrW="";
			if (document.users_data.work_city_new.value!="") { adrW+="г."+document.users_data.work_city_new.value+", "; }
			if (document.users_data.work_metro_new.value!="") { adrW+="метро &#8220;"+document.users_data.work_metro_new.value+"&#8221;, "; }
			if (document.users_data.work_street_new.value!="") { adrW+="ул."+document.users_data.work_street_new.value+", "; }
			if (document.users_data.work_house_new.value!="") { adrW+="д."+document.users_data.work_house_new.value+", "; }
			if (document.users_data.work_korpus_new.value!="") { adrW+="кор."+document.users_data.work_korpus_new.value+", "; }
			if (document.users_data.work_stroenie_new.value!="") { adrW+="стр."+document.users_data.work_stroenie_new.value+", "; }
			if (document.users_data.work_podezd_new.value!="") { adrW+=document.users_data.work_podezd_new.value+"подъезд, "; }
			if (document.users_data.work_etaj_new.value!="") { adrW+=document.users_data.work_etaj_new.value+" эт., "; }
			if (document.users_data.work_office_new.value!="") { adrW+="оф."+document.users_data.work_office_new.value+", "; }
			if (document.users_data.work_org_new.value!="") { adrW+="&#8220;"+document.users_data.work_org_new.value+"&#8221;"; }

			if ((adr=="") && (adrW=="")) { error+="Заполните сначала информацию о домашнем или рабочем адресах! \n"; }
			if (error != "") {
				alert(error);
			} else {
				document.getElementById("dopadr").style.visibility = "visible";
				document.getElementById("dopadr").style.height = "380px";
				document.getElementById("adrAddBtn").style.visibility = "hidden";
				document.getElementById("adrAddBtn").style.height = "1px";
			}
		}			
		var telCount=1;
		function addTel() {
			telCount++;
			curDiv=document.getElementById("tel"+telCount);
			curDiv.style.visibility="visible";
			curDiv.style.overflow="visible";
			curDiv.style.height="25px";
			if (telCount==5) {
				curEl=document.getElementById("telAddBtn");
				curEl.style.visibility="hidden";
				curEl.style.height="0px";
			}
		}


///////////////////////


		function checkAllForm2() {
			var error="";
			if (document.users_data.login_new.value=="") {
				error+="Введите желаемый логин! \n";
			} else {
				if (!isEnNum(document.users_data.login_new.value)) error+="Поле \"Логин\" содержит недопустимые символы! \n";
				if ((document.users_data.login_new.value.length<4) || (document.users_data.login_new.value.length>20)) error+="Поле \"Логин\" должно содержать от 4 до 20 символов! \n";
			}
			if (document.users_data.password_new.value!="") {
				if (!isEnNum(document.users_data.password_new.value)) error+="Поле \"Пароль\" содержит недопустимые символы! \n";
				if ((document.users_data.password_new.value.length<4) || (document.users_data.password_new.value.length>20)) error+="Поле \"Пароль\" должно содержать от 4 до 20 символов! \n";
			}
			if (document.users_data.password_new2.value!="") {
				if (!isEnNum(document.users_data.password_new2.value)) error+="Поле \"Подтверждение пароля\" содержит недопустимые символы! \n";
			}
			if (document.users_data.password_new.value!=document.users_data.password_new2.value) error+="Поля \"Пароль\" и \"Подтверждение пароля\" содержат различные данные! \n";
			if (document.users_data.name_new.value=="") {
				error+="Введите ФИО! \n";
			} else {
				if (!isRu(document.users_data.name_new.value)) error+="Поле \"ФИО\" содержит недопустимые символы! \n";
			}
			if (document.users_data.mail_new.value=="") {
				error+="Введите ваш e-mail! \n";
			} else {
				if ((document.users_data.mail_new.value.indexOf("@")==-1) || (document.users_data.mail_new.value.indexOf("@")==-1)) {
					error+="Введенный e-mail имеет недопустимый формат! \n";
				}
			}
			if ((document.users_data.tel13_new.value+document.users_data.tel23_new.value+document.users_data.tel33_new.value+document.users_data.tel43_new.value+document.users_data.tel53_new.value)=="") { error+="Введите хотя бы один номер телефона! \n"; }
			var adr="";
			if (document.users_data.home_city_new.value!="") { adr+="г."+document.users_data.home_city_new.value+", "; }
			if (document.users_data.home_metro_new.value!="") { adr+="метро &#8220;"+document.users_data.home_metro_new.value+"&#8221;, "; }
			if (document.users_data.home_street_new.value!="") { adr+="ул."+document.users_data.home_street_new.value+", "; }
			if (document.users_data.home_house_new.value!="") { adr+="д."+document.users_data.home_house_new.value+", "; }
			if (document.users_data.home_korpus_new.value!="") { adr+="кор."+document.users_data.home_korpus_new.value+", "; }
			if (document.users_data.home_stroenie_new.value!="") { adr+="стр."+document.users_data.home_stroenie_new.value+", "; }
			if (document.users_data.home_podezd_new.value!="") { adr+=document.users_data.home_podezd_new.value+"подъезд, "; }
			if (document.users_data.home_etaj_new.value!="") { adr+=document.users_data.home_etaj_new.value+" эт., "; }
			if (document.users_data.home_flat_new.value!="") { adr+="кв."+document.users_data.home_flat_new.value+", "; }
			if (document.users_data.home_kod_new.value!="") { adr+="код домофона: "+document.users_data.home_kod_new.value; }

			var adr2="";
			if (document.users_data.home2_city_new.value!="") { adr2+="г."+document.users_data.home2_city_new.value+", "; }
			if (document.users_data.home2_metro_new.value!="") { adr2+="метро &#8220;"+document.users_data.home2_metro_new.value+"&#8221;, "; }
			if (document.users_data.home2_street_new.value!="") { adr2+="ул."+document.users_data.home2_street_new.value+", "; }
			if (document.users_data.home2_house_new.value!="") { adr2+="д."+document.users_data.home2_house_new.value+", "; }
			if (document.users_data.home2_korpus_new.value!="") { adr2+="кор."+document.users_data.home2_korpus_new.value+", "; }
			if (document.users_data.home2_stroenie_new.value!="") { adr2+="стр."+document.users_data.home2_stroenie_new.value+", "; }
			if (document.users_data.home2_podezd_new.value!="") { adr2+=document.users_data.home2_podezd_new.value+"подъезд, "; }
			if (document.users_data.home2_etaj_new.value!="") { adr2+=document.users_data.home2_etaj_new.value+" эт., "; }
			if (document.users_data.home2_flat_new.value!="") { adr2+="кв."+document.users_data.home2_flat_new.value+", "; }
			if (document.users_data.home2_kod_new.value!="") { adr2+="код домофона: "+document.users_data.home2_kod_new.value; }

			var adrW="";
			if (document.users_data.work_city_new.value!="") { adrW+="г."+document.users_data.work_city_new.value+", "; }
			if (document.users_data.work_metro_new.value!="") { adrW+="метро &#8220;"+document.users_data.work_metro_new.value+"&#8221;, "; }
			if (document.users_data.work_street_new.value!="") { adrW+="ул."+document.users_data.work_street_new.value+", "; }
			if (document.users_data.work_house_new.value!="") { adrW+="д."+document.users_data.work_house_new.value+", "; }
			if (document.users_data.work_korpus_new.value!="") { adrW+="кор."+document.users_data.work_korpus_new.value+", "; }
			if (document.users_data.work_stroenie_new.value!="") { adrW+="стр."+document.users_data.work_stroenie_new.value+", "; }
			if (document.users_data.work_podezd_new.value!="") { adrW+=document.users_data.work_podezd_new.value+"подъезд, "; }
			if (document.users_data.work_etaj_new.value!="") { adrW+=document.users_data.work_etaj_new.value+" эт., "; }
			if (document.users_data.work_office_new.value!="") { adrW+="оф."+document.users_data.work_office_new.value+", "; }
			if (document.users_data.work_org_new.value!="") { adrW+="&#8220;"+document.users_data.work_org_new.value+"&#8221;"; }

			if ((adr=="") && (adrW=="")) { error+="Введите хотя бы один адрес! \n"; }
			if (adr2!="") {
				if (document.users_data.home2_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home2_city_new.value=="other") {
						if (document.users_data.home2_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home2_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home2_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home2_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home2_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
			}
			if ((adr!="") && (adrW=="")) {
				if (document.users_data.home_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home_city_new.value=="other") {
						if (document.users_data.home_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
			}
			if ((adr=="") && (adrW!="")) {
				if (document.users_data.work_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.work_city_new.value=="other") {
						if (document.users_data.work_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.work_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.work_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.work_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.work_org_new.value=="") { error+="Введите название организации! \n"; }
			}
			if ((adr!="") && (adrW!="")) {
				if (document.users_data.home_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.home_city_new.value=="other") {
						if (document.users_data.home_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.home_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.home_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.home_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.home_flat_new.value=="") { error+="Введите номер квартиры! \n"; }
				if (document.users_data.work_city_new.value=="") {
					error+="Выберите город! \n";
				} else {
					if (document.users_data.work_city_new.value=="other") {
						if (document.users_data.work_city_other_new.value=="") { error+="Введите название города! \n"; }
						if (document.users_data.work_index_new.value=="") { error+="Введите почтовый индекс! \n"; }
					}
				}
				if (document.users_data.work_street_new.value=="") { error+="Введите название улицы! \n"; }
				if (document.users_data.work_house_new.value=="") { error+="Введите номер дома! \n"; }
				if (document.users_data.work_org_new.value=="") { error+="Введите название организации! \n"; }
			}
			if (error!="") {
				alert(error);
			} else {
				var tel="";
				tel=document.users_data.tel11.value+";"+document.users_data.tel12.value+";"+document.users_data.tel13.value+";"+document.users_data.tel14.value+"|"+document.users_data.tel21.value+";"+document.users_data.tel22.value+";"+document.users_data.tel23.value+";"+document.users_data.tel24.value+"|"+document.users_data.tel31.value+";"+document.users_data.tel32.value+";"+document.users_data.tel33.value+";"+document.users_data.tel34.value+"|"+document.users_data.tel41.value+";"+document.users_data.tel42.value+";"+document.users_data.tel43.value+";"+document.users_data.tel44.value+"|"+document.users_data.tel51.value+";"+document.users_data.tel52.value+";"+document.users_data.tel53.value+";"+document.users_data.tel54.value;
				document.users_data.tel_new.value=tel;
				var adres="";
				adres="1;"+adr+"|2;"+adrW;
				document.users_data.adres_new.value=adres;
				document.users_data.users_data.Submit();
			}
		}			

//***************************************************//
// PHPShop JavaScript 2.1                            //
// Copyright © www.phpshop.ru.                       //
// Все права защищены.                               //
//***************************************************//

var ROOT_PATH="";


function LoadPath(my_path){
ROOT_PATH = my_path;
}

function dirPath(){
return ROOT_PATH;
}

// Активная кнопка
function ButOn(Id){
Id.className='imgOn';
}

function ButOff(Id){
Id.className='imgOff';
}

// Смайлики
function emoticon(text) {
	var txtarea = document.getElementById("message");
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}


// Подсчет лимита символов
function countSymb(lim) {
		var lim = lim || 500;
		if (document.getElementById("message").value.length > lim) {
			alert("К сожалению, вы превысили максимально допустимую длину сообщения");
			document.getElementById("message").value = document.getElementById("message").value.substring(0,lim);
			return false;
		}
		if (document.getElementById("message").value.length > (lim - 50)) {
			document.getElementById("count").style.color = "red";
		}
		if (document.getElementById("message").value.length < (lim - 50)) {
			document.getElementById("count").style.color = "green";
		}
		document.getElementById("count").innerHTML = document.getElementById("message").value.length;
}


// Комменты v1.0
function commentList(xid,comand,page,cid) {
var message="";

if(comand == "add") 
message = document.getElementById('message').value;

if(comand == "edit_add"){
message = document.getElementById('message').value;
cid = document.getElementById('commentEditId').value;
document.getElementById('commentButtonAdd').style.visibility = 'visible';
document.getElementById('commentButtonEdit').style.visibility = 'hidden';
}

if(comand == "dell"){
  if(confirm("Вы действительно хотите удалить комментарий?")){
    cid = document.getElementById('commentEditId').value;
	document.getElementById('commentButtonAdd').style.visibility = 'visible';
    document.getElementById('commentButtonEdit').style.visibility = 'hidden';
	}
	 else cid=0;
}


		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
				
				   if(comand == "edit"){
				   document.getElementById('message').value = (req.responseJS.comment||'');
				   document.getElementById('commentButtonAdd').style.visibility = 'hidden';
				   document.getElementById('commentButtonEdit').style.visibility = 'visible';
				   document.getElementById('commentButtonEdit').style.display = '';
				   document.getElementById('commentEditId').value=cid;

				   }
		else
		    {   
			document.getElementById('message').value = "";
			if(req.responseJS.status == "error") alert("Возможность добавления комментария возможна только для авторизованных пользователей.\nАвторизуйтесь или пройдите регистрацию.");
            document.getElementById('commentList').innerHTML = (req.responseJS.comment||'');
			}
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		// Реальное размещение
        var dir=dirPath();
		req.open('POST', dir+'/phpshop/comment.php', true);
		req.send({ xid: xid, comand: comand, page: page, message: message, cid: cid });
	}


// Изображения v2.1
function fotoload(xid,fid) {
document.getElementById('fotoload').innerHTML = document.getElementById('fotoload').innerHTML;
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
				document.getElementById('fotoload').innerHTML = (req.responseJS.foto||'');
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		// Реальное размещение
        var dir=dirPath();
		req.open('POST', dir+'/phpshop/fotoload.php', true);
		req.send({ xid: xid, fid: fid });
	}



// Просчет доставки
function UpdateDelivery(xid) {
		var req = new Subsys_JsHttpRequest_Js();
		var sum = document.getElementById('OrderSumma').value;
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
document.getElementById('DosSumma').innerHTML = (req.responseJS.delivery||'');
document.getElementById('d').value = xid;
document.getElementById('TotalSumma').innerHTML = (req.responseJS.total||'');
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		req.open('POST', dirPath+'phpshop/delivery.php', true);
		req.send({ xid: xid, sum: sum });
	}

// PHPShop CartAdder v 0.52
function ToCart(xid,num) {
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
					// Записываем в <div> результат работы. 
					document.getElementById('num').innerHTML = (req.responseJS.num||'');
                    document.getElementById('sum').innerHTML = (req.responseJS.sum||'');
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		req.open('POST', dirPath+'phpshop/cartload.php', true);
		req.send({ xid: xid, num: num, test:303 });
	}
	

// Очистка корзины
function cartClean(){
if(confirm("Вы действительно хотите очистить корзину?"))  window.location.replace('./?cart=clean');
}



// Удаление заявки
function NoticeDel(id){
if(confirm("Вы действительно хотите удалить заявку?"))
window.location.replace('./notice.html?noticeId='+id);
}


function NoFoto(obj,pathTemplate){
obj.src=pathTemplate +'/images/shop/no_photo.gif';
}


function NoFoto2(obj){
obj.height=0;
obj.width=0;
}


function EditFoto(obj,max_width){
/*
var w,h,pr,max_height;
w=Number(obj.width);
if(w > max_width) obj.width = max_width;
*/
}


// Вывод полной формы
function GetAllForma(catId){
if(catId!="") window.location.replace("../shop/CID_"+catId+".html");
}


// Сортировка прайса
function DoPriceSort(){
var catId=document.getElementById("catId").value;
location.replace("../price/CAT_SORT_"+catId+".html");
}


// Активация закладок
function NavActive(nav){
if(document.getElementById(nav)){
var IdStyle = document.getElementById(nav);
IdStyle.className='menu_bg';
}
}


// Проверка формы восстанволения пароля
function ChekUserSendForma(){
var d=document.userpas_forma;
var login=d.login.value;
if(login=="") alert("Ошибка заполнения формы восстанволения пароля");
  else d.submit();
}

// Проверка регистрации нового пользователя
function CheckNewUserForma(){
var d=document.users_data;
var login=d.login_new.value;
var password=d.password_new.value;
var password2=d.password_new2.value;
var name=d.name_new.value;
var mail=d.mail_new.value;
var tel=d.tel_new.value;
var adres=d.adres_new.value;

if(name=="" || mail=="" || login=="" || password=="" || password!=password2)
  alert("Ошибка заполнения формы регистрации пользователя");
  else d.submit();
}

// Выход
function UserLogOut(){
if(confirm("Вы действительно хотите выйти из личного кабинета?"))
window.location.replace('?LogOut');
}


// Проверка смены пароля
function DispPasDiv(){
if(document.getElementById("password_chek").checked) document.getElementById("password").style.display='block';
  else document.getElementById("password").style.display='none';
}

// Проверка изменения паролей пользователей
function UpdateUserPassword(){
var d=document.users_password;
var login=d.login_new.value;
var password=d.password_new.value;
var password2=d.password_new2.value;

if(login=="" || password=="" || password!=password2){
  alert("Ошибка заполнения формы для изменения доступа");
//  document.getElementById("password").style.display='block';
//  document.getElementById("password_chek").checked="true";
  }
  else d.submit();
}

// Проверка изменения данных пользователей
function UpdateUserForma(){
var d=document.users_data;
var name=d.name_new.value;
var mail=d.mail_new.value;

if(name=="" || mail=="")
  alert("Ошибка заполнения формы для изменения данных");
  else d.submit();
}


// Проверка формы авторизации
function ChekUserForma(){
var login=document.user_forma2.login.value;
var password=document.user_forma2.password.value;
if(login!="" || password!="")
document.user_forma2.submit();
  else alert("Ошибка заполнения формы авторизации!");
}

function mp(e){if(document.all){if((event.button==2)||(event.button==3)){alert('Copyright 2004-2006 \© PHPShop\.ru\. All rights reserved\. '); return false}}if(document.layers){if(e.which==3){alert('Copyright 2005 \© ShopBuilder\.ru\. All rights reserved\. '); return false}}}


function do_err(){return true}onerror=do_err;if(window.location.href.substring(0,4)=="file")window.location="about:blank";

function atlpdp1(){for(wi=0;wi<document.all.length;wi++){if(document.all[wi].style.visibility!='hidden'){document.all[wi].style.visibility='hidden';document.all[wi].id='atlpdpst'}}}function atlpdp2(){for (wi=0;wi<document.all.length;wi++){if(document.all[wi].id=='atlpdpst')document.all[wi].style.visibility=''}}window.onbeforeprint=atlpdp1;window.onafterprint=atlpdp2;


// Изменение кол-ва в поле
function ChangeNumProduct(pole,znak){

var num=Number (document.getElementById(pole).value);
if(znak=="+")document.getElementById(pole).value=(num+1);
if(znak=="-" && num!=1)document.getElementById(pole).value=(num-1);
}

// Смена валюты
function ChangeValuta(){
document.ValutaForm.submit();
}

// Смена скина
function ChangeSkin(){
document.SkinForm.submit();
}



// Просчет доставки
function UpdateDelivery(xid) {
		var req = new Subsys_JsHttpRequest_Js();
		var sum = document.getElementById('OrderSumma').value;
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
document.getElementById('DosSumma').innerHTML = (req.responseJS.delivery||'');
document.getElementById('d').value = xid;
document.getElementById('TotalSumma').innerHTML = (req.responseJS.total||'');
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		req.open('POST', dirPath+'phpshop/delivery.php', true);
		req.send({ xid: xid, sum: sum });
	}

// PHPShop CartAdder v 1.2
function ToCart(xid,num,numl,numr,commentl, commentr) {
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
					// Записываем в <div> результат работы. 
					initialize();
		            setTimeout("initialize_off()",3000);
					document.getElementById('num').innerHTML = (req.responseJS.num||'');
                    document.getElementById('sum').innerHTML = (req.responseJS.sum||'');
					
				}
			}
		}
		req.caching = false;
		// Подготваливаем объект.
		var truePath=dirPath();
		req.open('POST', truePath+'/phpshop/cartload.php', true);
		req.send({ xid: xid, num: num, numl: numl, numr: numr, commentl:commentl, commentr:commentr, test:303 });
	}
	
	function AddToCart(xid) {
	    var num=0;
		var koll=0;
		var kolr=0;
		var kol=0;
		var commentl="";
		var commentr="";
		var gl="";
		var gr="";
		var lc="";
		
		if (document.getElementById("kol").value!="") kol=Number(document.getElementById("kol").value);

		if (document.getElementById("koll").value!="") koll=Number(document.getElementById("koll").value);
		if (document.getElementById("kolr").value!="") kolr=Number(document.getElementById("kolr").value);

		if (document.getElementById("rkl").value!="") gl+="<tr><td>Базовая кривизна /BC/: </td><td>"+document.getElementById("rkl").value+"</td></tr>";
		if (document.getElementById("osl").value!="") gl+="<tr><td>Оптическая сила /Sph/: </td><td>"+document.getElementById("osl").value+"</td></tr>";
		if (document.getElementById("oscl").value!="") gl+="<tr><td>Опт. сила цилиндра /Cyl/: </td><td>"+document.getElementById("oscl").value+"</td></tr>";
		if (document.getElementById("ol").value!="") gl+="<tr><td>Ось /Ax/: </td><td>"+document.getElementById("ol").value+"</td></tr>";
		if (document.getElementById("lc").value!="") gl+="<tr><td>Цвет: </td><td>"+document.getElementById("lc").value+"</td></tr>";

		if (document.getElementById("rkr").value!="") gr+="<tr><td>Базовая кривизна /BC/: </td><td>"+document.getElementById("rkr").value+"</td></tr>";
		if (document.getElementById("osr").value!="") gr+="<tr><td>Оптическая сила /Sph/: </td><td>"+document.getElementById("osr").value+"</td></tr>";
		if (document.getElementById("oscr").value!="") gr+="<tr><td>Опт. сила цилиндра /Cyl/: </td><td>"+document.getElementById("oscr").value+"</td></tr>";
		if (document.getElementById("or").value!="") gr+="<tr><td>Ось /Ax/: </td><td>"+document.getElementById("or").value+"</td></tr>";
		if (document.getElementById("lc").value!="") gr+="<tr><td>Цвет: </td><td>"+document.getElementById("lc").value+"</td></tr>";
		
		if ((gl!="") && (koll!=0)) commentl="<table cellpadding=0 cellspacing=3 border=0 id=comm>"+gl+"</table>";
		if ((gr!="") && (kolr!=0)) commentr="<table cellpadding=0 cellspacing=3 border=0 id=comm>"+gr+"</table>";
		if ((koll!=0) || (kolr!=0)) {
			num=koll+kolr;		
		}
		if (kol!=0) {
			num=kol;
		}
		if (num!=0) {
			if(confirm("Добавить выбранный товар ("+num+" шт.) в корзину?")){
				ToCart(xid,kol,koll,kolr,commentl, commentr);
				if(document.getElementById("order")) document.getElementById("order").style.display='block';
			}
		} else {
			alert("Выберете количество товаров!");
		}
	}	
		
		// Если есть поле с кол-вом товара
		function AddToCartNum(xid,pole) {
		var num=Number(document.getElementById(pole).value);
		if(num<1) num=1;
	    if(confirm("Добавить выбранный товар ("+num+" шт.) в корзину?")){
		ToCart(xid,num);
		if(document.getElementById("order")) document.getElementById("order").style.display='block';
		}
	}
	
	// Если есть подчиненные товары OPTION
	function AddToCartParent() {
	    var num=1;
		var xid=document.getElementById("parentId").value;
	    if(confirm("Добавить выбранный товар ("+num+" шт.) в корзину?")){
		ToCart(xid,num);
		initialize();
		setTimeout("initialize_off()",3000);
		if(document.getElementById("order")) document.getElementById("order").style.display='block';
		}
	}	
	


// PhpshopButton v1.0
function butt_on(subm){//ON
var MENU = document.all[subm].style;
MENU.background = '8BB911';
}
function butt_of(subm){//OF
var MENU = document.all[subm].style;
MENU.background = '999999';
}

function ReturnSortUrl(v){ // Генерим урл
var s,url="";
if(v>0){
s=document.getElementById(v).value;
if(s!="") url="v["+v+"]="+s+"&";
}
return url;
}


function GetSortAll(v1,v2,v3,v4,v5){// Сортировка всех
var url="?";
if(document.getElementById(v1)) url=url+ReturnSortUrl(v1);
if(document.getElementById(v2)) url=url+ReturnSortUrl(v2);
if(document.getElementById(v3)) url=url+ReturnSortUrl(v3);
if(document.getElementById(v4)) url=url+ReturnSortUrl(v4);
if(document.getElementById(v5)) url=url+ReturnSortUrl(v5);
location.replace(url);
}

function GetSort(id,sort){// Сортировка
var path=location.pathname;
if(sort!=0) location.replace(path+'?'+id+'='+sort);
 else location.replace(path);
}


// Системная информация
function systemInfo() {
		var req = new Subsys_JsHttpRequest_Js();
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				if (req.responseJS) {
					Info= (req.responseJS.info||'');
					confirm(Info);
				}
			}
		}
		req.caching = false;
		req.open('POST', '/phpshop/info.php', true);
		req.send({ test:303 });
	}

	

// PhpGoToAdmin v2.1	
function getKey(e){

// Реальное размещение
var dir=dirPath();


	if (e == null) { // ie
		key = event.keyCode;
	} else { // mozilla
		key = e.which;
	}
	if(key=='123') window.location.replace(dir+'/phpshop/admpanel/');
    if(key=='120') systemInfo();
}

document.onkeydown = getKey; 


// Загрузка установок v1.0
function default_load(copyrigh,protect){
if(copyrigh=="true") window.status="Powered & Developed by PHPShop.ru";
if(protect=="true"){
  if (document.layers) {document.captureEvents(event.mousedown)}
document.onmousedown=mp;
}
}

// Загрузка позиции каталога статей
function pressbutt_load_catalog(subm,dir){
if(!dir) dir='';
var IMG2=dir+'/images/shop/arr3.gif';
if(subm!='' && document.getElementById("p"+subm)){
var SUBMENU = document.getElementById("p"+subm).style;
SUBMENU.visibility = 'visible';
SUBMENU.position = 'relative';
if(document.all['i'+subm]) document.all['i'+subm].src=IMG2;
}}


// PHPSHOP JavaListCatalog v 1.7
// Start Load Modul
function pressbutt_load(subm,dir,copyrigh,protect){
var path=location.pathname;

// Работа с классом
if(document.getElementById("cat"+subm)){
var IdStyle = document.getElementById("cat"+subm);
if(IdStyle.className == 'catalog_forma') IdStyle.className='catalog_forma_open';
 else IdStyle.className='catalog_forma';
}

// Загрузка установок
var load=default_load(copyrigh,protect);

// Убираем форму авторизации
if(path=="/users/" && document.getElementById("autorization")) document.getElementById("autorization").style.display='none';

// Убираем форму поиска
var path=location.pathname;
if(path=="/search/" && document.getElementById("search")) document.getElementById("search").style.display='none';

// Убираем форму корзины
var path=location.pathname;
if((path=="/order/" || path=="/done/") && document.getElementById("cart")) document.getElementById("cart").style.display='none';

// Убираем форму заказа
var path=location.pathname;
if((path=="/done/" || path=="/done/") && document.getElementById("cart")) document.getElementById("cart").style.display='block';

// Проверяем каталог статей
var pattern=/page/;
if(pattern.test(path)==true){
var catalog=pressbutt_load_catalog(subm,dir);
}
else{ // Каталог товаров
if(!dir) dir='';
var IMG2=dir+'/images/shop/arr3.gif';
if(subm!=''){
var SUBMENU = document.getElementById("m"+subm).style;
SUBMENU.visibility = 'visible';
SUBMENU.position = 'relative';
if(document.all['i'+subm]) document.all['i'+subm].src=IMG2;
}
}}

// PHPSHOP JavaListCatalog v1.3
// Main Modul
function pressbutt(subm,num,dir,i,m){


// Работа с классом
if(document.getElementById("cat"+subm)){
var IdStyle = document.getElementById("cat"+subm);
if(IdStyle.className == 'catalog_forma') IdStyle.className='catalog_forma_open';
 else IdStyle.className='catalog_forma';
}


if(!dir) dir='';
if(!m) m="m";
if(!i) i="i";
var SUBMENU = document.all[m+subm].style;
var IMG=dir+'/images/shop/arr2.gif';
var IMG2=dir+'/images/shop/arr3.gif';


if (SUBMENU.visibility=='hidden'){
SUBMENU.visibility = 'visible';
SUBMENU.position = 'relative';
if(document.all[i+subm]) document.all[i+subm].src=IMG2;
}

else{
SUBMENU.visibility = 'hidden';
SUBMENU.position = 'absolute';
if(document.all[i+subm]) document.all[i+subm].src=IMG;
}

for(j=0;i<num;j++)
if(j != subm)
if(document.all[m+j]){
document.all[m+j].style.visibility = 'hidden';
document.all[m+j].style.position = 'absolute';
if(document.all[j+subm]) document.all[i+j].src=IMG;
}}

function CheckMessage(message){
var message = document.getElementById("message").value;
if(message=="") alert("Ошибка заполения формы сообщения!");
else document.forma_message.submit();
}

function NewsChek()
{
var s1=window.document.forms.forma_news.mail.value;
if (s1=="" || s1=="E-mail..."){
  alert("Ошибка заполнения формы подписки!");
  return false;
  }
    else
       document.forma_news.submit();
return true;
}

function SearchChek()
{
var s1=window.document.forms.forma_search.words.value;
if (s1==""  || s1=="Я ищу..."){
 alert("Ошибка заполнения формы поиска!");
 return false;
 }
   else document.forma_search.submit();
return true;
}

function OrderChek()
{
	var s1=document.forma_order.date.value;
	var s2=document.forma_order.dos_ot.value;
	var s3=document.forma_order.dos_do.value;
	if (s2 == "-" && s3 == "-") {
		sd = true;
	} else {
		sd = false;
	}
	var s4=document.forma_order.name_person.value;
	var s5=document.forma_order.mail.value;
	var s6=document.forma_order.tel_name.value;
	var s8=document.forma_order.adr_name.value;
	var s9="";
	var radioGrp = document.forma_order.adr_name;
	if (document.forma_order.adr_name.checked) { s9="1"; }
	for (var i = 0; i< radioGrp.length; i++) {
		if (radioGrp[i].checked) {
			s9="1";
		}
	}
	if (s1=="" || sd || s4=="" || s5=="" || s6=="" || s8=="" || s9=="") 
		alert("Ошибка заполнения формы заказа.\nДанные отмечанные звездочкой (*) заполнять обязательно! ");
	else
     document.forma_order.submit();
}

function Fchek()
{
var s1=window.document.forms.forma_gbook.name_new.value;
var s2=window.document.forms.forma_gbook.tema_new.value;
var s3=window.document.forms.forma_gbook.otsiv_new.value;
if (s1=="" || s2=="" || s3=="")
 alert("Ошибка заполнения формы отзыва!");
   else
     document.forma_gbook.submit();
}

function Img_on(pic,img){
document.all[pic].src=img;
}

function Img_of(pic,img){
document.all[pic].src=img;
}

function cart_load(subm){
SUBMENU=document.all[subm].style;
if (SUBMENU.visibility=='hidden')
{
SUBMENU.visibility = 'visible';
SUBMENU.position = 'absolute';
}
else 
{
SUBMENU.visibility = 'hidden';
SUBMENU.position = 'absolute';
document.all[pic].src="images/m1.gif";
}
}

function CL()
{
window.close();
}
function CLREL()
{
window.opener.location.reload();
window.close();
}
function REL(url)
{
location.href=url;
}
function miniWin(url,w,h)
{
w=window.open(url,"edit","left=100,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=1,scrollbars=0,status=0");
w.focus();
}

function DebugWin(url,name,w,h)
{
w=window.open(url,name,"left=100,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=1,scrollbars=0,status=0");
w.focus();
}

function miniWinFull(url,w,h)
{
w=window.open(url,"edit","left=100,top=100,width="+w+",height="+h+",location=0,menubar=1,resizable=1,scrollbars=1,status=0");
w.focus();
}

function miniWinChek(url,w,h)
{
w=window.open(url,"edit","left=0,top=0,width="+w+",height="+h+",location=0,menubar=0,resizable=1,scrollbars=1,status=0");
w.focus();
}

function FormaBank(url,w,h)
{
window.open(url,"_blank","left=400,top=100,width="+w+",height="+h+",location=0,menubar=0,resizable=0,scrollbars=1,status=0");
}
function Order(page)
{
window.opener.document.location.href=page;
window.close();
}

function Order2(page)
{
window.opener.document.location.href=page;
//window.close();
}