
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.form1.Category, "Engineering", "Faculty of Engineering", "");
addOption(document.form1.Category, "Management", "Faculty of Management", "");
addOption(document.form1.Category, "ArtsSciences", "Faculty of Arts & Sciences", "");
addOption(document.form1.Category, "Law", "Faculty of Law", "");
addOption(document.form1.Category, "Arts", "Faculty of Art, Design and Architecture", "");
addOption(document.form1.Category, "other", "Other", "");

}

function SelectSubCat(){
// ON selection of category this function will work


addOption(document.form1.SubCat, "0", "Select Department", "");

if(document.form1.Category.value == 'Engineering'){
		document.form1.SubCat.disabled = false;
addOption(document.form1.SubCat,"Department of Civil Engineering", "Department of Civil Engineering");
addOption(document.form1.SubCat,"Department of Computer Engineering", "Department of Computer Engineering");
addOption(document.form1.SubCat,"Department of Electrical & Electronics Engineering", "Department of Electrical & Electronics Engineering");
addOption(document.form1.SubCat,"Department of Industrial Engineering", "Department of Industrial Engineering");
addOption(document.form1.SubCat,"Department of Mechatronics Engineering", "Department of Mechatronics Engineering");
addOption(document.form1.SubCat,"Department of Manufacturing Engineering", "Department of Manufacturing Engineering");
addOption(document.form1.SubCat,"Department of Materials Engineering", "Department of Materials Engineering");
addOption(document.form1.SubCat,"Department of Software Engineering", "Department of Software Engineering");
addOption(document.form1.SubCat,"Department of Information Systems Engineering ", "Department of Information Systems Engineering ");
}

if(document.form1.Category.value == 'Management'){
		document.form1.SubCat.disabled = false;
addOption(document.form1.SubCat,"Department of Management", "Department of Management");
addOption(document.form1.SubCat,"Department of Economics", "Department of Economics");
addOption(document.form1.SubCat,"Department of Public Relations", "Department of Public Relations");
addOption(document.form1.SubCat,"Department of International Relations", "Department of International Relations");
addOption(document.form1.SubCat,"Department of Tourism Management", "Department of Tourism Management");
addOption(document.form1.SubCat,"Department of Managament in Turkish Medium", "Department of Managament in Turkish Medium");
}
if(document.form1.Category.value == 'ArtsSciences'){
		document.form1.SubCat.disabled = false;
addOption(document.form1.SubCat,"Department of Mathematics", "Department of Mathematics");
addOption(document.form1.SubCat,"Department of English Language and Literature", "Department of English Language and Literature");
addOption(document.form1.SubCat,"Department of Translation and Interpretation", "Department of Translation and Interpretation");
addOption(document.form1.SubCat,"Department of Psychology", "Department of Psychology");
}

if(document.form1.Category.value == 'Law'){
		document.form1.SubCat.disabled = false;
	document.form1.SubCat.remove(0);
addOption(document.form1.SubCat,"Law", "Law");
}

if(document.form1.Category.value == 'Arts'){
	document.form1.SubCat.disabled = false;
addOption(document.form1.SubCat,"Department of Graphic Design", "Department of Graphic Design");
addOption(document.form1.SubCat,"Department of Interior Architecture and Environmental Design", "Department of Interior Architecture and Environmental Design");
addOption(document.form1.SubCat,"Department of Fashion & Textile Design", "Department of Fashion & Textile Design");
}
if(document.form1.Category.value == 'other'){
	document.form1.SubCat.disabled = true;
addOption(document.form1.SubCat,"1", "Law");
}
}
////////////////// 

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);
}
