//// PowerMatic
function clearForm1() {	
	document.drop_list.serial.value = "";
}
function clearForm2() {	
	document.drop_list.spec.value = "";
}
function hide(obj){
      obj1 = document.getElementById(obj);
      obj1.style.display = 'none';
}
function show(obj){
      obj1 = document.getElementById(obj);
      obj1.style.display = 'inline';
}

function fillCategory(){
	addOption(document.drop_list.Category, "Register Products", "PCM Products", "");
	addOption(document.drop_list.Category, "Register UPS", "UPS", "");
     intValue();
}
function fillmodel(model){
	if(model == 'ups'){
		addOption(document.drop_list.SubCat,"BNT-500A", "BNT-500A");
	addOption(document.drop_list.SubCat,"BNT-500AP", "BNT-500AP");
	addOption(document.drop_list.SubCat,"BNT-600A", "BNT-600A");
	addOption(document.drop_list.SubCat,"BNT-600AP", "BNT-600AP");
	addOption(document.drop_list.SubCat,"BNT-1000A", "BNT-1000A");
	addOption(document.drop_list.SubCat,"BNT-1000AP", "BNT-1000AP");
	addOption(document.drop_list.SubCat,"IMP-525A", "IMP-525A");
	addOption(document.drop_list.SubCat,"IMP-525AP", "IMP-525AP");
	addOption(document.drop_list.SubCat,"IMP-1000AP", "IMP-1000AP");
	addOption(document.drop_list.SubCat,"IMP-1500AP", "IMP-1500AP");
	addOption(document.drop_list.SubCat,"KIN-1000AP", "KIN-1000AP");
	addOption(document.drop_list.SubCat,"KIN-1500AP", "KIN-1500AP");
	addOption(document.drop_list.SubCat,"KIN-2200AP", "KIN-2200AP");
	addOption(document.drop_list.SubCat,"SMK-600A", "SMK-600A");
	addOption(document.drop_list.SubCat,"SMK-1000A", "SMK-1000A");
	addOption(document.drop_list.SubCat,"SMK-1500A", "SMK-1500A");
	addOption(document.drop_list.SubCat,"SMK-2000A", "SMK-2000A");
	addOption(document.drop_list.SubCat,"SMK-3000A", "SMK-3000A");
	addOption(document.drop_list.SubCat,"SMK-1500ARM", "SMK-1500ARM");
	addOption(document.drop_list.SubCat,"SMK-3000ARM", "SMK-3000ARM");
	addOption(document.drop_list.SubCat,"VGD-700", "VGD-700");
	addOption(document.drop_list.SubCat,"VGD-1000", "VGD-1000");
	addOption(document.drop_list.SubCat,"VGD-1500", "VGD-1500");
	addOption(document.drop_list.SubCat,"VGD-2000", "VGD-2000");
	addOption(document.drop_list.SubCat,"VGD-3000", "VGD-3000");
	addOption(document.drop_list.SubCat,"VGD-6000", "VGD-6000");
	addOption(document.drop_list.SubCat,"VGD-1000RM", "VGD-1000RM");
	addOption(document.drop_list.SubCat,"VGD-1500RM", "VGD-1500RM");
	addOption(document.drop_list.SubCat,"VGD-2000RM", "VGD-2000RM");
	addOption(document.drop_list.SubCat,"VGD-3000RM", "VGD-3000RM");
	addOption(document.drop_list.SubCat,"VGD-6000RM", "VGD-6000RM");
	addOption(document.drop_list.SubCat,"ONL-3750S", "ONL-3750S");
	addOption(document.drop_list.SubCat,"ONL-5000S", "ONL-5000S");
	addOption(document.drop_list.SubCat,"ONL-6250S", "ONL-6250S");
	addOption(document.drop_list.SubCat,"ONL-10KS", "ONL-10KS");
	addOption(document.drop_list.SubCat,"ONL-15KS", "ONL-15KS");
	addOption(document.drop_list.SubCat,"ONL-10K31", "ONL-10K31");
	addOption(document.drop_list.SubCat,"ONL-15K31", "ONL-15K31");
	addOption(document.drop_list.SubCat,"ONL-20K31", "ONL-20K31");
	addOption(document.drop_list.SubCat,"POWERTRONIC", "POWERTRONIC");
	addOption(document.drop_list.SubCat,"Others","Others");
	
	}else{
		addOption(document.drop_list.SubCat,"PRINCE-500T", "PRINCE-500T");
	addOption(document.drop_list.SubCat,"Q-525A", "Q-525A");
	addOption(document.drop_list.SubCat,"Q-525AP", "Q-525AP");
	addOption(document.drop_list.SubCat,"Q-1000AP", "Q-1000AP");
	addOption(document.drop_list.SubCat,"QUN-1000AP", "QUN-1000AP");
	addOption(document.drop_list.SubCat,"IMD-525AP", "IMD-525AP");
	addOption(document.drop_list.SubCat,"IMD-1000AP", "IMD-1000AP");
	addOption(document.drop_list.SubCat,"MD-1500AP", "MD-1500AP");
	addOption(document.drop_list.SubCat,"IMP-525A", "IMP-525A");
	addOption(document.drop_list.SubCat,"IMP-525AP", "IMP-525AP");
	addOption(document.drop_list.SubCat,"IMP-1000AP", "IMP-1000AP");
	addOption(document.drop_list.SubCat,"POWERTRONIC", "POWERTRONIC");
	addOption(document.drop_list.SubCat,"Others","Others");
	}
}
function intValue(){
	document.drop_list.serial.value = "Serial Number";
	document.drop_list.spec.value = "Specify Model";
}
function show_other(optionValue){
	 intValue();
	if(optionValue=='Others' || optionValue=='POWERTRONIC'){
		show('spec');
		}else{
		hide('spec');		
	}

}
function displayRow(tmp){	
		if(tmp == '1'){
		document.getElementById("reg01").style.display = '';
		document.getElementById("reg02").style.display = 'none';	
		document.getElementById("reg03").style.display = 'none';	
		}
		if(tmp == '2'){
		document.getElementById("reg01").style.display = 'none';
		document.getElementById("reg02").style.display = '';	
		document.getElementById("reg03").style.display = 'none';	
		}
		if(tmp == '3'){
		document.getElementById("reg01").style.display = 'none';
		document.getElementById("reg02").style.display = 'none';	
		document.getElementById("reg03").style.display = '';	
		}
	
 
}
 
function SelectSubCat(){
      
	removeAllOptions(document.drop_list.SubCat);
	intValue();
	if(document.drop_list.Category.value == '0'){
	addOption(document.drop_list.SubCat,"::Model::", "::Model::");
	}
	if(document.drop_list.Category.value == 'Register Products'){
	addOption(document.drop_list.SubCat,"PRINCE-500T", "PRINCE-500T");
	addOption(document.drop_list.SubCat,"Q-525A", "Q-525A");
	addOption(document.drop_list.SubCat,"Q-525AP", "Q-525AP");
	addOption(document.drop_list.SubCat,"Q-1000AP", "Q-1000AP");
	addOption(document.drop_list.SubCat,"QUN-1000AP", "QUN-1000AP");
	addOption(document.drop_list.SubCat,"IMD-525AP", "IMD-525AP");
	addOption(document.drop_list.SubCat,"IMD-1000AP", "IMD-1000AP");
	addOption(document.drop_list.SubCat,"MD-1500AP", "MD-1500AP");
	addOption(document.drop_list.SubCat,"IMP-525A", "IMP-525A");
	addOption(document.drop_list.SubCat,"IMP-525AP", "IMP-525AP");
	addOption(document.drop_list.SubCat,"IMP-1000AP", "IMP-1000AP");
	addOption(document.drop_list.SubCat,"Others","Others");
	}
	
	if(document.drop_list.Category.value == 'Register UPS'){
	addOption(document.drop_list.SubCat,"BNT-500A", "BNT-500A");
	addOption(document.drop_list.SubCat,"BNT-500AP", "BNT-500AP");
	addOption(document.drop_list.SubCat,"BNT-600A", "BNT-600A");
	addOption(document.drop_list.SubCat,"BNT-600AP", "BNT-600AP");
	addOption(document.drop_list.SubCat,"BNT-1000A", "BNT-1000A");
	addOption(document.drop_list.SubCat,"BNT-1000AP", "BNT-1000AP");
	addOption(document.drop_list.SubCat,"IMP-525A", "IMP-525A");
	addOption(document.drop_list.SubCat,"IMP-525AP", "IMP-525AP");
	addOption(document.drop_list.SubCat,"IMP-1000AP", "IMP-1000AP");
	addOption(document.drop_list.SubCat,"IMP-1500AP", "IMP-1500AP");
	addOption(document.drop_list.SubCat,"KIN-1000AP", "KIN-1000AP");
	addOption(document.drop_list.SubCat,"KIN-1500AP", "KIN-1500AP");
	addOption(document.drop_list.SubCat,"KIN-2200AP", "KIN-2200AP");
	addOption(document.drop_list.SubCat,"SMK-600A", "SMK-600A");
	addOption(document.drop_list.SubCat,"SMK-1000A", "SMK-1000A");
	addOption(document.drop_list.SubCat,"SMK-1500A", "SMK-1500A");
	addOption(document.drop_list.SubCat,"SMK-2000A", "SMK-2000A");
	addOption(document.drop_list.SubCat,"SMK-3000A", "SMK-3000A");
	addOption(document.drop_list.SubCat,"SMK-1500ARM", "SMK-1500ARM");
	addOption(document.drop_list.SubCat,"SMK-3000ARM", "SMK-3000ARM");
	addOption(document.drop_list.SubCat,"VGD-700", "VGD-700");
	addOption(document.drop_list.SubCat,"VGD-1000", "VGD-1000");
	addOption(document.drop_list.SubCat,"VGD-1500", "VGD-1500");
	addOption(document.drop_list.SubCat,"VGD-2000", "VGD-2000");
	addOption(document.drop_list.SubCat,"VGD-3000", "VGD-3000");
	addOption(document.drop_list.SubCat,"VGD-6000", "VGD-6000");
	addOption(document.drop_list.SubCat,"VGD-1000RM", "VGD-1000RM");
	addOption(document.drop_list.SubCat,"VGD-1500RM", "VGD-1500RM");
	addOption(document.drop_list.SubCat,"VGD-2000RM", "VGD-2000RM");
	addOption(document.drop_list.SubCat,"VGD-3000RM", "VGD-3000RM");
	addOption(document.drop_list.SubCat,"VGD-6000RM", "VGD-6000RM");
	addOption(document.drop_list.SubCat,"ONL-3750S", "ONL-3750S");
	addOption(document.drop_list.SubCat,"ONL-5000S", "ONL-5000S");
	addOption(document.drop_list.SubCat,"ONL-6250S", "ONL-6250S");
	addOption(document.drop_list.SubCat,"ONL-10KS", "ONL-10KS");
	addOption(document.drop_list.SubCat,"ONL-15KS", "ONL-15KS");
	addOption(document.drop_list.SubCat,"ONL-10K31", "ONL-10K31");
	addOption(document.drop_list.SubCat,"ONL-15K31", "ONL-15K31");
	addOption(document.drop_list.SubCat,"ONL-20K31", "ONL-20K31");
	addOption(document.drop_list.SubCat,"Others","Others");
	}
}
	
function removeAllOptions(selectbox){

	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		selectbox.remove(i);
	}
}

function addOption(selectbox, value, text ){
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

