function showurlin(url, dest, options)
{
  if (dest == 'popup')
  {
    window.open(url, '', options);
  }
  else if (dest == 'original')
  {
    if (window.opener.location)
      window.opener.location.href = url;
  }
}


function imgSwap(obj, newsrc) {
	obj.oldsrc = obj.src;
	obj.src = newsrc;
	return true;
}

function imgRestore(obj) {
	if(obj.oldsrc) obj.src = obj.oldsrc;
	return true;
}

var menuShowDelay = 200;
var menuHideDelay = 200;

function menuMouseOver(node) {
	var menu = findMenu(node);
	if(!menu) return;
	if(menu.showPending) window.clearTimeout(menu.showPending);
	if(menu.hidePending) window.clearTimeout(menu.hidePending);
	//menu.showPending = setPropertyTimeout(menu.style, "visibility", menuShowDelay, "visible");
	menu.showPending = setMenuShowTimeout(menu, menuShowDelay);
}

function menuMouseOut(node) {
	var menu = findMenu(node);
	if(!menu) return;
	if(menu.showPending) window.clearTimeout(menu.showPending);
	if(menu.hidePending) window.clearTimeout(menu.hidePending);
	//menu.hidePending = setPropertyTimeout(menu.style, "visibility", menuHideDelay, "hidden");
	menu.hidePending = setMenuHideTimeout(menu, menuHideDelay);

}

function findMenu(node) {
	if(typeof node.getElementsByTagName == 'function') {
		var children = node.getElementsByTagName('UL');
		if(children)
			return children[0];
		else
			return null;
	}
	else {
		var children = node.childNodes;
		for(var i=0; i < children.length; i++)
			if (children[i].nodeName == 'DIV')
				return children[i];
		return null;
	}
}


function showElement(object_id){
  var object = document.getElementById(object_id);
  return (object.style.visibility='visible');
}

function hideElement(object_id){
  var object = document.getElementById(object_id);
  return (object.style.visibility='hidden');
}

function setMenuShowTimeout(object, delay) {
    return setTimeout('showElement("'+object.id+'")', delay);
}

function setMenuHideTimeout(object, delay) {
    return setTimeout('hideElement("'+object.id+'")', delay);
}
