
var imgHomeOff = new Image();
	imgHomeOff.src = (strWebRoot + "img_v2/global/home.gif");
var imgHomeOn = new Image();
	imgHomeOn.src = (strWebRoot + "img_v2/global/home_f2.gif");

var imgEternityBandsOff = new Image();
	imgEternityBandsOff.src = (strWebRoot + "img_v2/global/eternity_bands.gif");
var imgEternityBandsOn = new Image();
	imgEternityBandsOn.src = (strWebRoot + "img_v2/global/eternity_bands_f2.gif");

var imgWeddingBandsOff = new Image();
	imgWeddingBandsOff.src = (strWebRoot + "img_v2/global/wedding_bands.gif");
var imgWeddingBandsOn = new Image();
	imgWeddingBandsOn.src = (strWebRoot + "img_v2/global/wedding_bands_f2.gif");

var imgMaternityRingsOff = new Image();
	imgMaternityRingsOff.src = (strWebRoot + "img_v2/global/maternity_rings.gif");
var imgMaternityRingsOn = new Image();
	imgMaternityRingsOn.src = (strWebRoot + "img_v2/global/maternity_rings_f2.gif");
	
var imgJewelryOff = new Image();
	imgJewelryOff.src = (strWebRoot + "img_v2/global/jewelry.gif");
var imgJewelryOn = new Image();
	imgJewelryOn.src = (strWebRoot + "img_v2/global/jewelry_f2.gif");
	
var imgSettingsOff = new Image();
	imgSettingsOff.src = (strWebRoot + "img_v2/global/settings.gif");
var imgSettingsOn = new Image();
	imgSettingsOn.src = (strWebRoot + "img_v2/global/settings_f2.gif");
	
var imgEngagementRingsOff = new Image();
	imgEngagementRingsOff.src = (strWebRoot + "img_v2/global/engagement_rings.gif");
var imgEngagementRingsOn = new Image();
	imgEngagementRingsOn.src = (strWebRoot + "img_v2/global/engagement_rings_f2.gif");

var imgSpecialRequestsOff = new Image();
	imgSpecialRequestsOff.src = (strWebRoot + "img_v2/global/special_requests.gif");
var imgSpecialRequestsOn = new Image();
	imgSpecialRequestsOn.src = (strWebRoot + "img_v2/global/special_requests_f2.gif");
	
	

	
// This can swap images either by name, of assuming that it was passed in by a link,
// then it can swap the image in the given link.
function SwapImages(){
	// Loop over images and swap them.
	for (var intI = 0 ; intI < arguments.length ; intI+=2){
	
		// Check to see if this is a link or an image name.
		if (typeof(arguments[intI]) == "object"){
				
			// We are dealing with a link object. Get the image.
			arguments[ intI ].childNodes[ 0 ].src = arguments[ intI + 1 ].src;
		
		} else {
			
			// We are dealing with an image by name.
			document.images[ arguments[intI] ].src = arguments[ intI + 1 ].src;
		}
		
	}
}





function Back(){
	if (window.history){
		window.history.go(-1);
	}
}


function StripNonNumeric(objInput){
	// Strip out non-numeric values (only positive values)
	objInput.value = objInput.value.replace(new RegExp("[^0-9.]{1,}", "gim"), "");
	
	if (objInput.value == "."){
		objInput.value = "";
	}
}


function StripNonInteger(objInput){
	// Strip out non-numeric values (only positive values)
	objInput.value = objInput.value.replace(new RegExp("[^0-9]{1,}", "gim"), "");
}


function StripNonZip(objInput){
	// Strip out non-numeric values (only positive values)
	objInput.value = objInput.value.replace(new RegExp("[^0-9\\-]{1,}", "gim"), "");
}


function PopCertificate(strName){
	var win = window.open("", strName, "width=640,height=480,status=yes,scrollbars=yes,resizable=yes");
}


function PopChart(strName){
	var win = window.open("", strName, "width=640,height=480,status=yes,scrollbars=yes,resizable=yes");
}


function PopEmail(strName){
	var win = window.open("", strName, "width=600,height=350,status=yes");
}


function PopXLargeImage(strItemID, strID){
	var win = window.open(
		(strWebRoot + "xlarge_image.cfm?item_id=" + strItemID + "&item_image_id=" + strID), 
		"", 
		"width=530,height=500,status=yes"
		//"width=675,height=615,status=yes"
		);
}


function PopCreditCardForm(strName){
	var win = window.open("", strName, "width=600,height=350,status=yes,scrollbars=yes,resizable=yes,menubar=yes");
}


function GetFCFRSCost(strMetal, strWidth, intSize){
	var Gold = new Array();
	var Platinum = new Array();
	var Index = parseInt(intSize - 3);
	
	Gold["2mm"] = "149.00_164.00_176.00_189.00_206.00_217.00_233.00_251.00_270.00";
	Gold["3mm"] = "219.00_237.00_252.00_269.00_284.00_300.00_315.00_327.00_347.00";
	Gold["4mm"] = "309.00_327.00_341.00_357.00_249.00_374.00_407.00_422.00_438.00";
	Gold["5mm"] = "341.00_356.00_368.00_384.00_396.00_413.00_440.00_293.00_455.00";
	Gold["6mm"] = "602.00_617.00_627.00_644.00_723.00_738.00_752.00_765.00_779.00";
	Gold["7mm"] = "729.00_746.00_761.00_771.00_854.00_869.00_881.00_894.00_911.00";
	Platinum["2mm"] = "332.00_382.00_410.00_432.00_459.00_486.00_508.00_528.00_544.00";
	Platinum["3mm"] = "456.00_510.00_559.00_586.00_610.00_635.00_659.00_687.00_710.00";
	Platinum["4mm"] = "694.00_722.00_746.00_784.00_808.00_835.00_858.00_886.00_910.00";
	Platinum["5mm"] = "804.00_827.00_863.00_886.00_908.00_941.00_963.00_987.00_1014.00";
	Platinum["6mm"] = "1096.00_1207.00_1279.00_1300.00_1325.00_1463.00_1486.00_1510.00_1531.00";
	Platinum["7mm"] = "1639.00_1660.00_1694.00_1717.00_1739.00_1881.00_1901.00_1924.00_1946.00";
		
	if (strMetal == "Platinum"){
		return ((Platinum[strWidth].split("_"))[Index]);
	} else if (("18K White Gold,18K Yellow Gold").indexOf(strMetal) >= 0) {
		return ((Gold[strWidth].split("_"))[Index]);
	} else {
		return(0);
	}
}


function GetFCFFSCost(strMetal, strWidth, intSize){
	var Gold = new Array();
	var Platinum = new Array();
	var Index = parseInt(intSize - 5);
	
	Gold["5mm"] = "294.00_308.00_317.00_330.00_342.00_352.00_364.00_377.00";
	Gold["6mm"] = "502.00_515.00_579.00_591.00_602.00_612.00_623.00_638.00";
	Gold["7mm"] = "609.00_617.00_683.00_695.00_705.00_716.00_729.00_742.00";
	Platinum["5mm"] = "659.00_699.00_738.00_778.00_818.00_856.00_897.00_935.00";
	Platinum["6mm"] = "797.00_836.00_878.00_915.00_956.00_994.00_1034.00_1073.00";
	Platinum["7mm"] = "951.00_990.00_1029.00_1070.00_1109.00_1149.00_1188.00_1228.00";
		
	if (strMetal == "Platinum"){
		return ((Platinum[strWidth].split("_"))[Index]);
	} else if (("18K White Gold,18K Yellow Gold").indexOf(strMetal) >= 0) {
		return ((Gold[strWidth].split("_"))[Index]);
	} else {
		return(0);
	}
}


function GetFRCCost(strMetal, strWidth, intSize){
	var Gold = new Array();
	var Platinum = new Array();
	var Index = parseInt(intSize - 3);
	
	/* Over written with Rounded Stock Prices above. */
	/* ------------------------------------------------------------------------------------------
	Gold["2mm"] = "139.00_152.00_163.00_174.00_190.00_202.00_217.00_233.00_254.00";
	Gold["3mm"] = "204.00_222.00_235.00_250.00_264.00_280.00_295.00_307.00_322.00";
	Gold["4mm"] = "341.00_305.00_318.00_334.00_347.00_362.00_379.00_391.00_408.00";
	Gold["5mm"] = "316.00_332.00_344.00_358.00_370.00_384.00_398.00_410.00_425.00";
	Gold["6mm"] = "559.00_574.00_586.00_600.00_676.00_690.00_701.00_714.00_727.00";
	Gold["7mm"] = "679.00_697.00_708.00_721.00_794.00_809.00_823.00_835.00_850.00";
	Platinum["2mm"] = "397.00_413.00_430.00_445.00_461.00_476.00_492.00_517.00_539.00";
	Platinum["3mm"] = "588.00_653.00_715.00_779.00_842.00_906.00_971.00_1034.00_1097.00";
	Platinum["4mm"] = "779.00_858.00_938.00_1018.00_1097.00_1178.00_1258.00_1337.00_1418.00";
	Platinum["5mm"] = "883.00_970.00_1057.00_1144.00_1231.00_1316.00_1404.00_1490.00_1578.00";
	Platinum["6mm"] = "1178.00_1201.00_1273.00_1382.00_1490.00_1600.00_1708.00_1817.00_1927.00";
	Platinum["7mm"] = "1680.00_1705.00_1738.00_1758.00_1780.00_1915.00_1937.00_1960.00_1981.00"; 
	---------------------------------------------------------------------------------------------- */
	
	/* 
		Regular Rounded Stock Prices, as Requested by Allen via email 11/5/2008
		Wanted to increase price by 15% of new Regular Rounded Stock Prices,
		so I needed to overwrite Raphael Rounded Stock prices with original 
		Rounded stock price because they were different.
	*/
	
	Gold["2mm"] = "114.00_126.00_135.00_145.00_158.00_167.00_179.00_193.00_207.00";
	Gold["3mm"] = "168.00_182.00_194.00_206.00_218.00_230.00_242.00_251.00_266.00";
	Gold["4mm"] = "237.00_251.00_262.00_274.00_287.00_301.00_312.00_324.00_336.00";
	Gold["5mm"] = "262.00_273.00_282.00_295.00_304.00_317.00_328.00_337.00_349.00";
	Gold["6mm"] = "462.00_473.00_481.00_494.00_555.00_566.00_577.00_587.00_597.00";
	Gold["7mm"] = "559.00_572.00_584.00_592.00_655.00_666.00_676.00_686.00_699.00";
	Platinum["2mm"] = "221.00_255.00_273.00_288.00_306.00_324.00_339.00_352.00_363.00";
	Platinum["3mm"] = "304.00_340.00_373.00_390.00_406.00_424.00_440.00_458.00_473.00";
	Platinum["4mm"] = "463.00_481.00_497.00_523.00_539.00_557.00_572.00_590.00_607.00";
	Platinum["5mm"] = "536.00_551.00_575.00_590.00_605.00_627.00_642.00_658.00_676.00";
	Platinum["6mm"] = "731.00_804.00_853.00_866.00_884.00_976.00_991.00_1007.00_1021.00";
	Platinum["7mm"] = "1093.00_1107.00_1130.00_1145.00_1160.00_1254.00_1268.00_1283.00_1298.00";
	
	if (strMetal == "Platinum"){
		return ((Platinum[strWidth].split("_"))[Index]);
	} else if (("18K White Gold,18K Yellow Gold").indexOf(strMetal) >= 0) {
		return ((Gold[strWidth].split("_"))[Index]);
	} else {
		return(0);
	}
}


function clearEmailSignUp(fieldName) 
{ 
	//var the_field = document.getElementById(fieldName);
	var tempElement = "document.email_signup_form." + fieldName;
	var the_field = eval(tempElement);
	if(the_field.value == 'Your E-mail Address'){
		the_field.value = '';
	} 
} 

function process_email_signup() {
	
	var user_email = document.email_signup_form.email_signup.value;
	
	//check if have a proper email address
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if (filter.test(user_email)) {	
	var email_url_link = "email_signup.cfm?user_email=" + user_email;
		window.open(email_url_link,'emailSignUp','toolbar=0,menubar=0,resizable=0,scrollbars=0,dependent=0,status=1,width=350,height=120,left=150,top=150'); 
	}
	else {
		alert("Please enter a valid email address");
		document.email_signup_form.email_signup.focus();
	}
	
	return false;
}
