
function fillCategory(){ 
 // this function is used to fill the category list on load
addOption(document.form.fencetypex, "Please select", "Please select", "");
addOption(document.form.fencetypex, "Semi Frameless Fencing", "Semi Frameless Fencing", "");
addOption(document.form.fencetypex, "Frameless Fencing", "Frameless Fencing", "");

}

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

removeAllOptions(document.form.posttypex);

	if(document.form.fencetypex.value == "Semi Frameless Fencing"){
		addOption(document.form.posttypex,"Round Aluminium Posts", "Round Aluminium Posts");
		addOption(document.form.posttypex,"Square Aluminium Posts", "Square Aluminium Posts");
		addOption(document.form.posttypex,"Round Stainless Steel Posts", "Round Stainless Steel Posts");
	}
	if(document.form.fencetypex.value == "Frameless Fencing"){
		addOption(document.form.posttypex,"", "No Selection Available");
	}
}
////////////////// 

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

