



var count1 = 0;
var count2 = 0;
//var OrangeCtyArray =new Array("Balmville","Bellvale","Blooming Grove","Bloomingburg","Bullville","Campbell Hall","Central Valley","Chester","Circleville","Cornwallonhudson","Cornwall","Cornwlonhud","Crawford","Cronomer Valley","Cuddebackville","Deer Park","Edenville","Fair Oaks","Florida","Fort Montgomery","Fortmontgomery","Fostertown","Godeffroy","Goshen","Greenville","Greenwood Lake","Hamptonburgh","Harriman","Highland Falls","Highland Mills","Howells","Huguenot","Johnson","Lake Osiris","Marlboro","Maybrook","Mechanicstown","Middlehope","Middletown","Minisink","Mnt Lodge Park","Monroe","Montgomery","Mount Hope","Mountainville","New Hampton","New Milford","New Windsor","Newburgh City","Newburgh Town","Newburgh","Orange Lake","Otisville Village","Otisville","Pine Bush","Pine Island","Port Jervis","Rock Tavern","Salisbury Mills","Scotchtown","Scotts Corner","Searsville","Slate Hill","Southfields","Sparrowbush","Sugar Loaf","Thompson Ridge","Tuxedo Park","Tuxedo","Unionville","Vails Gate","Walden","Wallkill","Warwick","Washingtonville","Wawayanda","Westbrookville","Westtown","Woodbury");
var OrangeCtyArray =new Array("Balmville","Fortmontgomery","Mnt Lodge Park","Scotts Corner","Bellvale","Fostertown","Monroe","Searsville","Blooming Grove","Godeffroy","Montgomery","Slate Hill","Bloomingburg","Goshen","Mount Hope","Southfields","Bullville","Greenville","Mountainville","Sparrowbush","Campbell Hall","Greenwood Lake","New Hampton","Sugar Loaf","Central Valley","Hamptonburgh","New Milford","Thompson Ridge","Chester","Harriman","New Windsor","Tuxedo Park","Circleville","Highland Falls","Newburgh City","Tuxedo","Cornwallonhudson","Highland Mills","Newburgh Town","Unionville","Cornwall","Howells","Newburgh","Vails Gate","Cornwlonhud","Huguenot","Orange Lake","Walden","Crawford","Johnson","Otisville Village","Wallkill","Cronomer Valley","Lake Osiris","Otisville","Warwick","Cuddebackville","Marlboro","Pine Bush","Washingtonville","Deer Park","Maybrook","Pine Island","Wawayanda","Edenville","Mechanicstown","Port Jervis","Westbrookville","Fair Oaks","Middlehope","Rock Tavern","Westtown","Florida","Middletown","Salisbury Mills","Woodbury","Fort Montgomery","Minisink","Scotchtown");
var StonyPointArray =new Array("Grassy Point","Jones Point","Stony Point","Tomkins Cove");
var HarverstrawArray =new Array("Garnerville","Haverstraw","Pomona","Thiells","West Haverstraw");
var RamapoArray =new Array("Airmont","Chestnut Ridge","Hillburn","Hillcrest","Kaser","Monsey","Montebello","New Hempstead","New Square","Pierson Lakes","Pomona","Sloatsburg","South Monsey","South Spring Valley","Spring Valley","Suffern","Tallman","Wesley Hills");
var ClarkstownArray =new Array("Bardonia","Central Nyack","Congers","Nanuet","New City","Valley Cottage","West Nyack");
var OrangetownArray =new Array("Blauvelt","Orangeburg","Pearl River","Sparkill","Tappan");
var RiverFrontArray =new Array("Grandview","Nyack","Palisades","Piermont","Snedens Landing","South Nyack","Upper Grandview","Upper Nyack");
//var RocklandCtyArray =new Array("Airmont","Bardonia","Blauvelt","Central Nyack","Chestnut Ridge","Congers","Garnerville","Grandview","Grassy Point","Haverstraw","Hillburn","Hillcrest","Jones Point","Kaser","Monsey","Montebello","Nanuet","New City","New Hempstead","New Square","Nyack","Orangeburg","Palisades","Pearl River","Piermont","Pierson Lakes","Pomona","Sloatsburg","Snedens Landing ","South Monsey","South Nyack","South Spring Valley","Sparkill","Spring Valley","Stony Point","Suffern","Tallman","Tappan","Thiells","Tomkins Cove","Upper Grandview","Upper Nyack","Valley Cottage","Wesley Hills","West Haverstraw","West Nyack");
var RocklandCtyArray =new Array("Airmont","Jones Point","Piermont","Suffern","Bardonia","Kaser","Pierson Lakes","Tallman","Blauvelt","Monsey","Pomona","Tappan","Central Nyack","Montebello","Sloatsburg","Thiells","Chestnut Ridge","Nanuet","Snedens Landing","Tomkins Cove","Congers","New City","South Monsey","Upper Grandview","Garnerville","New Hempstead","South Nyack","Upper Nyack","Grandview","New Square","South Spring Valley","Valley Cottage","Grassy Point","Nyack","Sparkill","Wesley Hills","Haverstraw","Orangeburg","Spring Valley","West Haverstraw","Hillburn","Palisades","Stony Point","West Nyack","Hillcrest","Pearl River");

function RemoveAll()
{
var i;
for(i=document.getElementById("tempcity").options.length-1;i>=0;i--)
{
document.getElementById("tempcity").remove(i);
}

var j;
for(j=document.getElementById("tempzip").options.length-1;j>=0;j--)
{
document.getElementById("tempzip").remove(j);
}

var k;
for(k=document.getElementById("tempcounty").options.length-1;k>=0;k--)
{
document.getElementById("tempcounty").remove(k);
}
}


function SelectAll()
{
var i;
for(i=document.getElementById("tempcity").options.length-1;i>=0;i--)
{
document.getElementById("tempcity")[i].selected = true;
}
}



function AddItem(objListBox, strText)
{
  var elOptNew = document.createElement('option');
  elOptNew.text = strText;
  elOptNew.value = strText;
  var elSel = objListBox;

  try {
    elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  }
  catch(ex) {
    elSel.add(elOptNew); // IE only
  }
}


function AddItem2(objListBox, strText, strValue)
{
  var elOptNew = document.createElement('option');
  elOptNew.text = strText;
  elOptNew.value = strValue;
  var elSel = objListBox;

  try {
    elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  }
  catch(ex) {
    elSel.add(elOptNew); // IE only
  }
}


function AddAreaName()
{

var strHtml;
var i;
for(i=document.getElementById("temparea").options.length-1;i>=0;i--)
{

strHtml = "<a href=\"javascript:RemoveItem2('" + document.getElementById("temparea")[i].value + "');\">" + document.getElementById("temparea")[i].value + "</a>";

}

document.getElementById('areaname').innerHTML=strHtml;

if (document.getElementById("temparea").options.length == 0) {
document.getElementById('areaname').innerHTML='none'
}
}




function DoAdd(strID)
{ 
  //RemoveAll();

  if (strID == 'A'){ //Adds all of Orange County
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('A');
  
  var arLen=OrangeCtyArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), OrangeCtyArray[i]);
  }

  }
  
  if (strID == 'B'){ //Adds all of Township of Stony Point
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('B');
  
  var arLen=StonyPointArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), StonyPointArray[i]);
     if (document.getElementById(StonyPointArray[i]) != null){
        document.getElementById(StonyPointArray[i]).checked = true;
     }
  }

  }
  
  if (strID == 'C'){ //Adds all of Township of Haverstraw
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('C');
  
  var arLen=HarverstrawArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), HarverstrawArray[i]);
     if (document.getElementById(HarverstrawArray[i]) != null){
        document.getElementById(HarverstrawArray[i]).checked = true;
     }
  }

  }  

  if (strID == 'D'){ //Adds all of Township of Ramapo
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('D');
  
  var arLen=RamapoArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), RamapoArray[i]);
     if (document.getElementById(RamapoArray[i]) != null){
        document.getElementById(RamapoArray[i]).checked = true;
     }
  }

  }
  
  if (strID == 'E'){ //Adds all of Township of Clarkstown
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('E');
  
  var arLen=ClarkstownArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), ClarkstownArray[i]);
     if (document.getElementById(ClarkstownArray[i]) != null){
        document.getElementById(ClarkstownArray[i]).checked = true;
     }
  }

  }
  
  if (strID == 'F'){ //Adds all of Township of Orangetown
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('F');
  
  var arLen=OrangetownArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), OrangetownArray[i]);
     if (document.getElementById(OrangetownArray[i]) != null){
        document.getElementById(OrangetownArray[i]).checked = true;
     }
  }

  }
  
  if (strID == 'G'){ //Adds all of Township of Orangetown
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  DoRemove('G');
  
  var arLen=RiverFrontArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     AddItem(document.getElementById("tempcity"), RiverFrontArray[i]);
     if (document.getElementById(RiverFrontArray[i]) != null){
        document.getElementById(RiverFrontArray[i]).checked = true;
     }
  }

  }

  if (strID == 'B1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Jones Point');
  DoRemove('B1');

  AddItem(document.getElementById("tempcity"), 'Jones Point'); 
  if (document.getElementById("Jones Point") != null){
        document.getElementById("Jones Point").checked = true;
  }
  }

  if (strID == 'B2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Tomkins Cove');
  DoRemove('B2');

  AddItem(document.getElementById("tempcity"), 'Tomkins Cove'); 
  if (document.getElementById("Tomkins Cove") != null){
        document.getElementById("Tomkins Cove").checked = true;
  }
  }
  
  if (strID == 'B3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Stony Point');
  DoRemove('B3');
  if (document.getElementById("Stony Point") != null){
        document.getElementById("Stony Point").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Stony Point'); 

  }
  
  if (strID == 'B4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Grassy Point');
  DoRemove('B4');
  if (document.getElementById("Grassy Point") != null){
        document.getElementById("Grassy Point").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Grassy Point'); 

  }

  if (strID == 'C1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Garnerville');
  DoRemove('C1');
  if (document.getElementById("Garnerville") != null){
        document.getElementById("Garnerville").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Garnerville'); 

  }
  
  if (strID == 'C2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Thiells');
  DoRemove('C2');
  if (document.getElementById("Thiells") != null){
        document.getElementById("Thiells").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Thiells'); 

  }
  
  if (strID == 'C3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'West Haverstraw');
  DoRemove('C3');
  if (document.getElementById("West Haverstraw") != null){
        document.getElementById("West Haverstraw").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'West Haverstraw'); 

  }
  
  if (strID == 'C4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Haverstraw');
  DoRemove('C4');
  if (document.getElementById("Haverstraw") != null){
        document.getElementById("Haverstraw").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Haverstraw'); 

  }
  
  if (strID == 'C5'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Pomona');
  DoRemove('C5');
  if (document.getElementById("Pomona") != null){
        document.getElementById("Pomona").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Pomona'); 

  }

  if (strID == 'D1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Sloatsburg');
  DoRemove('D1');
  if (document.getElementById("Sloatsburg") != null){
        document.getElementById("Sloatsburg").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Sloatsburg'); 

  }
  
  if (strID == 'D2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Pierson Lakes');
  DoRemove('D2');
  if (document.getElementById("Pierson Lakes") != null){
        document.getElementById("Pierson Lakes").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Pierson Lakes'); 

  }
  
  if (strID == 'D3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Hillburn');
  DoRemove('D3');
  if (document.getElementById("Hillburn") != null){
        document.getElementById("Hillburn").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Hillburn'); 

  }
  
  if (strID == 'D4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Suffern');
  DoRemove('D4');
  if (document.getElementById("Suffern") != null){
        document.getElementById("Suffern").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Suffern'); 

  }
  
  if (strID == 'D5'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Montebello');
  DoRemove('D5');
  if (document.getElementById("Montebello") != null){
        document.getElementById("Montebello").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Montebello'); 

  }
  
  if (strID == 'D6'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Wesley Hills');
  DoRemove('D6');
  if (document.getElementById("Wesley Hills") != null){
        document.getElementById("Wesley Hills").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Wesley Hills'); 

  }
  
  if (strID == 'D7'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Pomona');
  DoRemove('D7');
  if (document.getElementById("Pomona") != null){
        document.getElementById("Pomona").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Pomona'); 

  }
  
  if (strID == 'D8'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Airmont');
  DoRemove('D8');
  if (document.getElementById("Airmont") != null){
        document.getElementById("Airmont").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Airmont'); 

  }
  
  if (strID == 'D9'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Monsey');
  DoRemove('D9');
  if (document.getElementById("Monsey") != null){
        document.getElementById("Monsey").checked = true;
  }
  AddItem(document.getElementById("tempcity"), 'Monsey'); 

  }
  
  if (strID == 'D10'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'South Monsey');
  DoRemove('D10');
  
  AddItem(document.getElementById("tempcity"), 'South Monsey'); 
  if (document.getElementById("South Monsey") != null){
        document.getElementById("South Monsey").checked = true;
  }
  }
  
  if (strID == 'D11'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Tallman');
  DoRemove('D11');

  AddItem(document.getElementById("tempcity"), 'Tallman'); 
  if (document.getElementById("Tallman") != null){
        document.getElementById("Tallman").checked = true;
  }
  }
  
  if (strID == 'D12'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Kaser');
  DoRemove('D12');

  AddItem(document.getElementById("tempcity"), 'Kaser'); 
  if (document.getElementById("Kaser") != null){
        document.getElementById("Kaser").checked = true;
  }
  }
  
  if (strID == 'D13'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'New Hempstead');
  DoRemove('D13');

  AddItem(document.getElementById("tempcity"), 'New Hempstead'); 
  if (document.getElementById("New Hempstead") != null){
        document.getElementById("New Hempstead").checked = true;
  }
  }
  
  if (strID == 'D14'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Chestnut Ridge');
  DoRemove('D14');

  AddItem(document.getElementById("tempcity"), 'Chestnut Ridge'); 
  if (document.getElementById("Chestnut Ridge") != null){
        document.getElementById("Chestnut Ridge").checked = true;
  }
  }
  
  if (strID == 'D15'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Hillcrest');
  DoRemove('D15');

  AddItem(document.getElementById("tempcity"), 'Hillcrest'); 
  if (document.getElementById("Hillcrest") != null){
        document.getElementById("Hillcrest").checked = true;
  }
  }
  
  if (strID == 'D16'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'New Square');
  DoRemove('D16');

  AddItem(document.getElementById("tempcity"), 'New Square'); 
  if (document.getElementById("New Square") != null){
        document.getElementById("New Square").checked = true;
  }
  }
  
  if (strID == 'D17'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Spring Valley');
  DoRemove('D17');

  AddItem(document.getElementById("tempcity"), 'Spring Valley'); 
  if (document.getElementById("Spring Valley") != null){
        document.getElementById("Spring Valley").checked = true;
  }
  }
  
  if (strID == 'D18'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'South Spring Valley');
  DoRemove('D18');

  AddItem(document.getElementById("tempcity"), 'South Spring Valley'); 
  if (document.getElementById("South Spring Valley") != null){
        document.getElementById("South Spring Valley").checked = true;
  }
  }		

  if (strID == 'E1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Congers');
  DoRemove('E1');

  AddItem(document.getElementById("tempcity"), 'Congers'); 
  if (document.getElementById("Congers") != null){
        document.getElementById("Congers").checked = true;
  }
  }
  
  if (strID == 'E2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'New City');
  DoRemove('E2');

  AddItem(document.getElementById("tempcity"), 'New City'); 
  if (document.getElementById("New City") != null){
        document.getElementById("New City").checked = true;
  }
  }
  
  if (strID == 'E3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Bardonia');
  DoRemove('E3');

  AddItem(document.getElementById("tempcity"), 'Bardonia'); 
  if (document.getElementById("Bardonia") != null){
        document.getElementById("Bardonia").checked = true;
  }
  }
  
  if (strID == 'E4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Valley Cottage');
  DoRemove('E4');

  AddItem(document.getElementById("tempcity"), 'Valley Cottage'); 
  if (document.getElementById("Valley Cottage") != null){
        document.getElementById("Valley Cottage").checked = true;
  }
  }
  
  if (strID == 'E5'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Nanuet');
  DoRemove('E5');

  AddItem(document.getElementById("tempcity"), 'Nanuet'); 
  if (document.getElementById("Nanuet") != null){
        document.getElementById("Nanuet").checked = true;
  }
  }
  
  if (strID == 'E6'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'West Nyack');
  DoRemove('E6');

  AddItem(document.getElementById("tempcity"), 'West Nyack'); 
  if (document.getElementById("West Nyack") != null){
        document.getElementById("West Nyack").checked = true;
  }
  }
  
  if (strID == 'E7'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Central Nyack');
  DoRemove('E7');

  AddItem(document.getElementById("tempcity"), 'Central Nyack'); 
  if (document.getElementById("Central Nyack") != null){
        document.getElementById("Central Nyack").checked = true;
  }
  }

  if (strID == 'F1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Pearl River');
  DoRemove('F1');

  AddItem(document.getElementById("tempcity"), 'Pearl River'); 
  if (document.getElementById("Pearl River") != null){
        document.getElementById("Pearl River").checked = true;
  }
  }
  
  if (strID == 'F2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Blauvelt');
  DoRemove('F2');

  AddItem(document.getElementById("tempcity"), 'Blauvelt'); 
  if (document.getElementById("Blauvelt") != null){
        document.getElementById("Blauvelt").checked = true;
  }
  }
  
  if (strID == 'F3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Orangeburg');
  DoRemove('F3');

  AddItem(document.getElementById("tempcity"), 'Orangeburg'); 
  if (document.getElementById("Orangeburg") != null){
        document.getElementById("Orangeburg").checked = true;
  }
  }
  
  if (strID == 'F4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Tappan');
  DoRemove('F4');

  AddItem(document.getElementById("tempcity"), 'Tappan'); 
  if (document.getElementById("Tappan") != null){
        document.getElementById("Tappan").checked = true;
  }
  }
  
  if (strID == 'F5'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Sparkill');
  DoRemove('F5');

  AddItem(document.getElementById("tempcity"), 'Sparkill'); 
  if (document.getElementById("Sparkill") != null){
        document.getElementById("Sparkill").checked = true;
  }
  }

  if (strID == 'G1'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Grandview');
  DoRemove('G1');

  AddItem(document.getElementById("tempcity"), 'Grandview'); 
  if (document.getElementById("Grandview") != null){
        document.getElementById("Grandview").checked = true;
  }
  }
  
  if (strID == 'G2'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Nyack');
  DoRemove('G2');

  AddItem(document.getElementById("tempcity"), 'Nyack'); 
  if (document.getElementById("Nyack") != null){
        document.getElementById("Nyack").checked = true;
  }
  }
  
  if (strID == 'G3'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Palisades');
  DoRemove('G3');

  AddItem(document.getElementById("tempcity"), 'Palisades'); 
  if (document.getElementById("Palisades") != null){
        document.getElementById("Palisades").checked = true;
  }
  }
  
  if (strID == 'G4'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Piermont');
  DoRemove('G4');

  AddItem(document.getElementById("tempcity"), 'Piermont'); 
  if (document.getElementById("Piermont") != null){
        document.getElementById("Piermont").checked = true;
  }
  }
  
  if (strID == 'G5'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'South Nyack');
  DoRemove('G5');

  AddItem(document.getElementById("tempcity"), 'South Nyack'); 
  if (document.getElementById("South Nyack") != null){
        document.getElementById("South Nyack").checked = true;
  }
  }
  
  if (strID == 'G6'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Upper Grandview');
  DoRemove('G6');

  AddItem(document.getElementById("tempcity"), 'Upper Grandview'); 
  if (document.getElementById("Upper Grandview") != null){
        document.getElementById("Upper Grandview").checked = true;
  }
  }
  
  if (strID == 'G7'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Upper Nyack');
  DoRemove('G7');

  AddItem(document.getElementById("tempcity"), 'Upper Nyack'); 
  if (document.getElementById("Upper Nyack") != null){
        document.getElementById("Upper Nyack").checked = true;
  }
  }
  
  if (strID == 'G8'){
  //RemoveAll();
  RemoveItem(document.getElementById("tempcity"), '0');
  RemoveItem(document.getElementById("tempcity"), 'Snedens Landing');
  DoRemove('G8');

  AddItem(document.getElementById("tempcity"), 'Snedens Landing'); 
  if (document.getElementById("Snedens Landing") != null){
        document.getElementById("Snedens Landing").checked = true;
  }
  }
 

}



function DoRemove(strID)
{ 
  //RemoveAll();
  if (strID == 'A'){ //Removes all of Orange County
  
  var arLen=OrangeCtyArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), OrangeCtyArray[i]);
  }

  }
  
  if (strID == 'B'){ //Removes all of Township of Stony Point
  
  var arLen=StonyPointArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), StonyPointArray[i]);
  }

  }
  
  if (strID == 'C'){ //Removes all of Township of Haverstraw
  
  var arLen=HarverstrawArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), HarverstrawArray[i]);
  }

  }  

  if (strID == 'D'){ //Removes all of Township of Ramapo
  
  var arLen=RamapoArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), RamapoArray[i]);
  }

  }
  
  if (strID == 'E'){ //Removes all of Township of Clarkstown
  
  var arLen=ClarkstownArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), ClarkstownArray[i]);
  }

  }
  
  if (strID == 'F'){ //Removes all of Township of Orangetown
  
  var arLen=OrangetownArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), OrangetownArray[i]);
  }

  }
  
  if (strID == 'G'){ //Removes all of Township of Orangetown
  
  var arLen=RiverFrontArray.length;
  for ( var i=0, len=arLen; i<len; ++i ){
     RemoveItem(document.getElementById("tempcity"), RiverFrontArray[i]);
  }

  }

}

function dspCities(cnty){
var County = cnty;

    if (County == 'orange') {
        document.getElementById("orangecounty").checked = true;
        var tmpHTMLstr = "<table border=0 cellpadding=3 cellspacing=0 width=100%><tr>";
        
        var arLen=OrangeCtyArray.length;
        //alert('here')
        ctr = 0
        for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top" class="purple"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + OrangeCtyArray[i] + '\');" id="' + OrangeCtyArray[i] + '" value="' + OrangeCtyArray[i] + '"> ' + OrangeCtyArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top" class="purple"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + OrangeCtyArray[i] + '\');" id="' + OrangeCtyArray[i] + '" value="' + OrangeCtyArray[i] + '"> ' + OrangeCtyArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }
        tmpHTMLstr += "</tr></table>";
        //alert(tmpHTMLstr);
        document.getElementById("cityselect").innerHTML = tmpHTMLstr;
      
    }
    
    if (County == 'rockland'){
        document.getElementById("rocklandcounty").checked = true;
        var tmpHTMLstr = "<table border=0 cellpadding=3 cellspacing=0 width=100%><tr>";
        ctr = 0; 
               
        var arLen=RocklandCtyArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top" class="purple"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RocklandCtyArray[i] + '\');" id="' + RocklandCtyArray[i] + '" value="' + RocklandCtyArray[i] + '"> ' + RocklandCtyArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top" class="purple"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RocklandCtyArray[i] + '\');" id="' + RocklandCtyArray[i] + '" value="' + RocklandCtyArray[i] + '"> ' + RocklandCtyArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }
        /*  
          var arLen=StonyPointArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + StonyPointArray[i] + '\');" id="' + StonyPointArray[i] + '" value="' + StonyPointArray[i] + '"> ' + StonyPointArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + StonyPointArray[i] + '\');" id="' + StonyPointArray[i] + '" value="' + StonyPointArray[i] + '"> ' + StonyPointArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }

          var arLen=HarverstrawArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + HarverstrawArray[i] + '\');" id="' + HarverstrawArray[i] + '" value="' + HarverstrawArray[i] + '"> ' + HarverstrawArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + HarverstrawArray[i] + '\');" id="' + HarverstrawArray[i] + '" value="' + HarverstrawArray[i] + '"> ' + HarverstrawArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }

          var arLen=RamapoArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RamapoArray[i] + '\');" id="' + RamapoArray[i] + '" value="' + RamapoArray[i] + '"> ' + RamapoArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RamapoArray[i] + '\');" id="' + RamapoArray[i] + '" value="' + RamapoArray[i] + '"> ' + RamapoArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }

          var arLen=ClarkstownArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + ClarkstownArray[i] + '\');" id="' + ClarkstownArray[i] + '" value="' + ClarkstownArray[i] + '"> ' + ClarkstownArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + ClarkstownArray[i] + '\');" id="' + ClarkstownArray[i] + '" value="' + ClarkstownArray[i] + '"> ' + ClarkstownArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }
 
          var arLen=OrangetownArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + OrangetownArray[i] + '\');" id="' + OrangetownArray[i] + '" value="' + OrangetownArray[i] + '"> ' + OrangetownArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + OrangetownArray[i] + '\');" id="' + OrangetownArray[i] + '" value="' + OrangetownArray[i] + '"> ' + OrangetownArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }

          var arLen=RiverFrontArray.length;
          for ( var i=0, len=arLen; i<len; ++i ){
             if (ctr == 4){
                tmpHTMLstr += '</tr><tr><td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RiverFrontArray[i] + '\');" id="' + RiverFrontArray[i] + '" value="' + RiverFrontArray[i] + '"> ' + RiverFrontArray[i] + '</td>';        
                ctr = 1;
            }else{
                tmpHTMLstr += '<td valign="top"><input type="checkbox" onclick="javscript:AddRemoveCity(\'' + RiverFrontArray[i] + '\');" id="' + RiverFrontArray[i] + '" value="' + RiverFrontArray[i] + '"> ' + RiverFrontArray[i] + '</td>';
                ctr = ctr + 1;
            }
          }
     */
        tmpHTMLstr += "</tr></table>";
        document.getElementById("cityselect").innerHTML = tmpHTMLstr;
    }
}


function ErrorCheckSubmit(){

var strcity = '';
var i;
var x;
var strSelectString = '';

for(x=document.the_form.tempcity.length-1;x>=0;x--)
{
if (document.the_form.tempcity[x].selected){

strSelectString = 'Yes';

}
}


if (strSelectString == 'Yes') {
// do nothing
}
else {
SelectAll();
}


//SelectAllZips();
SelectAllCountys();


for(i=document.the_form.tempcity.length-1;i>=0;i--)
{
if (document.the_form.tempcity[i].selected){
if (strcity == ''){
//strcity = replaceChars(document.the_form.tempcity[i].text);
strcity = document.the_form.tempcity[i].value;
}
else {
//strcity = strcity + ', ' + replaceChars(document.the_form.tempcity[i].text);
strcity = strcity + ', ' + document.the_form.tempcity[i].value;
}
}
}

document.the_form.tempcity.value = strcity;


var strcounty = '';
var k;

for(k=document.the_form.tempcounty.length-1;k>=0;k--)
{

if (document.the_form.tempcounty[k].selected){
if (strcounty == ''){
strcounty = document.the_form.tempcounty[k].value;
}
else {
strcounty = strcounty + ', ' + document.the_form.tempcounty[k].value;
}
}

}

document.the_form.county.value = strcounty;


document.the_form.submit();

}


function QuickLink(){

var i;
for(i=document.getElementById("tempcity").options.length-1;i>=0;i--)
{
if (document.getElementById("tempcity")[i].selected) {
document.the_form.subdivision.value = document.getElementById("tempcity")[i].value;
}
}

document.the_form.submit();

}


function replaceChars(entry) {
out = " "; // replace this
add = "+"; // with this
temp = "" + entry; // temporary holder

while (temp.indexOf(out)>-1) {
pos= temp.indexOf(out);
temp = "" + (temp.substring(0, pos) + add + 
temp.substring((pos + out.length), temp.length));
}
return temp;
}

function AddRemoveCity(city){

    RemoveItem(document.getElementById("tempcity"), '0');

    if (document.getElementById(city).checked == true){
    AddItem(document.getElementById("tempcity"), city);        
    }else{
    RemoveItem(document.getElementById("tempcity"), city);   
    }
}

function RemoveItem(objListBox, strId)
{
  var elSel = objListBox;
  var i;
  if ((eval('strId')) == "All Areas") {
     elSel.remove(0);
  }
  for (i = elSel.length - 1; i>=0; i--) {
    //if (elSel.options[i].selected) {
    if (elSel.options[i].value == strId) {
      elSel.remove(i);
    }
  }
}


function RemoveItem2(objListBox, strId)
{
  var elSel = objListBox;
  var i;
  

  for (i = elSel.length - 1; i>=0; i--) {
    if (elSel.options[i].text == strId) {
      elSel.remove(i);
    }
  }


}


function DoRemove2()
{
  var strId = document.getElementById("tempcity").value;
  //var strIndex = GetSelectedItem();
  //alert(strId)
  //var strValue = document.the_form.city(strIndex).text;

  RemoveItem(document.getElementById("tempcity"), strId);
  
  if (document.getElementById(strId) != null){
      if (document.getElementById(strId).checked) {
        document.getElementById(strId).checked = false;
      }
  }
  //document.getElementById("city").remove(strIndex);


}


function GetSelectedItem() {

len = document.the_form.tempcity.length;
i = 0
chosen = "none"

for (i = 0; i < len; i++) {
if (document.the_form.tempcity[i].selected) {
chosen = i
} 
}

return chosen
} 







function addOption(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}



function setRentalRange2()
{

var i;
var j;
var rental = 0;

for(i=document.the_form.minprice.options.length-1;i>=0;i--)
{
document.the_form.minprice.remove(i);
document.the_form.maxprice.remove(i);
}

for (j = 0; j < 8; j++) {
if (document.the_form.hometypes[j].selected) {
rental = rental + 'R' + j;
} 
}


if (rental == '0R5') {
addOption(document.the_form.minprice, "Minimum Price","0");
addOption(document.the_form.minprice, "$1,000","1000");
addOption(document.the_form.minprice, "$1,500","1500");
addOption(document.the_form.minprice, "$2,000","2000");
addOption(document.the_form.minprice, "$2,500","2500");
addOption(document.the_form.minprice, "$3,000","3000");
addOption(document.the_form.minprice, "$4,000","4000");
addOption(document.the_form.minprice, "$5,000","5000");
addOption(document.the_form.minprice, "$10,000","10000");
addOption(document.the_form.minprice, "$20,000","20000");

addOption(document.the_form.maxprice, "Maximum Price","0");
addOption(document.the_form.maxprice, "$1,000","1000");
addOption(document.the_form.maxprice, "$1,500","1500");
addOption(document.the_form.maxprice, "$2,000","2000");
addOption(document.the_form.maxprice, "$2,500","2500");
addOption(document.the_form.maxprice, "$3,000","3000");
addOption(document.the_form.maxprice, "$4,000","4000");
addOption(document.the_form.maxprice, "$5,000","5000");
addOption(document.the_form.maxprice, "$10,000","10000");
addOption(document.the_form.maxprice, "$20,000","20000");
}
else
{
addOption(document.the_form.minprice, "Minimum Price","0");
addOption(document.the_form.minprice, "$500","500");
addOption(document.the_form.minprice, "$1,000","1000");
addOption(document.the_form.minprice, "$25,000","25000");
addOption(document.the_form.minprice, "$50,000","50000");
addOption(document.the_form.minprice, "$100,000","100000");
addOption(document.the_form.minprice, "$150,000","150000");
addOption(document.the_form.minprice, "$200,000","200000");
addOption(document.the_form.minprice, "$250,000","250000");
addOption(document.the_form.minprice, "$300,000","300000");
addOption(document.the_form.minprice, "$350,000","350000");
addOption(document.the_form.minprice, "$400,000","400000");
addOption(document.the_form.minprice, "$450,000","450000");
addOption(document.the_form.minprice, "$500,000","500000");
addOption(document.the_form.minprice, "$550,000","550000");
addOption(document.the_form.minprice, "$600,000","600000");
addOption(document.the_form.minprice, "$650,000","650000");
addOption(document.the_form.minprice, "$700,000","700000");
addOption(document.the_form.minprice, "$750,000","750000");
addOption(document.the_form.minprice, "$800,000","800000");
addOption(document.the_form.minprice, "$850,000","850000");
addOption(document.the_form.minprice, "$900,000","900000");
addOption(document.the_form.minprice, "$950,000","950000");
addOption(document.the_form.minprice, "$1,000,000","1000000");
addOption(document.the_form.minprice, "$1,500,000","1500000");
addOption(document.the_form.minprice, "$2,000,000","2000000");
addOption(document.the_form.minprice, "$2,500,000","2500000");
addOption(document.the_form.minprice, "$3,000,000","3000000");
addOption(document.the_form.minprice, "$3,500,000","3500000");
addOption(document.the_form.minprice, "$4,000,000","4000000");

addOption(document.the_form.maxprice, "Maximum Price","0");
addOption(document.the_form.minprice, "$500","500");
addOption(document.the_form.minprice, "$1,000","1000");
addOption(document.the_form.minprice, "$25,000","25000");
addOption(document.the_form.maxprice, "$50,000","50000");
addOption(document.the_form.maxprice, "$100,000","100000");
addOption(document.the_form.maxprice, "$150,000","150000");
addOption(document.the_form.maxprice, "$200,000","200000");
addOption(document.the_form.maxprice, "$250,000","250000");
addOption(document.the_form.maxprice, "$300,000","300000");
addOption(document.the_form.maxprice, "$350,000","350000");
addOption(document.the_form.maxprice, "$400,000","400000");
addOption(document.the_form.maxprice, "$450,000","450000");
addOption(document.the_form.maxprice, "$500,000","500000");
addOption(document.the_form.maxprice, "$550,000","550000");
addOption(document.the_form.maxprice, "$600,000","600000");
addOption(document.the_form.maxprice, "$650,000","650000");
addOption(document.the_form.maxprice, "$700,000","700000");
addOption(document.the_form.maxprice, "$750,000","750000");
addOption(document.the_form.maxprice, "$800,000","800000");
addOption(document.the_form.maxprice, "$850,000","850000");
addOption(document.the_form.maxprice, "$900,000","900000");
addOption(document.the_form.maxprice, "$950,000","950000");
addOption(document.the_form.maxprice, "$1,000,000","1000000");
addOption(document.the_form.maxprice, "$1,500,000","1500000");
addOption(document.the_form.maxprice, "$2,000,000","2000000");
addOption(document.the_form.maxprice, "$2,500,000","2500000");
addOption(document.the_form.maxprice, "$3,000,000","3000000");
addOption(document.the_form.maxprice, "$3,500,000","3500000");
addOption(document.the_form.maxprice, "$4,000,000+","99000000");
}

}


function setRentalRangeLN()
{

var i;

for(i=document.formLN.minimumPrice.options.length-1;i>=0;i--)
{
document.formLN.minimumPrice.remove(i);
document.formLN.maximumPrice.remove(i);
}



if ((document.formLN.proType1.checked == false) && (document.formLN.proType2.checked == false) && (document.formLN.proType3.checked == false) && (document.formLN.proType4.checked == false) && (document.formLN.proType5.checked == false) && (document.formLN.proType6.checked == true) && (document.formLN.proType7.checked == false) && (document.formLN.proType8.checked == false)) {
addOption(document.formLN.minimumPrice, "Minimum Price","0");
addOption(document.formLN.minimumPrice, "$1,000","1000");
addOption(document.formLN.minimumPrice, "$1,500","1500");
addOption(document.formLN.minimumPrice, "$2,000","2000");
addOption(document.formLN.minimumPrice, "$2,500","2500");
addOption(document.formLN.minimumPrice, "$3,000","3000");
addOption(document.formLN.minimumPrice, "$4,000","4000");
addOption(document.formLN.minimumPrice, "$5,000","5000");
addOption(document.formLN.minimumPrice, "$10,000","10000");
addOption(document.formLN.minimumPrice, "$20,000","20000");

addOption(document.formLN.maximumPrice, "Maximum Price","0");
addOption(document.formLN.maximumPrice, "$1,000","1000");
addOption(document.formLN.maximumPrice, "$1,500","1500");
addOption(document.formLN.maximumPrice, "$2,000","2000");
addOption(document.formLN.maximumPrice, "$2,500","2500");
addOption(document.formLN.maximumPrice, "$3,000","3000");
addOption(document.formLN.maximumPrice, "$4,000","4000");
addOption(document.formLN.maximumPrice, "$5,000","5000");
addOption(document.formLN.maximumPrice, "$10,000","10000");
addOption(document.formLN.maximumPrice, "$20,000","20000");
}
else
{
addOption(document.formLN.minimumPrice, "Minimum Price","0");
addOption(document.formLN.minimumPrice, "$500","500");
addOption(document.formLN.minimumPrice, "$1,000","1000");
addOption(document.formLN.minimumPrice, "$25,000","25000");
addOption(document.formLN.minimumPrice, "$50,000","50000");
addOption(document.formLN.minimumPrice, "$100,000","100000");
addOption(document.formLN.minimumPrice, "$150,000","150000");
addOption(document.formLN.minimumPrice, "$200,000","200000");
addOption(document.formLN.minimumPrice, "$250,000","250000");
addOption(document.formLN.minimumPrice, "$300,000","300000");
addOption(document.formLN.minimumPrice, "$350,000","350000");
addOption(document.formLN.minimumPrice, "$400,000","400000");
addOption(document.formLN.minimumPrice, "$450,000","450000");
addOption(document.formLN.minimumPrice, "$500,000","500000");
addOption(document.formLN.minimumPrice, "$550,000","550000");
addOption(document.formLN.minimumPrice, "$600,000","600000");
addOption(document.formLN.minimumPrice, "$650,000","650000");
addOption(document.formLN.minimumPrice, "$700,000","700000");
addOption(document.formLN.minimumPrice, "$750,000","750000");
addOption(document.formLN.minimumPrice, "$800,000","800000");
addOption(document.formLN.minimumPrice, "$850,000","850000");
addOption(document.formLN.minimumPrice, "$900,000","900000");
addOption(document.formLN.minimumPrice, "$950,000","950000");
addOption(document.formLN.minimumPrice, "$1,000,000","1000000");
addOption(document.formLN.minimumPrice, "$1,500,000","1500000");
addOption(document.formLN.minimumPrice, "$2,000,000","2000000");
addOption(document.formLN.minimumPrice, "$2,500,000","2500000");
addOption(document.formLN.minimumPrice, "$3,000,000","3000000");
addOption(document.formLN.minimumPrice, "$3,500,000","3500000");
addOption(document.formLN.minimumPrice, "$4,000,000","4000000");

addOption(document.formLN.maximumPrice, "Maximum Price","0");
addOption(document.formLN.maximumPrice, "$500","500");
addOption(document.formLN.maximumPrice, "$1,000","1000");
addOption(document.formLN.maximumPrice, "$25,000","25000");
addOption(document.formLN.maximumPrice, "$50,000","50000");
addOption(document.formLN.maximumPrice, "$100,000","100000");
addOption(document.formLN.maximumPrice, "$150,000","150000");
addOption(document.formLN.maximumPrice, "$200,000","200000");
addOption(document.formLN.maximumPrice, "$250,000","250000");
addOption(document.formLN.maximumPrice, "$300,000","300000");
addOption(document.formLN.maximumPrice, "$350,000","350000");
addOption(document.formLN.maximumPrice, "$400,000","400000");
addOption(document.formLN.maximumPrice, "$450,000","450000");
addOption(document.formLN.maximumPrice, "$500,000","500000");
addOption(document.formLN.maximumPrice, "$550,000","550000");
addOption(document.formLN.maximumPrice, "$600,000","600000");
addOption(document.formLN.maximumPrice, "$650,000","650000");
addOption(document.formLN.maximumPrice, "$700,000","700000");
addOption(document.formLN.maximumPrice, "$750,000","750000");
addOption(document.formLN.maximumPrice, "$800,000","800000");
addOption(document.formLN.maximumPrice, "$850,000","850000");
addOption(document.formLN.maximumPrice, "$900,000","900000");
addOption(document.formLN.maximumPrice, "$950,000","950000");
addOption(document.formLN.maximumPrice, "$1,000,000","1000000");
addOption(document.formLN.maximumPrice, "$1,500,000","1500000");
addOption(document.formLN.maximumPrice, "$2,000,000","2000000");
addOption(document.formLN.maximumPrice, "$2,500,000","2500000");
addOption(document.formLN.maximumPrice, "$3,000,000","3000000");
addOption(document.formLN.maximumPrice, "$3,500,000","3500000");
addOption(document.formLN.maximumPrice, "$4,000,000+","99000000");
}

}


function checkWaterfront()
{
if (document.formLN.waterfront.checked == true) {
document.the_form.waterfront.checked = true;
}
else {
document.the_form.waterfront.checked = false;
}

}


function setMinPrice2 () {
    var i = document.the_form.maxprice.selectedIndex;
    if (i > 0 && i < document.the_form.minprice.selectedIndex) {
        document.the_form.minprice.options[i-1].selected = true;
    }
}

function setMaxPrice2 () {
    var i = document.the_form.minprice.selectedIndex;
    if (i > 0 && i < (document.the_form.minprice.length - 1)) {
        if (i > document.the_form.maxprice.selectedIndex) {
            document.the_form.maxprice.options[i+1].selected = true;
        }
    } else {
        document.the_form.maxprice.options[0].selected = true;
    }
}



function setCityString2 () {
var strCityString = 'Test!';
len = document.the_form.tempcity.length;
i = 0


for (i = 0; i < len; i++) {
strCityString = strCityString + ', ' + document.the_form.tempcity[i].value;
}

strCityString = strCityString.replace(/Test!, /,"");
strCityString = strCityString.replace(/Test!/,"");

return strCityString;
}


function setHomeTypes2 () {
var strHomeType = 'Test!';
len = document.getElementById("hometypes").length;
i = 0


for (i = 0; i < len; i++) {
if (document.the_form.hometypes[i].selected) {
strHomeType = strHomeType + ', ' + document.the_form.hometypes[i].value;
}     
}

strHomeType = strHomeType.replace(/Test!, /,"");
strHomeType = strHomeType.replace(/Test!/,"");

return strHomeType;
}



function popupCMITI2 (vhometypes,vbedrooms,vbathrooms,vminprice,vmaxprice,vcity,vschool_district) {

var url;

url = 'http://www.cmiti.com/baer/email-popup.asp?hometypes=' + vhometypes + '&bedrooms=' + vbedrooms + '&bathrooms=' + vbathrooms + '&minprice=' + vminprice + '&maxprice=' + vmaxprice + '&city=' + vcity + '&school_district=' + vschool_district;

day = new Date();
id = day.getTime();

eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600,left = 540,top = 225');");

}