var nexti=0;
Rmapcoords=new Array();
Rmapnom   =new Array();
Rmapurl   =new Array();
Rmapcam   =new Array();

var x,y; 
var ms=navigator.appVersion.indexOf("MSIE");
var ie4=(ms>0)&&(parseInt(navigator.appVersion.substring(ms+5,ms+6))>=4);

function RmapJab(x,y) {
  if(ie4>0) {
    document.all.where.style.left = x-30;
    document.all.where.style.top = y-0+48;
    document.all.what.style.top = y-20;
    document.all.navi.style.top = y-120;
    scroll(0,y-250); }
  else {
    document.where.left = x-5;
    document.where.top = y-52;
    document.what.top = y-120;
    document.navi.top = y-220;
    scrollTo(0,y-150); }
  }

function RmapPlace(z) {
  RmapJab((document.panel.hotel.options[z].value).substring(0,4),(document.panel.hotel.options[z].value).substring(4,8));
  document.all["legend"].innerHTML = Rmapnom[z]+" ";
  if(Rmapurl[z]!=""){
    document.all["legend"].innerHTML += ", click for <a target=rw href=http://"+Rmapurl[z]+">website</a>"}
  if(Rmapcam[z]!=""){
    document.all["legend"].innerHTML += "<br>webcam:<br><img src=http://"+Rmapcam[z]+" width=280 height=210>"}
  }

function RmapInit(setcoords,setnom,seturl,setcam){
  Rmapcoords[nexti]=setcoords;
  Rmapnom[nexti]   =setnom;
  Rmapurl[nexti]   =seturl;
  if(RmapInit.arguments.length>3) Rmapcam[nexti]= setcam;
  else Rmapcam[nexti]= "";
  nexti=nexti+1;
  }
RmapInit("00000000","---resort---");
RmapInit("04050157","Abondance","www.valdabondance.com","www.valdabondance.com/IPsy.jpg");
RmapInit("01810969","Alpe-d'Huez","www.alpedhuez.com");
RmapInit("04990328","Argentiere","www.chamonix.com");
RmapInit("03840191","Avoriaz","www.avoriaz.com","neige.skiinfo.fr/_webcam/avoriaz/webcam/camera1.jpg");
RmapInit("05750731","Bonneval-s-Arc","www.bonneval-sur-arc.com");
RmapInit("04980356","Chamonix","www.chamonix.com","www.chamonet.com/webcam/jpg/chami1.jpg");
RmapInit("04470685","Champagny","www.champagny.com");
RmapInit("04680226","Champery","www.champery.com");
RmapInit("04460144","Chatel","www.chatel.com","www.trinum.com/ibox/chatel/Images/p04_chatel.jpg");
RmapInit("02520360","Chinaillon","");
RmapInit("03740398","Combloux","www.combloux.com","www.trinum.com/ibox/combloux/Images/dome2.jpg");
RmapInit("03450374","Cordon","www.cordon-ot.com/anglais/index3.html");
RmapInit("04010727","Courchevel","www.courchevel.com");
RmapInit("03100504","Crest-Voland","www.crestvoland-cohennoz.com");
RmapInit("03840332","Flaine","www.flaine.com","www.trinum.com/ibox/grandmassif/images/flaine4.jpg");
RmapInit("03070468","Flumet","");
RmapInit("02650413","la Clusaz","www.laclusaz.com","www.trinum.com/ibox/clusaz/Images/webcams/webcam13.jpg");
RmapInit("02930432","la Giettaz","www.la-giettaz.com");
RmapInit("02790985","la Grave","www.la-grave.com","www.la-grave.com/webcam/m_2400.jpg");
RmapInit("04020638","la Plagne","www.la-plagne.com","www.la-plagne.com/camera/fullsize.jpg");
RmapInit("05320560","la Rosiere","www.larosiere.net","www.regione.vda.it/bollettino_neve/images/la%20thuile.jpg");
RmapInit("03890705","la Tania","www.latania.com","camera.soprane.fr/latania/camera1/halfsize.jpg");
RmapInit("02520360","le Grand Bornand","www.legrandbornand.com","neige.skiinfo.fr/_webcam/grdbo/image_0000000001.jpg");
RmapInit("05190302","le Tour","");
RmapInit("04900618","les Arcs","www.lesarcs.com","www.lesarcs.com/IMG/jpg/webcam_arc1800-2.jpg");
RmapInit("03670304","les Carroz","www.lescarroz.com");
RmapInit("04520452","les Contamines","www.lescontamines.com","www.secmh.fr/camera/webcam.jpg");
RmapInit("02560841","le Corbier","www.le-corbier.com");
RmapInit("04480210","les Crosets","www.valdilliez.ch");
RmapInit("02101010","les Deux Alpes","www.2alpes.com");
RmapInit("03530229","les Gets","www.lesgets.com","www.stella-galaxy-usa.com/lgcam02.jpg");
RmapInit("04520396","les Houches","www.leshouches.com");
RmapInit("03510777","les Menuires","www.lesmenuires.com","lesmenuires.com/photo/webcam/shot11.jpg");
RmapInit("03760516","les Saisies","www.lessaisies.com","www.lessaisies.com/photos/webcam/petit11.jpg");
RmapInit("03750423","Megève","www.megeve.com","www.trinum.com/ibox/megeve/Images/arbois14.jpg");
RmapInit("03830750","Méribel","www.meribel.net","www.meribel.net/camera/fullsize.jpg");
RmapInit("04411047","Montgenevre","www.montgenevre.com");
RmapInit("04690175","Morgins","www.morgins.ch");
RmapInit("03750282","Morillon","www.ot-morillon.fr","www.ski-sixt.com/webcam/G1sairon/G1sairon_00001.jpg");
RmapInit("03520197","Morzine","www.morzine.com","www.hotelequipe.fr/img/webcam.jpg");
RmapInit("03330484","ND Bellecombe","www.notredamedebellecombe.com");
RmapInit("04440633","Peisey","www.peisey-vallandry.com");
RmapInit("05070740","Pralognan","www.pralognan.com","www.pralognan.com/webcam/pralognan_00002.jpg");
RmapInit("03420447","Praz-s-Arly","www.prazsurarly.com/index2.html","www.trinum.com/ibox/prazsurarly/Images/Webcam/cam3full.jpg");
RmapInit("04070255","Samoens","www.samoens.com/index_en.html","www.ski-sixt.com/webcam/G2Saix/G2Saix_00001.jpg");
RmapInit("05150600","St.Foy","www.saintefoy.net");
RmapInit("04160419","St.Gervais","www.saintgervais.com");
RmapInit("02530390","St.Jean-de-Sixt","www.saintjeandesixt.com");
RmapInit("03460749","St.Martin-Bel'ville","st-martin-belleville.com/ete_en/accueil/index_stm.php?","www.trinum.com/ibox/menuires/Images/image_00001.jpg");
RmapInit("03401036","Serre-Chevalier","www.Serre-Chevalier.com","www.ot-serrechevalier.fr/images/image.jpg");
RmapInit("05130664","Tignes","www.tignes.net");
RmapInit("05150790","Valcenis","www.valcenis.com","www.trinum.com/ibox/valcenis/images/valcenis4.jpg");
RmapInit("05660683","Val d\'Isere","www.valdisere.com");
RmapInit("03690800","Val Thorens","www.valthorens.com");
RmapInit("04190878","Valfréjus","www.valfrejus.com/anglais/ang_idx_hiver.htm","www.trinum.com/ibox/valfrejus/Images/webcam_00001.jpg");
RmapInit("04470628","Vallandry","www.peisey-vallandry.com");
RmapInit("03120874","Valloire","www.valloire.net");
RmapInit("02950669","Valmorel","www.valmorel.com/index.jsp?SDP_CHANGE_USERLANG=en","neige.skiinfo.fr/_webcam/valmorel/Cam2_0000000001.jpg");
RmapInit("01750934","Vaujany","www.vaujany.com");

function RmapFill() {
  for (it=1;it<Rmapcoords.length;it++) {
    if (Rmapcam[it]!="") {
      xy=Rmapcoords[it];
      x=xy.substring(0,4)-6;
      y=xy.substring(4,8)-0+50;
      document.write('<div STYLE="position:absolute; top:'+y+'; left:'+x+';z-index:7;"><img src="../images/webcam.gif" alt="webcam"></div>');
      }
    }
  }

function RmapResorts() {
  for(it=0;it<Rmapnom.length;it++) document.write("<option value="+Rmapcoords[it]+">"+Rmapnom[it]+"</option>");
  }

function RmapShow(pane) {
  sxy=""+this.location;
  sxy=sxy.substring(sxy.indexOf("?")+1, sxy.length);
  a=sxy.split(",");
  x=a[0]-0; //coordinates of where cursor clicked
  y=a[1]-22;
  y=y+pane*312;
  x=x+25;
  zoo=99999; //distance from resort icon, search for nearest
  for (it=1;it<Rmapcoords.length;it++) {
    if (Rmapurl[it]!="") {
      sit=Rmapcoords[it];
      zx=sit.substring(0,4)-x;
      zy=sit.substring(4,8)-y;
      zx=zx*zx;
      zy=zy*zy;
      if (zx+zy<zoo) {
        zoo=zx+zy;
        zit=it; //index of nearest resort to click point
        }
      }
    }
    RmapPlace(zit);
  }
