function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "engines", "Engines", "");
addOption(document.drop_list.Category, "align", "Align", "");
addOption(document.drop_list.Category, "eflite", "Eflite", "");
addOption(document.drop_list.Category, "jr", "JR", "");
//addOption(document.drop_list.Category, "mikado", "Mikado", "");
addOption(document.drop_list.Category, "msh", "MSH", "");
addOption(document.drop_list.Category, "tt", "Thunder Tiger", "");
}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Model", "");

//if(document.drop_list.Category.value == 'compass'){
//addOption(document.drop_list.SubCat,"compass", "Knight 3D");
//}
if(document.drop_list.Category.value == 'mikado'){
addOption(document.drop_list.SubCat,"logo400", "Logo 400");
addOption(document.drop_list.SubCat,"logoother", "Logo 500/600");
}
if(document.drop_list.Category.value == 'eflite'){
addOption(document.drop_list.SubCat,"Blade 400 3d", "Blade 400 3d");
addOption(document.drop_list.SubCat,"Blade CX2", "Blade CX2");
addOption(document.drop_list.SubCat,"Blade MCX", "Blade MCX");
}
if(document.drop_list.Category.value == 'msh'){
addOption(document.drop_list.SubCat,"protos500", "Protos 500");
//addOption(document.drop_list.SubCat,"", "");
}

if(document.drop_list.Category.value == 'engines'){
addOption(document.drop_list.SubCat,"os", "OS Spares");
//addOption(document.drop_list.SubCat,"ys", "YS Spares");
}

if(document.drop_list.Category.value == 'tt'){
addOption(document.drop_list.SubCat,"r50", "Raptor 50/Titan");
}

if(document.drop_list.Category.value == 'align'){
addOption(document.drop_list.SubCat,"trex250", "Trex 250");
addOption(document.drop_list.SubCat,"Trex 450 V2", "Trex 450 V2");
addOption(document.drop_list.SubCat,"Trex 450 Pro", "Trex 450 Pro");
addOption(document.drop_list.SubCat,"trex450xlccpm", "Trex 450 XL CCPM");
addOption(document.drop_list.SubCat,"Trex 500", "Trex 500");
addOption(document.drop_list.SubCat,"Trex 600 Nitro", "Trex 600 Nitro");
addOption(document.drop_list.SubCat,"trex600e", "Trex 600 Electric");
addOption(document.drop_list.SubCat,"Trex 700 Nitro", "Trex 700 Nitro");
}
if(document.drop_list.Category.value == 'jr'){
addOption(document.drop_list.SubCat,"Vibe 50", "Vibe 50");
<!--addOption(document.drop_list.SubCat,"Vibe 90", "Vibe 90");-->
}

if(document.drop_list.Category.value == 'Thunder Tiger'){
addOption(document.drop_list.SubCat,"Raptor 30", "Raptor 30");
addOption(document.drop_list.SubCat,"Raptor 50", "Raptor 50");
addOption(document.drop_list.SubCat,"Raptor 90", "Raptor 90");
addOption(document.drop_list.SubCat,"Raptor Titan", "Raptor Titan");
}
}
////////////////// 
function SelectSubPage(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubPage);
addOption(document.drop_list.SubPage, "", "--", "");

if(document.drop_list.SubCat.value == 'ys'){
addOption(document.drop_list.SubPage,"ys50st", "50 ST");
addOption(document.drop_list.SubPage,"ys91sr", "91 SR");
}


if(document.drop_list.SubCat.value == 'os'){
addOption(document.drop_list.SubPage,"os50hyper", "50 Hyper");
addOption(document.drop_list.SubPage,"os50hyperc", "50 Hyper Carb");
addOption(document.drop_list.SubPage,"os91sz", "91 SZ");
addOption(document.drop_list.SubPage,"os91szc", "91 SZ Carb");
addOption(document.drop_list.SubPage,"os91szhyp", "91 SZ Hyper");
addOption(document.drop_list.SubPage,"os91szhypc", "91 SZ Hyper Carb");
}


if(document.drop_list.SubCat.value == 'r50'){
addOption(document.drop_list.SubPage,"r50_head", "Head Assembly");
addOption(document.drop_list.SubPage,"r50_washout_maingear", "Washout & Main Gear Assembly");
addOption(document.drop_list.SubPage,"r50_mainframe", "Main Frame Assembly 1");
addOption(document.drop_list.SubPage,"r50_mainframe2", "Main Frame Assembly 2");
addOption(document.drop_list.SubPage,"r50_engine_clutch", "Fuel Tank, Engine, Clutchbell");
addOption(document.drop_list.SubPage,"r50_boom_tail", "Boom/Tail Assembly");
addOption(document.drop_list.SubPage,"r50_gear_canopy", "Landing Gear/Canopy");
}

if(document.drop_list.SubCat.value == 'Trex 700 Nitro'){
addOption(document.drop_list.SubPage,"trex700_swash_gear", "Swash/Main Gear Assembly");
addOption(document.drop_list.SubPage,"trex700_tailassembly", "Tail Assembly");
addOption(document.drop_list.SubPage,"trex700_head", "Head Assembly");
addOption(document.drop_list.SubPage,"trex700_main_frames", "Main Frames");
addOption(document.drop_list.SubPage,"trex700_2mainframes", "Main Frames 2");
}
if(document.drop_list.SubCat.value == 'Trex 450 Pro'){
addOption(document.drop_list.SubPage,"trex450prohead", "Head Assembly");
addOption(document.drop_list.SubPage,"trex450proframe", "Frame Assembly");
addOption(document.drop_list.SubPage,"trex450protail", "Boom/Tail Assembly");
}
if(document.drop_list.SubCat.value == 'trex450xlccpm'){
addOption(document.drop_list.SubPage,"trex450xlccpmhead", "Head Assembly");
addOption(document.drop_list.SubPage,"trex450xlccpmmain", "Main Frame Assembly");
addOption(document.drop_list.SubPage,"trex450xlccpmtail", "Tail Assembly");
}
if(document.drop_list.SubCat.value == 'Trex 450 V2'){
addOption(document.drop_list.SubPage,"trex450v2head", "Head Assembly");
addOption(document.drop_list.SubPage,"trex450v2swash", "Swashplate and Main Gear");
addOption(document.drop_list.SubPage,"trex450v2main", "Mainframe Assembly");
addOption(document.drop_list.SubPage,"trex450v2boom", "Tail and Landing Gear");
}
if(document.drop_list.SubCat.value == 'trex250'){
addOption(document.drop_list.SubPage,"trex250head", "Head Assembly");
addOption(document.drop_list.SubPage,"trex250mainframe", "Main Frame Assembly");
addOption(document.drop_list.SubPage,"trex250maingear", "Main Gear Assembly");
addOption(document.drop_list.SubPage,"trex250tail", "Tail Assembly");
}
if(document.drop_list.SubCat.value == 'Trex 500'){
addOption(document.drop_list.SubPage,"trex500head", "Head Assembly");
addOption(document.drop_list.SubPage,"trex500maingear", "Maingear and Swashplate");
addOption(document.drop_list.SubPage,"trex500mainframe", "Mainframes and Motor");
addOption(document.drop_list.SubPage,"trex500tail", "Landing Gear and Tail Assembly");
addOption(document.drop_list.SubPage,"trex500canopy", "Canopy and fittings");
}
if(document.drop_list.SubCat.value == 'Trex 600 Nitro'){
addOption(document.drop_list.SubPage,"trex600nhead", "Head Assembly");
addOption(document.drop_list.SubPage,"trex600nswashandmain", "Swashplate and Main Gear");
addOption(document.drop_list.SubPage,"trex600nclutchandfan", "Clutch and Fan Assembly");
addOption(document.drop_list.SubPage,"trex600nframe1", "Mainframes and Tank");
addOption(document.drop_list.SubPage,"trex600nboomandtail", "Boom and Tail Assembly");
addOption(document.drop_list.SubPage,"trex600ncanopy", "Canopy and fittings");
}
if(document.drop_list.SubCat.value == 'trex600e'){
addOption(document.drop_list.SubPage,"trex600ehead", "Head Assembly");
addOption(document.drop_list.SubPage,"trex600emainframe", "Main Frame Assembly");
addOption(document.drop_list.SubPage,"trex600etail", "Tail Assembly");
}
if(document.drop_list.SubCat.value == 'Trex 500'){
addOption(document.drop_list.SubPage,"trex500head", "Head Assembly");
addOption(document.drop_list.SubPage,"trex500maingear", "Maingear and Swashplate");
addOption(document.drop_list.SubPage,"trex500mainframe", "Mainframes and Motor");
addOption(document.drop_list.SubPage,"trex500tail", "Landing Gear and Tail Assembly");
addOption(document.drop_list.SubPage,"trex500canopy", "Canopy and fittings");
}
if(document.drop_list.SubCat.value == 'Vibe 50'){
addOption(document.drop_list.SubPage,"exp_vibe50_clutch_main", "Clutch/Main Gear Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_t_assembly", "Tail Unit Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_swash_flybar", "Swash/Flybar Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_tail_hub", "Tail Hub Assembly/Boom Clamp");
addOption(document.drop_list.SubPage,"exp_vibe50_tail_assembly", "Tail Assembly/Torque Tube");
addOption(document.drop_list.SubPage,"exp_vibe50_main_frame", "Main Frame Asssembly");
addOption(document.drop_list.SubPage,"exp_vibe50_links_aux", "Servo/Swash links, Auxillary Items");
addOption(document.drop_list.SubPage,"exp_Vibe50_landing_boom", "Landing Gear, Boom Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_head", "Head Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_fueltank_rx", "Fuel tank, Rx Assembly");
addOption(document.drop_list.SubPage,"exp_vibe50_engine", "Engine Assembly");
}
if(document.drop_list.SubCat.value == 'protos500'){
addOption(document.drop_list.SubPage,"protos500_carbon_frames", "Carbon Frame Set");
addOption(document.drop_list.SubPage,"protos500_tail_boom", "Tail Section");
addOption(document.drop_list.SubPage,"protos500_frames_head", "Head and frames");
}
if(document.drop_list.SubCat.value == 'Lama V3'){
addOption(document.drop_list.SubPage,"lamav3", "Main Page");
}
if(document.drop_list.SubCat.value == 'Honey Bee CP2'){
addOption(document.drop_list.SubPage,"cp2head", "Head Assembly");
addOption(document.drop_list.SubPage,"cp2mainframes", "Main Frames etc");
}

if(document.drop_list.SubCat.value == 'Honey Bee King 2'){
addOption(document.drop_list.SubPage,"hbking2", "Complete Assembly");
}

if(document.drop_list.SubCat.value == 'Blade 400 3d'){
addOption(document.drop_list.SubPage,"blade4003d", "Head and Swashplate");
addOption(document.drop_list.SubPage,"blade4003dboom", "Boom and Tail");
addOption(document.drop_list.SubPage,"blade4003dmain", "Mainframe Assembly");
}

if(document.drop_list.SubCat.value == 'Blade MCX'){
addOption(document.drop_list.SubPage,"blademcx", "Main Page");
}

if(document.drop_list.SubCat.value == 'Blade CX2'){
addOption(document.drop_list.SubPage,"bladecx2", "Main Page");
}

if(document.drop_list.SubCat.value == 'Lama V4'){
addOption(document.drop_list.SubPage,"lamav4", "Main Page");
}
}
/////////////////////
function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

