// function: pop-up window
//var popupWin;
//function popWin(varURL,winH,winW){
//	var wWin = 600;
//	var hWin = 600;
//	if (winW){
//		wWin = winW;
//	}
//	if (winH){
//		hWin = winH;
//	}
	
//	popupWin=window.open("",'winDocViewer','resizable=no, width=1, height=1');
//	popupWin.close();
		
//	popupWin = window.open(varURL, "newWin", "menubar=0, toolbar=0, scrollbars=1, resizable=0, width=" + wWin + ", height=" + hWin);	
//	if (window.focus) {popupWin.focus();}
//}


function email_page(){

	/*var ref = escape(window.parent.parent.location.href);
	
	var target = url + ref ;
	//alert(target);
	
	window.parent.location = target ;*/
	
	//document.FrmEmailThis.pagelink.value = window.top.location.href;
	//document.FrmEmailThis.submit();
	
}

// function: show / hide menu
function showMenu(menuId) {
	document.getElementById(menuId).style.display="";
}

function hideMenu(menuId) {
	document.getElementById(menuId).style.display="none";
}

function toggleMenu(menuId) {
	var menu = document.getElementById(menuId);
	if (menu.opened) {
		hideMenu(menuId);
		document.getElementById("menuArrow_" + menuId).src = document.getElementById("menuArrow_" + menuId).src.replace("_down","_right");
		menu.opened = false;
	}
	else {
		showMenu(menuId);
		document.getElementById("menuArrow_" + menuId).src = document.getElementById("menuArrow_" + menuId).src.replace("_right","_down");
		menu.opened = true;
	}
}

// function: show / hide tabs
function showTab(tabId) {
	document.getElementById('tab1').style.display="none";
	document.getElementById('tab2').style.display="none";
	document.getElementById('tab3').style.display="none";	
	document.getElementById('tab4').style.display="none";
	document.getElementById(tabId).style.display="block";
}


function rollOver(imgName) {
	document[imgName].src = eval(imgName + "_over.src");
}

function rollOff(imgName) {
	document[imgName].src = eval(imgName + "_off.src");
}


/** 
 * Automatic button rollover script
 * 
 *     Add class="button" to any <img> element.
 *     If the src attribute of that element ends in '_off.gif', this script will
 *     attempt to pre-load the equivalent '_on.gif' image. If that image is found,
 *     the appropriate rollover code will be attached to the element.
 *
 */

function ButtonRollovers()
{
	function main()
	{
		var buttons = document.all ? document.all : document.getElementsByTagName('*');
		for(var i=0;i<buttons.length;i++) 
		if(buttons[i].src && buttons[i].src.match(/_off.gif$/) &&
			(" "+buttons[i].className+" ").indexOf(" button ") != -1)
		{        
			var preload = new Image;
			preload.src = buttons[i].src.replace(/_off.gif$/, "_on.gif");

			buttons[i].onmouseover = on;
			buttons[i].onmouseout  = off;
		}
	}

	function target(event)
	{        
		var element = null;
		if(event.target)
			element = event.target;
		else if(event.srcElement)
			element = event.srcElement;

		if(element && element.nodeType == 3)
			element = element.parentNode;

		return element;
	}

	function on(event)
	{
		if(!event) 
			event = window.event;
		var element = target(event);
		if(element.src.match(/_off.gif$/))
			element.src = element.src.replace(/_off.gif$/, '_on.gif');
	}

	function off(event)
	{
		if(!event) 
			event = window.event;
		var element = target(event);
		if(element.src.match(/_on.gif$/))
			element.src = element.src.replace(/_on.gif$/, '_off.gif');
	}    

	if(window.addEventListener)
		window.addEventListener('load', main, false);
	else if(window.attachEvent)
		window.attachEvent('onload', main);
	else
	{
		var oldLoader = window.onload;
		window.onload = function()
		{
			if(oldLoader)
				oldLoader();
			main();
		};
	}
}
if(document.createElement && document.getElementsByTagName)
	ButtonRollovers();
	