function createPictureWindow(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></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 checkFeedbackForm(form) {
	f1 = document.forms[form].elements['feed[name]'].value;
	f2 = document.forms[form].elements['feed[email]'].value;
	f3 = document.forms[form].elements['feed[text]'].value;
	
	if (f1 == "") {
		alert("Введите, пожалуйста, Ваше имя");
		return false;
	}
 	else if ((f2 == "") || (f2.indexOf('@')<0) || (f2.indexOf('.')<0)) {
		alert("Введите, пожалуйста, корректный e-Mail");
		return false;
	}
	else if (f3 == "") {
		alert("Введите, пожалуйста, Ваше сообщение");
		return false;
	}
	else return true;
}

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>&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 createPopup(num,Width,Height){
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+p+p*q;
	WinFeatures = "top=50,left=50,width=100,height=100,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes";
	w = window.open('/popup.html?id='+num,windowName,WinFeatures);
}

savedClass = new Array();
function replaceClass(obj){
	if(obj) {
		savedClass['obj'] = obj; savedClass['className'] = document.getElementById(obj).className;
		document.getElementById(obj).className = 'topmenu_item_over';
		}
	else document.getElementById(savedClass['obj']).className = savedClass['className'];
}