/*
	legal_popup.js
	functions called by the "legal" footer appended to each page of the pump selection process.
*/

//launches pop-up window for "terms of use" and "privacy policy" links
//pageURL: indicates URL of the pop-up's content
//
function legalPopup(pageURL)
{
	var winHeight = 680;
	var winWidth = 600;
	var winParams = "height= " + winHeight +
									", width= " + winWidth + 
									", top=" + (screen.height - winHeight) / 2 +
									", left=" + (screen.height - winHeight) / 2 +
									", scrollbars=yes, toolbar=no, location=no, status=no, menubar=no, resizable=yes";
									
	var newWindow = window.open(pageURL, "ESI_legalPopup", winParams);

	if (window.focus) //if browser supports focus method, bring window to front (in case it's already open)
		newWindow.focus();
	
	return;
}

//redirect user to a  profile page for changing their unit preferences & registration information
//
//directory: When viewing from an "OEM" source, indicates the home directory for active OEM customer
//bOEM:			 indicates user came from an "OEM" link on manufacturers corporate website.
function updateProfile(directory, bOEM)
{
	var cat = new String(document.MAINFORM.catName.value);
	var strOEM;
	
	if (bOEM == 1)
		strOEM = directory
	else
		strOEM = "";
	
	window.location.href = "/reg/updateprofile.asp?OEM=" + strOEM + "&URL=/PumpSelection/" + directory + "/types.asp?catName=" + cat.slice(0, -3);
	return false
}