
var isMinIE4 = (document.all)    ? 1 : 0;
var timeout = 0;
var lastid = "";


function menuover (e, menuid, targetid)
  {

  	transition(menuid);
   	var x = getElementLeft(targetid);
	var y = getElementTop(targetid);
	getStyleObject(menuid).position = "absolute";

if ( typeof menxpad !="undefined"){
  	getStyleObject(menuid).left= x + getElementWidth(targetid) + menxpad  + "px";
}else{
	getStyleObject(menuid).left= x + getElementWidth(targetid) + "px";
}
  	getStyleObject(menuid).top = y + "px";
  
}

function menuout(id){
timeout = setTimeout("close('"+id+"')", 400);
lastid = id;
}

//function to check if this is a new menu or not
//and to close any old menus if you are over a new one

function transition(id){
	//no matter what clear the timeout
	if(timeout!=0){
		clearTimeout(timeout);
	}
		//now if you are on a new item close any old one
	if(id!=lastid & lastid !=""){
		close(lastid);
		lastid = id;
	}
}

//funtion to close any open meny
function close(id)
  {
  getStyleObject(id).position = "absolute";
  getStyleObject(id).left= "-300px";
  getStyleObject(id).top = "-300px";
}
