function fillCategory(){ 
		// this function is used to fill the category list on load
		
		addOption(document.form1.Category, "wedding", "wedding", "");
		
		addOption(document.form1.Category, "Teen Event", "Teen Event", "");
		
		addOption(document.form1.Category, "Corporate Event", "Corporate Event", "");
		
		addOption(document.form1.Category, "Holiday Party", "Holiday Party", "");
		
		addOption(document.form1.Category, "Social event", "Social event", "");
}

function SelectSubCat(){
// ON selection of category this function will work
removeAllOptions(document.form1.SubCat);
addOption(document.form1.SubCat, "", "SubCat", "");

if(document.form1.Category.value == 'Teen Event'){

if(document.getElementById('SubCat').value == "Others"){

 document.getElementById('others').style.display = 'block';

}else{

 document.getElementById('others').style.display = 'none';

}

document.getElementById('SubCat').style.display = 'block';

addOption(document.form1.SubCat,"Mitzvah", "Mitzvah");

addOption(document.form1.SubCat,"Quincenerra", "Quincenerra");

addOption(document.form1.SubCat,"Sweet 16", "Sweet 16");

addOption(document.form1.SubCat,"Others", "Others", "");

}

if(document.form1.Category.value == 'Corporate Event'){

document.getElementById('SubCat').style.display = 'block';

document.getElementById('others').style.display = 'none';

addOption(document.form1.SubCat,"Tradeshow Party", "Tradeshow Party");

addOption(document.form1.SubCat,"Open House", "Open House");

addOption(document.form1.SubCat,"Product Launch", "Product Launch", "");

addOption(document.form1.SubCat,"Incentive Program", "Incentive Program", "");

addOption(document.form1.SubCat,"Conference Event", "Conference Event", "");

addOption(document.form1.SubCat,"holiday party", "holiday party", "");

addOption(document.form1.SubCat,"Others", "Others", "");



}

if(document.form1.Category.value == 'Holiday Party'){

document.getElementById('SubCat').style.display = 'block';

document.getElementById('others').style.display = 'none';

addOption(document.form1.SubCat,"Corporate", "Corporate");

addOption(document.form1.SubCat,"Social", "Social");

addOption(document.form1.SubCat,"Others", "Others");

}



if(document.form1.Category.value == 'Social event'){

document.getElementById('SubCat').style.display = 'block';

document.getElementById('others').style.display = 'none';

addOption(document.form1.SubCat,"Birthday", "Birthday");

addOption(document.form1.SubCat,"Anniversary", "Anniversary");

addOption(document.form1.SubCat,"retirement", "retirement");

addOption(document.form1.SubCat,"Others", "Others");

}



if(document.form1.Category.value == 'wedding'){

document.getElementById('SubCat').style.display = 'none';



}





}

////////////////// 



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);

}







