function GotoOtherAreas()
	{
	var strArea = document.frmArea.elements['inpArea'].options[document.frmArea.elements['inpArea'].selectedIndex].value;
	if(strArea != '0') {
		location.replace(strArea);
		}
	else {
		alert('Please choose an area');
		}
	}

// Non-Internal search	
function submitWHSearch(pbRMCOM, pbUseHTTPS) {
	var strSearchString;
	var strProtocolAndWebSitename;

	//Reg Expr for matching technical article
	reContentRef = /^(mta|tec|prd|dwn|nws|mpr)\d{4}/i;
	
	if (pbUseHTTPS == null) {
		strProtocolAndWebSitename = '';
	} else if (pbUseHTTPS == true) {
		strProtocolAndWebSitename = 'https://' + window.location.hostname;
	} else {
		strProtocolAndWebSitename = 'http://' + window.location.hostname;
	}	
	
	// Support VAE, if search looks like a technical article content ref, open it.
	if (checkWHSearch(pbRMCOM))	{
		if(pbRMCOM) {
			strSearchString = document.frmWHSearchForm.elements['inpSearchCriteria'].value;
		}
		else {
			strSearchString = document.frmWHSearchForm.elements['inpSearchString'].value;
		}
			
		if(reContentRef.test(strSearchString)) {
			window.open(strProtocolAndWebSitename + '/_RMVirtual/Includes/CSRedirect.asp?nav=0&cref=' + strSearchString, "", "scrollbars=Yes, resizable=Yes, toolbar=Yes, menubar=Yes, location=no, directories=no, width=670,height=500,left=40,top=40");			
			return false;
		}
		else {
			if (document.frmWHSearchForm.inpSector && document.frmWHSearchForm.inpSector.options[document.frmWHSearchForm.inpSector.selectedIndex].text == 'Support') {
				document.frmWHSearchForm.inpSearchString.value = strSearchString;
				document.frmWHSearchForm.action = strProtocolAndWebSitename + '/Support/KnowledgeLibrary.asp';
			}
			document.frmWHSearchForm.submit();
		}
	}
	
}
// Internal Search			
function submitSearchInt()
	{
	if ((document.frmWHSearchInternal.inpSearchString.value == strSearchText) ||
	    (document.frmWHSearchInternal.inpSearchString.value == '')) {
	    alert('Please input your search criteria.');
	    }
	else {
		frmWHSearchInternal.submit();
		}
	}

function submitSearchInt2()
	{
	if ((document.frmWHSearchForm.inpSearchString.value == strSearchText) ||
	    (document.frmWHSearchForm.inpSearchString.value == '')) {
	    alert('Please input your search criteria.');
	    }
	else {
		frmWHSearchForm.submit();
		}
	}

function checkWHSearch(pbRMCOM)
	{
	if (pbRMCOM == true) {
		// use inpSearchCriteria	
		if (document.frmWHSearchForm.inpSector && document.frmWHSearchForm.inpSector.options[document.frmWHSearchForm.inpSector.selectedIndex].text.charAt(0) == '-')
		{
			alert('Please select an area of the site to search within.');
			return false;
		}
		if (document.frmWHSearchForm.inpCategory && document.frmWHSearchForm.inpCategory.options[document.frmWHSearchForm.inpCategory.selectedIndex].text.charAt(0) == '-')
		{
			alert('Please select a part of this area to search within.');
			return false;
		}
		if ((document.frmWHSearchForm.elements['inpSearchCriteria'].value == strSearchText) ||
		    (document.frmWHSearchForm.elements['inpSearchCriteria'].value == ''))
		{
			alert('Please input your search criteria.');
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		if ((document.frmWHSearchForm.elements['inpSearchString'].value == strSearchText) ||
		    (document.frmWHSearchForm.elements['inpSearchString'].value == ''))
		{
			alert('Please input your search criteria.');
			return false;
		}
		else
		{
			return true;
		}	
	}

	}
	
// Use in stdfooter
function ForwardURL(pbUseHTTPS) {

	var strDocumentURL = document.URL;
	var strDocumentTitle = document.title;
	var strPopUpWindowURL;
	var strProtocolAndWebSitename;

	if (pbUseHTTPS == null) {
		strProtocolAndWebSitename = '';
	} else if (pbUseHTTPS == true) {
		strProtocolAndWebSitename = 'https://' + window.location.hostname;
	} else {
		strProtocolAndWebSitename = 'http://' + window.location.hostname;
	}
	strPopUpWindowURL = strProtocolAndWebSitename + '/ContactUs/Forward.asp?DocumentURL=' + escape(strDocumentURL) + '&DocumentTitle=' + escape(strDocumentTitle);


	popupWindow(strPopUpWindowURL , 'FRIEND');
	
	// ******************************* DO NOT REMOVE ****************************************
	// Add the foward url event to the webabacus arrays so that they get posted back to the
	// server. 
	if(browserJavascript >= '1.3') {
		setWACustomVars('eventtype', 'forwardURL', true, true);
	}
	//***************************************************************************************
	
}

function printWHPage() {
	if (window.print) {
		window.print();
	
		// ******************************* DO NOT REMOVE ****************************************
		// Add the print event to the webabacus arrays so that they get posted back to the
		// server. Try first as the function may not be available
		if(browserJavascript >= '1.3') {
			setWACustomVars('eventtype', 'printWindow', true, true);
		}
		//***************************************************************************************
	
	} else {
		alert("To print this page, please use your browser's Print button");
	}
}

function showHideNav(pbShow) {
  if(window.browserDHTML && browserDHTML != '0') { 
	//update cookie FIRST
	var dtExpiry = new Date();
	dtExpiry.setYear(dtExpiry.getYear()+1);
	setCookie('hidenav',(pbShow ? 'false' : 'true'),dtExpiry,'/');
	var oSpan = document.all[(pbShow ? 'wh_max_nav' : 'wh_min_nav')];
	if (oSpan && oSpan.innerHTML == '') {
	  //ask server
	  var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
	  oXMLHTTP.open('POST', '/_RMVirtual/Includes/WebHeaderRmDotCom.asp?WH_Partial=True&WH_HideNav=' + (pbShow ? 'False' : 'True') + '&WH_URL=' + escape(document.location.pathname), false);
	  oXMLHTTP.send('a'); // force post
	  oSpan.outerHTML = oXMLHTTP.responseText;
	}
    changeStyle('min_nav','display',(pbShow ? 'none' : ''));
    changeStyle('max_nav','display',(pbShow ? '' : 'none'));
    if(window.adjustNavbar) {
      var bNav = (document.all['maxHead']==null ? false : true);
      if(pbShow != bNav)
        adjustNavbar();  
    }
  }
}
var mbHaveMinMax = true;
function showHideNavDisplay() {
  //refresh GUI
  var bShow = (getCookie('hidenav')=='true' ? false : true);
  showHideNav(bShow); 
}
