
var dhtml = false;
var NS3 = false
var bN = navigator.appName;
var bV = parseInt(navigator.appVersion);
if ((bN=="Netscape") & (bV<=3.9)) NS3=true
if ((!NS3) && ((document.layers) || (document.all)) || (document.getElementById)) dhtml=true
Init(false);

function SelectAll(){
        Init(false);
        Do();
}
function DeselectAll(){
        Init(true);
        Do();
}
function Invert(){
        Do();
}
function Do ()
{
        var a_tags = MapTable.all.tags('a');    
    for (counter=0; counter<a_tags.length; counter++)
    {   
                eval(a_tags[counter].href);
        }               
        var area_tags = MapTable.all.tags('area');      
    for (counter=0; counter<area_tags.length; counter++)
    {   
                eval(area_tags[counter].href);
        }               
}

function displayText(text){

        text = '<table bgcolor="white" width=200><tr><td align=left><font face="arial,helvetica, geneva" size=1>' + text + '</font></td></tr></table>'
        if ((!NS3) && (document.layers)) {
                document.layers['ilayer1'].document.layers['displayFieldNetscape'].visibility='show'
                document.layers['ilayer1'].document.layers['displayFieldNetscape'].document.open()
                document.layers['ilayer1'].document.layers['displayFieldNetscape'].document.write(text)
                document.layers['ilayer1'].document.layers['displayFieldNetscape'].document.close()

        } else if ((!NS3) && (document.all)){
                document.all["displayFieldIE"].innerHTML=text;
        } else if ((!NS3) && (document.getElementById)) {
                document.getElementById("displayFieldIE").innerHTML=text;
        }
}

function showheading (text)
{
        if (dhtml)
        {
                displayText(text);
    }
}

function none(){
        if (dhtml) {
                displayText('&nbsp;')
        }

}

imgsrc = new Array();
imgsrc[0] = "images/tr.gif";
imgsrc[1] = "images/gv_h.gif";
imgsrc[2] = "images/ch_h.gif";
imgsrc[3] = "images/es.gif";
imgsrc[4] = "images/es_h.gif";
imgsrc[5] = "images/ev_h.gif";
imgsrc[6] = "images/gr_h.gif";
imgsrc[7] = "images/harlem.gif";
imgsrc[8] = "images/harlem_h.gif";
imgsrc[9] = "images/me.gif";
imgsrc[10] = "images/me_h.gif";
imgsrc[11] = "images/mh.gif";
imgsrc[12] = "images/mh_h.gif";
imgsrc[13] = "images/mw.gif";
imgsrc[14] = "images/mw_h.gif";
imgsrc[15] = "images/soho_h.gif";
imgsrc[16] = "images/tr_h.gif";
imgsrc[17] = "images/ues.gif";
imgsrc[18] = "images/ues_h.gif";
imgsrc[19] = "images/uws.gif";
imgsrc[20] = "images/uws_h.gif";
imgsrc[21] = "images/wall_h.gif";
imgsrc[22] = "images/washington.gif";
imgsrc[23] = "images/washington_h.gif";
imgsrc[24] = "images/ues.gif";
imgsrc[25] = "images/ues_h.gif";
imgsrc[26] = "images/ws.gif";
imgsrc[27] = "images/ws_h.gif";
imgsrc[28] = "images/wall.gif";
imgsrc[29] = "images/gv.gif";
imgsrc[30] = "images/ev.gif";
imgsrc[31] = "images/ch-gr.gif"
imgsrc[32] = "images/ch-gr_h.gif"

function getAppVersion() {
appname= navigator.appName;
appversion = navigator.appVersion;
majorver = appversion.substring(0, 1);
if ( (appname == "Netscape") && ( majorver >= 3 ) ) return 1;
if ( (appname == "Microsoft Internet Explorer") && (majorver
>= 4) ) return 1;
return 0;
}

function swtch(num, imgname) {
if (getAppVersion()) {
document[imgname].src = img[num].src;
}
}

if (getAppVersion()) {
img = new Array();
for (i = 0; i < imgsrc.length; i++) {
img[i] = new Image();
img[i].src = imgsrc[i];
}
}
var v_wallstreet = false;
var v_wallstreet = false;
var v_tribeca = false;
var v_eastvillage = false;
var v_greenwichvillage = false;
var v_gramercy = false;
var v_chelsea = false;
var v_murrayhill = false;
var v_midtowneast = false;
var v_midtownwest = false;
var v_eastside = false;
var v_westside = false;
var v_uppereastside = false;
var v_upperwestside = false;
var v_harlem = false;
var v_washington = false;
var firstinlist = true;
var v_wallstreet = false;
var v_tribeca = false;
var v_eastvillage = false;
var v_greenwichvillage = false;
var v_gramercy = false;
var v_chelsea = false;
var v_murrayhill = false;
var v_midtowneast = false;
var v_midtownwest = false;
var v_eastside = false;
var v_westside = false;
var v_uppereastside = false;
var v_upperwestside = false;
var v_harlem = false;
var v_washington = false;
var firstinlist = true;
        
function Init(value)
{
        v_wallstreet = value;
        v_tribeca = value;
        v_eastvillage = value;
        v_greenwichvillage = value;
        v_gramercy = value;
        v_chelsea = value;
        v_murrayhill = value;
        v_midtowneast = value;
        v_midtownwest = value;
        v_eastside = value;
        v_westside = value;
        v_uppereastside = value;
        v_upperwestside = value;
        v_harlem = value;
        v_washington = value;
        v_wallstreet = value;
        v_tribeca = value;
        v_eastvillage = value;
        v_greenwichvillage = value;
        v_gramercy = value;
        v_chelsea = value;
        v_murrayhill = value;
        v_midtowneast = value;
        v_midtownwest = value;
        v_eastside = value;
        v_westside = value;
        v_uppereastside = value;
        v_upperwestside = value;
        v_harlem = value;
        v_washington = value;

        firstinlist = !value;
}


function UpdateList(){
        text='';
        textTable='';
        
        firstinlist=true;
        
        
        if (v_washington) {
                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                
                text = 'Washington Heights' + text;


        }
        if (v_harlem) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }

                text = 'Harlem' + text ;

        }
        if (v_wallstreet) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Financial District' + text;

        }
        if (v_tribeca) {

                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Battery Park City' + text;


        }
        if (v_eastvillage) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'E. Greenwich Village' + text;

        }
        if (v_greenwichvillage) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Greenwich Village' + text;


        }
        if (v_gramercy) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Gramercy Park' + text;

        }
        if (v_chelsea) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Chelsea' + text;


        }
        if (v_murrayhill) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Murray Hill' + text;

        }

        if (v_midtowneast) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'East Midtown' + text;

        }
        if (v_midtownwest) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'West Midtown' + text;

        }
        if (v_eastside) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'East Side' + text;

        }
        if (v_westside) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'West Side' + text;

        }
        if (v_upperwestside) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Upper West Side' + text;

        }
        if (v_uppereastside) {


                if (firstinlist) {
                        firstinlist = false;
                }
                else {
                        text = ', ' + text;
                }
                text = 'Upper East Side' + text;

        }

        textTable = '<table bgcolor="white" width="340" height="45" border=0><tr valign="top"><td align=left><font face="arial,helvetica, geneva" size=1>' + text + '</font></td></tr></table>'
        
        if ((!NS3) && (document.all)){
               document.all["NeighborhoodList"].innerHTML=textTable;
               document.all["txtNeighborhoodList"].value=text;
       } else if ((!NS3) && (document.getElementById)) {
               document.getElementById("NeighborhoodList").innerHTML=textTable;
               document.getElementById("txtNeighborhoodList").value=text;
           }  
}


function click_chelsea(){
        if(v_gramercy){
                if(v_chelsea) {
                        swtch('6','chelsea-gramercy_map');
                        //parent.frames[0].location.href = "setsession.asp?loc=asp_chelsea&bool=0"
                        v_chelsea=false;
                }
                else{
                        swtch('32','chelsea-gramercy_map');
                        //parent.frames[0].location.href = "setsession.asp?loc=asp_chelsea&bool=1"
                        v_chelsea=true;
                }
        }
        else{
                if(v_chelsea) {
                        swtch('31','chelsea-gramercy_map');
                        //parent.frames[0].location.href = "setsession.asp?loc=asp_chelsea&bool=0"
                        v_chelsea=false;
                }
                else{
                        swtch('2','chelsea-gramercy_map');
                        //parent.frames[0].location.href = "setsession.asp?loc=asp_chelsea&bool=1"
                        v_chelsea=true;
                }
        }
        //document.forms[0]["v_chelsea"].value = v_chelsea;
        //document.forms[0]["v_gramercy"].value = v_gramercy;
        UpdateList();
}

function click_gramercy(){
        if(v_chelsea){
                if(v_gramercy) {
                        swtch('2','chelsea-gramercy_map');
                        v_gramercy=false;
                } else{
                        swtch('32','chelsea-gramercy_map');
                        v_gramercy=true;
                }
        } else{
                if(v_gramercy) {
                        swtch('31','chelsea-gramercy_map');
                        v_gramercy=false;
                }
                else{
                        swtch('6','chelsea-gramercy_map')
                        v_gramercy=true;
                }
        }
        //document.forms[0]["v_chelsea"].value = v_chelsea;
        //document.forms[0]["v_gramercy"].value = v_gramercy;
        UpdateList();
}

function click_washington(){
        if(v_washington){
                swtch('22','washington_map');
                v_washington=false;
        } else{
                swtch('23','washington_map');
                v_washington=true;
        }
        //document.forms[0]["v_washington"].value = v_washington;

        UpdateList();
}

function click_harlem(){
        if(v_harlem){
                swtch('7','harlem_map');
                v_harlem=false;
        } else{
                swtch('8','harlem_map');
                v_harlem=true;
        }
        //document.forms[0]["v_harlem"].value = v_harlem;
        UpdateList();

}

function click_wallstreet(){
        if(v_wallstreet){
                swtch('28','wallstreet_map');
                v_wallstreet=false;
        } else{
                swtch('21','wallstreet_map');
                v_wallstreet=true;
        }
        //document.forms[0]["v_wallstreet"].value = v_wallstreet;
        UpdateList();
}
function click_tribeca(){
        if(v_tribeca){
                swtch('0','tribeca_map');
                v_tribeca=false;
        } else{
                swtch('16','tribeca_map');
                v_tribeca=true;
        }
        //document.forms[0]["v_tribeca"].value = v_tribeca;
        UpdateList();
}
function click_eastvillage(){
        if(v_eastvillage){
                swtch('30','eastvillage_map');
                v_eastvillage=false;
        } else{
                swtch('5','eastvillage_map');
                v_eastvillage=true;
        }
        //document.forms[0]["v_eastvillage"].value = v_eastvillage;
        UpdateList();
}
function click_greenwichvillage(){
        if(v_greenwichvillage){
                swtch('29','greenwichvillage_map');
                v_greenwichvillage=false;
        } else{
                swtch('1','greenwichvillage_map');
                v_greenwichvillage=true;
        }
        //document.forms[0]["v_greenwichvillage"].value = v_greenwichvillage;
        UpdateList();
}
function click_murrayhill(){
        if(v_murrayhill){
                swtch('11','murrayhill_map');
                v_murrayhill=false;
        } else{
                swtch('12','murrayhill_map');
                v_murrayhill=true;
        }
        //document.forms[0]["v_murrayhill"].value = v_murrayhill;
        UpdateList();
}
function click_midtowneast(){
        if(v_midtowneast){
                swtch('9','midtowneast_map');
                v_midtowneast=false;
        } else{
                swtch('10','midtowneast_map');
                v_midtowneast=true;
        }
        //document.forms[0]["v_midtowneast"].value = v_midtowneast;
        UpdateList();
}
function click_midtownwest(){
        if(v_midtownwest){
                swtch('13','midtownwest_map');
                v_midtownwest=false;
        } else{
                swtch('14','midtownwest_map');
                v_midtownwest=true;
        }
        //document.forms[0]["v_midtownwest"].value = v_midtownwest;
        UpdateList();
}
function click_eastside(){
        if(v_eastside){
                swtch('3','eastside_map');
                v_eastside=false;
        } else{
                swtch('4','eastside_map');
                v_eastside=true;
        }
        //document.forms[0]["v_eastside"].value = v_eastside;
        UpdateList();
}
function click_westside(){
        if(v_westside){
                swtch('26','westside_map');
                v_westside=false;
        } else{
                swtch('27','westside_map');
                v_westside=true;
        }
        //document.forms[0]["v_westside"].value = v_westside;
        UpdateList();
}
function click_uppereastside(){
        if(v_uppereastside){
                swtch('24','uppereastside_map');
                v_uppereastside=false;
        } else{
                swtch('25','uppereastside_map');
                v_uppereastside=true;
        }
        //document.forms[0]["v_uppereastside"].value = v_uppereastside;
        UpdateList();
}
function click_upperwestside(){
        if(v_upperwestside){
                swtch('19','upperwestside_map');
                v_upperwestside=false;
        } else{
                swtch('20','upperwestside_map');
                v_upperwestside=true;
        }
        //document.forms[0]["v_upperwestside"].value = v_upperwestside;
        UpdateList();
}






