<!--
//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();
 
 }
}

///MAIL///
//m(name,subject,body,server)
function m(name)
{
var mi="to";
var host="";
var fi="mail";
var ri=":";
var sbj="";
var bdi="";
if (arguments[1]) sbj="?subject="+arguments[1];
if (arguments[2]) {if (sbj) bdi="&";bdi=bdi+"body="+arguments[2];}
if (arguments[3]) 
{
host=arguments[3];
} else
{
host=location.href;
host=host.substr(host.indexOf("//")+2,host.length);
host=host.substr(0,host.indexOf("/"));
if (host.indexOf("www.")!=-1) host=host.substr(host.indexOf("www.")+4,host.length);
}
location.href=fi+mi+ri+name+unescape("%40")+host+sbj+bdi;
}
//pm(name,server)
function pm(name)
{
var host="";
if (arguments[1]) 
{
host=arguments[1];
} else
{
host=location.href;
host=host.substr(host.indexOf("//")+2,host.length);
host=host.substr(0,host.indexOf("/"));
if (host.indexOf("www.")!=-1) host=host.substr(host.indexOf("www.")+4,host.length);
}
document.write(name+unescape("%40")+host);
}

function rm(name)
{
var mi="to";
var host="";
var fi="mail";
var ri=":";
var sbj="";
var bdi="";
if (arguments[1]) sbj="?subject="+arguments[1];
if (arguments[2]) {if (sbj) bdi="&";bdi=bdi+"body="+arguments[2];}
if (arguments[3]) 
{
host=arguments[3];
} else
{
host=location.href;
host=host.substr(host.indexOf("//")+2,host.length);
host=host.substr(0,host.indexOf("/"));
if (host.indexOf("www.")!=-1) host=host.substr(host.indexOf("www.")+4,host.length);
}
return fi+mi+ri+name+unescape("%40")+host+sbj+bdi;
}

function reference(link)
{
if (link) location.href=link;
} 

///PRELOAD///
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->