function IsValidEmail_subscribe(form, field) {
 if (document.forms[form][field].value.indexOf("@")==-1 || document.forms[form][field].value.indexOf(".")==-1 || document.forms[form][field].value.indexOf(" ")!=-1 || document.forms[form][field].value.length<6) {
                               alert('E-mail is not correct!');
			       return false;
			    }
			    else {
			       return true;
			    }
			}

function Clear(name,field,defval) {
 if (name.elements[field].value==defval) name.elements[field].value='';
 return;
 }
var col=0;
var image=new Array();
function open_img(adr,w,h)
  {
  if (document.layers)
   {
   image=window.open('','img','directories=0,height='+h+',location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,width='+w);
   image.document.open();
   image.document.write("<html><head><title>Terrasoft</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#F8F8F8><center><a href=javascript:window.close();><img src=/images/"+adr+".gif border=0 width="+w+" height="+h+" alt='Закрыть окно'></a></center></body></html>");
   image.focus();
   }
  else
   {
   if (col>0) {image[col-1].close();}
   image[col]=window.open('','img','directories=0,height='+h+',location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,width='+w);
   image[col].document.open();
   image[col].document.write("<html><head><title>Terrasoft</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#F8F8F8><center><a href=javascript:window.close();><img src=/images/"+adr+".gif border=0 width="+w+" height="+h+" alt='Закрыть окно'></a></center></body></html>");
   image[col].focus();
   col=col+1;
   }


  }


function open_img2(adr,w,h)
  {
  if (document.layers)
   {
   image=window.open('','img','directories=0,height='+h+',location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,width='+w);
   image.document.open();
   image.document.write("<html><head><title>Terrasoft</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#F8F8F8><center><a href=javascript:window.close();><img src=/images/"+adr+" border=0 width="+w+" height="+h+" alt='Закрыть окно'></a></center></body></html>");
   image.focus();
   }
  else
   {
   if (col>0) {image[col-1].close();}
   image[col]=window.open('','img','directories=0,height='+h+',location=0,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,width='+w);
   image[col].document.open();
   image[col].document.write("<html><head><title>Terrasoft</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=#F8F8F8><center><a href=javascript:window.close();><img src=/images/"+adr+" border=0 width="+w+" height="+h+" alt='Закрыть окно'></a></center></body></html>");
   image[col].focus();
   col=col+1;
   }


  }


function loadPage(page) {
       if(page!="none") {
          //eval("parent.location='"+page+"'");
          document.location.href=page;
       }
   }



DOM = (document.getElementById)? true : false;
NN = (document.layers)? true : false;
IE = (document.all)? true : false;

if (IE) DOM=false;

var showflag=false;
var id=null;
var onname="";


function show(name, y){

killtimer();
if(showflag) hide();

if(NN){
document.layers[name].top=y;
document.layers[name].left=130;
document.layers[name].visibility='show';

}

if(DOM){
document.getElementById(name).style.top=y;
document.getElementById(name).style.left=130;
document.getElementById(name).style.visibility='visible';

}

if(IE){
document.all[name].style.top=y;
document.all[name].style.left=130;
document.all[name].style.visibility='visible';
}

showflag=true;
onname=name;

}

function killtimer(){

if(id!=null){

clearTimeout(id);
id=null;
}
return true;
}

function hide(){

if(id!=null) killtimer();

if(showflag){

if(NN) document.layers[onname].visibility='hide';
if(DOM) document.getElementById(onname).style.visibility='hidden';
if (IE) document.all[onname].style.visibility='hidden';
}

showflag=false;
onname="";

}

function reset(){

killtimer();
id = setTimeout('hide()', 500);
}