categorys=new Array(null
 ,new Array("791","device","ACCESSORIES","Adapters")
 ,new Array("650","device","ACCESSORIES","Battery Tester")
 ,new Array("662","device","ACCESSORIES","Meter Accessory")
 ,new Array("699","device","ACCESSORIES","Meter Cases")
 ,new Array("695","device","ACCESSORIES","Probes")

 ,new Array("524","device","ASSEMBLY","Assembly")
 ,new Array("529","device","ASSEMBLY","Battery Holders")
 ,new Array("411","device","ASSEMBLY","Connectors")
 ,new Array("480","device","ASSEMBLY","Leads & Clips")
 ,new Array("648","device","ASSEMBLY","Shunts")

 ,new Array("375","device","BATTERY","Battery by Category")
 ,new Array("687","device","BATTERY","Battery by Chemistry")
 ,new Array("689","device","BATTERY","Battery by Size")

 ,new Array("498","device","CHARGERS","12 Volt")
 ,new Array("499","device","CHARGERS","24 Volt")
 ,new Array("500","device","CHARGERS","6 Volt")
 ,new Array("651","device","CHARGERS","Battery Analysers")
 ,new Array("698","device","CHARGERS","Battery/Charger Combo")
 ,new Array("684","device","CHARGERS","Camera & Video")
 ,new Array("501","device","CHARGERS","Consumer")
 ,new Array("641","device","CHARGERS","Lithium")
 ,new Array("694","device","CHARGERS","Multi Chemistry")
 ,new Array("654","device","CHARGERS","Multi Voltage")
 ,new Array("702","device","CHARGERS","SLA Chargers")
 ,new Array("503","device","CHARGERS","Specialised")
 ,new Array("701","device","CHARGERS","Two Way Radio")
 ,new Array("632","device","CHARGERS","with Batteries")

 ,new Array("484","device","METERS","Air Flow Meters")
 ,new Array("657","device","METERS","Analytical Meters")
 ,new Array("660","device","METERS","Audiometers")
 ,new Array("570","device","METERS","Calibrators")
 ,new Array("655","device","METERS","Clamp Meters")
 ,new Array("649","device","METERS","Control Equipment")
 ,new Array("789","device","METERS","Data Loggers")
 ,new Array("663","device","METERS","Digital Panel Meters")
 ,new Array("664","device","METERS","Electric Test Meters")
 ,new Array("666","device","METERS","Electronic Test Meters")
 ,new Array("665","device","METERS","Electronic Weight Scales")
 ,new Array("792","device","METERS","Force Gauges")
 ,new Array("669","device","METERS","Humidity Meters")
 ,new Array("669","device","METERS","Hygrometers")
 ,new Array("668","device","METERS","Light Meters")
 ,new Array("669","device","METERS","Moisture Meters")
 ,new Array("671","device","METERS","Multimeters")
 ,new Array("663","device","METERS","Panel Meters")
 ,new Array("696","device","METERS","Ph Meters")
 ,new Array("659","device","METERS","Pressure Meters")
 ,new Array("661","device","METERS","Process Control Meters")
 ,new Array("660","device","METERS","Sound Level Meters")
 ,new Array("672","device","METERS","Tachometers")
 ,new Array("667","device","METERS","Temperature Meters")
 ,new Array("664","device","METERS","Test Meters")
 ,new Array("667","device","METERS","Thermal Meters")
 ,new Array("659","device","METERS","Vacuum Meters")
 ,new Array("665","device","METERS","Weight Scales")

 ,new Array("798","device","POWER","AC to DC Converters")
 ,new Array("800","device","POWER","Cig Power Supply")
 ,new Array("799","device","POWER","Commercial Power Supply")
 ,new Array("798","device","POWER","DC to AC Converters")
 ,new Array("700","device","POWER","Laptop Power Supply")
 ,new Array("796","device","POWER","Transformers")
 ,new Array("797","device","POWER","USB Power Supply")

 ,new Array("689","device","TORCH","Batteries: Primary")
 ,new Array("794","device","TORCH","Batteries: Rechargeable")
 ,new Array("795","device","TORCH","Light Globes")
 ,new Array("684","device","TORCH","Torches & Flashlights")

 ,new Array("412","device","BATTFIND","Barcode")
 ,new Array("367","device","BATTFIND","Blue Tooth")
 ,new Array("405","device","BATTFIND","Camcorders")
 ,new Array("374","device","BATTFIND","Camera Flash")
 ,new Array("461","device","BATTFIND","Car Alarm")
 ,new Array("346","device","BATTFIND","Cell Phones")
 ,new Array("384","device","BATTFIND","Cordless Drills")
 ,new Array("393","device","BATTFIND","Cordless Phones")
 ,new Array("412","device","BATTFIND","Data Terminals")
 ,new Array("397","device","BATTFIND","Digital Cameras")
 ,new Array("413","device","BATTFIND","Electric Shavers")
 ,new Array("366","device","BATTFIND","Electronic Devices")
 ,new Array("419","device","BATTFIND","Emergency Lighting")
 ,new Array("794","device","BATTFIND","Eneloop Rechargeable")
 ,new Array("431","device","BATTFIND","Flashlights")
 ,new Array("462","device","BATTFIND","GPS Systems")
 ,new Array("420","device","BATTFIND","Hearing Aids")
 ,new Array("535","device","BATTFIND","Hobby")
 ,new Array("350","device","BATTFIND","Laptop Computers")
 ,new Array("392","device","BATTFIND","Laser Sights")
 ,new Array("682","device","BATTFIND","Medical Equipment")
 ,new Array("346","device","BATTFIND","Mobile Phones")
 ,new Array("683","device","BATTFIND","Nintendo & PSP")
 ,new Array("350","device","BATTFIND","Notebook Computers")
 ,new Array("351","device","BATTFIND","PDA's")
 ,new Array("410","device","BATTFIND","Pagers")
 ,new Array("374","device","BATTFIND","Photo Cells")
 ,new Array("351","device","BATTFIND","PocketPC")
 ,new Array("683","device","BATTFIND","Portable Gaming")
 ,new Array("675","device","BATTFIND","Portable Printer")
 ,new Array("384","device","BATTFIND","Power Tools")
 ,new Array("394","device","BATTFIND","Professional Video")
 ,new Array("380","device","BATTFIND","Rechargeable")
 ,new Array("535","device","BATTFIND","Remote Control")
 ,new Array("682","device","BATTFIND","Rescue Equipment")
 ,new Array("412","device","BATTFIND","Scanners")
 ,new Array("351","device","BATTFIND","SmartPhones")
 ,new Array("674","device","BATTFIND","Smoke Alarms")
 ,new Array("431","device","BATTFIND","Torches")
 ,new Array("793","device","BATTFIND","Toys")
 ,new Array("416","device","BATTFIND","Two Way Radio")
 ,new Array("681","device","BATTFIND","UPS & Standby")
 ,new Array("405","device","BATTFIND","Video Camera")
 ,new Array("479","device","BATTFIND","Watch Batteries")

 ,new Array("562","device","BATTSIZE","9V")
 ,new Array("558","device","BATTSIZE","AA")
 ,new Array("559","device","BATTSIZE","AAA")
 ,new Array("568","device","BATTSIZE","AAAA")
 ,new Array("360","device","BATTSIZE","Button cells")
 ,new Array("560","device","BATTSIZE","C Cells")
 ,new Array("485","device","BATTSIZE","Coin Cells")
 ,new Array("563","device","BATTSIZE","Cylindrical")
 ,new Array("561","device","BATTSIZE","D Cells")
 ,new Array("368","device","BATTSIZE","Industrial")
 ,new Array("634","device","BATTSIZE","Lantern")
 ,new Array("692","device","BATTSIZE","N Cells")
 ,new Array("693","device","BATTSIZE","RBC")
 ,new Array("479","device","BATTSIZE","Watch Batteries")

 ,new Array("378","device","BATTCHEM","Alkaline")
 ,new Array("376","device","BATTCHEM","Carbon")
 ,new Array("373","device","BATTCHEM","Lithium")
 ,new Array("691","device","BATTCHEM","NiCd")
 ,new Array("690","device","BATTCHEM","NiMH")
 ,new Array("358","device","BATTCHEM","Sealed Lead")
 ,new Array("481","device","BATTCHEM","Silver Oxide")
 ,new Array("425","device","BATTCHEM","Zinc Chloride")

 ,new Array("XXX","device","XXXX","XXXX")
 ,new Array("XXX","device","XXXX","XXXX")

    );
//level variable    
var level=0; 


function loadSubGroups() {
    for (i = document.form.product.options.length; i >= 0; i--) {
            document.form.product.options[i] = null; 
    }
    var brand_name = document.form.brand.value;
    var product_j = 0;
    var product_array = new Array();
    for(var i=1;i<categorys.length;i++){
        if(categorys[i][2]==brand_name){
			if(categorys[i][1] == 'device'){            
				//Search if the item exists already!
				product_flag = true;
				for(var m=0;m<product_array.length;m++){
					if(product_array[m][0] == categorys[i][3]){
						product_flag = false;
						break;
					}
				}
				if(product_flag){
					product_array[product_j]=new Array(categorys[i][3],categorys[i][0]);
					product_j++;
				}
			}
        }
    }
    product_array.sort();
    for( var i=0;i<product_array.length;i++){
           document.form.product.options[i]=new Option(product_array[i][0]);
           document.form.product.options[i].value=product_array[i][1];
    }
}

function viewProduct(type) {
   if(type == 'product'){
      for(var ix1=1;ix1<categorys.length;ix1++){
         product_flag = false;
         if(document.form.product.value == categorys[ix1][0]){
            product_flag = true;
            var ix2 = ix1;
         }
         if(product_flag){
            var catnum = categorys[ix2][0];
            window.location="http://www.yankeeroo.com/store/home.php?cat="+catnum;
         }
      }
   }
}