// JavaScript Document

	function printWindow() {
		bV = parseInt(navigator.appVersion);
		if (bV >= 4) window.print();
	}

	function openPrintWindow(url) {
	  popupWin = window.open(url,'new_page','width=560,height=450,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes')
	}

	function openWindow(url) {
	  popupWin = window.open(url,'new_page','width=400,height=450,location=yes,resizable=yes')
	}	

	

// ################################
// ## SEARCH BY WOOFER IMPEDANCE ##
// ################################

// SWAP IMAGE STEPS
	function chgImg1(imgField) {
	var myindex1=document.getElementById("woofer_qty").selectedIndex;
	if (myindex1 == 0) {
			//keep step #2 image default gray
//			document.getElementById("step2Img").src= "woofer_wizard/www_step_2_sub.gif"
			//if 1st checkbox needs selection, then revert both 2nd & 3rd image back to default gray
//			document.getElementById("step3Img").src= "woofer_wizard/www_step_3.gif"			
			//disable drop down menu
			document.getElementById("woofer_imp").disabled = true;		
	} else {
			//change step #2 image to selected red
//			document.getElementById("step2Img").src= "woofer_wizard/www_step_2_sub_o.gif"
			//enable drop down menu so it can be reselected
			document.getElementById("woofer_imp").disabled = false;
		}
	}

	function chgImg2() {
	var myindex2=document.getElementById("woofer_imp").selectedIndex;
	if (myindex2 == 0) {
			//keep step #3 image default gray
//			document.getElementById("step3Img").src= "woofer_wizard/www_step_3.gif"
		} else {
			//change step #3 image selected red
//			document.getElementById("step3Img").src= "woofer_wizard/www_step_3_o.gif"
		}
	}


	
// ################################
// ### SEARCH BY AMP IMPEDANCE ####
// ################################	

	function chgImg1A(imgField) {
	var myindex1A=document.getElementById("amp_imp").selectedIndex;
	if (myindex1A == 0) {
			//keep step #2 image default gray
			document.getElementById("step2Img").src= "woofer_wizard/www_step_2_find.gif"
	} else {
			//change step #2 image to selected red
			document.getElementById("step2Img").src= "woofer_wizard/www_step_2_find_o.gif"
		}
	}

	

// ################################
// ## SEARCH BY WOOFER IMPEDANCE ##
// ################################

// SUBMIT FORM
	function submitForm(form) {
	var myFormQ=document.getElementById("woofer_qty").selectedIndex;
	var myFormI=document.getElementById("woofer_imp").selectedIndex;	
		if (myFormQ == 0) {
			alert("Please Select Woofer Quantity")
			return false;
		}
		if (myFormI == 0) {
			alert("Please Select Woofer Impedance")
			return false;
		}
		document.wiringWizard.submit();	
	}
	
	

// ###################################
// ## SEARCH BY AMPLIFIER IMPEDANCE ##
// ###################################

// SUBMIT FORM
	function submitAmpForm(form) {
	var myFormI=document.getElementById("amp_imp").selectedIndex;	
		if (myFormI == 0) {
			alert("Please Select Amplifier Impedance")
			return false;
		}
		document.wiringWizard.submit();	
	}



// ################################
// ####### WIRING FORMULAS ########
// ################################

// SUBMIT PARALLEL FORM
	function submitParallelForm(form) {
	var myFormPQ=document.getElementById("p_woofer_qty").selectedIndex;
	var myFormPI=document.getElementById("p_woofer_imp").selectedIndex;	
		if (myFormPQ == 0) {
			alert("Please Select Woofer Quantity")
			return false;
		}
		if (myFormPI == 0) {
			alert("Please Select Woofer Impedance")
			return false;
		}
		document.parallelForm.submit();	
	}
	
// SUBMIT PARALLEL FORM
	function submitSeriesForm(form) {
	var myFormSQ=document.getElementById("s_woofer_qty").selectedIndex;
	var myFormSI=document.getElementById("s_woofer_imp").selectedIndex;	
		if (myFormSQ == 0) {
			alert("Please Select Woofer Quantity")
			return false;
		}
		if (myFormSI == 0) {
			alert("Please Select Woofer Impedance")
			return false;
		}
		document.seriesForm.submit();	
	}

// JAVASCRIPT TO TOGGLE ON/OFF DIVs - SUBSTITUTES VISIBILITY PROPERTY WITH DISPLAY
	function showSearchCriteria(val) {
	var formPar = document.getElementById('Layer0').style;
	var formSer = document.getElementById('Layer1').style;	
	var formSerPar = document.getElementById('Layer2').style;		

		if(val == "parallel") {
			formPar.display = "block";
			formSer.display = "none";
			formSerPar.display = "none";
		}

		if(val == "series") {
			formPar.display = "none";
			formSer.display = "block";
			formSerPar.display = "none";
		}

		if(val == "seriesparallel") {
			formPar.display = "none";
			formSer.display = "none";
			formSerPar.display = "block";
		}	
	}

// SWAP IMAGE STEPS FOR PARALLEL FORM
	function chgImg1P(imgField) {
	var myindex1P=document.getElementById("p_woofer_qty").selectedIndex;
	if (myindex1P == 0) {
			//keep step #2 image default gray
			document.getElementById("step2ImgP").src= "woofer_wizard/www_step_2_sub.gif"
			//if 1st checkbox needs selection, then revert both 2nd & 3rd image back to default gray
			document.getElementById("step3ImgP").src= "woofer_wizard/www_step_3.gif"			
			//disable drop down menu
			document.getElementById("p_woofer_imp").disabled = true;		
	} else {
			//change step #2 image to selected red
			document.getElementById("step2ImgP").src= "woofer_wizard/www_step_2_sub_o.gif"
			//enable drop down menu so it can be reselected
			document.getElementById("p_woofer_imp").disabled = false;
		}
	}

	function chgImg2P() {
	var myindex2P=document.getElementById("p_woofer_imp").selectedIndex;
	if (myindex2P == 0) {
			//keep step #3 image default gray
			document.getElementById("step3ImgP").src= "woofer_wizard/www_step_3.gif"
		} else {
			//change step #3 image selected red
			document.getElementById("step3ImgP").src= "woofer_wizard/www_step_3_o.gif"
		}
	}
	
// SWAP IMAGE STEPS FOR SERIES FORM
	function chgImg1S(imgField) {
	var myindex1S=document.getElementById("s_woofer_qty").selectedIndex;
	if (myindex1S == 0) {
			//keep step #2 image default gray
			document.getElementById("step2ImgS").src= "woofer_wizard/www_step_2_sub.gif"
			//if 1st checkbox needs selection, then revert both 2nd & 3rd image back to default gray
			document.getElementById("step3ImgS").src= "woofer_wizard/www_step_3.gif"			
			//disable drop down menu
			document.getElementById("s_woofer_imp").disabled = true;		
	} else {
			//change step #2 image to selected red
			document.getElementById("step2ImgS").src= "woofer_wizard/www_step_2_sub_o.gif"
			//enable drop down menu so it can be reselected
			document.getElementById("s_woofer_imp").disabled = false;
		}
	}

	function chgImg2S() {
	var myindex2S=document.getElementById("s_woofer_imp").selectedIndex;
	if (myindex2S == 0) {
			//keep step #3 image default gray
			document.getElementById("step3ImgS").src= "woofer_wizard/www_step_3.gif"
		} else {
			//change step #3 image selected red
			document.getElementById("step3ImgS").src= "woofer_wizard/www_step_3_o.gif"
		}
	}

