//startList = function() {
//if (document.all&&document.getElementById) {
//navRoot = document.getElementById("nav");
//for (i=0; i<navRoot.childNodes.length; i++) {
//node = navRoot.childNodes[i];
//if (node.nodeName=="LI") {
//node.onmouseover=function() {
//this.className+=" over";
//  }
//  node.onmouseout=function() {
//  this.className=this.className.replace(" over", "");
//   }
//   }
//  }
// }
//}
//window.onload=startList;

// проверка поддержки флеш
var ie=0;
var f=0;
var fz=0;
var n=navigator;

if (n.platform=='Win32' && n.appName == 'Microsoft Internet Explorer'){
  ie=1;
  for (var i=3; i<10; i++) {
    try {
      new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
      f=i;
    }
    catch (e) {}
  }
}


if ((ie==0)&&(n.plugins))
{for (var i=0;i<n.plugins.length;i++){if (n.plugins[i].name.indexOf('Flash')> -1)
{fz=parseInt(n.plugins[i].description.charAt(16));
if (fz>f) f=fz; }}}

if (f>=5)
  flashCom = true;
else
  flashCom = false;
  

function openCalendar(type,fieldId,path) {
  //alert(frm.inp);
  if (!path)
    path = '/';
  dateField = document.getElementById(fieldId);
  dateType = type;
  if (type == 'datetime') {
    window.open(path+"includes/calendar.html", "calendar", "width=300,height=225,left=100,top=100,status=no");
  }
  else {
    window.open(path+"includes/calendar.html", "calendar", "width=300,height=190,left=100,top=100,status=no");
  }
}
	
	var tId = 0;
	var curMID = null;
	function showHide(id,show) {
 	  obj = document.getElementById(id);
 	  
 	  if (tId != 0 && show) {
	    clearTimeout(tId);
	    tId = 0; 	    
 	  }
	  else if (show == 0 && obj.style.display == "block") {
	    if (tId != 0)
  	    clearTimeout(tId);
	    tId = setTimeout("obj.style.display = 'none'",500);
	  }
	  else {
      if (curMID != null && curMID != id) {
     	  obj1 = document.getElementById(curMID);
     	  obj1.style.display = 'none';
      }
	    obj.style.display = "block";
	    curMID = id;
	    clearTimeout(tId);
	    tId = 0;
	  }  
	}
	
	function scale(id,sh,h) {
 	  obj = document.getElementById(id);
 	  i = parseInt(obj.style.height);
//    	  alert(i);
//	  s = h/2;
	  s = 10;
	  if (i > 0 && i < h) {
	    obj.style.height = i + Math.pow(-1,(sh+1))*s;
//	    if (s >= 2)
//	      s = s/2;
//	    else
//	      s = 1;
  	  setTimeout("scale('"+id+"',"+sh+","+h+")",100);
	  }
	  else
	    obj.style.height = h*sh;
	}
	
	function checkNumber(inputId) {
    val = inputId.value;
    val = val.replace(/ |\-/gi, "");
    val = val.replace(/^\+7/, "");
    
    if (val.length == 11 && val.substr(0,1)=='8')
      val = val.substr(1);
      
    if (val.length != 10 && val.length != 7) {
      alert('Неверный формат номера мобильного телефона!');
      inputId.select();
      inputId.focus();
      return false;
    }
    
    if (val.match(/[^\d]/)) {
      alert('Номер мобильного телефона содержит недопустимые символы!');
      inputId.focus();
      return false;
    }
    return val;
  }
  
  function checkMail(email)
  {
       re = /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i;
       return re.test(email);
  }

function gi(id) {
  return document.getElementById(id);
}