

var productImageNames = new Array("ant11b",
							"br700",
							"dcp501",
							"dct5100",
							"dsr470",
							"dct700",
							"dct2500",
							"dct3400",
							"dct6200",
							"dct6208",
							"dct6412",
							"bmc9012",
							"bmc9022",
							"drc800",
							"drc400",
							"hdt100",
							"hdt101",
							"hmds1040",
							"hmez1000",
							"hmts1050",								
							"hmwc1020",
							"hmwl1010",							
							"hmws1060",
							"imfree",
							"sb4200",
							"sb5100",
							"sb5120",
							"sb5102",
							"sbg1000",
							"signal_booster",
							"signal_splitter",
							"simplefi",
							"wa840g",
							"we800g",
							"wn825g",
							"wpci810g",
							"wr850g",
							"m25",
							"m500",
							"wps870g",
							"wu830g",
							"wr850gp",
							"wa840gp",
							"wn825gp",
							"wpci810gp",
							"vt1000",
							"vt2000",
							"vt2400",
							"vt2500",							
							"e30",
							"e31",
							"e32",
							"e33",
							"e34",
							"e51",
							"e52",
							"c50",
							"c51",
							"c70",
							"t31",
							"HH1620"							
);

//preload images
if (document.images) {
	var imageNames = new Array("m_goshop","ok","ok_blue","homepage_feature1_ok", "rightnav_about_ok", "rightnav_product_ok","homepage_feature2_ok","homepage_feature3_ok","home_vhn_ok","mnp_go");
	var imageExtension = ".gif";
	var rolloverImages = new Array(imageNames.length);
	var curName = "";
	var gWhichGlowing = "";

	//preload rollover images
	for (var i=0; i<imageNames.length; i++) {
		curName = imageNames[i];
		rolloverImages[curName] = new Array("over","out");
		rolloverImages[curName]["out"] = new Image();
		rolloverImages[curName]["out"].src = imagePath+curName+"-out"+imageExtension;
		rolloverImages[curName]["over"] = new Image();
		rolloverImages[curName]["over"].src = imagePath+curName+"-over"+imageExtension;
	}
	
	//preload product images
	productImages = new Array();

	for (var i=0; i<productImageNames.length; i++) {
		productImages[i] = new Image();
		productImages[i].src = imagePath + "m_circle_" + productImageNames[i] + ".jpg"; 
	}
}
			
// reset the form
function init()
{
	// reset form
	document.product_selector.reset();
}
		
// updates the graphic of the product called from onchange
function updateProduct()
{
	var myindex = document.product_selector.product_jump.selectedIndex
	var myproduct = document.product_selector.product_jump.options[myindex].value
	if (myproduct != -1){

		imageurl = imagePath + "m_circle_" + myproduct + ".jpg"
		document.product_image.src = imageurl;
		document.product_image.alt = myproduct;
	}
}

// check if user hit enter
function checkEnter(event) {
	if ((event.keyCode == 13) || (event.which == 13)) {
		validateJump();
	} else {
		var myindex = document.product_selector.product_jump.selectedIndex
		var myproduct = document.product_selector.product_jump.options[myindex].value
		if (myproduct != -1){
			imageurl = imagePath + "m_circle_" + myproduct + ".jpg"
			document.product_image.src = imageurl;
			document.product_image.alt = myproduct;
		}
	}
}


// check to make sure user does not go anywhere when selecting "Select a Product" from the dropdown menu
function validateJump() {
	if (document.product_selector.product_jump.options[0].selected == true) {
		return false;
	} else {
		document.product_selector.submit();
	}
}

// rollover scripts

function Glow(whichImage) {
	if (document.images) {
		document[whichImage].src = rolloverImages[whichImage]["over"].src;
		gWhichGlowing = whichImage;
	}
}

function DeGlow(){
	if (document.images) {
		document[gWhichGlowing].src = rolloverImages[gWhichGlowing]["out"].src;
		gWhichGlowing = "";
	}
}

function okBlueGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_blue-over.gif";
	}
}

function okBlueDeGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_blue-out.gif";
	}
}

function okGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok-over.gif";
	}
}

function okDeGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok-out.gif";
	}
}

function okHomeGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_home-over.gif";
	}
}

function okHomeDeGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_home-out.gif";
	}
}

function okEmailGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_email-over.gif";
	}
}

function okEmailDeGlow(whichImage) {
	if (document.images) {
		whichImage.src = imagePath + "ok_email-out.gif";
	}
}

function goBack() {
	window.history.back();
}

function configuratorPopUp(url, name, event) {
	var params="width=820,height=540,scrollbars=1,resizable=1,top=20,left=20"; 
	window.open(url, name, params).focus();

	//cancel onclick event in case it's also caught by td
	if (event)
		event.cancelBubble = true;
		
	//return true;
}

function windowPopUp(url, name, event, width, height) {
	var params="scrollbars=1,location=0,menubar=0,status=0,toolbar=0,resizable=1,top=40,left=40,";
	var params = params + "width=" + width + ",height=" + height; 
	window.open(url, name, params).focus();
	//cancel onclick event in case it's also caught by td
	if (event)
		event.cancelBubble = true;
}

function imfreePopUp(url, name, event, width, height) {
	var params="scrollbars=0,location=0,menubar=0,status=0,toolbar=0,resizable=1,top=40,left=40,";
	var params = params + "width=" + width + ",height=" + height; 
	window.open(url, name, params).focus();
	//cancel onclick event in case it's also caught by td
	if (event)
		event.cancelBubble = true;
}

