var nsCompId = "716012";var tintedLensCost = '199.00';var greyPhotoLensCost = '299.00';/* var mySubdomain is used to determine whether or not to insert "sandbox." into the subdomain for NetSuite purposes. I only wanted to insert "sandbox." into the absolute URL references in hidden iframes' sources that were being usedwith Flash for cross-subdomain communication. So it did not makes sense to update the entire domain.Examples:https://forms.netsuite.com/app/site/https://forms.sandbox.netsuite.com/app/site/So, https://forms.sandbox.netsuite.com/app/site/may need to communicate with https://checkout.sandbox.netsuite.com/app/site/orhttps://forms.netsuite.com/app/site/may need to communicate with https://checkout.netsuite.com/app/site/depending on which server the code is being executed from.*/var mySubdomain = "sandbox.";var myDomain = document.domain;if (myDomain.indexOf("sandbox.") == -1) mySubdomain = "";//alert('mySubdomain = ' + mySubdomain);var isBrowserIE = document.all ? true : false;var isBrowserNS = document.addEventListener ? true : false;var isBrowserNS4x = document.layers ? true : false ;/*function includeJsFile(jsFilePath) {	var myIncludeScript  = document.createElement('script');	myIncludeScript.src  = jsFilePath;	myIncludeScript.type = 'text/javascript';	myIncludeScript.defer = true;		document.getElementsByTagName('head').item(0).appendChild(myIncludeScript);}// Include the ajax file from Trinet's server as needed// to perform server-side operations like sending an email.includeJsFile('/c.' + nsCompId + '/site/includes/ajax.js');*//** * copySelectTag *  * @param {string} sourceSelectId: the id assigned to the source select tag *  * @param {string} targetSelectId: the id assigned to the target select tag *  * @param {booelan} sortList: if set to true then the source list will be sorted alphabetically in ascending order * 							  before being applied to the target. The source list order will remain unchanged. * * @param {integer} defaultIndex: the index of the option to be the target select's initial selection. Index 0 is the first option. */function copySelectTag(sourceSelectId, targetSelectId, sortList, defaultIndex) {	var originalSourceSelection = document.getElementById(sourceSelectId).value;		var sourceSelectOptions = document.getElementById(sourceSelectId).options;	var targetSelectOptions = document.getElementById(targetSelectId).options;		var sourceSelectAllOptions = new Array();	var sourceSelectOptionsCount = sourceSelectOptions.length;	var targetSelectOptionsCount = targetSelectOptions.length;			// If sourceSelectAllOptions has not yet been initialized then store all options initally included 	// in the source selection drop-down.	//sourceSelectAllOptions[0] = sourceSelectOptions[0];	for (var i = 0; i < sourceSelectOptionsCount; i++) {		// Transfer the current source list in the drop-down to an array.		sourceSelectAllOptions[i] = sourceSelectOptions[i];	}			// Remove all options from target drop-down.	for (var i = 0; i < targetSelectOptionsCount; i++) {		// Since removing an option changes the index of the existing options		// just always remove the first option.		targetSelectOptions[0] = null;	}			// Store source labels and values	var newTargetList = new Array();	var sourceEntryText = "";	var sourceEntryValue = "";	for (var i = 0; i < sourceSelectAllOptions.length; i++) {		sourceEntryText = sourceSelectAllOptions[i].text;		sourceEntryValue = sourceSelectAllOptions[i].value;				// Use ~ as a delimeter between each options label and value. Also in the unusual case that a value 		// contains a ~ replace it with a space. This concatenation is being done to maintain the association		// between each options label and its value during sorting following this loop.		newTargetList[newTargetList.length] = sourceEntryText.replace(/~/g, " ") + "~" + sourceEntryValue.replace(/~/g, " ");	}			// Sort the list	if (sortList) {		newTargetList.sort();	}				// Update the target drop-down with the latest source list.	for (var i = 0; i < newTargetList.length; i++) {		var newOptionData = newTargetList[i].split("~");		var newTargetName = newOptionData[0];		var newTargetValue = newOptionData[1];		targetSelectOptions[targetSelectOptions.length] = new Option(newTargetName, newTargetValue);	}		// Set the source's initial selection.	if (!isNaN(parseInt(defaultIndex))) {		document.getElementById(sourceSelectId).selectedIndex = defaultIndex;	}		// Ensure that the source original selection is still the same as before copying.	document.getElementById(sourceSelectId).value = originalSourceSelection;}// FOR DEBUG OUTPUT ONLYfunction createDebugOutput() {	var debugDiv = document.createElement('div');	var debugDivWidth = 350;	//var debugDivContent = '<div style="position:absolute; z-index:100; overflow:hidden; width:350px; top:650px; left:0px; color:#6D6F71; border:1px solid #000000; background-color:#EDECEC;">&nbsp;</div>';	var debugDivContent = '<div style="position:relative; z-index:100; width:350px; margin-top:-100px; color:#6D6F71; border:1px solid #000000; background-color:#EDECEC;">&nbsp;</div>';	debugDiv.setAttribute('id','myDebugDiv');	debugDiv.innerHTML = debugDivContent;	document.body.appendChild(debugDiv);	//document.getElementById("myDebugDiv").innerHTML = "DEBUG OUTPUT:<br />";	document.getElementById("myDebugDiv").innerHTML = "";}function updateDebugOutput(debugContent, clearDiv) {	var myInnerHTML = document.getElementById("myDebugDiv").innerHTML;	if (clearDiv) myInnerHTML = "DEBUG OUTPUT:<br /><br />" + debugContent;	else myInnerHTML = myInnerHTML + '<br /><br />' + debugContent;}function updateLensColorImg(newLensColorId) {	var colorImg = new Array();	colorImg[0] = 'lens_clear_large.jpg';	colorImg[1] = 'lens_green_large.jpg';	colorImg[2] = 'lens_light_green_large.jpg';	colorImg[3] = 'lens_slate_large.jpg';	colorImg[4] = 'lens_bronze_large.jpg';	colorImg[5] = 'lens_rose_large.jpg';	colorImg[6] = 'lens_amber_large.jpg';	colorImg[7] = 'lens_grey_photochromic_large.jpg';	colorImg[8] = 'lens_clear_large_corbu.jpg';	colorImg[9] = 'lens_clear_large_corbuhoney.jpg';	colorImg[10] = 'lens_clear_large_bauhauscharcoal.jpg';	colorImg[11] = 'lens_clear_large_bauhaushoney.jpg';		/*	colorImg[1] = 'lens_green.jpg';	colorImg[2] = 'lens_light_green.jpg';	colorImg[3] = 'lens_slate.jpg';	colorImg[4] = 'lens_bronze.jpg';	colorImg[5] = 'lens_rose.jpg';	colorImg[6] = 'lens_amber.jpg';	colorImg[7] = 'lens_grey_photochromic.jpg';	*/		/*	if (newLensColorId > 0) {		document.getElementById('custentity_enhanced_lenses').value = newLensColorId; 		document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[newLensColorId]; 		document.getElementById('lensImgContainer').style.display = 'block';	}	else {		document.getElementById('custentity_enhanced_lenses').value = "";		document.getElementById('lensImgContainer').style.display = 'none';	}	*/		if (newLensColorId > 0) document.getElementById('custentity_enhanced_lenses').value = newLensColorId;	else document.getElementById('custentity_enhanced_lenses').value = "";			if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 1))	{			document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[8]; 		}	else if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 2))	{			document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[10]; 		}	else if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 3))	{			document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[9]; 		}	else if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 5))	{			document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[11]; 		}	else	{		document.getElementById('lensImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[newLensColorId]; 	}	document.getElementById('lensImgContainer').style.display = 'block';		// Show "Omit Clear Lenses" check box only when Grey Photochromic lenses are selected.	var omitClearLensOption = document.getElementById('omitClearLenses');	var omitClearLensCheckbox = document.getElementById('custentity_omit_clear_lenses_fs_inp');	if (omitClearLensOption) {		if (newLensColorId == 7) {			omitClearLensOption.style.display = 'inline';		}		else {			omitClearLensOption.style.display = 'none';			if (omitClearLensCheckbox) omitClearLensCheckbox.checked = false;		}	}}function updateLensDescriptionImg(newLensColorId) {	var colorImg = new Array();	colorImg[0] = '';	colorImg[1] = 'lens_green.jpg';	colorImg[2] = 'lens_light_green.jpg';	colorImg[3] = 'lens_slate.jpg';	colorImg[4] = 'lens_bronze.jpg';	colorImg[5] = 'lens_rose.jpg';	colorImg[6] = 'lens_amber.jpg';	colorImg[7] = 'lens_grey_photochromic.jpg';	colorImg[8] = 'lens_clear_large_corbu.jpg';	colorImg[9] = 'lens_clear_large_corbuhoney.jpg';	colorImg[10] = 'lens_clear_large_bauhauscharcoal.jpg';		if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 1))	{			document.getElementById('myLensColorImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[8]; 	}	else if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 2))	{			document.getElementById('myLensColorImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[10]; 	}	else if((newLensColorId == 0) && (document.getElementById('custentity_frame').value == 3))	{			document.getElementById('myLensColorImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[9]; 	}	else	{			document.getElementById('myLensColorImg').src = '/c.' + nsCompId + '/site/images/lenses/' + colorImg[newLensColorId]; 	}	}function updateReferDropdown(isReferred) {	document.getElementById('custentity_user_referred').value = isReferred;		if (isReferred == '1') 	{		document.getElementById("referral_phone_field").style.display = 'block';		document.getElementById("referral_list").style.display = 'none';	}	else 	{		document.getElementById("referral_phone_field").value = '';		document.getElementById("referral_phone_field").style.display = 'none';		document.getElementById("referral_list").style.display = 'block';	}}function populateTempSizeMain(){	var extratemp = document.getElementsByName("extratempsize[]");		if(document.getElementById("extratemp").checked == true)	{		for(i = 0; i < 4; i++)		{				if(extratemp[i].checked) { populateTempSize(extratemp[i].value);}		}			}	else	{		populateTempSize('999');	}		}	function populateTempSize(val){	var custom = document.getElementsByName("customsize[]");	var rep = document.getElementsByName("repsize[]");	document.getElementById("custentity_replacement_stock_temples").value = document.getElementById("custentity_custom_length_temples").value;	var dsp = document.getElementById("extratempdsp");		if(document.getElementById("extratemp").checked == true)	{	if(val == '135')	{		document.getElementById("extra5").checked = false;			document.getElementById("extra4").checked = true;			rep[0].checked = true;			rep[1].checked = false;			custom[0].checked = false;		custom[1].checked = false;		}	else if(val == '148')	{		document.getElementById("extra5").checked = true;			document.getElementById("extra4").checked = false;			rep[0].checked = false;			rep[1].checked = false;			custom[0].checked = true;		custom[1].checked = false;		}		else if(val == '140')	{		document.getElementById("extra5").checked = false;			document.getElementById("extra4").checked = true;			rep[0].checked = false;			rep[1].checked = true;			custom[0].checked = false;		custom[1].checked = false;			}	else if(val == '155')	{		document.getElementById("extra5").checked = true;			document.getElementById("extra4").checked = false;			rep[0].checked = false;			rep[1].checked = false;			custom[0].checked = false;		custom[1].checked = true;			}	} //checked	else	{		document.getElementById("extra5").checked = false;			document.getElementById("extra4").checked = false;			rep[0].checked = false;			rep[1].checked = false;			custom[0].checked = false;		custom[1].checked = false;			}	dsp.value = "Replacement Temple Length " + val + "mm and Color " + document.getElementById('custentity_custom_length_temples').options[document.getElementById('custentity_custom_length_temples').selectedIndex].text;}function updateTempleSize(val) {	if(val == 1){		document.getElementById('TEMPLE_SIZE').value = 'L35';		document.getElementById("temple_dsp1").innerHTML = "135mm";		document.getElementById("temple_dsp").innerHTML = "135mm";		document.getElementById("orderTempleCost").value = "0";		document.getElementById("temple_cost1").innerHTML = "$0.00";		document.getElementById("temple_cost").innerHTML = "$0.00";	} 	else if(val == 2){		document.getElementById('TEMPLE_SIZE').value = 'L40';		document.getElementById("temple_dsp1").innerHTML = "140mm";		document.getElementById("temple_dsp").innerHTML = "140mm";		document.getElementById("orderTempleCost").value = "0";		document.getElementById("temple_cost1").innerHTML = "$0.00";		document.getElementById("temple_cost").innerHTML = "$0.00";	}	else if(val == 3){		document.getElementById('TEMPLE_SIZE').value = 'L48';		document.getElementById("temple_dsp1").innerHTML = "148mm";		document.getElementById("temple_dsp").innerHTML = "148mm";		document.getElementById("orderTempleCost").value = "25";		document.getElementById("temple_cost1").innerHTML = "$25.00";		document.getElementById("temple_cost").innerHTML = "$25.00";	}	else if(val == 4){		document.getElementById('TEMPLE_SIZE').value = 'L55';		document.getElementById("temple_dsp1").innerHTML = "155mm";		document.getElementById("temple_dsp").innerHTML = "155mm";		document.getElementById("orderTempleCost").value = "25";		document.getElementById("temple_cost1").innerHTML = "$25.00";		document.getElementById("temple_cost").innerHTML = "$25.00";	}}function updateFrameDropdown(isFrame) {	document.getElementById('custentity_frame').value = isFrame;		if (isFrame == '0') 	{		document.getElementById("bauhausTemple").style.display = 'block';		document.getElementById("corbuTemple").style.display = 'none';		document.getElementById("corbuTempleHoney").style.display = 'none';		document.getElementById("bauhausTempleCharcoal").style.display = 'none';				document.getElementById("templeImgContainer").style.display = 'block';		document.getElementById("noTemple").style.display = 'none';		document.getElementById("alt_temple1").checked = true;		document.getElementById('custentity_temple_color').value = '1';		updateTempleColorImg('1');				document.getElementById("altTempleSizeDisplay").style.display = 'block';		document.getElementById("referral_phone_container").style.display = 'block';		updateLensColorImg(0);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize3.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize4.jpg'; 			//Frame Image 		//document.getElementById("frameImgContainer1").style.display = 'block';		//document.getElementById("frameImgContainer2").style.display = 'block';		//document.getElementById("frameImgContainer3").style.display = 'none';		//document.getElementById("frameImgContainer4").style.display = 'none';			}	else if (isFrame == '1')	{		document.getElementById("bauhausTemple").style.display = 'none';		document.getElementById("corbuTemple").style.display = 'block';		document.getElementById("corbuTempleHoney").style.display = 'none';		document.getElementById("bauhausTempleCharcoal").style.display = 'none';				document.getElementById("templeImgContainer").style.display = 'block';		document.getElementById("noTemple").style.display = 'none';		document.getElementById("alt_temple5").checked = true;		document.getElementById('custentity_temple_color').value = '5';		updateTempleColorImg('5');				document.getElementById("altTempleSizeDisplay").style.display = 'block';		document.getElementById("referral_phone_container").style.display = 'block';				updateLensColorImg(8);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize3.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize4.jpg'; 			//Frame Image 		//document.getElementById("frameImgContainer1").style.display = 'none';		//document.getElementById("frameImgContainer2").style.display = 'none';		//document.getElementById("frameImgContainer3").style.display = 'block';		//document.getElementById("frameImgContainer4").style.display = 'block';	}	else if (isFrame == '2') 	{		document.getElementById("bauhausTemple").style.display = 'none';		document.getElementById("corbuTemple").style.display = 'none';		document.getElementById("corbuTempleHoney").style.display = 'none';		document.getElementById("bauhausTempleCharcoal").style.display = 'block';				document.getElementById("templeImgContainer").style.display = 'block';		document.getElementById("noTemple").style.display = 'none';		document.getElementById("alt_temple7").checked = true;		document.getElementById('custentity_temple_color').value = '7';		updateTempleColorImg('7');				document.getElementById("altTempleSizeDisplay").style.display = 'block';		document.getElementById("referral_phone_container").style.display = 'block';		updateLensColorImg(10);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize6BauhausCharcoal.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize4.jpg'; 			//Frame Image 		//document.getElementById("frameImgContainer1").style.display = 'block';		//document.getElementById("frameImgContainer2").style.display = 'block';		//document.getElementById("frameImgContainer3").style.display = 'none';		//document.getElementById("frameImgContainer4").style.display = 'none';			}	else if (isFrame == '3')	{		document.getElementById("bauhausTemple").style.display = 'none';		document.getElementById("corbuTemple").style.display = 'none';		document.getElementById("corbuTempleHoney").style.display = 'block';		document.getElementById("bauhausTempleCharcoal").style.display = 'none';				document.getElementById("templeImgContainer").style.display = 'block';		document.getElementById("noTemple").style.display = 'none';		document.getElementById("alt_temple6").checked = true;		document.getElementById('custentity_temple_color').value = '6';		updateTempleColorImg('6');				document.getElementById("altTempleSizeDisplay").style.display = 'block';		document.getElementById("referral_phone_container").style.display = 'block';				updateLensColorImg(9);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize3.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize5CorbuHoneyBrown.jpg'; 			//Frame Image 		//document.getElementById("frameImgContainer1").style.display = 'none';		//document.getElementById("frameImgContainer2").style.display = 'none';		//document.getElementById("frameImgContainer3").style.display = 'block';		//document.getElementById("frameImgContainer4").style.display = 'block';	}	else if (isFrame == '5') //Bauhaus Honey Brown	{		document.getElementById("bauhausTemple").style.display = 'none';		document.getElementById("corbuTemple").style.display = 'none';		document.getElementById("corbuTempleHoney").style.display = 'block';		document.getElementById("bauhausTempleCharcoal").style.display = 'none';				document.getElementById("templeImgContainer").style.display = 'block';		document.getElementById("noTemple").style.display = 'none';		document.getElementById("alt_temple6").checked = true;		document.getElementById('custentity_temple_color').value = '6';		updateTempleColorImg('8');				document.getElementById("altTempleSizeDisplay").style.display = 'block';		document.getElementById("referral_phone_container").style.display = 'block';				updateLensColorImg(11);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Bauhaus_HoneyBrown.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize4.jpg'; 			//Frame Image 		//document.getElementById("frameImgContainer1").style.display = 'none';		//document.getElementById("frameImgContainer2").style.display = 'none';		//document.getElementById("frameImgContainer3").style.display = 'block';		//document.getElementById("frameImgContainer4").style.display = 'block';	}	else	{		document.getElementById("bauhausTemple").style.display = 'none';		document.getElementById("corbuTemple").style.display = 'none';		document.getElementById("corbuTempleHoney").style.display = 'none';		document.getElementById("bauhausTempleCharcoal").style.display = 'none';				document.getElementById("templeImgContainer").style.display = 'none';		document.getElementById("noTemple").style.display = 'block';		document.getElementById("altTempleSizeDisplay").style.display = 'none';		document.getElementById("referral_phone_container").style.display = 'none';		updateReferDropdown('2');		updateLensColorImg(0);				document.getElementById('frameImg2B').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize3.jpg'; 		document.getElementById('frameImg2C').src = '/c.' + nsCompId + '/site/images/temples/Image_Resize4.jpg'; 			document.getElementById("alt_templesize2").checked = true;		document.getElementById("orderTempleCost").value = '0';		//document.getElementById("frameImgContainer1").style.display = 'none';		//document.getElementById("frameImgContainer2").style.display = 'none';		//document.getElementById("frameImgContainer3").style.display = 'none';		//document.getElementById("frameImgContainer4").style.display = 'none';	}}function updateTempleColorImg(newTempleColorId) {	//document.getElementById('myTempleColorImg').src = '/c.' + nsCompId + '/site/images/temples/temple_' + newTempleColor + '.jpg';		var colorImg = new Array();	colorImg[0] = '';	colorImg[1] = 'temple_black_large.jpg';	colorImg[2] = 'temple_red_large.jpg';	colorImg[3] = 'temple_blue_large.jpg';	colorImg[4] = 'temple_grey_large.jpg';	colorImg[5] = 'temple_charcoal_large.jpg';	colorImg[6] = 'temple_corbu_honeybrown_large.jpg';	colorImg[7] = 'temple_bauhaus_charcoal_large.jpg';	colorImg[8] = 'temple_bauhaus_honeybrown_large.jpg';		/*	colorImg[1] = 'temple_black.jpg';	colorImg[2] = 'temple_red.jpg';	colorImg[3] = 'temple_blue.jpg';	colorImg[4] = 'temple_grey.jpg';	*/	document.getElementById('custentity_temple_color').value = newTempleColorId; 	if((document.getElementById('custentity_frame').value == 5) && (newTempleColorId == 8))	{			document.getElementById('custentity_temple_color').value = 6;	}		document.getElementById('templeImg').src = '/c.' + nsCompId + '/site/images/temples/' + colorImg[newTempleColorId]; 	document.getElementById('templeImgContainer').style.display = 'block';	/*if(newTempleColorId == 5)	{		document.getElementById('templeImgContainer').style.display = 'none';	}	else	{		document.getElementById('templeImgContainer').style.display = 'block';	}	*/}function updateTempleColorSelection(newTempleIndex) {	document.getElementById('custentity_temple_color').selectedIndex = newTempleIndex;}// Does not work for iframe with source set from an external site.function autofitIframe(myId) {	var myIframe = parent.document.getElementById(myId);	if (myIframe) {		if (!window.opera && !document.mimeType && document.all && document.getElementById){			alert("this.document.body.offsetHeight+'px' = " + this.document.body.offsetHeight+"px");			myIframe.style.height = this.document.body.offsetHeight+"px";		}		else if(document.getElementById) {			alert("this.document.body.scrollHeight+'px' = " + this.document.body.scrollHeight+"px");			myIframe.style.height = this.document.body.scrollHeight+"px";		}	}}function getQueryStringValue(targetNV) {	var data = window.location.search.substring(1); // trims "?" from beginning:	var items;	var targetNvResult = '';		if (data.length > 0) {		allNVs = data.split("&") // Split the querystring into name/value pairs				for (var nextNV = 0; nextNV < allNVs.length; nextNV++) {			data = allNVs[nextNV].split("=");						if (data[0].toLowerCase() == targetNV.toLowerCase() || data[0].toLowerCase() == targetNV.toUpperCase()) { 				// Target name was found				//targetNvResult = targetNV + '=' + data[1];				targetNvResult = data[1];				break;			}		}	}		return targetNvResult;}// Example: urlExcludingKey('jsessionid');function urlExcludingKey(targetKey) {	var data = window.location.search.substring(1); // trims "?" from beginning:	var items;	var newUrl = '';		if (data.length > 0) {		allNVs = data.split("&") // Split the querystring into name/value pairs				for (var nextNV = 0; nextNV < allNVs.length; nextNV++) {			data = allNVs[nextNV].split("=");						if (data[0].toLowerCase() != targetKey.toLowerCase() && data[0].toLowerCase() != targetKey.toUpperCase()) { 				if (newUrl != '') newUrl += '&';				newUrl += allNVs[nextNV];			}		}	}		alert('original URL = ' + data + ', new URL = ' + newUrl);		return newUrl;}// Allow Flash to update page before detecting if user leaves the current page.function startPageUnloadDetection() {	//For browsers that support onbeforeunload (IE & FF):	window.onbeforeunload = function(evt)	{		if (typeof evt == 'undefined') evt = window.event;		if (evt) {			//evt.returnValue = "\nIf you clicked the 'Confirm Order' button and are ready to submit your data then click the 'OK' button.\n\nIf this is not the case and you leave this page before submitting your current form data it will be lost.\n\nNote: Please use the form's back button instead of the browser's back button.\n\n";			evt.returnValue = "\nThis will log you out of the ordering system. If you have not yet submitted a pending order for Superfocus, click \"Cancel\" to stay in the ordering system. If you are ready to log out of the system, click \"OK.\" Any unsubmitted data on the form will be lost.\n\n";		}	}	// Note: If a button is active IE does not permit event handlers to be updated.	// To terminate this handler when it is alright to allow the user to leave the current page	// without notification...	// If the button is not a submit type, use onclick="setTimeout('window.onbeforeunload=null',1); form.submit();"}/*The stateLookUp function was created to keep up with NetSuite's changes to the waythe state drop-down values are represented. This will also allow any potentialfuture updates to be accounted for as well.*/function stateLookUp(stateIndex, stateAbbreviation, stateFullName, returnFullName) {	var stateAbbr = new Array();	stateAbbr[0] = 'AL';	stateAbbr[1] = 'AK';	stateAbbr[2] = 'AZ';	stateAbbr[3] = 'AR';	stateAbbr[4] = 'CA';	stateAbbr[5] = 'CO';	stateAbbr[6] = 'CT';	stateAbbr[7] = 'DE';	stateAbbr[8] = 'DC';	stateAbbr[9] = 'FL';	stateAbbr[10] = 'GA';	stateAbbr[11] = 'HI';	stateAbbr[12] = 'ID';	stateAbbr[13] = 'IL';	stateAbbr[14] = 'IN';	stateAbbr[15] = 'IA';	stateAbbr[16] = 'KS';	stateAbbr[17] = 'KY';	stateAbbr[18] = 'LA';	stateAbbr[19] = 'ME';	stateAbbr[20] = 'MD';	stateAbbr[21] = 'MA';	stateAbbr[22] = 'MI';	stateAbbr[23] = 'MN';	stateAbbr[24] = 'MS';	stateAbbr[25] = 'MO';	stateAbbr[26] = 'MT';	stateAbbr[27] = 'NE';	stateAbbr[28] = 'NV';	stateAbbr[29] = 'NH';	stateAbbr[30] = 'NJ';	stateAbbr[31] = 'NM';	stateAbbr[32] = 'NY';	stateAbbr[33] = 'NC';	stateAbbr[34] = 'ND';	stateAbbr[35] = 'OH';	stateAbbr[36] = 'OK';	stateAbbr[37] = 'OR';	stateAbbr[38] = 'PA';	stateAbbr[39] = 'PR';	stateAbbr[40] = 'RI';	stateAbbr[41] = 'SC';	stateAbbr[42] = 'SD';	stateAbbr[43] = 'TN';	stateAbbr[44] = 'TX';	stateAbbr[45] = 'UT';	stateAbbr[46] = 'VT';	stateAbbr[47] = 'VA';	stateAbbr[48] = 'WA';	stateAbbr[49] = 'WV';	stateAbbr[50] = 'WI';	stateAbbr[51] = 'WY';	stateAbbr[52] = 'AFE';	stateAbbr[53] = 'AFA';	stateAbbr[54] = 'AFP';	stateAbbr[55] = 'AB';	stateAbbr[56] = 'BC';	stateAbbr[57] = 'MB';	stateAbbr[58] = 'NB';	stateAbbr[59] = 'NF';	stateAbbr[60] = 'NT';	stateAbbr[61] = 'NS';	stateAbbr[62] = 'NU';	stateAbbr[63] = 'ON';	stateAbbr[64] = 'PE';	stateAbbr[65] = 'PQ';	stateAbbr[66] = 'SK';	stateAbbr[67] = 'YT';	stateAbbr[68] = 'AC';	stateAbbr[69] = 'NW';	stateAbbr[70] = 'NO';	stateAbbr[71] = 'QL';	stateAbbr[72] = 'SA';	stateAbbr[73] = 'TS';	stateAbbr[74] = 'VC';	stateAbbr[75] = 'WS';		var stateFull = new Array();	stateFull[0] = 'Alabama';	stateFull[1] = 'Alaska';	stateFull[2] = 'Arizona';	stateFull[3] = 'Arkansas';	stateFull[4] = 'California';	stateFull[5] = 'Colorado';	stateFull[6] = 'Connecticut';	stateFull[7] = 'Delaware';	stateFull[8] = 'District of Columbia';	stateFull[9] = 'Florida';	stateFull[10] = 'Georgia';	stateFull[11] = 'Hawaii';	stateFull[12] = 'Idaho';	stateFull[13] = 'Illinois';	stateFull[14] = 'Indiana';	stateFull[15] = 'Iowa';	stateFull[16] = 'Kansas';	stateFull[17] = 'Kentucky';	stateFull[18] = 'Louisiana';	stateFull[19] = 'Maine';	stateFull[20] = 'Maryland';	stateFull[21] = 'Massachusetts';	stateFull[22] = 'Michigan';	stateFull[23] = 'Minnesota';	stateFull[24] = 'Mississippi';	stateFull[25] = 'Missouri';	stateFull[26] = 'Montana';	stateFull[27] = 'Nebraska';	stateFull[28] = 'Nevada';	stateFull[29] = 'New Hampshire';	stateFull[30] = 'New Jersey';	stateFull[31] = 'New Mexico';	stateFull[32] = 'New York';	stateFull[33] = 'North Carolina';	stateFull[34] = 'North Dakota';	stateFull[35] = 'Ohio';	stateFull[36] = 'Oklahoma';	stateFull[37] = 'Oregon';	stateFull[38] = 'Pennsylvania';	stateFull[39] = 'Puerto Rico';	stateFull[40] = 'Rhode Island';	stateFull[41] = 'South Carolina';	stateFull[42] = 'South Dakota';	stateFull[43] = 'Tennessee';	stateFull[44] = 'Texas';	stateFull[45] = 'Utah';	stateFull[46] = 'Vermont';	stateFull[47] = 'Virginia';	stateFull[48] = 'Washington';	stateFull[49] = 'West Virginia';	stateFull[50] = 'Wisconsin';	stateFull[51] = 'Wyoming';	stateFull[52] = 'Armed Forces Europe';	stateFull[53] = 'Armed Forces Americas';	stateFull[54] = 'Armed Forces Pacific';	stateFull[55] = 'Alberta';	stateFull[56] = 'British Columbia';	stateFull[57] = 'Manitoba';	stateFull[58] = 'New Brunswick';	stateFull[59] = 'Newfoundland and Labrador';	stateFull[60] = 'Northwest Territories';	stateFull[61] = 'Nova Scotia';	stateFull[62] = 'Nunavut';	stateFull[63] = 'Ontario';	stateFull[64] = 'Prince Edward Island';	stateFull[65] = 'Quebec';	stateFull[66] = 'Saskatchewan';	stateFull[67] = 'Yukon Territory';	stateFull[68] = 'Australian Capital Territory';	stateFull[69] = 'New South Wales';	stateFull[70] = 'Northern Territory';	stateFull[71] = 'Queensland';	stateFull[72] = 'South Australia';	stateFull[73] = 'Tasmania';	stateFull[74] = 'Victoria';	stateFull[75] = 'Western Australia';			if (!isNaN(parseInt(stateIndex))) {		// Requesting state based on index		if (returnFullName) {			return stateFull[stateIndex];		}		else {			return stateAbbr[stateIndex];		}	}	else if(stateAbbreviation != '') {		// Requesting state index from abbreviated state name		for (var i = 0; i < stateAbbr.length; i++) {			if (stateAbbr[i] == stateAbbreviation) {				return i;			}		}	}	else if(stateFullName != '') {		// Requesting state index from full state name		for (var i = 0; i < stateFull.length; i++) {			if (stateFull[i] == stateFullName) {				return i;			}		}	}}function endPageUnloadDetection() {	window.onbeforeunload = function(evt) { }}// This function is called by localMergeAndSendEmail()function handleAjaxEmailResponse(myResponse) {	var headers = response.getAllHeaders();	var output = 'Code: '+response.getCode()+'\n';	output += 'Headers:\n';		for ( var i in headers ) {		output += i + ': '+headers[i]+'\n';	}		output += '\n\nBody:\n\n';	output += response.getBody();	alert( output );}/** * handleValidationResult(passedValidation) * @param {boolean} passedValidation  */function handleValidationResult(passedValidation, validationMessage) {	if (!passedValidation) alert(validationMessage);	else window.location.hash = '#top'; // If no errors then jump user back to top of page.}/*Example usage:	// Preload nav images	var myNavImagePath = '/c.' + nsCompId + '/site/images/navigation/';	var myNavImages = new Array();	myNavImages[0] = myNavImagePath + "ecommerce_customize.gif";	myNavImages[1] = myNavImagePath + "ecommerce_customize_over.gif";		// image list	images = new Array();	images[0]="image1.jpg"	images[1]="image2.jpg"		imagePreloader(images);*/var myNavImages = new Array();var myIsNavImageLoaded = new Array();var allImagesAlreadyLoaded = false;function imagePreloader(myImageArray) {	var imageObj = new Image();		for(var i = 0; i < myImageArray.length; i++) {		// Initialize load condition to false		// This array can be used to trigger an event		// once all images of myImageArray have been loaded.		myIsNavImageLoaded[i] = '0';				// action once the image has loaded		imageObj.onLoad = imageLoaded(i);		imageObj.src = myImageArray[i];	}}function imageLoaded(imageIndex) {	myIsNavImageLoaded[imageIndex] = '1';		var allImagesNowLoad = areAllImagesLoaded();	if (allImagesNowLoad == true) {		// Execute this code once all images are loaded		//alert("All loaded");	}}/** * insertRequiredLabel * @param {string} labelId * @param {boolean} asteriskOnly: if set to true the "Required" label is not displayed. */function insertRequiredLabel(labelId, asteriskOnly) {	var requiredText = 'Required';	if (asteriskOnly) requiredText = '';	document.write('<span id="asterisk_' + labelId + '" style="display:none;" class="error_msg">&nbsp;*&nbsp;' + requiredText + '</span>');}function areAllImagesLoaded() {	var allLoaded = false;		// Don't check that all images are loaded until each	// image has had a chance to start preloading.	if (!allImagesAlreadyLoaded && myIsNavImageLoaded.length != 0 && myIsNavImageLoaded.length == myNavImages.length) {		allLoaded = true;		for(var i = 0; i < myIsNavImageLoaded.length; i++) {			if (myIsNavImageLoaded[i] == '0') allLoaded = false;		}				if (allLoaded) allImagesAlreadyLoaded = true;	}		return allLoaded;}// Merge, send, and associate an email with a record// This function calls handleAjaxEmailResponse()function localMergeAndSendEmail(){	//alert("START localMergeAndSendEmail");	/*	var records = new Array();	records['transaction'] = '1000';	var emailBody = nlapiMergeTemplate( 25, 'customer', '100' );	*/		/*	nlapiSendEmail(author, recipient, subject, body, cc, bcc, records)	nlapiSendEmail(from, to, subject, body, cc, bcc, records, files)	nlapiSendEmail(-5, 100, 'Promotion Notification', emailBody , null, null, records);		 	* author - The internalId of an employee record (this is the sender). Must be an			employee record and defaults to script deployment ID.		* recipient - Recipient internalId or external email address		* subject {string} - Subject of the outgoing mail		* body {string} - Body of the outgoing email.			Important: The body argument is required. A JavaScript exception will be thrown if			the body of the email message is left blank.		* cc[ ] - An array of email addresses or a single email address to copy		* bcc[ ] - An array of email addresses or a single email address to blind copy		* records - An associative array of internal records to associate/attach this email with.			The following options are valid:			* transaction - Transaction/Opportunity			* activity - Case/Campaign			* entity - Entity			* record - Custom record internalId			* recordtype - Custom recordType internalId	 */	/*	// id 2 = do_not_reply@trufocals.com	var emailAuthor = 203;	var emailRecipient = 'testmk@trinetsolutions.com';	var emailSubject = 'NetSuite Email Test Subject';	var emailBody = 'Test message body';	//var emailBody = nlapiMergeTemplate( 25, 'customer', '100' );	//var emailCc = new Array();	var emailCc = null;	//var emailBcc = new Array();	var emailBcc = null;	var emailRecords = new Array();	//var emailRecords = null;	*/	//nlapiSendEmail(emailAuthor, emailRecipient, emailSubject, emailBody, emailCc, emailBcc, emailRecords);	//nlapiSendEmail(emailAuthor, emailRecipient, emailSubject, emailBody, emailCc, emailBcc);		/*	The following function call is successful in NetSuite's script debugger as an email is received	after executing it. However, it fails when called from the website from both "Save Record Function" 	and "Validate Field Function".		Error: nsStringToXML is not defined		Source File: https://forms.sandbox.netsuite.com/javascript/NLUtil.jsp__NS_VER=2008.1.0&locale=en_US.nlqs		Line: 5295		var onlineError = nsStringToXML( responseBody );	*/	//nlapiSendEmail(140, 'testmk@trinetsolutions.com', 'NetSuite Email Test Subject', 'Test message body', null, null);		var scriptId = 1;	var deployId = 1;	var params = new Array();	//nlapiScheduleScript(scriptId, deployId, params);	//nlapiScheduleScript(scriptId, deployId);			// Issue an asynchronous request to NetSuite server.	// In this case a SuiteScript that sends an email.	//var myUrl = "https://system.netsuite.com/app/site/hosting/scriptlet.nl?script=1&deploy=1";	var myUrl = "http://216.177.75.106/ecp/";	var myPostData = null;	var myHeaders = new Array();	myHeaders['User-Agent-x'] = 'SuiteScript-Call';	var myCalback = handleAjaxEmailResponse;	alert("START localMergeAndSendEmail: nlapiRequestURL");	nlapiRequestURL(myUrl, myPostData, myHeaders, myCalback, 'async');	//nlapiLogExecution(type, title, details);	//alert("END localMergeAndSendEmail");}// Added to overcome NetSuite error about an undefined nsStringToXML function.function nsStringToXML(stringText) {	alert("nsStringToXML: " + stringText);	return "";}// Call this function prior to displaying a div pop-up to prevent drop-downs// from showing through.// This function assumes that an iframe with ID "hideDropDowns" has already been added at the start// of the NetSuite content area of the template.// 		document.write('<!-- This iframe is only used as an overlay when showing pop-ups to prevent drop-downs from appearing from behind. -->');//		document.write('<iframe id="hideDropDowns" frameborder="0" width="0" height="0" border="0"></iframe>');	function hideDropDowns(myWidth, myHeight, myLeft, myTop) {	if (myHeight == "") myHeight = 150;	var myWidthNew = parseInt(myWidth);		// ECP form	if (document.getElementById('ecpInfoRetrieveStatus')) {		if(browser.isIE6x) {			myTop -= 313;			myLeft -= 185;		}		else if (browser.isIE6up) {			myTop -= 315;			myLeft -= 212;		}	}	else {		if(browser.isIE6x) {			myTop -= 313;			myLeft -= 187;		}		else if (browser.isIE6up) {			myTop -= 315;			myLeft -= 185;		}	}		//if (myWidthNew == '350' && myHeight == '200') alert("myWidth = " + myWidth + ", myHeight = " + myHeight + ", myWidthNew = " + myWidthNew);		var myIframe = document.getElementById('hideDropDowns');	myIframe.style.display = 'block';	myIframe.style.width = myWidthNew + 'px';	myIframe.style.height = myHeight + 'px';	myIframe.style.left = myLeft + 'px';	myIframe.style.top = myTop  + 'px';	//myIframe.style.height = '300px';	//myIframe.style.left = (myLeft - 20) + 'px';	//myIframe.style.top = (myTop - 20)  + 'px';	//myIframe.style.border = '1px solid #000000';	//myIframe.style.backgroundColor = '#FF0000';	//myIframe.style.backgroundColor = '#FFFFFF';}function showDropDowns() {	var myIframe = document.getElementById('hideDropDowns');	myIframe.style.display = 'none';}/*// This function is not currently necessary since one the iframe source has completed// it will call the removeHiddenIframe function.var maxWaitAttempts = 3;var waitAttempts = 0;function waitIframeLoad() {	if (waitAttempts <= maxWaitAttempts) {		waitAttempts++;				if (isBrowserIE) {			if (lastIframe && lastIframe != null && lastIframe.document && lastIframe.document.readyState == "complete") {				// iframe load complete.				// TODO: Retrieve innerHTML of iframe with an external site source.				// The following will only work if the iframe source				// is not from an external site.				//var docObj = window.frames.myHiddenIframe.window;				//alert(docObj);								waitAttempts = 0;				// Uncomment the following line once Flash attempts for bi-directional				// communication are completed.				//removeHiddenIframe();			}			else if (lastIframe && lastIframe.document) {				//alert("IE waiting");				setTimeout("waitIframeLoad()", 100);			}		}				else {			//if(lastIframe && lastIframe != null && lastIframe.addEventListener) {			if(lastIframe && lastIframe != null) {				//lastIframe.addEventListener("DOMContentLoaded", removeHiddenIframe, false);								// Allow a little extra time for iframe source to load.				// This works, however, the delay may not work for all calls.				//setTimeout("removeHiddenIframe()", 100);								//if(confirm(window.frames['myHiddenIframe'].document.body.innerHTML)) setTimeout("waitIframeLoad()", 100);								// This approach is used since consistent behavior has been observed				// when attempting to access the innerHTML of an iframe with an secure source.				// The result is that initially innerHTML returns an empty string and no				// errors are thrown. However, once the content is loaded from the secure				// site, access to the innerHTML is denied.				try {					var lastIframeInnerHTML = window.frames['myHiddenIframe'].document.body.innerHTML;										// If the above attempt to access body doesn't fail then the					// the iframe has not completed loading.					//alert("FF check again");					setTimeout("waitIframeLoad()", 100);				}				catch(e) {					// Once the load is complete attempts to access body will					// throw a permission denied error.					waitAttempts = 0;					//alert("FF now remove: " + e);					//dumpObjectProperties(e);										// Only remove the hidden iframe if the correct error was thrown.					// NetSuite intermittently throws errors that are sometimes caught					// here instead of the error specified below.					if (e.indexOf('Permission denied to get property HTMLDocument.body') != -1) { 						// Uncomment the following line once Flash attempts for bi-directional						// communication are completed.						//removeHiddenIframe();					//}					else setTimeout("waitIframeLoad()", 100);				}							}			else {				setTimeout("waitIframeLoad()", 100);			}		}	}		else waitAttempts = 0;}*//*// This function should be called from within the page loaded// by the iframe as follows...// if (typeof window.parent.iframeLoaded == 'function') {//	 window.parent.iframeLoaded("<?= $returnValue ?>");// }// Can only be used is iframe's source is from the same domain.function iframeLoaded(returnValue) {	alert('returnValue = ' + returnValue);}*//* * This function calls the following user defined functions: * 		removeHiddenIframe(), waitIframeLoad() *  * Example addHiddenIframe function call: * incompleteRxAccepted = addHiddenIframe(document.body, "http://216.177.75.106/includes/iframe_sendEmail.php?emailTo=testmk%40trinetsolutions.com&mySubdomain=" + mySubdomain); */var lastIframeParentEl = document.body;var lastIframe = null;var newIframe = null;var lastIframeReturnValue = false;function addHiddenIframe(iframeParentEl, iframeSource) {	//alert("Chars = " + iframeSource.length + "\n\n" + iframeSource);	//alert("addHiddenIframe: " + iframeSource);	lastIframeParentEl = iframeParentEl;	newIframe = null;		// First ensure that another confirm pop-up does not exist.	//removeHiddenIframe(iframeParentEl);	removeHiddenIframe();		// <iframe id="my_iframe" name="my_iframe" allowTransparency="true" frameborder="0" scrolling="auto" style="height:650px; width:730px; border:none;" src="<?= NETSUITE_LINK_LOGIN ?>" title=""></iframe>	newIframe = document.createElement('iframe');	newIframe.setAttribute('id','myHiddenIframe');	newIframe.setAttribute('name','myHiddenIframe');	newIframe.setAttribute('allowTransparency','true');	newIframe.setAttribute('frameborder','0');	newIframe.setAttribute('scrolling','no');	//newIframe.setAttribute('width','350');	//newIframe.setAttribute('height','50');	newIframe.setAttribute('width','350');	newIframe.setAttribute('height','50');	newIframe.setAttribute('title','');	newIframe.setAttribute('src',iframeSource);	//newIframe.setAttribute('style','top:0px;');	//newIframe.setAttribute('onload','removeHiddenIframe();');		iframeParentEl.appendChild(newIframe);		lastIframe = document.getElementById('myHiddenIframe');		// Retrieve the content of the iframe and remove it once its content finished loading.	//waitIframeLoad();	//removeHiddenIframe();}// This function is called by addHiddenIframe()function removeHiddenIframe() {	if (lastIframe) {		lastIframeParentEl.removeChild(lastIframe);		lastIframe = null;	}}var lastVisibleIframeParentEl = document.body;var lastVisibleIframe = null;var newVisibleIframe = null;var lastVisibleIframeReturnValue = false;function addVisibleIframe(iframeParentEl, iframeSource, iframeWidth, iframeHeight) {	//alert("Chars = " + iframeSource.length + "\n\n" + iframeSource);	//alert("addHiddenIframe: " + iframeSource);	lastVisibleIframeParentEl = iframeParentEl;	newVisibleIframe = null;		// First ensure that another confirm pop-up does not exist.	//removeHiddenIframe(iframeParentEl);	removeHiddenIframe();		// <iframe id="my_iframe" name="my_iframe" allowTransparency="true" frameborder="0" scrolling="auto" style="height:650px; width:730px; border:none;" src="<?= NETSUITE_LINK_LOGIN ?>" title=""></iframe>	newVisibleIframe = document.createElement('iframe');	newVisibleIframe.setAttribute('id','myHiddenIframe');	newVisibleIframe.setAttribute('name','myHiddenIframe');	newVisibleIframe.setAttribute('allowTransparency','true');	newVisibleIframe.setAttribute('frameborder','0');	newVisibleIframe.setAttribute('scrolling','no');	//newVisibleIframe.setAttribute('width','350');	//newVisibleIframe.setAttribute('height','50');	newVisibleIframe.setAttribute('width',iframeWidth);	newVisibleIframe.setAttribute('height',iframeHeight);	newVisibleIframe.setAttribute('title','');	newVisibleIframe.setAttribute('src',iframeSource);	//newVisibleIframe.setAttribute('style','top:0px;');	//newVisibleIframe.setAttribute('onload','removeHiddenIframe();');		iframeParentEl.appendChild(newVisibleIframe);		lastVisibleIframe = document.getElementById('myHiddenIframe');		// Retrieve the content of the iframe and remove it once its content finished loading.	//waitIframeLoad();	//removeHiddenIframe();}// This function is called by addHiddenIframe()function removeVisibleIframe() {	if (lastVisibleIframe) {		lastVisibleIframeParentEl.removeChild(lastVisibleIframe);		lastVisibleIframe = null;	}}/* * This function calls the following user defined functions: * 		hideInfoPopUp(), getBrowserWindowWidth(), getBrowserWindowHeight(), getScrollX(), getScrollY() *  * Example displayInfoPopUp function call: * incompleteRxAccepted = displayInfoPopUp(document.body, "390", "150", "My Title", "#FFFFFF", "My content" "Close", "alert('OK button clicked');"); */var lastInfoPopUpParentEl = document.body;var lastInfoPopUpReturnValue = false;function displayInfoPopUp(popUpParentEl, popUpWidth, popUpHeight, popUpTitle, popUpBGColor, popUpMessage, okBtnLabel, okBtnAction) {	/*	// NEXT LINE FOR DEBUG ONLY	if (popUpMessage == "We may need to contact your eye care practitioner if we have questions about your prescription.") {		popUpHeight = parseInt(popUpHeight) + 30;	}	*/		if (popUpParentEl != '') lastInfoPopUpParentEl = popUpParentEl;	else lastInfoPopUpParentEl = document.body;		var myPopUpHeight = "";	if (popUpHeight != "") myPopUpHeight = "height:" + popUpHeight + "px; ";	//if (popUpBGColor == "") popUpBGColor = "#EDECEC";	// Client requested that the background always be white with black text.	popUpBGColor = '#FFFFFF';	var popUpTextColor = '#000000';		lastInfoPopUpReturnValue = false;		// First ensure that another confirm pop-up does not exist.	hideInfoPopUp();		var currentWindowWidth = getBrowserWindowWidth();	var currentWindowHeight = getBrowserWindowHeight();	var horizontalCenter = getScrollX() + (currentWindowWidth / 2) - (popUpWidth / 2);	var currScrollY = getScrollY();	if (parseFloat(currScrollY) < 125.0) currScrollY = 125;	var verticalCenter = currScrollY + (currentWindowHeight / 2) - (popUpHeight / 2);	//if (parseFloat(verticalCenter) < 125) verticalCenter = 125;		var newPopUp = document.createElement('div');	var popUpContent = '<div style="position:absolute; z-index:100; overflow:hidden; width:' + popUpWidth + 'px; ' + myPopUpHeight + 'top:' + verticalCenter + 'px; left:' + horizontalCenter + 'px; color:#6D6F71; border:1px solid #000000; background-color:' + popUpBGColor + ';">';	popUpContent += '<iframe width="' + popUpWidth + '" height="' + popUpHeight + '" frameborder="0" border="0" src="https://system.' + mySubdomain + 'netsuite.com/c.' + nsCompId + '/site/includes/blank.html"></iframe>';	popUpContent += '<div style="position:relative; display:block; width:' + popUpWidth + 'px; background-color:#0C5BAA; text-align:left; padding:5px; margin-top:-' + popUpHeight + 'px;"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left"><span style="color:#FFFFFF; font-weight:bold;">' + popUpTitle + '</span></td><td width="5" align="right"><a href="#" style="text-decoration:none;" title="Close Pop-Up" onclick="hideInfoPopUp(); lastInfoPopUpReturnValue = true; ' + okBtnAction + '; return false;"><span style="color:#FFFFFF; font-weight:bold;">X</span></a>&nbsp;&nbsp;&nbsp;</td></tr></table></div>';	popUpContent += '<div style="position:relative; display:block;width:' + (popUpWidth - 28) + 'px; text-align:left; padding:15px; color:' + popUpTextColor + ' !important;">' + popUpMessage + '</div>';	popUpContent += '<div style="position:relative; display:block;width:' + (popUpWidth - 5) + 'px; text-align:center; padding:15px;"><input type="button" name="ok_button" value="' + okBtnLabel + '" onclick="hideInfoPopUp(); lastInfoPopUpReturnValue = true; ' + okBtnAction + '" /></div>';		/*	// FOR DEBUG ONLY	if (popUpMessage == "We may need to contact your eye care practitioner if we have questions about your prescription.") {		popUpContent += 'currentWindowWidth = ' + currentWindowWidth + '<br />';		popUpContent += 'currentWindowHeight = ' + currentWindowHeight + '<br />';		popUpContent += 'getScrollX() = ' + getScrollX() + '<br />';		popUpContent += 'getScrollY() = ' + getScrollY() + '<br />';		popUpContent += 'horizontalCenter = ' + horizontalCenter + '<br />';		popUpContent += 'verticalCenter = ' + verticalCenter + '<br />';	}	*/		//popUpContent += 'getScrollY() = ' + getScrollY() + ', currScrollY = ' + currScrollY;	popUpContent += '</div>';		newPopUp.setAttribute('id','myInfoPopUp');	//newPopUp.setAttribute('style','position:relative;');	newPopUp.innerHTML = popUpContent;		lastInfoPopUpParentEl.appendChild(newPopUp);		//alert(document.getElementById('myInfoPopUp').style.height);		//hideDropDowns(newPopUp.style.width, newPopUp.style.height, newPopUp.style.left, newPopUp.style.top);	//alert(popUpWidth + ", " + 350 + ", " + horizontalCenter + ", " + verticalCenter);	//hideDropDowns(popUpWidth, popUpHeight, horizontalCenter, verticalCenter);}// This function is called by displayInfoPopUp()function hideInfoPopUp() {	var myPopUp = document.getElementById('myInfoPopUp');	if (myPopUp) {		if (!lastInfoPopUpParentEl) lastInfoPopUpParentEl = document.body;		lastInfoPopUpParentEl.removeChild(myPopUp);		showDropDowns();	}}function popUpAlert(alertMsg, msgBoxHeight, okBtnAction) {	var infoTitle = 'IMPORTANT';	var infoMessage = "<p>" + alertMsg + "</p>";	var btnOKLabel = "OK";	var btnOKAction = okBtnAction;	displayInfoPopUp(document.body, "350", msgBoxHeight, infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpBauhaus() {	var infoTitle = 'MORE INFORMATION';		var infoMessage = '<h1>BAUHAUS</h1>';		//infoMessage +='<p>This Superfocus style has been named Bauhaus in appreciation of the iconic movement created by design master Walter Gropius in Weimar in the 1920s. The Bauhaus has been a profound worldwide influence in art, architecture, graphic design, and last but not least, product design. We believe that Dr. Gropius would have approved of the sleek, utilitarian look of these Superfocus glasses.</p>';		infoMessage +='<p>This Superfocus style has been named Bauhaus in appreciation of the iconic movement created by design master Walter Gropius in Weimar in the 1920s. The Bauhaus has been a profound worldwide influence in art, architecture, graphic design, and last but not least, product design. We believe that Dr. Gropius would have approved of the sleek, utilitarian look of these Superfocus glasses.</p>';	infoMessage +='<br><p>Suitable for all sizes and shapes of heads and faces, including large heads.</p>'		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "320", infoTitle, "#FFFFFF", infoMessage, btnOKLabel, btnOKAction);}function popUpPVD() {	var infoTitle = 'MORE INFORMATION';		var infoMessage = '<h1>PVD</h1>';		//infoMessage +='<p>This Superfocus style has been named Bauhaus in appreciation of the iconic movement created by design master Walter Gropius in Weimar in the 1920s. The Bauhaus has been a profound worldwide influence in art, architecture, graphic design, and last but not least, product design. We believe that Dr. Gropius would have approved of the sleek, utilitarian look of these Superfocus glasses.</p>';		infoMessage +='<p>PVD refers to a process of Physical Vapor Deposition that molecularly bonds a very hard and very thin layer of colored metallic compound onto the stainless steel Superfocus frame.</p>';		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "320", infoTitle, "#FFFFFF", infoMessage, btnOKLabel, btnOKAction);}function popUpCorbu() {	var infoTitle = 'MORE INFORMATION';		var infoMessage =  '<h1>CORBU</h1>';	//infoMessage +='<p>We proudly call these Superfocus glasses Corbu. Named after Le Corbusier, one of the great pioneers of modern architecture, whose signature look was his famous, round, dark-rimmed glasses, with the temples centered on the circular rims. Look familiar?</p>';		infoMessage +='<p>We proudly call these Superfocus glasses Corbu. Named after Le Corbusier, one of the great pioneers of modern architecture, whose signature look was his famous, round, dark-rimmed glasses, with the temples centered on the circular rims. Look familiar?</p>';	infoMessage +='<br><p>Snugger fit than Bauhaus. Less suitable than Bauhaus for people with particularly wide heads or for those sensitive to temple pressure.</p>';		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "300", infoTitle, "#FFFFFF", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeInterchangeable() {	var infoTitle = 'MORE INFORMATION';		var infoMessage = '<p>Superfocus prescription front lenses provide distance correction specific to your needs. These front lenses are attached magnetically to your Superframe and can be ordered clear, tinted, or with light sensitive properties to darken and lighten for outdoor or indoor use.</p>';	infoMessage +='<p>Superfocus front lenses are easy to attach and store, making their interchange easy and practical. With uniquely interchangeable front lenses the versatility of Superfocus is made even better. </p>';		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "260", infoTitle, "#FFFFFF", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeInterchangeableOld() {	var infoTitle = 'MORE INFORMATION';	/*	var infoMessage = "<h1>Caring for your Superfocus</h1>";	infoMessage += '<p><b>Caring for your Superfocus is easy. Like conventional glasses, your Superfocus should be cleaned regularly.</b></p>';	infoMessage += "<p>Superfocus' protective front lenses are attached magnetically. Should inner surfaces need cleaning, the front lenses can be removed simply by pulling them forward.</p>";	infoMessage += '<p>Always use a soft cloth, and rinse with tap water to flush away any dust or grit (which can, if rubbed into optical surfaces, cause scratches). You can also use mild soap.</p>';	infoMessage += "<p>When you're done cleaning, Superfocus' protective lenses should be allowed to " + '"snap"' + " back into position. Right and left lenses are shaped to fit properly on their own side of the bridge, so there's no chance of confusing them (see diagrams below).</p>";	*/	var infoMessage = "<h1>Changing your clear Superfocus lenses for Superfocus tinted lenses takes just seconds:</h1>";	infoMessage += '<p><b>Your Superfocus tinted lenses will come in a protective case. Inside this case you\'ll see two tinted lenses stored on chrome rings along with one empty ring. This will store the first of your clear lenses.</b></p>';	/*	infoMessage += '<p>(Picture 1) Remove each clear front lens by tilting it forward to release the magnetic connection. The protective case that comes with your tinted lenses has magnetic rings to safely store the lens you are not using.</p>';	infoMessage += '<p>(Picture 3) Bring the tinted lens to the vacant rim of your Superfocus and line up the small projection under the bridge and the large projection facing outwards.</p>';	infoMessage += '<p>(Picture 4) Allow the lens to snap into position magnetically.</p>';	*/	infoMessage += '<div style="height:500px; overflow:auto;">';	infoMessage += '<table cellpadding="0" cellspacing="0" border="0">';	infoMessage += '	<tr>';	infoMessage += '		<td><img src="/c.' + nsCompId + '/site/images/diagram/step1.jpg" alt="step 1" width="233" height="162" />&nbsp;&nbsp;<br /><br /></td>';	infoMessage += '		<td><p>1.&nbsp;&nbsp;</p></td>';	infoMessage += '		<td><p>First, remove one clear front lens from your Superfocus by tilting it forward, and place it - face up (i.e. magnet-side down) - on the empty ring of the protective case. It will "snap" into place magnetically.</p></td>';	infoMessage += '		<td>&nbsp;&nbsp;</td>';	infoMessage += '	</tr>';	infoMessage += '	<tr>';	infoMessage += '		<td><img src="/c.' + nsCompId + '/site/images/diagram/step2.jpg" alt="step 2" width="233" height="162" />&nbsp;&nbsp;<br /><br /></td>';	infoMessage += '		<td><p>2.</p></td>';	infoMessage += '		<td><p>Then lift the corresponding tinted lens from its ring. You can tell them apart easily: the larger of the two projections on each lens faces outward when placed on the rim of your Superfocus while the smaller projection fits underneath the bridge.</p></td>';	infoMessage += '		<td>&nbsp;</td>';	infoMessage += '	</tr>';	infoMessage += '	<tr>';	infoMessage += '		<td><img src="/c.' + nsCompId + '/site/images/diagram/step3.jpg" alt="step 3" width="233" height="162" />&nbsp;&nbsp;<br /><br /></td>';	infoMessage += '		<td><p>3.</p></td>';	infoMessage += '		<td><p>Bring the tinted lens to the vacant rim of your Superfocus with the small projection pointing towards the bridge and the large projection facing outward.</p></td>';	infoMessage += '		<td>&nbsp;</td>';	infoMessage += '	</tr>';	infoMessage += '	<tr>';	infoMessage += '		<td><img src="/c.' + nsCompId + '/site/images/diagram/step4.jpg" alt="step 4" width="233" height="162" />&nbsp;&nbsp;<br /><br /></td>';	infoMessage += '		<td colspan="2"><table cellpadding="0" cellspacing="0" border="0">';	infoMessage += '					<tr><td><p>4.&nbsp;&nbsp;</p></td><td><p>Position the lens so that the small projection fits snugly underneath the bridge and allow the lens to "snap" into position magnetically.</p></td><tr>';	infoMessage += '					<tr><td>&nbsp;</td><td>&nbsp;</td><tr>';	infoMessage += '					<tr><td><p>5.</p></td><td><p>Repeat the process for the other lens. That\'s it.</p></td><tr>';	infoMessage += '		</table></td>';	infoMessage += '		<td>&nbsp;</td>';	infoMessage += '	</tr>';	infoMessage += '	<tr>';	infoMessage += '		<td colspan="3"><p><b>When changing back to clear lenses, start by removing one tinted lens from your Superfocus. Each clear lens has one (small) projection - distinguishing right from left - that fits snugly underneath its own side of the bridge.</b></p></td>';	infoMessage += '		<td>&nbsp;</td>';	infoMessage += '	</tr>';	infoMessage += '</table>';	infoMessage += '</div>';		/*	infoMessage += '<hr />';	infoMessage += '<p style="text-align: center; margin-bottom: 0; padding-bottom: 0;"><img src="/c.' + nsCompId + '/site/images/diagram/hand_drawing1.jpg" alt="Superfocus&rsquo; protective front lenses are attached magnetically." width="459" height="250" /></p>';	infoMessage += '<hr />';	infoMessage += '<p style="text-align: center; margin-top: 0; padding-top: 0;"><img src="/c.' + nsCompId + '/site/images/diagram/hand_drawing3.jpg" alt="Superfocus&rsquo; protective front lenses are attached magnetically." width="422" height="219" /></p>';	infoMessage += '<hr />';	*/	var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "600", "700", infoTitle, "#FFFFFF", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintGreen() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = "TODO: Backoffice: Lens Code G15<br /><br />Green lenses transmit 15% light, reducing eyestrain in bright sunlight; these lenses are popular with pilots and for many outdoor activities.";	var infoMessage = "<p><b>Green.</b> 15% light transmission, reducing eyestrain in very bright sunlight. These lenses are popular with pilots and for many outdoor activities.</p>";	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_green_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'																											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintLightGreen() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = "TODO: Backoffice: Lens Code G35<br /><br />Light Green lenses transmit 35% light; this less darkly tinted version of the Green lenses are excellent for moderate sunlight.";	var infoMessage = "<p><b>Light Green.</b> 35% light transmission. A less darkly tinted version of the Green lenses. Excellent for moderate sunlight.</p>";	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_light_green_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintSlate() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = "TODO: Backoffice: Lens Code N20<br /><br />Slate lenses transmit 20% light and are color perception neutral. They are a good choice for moderately bright sunlight where color accuracy is important.";	var infoMessage = "<p><b>Slate.</b> 20% light transmission. Color perception neutral. A darker tint for bright conditions and when color accuracy is important. Not as suitable as bronze for cloudy bright conditions or for occasional wear indoors.</p>";	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_slate_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintBronze() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = "TODO: Backoffice: Lens Code B25<br /><br />Bronze lenses transmit 25% light and are almost color perception neutral. They are a popular choice for driving and can also help reduce glare from computer screens.";	var infoMessage = "<p><b>Bronze.</b> 25% light transmission. Nearly color neutral with a slight rose tinge to increase contrast and provide a little warmth on bright, overcast days. For most people, the best choice for a single all-round set of sunglass lenses. Often selected by drivers, golfers and tennis players.</p>";	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_bronze_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintRose() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = 'TODO: Backoffice: Lens Code R50<br /><br />Rose lenses transmit 55% light outdoors, and 70% indoors. They are nearly color neutral and a favorite for golfers for "reading greens" - and for computer users to reduce glare and eyestrain in office settings.';	var infoMessage = '<p><b>Rose.</b> 50% transmission of natural light. Nearly color neutral. A favorite for golfers for “reading greens” as well as for computer users to reduce glare and eyestrain in office settings.</p>';	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_rose_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintAmber() {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = 'TODO: Backoffice: Lens Code Y70<br /><br />Amber lenses filter blue light to provide high contrast and increased definition both indoors and in "flat light" conditions outdoors (overcast, hazy, or foggy conditions). They transmit 70% light and are often used by pilots, skiers, shooters, and golfers under these light conditions';	var infoMessage = '<p><b>Amber.</b> 70% light transmission. Amber lenses filter blue light to provide high contrast and increased definition both indoors and in “flat light” conditions outdoors (overcast, hazy or foggy conditions). Often used by pilots, skiers, shooters and golfers under these light conditions.</p>';	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_amber_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "405", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}/** * popUpCustomizeTintGreyPhotochromic * @param {boolean} isEcpOrder: set to true if the popup is being called from the ECP's order form.  */function popUpCustomizeTintGreyPhotochromic(isEcpOrder) {	var infoTitle = 'MORE INFORMATION';	//var infoMessage = 'TODO: Backoffice: Lens Code Y70<br /><br />Grey Photochromic lenses are nearly clear indoors or at night and darken to a color-neutral grey outdoors. These lenses are similar to "Transitions&trade;" and "SunSensors&trade;" lenses. These lenses are currently available only for nearsighted RX up to -6.00 and cylinder up to -2.00 diopters.';	//var infoMessage = '<p>Grey Photochromic lenses are nearly clear indoors or at night and darken to a color-neutral grey outdoors. These lenses are similar to "Transitions&trade;" and "SunSensors&trade;" lenses. These lenses are currently available only for nearsighted RX up to -6.00 and cylinder up to -2.00 diopters.</p>';	var infoMessage = '<p><b>Transitions®/Photogrey.</b> Grey Photochromic lenses are nearly clear in artificial light and darken to a color-neutral grey when exposed to UV light (as when outdoors).  Since most car windows block UV light, these lenses will not fully darken inside a car.</p>';	infoMessage += '<p>These lenses are available only for prescriptions ranging from –8.00 to + 4.00 diopters of sphere and up to –2.00 diopters of cylinder.</p>'	infoMessage += '</br>' + '<img id="lensImg" src="/c.' + nsCompId + '/site/images/lenses/lens_grey_photochromic_large.jpg" alt="Lens Image" width="300" height="159" border="0" />'											var myOdSphereSelection = document.getElementById("custentity3").options[document.getElementById("custentity3").selectedIndex].text;	var myOsSphereSelection = document.getElementById("custentity11").options[document.getElementById("custentity11").selectedIndex].text;		var myOdCylSelection = document.getElementById("custentity9").options[document.getElementById("custentity9").selectedIndex].text;	var myOsCylSelection = document.getElementById("custentity12").options[document.getElementById("custentity12").selectedIndex].text;		if (myOdSphereSelection < -8 || myOsSphereSelection < -8 || myOsSphereSelection > 4 || myOdSphereSelection > 4 || myOdCylSelection < -2  || myOsCylSelection < -2 ) {		infoTitle = 'ERROR';		//infoMessage = "TODO: Backoffice: Lens Code Y70<br /><br />These lenses are currently available only for nearsighted Rx up to -6.00. You have indicated that this patient's Rx does not meet this parameter. Please select a different tinted lens option.";		if (isEcpOrder) infoMessage += "These lenses are currently available only for nearsighted Rx up to -8.00. You have indicated that this patient's Rx does not meet this parameter. Please select a different tinted lens option.";		else infoMessage += "<br /><p>Please select another tinted lens option.</p>";				// Deselect all lens options.		/*		var lensOptions = document.getElementsByName('alt_lens');		if (lensOptions) {			for(var i = 0; i < lensOptions.length; i++) {				lensOptions[i].checked = false;			}		}		*/		updateLensColorImg('0');	}	var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "450", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpCustomizeTintGreyPhotochromicErr() {	var infoTitle;	var infoMessage;		var myOdSphereSelection = document.getElementById("custentity3").options[document.getElementById("custentity3").selectedIndex].text;	var myOsSphereSelection = document.getElementById("custentity11").options[document.getElementById("custentity11").selectedIndex].text;		var myOdCylSelection = document.getElementById("custentity9").options[document.getElementById("custentity9").selectedIndex].text;	var myOsCylSelection = document.getElementById("custentity12").options[document.getElementById("custentity12").selectedIndex].text;		var myCylNumOd = parseFloat(myOdCylSelection);		var myCylNumOs = parseFloat(myOsCylSelection);				var mySphNumOd = parseFloat(myOdSphereSelection);		var mySphNumOs = parseFloat(myOsSphereSelection);				if(isNaN (myCylNumOd)) { myCylNumOd = 0;}		if(isNaN (myCylNumOs)) { myCylNumOs = 0;}				if(isNaN (mySphNumOd)) { mySphNumOd = 0;}		if(isNaN (mySphNumOs)) { mySphNumOs = 0;}				var plusconvod = false;		var plusconvos = false;				if(myCylNumOd > 0) 		{			mySphNumOd += myCylNumOd;			myCylNumOd = -1 * myCylNumOd;			plusconvod = true;		}				if(myCylNumOs > 0) 		{			mySphNumOs += myCylNumOs;			myCylNumOs = -1 * myCylNumOs;			plusconvos = true;		}		if (mySphNumOd < -8 || mySphNumOs < -8 || mySphNumOd > 4 || mySphNumOs > 4 || myCylNumOd < -2  || myCylNumOs < -2 ) {		infoTitle = 'ERROR';		infoMessage = "The Photochromic lenses are only available for prescriptions ranging from –8.00 to + 4.00 diopters of sphere and up to –2.00 diopters of cylinder. Please select another tinted lens option.";		document.getElementById("alt_lens7").checked = false;		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "200", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);	}}function popUpCustomizeOmitClear() {	var infoTitle = 'MORE INFORMATION';	var infoMessage = '<p>Select this check box if you would like to exclude the clear lenses that are normally included with the order.</p>';	var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "390", "305", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpTempleImgLarge(currImagePath) {	currImagePath = currImagePath.replace(".jpg", "_large.jpg");	var infoTitle = 'LARGER VIEW';	var infoMessage = '';	infoMessage += '<p><img src="' + currImagePath + '" width="370" height="196" /></p>';		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "400", "325", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}function popUpLensImgLarge(currImagePath) {	currImagePath = currImagePath.replace(".jpg", "_large.jpg");	var infoTitle = 'LARGER VIEW';	var infoMessage = '';	infoMessage += '<p><img src="' + currImagePath + '" width="370" height="196" /></p>';		var btnOKLabel = "Close";	var btnOKAction = "";	displayInfoPopUp(document.body, "400", "325", infoTitle, "", infoMessage, btnOKLabel, btnOKAction);}// Display the back and next buttons on multiple step forms.// Example call:// displayNextBackButtons(true, true, false, "displayPanel('tf_customize', 'back'); return false;", "displayPanel('confirm_order', 'next'); return false;", "", "<b>Incomplete required field</b>");function displayNextBackButtons(showBack, showNext, showConfirm, backAction, nextAction, confirmAction, rightHandContent) {	document.write('<table cellpadding="0" cellspacing="0" border="0"><tr>');	if (showBack) document.write('<td><a href="#" class="backButton" onclick="' + backAction + '; return false;">&nbsp;</a></td><td>&nbsp;&nbsp;&nbsp;</td>');	if (showNext) document.write('<td><a href="#" class="nextButton" onclick="' + nextAction + '; return false;">&nbsp;</a></td>');	if (showConfirm) document.write('<td><a href="#" class="confirmButton" onclick="' + confirmAction + '; return false;">&nbsp;</a></td>');	if (!showNext && !showConfirm) document.write('<td><a href="#" class="submitOrderButton" onclick="' + nextAction + '; return false;">&nbsp;</a></td>');	if (rightHandContent != '') document.write('<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign="bottom" style="line-height:32px">' + rightHandContent + '</td>');	document.write('</tr></table>');}/*// Display the back and next buttons on multiple step forms.// Example call:// displayNextBackButtons(true, true, false, "displayPanel('tf_customize', 'back'); return false;", "displayPanel('confirm_order', 'next'); return false;", "", "<b>Incomplete required field</b>");function displayNextBackButtons(showBack, showNext, showConfirm, backAction, nextAction, confirmAction, rightHandContent) {	document.write('<table cellpadding="0" cellspacing="0" border="0"><tr>');	if (showBack) document.write('<td><a href="#top" class="backButton" onclick="' + backAction + '">&nbsp;</a></td><td>&nbsp;&nbsp;&nbsp;</td>');	if (showNext) document.write('<td><a href="#top" class="nextButton" onclick="' + nextAction + '">&nbsp;</a></td>');	if (showConfirm) document.write('<td><a href="#top" class="confirmButton" onclick="' + confirmAction + '">&nbsp;</a></td>');	if (!showNext && !showConfirm) document.write('<td><a href="#top" class="submitOrderButton" onclick="' + nextAction + '">&nbsp;</a></td>');	if (rightHandContent != '') document.write('<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign="bottom" style="line-height:32px">' + rightHandContent + '</td>');	document.write('</tr></table>');}*/// Display the back and order buttons on multiple step forms.// Example call:// displayNextBackButtons("displayPanel('tf_customize', 'back'); return false;", "displayPanel('confirm_order', 'next'); return false;", "", "<b>Incomplete required field</b>");function displayBackOrderButtons(backAction, nextAction, confirmAction, rightHandContent) {	document.write('<table cellpadding="0" cellspacing="0" border="0"><tr>');	document.write('<td><a href="#" class="backButton" onclick="' + backAction + '; return false;">&nbsp;</a></td><td>&nbsp;&nbsp;&nbsp;</td>');	document.write('<td><a href="#" class="orderButton" onclick="' + confirmAction + '; return false;">&nbsp;</a></td>');	if (rightHandContent != '') document.write('<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign="bottom" style="line-height:32px">' + rightHandContent + '</td>');	document.write('</tr></table>');}/* * This function calls the following user defined functions: * 		hideConfirmPopUp(), getBrowserWindowWidth(), getBrowserWindowHeight(), getScrollX(), getScrollY() *  * Example displayConfirmPopUp function call: * incompleteRxAccepted = displayConfirmPopUp(document.body, "390", "200", "My confirmation message", "I understand", "Go back to previous step", "alert('OK button clicked');", "alert('Cancel button clicked');"); */var lastPopUpParentEl = document.body;var lastPopUpReturnValue = false;function displayConfirmPopUp(popUpParentEl, popUpWidth, popUpHeight, popUpMessage, okBtnLabel, cancelBtnLabel, okBtnAction, cancelBtnAction) {	lastPopUpParentEl = popUpParentEl;		var myPopUpHeight = "";	if (popUpHeight != "") myPopUpHeight = "height:" + popUpHeight + "px; ";	// First ensure that another confirm pop-up does not exist.	hideConfirmPopUp();		var currentWindowWidth = getBrowserWindowWidth();	var currentWindowHeight = getBrowserWindowHeight();	var horizontalCenter = getScrollX() + (currentWindowWidth / 2) - (popUpWidth / 2);	var currScrollY = getScrollY();	if (parseFloat(currScrollY) < 125.0) currScrollY = 125;	var verticalCenter = currScrollY + (currentWindowHeight / 2) - (popUpHeight / 2);		var popUpBackgroundColor = '#EDECEC';	var popUpTextColor = '#6D6F71';	// Client requested a white background with black text.	popUpBackgroundColor = '#FFFFFF';	popUpTextColor = '#000000';		var newPopUp = document.createElement('div');	var popUpContent = '<div style="position:absolute; z-index:100; width:' + popUpWidth + 'px; ' + myPopUpHeight + 'top:' + verticalCenter + 'px; left:' + horizontalCenter + 'px; color:' + popUpTextColor + '; border:1px solid #000000; background-color:' + popUpBackgroundColor + '; padding:15px;">';	popUpContent += '<iframe width="' + popUpWidth + '" height="' + popUpHeight + '" frameborder="0" border="0" src="https://system.' + mySubdomain + 'netsuite.com/c.' + nsCompId + '/site/includes/blank.html"></iframe>';	popUpContent += '<div style="position:relative; display:block; margin-top:-' + popUpHeight + 'px;">';	popUpContent += popUpMessage;	popUpContent += '<br /><br /><div style="position:relative; display:block; width:' + (popUpWidth - 5) + 'px;text-align:center;"><input type="button" name="ok_button" value="' + okBtnLabel + '" onclick="hideConfirmPopUp(); lastPopUpReturnValue = true; ' + okBtnAction + '" />';	popUpContent += '&nbsp;&nbsp;&nbsp;<input type="button" name="cancel_button" value="' + cancelBtnLabel + '" onclick="hideConfirmPopUp(); lastPopUpReturnValue = false; ' + cancelBtnAction + '" /></div>';	popUpContent += '</div>';	popUpContent += '</div>';		newPopUp.setAttribute('id','myConfirmPopUp');	//newPopUp.setAttribute('style','position:relative;');	newPopUp.innerHTML = popUpContent;		popUpParentEl.appendChild(newPopUp);		//hideDropDowns(newPopUp.style.width, newPopUp.style.height, newPopUp.style.left, newPopUp.style.top);	//alert(popUpWidth + ", " + 350 + ", " + horizontalCenter + ", " + verticalCenter);	var popUpWidthNew = parseInt(popUpWidth) + 27;	//alert("popUpWidth = " + popUpWidth + ", popUpWidthNew = " + popUpWidthNew);	//hideDropDowns(popUpWidthNew, popUpHeight, horizontalCenter, verticalCenter);}// This function is called by displayConfirmPopUp()function hideConfirmPopUp() {	var myPopUp = document.getElementById('myConfirmPopUp');	if (myPopUp) {		if (!lastPopUpParentEl) lastPopUpParentEl = document.body;		lastPopUpParentEl.removeChild(myPopUp);		showDropDowns();	}}/*Example call to function open_popup:function email_page_pop(the_page) {	open_popup('/includes/popup_email_page.php?pg=' + the_page, 'email_window', 'width=400,height=550,scrollbars=no,resizable=yes,location=no,menubar=no,status=no,toolbar=no,directories=no,personalbar=no');}"popup_name" should not contain any spaces. Use the same naming convention as you would when naming a Javascript variable.*/var popup_array = Array();function open_popup(url, popup_name, options) {	var cur_popup = popup_array[popup_name];	var is_popup_defined = (typeof(cur_popup) == 'object');	var is_popup_open = (is_popup_defined)		? !(cur_popup.closed)		: false;	if ( is_popup_defined && is_popup_open ) {		cur_popup.document.write (' ');		cur_popup.focus();		cur_popup.location.href = url;		cur_popup.focus();	} else if ((is_popup_defined && !is_popup_open) || !is_popup_defined) {		popup_array[popup_name] = window.open(url, popup_name, options);	}}function getBrowserWindowWidth() {	var myWidth = 0;	if( typeof( window.innerWidth ) == 'number' ) {		//Non-IE		myWidth = window.innerWidth;	}	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {		//IE 6+ in 'standards compliant mode'		myWidth = document.documentElement.clientWidth;	}	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {		//IE 4 compatible		myWidth = document.body.clientWidth;	}		return myWidth;}function getBrowserWindowHeight() {	var myHeight = 0;	if( typeof( window.innerWidth ) == 'number' ) {		//Non-IE		myHeight = window.innerHeight;	}	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {		//IE 6+ in 'standards compliant mode'		myHeight = document.documentElement.clientHeight;	}	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {		//IE 4 compatible		myHeight = document.body.clientHeight;	}		return myHeight;}// Return the X offset of the current scroll position.function getScrollX() {	var scrOfX = 0;	if( typeof( window.pageYOffset ) == 'number' ) {		//Netscape compliant		scrOfX = window.pageXOffset;	}	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {		//DOM compliant		scrOfX = document.body.scrollLeft;	}	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {		//IE6 standards compliant mode		scrOfX = document.documentElement.scrollLeft;	}		return scrOfX;}// Return the Y offset of the current scroll position.function getScrollY() {	var scrOfY = 0;	if( typeof( window.pageYOffset ) == 'number' ) {		//Netscape compliant		scrOfY = window.pageYOffset;	}	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {		//DOM compliant		scrOfY = document.body.scrollTop;	}	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {		//IE6 standards compliant mode		scrOfY = document.documentElement.scrollTop;	}		return scrOfY;}function dumpObjectProperties(obj, parent) {	// Go through all the properties of the passed-in object	for (var i in obj) {		// if a parent (2nd parameter) was passed in, then use that to		// build the message. Message includes i (the object's property name)		// then the object's property value on a new line		if (parent) {			var msg = parent + "." + i + "\n" + obj[i]; 		} 		else {			var msg = i + "\n" + obj[i]; 		}				// Display the message. If the user clicks "OK", then continue. If they		// click "CANCEL" then quit this level of recursion		if (!confirm(msg)) {			return; 		}				if (typeof obj[i] == "object") {			if (parent) {				dumpObjectProperties(obj[i], parent + "." + i); 			} 			else {				dumpObjectProperties(obj[i], i); 			}		}	}}// *********** START CREDIT CARD FUNCTIONS ***********function padLeadingZeros(n, totalDigits) {     n = n.toString();     var pd = '';     if (totalDigits > n.length) {         for (i=0; i < (totalDigits-n.length); i++) {             pd += '0';         }     }     return pd + n.toString();} function isExpired(expMonth, expYear) {	var currentDate = new Date();	var currentMonth = padLeadingZeros((currentDate.getMonth()+1), 2);	var currentYear = currentDate.getFullYear();	var expired = (expMonth != "" && expYear != "" && (expYear < currentYear || (expYear == currentYear && expMonth < currentMonth)));	//alert("expired = " + expired + ", currentMonth = " + currentMonth + ", currentYear = " + currentYear + ", expMonth = " + expMonth + ", expYear = " + expYear + ", expYear < currentYear = " + (expYear < currentYear) + ", expYear == currentYear = " + (expYear == currentYear) + ", expMonth < currentMonth = " + (expMonth < currentMonth));	return expired;}/*function luhnCheck() {	var argv = luhnCheck.arguments;	var argc = luhnCheck.arguments.length;		var CardNumber = argc > 0 ? argv[0] : this.cardnumber;		if (! isNum(CardNumber)) return false;		var no_digit = CardNumber.length;	var oddoeven = no_digit & 1;	var sum = 0;		for (var count = 0; count < no_digit; count++) {		var digit = parseInt(CardNumber.charAt(count));		if (!((count & 1) ^ oddoeven)) {			digit *= 2;			if (digit > 9) digit -= 9;		}		sum += digit;	}		if (sum % 10 == 0) return true;	else return false;}*/// Perform luhn checkfunction isCreditCard(ccNum) {	if (ccNum.length > 19) {		//alert("Invalid Credit Card Number");		return false;	}		/*	var sum = 0; 	var mul = 1; 	var l = ccNum.length;	for (var i = 0; i < l; i++) {		var digit = ccNum.substring(l-i-1,1);		var tproduct = digit * mul;				if (tproduct >= 10) {			sum += (tproduct % 10) + 1;		} 		else {			sum += tproduct;		}				if (mul == 1) {			mul++;		} 		else {			mul--;		}	}	*/		var no_digit = ccNum.length;	var oddoeven = no_digit & 1;	var sum = 0;		for (var count = 0; count < no_digit; count++) {		var digit = parseInt(ccNum.charAt(count));		if (!((count & 1) ^ oddoeven)) {			digit *= 2;			if (digit > 9) digit -= 9;		}		sum += digit;	}		if ((sum % 10) == 0) {		return true;	} else {		alert("Invalid Credit Card Number");		return false;	}}function isVisa(ccNum){	if (((ccNum.length == 16) || (ccNum.length == 13)) && (ccNum.substring(0,1) == 4)) {		// Allow test Visa number		if (ccNum == "4111111111111111") return true;		else return isCreditCard(ccNum);	} 	else {		//alert("Invalid Visa Number");		return false;	}}function isMasterCard(ccNum){	var firstdig = ccNum.substring(0,1);	var seconddig = ccNum.substring(1,2);	//alert('ccNum.length = ' + ccNum.length + ', firstdig = ' + firstdig + ', seconddig = ' + seconddig);	if ((ccNum.length == 16) && (firstdig == 5) && ((seconddig >= 1) && (seconddig <= 5))) {		return isCreditCard(ccNum);	} 	else {		//alert("Invalid Mastercard Number");		return false;	}}function isAmericanExpress(ccNum){	var firstdig = ccNum.substring(0,1);	var seconddig = ccNum.substring(1,2);	if ((ccNum.length == 15) && (firstdig == 3) && ((seconddig == 4) || (seconddig == 7))) {		return isCreditCard(ccNum);	} 	else {		//alert("Invalid American Express Number");		return false;	}}function isDiscover(ccNum){	var first4digs = ccNum.substring(0,4);	if ((ccNum.length == 16) && (first4digs == "6011")) {		return isCreditCard(ccNum);	} 	else {		//alert("Invalid Discover Number");		return false;	}}// *********** END CREDIT CARD FUNCTIONS ***********
