function cr_model(str) {
	if (str == 0) {
	document.getElementById('div_cr_model_1').className = 'showGrp';
	document.getElementById('div_cr_model_2').className = 'showGrp';
	document.getElementById('div_cr_oem_1').className = 'hideGrp';
	document.getElementById('div_cr_oem_2').className = 'hideGrp';
	}
	else {
	document.getElementById('div_cr_model_1').className = 'hideGrp';
	document.getElementById('div_cr_model_2').className = 'hideGrp';
	document.getElementById('div_cr_oem_1').className = 'showGrp';
	document.getElementById('div_cr_oem_2').className = 'showGrp';	
	}
}
  function jumplist(it) {
           var dest = it.options[it.selectedIndex].value;
           if (dest == "nowhere") {
              it.selectedIndex = 0;
           } else {
              location.href = dest;
           }
        }

function allowBuy() {
	document.getElementById('div_cr').className = 'hideGrp';
	document.getElementById('div_buy').className = 'showGrp';
}

function loadBrands() {
	var ind = document.configurator.CatName.selectedIndex;	
	if (ind > 0) {
		document.getElementById('div_brand_0').className = 'hideGrp';
		document.getElementById('div_brand').className = 'showGrp';
		document.getElementById('B').focus();
	}
	else {
		document.getElementById('div_brand_0').className = 'showGrp';
		document.getElementById('div_brand').className = 'hideGrp';
	}
	document.getElementById('div_model_0').className = 'showGrp';
	document.getElementById('div_model').className = 'hideGrp';
	document.configurator.M.length = 0;
	document.configurator.M.options[0] = new Option('select model ...');
	document.configurator.B.length = 0;
	document.configurator.B.options[0] = new Option('select brand ...');
	if (ind == 1) {
		for (var i = 0; i < camcorder_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(camcorder_brands[i]);
		}
	}
	else if (ind == 2) {
		for (var i = 0; i < cellular_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(cellular_brands[i]);
		}	
	}
	else if (ind == 3) {
		for (var i = 0; i < cordless_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(cordless_brands[i]);
		}	
	}
	else if (ind == 4) {
		for (var i = 0; i < digitalcamera_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(digitalcamera_brands[i]);
		}	
	}
	else if (ind == 5) {
		for (var i = 0; i < laptop_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(laptop_brands[i]);
		}	
	}
	else if (ind == 6) {
		for (var i = 0; i < pda_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(pda_brands[i]);
		}	
	}
	else if (ind == 7) {
		for (var i = 0; i < ups_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(ups_brands[i]);
		}	
	}
	else if (ind == 8) {
		for (var i = 0; i < powertools_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(powertools_brands[i]);
		}	
	}
	else if (ind == 9) {
		for (var i = 0; i < scanner_brands.length; i++) {
			document.configurator.B.options[i+1] = new Option(scanner_brands[i]);
		}	
	}	
}

function loadModels() {
	var cat = document.configurator.CatName.selectedIndex;
	var ind = document.configurator.B.selectedIndex;
	if (ind > 0) {
		document.getElementById('div_model_0').className = 'hideGrp';
		document.getElementById('div_model').className = 'showGrp';
		document.getElementById('M').focus();
	}
	else {
		document.getElementById('div_model_0').className = 'showGrp';
		document.getElementById('div_model').className = 'hideGrp';
	}
	ind = ind - 1
	if (ind >= 0) {
		document.configurator.M.length = 0;
		document.configurator.M.options[0] = new Option('select model ...');
		if (cat == 1) {
			for (var i = 0; i < camcorder_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(camcorder_models[ind][i]);
			}
		}
		else if (cat == 2) {
			for (var i = 0; i < cellular_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(cellular_models[ind][i]);
			}	
		}
		else if (cat == 3) {
			for (var i = 0; i < cordless_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(cordless_models[ind][i]);
			}	
		}
		else if (cat == 4) {
			for (var i = 0; i < digitalcamera_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(digitalcamera_models[ind][i]);
			}	
		}
		else if (cat == 5) {
			for (var i = 0; i < laptop_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(laptop_models[ind][i]);
			}	
		}
		else if (cat == 6) {
			for (var i = 0; i < pda_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(pda_models[ind][i]);
			}	
		}
		else if (cat == 7) {
			for (var i = 0; i < ups_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(ups_models[ind][i]);
			}	
		}
		else if (cat == 8) {
			for (var i = 0; i < powertools_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(powertools_models[ind][i]);
			}	
		}
		else if (cat == 9) {
			for (var i = 0; i < scanner_models[ind].length; i++) {
				document.configurator.M.options[i+1] = new Option(scanner_models[ind][i]);
			}	
		}
	}
}	

function goTo(pagename) {
	if (pagename.options[pagename.selectedIndex].value != 'null') {
		location.href=pagename.options[pagename.selectedIndex].value;
	}
	else {
		alert('Please make a selection ...');
	}
	return true;
}

function exactMatch(obj) {
	obj.findMatch.value = '1';
	//alert(obj.findMatch.value);
	obj.submit();
	//return true;
}

function SendPass() { //v2.0
  window.open('/sendpass.asp','sendpass','width=400,height=200,scrollbar=no,menubar=no');
}

function product_image(url) { //v2.0
  window.open('/product_image.asp?ImageFile=' + url,'product_image','width=500,height=500,scrollbar=yes,menubar=no');
}

var cStatus = window.status;
function hilite1(obj,url) {
	obj.className = 'le_over';
	window.status = url;
}
function hilite2(obj) {
	obj.className = 'le';
	window.status = cStatus;
}	

function warnAction(q,p) { //df
	if (confirm(q)) {
		location.href = p;
	}
}

function checkRMA(str) {
	if (document.getElementById('cb_Sku_' + str).checked)
		document.getElementById('div_Sku_' + str).className = 'showGrp';
	else
		document.getElementById('div_Sku_' + str).className = 'hideGrp';
}

function showModelMsg(obj, str) {
	if (obj.selectedIndex > 0) {
		document.getElementById('div_ModelMsg_' + str).className = 'showGrp';
	}
	else {
		document.getElementById('div_ModelMsg_' + str).className = 'hideGrp';
	}
}