var WIN,cur0,cur1;
function NW(x,H,W,L,nm){
if (!L){L=0}
if (!H){H=400}
if (!W){W=550}
if (!nm){nm='cl'}
if (x.substr(0,7)=='pic.php'||x.substr(0,8)=='fpic.php'){mb='no'}else{mb='yes'}
WIN=window.open(x, nm, "height="+H+",width="+W+",toolbar=no,status=no,directories=no,menubar="+mb+",resizable,scrollbars=yes,top=0,left="+L);
}
function NNW(x,H,W,L,nm){
if (!L){L=0}
if (!H){H=400}
if (!W){W=550}
if (!nm){nm='ccl'}
if (x.substr(0,7)=='pic.php'||x.substr(0,8)=='fpic.php'||x.substr(0,12)=='fcomppic.php'||x.substr(0,13)=='fcompvpic.php'){mb='no'}else{mb='yes'}
WIN=window.open(x, nm, "height="+H+",width="+W+",toolbar=no,status=no,directories=no,menubar="+mb+",resizable,scrollbars=yes,top=0,left="+L);
}
function WReg(x,y,z){
 if(!x){x='reg'}
 if(!y){y=500}
 if(!z){z=200}
 WIN=window.open("blank.html", x, "height="+z+",width="+y+",toolbar=no,status=no,directories=no,menubar=no,resizable,scrollbars=yes,left=50");
}
function MO(x,y,lnk){
 if(x){
  y.src="img/circleon.gif";
  lnk.className="menuon";
 }else{
  y.src="img/circle.gif";
  lnk.className="menu";
 }
}
function MOm(x,lnk){
 if(x){
  lnk.className="smenuon";
 }else{
  lnk.className="smenu";
 }
}
function annForm(TheForm){
 eml = /^([-_0-9A-Za-z]+\.)*[-_0-9A-Za-z]+@([-_0-9A-Za-z]+\.)+[A-Za-z]{2,4}$/;
 with (TheForm){
  if (login.value.length<1){alert ('Логин обязателен'); return false}
  if (pass.value.length<1){alert ('Пароль обязателен'); return false}
  if ((address.value.length<1)&&(email.value.length<1)){alert ('Нет контактной информации'); return false}
  if (!(eml.test(email.value))){
   alert('Ошибка в email адресе');
   return false;
  }
  if (title.value.length<1){alert ('А заголовок?'); return false}
  if (town.value.length<1){alert ('Город указывать обязательно'); return false}
  if (text.value.length<3){alert ('Сообщение слишком короткое'); return false}
 }
 return true;
}
function cursorM(){
 var tt=3000+Math.round(Math.random()*5000);
 setTimeout('doCur()',tt);
}
function doCur(){
 cur0=document.getElementById('cur0');
 cur1=document.getElementById('cur1');
 dxC0=10+Math.round(Math.random()*30);
 if(dxC0%2){dxC0*=-1;}
 dyC0=10+Math.round(Math.random()*30);
 if(dyC0%2){dyC0*=-1;}
 dxC1=10+Math.round(Math.random()*30);
 if(dxC1%2){dxC1*=-1;}
 dyC1=10+Math.round(Math.random()*30);
 if(dyC1%2){dyC1*=-1;}
 document.onmousemove=moveCur;
 document.onscroll=moveCur;
 document.onmousewheel=moveCur;
}
function moveCur(e){
 if(!e){e=window.event;}
 cur0.style.left=e.clientX+document.body.scrollLeft+dxC0;
 cur0.style.top=e.clientY+document.body.scrollTop+dyC0;
 cur1.style.left=e.clientX+document.body.scrollLeft+dxC1;
 cur1.style.top=e.clientY+document.body.scrollTop+dyC1;
}
