
var imgHomeOff = new Image();
	imgHomeOff.src = (strWebRoot + "img/global/nav_home.gif");
var imgHomeOn = new Image();
	imgHomeOn.src = (strWebRoot + "img/global/nav_home_f2.gif");

var imgOtherDesignersOff = new Image();
	imgOtherDesignersOff.src = (strWebRoot + "img/global/designers.gif");
var imgOtherDesignersOn = new Image();
	imgOtherDesignersOn.src = (strWebRoot + "img/global/designers_f2.gif");

var imgCloseoutsOff = new Image();
	imgCloseoutsOff.src = (strWebRoot + "img/global/closeouts.gif");
var imgCloseoutsOn = new Image();
	imgCloseoutsOn.src = (strWebRoot + "img/global/closeouts_f2.gif");
	
var imgJewelryOff = new Image();
	imgJewelryOff.src = (strWebRoot + "img/global/jewelry.gif");
var imgJewelryOn = new Image();
	imgJewelryOn.src = (strWebRoot + "img/global/jewelry_f2.gif");
	
var imgNewArrivalsOff = new Image();
	imgNewArrivalsOff.src = (strWebRoot + "img/global/new_arrivals.gif");
var imgNewArrivalsOn = new Image();
	imgNewArrivalsOn.src = (strWebRoot + "img/global/new_arrivals_f2.gif");

var imgWatchesOff = new Image();
	imgWatchesOff.src = (strWebRoot + "img/global/watches.gif");
var imgWatchesOn = new Image();
	imgWatchesOn.src = (strWebRoot + "img/global/watches_f2.gif");
	
var imgSaleOff = new Image();
	imgSaleOff.src = (strWebRoot + "img/global/nav_sale.gif");
var imgSaleOn = new Image();
	imgSaleOn.src = (strWebRoot + "img/global/nav_sale_f2.gif");
	
var imgWeBuyOff = new Image();
	imgWeBuyOff.src = (strWebRoot + "img/global/we_buy.gif");
var imgWeBuyOn = new Image();
	imgWeBuyOn.src = (strWebRoot + "img/global/we_buy_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=538,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"] = "99.00_109.00_117.00_126.00_137.00_145.00_155.00_167.00_180.00";
	Gold["3mm"] = "146.00_158.00_168.00_179.00_189.00_200.00_210.00_218.00_231.00";
	Gold["4mm"] = "206.00_218.00_227.00_238.00_249.00_261.00_271.00_281.00_292.00";
	Gold["5mm"] = "227.00_237.00_245.00_256.00_264.00_275.00_285.00_293.00_303.00";
	Gold["6mm"] = "401.00_411.00_418.00_429.00_482.00_492.00_501.00_510.00_519.00";
	Gold["7mm"] = "486.00_497.00_507.00_514.00_569.00_579.00_587.00_596.00_607.00";
	Platinum["2mm"] = "192.00_221.00_237.00_250.00_266.00_281.00_294.00_306.00_315.00";
	Platinum["3mm"] = "264.00_295.00_324.00_339.00_353.00_368.00_382.00_398.00_411.00";
	Platinum["4mm"] = "402.00_418.00_432.00_454.00_468.00_484.00_497.00_513.00_527.00";
	Platinum["5mm"] = "466.00_479.00_500.00_513.00_526.00_545.00_558.00_572.00_587.00";
	Platinum["6mm"] = "635.00_699.00_741.00_753.00_768.00_848.00_861.00_875.00_887.00";
	Platinum["7mm"] = "950.00_962.00_982.00_995.00_1008.00_1090.00_1102.00_1115.00_1128.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"] = "245.00_256.00_264.00_275.00_285.00_293.00_303.00_314.00";
	Gold["6mm"] = "418.00_429.00_482.00_492.00_501.00_510.00_519.00_531.00";
	Gold["7mm"] = "507.00_514.00_569.00_579.00_587.00_596.00_607.00_618.00";
	Platinum["5mm"] = "549.00_582.00_615.00_648.00_681.00_713.00_747.00_779.00";
	Platinum["6mm"] = "664.00_696.00_731.00_762.00_796.00_828.00_861.00_894.00";
	Platinum["7mm"] = "792.00_825.00_857.00_891.00_924.00_957.00_990.00_1023.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;
}
