var cat, Gr, Col

function initVar() {
	G = new Array(2);
	// Melamine Group
	G[1] = new Array("All~0","Tableware~1","Childrenware~2","Tray Set~3","Cutlery & Utensils~4","Toiletware~5","Airline Inflight Service~6","Ashtray~7","Catering & Institutions~8","Japanese Tableware~9","Made-to-Order~10","Gift Set~11");
	// Plastic Group
	G[2] = new Array("All~0","O.E.M Part~1","Car Battery~2","Beverage Crate~3","Plastic Pail~4","Furniture~5","Pallet~6","Helmet~7","Garbage Bin~8","Container Crate~9","Houseware & Premium~10");
	 
	C = new Array() ;
	// Collection in Melamine Group
	C[1] = new Array() ;
	// Default Melamine Search
	C[1][0] = new Array("All~1");
	// Table ware Collection
	C[1][1] = new Array("All~10199","Orchard Fruit~10101","Country Rose~10102","Fruit Symphony~10103","Herbal~10104","Rose Screen~10105","Garden Hill~10106","Montana~10107","Rainbow~10108","Rosary~10109","Summer Orchard~10110","Flowery Hill~10111","Fiona~10112","Jennifer~10113","Laura~10114","Birmingham~10115","Delight~10116","Autumn~10117","Fruity~10118","Impress~10119","Spring Field~10120","Sweetie~10121","Country Pear~10122","Morina~10123","Pink Rose~10124","Dynasty~10125","Fruity Regge~10126","Glory Love~10127","Golden Blue~10128","Harmony~10129","Lily~10130","Peach Marble~10131","Royal Opera~10132","Victoria~10133","Arena~10135","Rosana~10136","Rose Marry~10137","Princess~10138","Romance~10139","Sarah~10140","Sylvia~10141","Sweet Summer~10142","Fancy Leaf~10143","Blue Sky~10144","All Seasons~10145","Pink Garden~10146") ;
	C[1][1].sort();
	// Childrenware Collection
	C[1][2] = new Array("All~10299","Digimon~10201","Disney~10202","Looney Tunes~10203","Pooh~10204") ;
	// Tray Set Collection
	C[1][3] = new Array("All~10399","Set 1~10301","Set 2~10302","Set 3~10303","Set 4~10304","Set 5~10305","Set 6~10306","Set 7~10307","Set 8~10308","Set 9~10309","Set 10~10310","Set 11~10311","Set 12~10312") ;
	// Cutlery & Utensils Collection
	C[1][4] = new Array("All~10499","Set 1~10401","Set 2~10402","Set 3~10403") ;
	// Toiletware Collection
	C[1][5] = new Array("All~10599","Toilet Seat~10501","Toilet ware~10502") ;
	// Airline Inflight Service Collection
	C[1][6] = new Array("All~10699","Set 1~10601","Set 2~10602","Set 3~10603","Set 4~10604","Set 5~10605") ;
	// Ashtray Collection
	C[1][7] = new Array("Ashtray~10701") ;
	// Catering & Institutions Collection
	C[1][8] = new Array("All~10899","Set 1~10801","Set 2~10802","Set 3~10803","Set 4~10804","Set 5~10805","Set 6~10806","Set 7~10807","Set 8~10808","Set 9~10809","Set 10~10810","Set 11~10811","Set 12~10812","Set 13~10813","Set 14~10814","Set 15~10815","Set 16~10816","Set 17~10817") ;
	// Japanese Tableware Collection
	C[1][9] = new Array("All~10999","Kantoh~10901","Haruna~10902","Kamon~10903","Kikuamime~10904","Manju~10905","Midori~10906","Nanten~10907","Nichiki~10908") ;
	// Made-to-Order Collection
	C[1][10] = new Array("All~11099","Cartoon~11001","Coke~11002") ;
	// Gift Set Collection
	C[1][11] = new Array("All~11199","Set 1~11101","Set 2~11102","Set 3~11103","Set 4~11104","Set 5~11105","Set 6~11106","Set 7~11107","Set 8~11108","Set 9~11109","Set 10~11110","Set 11~11111","Set 12~11112","Set 13~11113","Set 14~11114","Set 15~11115","Set 16~11116","Set 17~11117","Set 18~11118","Set 19~11119","Set 20~11120") ;
	//C[1][11].sort();

	// Collection in Plastic Group
	C[2] = new Array();
	// Default Plastic Search
	C[2][0] = new Array("All~2");
	// O.E.M Part Collection
	C[2][1] = new Array("All~20199","Electrical Home & Appliance Part~20101","Automotive Part~20102") ;
	// Car Battery Collection
	C[2][2] = new Array("All~20299","Battery Accessories 1~20201","Battery Accessories 2~20202","DIN Standard Model~20203","Motorcycle Battery~20205","JIS Standard Model (N 50)~20206","JIS Standard Model (N 60)~20207","JIS Standard Model (N 70)~20208") ;
	// Beverage CreteCollection
	C[2][3] = new Array("All~20399","Half Depth Crate~20301","Full Depth Crate~20302") ;
	// Plastic Pail Collection
	C[2][4] = new Array("All~20499","20 Litr Pail with or without Spout ~20401","5 US Gallun Pail~20402","10,5 Kgs Pail ~20403","2 Kgs Pail  ~20404","1 US Gallun Pail ~20405") ;
	// Furniture Collection
	C[2][5] = new Array("Furniture~20501") ;
	// Pallet Collection
	C[2][6] = new Array("All~20699","Pallet TP-1~20601","Pallet TP-2~20602","Pallet TP-3~20603","Pallet TP-4~20604","Pallet TP-6/1~20605","Pallet TP-7~20606","Pallet TP-8~20607","Pallet TP-9~20608","Pallet TP-10~20609","Pallet TP-12~20610") ;
	// Helmet Collection
	C[2][7] = new Array("All~20799","PN 883~20701","PN 555~20702","PN 600~20703") ;
	// Garbage Bin Collection
	C[2][8] = new Array("All~20899","MGB 80 Litre~20801","MGB 120 Litre~20802","MGB 240 Litre~20803","MGB 660 Litre~20804") ;
	// Container Crate Collection
	C[2][9] = new Array("All~20999","Fish Crate~20901","Container 1~20902","Container 2~20903","Spare Part Box~20904") ;
	// Houseware & Premium Collection
	C[2][10] = new Array("All~21099","Picnic~21001","Organizer~21004","Laundry~21002","Drinking~21003","Accessories~21005") ;
	
	cat = document.Fsearch.cat ;
	Gr = document.Fsearch.Gr ;
	Col = document.Fsearch.Col ;
	cat.options[0].selected = true ;
}

function initVal() {
	Cat(1) ;
	Groups(0) ;
}
function Cat(x) {
	Gr.options.length = G[x].length  ;
	for( i=0; i<G[x].length ; i++ ){
		var a = G[x][i].split("~") ;
		Gr.options[i].value = a[1] ;
		Gr.options[i].text = a[0] ;
	}
	Gr.options[0].selected = true ;
}
function Groups(x) {
	b = cat.value ;
	Col.options.length = C[b][x].length  ;
	for( i=0; i<C[b][x].length ; i++ ){
		var a = C[b][x][i].split("~") ;
		Col.options[i].value = a[1] ;
		Col.options[i].text = a[0] ;
	}
	Col.options[0].selected = true ;
	Col.size = Col.options.length>10?5:1;
}
function Fur(x){
	url = "furniture.html";
	a = window.open(url,"ProductSearch"+x+"","toolbar=0,directories=no, scrollbars=0 width=450 height=357 status=0,resizable=0") ;
	a.moveTo(100,50);
}
function DefOpen(nCat,nGr,nCol){
	url = "show.php?cat="+nCat+"&Gr="+nGr+"&Col="+nCol+"" ;
	a = window.open(url,"ProductSearch"+nCol+"","toolbar=0,directories=no, scrollbars=0 width=300 height=300 status=0,resizable=0") ;
	a.moveTo(100,50);
}
function Psearch(){
	aCat = cat.options[cat.selectedIndex].value ;
	aGr = Gr.options[Gr.selectedIndex].value ;
	aCol = Col.options[Col.selectedIndex].value ;
	//window.alert("cat:"+aCat+"--Group:"+aGr+"--Collection:"+aCol);
	switch(aCol){
		case "1" : window.location.replace("prodmela.html"); break;
		case "2" : window.location.replace("prodplas.html"); break;
		case "10199" : window.location.replace("pm_tw1.html"); break;
		case "10299" : window.location.replace("pm_cw1.html"); break;
		case "10399" : window.location.replace("pm_tray1.html"); break;
		case "10499" : window.location.replace("pm_cut1.html"); break;
		case "10599" : window.location.replace("pm_toi1.html"); break;
		case "10699" : window.location.replace("pm_air1.html"); break;
		case "10899" : window.location.replace("pm_cat1.html"); break;
		case "10999" : window.location.replace("pm_jp1.html"); break;
		case "11099" : window.location.replace("pm_made1.html"); break;
		case "11199" : window.location.replace("pm_gs1.html"); break;
		case "20199" : window.location.replace("pl_eng1.html"); break;
		case "20299" : window.location.replace("pl_bat1.html"); break;
		case "20399" : window.location.replace("pl_bev1.html"); break;
		case "20499" : window.location.replace("pl_pail1.html"); break;
		case "20501" : Fur(aCol); break;
		case "20699" : window.location.replace("pl_pal1.html"); break;
		case "20799" : window.location.replace("pl_hel1.html"); break;
		case "20899" : window.location.replace("pl_gar1.html"); break;
		case "20999" : window.location.replace("pl_con1.html"); break;
		case "21099" : window.location.replace("pl_pre1.html"); break;
		default : DefOpen(aCat,aGr,aCol); 
	}
}
