
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
  

function hideMapping() {
 if(document.getElementById) {
  if (parent.hauptmenu) {
   var mapElement = parent.hauptmenu.document.getElementById("ortinforahmen");
  }
  else if (parent) {
   var mapElement = parent.document.getElementById("ortinforahmen");
  }
  if (mapElement) {
   mapElement.style.visibility = "hidden";
  }
 }
}

function showMapping(citynum) {
 if(document.getElementById) {
  if (parent.hauptmenu) {
   var mapElement = parent.hauptmenu;
  }
  else if (parent) {
   var mapElement = parent;
  }
  if (mapElement.CityInfo && mapElement.CityInfo[citynum]) {
   listInfo = mapElement.CityInfo[citynum].split("|");
   if (listInfo[1] != "") { //Land vorhanden
    if (mapElement.document.getElementById("ortlandkarte")) {
     if (listInfo[0] != "" && listInfo[2] != "" && listInfo[3] != "") { //Ort+Pos vorhanden
      if (location.protocol != "file:") {
       var pfadImg = "/site/images/";
      } else {
       var pfadImg = "../images/";
      }
      mapElement.document.getElementById("ortbezeichnung").innerHTML = "<B>" + listInfo[1].toUpperCase() + "</B><BR>";
      posLeft = listInfo[2] - 0 - 4;
      mapElement.document.getElementById("ortposition").style.left = parseInt(posLeft) + "px";
      posTop = listInfo[3] - 0 + 19;
      mapElement.document.getElementById("ortposition").style.top = parseInt(posTop) + "px";
      mapElement.document.getElementById("ortposition").innerHTML =   
       "<IMG SRC='" + pfadImg + "map-point.gif' WIDTH=10 HEIGHT=10 BORDER=0 ALT=''>";
      mapElement.document.getElementById("ortlandkarte").innerHTML =   
       "<IMG SRC='" + pfadImg + "map-" + listInfo[1].toLowerCase() + ".jpg' WIDTH=205 HEIGHT=142 BORDER=0 ALT=''><BR>";
      mapElement.document.getElementById("ortbeschreibung").innerHTML =   
       "<IMG SRC='" + pfadImg + "map-point.gif' WIDTH=10 HEIGHT=10 BORDER=0 ALT=''> <B>" +
       listInfo[0] + "</B><BR><BR>" + listInfo[4];
      if (navigator.userAgent.indexOf("MSIE")>0 && location.protocol == "file:") {
       //IE-Hack weil der Explorer den Rand innerhalb der Box statt ausserhalb der Box sieht
       mapElement.document.getElementById("ortinforahmen").style.width = "209px";
      }
      //Rahmen über bestimmten Block positionieren
      if (mapElement.layerPositionieren) {
       mapElement.layerPositionieren();
      }
      //if (mapElement.document.getElementById("block-i18nblocks-10")) {   
      // mapElement.document.getElementById("ortinforahmen").style.left = parseInt(findPosX(mapElement.document.getElementById("block-i18nblocks-10"))) + "px";
      // mapElement.document.getElementById("ortinforahmen").style.top = parseInt(findPosY(mapElement.document.getElementById("block-i18nblocks-10"))) + "px";
      //}
      mapElement.document.getElementById("ortinforahmen").style.visibility = "visible";
     }
    } else {
     mapElement.document.getElementById("ortinforahmen").style.visibility = "hidden";
    }
   }
  } else {
   mapElement.document.getElementById("ortinforahmen").style.visibility = "hidden";
  }
 }
}

function map(bildname) {
 bildfenster=window.open(bildname,"gross","menubar=1,location=0,directories=0,toolbar=0,status=0,scrollbars=1,resizable=1,width=600,height=420");
 bildfenster.focus();
}

function gross(bildname) {
 bildfenster=window.open(bildname,"gross","menubar=0,location=0,directories=0,toolbar=0,status=0,scrollbars=1,resizable=1,width=380,height=300");
 bildfenster.focus();
}

function reservation(sprache,user,aktion) {
 if (aktion == null) aktion = '';
 if (user == "") {  //Keine Buchungsmöglichkeit vorhanden
   if (sprache == "d") {
     alert("Dieses Hotel ist noch nicht &uuml;ber unser Reservationssystem buchbar.\nBitte kontaktieren Sie das Hotel direkt per E-Mail (siehe rechte Seite).\nBesten Dank.");
   } else {
     alert("This hotel is not yet bookable through our booking service.\nPlease contact the hotel by email at your right hand side.\nThank you.");
   }
 } else {
   if (user.indexOf("://") > 0) {  //Linkadresse vorhanden
     userLink = user.split("$");
     if (userLink[0] == null) userLink[0] = '';
     if (userLink[1] == null) userLink[1] = '';
     if (userLink[0] != "" && aktion == "") {     //Link ist Zimmerbuchung
       window.open(userLink[0],"roombooking","menubar=1,location=0,directories=0,toolbar=1,status=1,scrollbars=1,resizable=1");
     }
     if (userLink[1] != "" && aktion == "pa1") {  //Link ist Package
       window.open(userLink[1],"packagebooking","menubar=1,location=0,directories=0,toolbar=1,status=1,scrollbars=1,resizable=1");
     }
   } else {                        //Bookingcode vorhanden
     packPos = user.indexOf("$");
     if (packPos > 0) {
      user = user.substring(0,packPos);
     }
     window.open("http://www.bookingsystem.ch/sih/booking.cgi?user="+user+"&lang="+sprache+"&caller=sih&action="+aktion,"booking","menubar=1,location=0,directories=0,toolbar=1,status=1,scrollbars=1,resizable=1,width=680,height=460");
   }
 }
}

function mailit(mailadr) {
 mailwin=window.open("http://www.sih.ch/goto/go.cgi?to="+mailadr,"mailme","menubar=0,location=0,directories=0,toolbar=0,status=0,scrollbars=0,resizable=0,width=100,height=100");
 setTimeout("mailwin.close()",3000);
}
