function nullOptionsDMA(aMenu){
	var tot=aMenu.options.length
	for (i=0;i<tot;i++) {
		aMenu.options[i]=null
	}
	aMenu.options.length=0;
}


function MySubjectDMA0(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select All","");
options[1]=new Option("House","1");
options[2]=new Option("Apartment","2");
options[3]=new Option("Duplex","3");
options[4]=new Option("Site","5");
options[5]=new Option("All","");
options[5].selected=true
}
}


function MySubjectDMA1(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select All","");
options[1]=new Option("Office","1");
options[2]=new Option("Retail Unit","2");
options[3]=new Option("Industrial","4");
options[4]=new Option("Commercial Site","5");
options[5]=new Option("Agricultural Land","6");
options[6]=new Option("Restaurant / Bar","7");
options[7]=new Option("Industrial Site","8");
options[8]=new Option("Development Land","9");
options[9]=new Option("Investment Property","10");
options[10]=new Option("All","");
options[10].selected=true
}
}


function MySubjectDMA2(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select All","");
options[1]=new Option("House","2");
options[2]=new Option("Apartment","1");
options[3]=new Option("Studio","3");
options[4]=new Option("Flat","4");
options[5]=new Option("All","");
options[5].selected=true
}
}


function MySubjectDMA3(aMenu){
nullOptionsDMA(aMenu)
with (aMenu){
//Rewrites the text and values
options[0]=new Option("Select All","");
options[1]=new Option("House","1");
options[2]=new Option("Apartment","2");
options[3]=new Option("Duplex","3");
options[4]=new Option("Bungalow","4");
options[5]=new Option("All","");
options[5].selected=true
}
}


/* ####################### goDM() ####################### */

function goDMA(aMenu){
if (aMenu.options.value!="none")
{
location=aMenu.options[aMenu.selectedIndex].value
}

}

/* ####################### setUp ####################### */

function setUpPropertyForm(){
with (document.PropertySearch) {
if (search_type.selectedIndex==0){
search_type.options[0].selected=true
pt_id.options[0].selected=true
}

if (search_type.selectedIndex==1)
MySubjectDMA0(pt_id)
if (search_type.selectedIndex==2)
MySubjectDMA1(pt_id)
if (search_type.selectedIndex==3)
MySubjectDMA2(pt_id)
if (search_type.selectedIndex==4)
MySubjectDMA3(pt_id)

}
}

/* ####################### changeFiles ####################### */

function changeFilesDMA(){
aMenu=document.PropertySearch.search_type
aMenu2=document.PropertySearch.pt_id
with (aMenu){

switch (selectedIndex) {
case 0:
aMenu2.options.length=0;
aMenu2.options[0]=
new Option("Types","")
aMenu2.options[0].selected=true;
history.go(0)
break
case 1:
MySubjectDMA0(aMenu2)
aMenu2.options[0].text="Show All"
break
case 2:
MySubjectDMA1(aMenu2)
aMenu2.options[0].text="Show All"
break
case 3:
MySubjectDMA2(aMenu2)
aMenu2.options[0].text="Show All"
break
case 4:
MySubjectDMA3(aMenu2)
aMenu2.options[0].text="Show All"
break

}
}

}
