// JavaScript Document
var xmlHttp
var divRef
var states = new Array();

function stateDiv(divref, diva){
	if(states[divref]){
		if(states[divref]=='none'){
			state = 'block';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="property_listings.php?action=search&table=residential_property" class="userlink">Residential Property</a> | <a href="property_listings.php?action=search&table=commercial_property" class="userlink">Commercial Property</a> |';
		}
		if(states[divref]=='block'){
			state = 'none';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Show Map</a> | <a href="property_listings.php?action=search&table=residential_property" class="userlink">Residential Property</a> | <a href="property_listings.php?action=search&table=commercial_property" class="userlink">Commercial Property</a> |';
		}
	}else{
		state = 'block';
		astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="property_listings.php?action=search&table=residential_property" class="userlink">Residential Property</a> | <a href="property_listings.php?action=search&table=commercial_property" class="userlink">Commercial Property</a> |';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + divref + ".style.display = state");
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[divref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(divref); 
		hza.style.display = state;
	}
	document.getElementById(diva).innerHTML = astate;
	states[divref] = state;
	
}

function stateDiv2(divref, diva){
	if(states[divref]){
		if(states[divref]=='none'){
			state = 'block';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="buyer_listings.php?action=search&table=buyers_residential_property" class="userlink">Residential Buyers</a> | <a href="buyer_listings.php?action=search&table=buyers_commercial_property" class="userlink">Commercial Buyers</a> |';
		}
		if(states[divref]=='block'){
			state = 'none';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Show Map</a> | <a href="buyer_listings.php?action=search&table=buyers_residential_property" class="userlink">Residential Buyers</a> | <a href="buyer_listings.php?action=search&table=buyers_commercial_property" class="userlink">Commercial Buyers</a> |';
		}
	}else{
		state = 'block';
		astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="buyer_listings.php?action=search&table=buyers_residential_property" class="userlink">Residential Buyers</a> | <a href="buyer_listings.php?action=search&table=buyers_commercial_property" class="userlink">Commercial Buyers</a> |';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + divref + ".style.display = state");
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[divref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(divref); 
		hza.style.display = state;
	}
	document.getElementById(diva).innerHTML = astate;
	states[divref] = state;
	
}

function stateDiv4(divref, diva){
	if(states[divref]){
		if(states[divref]=='none'){
			state = 'block';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv4(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="directory.php?dirSection=Algarve%20Info&action=search" class="userlink">Algarve Info</a> | <a href="directory.php?dirSection=Services&action=search" class="userlink">Algarve Services</a> |';
		}
		if(states[divref]=='block'){
			state = 'none';
			astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv4(\'mapdiv\', \'diva\');" class="userlink">Show Map</a> | <a href="directory.php?dirSection=Algarve%20Info&action=search" class="userlink">Algarve Info</a> | <a href="directory.php?dirSection=Services&action=search" class="userlink">Algarve Services</a> |';
		}
	}else{
		state = 'block';
		astate = '| <a href="javascript:void(0);" onclick="javascript:stateDiv4(\'mapdiv\', \'diva\');" class="userlink">Hide Map</a> | <a href="directory.php?dirSection=Algarve%20Info&action=search" class="userlink">Algarve Info</a> | <a href="directory.php?dirSection=Services&action=search" class="userlink">Algarve Services</a> |';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + divref + ".style.display = state");
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[divref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(divref); 
		hza.style.display = state;
	}
	document.getElementById(diva).innerHTML = astate;
	states[divref] = state;
	
}

function stateDiv3(divref){
	if(states[divref]){
		if(states[divref]=='none'){
			state = 'block';
		}
		if(states[divref]=='block'){
			state = 'none';
		}
	}else{
		state = 'block';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + divref + ".style.display = state");
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[divref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(divref); 
		hza.style.display = state;
	}
	states[divref] = state;
	
}