function product_tm(str, num) {
	for (var i = 0; i <=num; i++) {
		if (i == str) {
			document.getElementById('div_image' + i).className = 'showGrp';
			document.getElementById('id_product_tm' + i).className = 'img_tm_1';
		}
		else {
			document.getElementById('div_image' + i).className = 'hideGrp';
			document.getElementById('id_product_tm' + i).className = 'img_tm';
		}		
	}
}

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function completeShipping(obj) {
  if (obj.billandship.checked) {
		ShipFirst = obj.ShipFirst.value;
		ShipMiddle = obj.ShipMiddle.value;
		ShipLast = obj.ShipLast.value;
		ShipCompany = obj.ShipCompany.value;
		ShipAddress = obj.ShipAddress.value;
		ShipSuite = obj.ShipSuite.value;
		ShipCity = obj.ShipCity.value;
		ShipState = obj.ShipState.value;
		ShipZip = obj.ShipZip.value;
		ShipCountry = obj.ShipCountry.value;
		ShipPhone = obj.ShipPhone.value; 
	
		obj.ShipFirst.value = obj.First.value;
		obj.ShipMiddle.value = obj.Middle.value;
		obj.ShipLast.value = obj.Last.value;
		obj.ShipCompany.value = obj.Company.value;
		obj.ShipAddress.value = obj.Address.value;
		obj.ShipSuite.value = obj.Suite.value;
		obj.ShipCity.value = obj.City.value;
		obj.ShipState.value = obj.State.value;
		obj.ShipZip.value = obj.Zip.value;
		obj.ShipCountry.value = obj.Country.value;
		obj.ShipPhone.value = obj.Phone.value;
	}
	else {
		obj.ShipFirst.value = ShipFirst;
		obj.ShipMiddle.value = ShipMiddle;
		obj.ShipLast.value = ShipLast;
		obj.ShipCompany.value = ShipCompany;
		obj.ShipAddress.value = ShipAddress;
		obj.ShipSuite.value = ShipSuite;
		obj.ShipCity.value = ShipCity;
		obj.ShipState.value = ShipState;
		obj.ShipZip.value = ShipZip;
		obj.ShipCountry.value = ShipCountry;
		obj.ShipPhone.value  = ShipPhone;
	}
  return true;
}