
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.drop_list.Category, "الطيران وشركات الطيران", "الطيران وشركات الطيران", "");
addOption(document.drop_list.Category, "السيارات", "السيارات", "");
addOption(document.drop_list.Category, "الهندسة المدنية والكهروميكانيكية", "الهندسة المدنية والكهروميكانيكية", "");
addOption(document.drop_list.Category, "الاتصالات", "الاتصالات", "");
addOption(document.drop_list.Category, "الاستثمار", "الاستثمار", "");
addOption(document.drop_list.Category, "التجارة الخارجية والمقاولات", "التجارة الخارجية والمقاولات", "");
addOption(document.drop_list.Category, "القطاع الصناعى", "القطاع الصناعى", "");
addOption(document.drop_list.Category, "النفط والغاز", "النفط والغاز", "");
addOption(document.drop_list.Category, "الشحن", "الشحن", "");
addOption(document.drop_list.Category, "الفنادق والسياحة", "الفنادق والسياحة", "");
addOption(document.drop_list.Category, "التجارة الخارجية والمقاولات", "التجارة الخارجية والمقاولات", "");
}

function SelectSubCat(){
// ON selection of category this function will work
removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "من فضلك اختر الشركة ...", "");

if(document.drop_list.Category.value == 'الطيران وشركات الطيران'){
addOption(document.drop_list.SubCat,"aviation-gainjet.html", "غاين جت");
addOption(document.drop_list.SubCat,"aviation-kial.html", "Kuwait International Aircraft Leasing Company");
}
if(document.drop_list.Category.value == 'السيارات'){
addOption(document.drop_list.SubCat,"automotive-fasac.html", "شركة فؤاد الغانم وأولاده للسيارات ذ.م.م");
}
if(document.drop_list.Category.value == 'الهندسة المدنية والكهروميكانيكية'){
addOption(document.drop_list.SubCat,"construction-aigtcc.html", "شركة الغانم إنترناشيونال للتجارة العامة والمقاولات ذ.م.م");
addOption(document.drop_list.SubCat,"construction-rrec.html", "شركة الرضاب العقارية");
}
if(document.drop_list.Category.value == 'الاتصالات'){
addOption(document.drop_list.SubCat,"communication-knetco.html", "شركة الشبكة الكويتية للتقنية الإلكترونية");
addOption(document.drop_list.SubCat,"communication-gulf.html", "شركة أنظمة تكنولوجيا الخليج الإلكترونية");
addOption(document.drop_list.SubCat,"communication-gce.html", "شركة اتصالات الخليج الإلكترونية ذ.م.م.");
}
if(document.drop_list.Category.value == 'الاستثمار'){
addOption(document.drop_list.SubCat,"investment-fmtasgtcc.html", "شركة فؤاد الغانم وأولاده للتجارة العامة والمقاولات ذ.م.م");
}
if(document.drop_list.Category.value == 'التجارة الخارجية والمقاولات'){
addOption(document.drop_list.SubCat,"international-jet.html", "تحالف الطائرات");
addOption(document.drop_list.SubCat,"international-tube.html", "Compri Tube");
}
if(document.drop_list.Category.value == 'الصنـــاعــى'){
addOption(document.drop_list.SubCat,"industrial-mmc.html", "شركة المساحة المشتركة");
addOption(document.drop_list.SubCat,"industrial-uamco.html", "الشركة المتحدة لأعمال الألمنيوم وطلاء المعادن ذ.م.م");
addOption(document.drop_list.SubCat,"industrial-gi.html", "الغانم للصناعات");
addOption(document.drop_list.SubCat,"industrial-gt.html", "Al Ghanim Trimex");
}
if(document.drop_list.Category.value == 'النفط والغاز'){
addOption(document.drop_list.SubCat,"oil-eippc.html", "شركة الطاقة الدولية للمشاريع البترولية");
addOption(document.drop_list.SubCat,"oil-fk.html", "Fluor Kuwait");
}
if(document.drop_list.Category.value == 'الشحن'){
addOption(document.drop_list.SubCat,"shipping-agst.html", "مجموعة الغانم للملاحة والنقل ذ.م.م");
}
if(document.drop_list.Category.value == 'الفنادق والسياحة'){
addOption(document.drop_list.SubCat,"tourism-kch.html", "فندق انتركونتيننتال الكويت");
addOption(document.drop_list.SubCat,"tourism-sak.html", "سما الكويت");
}
if(document.drop_list.Category.value == 'التجارة الخارجية والمقاولات'){
addOption(document.drop_list.SubCat,"trading-rgtcc.html", "شركة رهام للتجارة العامة والمقاولات ذ.م.م");
addOption(document.drop_list.SubCat,"trading-git.html", "شركة الصناعات التكنولوجية الخليجية");
addOption(document.drop_list.SubCat,"trading-fmtas.html", "مؤسسة فؤاد الغانم ذ.م.م");
}

}
////////////////// 

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);
}

