var ns6,ns4,ie4;
// Show/Hide functions for non-pointer layer/objects
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ns6 = false;
//if the DOM is not IE and not NS4, it must be NS6
if (ns4 == ie4) {
	ns6 = true;
	ie4 = ns4 = false;
}
var URL,width,height,scroll,menubar,toolbar,resize,xPos,yPos,winName = "";//открывает новое окно // ,Align
function openWin(URL,width,height,scroll,menubar,toolbar,resize,xPos,yPos,winName){   // ,Align
	var focusFail = false;
	if (width == "") width = "500";
	if (height == "") height = "500";
	if (scroll == "") scroll = "auto";
	if (menubar =="") menubar = "no";
	if (toolbar == "") toolbar = "no";
	if (resize == "") resize = "yes";
//	if (Align == "") Align = "center";
	if (xPos == "") xPos = "5";  // 5
	if (yPos == "") yPos = "5";    // 5
	if (winName == "") winName = "очень большая фотография";
	var features ="width=" +width+ ",height=" +height+ ",scrollbars=" +scroll+ ",menubar=" +menubar+ 
	",toolbar=" +toolbar+ ",resizable=" +resize+ ",left=" +xPos+ ",top=" +yPos  ;
	var newWin = window.open(URL,winName,features);  // + ",Align=" +Align
	if (navigator.appVersion.indexOf("NT")!= -1){
		if (navigator.appVersion.indexOf("NT 5")!= -1){
			focusFail = false;
		} else if (ie4 == true)	focusFail = true;
	}
	if (focusFail == false){
		if (window.focus) newWin.focus();
	}
}
function CSPop(p) {
  window.open(p,'showcase','scrollbars=no,toolbar=no,width=700,height=570')
}
function CSPop2(p) {
  window.open(p,'showcase','scrollbars=no,toolbar=no,width=780,height=640')
}
function CSPop3(p) {
  window.open(p,'showcase','scrollbars=no,toolbar=no,width=650,height=500')  // ,Align=center
}
function CSPop4(p) {
  window.open(p,'showcase','scrollbars=no,toolbar=no,width=450,height=350')  // ,Align=center
}

function open_window(link,w,h) {  //открывает новое окно для редактированием категорий, товаров, и т.п.
		var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
		newWin = window.open(link,'newWin',win);
}
function buyItem(itemno) { //  
window.open("buy.php?"+itemno,"_blank","toolbar=no, location=no, scrollbars=no, width=300, height=50")
}
function validate() {	if (document.vashvopros.namesoo.value.length<1) {		alert("Введите имя");		return false;	};
	if (document.vashvopros.temasoo.value.length<1) {		alert("Вы неуказали тему");		return false;	};
	if (document.vashvopros.mailsoo.value.length<1) {		alert("Вы неуказали свой E-mail ");		return false;	};
	if (document.vashvopros.voprossoo.value.length<1) {		alert("Вас неслышно. Пишите громче. ");		return false;	};
	return true;
}
function validateZakaz() {
	if (document.form1.name.value.length<1) {		alert("А как вас зовут ?");		return false;	};
	if (document.form1.email.value.length<1) {		alert("Введите адрес Вашей электронной почты");		return false;	};
	if (document.form1.telefon.value.length<1) {		alert(" Введите номер своего телефона");		return false;	};
	if (document.form1.address.value.length<1) {		alert("Введите адрес для доставки заказа");		return false;	};
	return true;
}
