/* hilight hotel entry */
function tBHotelHi(HotelID) {
var link = document.getElementById('h' + HotelID);
link.style.color = '#FF7F00';
link.style.textDecoration = 'underline';
}
/* unhilight hotel entry */
function tBHotelLo(HotelID) {
var link = document.getElementById('h' + HotelID);
link.style.color = '#000066';
link.style.textDecoration = 'none';
}
/* hilight special offer */
function tBSOHi(SpecialOfferID) {
var link = document.getElementById('s' + SpecialOfferID);
link.style.color = '#FF7F00';
link.style.textDecoration = 'underline';
}
/* unhilight special offer */
function tBSOLo(SpecialOfferID) {
var link = document.getElementById('s' + SpecialOfferID);
link.style.color = '#CC3333';
link.style.textDecoration = 'none';
}
/* hilight page arrow */
function tBPageHi(arrow) {
var link = document.getElementById(arrow);
link.style.color = '#FF7F00';
link.style.textDecoration = 'underline';
}
/* unhilight page arrow */
function tBPageLo(arrow) {
var link = document.getElementById(arrow);
link.style.color = '#000066';
link.style.textDecoration = 'none';
}
/* hilight roomtype entry */
function tBRTHi(RoomTypeID) {
var name = document.getElementById('rn' + RoomTypeID);
var link = document.getElementById('rl' + RoomTypeID);
name.className = "hitlist1_over";
link.className = "hitlist2_over";
}
/* unhilight roomtype entry */
function tBRTLo(RoomTypeID) {
var name = document.getElementById('rn' + RoomTypeID);
var link = document.getElementById('rl' + RoomTypeID);
name.className = "hitlist1_out";
link.className = "hitlist2_out";
}
function findPosX(obj){
//from http://blog.firetree.net/2005/07/04/javascript-find-position/ by Peter-Paul Koch & Alex Tingle
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;
}
//end
function showLegenda(objIMG){
var objDIV = document.getElementById("legenda");
objDIV.style.left = (findPosX(objIMG) - 20 ) + "px";
objDIV.style.top = (findPosY(objIMG) - 214) + "px";
objDIV.style.display = "block";
}
function hideLegenda(){
document.getElementById("legenda").style.display = "none";
}
function showHotelMap(intMode, intHotelID, intLangID){
tag_id = "div_hotelmap";
var strInnerHTML = "
" +
" " +
" please wait ... | " +
"
" +
"
";
var objMap = document.getElementById(tag_id);
objMap.innerHTML = strInnerHTML;
var objText = document.getElementById("div_hoteltext" + intHotelID);
if (intMode == 1){ //hitlist
if (isIE6()){
objMap.style.left = (findPosX(objText) + 215) + "px";
objMap.style.top = (findPosY(objText) - 190) + "px";
} else {
objMap.style.left = (findPosX(objText) + 80) + "px";
objMap.style.top = (findPosY(objText) - 170) + "px";
}
} else if (intMode == 2){ //citypage
if (isIE6()){
objMap.style.left = (findPosX(objText) + 100) + "px";
objMap.style.top = (findPosY(objText)) + "px";
} else {
objMap.style.left = (findPosX(objText) + 100) + "px";
objMap.style.top = (findPosY(objText)) + "px";
}
} else {
return 0;
}
objMap.style.display = "block";
xmlHttp = GetXmlHttpObject()
var url = "/ajax_gethotelgeocodes.asp";
url = url + "?sid=" + Math.random();
url = url + "&hotelID=" + intHotelID;
url = url + "&langID=" + intLangID;
xmlHttp.onreadystatechange = stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function hideHotelMap(){
document.getElementById("div_hotelmap").style.display = "none";
}
function isIE6(){
if (navigator.appName == 'Microsoft Internet Explorer'){
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null){
var ver = parseFloat( RegExp.$1 );
return ver == 6;
}
}
return false;
}
function GetXmlHttpObject(){
var objXMLHttp=null;
if (window.XMLHttpRequest){
objXMLHttp=new XMLHttpRequest();
} else if (window.ActiveXObject){
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function stateChanged(){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
var json_data = xmlHttp.responseText;
var result = eval("(" + json_data + ")" );
var jHotelID = result.hotelid;
var jMapURL = result.mapurl;
var jIconURL = result.iconurl;
var objMap = document.getElementById(tag_id);
var strInnerHTML = "" +
" " +
" " +
" " +
" | " +
"
" +
"
"
objMap.innerHTML = strInnerHTML;
}
}