
timerID=null;
timerShowID=null;

function stopTimer(){
if (timerID!=null){
	clearTimeout(timerID);
	}
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
}

function timeoutShow(timer, id, tpos){
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
timerShowID=setTimeout("showMenu("+id+", " +tpos +")",timer);
}

// Админское меню
function timeoutAdminShow(timer, id, tpos){
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
timerShowID=setTimeout("showAdminMenu("+id+", " +tpos +")",timer);
}

function showMenu(id,tpos){
if (timerID!=null){
	clearTimeout(timerID);
	}
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
hideMenu();
id.style.display='block';
//var cid="topTable.offsetTop+tpos"+tpos+".offsetTop+(tpos"+tpos+".offsetHeight)+197";
var cid = tpos;
//alert(eval(cid));
id.style.left=eval(cid);
//id.style.left=event.x;
}

// Админское меню
function showAdminMenu(id,tpos){
if (timerID!=null){
	clearTimeout(timerID);
	}
if (timerShowID!=null ){
	clearTimeout(timerShowID);
	}
hideMenu();
id.style.display='block';
var cid="topTable.offsetTop+tpos"+tpos+".offsetTop+(tpos"+tpos+".offsetHeight)+95";
//alert(eval(cid));
id.style.top=eval(cid);
//id.style.left=event.x;
}

function timeoutHide(timer){
if (timerID!=null){
	clearTimeout(timerID);
	}
	timerID=setTimeout("hideMenu()",timer);
}

//------------------------------------------------------------------------------------
function showhide(d,l){
    if (d.style.display!="block"){
        d.style.display="block";
        l.innerHTML='&minus;'+l.innerHTML.substring(1);
    } else {
        d.style.display="none";
        l.innerHTML='+'+l.innerHTML.substring(1);
        }
}

function openwin(myurl,mx,my,resize,name){
	if(resize=="noresize"){resize="no";
	}else{resize="yes";}

	if(name==null){name="popup";}
	  nn4 = (document.layers)? true : false;
	  ie4 = (document.all)? true : false;
	  wx = Math.round((screen.width - mx) / 2);
	  wy = Math.round((screen.height - my) / 2);
	  wpos = (nn4)? "screenX="+wx+",screenY="+wy : "left="+wx+",top="+wy;
	  var a = window.open(myurl,name,"resizable="+resize+", menubar=no,toolbars=no,scrollbars=yes,width=" + mx + ",height=" + my + "," + wpos);
	  a.focus();
}

function openimg(myurl,mx,my,name)
 {
  if (a!=null){a.close();}
  mx=mx+30;
  my=my+57;
  if(name==null){name="sv";}
  nn4 = (document.layers)? true : false;
  ie4 = (document.all)? true : false;
  wx = Math.round((screen.width - mx) / 2);
  wy = Math.round((screen.height - my) / 2);
  wpos = (nn4)? "screenX="+wx+",screenY="+wy : "left="+wx+",top="+wy;
  var a = window.open(myurl,name,"resizable=no, menubar=no,toolbars=no,scrollbars=no,width="+mx+",height="+my+"," + wpos);
  a.resizeTo(mx, my);
  a.focus();
 }



