function loadboxN(){
	
var IntPath = document.getElementById('city1');
var TheOptions = IntPath.options.length;

document.getElementById('city1').options.length = 0;

var TheSelected = document.getElementById('city2');
var arySelected = new Array();
for (var i = 0; i < TheSelected.length; i++) {  
arySelected[TheSelected.options[i].value] = TheSelected.options[i].text;
}
var arySourceOptions = new Array();	
arySourceOptions['ANA'] = 'Anaheim'
arySourceOptions['AH'] = 'Anaheim Hills'
arySourceOptions['BREA'] = 'Brea'
arySourceOptions['BP'] = "Buena Park"
arySourceOptions['FUL'] = "Fullerton"
arySourceOptions['LH'] = "La Habra"
arySourceOptions['LP'] = "La Palma"
arySourceOptions['LONG'] = 'Long Beach'
arySourceOptions['ORG'] = "Orange"
arySourceOptions['PLA'] = "Placentia"
arySourceOptions['VP'] = "Villa Park"
arySourceOptions['YL'] = "Yorba Linda"
    for ( testKey in arySourceOptions)
    {
    	if (arySelected[testKey] != arySourceOptions[testKey])
    	{  
    	IntPath.options[IntPath.options.length] = new Option(arySourceOptions[testKey],testKey);
    	}
    }

}


function loadboxC(){
var IntPath = document.getElementById('city1');
var TheOptions = IntPath.options.length;
document.getElementById('city1').options.length = 0;
var TheSelected = document.getElementById('city2');
var arySelected = new Array();
for (var i = 0; i < TheSelected.length; i++) {  
arySelected[TheSelected.options[i].value] = TheSelected.options[i].text;
}
var arySourceOptions = new Array();
arySourceOptions['BP'] = "Buena Park"	
arySourceOptions['CM']='Costa Mesa';
arySourceOptions['CYP']='Cypress';
arySourceOptions['FV']='Fountain Valley';
arySourceOptions['GG']='Garden Grove';
arySourceOptions['HB']='Huntington Beach';
arySourceOptions['IR']='Irvine';
arySourceOptions['LOSA']='Los Alamitos';
arySourceOptions['NB']='Newport Beach';
arySourceOptions['NC']='Newport Coast';
arySourceOptions['SA']='Santa Ana';
arySourceOptions['SLB']='Seal Beach';
arySourceOptions['STAN']='Stanton';
arySourceOptions['TUS']='Tustin';
arySourceOptions['WTM']='Westminster';
    for ( testKey in arySourceOptions)
    {
    	if (arySelected[testKey] != arySourceOptions[testKey])
    	{  
    	IntPath.options[IntPath.options.length] = new Option(arySourceOptions[testKey],testKey);
    	}
    }


}

function loadboxS(){
var IntPath = document.getElementById('city1');
var TheOptions = IntPath.options.length;
document.getElementById('city1').options.length = 0;
IntPath.options[IntPath.options.length] = new Option('Aliso Viejo','AV');
IntPath.options[IntPath.options.length] = new Option('Coto De Caza','CDC');
IntPath.options[IntPath.options.length] = new Option('Canyon Areas','CA');
IntPath.options[IntPath.options.length] = new Option('Dana Point','DP');
IntPath.options[IntPath.options.length] = new Option('Foothill Ranch','FH'); //s
IntPath.options[IntPath.options.length] = new Option('Ladera Ranch','LD'); //s
IntPath.options[IntPath.options.length] = new Option('Laguna Beach','LB');
IntPath.options[IntPath.options.length] = new Option('Laguna Hills','LAGH');
IntPath.options[IntPath.options.length] = new Option('Laguna Niguel','LN');
IntPath.options[IntPath.options.length] = new Option('Lake Forest','LF');
IntPath.options[IntPath.options.length] = new Option('Mission Viejo','MV');
IntPath.options[IntPath.options.length] = new Option('Portola Hills','PH'); //s
IntPath.options[IntPath.options.length] = new Option('Rancho Santa Marg','RSM');
IntPath.options[IntPath.options.length] = new Option('San Clemente','SC');
IntPath.options[IntPath.options.length] = new Option('San Juan Capistrano','SJ');

}

function loadboxR(){

var IntPath = document.getElementById('city1');
var TheOptions = IntPath.options.length;
document.getElementById('city1').options.length = 0;

var TheSelected = document.getElementById('city2');
var arySelected = new Array();

for (var i = 0; i < TheSelected.length; i++) {  
arySelected[TheSelected.options[i].value] = TheSelected.options[i].text;
}

var arySourceOptions = new Array();	
arySourceOptions["BD"] = "Bermuda Dunes";
arySourceOptions['CC']='Cathedral City';
arySourceOptions['COR']='Corona';
arySourceOptions['LQ']='La Quinta';
arySourceOptions['NORC']='Norco';
arySourceOptions['PDST']='Palm Desert';
arySourceOptions['PSPR']='Palm Springs';
arySourceOptions['RM']='Rancho Mirage';
arySourceOptions['RVSD']='Riverside';

    for ( testKey in arySourceOptions)
    {
    	if (arySelected[testKey] != arySourceOptions[testKey])
    	{  
    	IntPath.options[IntPath.options.length] = new Option(arySourceOptions[testKey],testKey);
    	}
    }

}


function Togglediv(divName) { 
	with (document.getElementById(divName).style) {
		if (display == "block"){
			display = "none"
			document.getElementById('advsearch').innerHTML = "[Advanced Search]";
		}
		else {
			display = "block";
			document.getElementById('advsearch').innerHTML = "[Basic Search]"
		}
	}
}
function showdiv(divName) { 
	with (document.getElementById(divName).style) {
		
			display = "block";
		
	}
	document.getElementById('bedrooms').disabled = false;
	document.getElementById('bathrooms').disabled = false;
	document.getElementById('squarefeet').disabled = false;
	document.getElementById('PROPSFR').checked = true;
}

function hidediv(divName,theID) {
	document.getElementById('PROPCONDO').checked = false;
	document.getElementById('PROPLOFT').checked = false;
	document.getElementById('PROPCOOP').checked = false;
	document.getElementById('PROPSFR').checked = false;
	document.getElementById('bedrooms').disabled = document.getElementById(theID).checked;
	document.getElementById('bathrooms').disabled = document.getElementById(theID).checked;
	with (document.getElementById(divName).style) {
	display = "none";
	}
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}

function register(mlsnum,type){
var cookie = getCookie('registered');
if (cookie == '' || cookie == null){	
document.location="register.php?mid="+mlsnum+"&proptype="+type+"";
}else{
document.location="mls-details-"+type+"-"+mlsnum+".php";

}
}


