function addOption(selectbox,text,value,selectedValue)
{
	
	
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	
	if(text==selectedValue){
		optn.selected = true;
	}
	
	selectbox.options.add(optn);
	
	//selectbox
}

function removaAll(){
	var selectbox = document.getElementById('subtype');
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		selectbox.remove(i);
	}
}
var resdentail = new Array("Apartment","Bunglow","Duplex","Tenement","Land","Plot");
var commercial = new Array("Land","Showroom","Hotel","Agricultural","Warehouse/Godown","Office","Complex");

function addResidentailOption_list(selectedValue){
	removaAll();
	addOption(document.getElementById('subtype'),'Any', 'Any',selectedValue);
	for (var i=0; i < resdentail.length;++i){
			addOption(document.getElementById('subtype'),resdentail[i], resdentail[i],selectedValue);
	}
}

function addCommercialOption_list(selectedValue){
	removaAll();
	addOption(document.getElementById('subtype'),'Any', 'Any',selectedValue);
	for (var i=0; i <commercial.length;++i){
			addOption(document.getElementById('subtype'),commercial[i], commercial[i],selectedValue);
	}
}

function addAllOption_list(selectedValue){
	//alert(selectedValue);
	removaAll();
	addOption(document.getElementById('subtype'),'Any', 'Any',selectedValue);
	for (var i=0; i < resdentail.length;++i){
		addOption(document.getElementById('subtype'),resdentail[i], resdentail[i],selectedValue);
	}
	for (var i=0; i <commercial.length;++i){
		addOption(document.getElementById('subtype'),commercial[i], commercial[i],selectedValue);
	}
}


function addAllOption_list_withoutAny(selectedValue){
	//alert(selectedValue);
	removaAll();
	for (var i=0; i < resdentail.length;++i){
		addOption(document.getElementById('subtype'),resdentail[i], resdentail[i],selectedValue);
	}
	for (var i=0; i <commercial.length;++i){
		addOption(document.getElementById('subtype'),commercial[i], commercial[i],selectedValue);
	}
}

