function par_hide_show(){
	elem=document.getElementById("heat");
	sel=document.getElementById("mode").value;
  if(sel==1){
    elem.style.visibility = "hidden";
  }else{
    elem.style.visibility = "visible";
  }

}
function validate_custinfo(userDataForm)
{
	emptyFields = new Array();

	Fields = new Array();
	Fields['first_name'] = "Имя";
	Fields['last_name'] = "Фамилия";
	Fields['email'] = "E-mail";
	Fields['city'] = "Город";
	Fields['address'] = "Адрес";
	Fields['phone'] = "Телефон";

	var message = '';
	for (var i=0; i<userDataForm.length; i++)
	{
		if ( (userDataForm[i].type=='text' || userDataForm[i].type=='textarea') && userDataForm[i].name != 'note')
		{
			bob = userDataForm[i].name;
			if (userDataForm[i].value=="" || userDataForm[i].value==" ") message+="   - "+Fields[bob]+"\n";
		}
	}
	if (message!='')
	{
		alert ("Не заполнены поля:\n"+message);
		return false;
	}
	else return true;
}

function open_window(imgPath,imgW,imgH,productName) //opens new window
{
	var winW = imgW+30;
	var winH = imgH+80;
	var left = (screen.width - winW) / 2;
	var top = (screen.height - winH) / 2;
	var winId = 'id_'+imgW*imgH;

	var w = window.open("",winId,"width="+winW+",height="+winH+",left="+left+",top="+top+",menubar=no,title=no,location=no,resizable=no,scrollbars=no");

	var d = w.document;

	d.open();
	d.write('<html>\n<head><title>' + productName + '</title></head>\n');
	d.write('<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">\n<div align="center" style="margin-top: 12px;"><span  style="color: #117BB8; font: bold 12px Arial, Helvetica, sans-serif;">' + productName + '</span><br><img src = "' + imgPath + '" width=' + imgW + ' height=' + imgH + ' style="margin-top: 12px; margin-bottom: 12px;"><br>\n');
	d.write('<table bgcolor="#649DD1" width="100%" height="50" cellspacing="0" cellpadding="0" border="0"><tr><td align="center" valign="top" style="padding-top: 7px;"><a href="javascript:window.close()" style="font: bold 12px Arial, Helvetica, sans-serif; color: #FFFFFF; text-decoration: none;">[закрыть]</a></td></tr></table></div>\n</body>\n</html>');
	d.close();
}

function open_screenshot(url,scrW,scrH,scrName) //opens new window
{
	var winW = scrW+20;
	var left = (screen.width - scrW) / 2;
	var top = (screen.height - scrH) / 2;
	var winId = 'id_'+scrW*scrH;

	var w = window.open("",winId,"width="+winW+",height="+scrH+",left="+left+",top="+top+",menubar=no,title=yes,location=no,resizable=no,scrollbars=yes");

var d = w.document;

	d.open();
	d.write('<html>\n<head><title>' + scrName + '</title></head>\n');
	d.write('<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">\n<img src = "' + url + '" width=' + scrW + ' height=' + scrH + '><br>\n');
	d.write('</body>\n</html>');
	d.close();
}