// JavaScript Document
function listboxItemSelected(oList1,oList2)
{
	id="";
	if (oList2!=null){
	clearComboOrList(oList2);
	if (oList1.selectedIndex == -1){
	oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
	} else {
	//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
	fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
	//alert(getvalue(oList1,k));
	}
	}
}
function listboxItemSelected11(oList1,oList2)
{
	 
	
	//alert(oList1.selectedIndex);
	if(oList1.selectedIndex == 1)
	 {
		//alert("hai");
		document.getElementById('Apartment').style.display='';
		 document.getElementById('Individual').style.display='none';
		document.getElementById('Retail').style.display='none';
		document.getElementById('Office').style.display='none';
		document.getElementById('Land').style.display='none';
		
	 }
	 else if(oList1.selectedIndex == 2)
	 {
		document.getElementById('Apartment').style.display='none';
		 document.getElementById('Individual').style.display='';
		document.getElementById('Retail').style.display='none';
		document.getElementById('Office').style.display='none';
		document.getElementById('Land').style.display='none';
	 }
	else if(oList1.selectedIndex == 3)
	 {
document.getElementById('Apartment').style.display='none';
		 document.getElementById('Individual').style.display='none';
		document.getElementById('Retail').style.display='';
		document.getElementById('Office').style.display='none';
		document.getElementById('Land').style.display='none';	 }
	else if(oList1.selectedIndex == 4)
	 {
		document.getElementById('Apartment').style.display='none';
		 document.getElementById('Individual').style.display='none';
		document.getElementById('Retail').style.display='none';
		document.getElementById('Office').style.display='';
		document.getElementById('Land').style.display='none';
	 }
	else if(oList1.selectedIndex == 5)
	 {
		document.getElementById('Apartment').style.display='none';
		 document.getElementById('Individual').style.display='none';
		document.getElementById('Retail').style.display='none';
		document.getElementById('Office').style.display='none';
		document.getElementById('Land').style.display='';
	 }
	id="";
	if (oList2!=null){
	clearComboOrList(oList2);
	if (oList1.selectedIndex == -1){
	oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
	} else {
	//alert(oList1.name + '=' + oList1.options[oList1.selectedIndex].value)
	fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
	//alert(getvalue(oList1,k));
	}
	}
}
function clearComboOrList(oList)
{
	for (var i = oList.options.length - 1; i >= 0; i--)
	{
		oList.options[i] = null;
	}
	oList.selectedIndex = -1;
	if (oList.onchange)	
		oList.onchange();
}
	
function fillListbox(oList, vValue)
{
	if (vValue != '') {
	if (assocArray[vValue]){
	var arrX = assocArray[vValue];
	for (var i = 0; i < arrX.length; i = i + 2){
	if (arrX[i] != 'EOF') 
	{
			s1=arrX[i + 1];
		oList.options[oList.options.length] = new Option(s1.replace("&#39","'"), arrX[i]);
	}
	}
	//alert (oList.options.length)
	if (oList.options.length == 1){
	//oList.selectedIndex=0;
	if (oList.onchange)	oList.onchange();
	}
	} else {
			
			oList.options[0] = new Option('', '');
	}
	}
}