//
// Highlight the selected menu item
//
// called by the 'onLoad' event of the relevant
// page.  The menu ID is the argument.
// 
function menuSelect( menuItem, section ) {

	//alert ("test - " + menuItem );
	var pageName = section;

	identity=document.getElementById( menuItem );
	identity.className = "menuSelected";
	return;
}

//
// Open a pop-up window
// function is passed the URL, height & width
//
function popupWin ( url, height, width) {
	var features;
	features = "'toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=" + width + ",height=" + height + "'";
	window.open ( url, "popup", features);
}

function popupWinSB ( url, height, width) {
	// popup window with scroll bars
	var features;
	features = "'toolbar=no,status=no,menubar=no,scrollbars=yes,resizeable=no,width=" + width + ",height=" + height + "'";
	window.open ( url, "popup", features);
}

function popMailer ( url, height, width) {
	// popup window with scroll bars
	var features;
	var height = 480;
	var width = 500;
	features = "'toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=" + width + ",height=" + height + "'";
	window.open ( url, "popup", features);
}



function showMap () {
	var features;
	features = "toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=350,height=300";
	window.open ( "./map_popup.html", "map", features);
}

function showTerms ( id ) {
	var features;
	features = "toolbar=no,status=no,menubar=no,scrollbars=yes,resizeable=no,width=400,height=300";
	window.open ( "/glossaryp.html#" + id , "Glossary", features);
}

// show enlarged product image
//  args: image=image file name, or=orientation (p or l)
function showProduct ( image, or) {
	var features;
	if ( or == "p" ) {
		features = "toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=500,height=670";
	}
	else {
		features = "toolbar=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=670,height=550";
	}
	window.open ( image, "product", features);
}


// Copyright 2006-2007 javascript-array.com
// http://javascript-array.com/scripts/simple_drop_down_menu/
//
var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 


