
function getLocations(State) {
 
    var asValues = new Array();
    var count=0;
    for (var i = 0; i < State.length; i++) {
        if (State.options[i].selected) {
            asValues[asValues.length] = State.options[i].value;
        }
    }
	 
	 for(i=document.search.Location.length-1; i>=0; i--)
    {
        document.search.Location.options[i] = null;
    }
  
var LocationList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
case 'CT':
  LocationList[0] = new Array("Evergreen Woods", "29");
  break;
case 'FL':
  LocationList[0] = new Array("Barkley Place", "22");
  break;
case 'MA':
  LocationList[0] = new Array("Brightview Concord River", "36");
  LocationList[1] = new Array("Brightview Danvers", "27");
  LocationList[2] = new Array("Brightview N. Andover", "44");  
  LocationList[3] = new Array("Country Club Heights", "26");
  LocationList[4] = new Array("New Pond Village", "33");
  
  
  break;
case 'MD':
  LocationList[0] = new Array("Baltimore Home Office", "5");
  LocationList[1] = new Array("Brightview Avondell", "20");
  LocationList[2] = new Array("Brightview Bel Air", "23");
  LocationList[3] = new Array("Brightview Catonsville", "25");
  LocationList[4] = new Array("Brightview Mays Chapel Ridge", "31");
  LocationList[5] = new Array("Brightview South River", "41");
  LocationList[6] = new Array("Brightview Towson","42");
  LocationList[7] = new Array("Brightview Westminster Ridge", "34"); 
  LocationList[8] = new Array("Brightview White Marsh", "35"); 
	LocationList[9] = new Array("Brightview Rockville", "43"); 
  break;
case 'MO':
  LocationList[0] = new Array("The Montclair", "32");
  break;
case 'NJ':
  LocationList[0] = new Array("Brightview Mount Laurel", "37");
  LocationList[1] = new Array("Brightview Greentree", "39");
  LocationList[2] = new Array("Brightview Woodbury Lake", "38");  
  break;
case 'PA':
  LocationList[0] = new Array("Brightview East Norriton", "28");
  LocationList[1] = new Array("The Manor at York Town", "30");
  break;
case 'RI':
  LocationList[0] = new Array("Brightview Commons", "24");
  break;
case 'VA':
  LocationList[0] = new Array("Brightview Baldwin Park", "21");
  break;
default:
  LocationList[0] = new Array("All", "");
  LocationList[1] = new Array("Barkley Place", "22");
  LocationList[2] = new Array("Brightview Avondell", "20");
  LocationList[3] = new Array("Brightview Baldwin Park", "21");
  LocationList[4] = new Array("Brightview Bel Air", "23");
  LocationList[5] = new Array("Brightview Catonsville", "25");
  LocationList[6] = new Array("Brightview Commons", "24");
  LocationList[7] = new Array("Brightview Concord River", "36");
  LocationList[8] = new Array("Brightview Danvers", "27");
  LocationList[9] = new Array("Brightview East Norriton", "28");
  LocationList[10] = new Array("Brightview Greentree", "39");
  LocationList[11] = new Array("Brightview Mays Chapel Ridge", "31");
  LocationList[12] = new Array("Brightview Mount Laurel", "37");
  LocationList[13] = new Array("Brightview South River", "41");
  LocationList[14] = new Array("Brightview Towson","42");
  LocationList[15] = new Array("Brightview White Marsh", "35");
  LocationList[16] = new Array("Brightview Woodbury Lake", "38");
  LocationList[17] = new Array("Country Club Heights", "26");
  LocationList[18] = new Array("Evergreen Woods", "29");
  LocationList[19] = new Array("MD - Baltimore Home Office", "5");
  LocationList[20] = new Array("New Pond Village", "33");
  LocationList[21] = new Array("The Manor at York Town", "30");
  LocationList[22] = new Array("The Montclair", "32");
  break;
}
    
    for (i=0; i < LocationList.length; i++) {
    document.search.Location.options[count]=new Option();
	document.search.Location.options[count].text = LocationList[i][0];
	document.search.Location.options[count].value = LocationList[i][1];
	count++; 
	 }
	 
	 }
}

function getCLocations(City) {
 
    var asValues = new Array();
    var count=0;
    for (var i = 0; i < City.length; i++) {
        if (City.options[i].selected) {
            asValues[asValues.length] = City.options[i].value;
        }
    }
	 
	 for(i=document.search.Location.length-1; i>=0; i--)
    {
        document.search.Location.options[i] = null;
    }
  
var LocationList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
case 'Baltimore':  
	LocationList[0] = new Array("Baltimore Home Office", "37");
  break;
case 'White Marsh':  
  LocationList[0] = new Array("Brightview White Marsh", "35");
  break;
case 'Bel Air':  
  LocationList[0] = new Array("Brightview Avondell", "20");
  LocationList[1] = new Array("Brightview Bel Air", "23");
  break;
case 'Billerica':  
  LocationList[0] = new Array("Brightview Concord River", "36");
  break;
case 'Catonsville':  
  LocationList[0] = new Array("Brightview Catonsville", "25");
  break;
case 'Danvers':  
  LocationList[0] = new Array("Brightview Danvers", "27");
  break;
case 'East Norriton':  
  LocationList[0] = new Array("Brightview East Norriton", "28");
  break;
case 'Edgewood':  
  break;
case 'Evesham':  
  LocationList[0] = new Array("Brightview Greentree", "39");
  break;
case 'Fort Myers':  
  LocationList[0] = new Array("Barkley Place", "22");
  break;
case 'Jamison':  
  LocationList[0] = new Array("The Manor at York Town", "30");
  break;
case 'Mount Laurel':  
  LocationList[0] = new Array("Brightview Mount Laurel", "37");
  break;
case 'North Branford':  
  LocationList[0] = new Array("Evergreen Woods", "29");
  break;
case 'Springfield':  
  LocationList[0] = new Array("The Montclair", "32");
  break;
case 'Staunton': 
  LocationList[0] = new Array("Brightview Baldwin Park", "21");
  break;
case 'Timonium':  
  LocationList[0] = new Array("Brightview Mays Chapel Ridge", "31");
  break;
case 'Wakefield':  
  LocationList[0] = new Array("Brightview Commons", "24");
  break;
case 'Walpole':  
  LocationList[0] = new Array("New Pond Village", "33");
  break;
case 'Westminster':  
	LocationList[0] = new Array("Brightview Westminster Ridge", "34");
  break;
case 'Woburn':  
  LocationList[0] = new Array("Country Club Heights", "26");
  break;
case 'Woodbury Lake':  
  LocationList[0] = new Array("Brightview Woodbury Lake", "38");
  break;
default:
  LocationList[0] = new Array("All", "");
	LocationList[1] = new Array("Baltimore Home Office", "37");
  LocationList[2] = new Array("Barkley Place", "22");
  LocationList[3] = new Array("Brightview Avondell", "20");
  LocationList[4] = new Array("Brightview Baldwin Park", "21");
  LocationList[5] = new Array("Brightview Bel Air", "23");
  LocationList[6] = new Array("Brightview Catonsville", "25");
  LocationList[7] = new Array("Brightview Commons", "24");
  LocationList[8] = new Array("Brightview Concord River", "36");
  LocationList[9] = new Array("Brightview Danvers", "27");
  LocationList[10] = new Array("Brightview East Norriton", "28");
  LocationList[11] = new Array("Brightview Mays Chapel Ridge", "31");
  LocationList[12] = new Array("Brightview Westminster Ridge", "34");
  LocationList[13] = new Array("Brightview White Marsh", "35");
  LocationList[14] = new Array("Country Club Heights", "26");
  LocationList[15] = new Array("Evergreen Woods", "29");
  LocationList[16] = new Array("New Pond Village", "33");
  LocationList[17] = new Array("The Manor at York Town", "30");
  LocationList[18] = new Array("The Montclair", "32");
  LocationList[19] = new Array("Brightview Mount Laurel", "37");
  LocationList[20] = new Array("Brightview Woodbury Lake", "38");
  LocationList[21] = new Array("Brightview Greentree", "39");
  LocationList[22] = new Array("Brightview South River", "41");
  break;
}
    
    for (i=0; i < LocationList.length; i++) {
    document.search.Location.options[count]=new Option();
	document.search.Location.options[count].text = LocationList[i][0];
	document.search.Location.options[count].value = LocationList[i][1];
	count++; 
	 }
	 
	 }
}

//Get Cities for State

function getCity(Cities) {
 
    var asValues = new Array();
    var count=0;
    for (var i = 0; i < Cities.length; i++) {
        if (Cities.options[i].selected) {
            asValues[asValues.length] = Cities.options[i].value;
        }
    }
	 
	 for(i=document.search.jcity.length-1; i>=0; i--)
    {
        document.search.jcity.options[i] = null;
    }
  
var CityList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
	case 'CT':   
  CityList[0] = new Array("North Branford", "North Branford");
  break;
case 'FL':   
  CityList[0] = new Array("Fort Myers", "Fort Myers");
  break;
case 'MA':   
  CityList[0] = new Array("Billerica", "Billerica");
  CityList[1] = new Array("Danvers", "Danvers");
  CityList[2] = new Array("Walpole", "Walpole");
  CityList[3] = new Array("Woburn", "Woburn");
  break;
case 'MD':   
  CityList[0] = new Array("Baltimore", "Baltimore");
  CityList[1] = new Array("Bel Air", "Bel Air");
  CityList[2] = new Array("Catonsville", "Catonsville");
  CityList[3] = new Array("Timonium", "Timonium");
  CityList[4] = new Array("Westminster", "Westminster");
  CityList[5] = new Array("White Marsh", "White Marsh");
  break;
case 'MO':   
  CityList[0] = new Array("Springfield", "Springfield");
  break;
case 'NJ':   
  CityList[0] = new Array("Evesham", "Evesham");
  CityList[1] = new Array("Mount Laurel", "Mount Laurel");
  CityList[2] = new Array("Woodbury Lake", "Woodbury Lake");
  break;
case 'PA':   
  CityList[0] = new Array("East Norriton", "East Norriton");
  CityList[1] = new Array("Jamison", "Jamison");
  break;
case 'RI':   
  CityList[0] = new Array("Wakefield", "Wakefield");
  break;
case 'VA':   
  CityList[0] = new Array("Staunton", "Staunton");
  break;
default:
  CityList[0] = new Array("All", "");
  CityList[1] = new Array("Baltimore", "Baltimore");
  CityList[2] = new Array("Bel Air", "Bel Air");
  CityList[3] = new Array("Catonsville", "Catonsville");
  CityList[4] = new Array("Billerica", "Billerica");
  CityList[5] = new Array("Danvers", "Danvers");
  CityList[6] = new Array("East Norriton", "East Norriton");
  CityList[7] = new Array("Edgewood", "Edgewood");
  CityList[8] = new Array("Evesham", "Evesham");
  CityList[9] = new Array("Fort Myers", "Fort Myers");
  CityList[10] = new Array("Jamison", "Jamison");
  CityList[11] = new Array("Mount Laurel", "Mount Laurel");
  CityList[12] = new Array("North Branford", "North Branford");
  CityList[13] = new Array("Springfield", "Springfield");
  CityList[14] = new Array("Staunton", "Staunton");
  CityList[15] = new Array("Timonium", "Timonium");
  CityList[16] = new Array("Wakefield", "Wakefield");
  CityList[17] = new Array("Walpole", "Walpole");
  CityList[18] = new Array("Westminster", "Westminster");
  CityList[19] = new Array("White Marsh", "White Marsh");
  CityList[20] = new Array("Woburn", "Woburn");
  CityList[21] = new Array("Woodbury Lake", "Woodbury Lake");
  break;
}
    
    for (i=0; i < CityList.length; i++) {
    document.search.jcity.options[count]=new Option();
	document.search.jcity.options[count].text = CityList[i][0];
	document.search.jcity.options[count].value = CityList[i][1];
	count++; 
	 }
	 
	 }
	 getLocations(Cities);
}


//Get States for Cities

function getStates(State) {
 
    var asValues = new Array();
    var count=0;
    
    for (var i = 0; i < State.length; i++) {
        if (State.options[i].selected) {
            asValues[asValues.length] = State.options[i].value;
        }
    }
	 
	 for(i=document.search.jstate.length-1; i>=0; i--)
    {
        document.search.jstate.options[i] = null;
    }
  
var StateList = new Array();
var x;
var LocationValue;
count = 0;
 asValues.length = 1;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{/*
case '1':
  StateList[0] = new Array("All", "");
  StateList[1] = new Array("MD", "4");
  break;
case '2':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MD", "4");
  StateList[2]  = new Array("MD", "4");
  break;
case '3':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MD", "4");
  break;
case '4':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MA", "3");
  break;
case '5':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("PA", "6");
  break;
case '6':
  StateList[0] = new Array("All", "");
  break;
case '7':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("FL", "2");
  break;
case '8':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("PA", "6");
  break;
case '9':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("CT", "1");
  break;
case '10':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MO", "5");
  break;
case '11':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("VA", "8");
  break;
case '12':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MD", "4");
  break;
case '13':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("RI", "7");
  break;
case '14':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MA", "3");
  break;
case '15':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MD", "4");
  break;
case '16':
  StateList[0] = new Array("All", "");
  StateList[1]  = new Array("MA", "3");
  break;*/
default:
  StateList[0] = new Array("All", "");
  StateList[1] = new Array("CT", "CT");
  StateList[2] = new Array("FL", "FL");
  StateList[3] = new Array("MA", "MA");
  StateList[4] = new Array("MD", "MD");
  StateList[5] = new Array("MO", "MO");
  StateList[6] = new Array("NJ", "NJ");
  StateList[7] = new Array("PA", "PA");
  StateList[8] = new Array("RI", "RI");
  StateList[9] = new Array("VA", "VA");
  break;
}
    
    for (i=0; i < StateList.length; i++) {
    document.search.jstate.options[count]=new Option();
	document.search.jstate.options[count].text = StateList[i][0];
	document.search.jstate.options[count].value = StateList[i][1];
	count++; 
	 }
	 
	 }
	 getCLocations(State);
}

function getAllstates(jstate) {
 
    var asValues = new Array();
    var count=0;
    jstate.length = 1;
    for (var i = 0; i < jstate.length; i++) {
        if (jstate.options[i].text) {
            asValues[asValues.length] = jstate.options[i].value;
        }
    }
	 
	 for(i=document.search.jstate.length-1; i<0; i++)
    {
        document.search.jstate.options[i] = null;
    }
  
var StateList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
case '1' :
  StateList[0] = new Array("All", "");
  StateList[1] = new Array("CT", "CT");
  StateList[2] = new Array("FL", "FL");
  StateList[3] = new Array("MA", "MA");
  StateList[4] = new Array("MD", "MD");
  StateList[5] = new Array("MO", "MO");
  StateList[6] = new Array("NJ", "NJ");
  StateList[7] = new Array("PA", "PA");
  StateList[8] = new Array("RI", "RI");
  StateList[9] = new Array("VA", "VA");
  break;
default:
  StateList[0] = new Array("All", "");
  StateList[1] = new Array("CT", "CT");
  StateList[2] = new Array("FL", "FL");
  StateList[3] = new Array("MA", "MA");
  StateList[4] = new Array("MD", "MD");
  StateList[5] = new Array("MO", "MO");
  StateList[6] = new Array("NJ", "NJ");
  StateList[7] = new Array("PA", "PA");
  StateList[8] = new Array("RI", "RI");
  StateList[9] = new Array("VA", "VA");
  break;
}

    for (i=0; i < StateList.length; i++) {
    document.search.jstate.options[count]=new Option();
	document.search.jstate.options[count].text = StateList[i][0];
	document.search.jstate.options[count].value = StateList[i][1];
	count++; 
	 }
	 
	 }
	
}

function getAllcity(jcity) {
 
    var asValues = new Array();
    var count=0;
    jcity.length = 1;
    for (var i = 0; i < jcity.length; i++) {
        if (jcity.options[i].text) {
            asValues[asValues.length] = jcity.options[i].value;
        }
    }
	 
	 for(i=document.search.jcity.length-1; i<0; i++)
    {
        document.search.jcity.options[i] = null;
    }
  
var CityList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
case '1' :
  CityList[0] = new Array("All", "");
  CityList[1] = new Array("Baltimore", "Baltimore");
  CityList[2] = new Array("Bel Air", "Bel Air");
  CityList[3] = new Array("Catonsville", "Catonsville");
  CityList[4] = new Array("Billerica", "Billerica");
  CityList[5] = new Array("Danvers", "Danvers");
  CityList[6] = new Array("East Norriton", "East Norriton");
  CityList[7] = new Array("Edgewood", "Edgewood");
  CityList[8] = new Array("Evesham", "Evesham");
  CityList[9] = new Array("Fort Myers", "Fort Myers");
  CityList[10] = new Array("Jamison", "Jamison");
  CityList[11] = new Array("North Branford", "North Branford");
  CityList[12] = new Array("Springfield", "Springfield");
  CityList[13] = new Array("Staunton", "Staunton");
  CityList[14] = new Array("Timonium", "Timonium");
  CityList[15] = new Array("Wakefield", "Wakefield");
  CityList[16] = new Array("Walpole", "Walpole");
  CityList[17] = new Array("Westminster", "Westminster");
  CityList[18] = new Array("Woburn", "Woburn");
  break;
default:
  CityList[0] = new Array("All", "");
  CityList[1] = new Array("Baltimore", "Baltimore");
  CityList[2] = new Array("Bel Air", "Bel Air");
  CityList[3] = new Array("Catonsville", "Catonsville");
  CityList[4] = new Array("Billerica", "Billerica");
  CityList[5] = new Array("Danvers", "Danvers");
  CityList[6] = new Array("East Norriton", "East Norriton");
  CityList[7] = new Array("Edgewood", "Edgewood");
  CityList[8] = new Array("Evesham", "Evesham");
  CityList[9] = new Array("Fort Myers", "Fort Myers");
  CityList[10] = new Array("Jamison", "Jamison");
  CityList[11] = new Array("North Branford", "North Branford");
  CityList[12] = new Array("Springfield", "Springfield");
  CityList[13] = new Array("Staunton", "Staunton");
  CityList[14] = new Array("Timonium", "Timonium");
  CityList[15] = new Array("Wakefield", "Wakefield");
  CityList[16] = new Array("Walpole", "Walpole");
  CityList[17] = new Array("Westminster", "Westminster");
  CityList[18] = new Array("Woburn", "Woburn");
  break;
}

    for (i=0; i < CityList.length; i++) {
    document.search.jcity.options[count]=new Option();
	document.search.jcity.options[count].text = CityList[i][0];
	document.search.jcity.options[count].value = CityList[i][1];
	count++; 
	 }
	 
	 }
	
}

function getAllLocation(Location) {
 
    var asValues = new Array();
    var count=0;
    Location.length = 1;
    for (var i = 0; i < Location.length; i++) {
        if (Location.options[i].text) {
            asValues[asValues.length] = Location.options[i].value;
        }
    }
	 
	 for(i=document.search.Location.length-1; i<0; i++)
    {
        document.search.Location.options[i] = null;
    }
  
var LocationList = new Array();
var x;
var LocationValue;
count = 0;
for(var x = 0; x < asValues.length; x++) {
LocationValue = asValues[x];

switch(LocationValue.toString())
{
case '1' :
  LocationList[0] = new Array("All", "");
	LocationList[1] = new Array("Baltimore Home Office", "37");
  LocationList[2] = new Array("Barkley Place", "22");
  LocationList[3] = new Array("Brightview Avondell", "20");
  LocationList[4] = new Array("Brightview Baldwin Park", "21");
  LocationList[5] = new Array("Brightview Bel Air", "23");
  LocationList[6] = new Array("Brightview Catonsville", "25");
  LocationList[7] = new Array("Brightview Commons", "24");
  LocationList[8] = new Array("Brightview Concord River", "36");
  LocationList[9] = new Array("Brightview Danvers", "27");
  LocationList[10] = new Array("Brightview East Norriton", "28");
  LocationList[11] = new Array("Brightview East Norriton", "38");
  LocationList[12] = new Array("Brightview Mays Chapel Ridge", "31");
  LocationList[13] = new Array("Brightview South River", "41");
	LocationList[14] = new Array("Brightview Westminster Ridge", "34");
  LocationList[15] = new Array("Brightview White Marsh", "35");
  LocationList[16] = new Array("Country Club Heights", "26");
  LocationList[17] = new Array("Evergreen Woods", "29");
  LocationList[18] = new Array("New Pond Village", "33");
  LocationList[19] = new Array("The Manor at York Town", "30");
  LocationList[20] = new Array("The Montclair", "32");
  break;
default:
  LocationList[0] = new Array("All", "");
	LocationList[1] = new Array("Baltimore Home Office", "37");
  LocationList[2] = new Array("Barkley Place", "22");
  LocationList[3] = new Array("Brightview Avondell", "20");
  LocationList[4] = new Array("Brightview Baldwin Park", "21");
  LocationList[5] = new Array("Brightview Bel Air", "23");
  LocationList[6] = new Array("Brightview Catonsville", "25");
  LocationList[7] = new Array("Brightview Commons", "24");
  LocationList[8] = new Array("Brightview Concord River", "36");
  LocationList[9] = new Array("Brightview Danvers", "27");
  LocationList[10] = new Array("Brightview East Norriton", "28");
  LocationList[11] = new Array("Brightview East Norriton", "38");
  LocationList[12] = new Array("Brightview Mays Chapel Ridge", "31");
  LocationList[13] = new Array("Brightview South River", "41");
	LocationList[14] = new Array("Brightview Westminster Ridge", "34");
  LocationList[15] = new Array("Brightview White Marsh", "35");
  LocationList[16] = new Array("Country Club Heights", "26");
  LocationList[17] = new Array("Evergreen Woods", "29");
  LocationList[18] = new Array("New Pond Village", "33");
  LocationList[19] = new Array("The Manor at York Town", "30");
  LocationList[20] = new Array("The Montclair", "32");
  break;
}

    for (i=0; i < LocationList.length; i++) {
    document.search.Location.options[count]=new Option();
	document.search.Location.options[count].text = LocationList[i][0];
	document.search.Location.options[count].value = LocationList[i][1];
	count++; 
	 }
	 
	 }
	
}
