// ORINGAL AUTHOR: FRANK SEMAN
	// ORIGINAL LOCATION: INVESTORS SITE
	
if (typeof(leftNavElArray) == "undefined"){
	var leftNavElArray = new Array();	
}
	
	function SetRadioDefault()
	{
		// If there is only one radio box then by default it must always be 
		// selected regadrless on insert or updateing
		if (typeof(document.frmSubscription.radSubscription.value) == 'string')
		{
			// If there is only one radio box then test as a string
			document.frmSubscription.radSubscription.checked = true;
		}
		else
		// if there are multiple radio buttons then we need to make sure at least one
		// is selected on load, if not default to the first radio button as selected.
		{
			var length = "5";
			var selected = false;
			
			for(i=0;i<length;i++)
			{
				if(document.frmSubscription.radSubscription[i].checked)
				{
					selected = true;
					break;
				}
			}
			
			if(!selected)
			{
				document.frmSubscription.radSubscription[0].checked = true;
			}
		}
		
	}													
	
	
	
	function isMoz() {
	// I CHECK IF THE BROWSER IS MOZILLA
	// IF IT IS, I LOAD A MOZILLA STYLESHEET
		if (is_moz){
			//alert('browser is mozilla');
			//document.write("<style>a.topNavLink:link,a.topNavLink:visited,a.topNavLink:active {color: #545454; padding: 6px 8px;  border-style: dotted; border-width: 5px 0px 0px 0px; border-left-color: #ffffff; border-right-color: #737373; font-size: 9px; text-decoration: none; border-top-style: solid; border-top-color: #E6E6E6; }</style>")
			document.write("<style>.sep {width: 1px; border-style: dotted; border-width: 0px 1px; border-left-color: #ffffff; border-right-color: #737373; padding-top: 2px; position: relative; top: 2px;}</style>")
			//document.write("<style>a.topNavLink:hover {background-color: #; color: #000000; border-top-color: #D3232E;}</style>")
			document.write("<style>a.topNavLink_selected:link,a.topNavLink_selected:visited,a.topNavLink_selected:active {border-bottom:6px solid #4E92CF;}</style>")
			document.write("<style>a.topNavLink:link,a.topNavLink:visited,a.topNavLink:active {padding-bottom:11px;}</style>")
			
			document.write("<style>a.leftNav_level0:link,a.leftNav_level0:active,a.leftNav_level0:visited {}</style>")
			document.write("<style>a.leftNav_level1:link,a.leftNav_level1:active,a.leftNav_level1:visited {}</style>")
			document.write("<style>a.leftNav_level2:link,a.leftNav_level2:active,a.leftNav_level2:visited {}</style>")
			document.write("<style>#contentSummary_download_info {width: 70px;}</style>")
		}else {
			document.write("<style>a.leftNav_level0:link,a.leftNav_level0:active,a.leftNav_level0:visited {width:100%;height:100%}</style>")
			return;
		};
	}		
	
	function printerFriendly(type_){
		var type = type_
		if(type == 'normal'){
			window.location.reload();
		}else{
		
			document.all.summaryFooterLayout.style.position = 'relative';
			document.all.summaryFooterLayout.style.top = '34px';
			document.all.viewNormal.style.display='block';
			document.all.viewFull.style.display='none';
			
			document.all.header.style.display='none';
			document.all.headerPics.style.display='none';
			document.all.leftNav.style.display='none';
			document.all.footerContent.style.display='none';
			document.all.maximo.style.display='none';
			document.all.restoro.style.display='block';
			document.all.welicon_print.style.display='inline';
		}
	}
	
// Validate and submit form - EMAIL ALERT REGISTRATION FORM/TEMPLATE
function SubmitForm(objForm, emailformname, action)
{
	//if the user is adding or updating a subscription validate supplied email address,
	//if the email address is valid or the user is performing another process 
	// (i.e unsubscribe) set the action field and submit the form 	
	if((action == "UnSub") || (ValidEmail(eval("objForm." + emailformname))))
	{
		objForm.hdnAction.value = action;
		objForm.submit();
	}			
}

function ValidEmail(entered)
{
	// E-mail-Validation by Henrik Petersen / NetKontoret
	// Explained at www.echoecho.com/jsforms.htm
	// Please do not remove the this line and the two lines above.
	with (entered)
	{
		apos=value.indexOf("@"); 
		dotpos=value.lastIndexOf(".");
		lastpos=value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
		{
			alert("Error! Please enter a valid email address");
			return false;
		}
		else 
		{
			return true;
		}
	}
}

// showHideLeft
//Modified by WOPAMF. Because leftNav is different we need to change the way hide/show works.
//Explicitly hide all before showing the selected nav group
//function showHideLeft(id, idList){
function showHideLeft(id){

	//#########################
	//This section is to loop throught the Id list and close everything
	// determine display type & return display state to browser
	//var currentID;
	//var idListCopy = new Array();
	//idListCopy = idList.copy();
	//currentID = idListCopy.pop();
	//while (currentID.length > 0 ){
	//	document.all[id].style.display = "block";
	//	currentID = idListCopy.pop();
	//}
	//#########################
	
	if (document.all[id].style.display == "block"){
		document.all[id].style.display = "none";
		return;
	}
	else{
		document.all[id].style.display = "block";
		return;
	}
};
