/***********************************************************
	DHTML layer show/hide script (c) 2007, David Emerson
	Emerson Media :: www.emersonmedia.com
***********************************************************/

// settings for overarch nav thumbs and titles
var OVERARCH_NAV = new Array();
OVERARCH_NAV["fumsi"] = new Array();
OVERARCH_NAV["freepint"] = new Array();
OVERARCH_NAV["vip"] = new Array();
OVERARCH_NAV["resourceshelf"] = new Array();
OVERARCH_NAV["docuticker"] = new Array();
OVERARCH_NAV["jinfo"] = new Array();

OVERARCH_NAV["fumsi"]["gif"] = "fumsi";
OVERARCH_NAV["fumsi"]["title"] = "<FONT COLOR=#ffffff>FUMSI: Helping You Find, Use, Manage and Share Information";
OVERARCH_NAV["fumsi"]["desc"] = "Tips and feature stories for FUMSI professionals – learn from experts in the field. Search the database of articles, purchase hands-on reports, and subscribe for more benefits.</FONT>";
OVERARCH_NAV["fumsi"]["url"] = "http://www.fumsi.com";

OVERARCH_NAV["freepint"]["gif"] = "freepint";
OVERARCH_NAV["freepint"]["title"] = "<FONT COLOR=#ffffff>FreePint: Global Community for Info Pros";
OVERARCH_NAV["freepint"]["desc"] = "Get your tricky questions answered at the FreePint Bar. Sign up for our free newsletter to receive updates on tips, articles, features and more.</FONT>";
OVERARCH_NAV["freepint"]["url"] = "http://www.freepint.com";

OVERARCH_NAV["vip"]["gif"] = "vip";
OVERARCH_NAV["vip"]["title"] = "<FONT COLOR=#ffffff>VIP: Premium News and Reviews for Premium Content Users";
OVERARCH_NAV["vip"]["desc"] = "In-depth unbiased reviews of premium content products, plus industry insight and news analysis. Request a free sample issue or start a subscription.</FONT>";
OVERARCH_NAV["vip"]["url"] = "http://www.vivavip.com";

OVERARCH_NAV["resourceshelf"]["gif"] = "resourceshelf";
OVERARCH_NAV["resourceshelf"]["title"] = "<FONT COLOR=#ffffff>ResourceShelf: Daily Updates of Web-Based Sources";
OVERARCH_NAV["resourceshelf"]["desc"] = "Full text, multimedia, databases, lists and rankings - if it's free and on the web, it's on ResourceShelf. Free weekly newsletter.</FONT>";
OVERARCH_NAV["resourceshelf"]["url"] = "http://www.resourceshelf.com";

OVERARCH_NAV["docuticker"]["gif"] = "docuticker";
OVERARCH_NAV["docuticker"]["title"] = "<FONT COLOR=#ffffff>DocuTicker: Full-Text Reports Online";
OVERARCH_NAV["docuticker"]["desc"] = "Our guide to free full-text reports by government agencies, NGOs, and other public interest groups on the web. Free weekly newsletter.</FONT>";
OVERARCH_NAV["docuticker"]["url"] = "http://www.docuticker.com";

OVERARCH_NAV["jinfo"]["gif"] = "jinfo";
OVERARCH_NAV["jinfo"]["title"] = "<FONT COLOR=#ffffff>Jinfo: Jobs in Information";
OVERARCH_NAV["jinfo"]["desc"] = "Find an information-related vacancy or learning opportunity to enhance your career. Free weekly update. Targeted advertising for recruiters and event organisers.<BR></FONT>";
OVERARCH_NAV["jinfo"]["url"] = "http://www.jinfo.com";

/************************************************/
// dropdown script settings
var o_timer_active = 0;
var Y_FUDGE_FACTOR = 28;	// move dropdowns down by these pixels
var X_FUDGE_FACTOR = new Array();	// move dropdowns left by these pixels
var O_MENU_TIMEOUT = 1;	// timeout disappearing time in sec
X_FUDGE_FACTOR["fumsi"] = -35;
X_FUDGE_FACTOR["freepint"] = -35;
X_FUDGE_FACTOR["vip"] = -35;
X_FUDGE_FACTOR["resourceshelf"] = -50;
X_FUDGE_FACTOR["docuticker"] = -125;
X_FUDGE_FACTOR["jinfo"] = -200;
var OVERARCH_HTML = new Array();	// html to output for overarch menu popups
OVERARCH_HTML[0] = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin:0px;padding:0px\"><tr><td class=\"overarch_top\"><img src=\"http://web.vivavip.com/library/spacer.gif\" width=\"1\" height=\"1\" /></td></tr><tr><td class=\"overarch_bg\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\"><a href=\"";
OVERARCH_HTML[1] = "\"><img src=\"http://web.vivavip.com/library/inc/thumb_nav_";
OVERARCH_HTML[2] = ".gif\" width=\"95\" height=\"73\" border=\"0\" /></a></td><td valign=\"top\"><div id=\"hover_title\">";
OVERARCH_HTML[3] = "</div>";
OVERARCH_HTML[4] = " <a href=\"";
OVERARCH_HTML[5] = "\"><B>Launch website &raquo;</B></a></td></tr></table></td></tr><tr><td class=\"overarch_bot\"><img src=\"http://web.vivavip.com/library/spacer.gif\" width=\"1\" height=\"1\" /></td></tr></table>";

/************************************************/

// preload (cache) images
var precache = new Array("top_hover","overarch_bg_top","overarch_bg_bot","overarch_bg");
var overarchImage = new Array();
if (document.images) {
	for(i=0; i<precache.length; i+=3) {
		overarchImage[i] = new Image();
		overarchImage[i].src = "http://web.vivavip.com/library/inc/" + precache[i] + ".gif";
	}
}

function overarch_clear_timer() {
	if(o_timer_active == 1) {
		clearTimeout(o_timer);
		o_timer_active = 0;
	}
}

function overarch_show(id_image,id_list,overarch_name) {
	// find position of button
	var pos_left = pos_top = 0;
	if (id_image.offsetParent) {
		pos_left = id_image.offsetLeft;
		pos_top = id_image.offsetTop;
		while (id_image = id_image.offsetParent) {
			pos_left += id_image.offsetLeft;
			pos_top += id_image.offsetTop;
		}
	}
	pos_left += X_FUDGE_FACTOR[overarch_name];
	pos_top += Y_FUDGE_FACTOR;
	
	document.getElementById(id_list).style.left = pos_left + "px";
	document.getElementById(id_list).style.top = pos_top + "px";
	document.getElementById(id_list).style.display = "block";

	// output popup html
	document.getElementById(id_list).innerHTML = OVERARCH_HTML[0] + OVERARCH_NAV[overarch_name]["url"] + OVERARCH_HTML[1] + OVERARCH_NAV[overarch_name]["gif"] + OVERARCH_HTML[2] + OVERARCH_NAV[overarch_name]["title"] + OVERARCH_HTML[3] + OVERARCH_NAV[overarch_name]["desc"] + OVERARCH_HTML[4] + OVERARCH_NAV[overarch_name]["url"] + OVERARCH_HTML[5];
}

function overarch_delay_hide() {
	overarch_clear_timer();
	o_timer = setTimeout('overarch_hide();', O_MENU_TIMEOUT * 1000);
	o_timer_active = 1;
}

function overarch_hide() {
	document.getElementById('div_overarch').style.display = "none";
}

function overarch_item_over(id_item) {
	id_item.style.backgroundColor = '#b7c2d5';
	id_item.style.cursor = "hand";
}

function overarch_item_out(id_item) {
	id_item.style.backgroundColor = '#e5e5e5';
}

function overarch_b_over(id_image) {
	document.getElementById(id_image).src = "http://web.vivavip.com/library/inc/b_" + id_image + "_on.gif";
	overarch_clear_timer();
	overarch_hide();
}

function overarch_b_out(id_image) {
	document.getElementById(id_image).src = "http://web.vivavip.com/library/inc/b_" + id_image + "_off.gif";
}



/************************************************
	           Misc. Functions
************************************************/

function ie_hover_fix() {
	if(!document.all) {
		return false;
	}
	var element_ids = Array('nav1','nav2','nav3','nav4','nav5','nav6','nav7');
	for(var i=0; i<element_ids.length; i++) {
		var element = document.getElementById(element_ids[i]);
		if(element) {
			element.onmouseover = function () {
				element_class = this.className;
				this.className = element_class + " hover";
			}
			element.onmouseout = function () {
				element_class = this.className;
				element_class = element_class.replace(/hover/,"")
				this.className = element_class;
			}
		}
	}
}
