
var menu = new Array("dl_menu", "cp_menu", "gw_menu", "c_menu");

var timeon;

function menuOver(name) {
	clearTimeout(timeon);
	hideAllMenus(name);
	showHideLayer(name, 'show');
}

function menuOut() {
	timeon = setTimeout("oriStatus()", 500);
}

function showHideLayer(name, status) {
	ele = document.getElementById(name);
	if (ele.style) {
    	ele = ele.style;
    	status = (status =='show') ? 'visible' : (status=='hide') ? 'hidden' : status;
   	}
	ele.visibility = status;
}

function oriStatus() {
	hideAllMenus();
	if (cmenu) showHideLayer(cmenu, 'show');
}

function hideAllMenus(except) {
	for (i = 0; i < menu.length; i++) {
		if (menu[i] != except) {
			showHideLayer(menu[i], 'hide');
		}
	}
}

function showPopUp(on, name, popup) {
	clearTimeout(timeon);
	hideAllMenus(name);
	o = document.getElementById(on);
	n = document.getElementById(name);
	pp = document.getElementById(popup);
	pp.style.left = parseInt(o.style.left) + n.offsetLeft;
	pp.style.top = parseInt(o.style.top) + n.offsetTop - parseInt(pp.style.height);
	al = parseInt(pp.style.width) + parseInt(pp.style.left) - parseInt(o.style.left) - parseInt(o.offsetWidth);
	if ( parseInt(al) > 0 ) {
		pp.style.left = parseInt(pp.style.left) - parseInt(al);
	}
	pp.style.visibility = 'visible';
}

function restore(name, filename) {
	obj = document.getElementById(name);
	if (obj != null)
		obj.src = filename;
}

function swap(name, filename) {
	obj = document.getElementById(name);
	if (obj != null)
		obj.src = filename;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

preloadImages(
	"images/designlife_1.gif",
	"images/designlife_2.gif",
	"images/crosspoll_1.gif",
	"images/crosspoll_2.gif",
	"images/globalwisdom_1.gif",
	"images/globalwisdom_2.gif",
	"images/connections_1.gif",
	"images/connections_2.gif"
	);