function createPictureWindow(_pic,_width,_height) {
	wTop = (screen.height-_height)/3;
	wLeft = (screen.width-_width)/2;
	WinFeatures = "top="+wTop+",left="+wLeft+",width="+_width+",height="+_height+",maximize=no,minimize=no,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resize=no";
	_newPicture = window.open("zoom.php?id="+_pic+"&dir=pictures","frontendPictureWindow",WinFeatures);
}

function createDynamicWindow(Path,Width,Height,Title)
{
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+(Width*p)+(Height*q);
	WinFeatures = "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Height+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no";
	w = window.open("",windowName,WinFeatures);
	w.document.open();
	w.document.write('<head><title>ODRY &quot;'+Title+'&quot;</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>');
	w.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;'></body>"); 
	w.document.close();
}

function createDescriptionWindow(_file,_width,_height)
{
	wTop = (screen.height-_height)/3;
	wLeft = (screen.width-_width)/2;
	WinFeatures = "top="+wTop+",left="+wLeft+",width="+_width+",height="+_height+",maximize=no,minimize=no,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resize=no";
	_newDescription = window.open(_file,"frontendDescriptionWindow",WinFeatures);
}

// Проверка содержимого полей формы заказа
function checkFields(form)
{
	f1 = document.forms[form].elements['title'].value;
	f2 = document.forms[form].elements['text'].value;
	f3 = document.forms[form].elements['email'].value;
	
	if (f1 == "") {
		alert("Введите, пожалуйста, Ваше имя");
		return false;
	}
 	else if (f2 == "") {
		alert("Введите, пожалуйста, текст сообщения");
		return false;
	}
	else return true;
}

function checkFieldsRequest(form,fields_Array) {
	isOK = true;
	for(i=0; i<fields_Array.length; i++) if (document.forms[form].elements[fields_Array[i]].value=='') isOK = false;
	if (!isOK) alert("Все поля, помеченные символом (*), должны быть заполнены");
	return isOK;
}