<!--
//define browser
var isIE, isNS, isNS6, isDOM, lR, sR, vis, invis, myTimeOut, goName;
	if (document.all) {isIE= true;lR="document.all.";rR="";sR=".style";vis="visible";invis="hidden";}
	if (document.layers){isNS = true;lR="document.layers.";rR="";sR="";vis="show";invis="hide";}
	if (document.getElementById &&!isIE) {isDOM=true;lR = "document.getElementById('";rR="')";sR = "').style";invis ="hidden";vis = "visible"}
	if (isDOM == true && navigator.appName =="Netscape") isNS6 = true;

function checkform()
{
if (arguments.length>0)
{
if (arguments.length>1)
 { 
 for (var i=1;i<arguments.length;i++)
  {
  if (document.forms[arguments[0]].elements[arguments[i]].value=="") 
     {
	 alert("Вы не заполнили обязательное поле!");
	 document.forms[arguments[0]].elements[arguments[i]].focus();
	 return false;
	 }
  }
 } else 
 {
 for (var i=0;i<document.forms[arguments[0]].elements.length;i++)
  {
  if (document.forms[arguments[0]].elements[i].value=="") 
     {
	 alert("Вы не заполнили обязательное поле!");
	 document.forms[arguments[0]].elements[i].focus();
	 return false;
	 }
   } 
 }//>1
}//>0
return true;
}

function showpic(nam,w,h,alt,val)
{
var rand=Math.floor(Math.random()*1000);
if (nam!="")
 {
myWin= open("", "win"+rand,"width="+w+",height="+h+",status=no,toolbar=no,menubar=no");

  // открыть объект document для последующей печати 
  myWin.document.open();
  
  // генерировать новый документ 
  myWin.document.write("<html><head><title>"+alt+"</title></head>");
  myWin.document.write("<body bgcolor=#FFFFFF text=#000000 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");
  if (val>=4) {
  myWin.document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\""+w+"\" HEIGHT=\""+h+"\" id=\"fla"+rand+"\" ALIGN=\"\">");
  myWin.document.write("<PARAM NAME=movie VALUE=\""+nam+"\">"); 
  myWin.document.write("<PARAM NAME=quality VALUE=high>");
  myWin.document.write("<PARAM NAME=bgcolor VALUE=#FFFFFF>");
  myWin.document.write("<EMBED src=\""+nam+"\" quality=high bgcolor=#FFFFFF  WIDTH=\""+w+"\" HEIGHT=\""+h+"\" NAME=\"fla"+rand+"\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>");
  } else
  {
  myWin.document.write("<img src='"+nam+"' width='"+w+"' height='"+h+"' alt='"+alt+"'>");
  }
  myWin.document.write("</body></html>");
  // закрыть документ - (но не окно!)
  myWin.document.close();
 
 }
}

function setCookie(name, value, expires, path, domain, secure)
{
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	if ((name + "=" + escape(value)).length <= 4000)
		document.cookie = curCookie;
	else
		if (confirm("Cookie превышает 4KB и будет вырезан !"))
				document.cookie = curCookie;
}

function getCookie(name)
{
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1)
		return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie(name, path, domain)
{
	if (getCookie(name))
	{
		document.cookie = name + "=" +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}
//-->