if(document.getElementById) document.write('<style type="text/css">tr.subdiv{ display: none; }</style>');

var is = new Is();
function Is(){
  this.agent=navigator.userAgent.toLowerCase();
  this.opera = (this.agent.indexOf('opera')!=-1) ? true:false;
  this.ie4 = ((this.agent.indexOf('msie')!=-1) && (this.agent.indexOf('opera')==-1)) ? true:false;
  this.ns6 = ((this.agent.indexOf('gecko')!=-1) && (this.agent.indexOf('opera')==-1)) ? true:false;
  this.ns4 = ((this.agent.indexOf('mozilla')!=-1) && (this.agent.indexOf('opera')==-1) && (this.agent.indexOf('msie')==-1) && (this.agent.indexOf('gecko')==-1)) ? true:false;
}

divover=['#4D1D0A','#853208']; //onmouseover onmouseover_sub
divcolor=['#6D3119','#9C4E26']; //onmouseout onmouseout_sub


function hilitediv(myobj,mode,level){
  kids = myobj.childNodes;
  if(mode==0){
    color=divcolor[level];
  }
  if(mode==1){
    color=divover[level];
    try{ myobj.style.cursor='pointer'; } catch (a){}
    try{ myobj.style.cursor='hand'; } catch (a){}
  }
  if(mode==3){
    color='#A0B7EF';
  }
  for(var i=0; i<kids.length; i++){
    if(kids[i].nodeName=='TD'){
      kids[i].style.backgroundColor=color;
    }
  }
}

function opendiv(id){
  var display='none';
  with(document.getElementById('subdiv'+id)){
    if(innerHTML!='<td></td>' && (style.display=='none' || style.display=='')) display=(is.ie4) ? 'block' : 'table-row';
    style.display=display;
  }
}

function reg_validator2(form){
  //check login
  if(form.login.value.length<1){
    alert("Введите свой логин");
    form.login.focus();
    return false;
  }
  for(i=0; i<form.login.value.length; i++){
    if(login_chars.indexOf(form.login.value.charAt(i).toLowerCase())==-1){
      alert("В логине допускаются только английские буквы");
      form.login.focus();
      return false;
    }
    if(login_chars.indexOf(form.login.value.charAt(i))==-1){
      alert("В логине все буквы должны быть маленькие");
      form.login.focus();
      return false;
    }
  }
  if(form.login.value.length < 6 || form.login.value.length > 10){
    alert("Логин должен содержать от 6 до 10 символов");
    form.login.focus();
    return false;
  }
  //check password
  if(form.password.value.length<1){
    alert("Введите свой пароль");
    form.password.focus();
    return false;
  }
  for(i=0; i<form.password.value.length; i++){
    if(passwd_chars.indexOf(form.password.value.charAt(i).toLowerCase())==-1){
      alert("В пароле допускаются только английские буквы и цифры");
      form.password.focus();
      return false;
    }
  }
  if(form.password.value.length < 6 || form.password.value.length > 10){
    alert("Пароль должен содержать от 6 до 10 символов");
    form.password.focus();
    return false;
  }
  return true;
}

function WindHelp(){
  var n=window.open('help_full.php','help','height=600,width=800,menubar=no,scrollbars=yes,status=yes,toolbar=no,scrollable=yes,resizable=yes');
  n.focus();
  return false;
}


function WindHelp2(){
  var n=window.open('help_full2.php','help','height=600,width=800,menubar=no,scrollbars=yes,status=yes,toolbar=no,scrollable=yes,resizable=yes, left=100, top=50');
  n.focus();
  return false;
}


function openWindow(page, name){
	window.open(page, name, "titlebar=1, toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=0,width=400,height=300,left=100,top=100");
}




function WindOpen(myURL, myName, myWidth, myHeight){

 var n=window.open(myURL,myName,"width=" + myWidth + ",height=" + myHeight + ",menubar=no,scrollable=yes,resizable=no");

  //n.focus();

  //return false;

}


