﻿if (document.layers){
  //Netscape 4 specific code
  pre = 'document.';
  preobj = 'document';
  endobj = '';
  post = '';
} else if (document.getElementById) {
  //Netscape 6 specific code
  pre = 'document.getElementById("';
  preobj = 'document.getElementById("';
  endobj = '")';
  post = '").style';
} else {
  //IE4+ specific code
  pre = 'document.all.';
  preobj = 'document.all';
  endobj = '';
  post = '.style';
} 

function hilite(cityId)
{
    deliteall();
    eval(preobj+'city'+cityId+post).fontWeight='bold';
}

function delite(cityId)
{
    deliteall();
    eval(preobj+'city'+cityId+post).fontWeight='normal';
}

function deliteall()
{
    var cities=document.getElementsByTagName("div");
    for (i=0; i<cities.length; i++)
    {
        if (cities[i].id.substr(0,4)=="city")
        {
             if (cities[i].style.fontWeight='bolder')
             {
                  cities[i].style.fontWeight='normal';
             }
        }
    }
}

function lightme(cityID)
{
    hilite(cityID);
    var myobj=new Object();
    myobj=eval(preobj+'world_scroll'+endobj);
    myobj.light(cityID);
}

function darkme(cityID)
{
    delite(cityID);
    var myobj=new Object();
    myobj=eval(preobj+'world_scroll'+endobj);
    myobj.dark(cityID);
}

function city_goto(cityID)
{
    var myPage=window.location.pathname.substring(window.location.pathname.lastIndexOf('/')+1).toLowerCase().replace('voorwaarden', 'stad');
    location=myPage+'?stad='+cityID;
}

function kaartje(mywidth, bcolor)
{
    var kaart_width = mywidth;
    var kaart_height = kaart_width*0.75;
       
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+kaart_width+'" height="'+kaart_height+'" id="world_scroll" align="middle">');
    document.write('<param name="flashVars" value="bcolor='+bcolor+'" />');
    document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="flash/world_scroll.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />');
    document.write('<embed flashVars="bcolor='+bcolor+'" src="flash/world_scroll.swf" quality="high" bgcolor="#ffffff" width="'+kaart_width+'" height="'+kaart_height+'" name="world_scroll" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
          
    window.world_scroll = document.getElementById('world_scroll');
}

function loadhotel(myhotel)
{
    GetExtraInfo(1, myhotel);
}

function loadsight(mysight)
{
    GetExtraInfo(2, mysight);
}

function uphotel(hotelID)
{
    var myobj=new Object();
    myobj=getObj('city_map');
    //myobj.SetVariable("watchObject.focusLocation", hotelID);
    myobj.SetVariable("watchObject.focusLocation", hotelID);
}

function downhotel(hotelID)
{
    var myobj=new Object();
    myobj=getObj('city_map');
    //myobj.SetVariable("watchObject.focusLocation", '0');
    myobj.SetVariable("watchObject.focusLocation", '0');
}

function showCityMap(cityid)
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="225" id="city_map" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="flash/map/map.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#f5efde" /><embed src="flash/map/map.swf" quality="high" bgcolor="#f5efde" width="300" height="225" name="city_map" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
    window.city_map = getObj('city_map');
}
