function showhide(divID)
{
	if (document.layers) // NN4+
	{
		if (document.layers[divID].visibility == "hide")
			show(divID);
		else
			hide(divID);
	}
	else if (document.getElementById)
	{
		var obj = document.getElementById(divID);
		if (obj.style.visibility == "hidden")
			show(divID);
		else
			hide(divID);
	}
	else if (document.all)
	{
		if (document.all[divID].style.visibility == "hidden")
			show(divID);
		else
			hide(divID);
	}
}//end function showhide

function checkMouseOut (e, layerNode)
{
	if (!e)
	{
		var e = window.event;
	}
	
	var target = (window.event) ? e.srcElement : e.target;
	
	if ( target != layerNode)
	{
		return;
	}
	
	var relatedTarget = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while (relatedTarget != target && relatedTarget.nodeName != 'BODY')
	{
		relatedTarget = relatedTarget.parentNode;
	}
	
	if (relatedTarget == target)
	{
		return;
	}
	// Mouseout took place when mouse actually left layer
	// Handle event
}

function show(divID)
{
	var txt = "[ Hide ]";
	if (document.layers) // NN4+
	{
		document.layers[divID].visiblity = "show";
		document.layers[divID].display = "inline";
		if (document.layers[divID+'_image']) {
			document.layers[divID+'_image'].src = "images/arrow_open.gif";
		}
		if (document.layers[divID+'_txt']) {
			document.layers[divID+'_txt'].innerHTML = txt;
		}
	}
	else if (document.getElementById) // gecko(NN6) + IE 5+
	{
		obj = document.getElementById(divID);
		obj.style.visibility = "visible";
		obj.style.display = "inline";
		obj = document.getElementById(divID+'_image');
		if (obj) {
			obj.src = "images/arrow_open.gif";
		}
		obj = document.getElementById(divID+'_txt');
		if (obj) {
			obj.innerHTML = txt;
		}
	}
	else if (document.all) // IE 4
	{
		document.all[divID].style.visibility = "visible";
		document.all[divID].style.display = "inline";
		if (document.all[divID+'_image']) {
			document.all[divID+'_image'].src = "images/arrow_open.gif";
		}
		if (document.all[divID+'_txt']) {
			document.all[divID+'_txt'].innerHTML = txt;
		}
	}

}//end function show

function hide(divID)
{
	var txt = "[ Show ]";
	if (document.layers) // NN4+
	{
		document.layers[divID].visiblity = "hide";
		document.layers[divID].display = "none";
		if (document.layers[divID+'_image']) {
			document.layers[divID+'_image'].src = "images/arrow_closed.gif";
		}
		if (document.layers[divID+'_txt']) {
			document.layers[divID+'_txt'].innerHTML = txt;
		}
	}
	else if (document.getElementById) // gecko(NN6) + IE 5+
	{
		var obj = document.getElementById(divID);
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		obj = document.getElementById(divID+'_image');
		if (obj) {
			obj.src = "images/arrow_closed.gif";
		}
		obj = document.getElementById(divID+'_txt');
		if (obj) {
			obj.innerHTML = txt;
		}
	}
	else if (document.all) // IE 4
	{
		document.all[divID].style.visibility = "hidden";
		document.all[divID].style.display = "none";
		if (document.all[divID+'_images']) {
			document.all[divID+'_images'].src = "images/arrow_closed.gif";
		}
		if (document.all[divID+'_txt']) {
			document.all[divID+'_txt'].innerHTML = txt;
		}
	}
}

function changeImageSrc(imageID, txtID, prefix)
{
	if (document.layers) // NN4+
	{
		var val = document.layers[txtID].value;
		document.layers[imageID].src == prefix+val;
	}
	else if (document.getElementById)
	{
		var txt = document.getElementById(txtID);
		var obj = document.getElementById(imageID);
		obj.src = prefix+txt.value;
	}
	else if (document.all)
	{
		var val = document.all[txtID].value;
		document.all[imageID].src = prefix+val;
	}
}

function processLinks()
{
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
				anchor.target = "_blank";
		}
	}
}
function hover(imgName,imgObj){
	if (document.images){
		imgOn=imgName + "_mo.gif";
		imgObj.src= "/images/"+imgOn;
	}
}

function unhover(imgName,imgObj){
	if (document.images){
		imgOff=imgName + ".gif";
		imgObj.src= "/images/"+imgOff;
	}
}//end function unhover

// Used in the Customer Activation popup window.
// Closes the popup and refreshes parent window.
function refreshParent (urlString)
{
	if(window.opener != null){
		if (urlString == '')
		{
			// window.opener.location.href = window.opener.location.href;
			window.opener.location.reload();
		}
		else
		{
			window.opener.location.href = urlString;
		}
	}
	window.close();
}

// A seconds timer function -- waits a few
// seconds then calls refreshParent()
function counterDisplay(seconds, urlString)
{
	// document.getElementById('myCounter').innerHTML = seconds;
	// return;
	
	if (seconds < 1)
	{
		refreshParent(urlString);
	} 
	else
	{
		document.getElementById('myCounter').innerHTML = seconds;
		
		seconds -= 1;
		// document.all("counterDisplay").innerText = 'This is new text in SPAN ONE';
		setTimeout('counterDisplay(' + seconds + ', \'' + urlString + '\')',1000);
	}
	
}
