
function openMenu(menuName) {
	document.getElementById(menuName).style.display = "inline";
}

function closeMenu(menuName){
	document.getElementById(menuName).style.display = "none";
}

function changeColor(menuName, bgcolor, color) {
	if (bgcolor != ''){
		document.getElementById(menuName).style.backgroundColor = bgcolor;
	}
	else{
		document.getElementById(menuName).style.color = color;
	}	
}


function getPosition(obj, pstrType){
 try {
 //alert(obj.offsetLeft)
  var position = {x:0,y:0};
  do{
   position.x += obj.offsetLeft;
   position.y += obj.offsetTop;
   obj = obj.offsetParent;
  } while(obj)
  	if (pstrType == "top"){
		return position.y;
  	}
	else{
		return position.x;
	}
 } catch (e) {
 }
}

function setPosition(menuName, pintLeft, pintTop, pstrMenuType, pintSpacingDistance){
	if (pstrMenuType == "vertical"){
		var intNewTop = parseInt(pintTop) + pintSpacingDistance;
		var intNewLeft = pintLeft;
	}
	else{
		var intNewTop = pintTop
		var intNewLeft = parseInt(pintLeft) + pintSpacingDistance;
	}
	document.getElementById(menuName).style.left = intNewLeft + "px"
	document.getElementById(menuName).style.top = intNewTop + "px"
}


function hotImage(source, dest){
	if (document.images){
		dest.src = source.src;		
	}
}



//use for ALL generic windows
function openWin(URL, winName, width, height)
{
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	win = window.open(URL, winName, "width=" + width + ",height=" + height + ",scrollbars=no,toolbar=no,left=300,top=50");
	
		//delay a bit here because IE4 encounters errors
		//when trying to focus a recently opened window
 		setTimeout('win.focus();',250);
	
}

//confimation box to delete items
function delItem(pstrItemName){
	if(!pstrItemName)
		pstrItemName = "item";	
		
	 if (confirm("Are you sure you want to delete this "+pstrItemName+"?")){
	 return true;
	 }
	 else{
	 return false;
	 }
}
