//11.12.2008
var ajax = {
 "par" : ["url", "callback_function", "return_xml"],

// functions
 "msgBox" : function (r) {
  alert(r.getElementsByTagName("Message")[0].firstChild.nodeValue);
  //alert(r);
 },
 "makeHttpRequest" : function() {
  var http_request = false; 
  if (window.XMLHttpRequest) { // Mozilla, Safari,... 
   http_request = new XMLHttpRequest(); 
   if (http_request.overrideMimeType) { 
    http_request.overrideMimeType('text/xml; charset=ISO-8859-1');
   } 
  } else if (window.ActiveXObject) { // IE 
   try { 
    http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
   } catch (e) { 
     try { 
      http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
    } catch (e) {} 
   } 
  } 
   if (!http_request) { 
       alert('Unfortunatelly you browser doesn\'t support this feature.'); 
       return false; 
   }

   http_request.onreadystatechange = function() { 
       if (http_request.readyState == 4) { 
           if (http_request.status == 200) { 
               if (ajax.par.return_xml) { 
                   eval(ajax.par.callback_function + '(http_request.responseXML)'); 
               } else { 
                   eval(ajax.par.callback_function + '(http_request.responseText)'); 
               } 
           } else { 
               alert('There was a problem with the request.(Code: ' + http_request.status + ')'); 
           } 
       } 
   } 
    var method = 'GET';

   http_request.open(method, ajax.par.url, true); 
   http_request.send(null);
 }
}
var xml = {
 "getNumber" : function(oRootEl, tagName) {
  return oRootEl.getElementsByTagName(tagName).length;
 },
 "getAttribute" : function(oEl, attribute) {
  return oEl.getAttribute(attribute);
 },
 "getChildValue" : function(oRootEl, tagName, i) {
  return oRootEl.getElementsByTagName(tagName)[i].firstChild.nodeValue;
 }
}



var css = {
 "changerow" : function(row, m) {
  if(m==1) {
   row.style.background = ba_map.par.global.defaultBackground || "#CCC";
  }
  else {
   row.style.background = ba_map.par.global.defaultBoothColor || "#FFE";
  }
 }
}

var utils = {
 "browser" : function() {
  /*  Autor, Entwicklung 2003-2008 Kristof Lipfert Duesseldorf    */
  /*  Version 20080522                                            */
  check=[
   ['window.postMessage',
   'window.XMLHttpRequest&&(document.postMessage||window.external)',
   'document.compatMode',
   '(document.detachEvent||document.contentType)'],
   ['window.execScript','window.pkcs11','window.opera',
   'window.navigator&&window.navigator.vendor'],
   [['IE8','FF3','Op9.5','KDE?'],
   ['IE7','FF2','Op9','KDE?'],
   ['IE6','FF1.5','Op8','KDE/Safari3'],
   ['IE5x','NN7','Op7','KDE/Konqu.3']]];
   var j; var b; 
  for(n=0;n<check[1].length;n++){
   if(!eval(check[1][n])==0) {
    b=n; }
   }
  for(n=check[0].length;n>-1;n--){
   if(!eval(check[0][n])==0) {
    j=n;
   }
  }
  var b = (j>-1&&b>-1) ? check[2][j][b] : "Unbekannter Browser";
  return b;
 }
};

var ba_map = {
 "showId" : 0,
 "hallId" : 0,
 "hallIndex" : 0,
 "background" : null,
 "booths" : null,
 "working" : null,
 "overview" : null,
 "clipping" : null,
 "par" : null,
 "waiting" : null,
 "browser" : null,
 "constants" : { "lZ" : null, "sZ": null, "cW" : null, "rH" : null},
 "sessionTimeStamp" : 0,
 "init" : function() {
  ba_map.setSessionTimeStamp();
  ba_map.par = par;
  //ba_map.getShowId();
  ba_map.hallId = ba_map.getQueryString("hallId");
  
  //Workaround showID 452
  if(ba_map.getQueryString("tradeShowId")==770) {
   ba_map.hallId = 1444;
  }
  //end workaround
  
  //Workaround showID 595
  if(ba_map.getQueryString("tradeShowId")==595) {
   ba_map.hallId = 1489;
  }
  //end workaround
  
  ba_map.showId = ba_map.getQueryString("tradeshowID");
  ba_map.transparencyMode = utils.browser()=="IE6" ? ".gif" : ".png";
  ba_map.setHallIndex();
  ba_map.setConstants();
  ba_map.overrideParByQString();
  ba_map.overridePar();
  document.title = ba_map.par.global.tradeShow;
  ba_map.background = document.getElementById("background");
  ba_map.booths = document.getElementById("booths");
  ba_map.working = document.getElementById("working");
  ba_map.overview = document.getElementById("overview");
  ba_map.overviewBorder = document.getElementById("overviewBorder");
  ba_map.clipping = document.getElementById("clipping");
  ba_map.container = document.getElementById("ba_mapcontainer");
  ba_map.zoomControl = document.getElementById("zoomControl");
  ba_map.dnd.zoom.x =  Math.floor((ba_map.par.global.maximumZoom-ba_map.par.global.zoom) * 200 / (ba_map.par.global.maximumZoom-ba_map.par.global.minimumZoom))+12;
  ba_map.zoomControl.style.right = ba_map.dnd.zoom.x + "px";
  ba_map.dnd.zoom.gridPosition = ba_map.dnd.zoom.x;
  ba_map.container.style.width = ba_map.par.global.availableWidth + "px";
  ba_map.container.style.height = ba_map.par.global.availableHeight + "px";
  ba_map.booths.style.width = ba_map.par.global.availableWidth-2 + "px";
  ba_map.booths.style.height = ba_map.par.global.availableHeight-2 + "px";
  ba_map.getDefaultViewport();
  //ba_map.getDefaultView();
  //ba_map.drawing.showOverview();
  //ba_map.drawing.drawBackgroundTable();
  ba_map.dnd.hallplan.clipping = ba_map.screen.clipping().byRowsAndCols;
  ba_map.modules.print.showPrintDialog();
  ba_map.search.setAreaTab();
  ba_map.setDescription();
  ba_map.search.getAbc();
  ba_map.drawing.showHallName();
  ba_map.drawing.setPortalSkin();
  ba_map.setUnselectable(document.body);
 },
 "printinit" : function() {
  ba_map.setSessionTimeStamp();
  ba_map.par = par;
  ba_map.showId = ba_map.getQueryString("tradeshowID");
  ba_map.hallId = ba_map.getQueryString("hallId");
  ba_map.transparencyMode = utils.browser()=="IE6" ? ".gif" : ".png";
  ba_map.setHallIndex();
  ba_map.overridePar();
  ba_map.par.global.zoom = parseInt(ba_map.getQueryString("zoom"));
  ba_map.setConstants();
  document.title = ba_map.par.global.tradeShow;
  ba_map.background = document.getElementById("background");
  ba_map.booths = document.getElementById("booths");
  ba_map.working = document.getElementById("working");
  ba_map.container = document.getElementById("ba_mapcontainer");
  ba_map.container.style.width = ba_map.par.global.availableWidth + "px";
  ba_map.container.style.height = ba_map.par.global.availableHeight + "px";
  ba_map.booths.style.width = ba_map.par.global.availableWidth-2 + "px";
  ba_map.booths.style.height = ba_map.par.global.availableHeight-2 + "px";
  ba_map.dnd.hallplan.x = parseInt(ba_map.getQueryString("x"));
  ba_map.dnd.hallplan.y = parseInt(ba_map.getQueryString("y"));
  ba_map.drawing.drawBackgroundTable();
  ba_map.dnd.hallplan.move(true);
  ba_map.drawing.setPortalSkin();
  ba_map.setDescription();
 },
 "resizeinit" : function(w, h) {
  ba_map.setSessionTimeStamp();
  ba_map.par.global.availableWidth = w;
  ba_map.par.global.availableHeight = h;
  ba_map.container.style.width = ba_map.par.global.availableWidth + "px";
  ba_map.container.style.height = ba_map.par.global.availableHeight + "px";
  ba_map.booths.style.width = ba_map.par.global.availableWidth-2 + "px";
  ba_map.booths.style.height = ba_map.par.global.availableHeight-2 + "px";
  ba_map.drawing.showOverview();
  ba_map.drawing.setPortalSkin();
  ba_map.drawing.getBgrAndBooths(true);
 },
 "setConstants" : function() {
  ba_map.constants.sZ = ba_map.par.hall[ba_map.hallIndex].width/ba_map.par.hall[ba_map.hallIndex].overviewWidth,
  ba_map.constants.lZ = 100/ba_map.par.global.zoom,
  //colWidth
  ba_map.constants.cW = ba_map.par.hall[ba_map.hallIndex].width/ba_map.par.hall[ba_map.hallIndex].cols;
  //rowHeight
  ba_map.constants.rH = ba_map.par.hall[ba_map.hallIndex].height/ba_map.par.hall[ba_map.hallIndex].rows;
 },
 "setShowId" : function(r) {
  ba_map.showId = xml.getChildValue(r, "showId", 0);
  //Img src des Geländeplans neu schreiben
  if(ba_map.par.global.showArea) {
   ba_map.DOM_img.src = "gelaendeplan_" + ba_map.showId + ".gif";
  }
 },
 "setHallIndex" : function() {
  for (var i=0; i<ba_map.par.hall.length; i++) {
   if(ba_map.par.hall[i].id==ba_map.hallId) {
    ba_map.hallIndex = i;
    break;
   }
  }
 },
 "overridePar" : function() {
  if(ba_map.par.hall[ba_map.hallIndex].override) {
   var ov = ba_map.par.hall[ba_map.hallIndex].override.show[ba_map.showId];
   if(ov!=undefined) {
    for (var item in ov) {
     ba_map.par.global[item] = ov[item];
    }
   }
  }
 },
 "overrideParByQString" : function() {	
	
	//width
	var w = ba_map.getQueryString("width");
	if(w && !isNaN(w)) {
		
		ba_map.par.global.availableWidth = w - 2;	
	
	}	
	
	//height
	var h = ba_map.getQueryString("height");
	if(h && !isNaN(h)) {
		
		ba_map.par.global.availableHeight = h - 2;	
	
	}
 },
 "getLanguage" : function() {
  switch (ba_map.getQueryString("language")) {
   case "de":
    return 0;
    break;
   case "en":
    return 1;
    break;
   case "fr":
    return 2;
    break;
   default:
    return 0;
    break;
  }
 },
 "setDescription" : function() {
  var s = ba_map.getLanguage();
  for(i=0; i<sprachArray.length; i++)	{
   try {
    var textString = sprachArray[i][s];
    var newText = document.createTextNode(textString);
    var aktKnoten = document.getElementById("text"+i);
    while(aktKnoten.hasChildNodes()) {
     aktKnoten.removeChild(aktKnoten.lastChild);
    }
    aktKnoten.appendChild(newText);
   }
   catch(e) {
   }
  }
  if(ba_map.getQueryString("view")=="print") {
   //TODO --> in function hallNam etc.
   var hallName = ba_map.isArray(ba_map.par.hall[ba_map.hallIndex].name) ? ba_map.par.hall[ba_map.hallIndex].name[ba_map.getLanguage()] : ba_map.par.hall[ba_map.hallIndex].name;
   var n = (hallName!="") ? ba_map.par.global.tradeShow + ", " + hallName : ba_map.par.global.tradeShow;
   var DOM_text = document.createTextNode(n);
   try {
    document.getElementById("head1").appendChild(DOM_text);
   }
   catch(e) {
   }
  }
 },
 "getQueryString" : function(q) {
  var qs = document.location.search;
  var returnStr = "";
  qs = qs.substr(1);
  var qsSplitted = qs.split("&");
  for (var i=0; i<qsSplitted.length; i++) {
   var dString = qsSplitted[i].split("=");
   if(dString[0].toLowerCase()==q.toLowerCase()) {
    return dString[1];
    break;
   }
  }
  return false;
 },
 "getDefaultViewport": function() {  
  var companyid = ba_map.getQueryString("companyid");
  ajax.par.url = "/ngn/hallplan/getDefaultViewport.Ajax.asp?hallID=" + ba_map.hallId + "&showID=" + ba_map.getQueryString('tradeshowID') + "&companyid=" + companyid+"&instance="+ba_map.par.global.instance+"&organizer="+ba_map.par.global.organizer;
   ajax.par.callback_function = "ba_map.drawing.drawDefaultViewport";
   ajax.par.return_xml = true;
   ajax.makeHttpRequest();
 },
 "control" : function(e) {
  if(!ba_map.dnd.hallplan.moveByInAction) {
   if(!e) {
    e = window.event;
   }
   try {
    ba_map.mouse.x = e.clientX-ba_map.container.offsetLeft;
    ba_map.mouse.y = e.clientY-ba_map.container.offsetTop;
    if(ba_map.dnd.hallplan.isLocked == false) {
     ba_map.dnd.hallplan.dnd();
    }
    if(ba_map.dnd.overview.isLocked == false) {
     ba_map.dnd.overview.dnd();
    }
    if(ba_map.dnd.zoom.isLocked == false) {
     ba_map.dnd.zoom.dnd();
    }
   }
   catch(er) {
    //ba_map.debug([er.description]);
   }
  }
 },
 "isInArray" : function(arr, el, cVal) {
  var rVal = false;
  for(var i=0; i<arr.length; i++) {
   var arrVal = (cVal) ? arr[i].cVal : arr[i];
   if(arrVal==el) {
    rVal = true;
    break;
   }
  }
  return rVal;
 },
 "isArray" : function (obj) {
  if (obj.constructor.toString().indexOf("Array") == -1)
   return false;
  else
   return true;
 },
 "setUnselectable" : function(el) {
  for(var i=0; i<el.childNodes.length; i++) {
   try {
    if(el.childNodes[i].nodeName!="INPUT") {
     el.childNodes[i].unselectable = "on";
	 el.childNodes[i].style.MozUserSelect = "none";
	 el.childNodes[i].style.KhtmlUserSelect = "none";
    }
   }
   catch (e) {
   }
   if(el.childNodes[i].hasChildNodes()) {
    ba_map.setUnselectable(el.childNodes[i]);
   }
  }
 },
 "toggleDebugger" : function(v) {
  ba_map.par.global.debugging = v.checked;
  if(!v.checked) document.getElementById("debugger").innerHTML = "";
 },
 "serializeObject" : function(obj) {
  var str = ""
  for(var item in obj) {
   str+="\""+item+"\":"+obj[item]+",";
  }
  if(str.length>0) {
   str = str.substr(0, str.length-1);
  }
  return str;
 },
 "toMeasure" : function(value, measure) {
  if(isNaN(value)) return value;
  return value + measure;
 },
 "getOffsetHeight" : function(el) {
  var h = 0;
  for (var i=0; i<el.childNodes.length; i++) {
	  //ba_map.debug([el.childNodes[i].getAttribute("ignoredimensions")]);
   if(el.childNodes[i].nodeType == 1 && !el.childNodes[i].getAttribute("ignoredimension"))   { 
    h=h+el.childNodes[i].offsetHeight;
   }
  }
  return h;
 },
 "getOffsetWidth" : function(el) {
  var w = 0;
  for (var i=0; i<el.childNodes.length; i++) {
   if(el.childNodes[i].nodeType == 1 && !el.childNodes[i].getAttribute("ignoredimension"))   { 
    w=w+el.childNodes[i].offsetWidth;
   }
  }
  return w;
 },
 "clearContainer" : function(c) {
  if(c) {
   while(c.childNodes.length){
    c.removeChild(c.lastChild);
   }
  }
 },
 "setSessionTimeStamp" : function() {
	var t = new Date();
	ba_map.sessionTimeStamp = t.getTime();
 },
 "zoom" : function(z) {
  ba_map.dnd.hallplan.x = Math.round(ba_map.dnd.hallplan.x * z / ba_map.par.global.zoom);
  ba_map.dnd.hallplan.y = Math.round(ba_map.dnd.hallplan.y * z / ba_map.par.global.zoom);
  ba_map.par.global.zoom = z;  
  ba_map.zoomLabel.showZoom(z);
  ba_map.constants.lZ = 100/ba_map.par.global.zoom;
  ba_map.drawing.drawBackgroundTable();
  //ba_map.drawing.deleteBooths(); 
  ba_map.drawing.hideBooths(); 
  ba_map.dnd.hallplan.move(false);
 },
 "dnd" : {
  "xStart"   : 0,
  "yStart"   : 0,
  "hallplan" : {
   "x"        : 0,
   "y"        : 0,
   "xStartDnd": 0,
   "yStartDnd": 0,
   "isLocked" : true,
   "clipping" : [],
   "tileArray": [],
   "moveByInAction": false,
   "start"    : function() {  
    //window.clearTimeout(ba_map.waiting);
    ba_map.drawing.hideBooths();  
    //ba_map.search.drawCurtain(true);
    ba_map.dnd.hallplan.isLocked = false;
    ba_map.mouse.setCursor("url(../images/cursorhand.cur), move");
    ba_map.dnd.xStart = ba_map.mouse.x;
    ba_map.dnd.yStart = ba_map.mouse.y;
    ba_map.dnd.setDndStart();
   },
   "dnd" : function() {
    ba_map.dnd.hallplan.x = ba_map.dnd.hallplan.xStartDnd + ba_map.mouse.x - ba_map.dnd.xStart;
    ba_map.dnd.hallplan.y = ba_map.dnd.hallplan.yStartDnd + ba_map.mouse.y - ba_map.dnd.yStart;
    //ba_map.waiting = window.setTimeout("ba_map.dnd.hallplan.move()", 500);  
    ba_map.dnd.hallplan.move();  
   },
   "move" : function(booths) {
    var coorCorr = ba_map.dnd.hallplan.normXY();
    ba_map.background.style.left = ba_map.dnd.hallplan.x + "px";
    ba_map.background.style.top = ba_map.dnd.hallplan.y + "px";
    if(ba_map.getQueryString("view")!="print") {
     ba_map.dnd.overview.adjustClipping();
    }
    if(booths==true) {
     ba_map.drawing.getBgrAndBooths(true);
    }
    else {
     if(ba_map.dnd.hallplan.watchClipping() == true || ba_map.dnd.zoom.isLocked == false) {
      //ba_map.debug(["Neue Kacheln"]);
      ba_map.drawing.getBgrAndBooths(false);
     }
    }
    return coorCorr;
   },
   "moveTo" : function(x, y) {
    var xDiff = ba_map.dnd.hallplan.x - x;
    var yDiff = ba_map.dnd.hallplan.y - y;
    ba_map.dnd.hallplan.x = x;
    ba_map.dnd.hallplan.y = y;
    //ba_map.debug([x, xDiff, y, yDiff]);
    ba_map.dnd.hallplan.moveBy({"x" : xDiff, "y" : yDiff, "ghost" : true});
   },
   "moveBy" : function(obj, x, y) { 
    if(obj.x!=0 || obj.y!=0) {
     var moveX, moveY;
     var xStep = (Math.abs(obj.x)>= 200) ? 40 : 20;
     var yStep = (Math.abs(obj.y)>= 200) ? 40 : 20;
     var xDir = (obj.x<0) ? -xStep : xStep;
     var yDir = (obj.y<0) ? -yStep : yStep;
     if(!x) {
      ba_map.dnd.hallplan.moveByInAction = true;
      ba_map.dnd.hallplan.start(); 
      var x = 1;
      var y = 1;
     }
     else {
      x=x+xStep;
      y=y+yStep;
     } 
     if(moveX = (x<Math.abs(obj.x))) {
      ba_map.dnd.hallplan.x=ba_map.dnd.hallplan.x+xDir;
     }
     if(moveY = (y<Math.abs(obj.y))) {
      ba_map.dnd.hallplan.y=ba_map.dnd.hallplan.y+yDir;
     }
     if(moveX || moveY) {
      var goOn = ba_map.dnd.hallplan.move();
      if(!goOn.xCorrMin && !goOn.yCorrMin)
       window.setTimeout("ba_map.dnd.hallplan.moveBy({"+ba_map.serializeObject(obj)+"}, "+x+", "+y+")", 50);
      else { 
       ba_map.dnd.hallplan.moveByInAction = false; 
       if(obj.ghost) ba_map.drawing.removeGhost(); 
       ba_map.dnd.stop(); 
       return true;
      }
     }  
     else {  
      ba_map.dnd.hallplan.moveByInAction = false;
      if(obj.ghost) ba_map.drawing.removeGhost();  
      ba_map.dnd.stop(); 
      return true;
     }
    }
   },
   "normXY" : function() {
    var yCorrMin, yCorrMax, xCorrMin, xCorrMax;
	if(ba_map.par.global.boxConstrainedOverview) {
	 var _hallplanMargin = ba_map.par.global.hallplanMargin || 0;
     if(yCorrMin = ba_map.dnd.hallplan.y>_hallplanMargin)
      ba_map.dnd.hallplan.y=_hallplanMargin;
     if(ba_map.dnd.hallplan.y<-ba_map.par.hall[ba_map.hallIndex].height / ba_map.constants.lZ+ba_map.par.global.availableHeight - _hallplanMargin)
      ba_map.dnd.hallplan.y = -ba_map.par.hall[ba_map.hallIndex].height / ba_map.constants.lZ+ba_map.par.global.availableHeight - _hallplanMargin;
     if(xCorrMin = ba_map.dnd.hallplan.x>_hallplanMargin)
      ba_map.dnd.hallplan.x=_hallplanMargin;
     if(ba_map.dnd.hallplan.x<-ba_map.par.hall[ba_map.hallIndex].width / ba_map.constants.lZ+ba_map.par.global.availableWidth - _hallplanMargin)
      ba_map.dnd.hallplan.x = -ba_map.par.hall[ba_map.hallIndex].width / ba_map.constants.lZ+ba_map.par.global.availableWidth - _hallplanMargin;
	}
    return {"xCorrMin" : xCorrMin, "xCorrMax" : xCorrMax, "yCorrMin" : yCorrMin, "xCorrMax" : xCorrMax};
   },
   "watchClipping" : function() {
    var actClipping = ba_map.screen.clipping().byRowsAndCols;
    if(ba_map.dnd.hallplan.clipping.rB!=actClipping.rB||ba_map.dnd.hallplan.clipping.rT!=actClipping.rT||ba_map.dnd.hallplan.clipping.cL!=actClipping.cL||ba_map.dnd.hallplan.clipping.cL!=actClipping.cL) {
    //ba_map.debug([ba_map.dnd.hallplan.clipping.rB, ba_map.screen.clipping().byRowsAndCols.rB, "&nbsp;"]);
     ba_map.dnd.hallplan.clipping = actClipping;
     //ba_map.dnd.hallplan.toTileArray();
     return true
    }
    else return false;
   },
   //deprecated
   "toTileArray" : function () {
    for(var i=ba_map.dnd.hallplan.clipping.rT; i<=ba_map.dnd.hallplan.clipping.rB; i++) {
     for(var j=ba_map.dnd.hallplan.clipping.cL; j<=ba_map.dnd.hallplan.clipping.cR; j++) {
      if(!ba_map.isInArray(ba_map.dnd.hallplan.tileArray, i+"_"+j)) {
       ba_map.dnd.hallplan.tileArray.push(i+"_"+j);
      }
     }
    }
   }
  },
  "overview" : {
   "x"        : 0,
   "y"        : 0,
   "xOffset"  : 0,
   "yOffset"  : 0,
   "isLocked" : true,
   "googleLikeHallplanOffset" : { "x" : 0, "y" : 0},
   "ghost"    : {},
   "ghostIsActive" : false,
   "start" : function() {  
    //ba_map.search.drawCurtain(true); 
    //ba_map.drawing.deleteBooths(); 
    if(ba_map.par.global.googleLikeOverview) {
     if(ba_map.drawing.drawGhost("clipping")) {
      ba_map.dnd.overview.ghostIsActive = true;
      ba_map.dnd.overview.googleLikeHallplanOffset.x = ba_map.dnd.hallplan.x;
      ba_map.dnd.overview.googleLikeHallplanOffset.y = ba_map.dnd.hallplan.y;
      //ba_map.debug(["xoffset: "+ba_map.dnd.overview.googleLikeHallplanOffset.x]);
     }
    }
    else {
     ba_map.drawing.hideBooths(); 
    }
    ba_map.dnd.overview.isLocked = false;
    ba_map.mouse.setCursor("url(../images/cursorhand.cur), move");
   },
   "dnd" : function() {
    ba_map.dnd.overview.x = ba_map.mouse.x - ba_map.dnd.overview.xOffset;
    ba_map.dnd.overview.y = ba_map.mouse.y - ba_map.dnd.overview.yOffset;
    ba_map.dnd.hallplan.x = Math.round(-ba_map.dnd.overview.x*ba_map.constants.sZ/ba_map.constants.lZ+(ba_map.par.global.availableWidth/2));
    ba_map.dnd.hallplan.y = Math.round(-ba_map.dnd.overview.y*ba_map.constants.sZ/ba_map.constants.lZ+(ba_map.par.global.availableHeight/2));
    if(!ba_map.par.global.googleLikeOverview) {
     ba_map.dnd.hallplan.move();
    }
    else {  
     ba_map.dnd.overview.adjustClipping(ba_map.dnd.overview.ghost.ghost);  
    }
   },
   "adjustClipping" : function(ghost) {
    var ovClipping = (ghost) ? ghost : ba_map.clipping;
    ba_map.dnd.hallplan.normXY();
	var x, y;
	x = -ba_map.dnd.hallplan.x;	
	y = -ba_map.dnd.hallplan.y;
    with (ovClipping) {
	 var w = ba_map.par.global.availableWidth * ba_map.constants.lZ / ba_map.constants.sZ;
	 var h = ba_map.par.global.availableHeight * ba_map.constants.lZ / ba_map.constants.sZ;
	 var l = Math.round(x * ba_map.constants.lZ / ba_map.constants.sZ) + ba_map.dnd.overview.xOffset;
	 var t = Math.round(y * ba_map.constants.lZ / ba_map.constants.sZ) + ba_map.dnd.overview.yOffset;
     style.width =  ba_map.toMeasure(w, "px");
     style.height = ba_map.toMeasure(h, "px");
     style.left =  ba_map.toMeasure(l, "px");
     style.top =  ba_map.toMeasure(t, "px");
	 var xOverflow = (l-ba_map.dnd.overview.xOffset<0) ? Math.abs(l-ba_map.dnd.overview.xOffset) : 0;
	 var yOverflow = (t-ba_map.dnd.overview.yOffset<0) ? Math.abs(t-ba_map.dnd.overview.yOffset) : 0;
	 style.clip = "rect(" + ba_map.toMeasure(yOverflow, 'px') + ", " + ba_map.toMeasure(w+4, 'px') + ", " + ba_map.toMeasure(h+4, 'px') + ", " + ba_map.toMeasure(xOverflow, 'px') +")";
    }
    //ba_map.debug([ba_map.clipping.style.left, ba_map.dnd.overview.yOffset]);
   }
  },
  "zoom" : {
   "x" : 0,
   "isLocked" : true,
   "gridPosition" : 0,
   "start" : function() {
    ba_map.dnd.zoom.isLocked = false;
    ba_map.mouse.setCursor("url(../images/cursorhand.cur), move");
   },
   "dnd" : function() {
    ba_map.dnd.zoom.x = ba_map.par.global.availableWidth - ba_map.mouse.x - 5;
    var zoomSteps = 200 / (ba_map.par.global.maximumZoom - ba_map.par.global.minimumZoom);
    var newZoom = ba_map.par.global.maximumZoom-Math.round((ba_map.dnd.zoom.x-12) / zoomSteps);
     if(ba_map.dnd.zoom.x > 11 && ba_map.dnd.zoom.x < 213) {
      ba_map.zoomControl.style.right = ba_map.dnd.zoom.x + "px";
      document.getElementById("zoomLabel").style.right = ba_map.dnd.zoom.x + 12 + "px";
      ba_map.zoomLabel.showZoom(newZoom);
     if(newZoom % 5 == 0) {
      ba_map.dnd.zoom.gridPosition = ba_map.dnd.zoom.x;
      ba_map.zoom(newZoom);
     }
    }
   },
   "click" : function(d) {
    var zoomSteps = 200 / (ba_map.par.global.maximumZoom - ba_map.par.global.minimumZoom);
    ba_map.dnd.zoom.x = Math.round(ba_map.dnd.zoom.gridPosition+d * zoomSteps);
    if(ba_map.dnd.zoom.x < 12) ba_map.dnd.zoom.x = 12;
    if(ba_map.dnd.zoom.x > 212) ba_map.dnd.zoom.x = 212;
    var newZoom = ba_map.par.global.maximumZoom-Math.round((ba_map.dnd.zoom.x-12) / zoomSteps);
    ba_map.zoomControl.style.right = ba_map.dnd.zoom.x + "px";
    ba_map.dnd.zoom.gridPosition = ba_map.dnd.zoom.x;
    if(ba_map.par.global.zoom - d >= ba_map.par.global.minimumZoom && ba_map.par.global.zoom - d <= ba_map.par.global.maximumZoom) {
     ba_map.zoom(newZoom);  
    }
    ba_map.dnd.stop();
   }   
  },
  "stop" : function() {
   if(!ba_map.dnd.hallplan.moveByInAction) {
    if(ba_map.dnd.overview.ghostIsActive) {
     ba_map.dnd.overview.ghostIsActive = false;
     ba_map.drawing.hideBooths(); 
     ba_map.dnd.hallplan.moveTo(ba_map.dnd.overview.googleLikeHallplanOffset.x, ba_map.dnd.overview.googleLikeHallplanOffset.y)
    }
    else {
     ba_map.search.drawCurtain(false);
     ba_map.dnd.hallplan.isLocked = true;
     ba_map.dnd.overview.isLocked = true;
     ba_map.dnd.zoom.isLocked = true;
     ba_map.zoomControl.style.right = ba_map.dnd.zoom.gridPosition + "px";
     ba_map.mouse.setCursor("default");
     if(ba_map.dnd.watchMoving()) {
      ba_map.dnd.setDndStart();
      //ba_map.drawing.deleteBooths(); 
      //ba_map.drawing.hideBooths(); 
      var getBooths = (ba_map.par.global.zoom > ba_map.par.global.minimumZoomForBooths) ? true : false;
      ba_map.drawing.getBgrAndBooths(getBooths);
     }
     else {
      ba_map.drawing.showBooths();
     }
    }
   }
  },
  "watchMoving" : function() {
   if(ba_map.dnd.hallplan.xStartDnd != ba_map.dnd.hallplan.x || ba_map.dnd.hallplan.yStartDnd != ba_map.dnd.hallplan.y) {
    return true;
   }
   else {
    return false;
   }
  },
  "setDndStart" : function() {
   ba_map.dnd.hallplan.xStartDnd = ba_map.dnd.hallplan.x;
   ba_map.dnd.hallplan.yStartDnd = ba_map.dnd.hallplan.y;
  },
  "gotoDefaultView" : function(r) {
   if(xml.getNumber(r, "b")>0) {
    for(var i=0; i<xml.getNumber(r, "b"); i++) {
     var node = r.getElementsByTagName("b")[i];
     var bId  = xml.getAttribute(node, "bId");
     var x    = xml.getAttribute(node, "x");
     var y    = xml.getAttribute(node, "y");
     if(i==0) {
      ba_map.dnd.jumpToBooth(bId, x, y);
     }
     if(!ba_map.isInArray(ba_map.drawing.selectedBooths, bId))
      ba_map.drawing.selectedBooths.push(bId);
    }
   }
   else {
    ba_map.dnd.jumpToCenter();
   }
   ba_map.drawing.getBgrAndBooths(true);
  },
  "jumpToBooth" : function(bId, x, y) {
   ba_map.drawing.hideBooths(); 
   ba_map.dnd.hallplan.x = -parseInt(x/ba_map.constants.lZ-ba_map.par.global.availableWidth/2);
   ba_map.dnd.hallplan.y = -parseInt(y/ba_map.constants.lZ-ba_map.par.global.availableHeight/2);
   ba_map.dnd.hallplan.move(true);
   ba_map.dnd.setDndStart();
   if(ba_map.par.global.showToolTip) {
    //window.setTimeout("ba_map.toolTip.exhibitors.getExhibitorsByBooth("+bId+","+ x+","+ y +")", 500);
   }
  },
  "jumpToCenter" : function() {
   ba_map.dnd.hallplan.x = -parseInt(ba_map.par.hall[ba_map.hallIndex].width/ba_map.constants.lZ/2-ba_map.par.global.availableWidth/2);
   ba_map.dnd.hallplan.y = -parseInt(ba_map.par.hall[ba_map.hallIndex].height/ba_map.constants.lZ/2-ba_map.par.global.availableHeight/2);
   ba_map.dnd.hallplan.move(true);
   ba_map.dnd.setDndStart();
  },
  "jumpToCoordinates" : function(x, y, corr) {
   //ba_map.drawing.deleteBooths(); 
   ba_map.drawing.hideBooths(); 
   if(!corr) {
    ba_map.dnd.hallplan.x = -parseInt(x/ba_map.constants.lZ-ba_map.par.global.availableWidth/2);
    ba_map.dnd.hallplan.y = -parseInt(y/ba_map.constants.lZ-ba_map.par.global.availableHeight/2);
   }
   ba_map.dnd.hallplan.move(true);
   ba_map.dnd.setDndStart();   
  }
 },
 "drawing" : {
  "drawnBooths" : [],
  "selectedBooths" : [],
  "visibleBooths" : [],
  "drawDefaultViewport" : function(r) {  	
   ba_map.setShowId(r);   
   //ba_map.overridePar();
   ba_map.drawing.showOverview();
   ba_map.drawing.drawBackgroundTable();
   ba_map.dnd.gotoDefaultView(r);
  },
  "showOverview" : function(c) { 
   if(ba_map.drawing.showOverview.arguments.length==0) {
    var c=0;
    var newImg = document.createElement("IMG");
    newImg.id = "ov";
    newImg.src = "uebersicht_"+ba_map.hallId+"_"+ba_map.showId+".jpg";
    newImg.unselectable = "on";
    if(!document.getElementById("ov")) {
     ba_map.overview.appendChild(newImg);
    }
   }
   else {
    c++;
   }
   if(document.getElementById("ov").complete==true||c==1000) {
    var oW = ba_map.overview.offsetWidth;
    var oH = ba_map.overview.offsetHeight;
    if (oW!=ba_map.par.hall[ba_map.hallIndex].overviewWidth) {
     var scalFac = oW / ba_map.par.hall[ba_map.hallIndex].overviewWidth;
     oW = Math.round(oW / scalFac);
     oH = Math.round(oH / scalFac);
     ba_map.par.hall[ba_map.hallIndex].overviewWidth = oW;
     document.getElementById("ov").width = oW;
     document.getElementById("ov").height = oH;
    }
    ba_map.overview.style.left = ba_map.par.global.availableWidth  -oW + "px";
    ba_map.overview.style.top  = ba_map.par.global.availableHeight -oH + "px";
    ba_map.dnd.overview.xOffset = ba_map.overview.offsetLeft;
    ba_map.dnd.overview.yOffset = ba_map.overview.offsetTop;
    ba_map.overviewBorder.style.left = parseInt(ba_map.overview.style.left) - 10 + "px";
    ba_map.overviewBorder.style.top = parseInt(ba_map.overview.style.top) - 10 + "px";
    ba_map.overviewBorder.style.width = oW + 10 + "px";
    ba_map.overviewBorder.style.height = oH + 10 + "px";
    ba_map.dnd.overview.adjustClipping();
    if(ba_map.par.global.hideOverviewByDefault) ba_map.drawing.toggleOverview();
   }
   else {
    window.setTimeout("ba_map.drawing.showOverview("+c+")", 100);
   }
  },
  "drawBackgroundTable" : function() {
   var tab = "";
   tab+="<table border=0 cellpadding=0 cellspacing=0 onmousedown='ba_map.dnd.hallplan.start()'>";
   for (i=1; i<=ba_map.par.hall[ba_map.hallIndex].rows; i++)	{
    tab+="<tr>";
    for (j=1; j<=ba_map.par.hall[ba_map.hallIndex].cols; j++)	{
     tab+="<td width='" + parseInt(ba_map.constants.cW/ba_map.constants.lZ) +"' height='" + parseInt(ba_map.constants.rH/ba_map.constants.lZ) +"'><img width='" + parseInt(ba_map.constants.cW/ba_map.constants.lZ) +"' height='" + parseInt(ba_map.constants.rH/ba_map.constants.lZ) +"'  id='"+i+"_"+j+"' src='../images/dummy.gif' unselectable='on' style='-moz-user-select:none'></td>";
    }
    tab+="</tr>";
   }
   tab+="</table>";
   ba_map.background.innerHTML = tab;
  },
  "getBgrAndBooths" : function(getBooths, bId) {
   var getBgr = false; //(ba_map.par.global.zoom==100) ? "false" : "true";
   if(getBooths) {
    ba_map.working.style.display = "block";
    var clipping = ba_map.screen.clipping();
    var cP = clipping.byPix;
    var cRC = clipping.byRowsAndCols;
    var xL = parseInt((cRC.cL-1)*ba_map.constants.cW);
    var xR = parseInt((cRC.cR)*ba_map.constants.cW);
    var yT = parseInt((cRC.rT-1)*ba_map.constants.rH);
    var yB = parseInt((cRC.rB)*ba_map.constants.rH);
    var tempTileArray = [];
    for(i=cRC.rT; i<=cRC.rB; i++) {
     for(j=cRC.cL; j<=cRC.cR; j++) {
      if(!ba_map.isInArray(ba_map.dnd.hallplan.tileArray, i+"_"+j)) {
       ba_map.dnd.hallplan.tileArray.push(i+"_"+j);
       tempTileArray.push(i+"_"+j);
      }
     }
    }
    if(tempTileArray.length > 0) {
     ba_map.drawing.drawBgr();
     ajax.par.url = "/ngn/hallplan/getBgrAndBooths.Ajax.2.1.1.asp?getBooths="+getBooths+"&getBgr="+getBgr+"&yT="+yT+"&yB="+yB+"&xL="+xL+"&xR="+xR+"&rt="+cRC.rT+"&rB="+cRC.rB+"&cL="+cRC.cL+"&cR="+cRC.cR+"&hallID="+ba_map.hallId+"&showID="+ba_map.showId+"&bId="+bId+"&z="+ba_map.par.global.zoom+"&freeBooths="+ba_map.par.global.showFreeBooths+"&tileArray="+tempTileArray+"&cW="+ba_map.constants.cW+"&rH="+ba_map.constants.rH+"&instance="+ba_map.par.global.instance+"&organizer="+ba_map.par.global.organizer;
     ajax.par.callback_function = "ba_map.drawing.drawBooths";
     ajax.par.return_xml = true;
     ba_map.drawing.showBooths(true, true);
    }
    else {
     ba_map.drawing.showBooths(true);
     ba_map.drawing.drawBgr();
     ba_map.working.style.display = "none";
    }
   }
   else {  
    ba_map.drawing.drawBgr();
   }
  },
  "drawBgr" : function() {
   var suffix = ""; //(ba_map.par.global.zoom==100) ? "" : "_"+ba_map.par.global.zoom;
   var clipping = ba_map.screen.clipping();
   var cRC = clipping.byRowsAndCols;
   for(var i=cRC.rT; i<=cRC.rB; i++) {
    for(var j=cRC.cL; j<=cRC.cR; j++) {
     //ba_map.debug(i+"_"+j);
     try {
      document.getElementById(i+"_"+j).src = "kachel_" + ba_map.hallId +"_"+ba_map.showId+"\/"+i+"_"+j+suffix+".jpg?ts=" + ba_map.sessionTimeStamp;
     }
     catch(e) {
     }
    }
   } 
  },
  "drawBooths" : function(r) {
   for (i=0; i < xml.getNumber(r, "booth"); i++)	{
    var b = r.getElementsByTagName("booth")[i];
    var sID = xml.getAttribute(b, "id");
    if(!document.getElementById(sID)) {
     var sel = xml.getAttribute(b, "sel");
     var x = b.getElementsByTagName("coordinates")[0].getElementsByTagName("x")[0].firstChild.nodeValue;
     var y = b.getElementsByTagName("coordinates")[0].getElementsByTagName("y")[0].firstChild.nodeValue;
     var nr= xml.getChildValue(b, "number", 0);
	 var boothStyle = ba_map.drawing.getBoothStyle(x, y, sID);
     ba_map.drawing.drawnBooths.push({"id": sID, "x" : x, "y" : y, "nr" : nr});
     var nS = document.createElement("DIV");
     var DOM_text = document.createTextNode(ba_map.toolTip.exhibitors.getToolTipText(nr));
     var DOM_span = document.createElement("SPAN");
     var DOM_a = document.createElement("a");
     DOM_span.appendChild(DOM_text);
     DOM_a.appendChild(DOM_span);
     DOM_a.href = "javascript: void(0)";
     DOM_a.style.paddingTop = "1px";
     DOM_a.style.paddingLeft = "4px";
	 DOM_a.style.marginRight = "10px";
	 //DOM_a.style.display = "block";
     if(ba_map.getQueryString("view")!="print") {
      DOM_a.onmousedown = function() {ba_map.toolTip.exhibitors.getExhibitorsByBooth(this.parentNode.id, this.parentNode.style.left, this.parentNode.style.top);};
     }
     DOM_a.className = boothStyle.linkclass;
	 DOM_a.style.width = ba_map.toMeasure(boothStyle.width, "px");
	 DOM_a.style.height = ba_map.toMeasure(boothStyle.height, "px");
	 DOM_a.style.background = boothStyle.background;
     DOM_a.style.border = ba_map.par.global.defaultBoothBorder;
     DOM_a.style.fontSize = ba_map.par.global.defaultBoothNrSize;
     with(nS) {
      id = sID;
      className = boothStyle.containerclass;
	  style.left = ba_map.toMeasure(boothStyle.left, "px");
	  style.top = ba_map.toMeasure(boothStyle.top, "px");
	  style.background = boothStyle.containerbackground;
      setAttribute("x", x);
      setAttribute("y", y);
      setAttribute("boothNr", nr);
	  onmouseover = function() { 
	   ba_map.par.global.boothFlagZIndex++;
	   this.style.zIndex = ba_map.par.global.boothFlagZIndex;
	  };	  
      appendChild(DOM_a);
     }
     document.getElementById("ba_mapcontainer").appendChild(nS);
     if(utils.browser()=="IE6" && boothStyle.width=="auto") {
      DOM_a.style.width = ba_map.toMeasure(DOM_span.offsetWidth, "px");
     }
     if(!ba_map.isInArray(ba_map.drawing.visibleBooths, sID)) {
      ba_map.drawing.visibleBooths.push(sID);
     }
    }
   }
   ba_map.working.style.display = "none";
  },
  "deleteBooths" : function() {
   while(ba_map.booths.hasChildNodes()) {
    ba_map.booths.removeChild(ba_map.booths.lastChild);
   }
  },
  "hideBooths" : function() {
   if(ba_map.getQueryString("view")!="print") {
    for(var i=0; i<ba_map.drawing.visibleBooths.length; i++) {
     document.getElementById(ba_map.drawing.visibleBooths[i]).style.visibility = "hidden";
    }
    ba_map.drawing.visibleBooths = [];
    //ba_map.booths.style.display = "none";
    document.getElementById("ausstellerDisplay").style.visibility = "hidden";
   }
  },
  "showBooths" : function(adjust, drawBgrAndBooths) {
   if(ba_map.par.global.zoom > ba_map.par.global.minimumZoomForBooths) {
    var actClip = ba_map.screen.clipping().byPix;
    for(var i=0; i<ba_map.drawing.drawnBooths.length; i++) {
	 var sID = ba_map.drawing.drawnBooths[i].id;
     var b = document.getElementById(sID);
     var x = ba_map.drawing.drawnBooths[i].x;
     var y = ba_map.drawing.drawnBooths[i].y;
     if(x>=actClip.xL&&x<=actClip.xR&&y>=actClip.yT&&y<=actClip.yB) {
      //if(adjust) {
       var a = b.getElementsByTagName("a")[0];
       var nr= ba_map.drawing.drawnBooths[i].nr;
	   var boothStyle = ba_map.drawing.getBoothStyle(x, y, sID);
	   a.style.background = boothStyle.background;
	   a.className = boothStyle.linkclass;
       with(b) {
	    //style.width = ba_map.toMeasure(boothStyle.width, "px");
	    //style.height = ba_map.toMeasure(boothStyle.height, "px");
	    style.left = ba_map.toMeasure(boothStyle.left, "px");
	    style.top = ba_map.toMeasure(boothStyle.top, "px");
	    style.background = boothStyle.containerbackground;
	    className = boothStyle.containerclass;
        //a.innerHTML = ba_map.toolTip.exhibitors.getToolTipText(nr);
       }
      //}
      b.style.visibility = "visible";
      //if(!ba_map.isInArray(ba_map.drawing.visibleBooths, b.id)) {
       ba_map.drawing.visibleBooths.push(b.id);
      //}
     }
    }
    if(adjust&&drawBgrAndBooths) ajax.makeHttpRequest();
    //ba_map.booths.style.display = "block"; 
    ba_map.toolTip.exhibitors.moveToolTip();
    return true;
   }
  },
  //deprecated
  "getHighlight" : function(s) {
   if(s==2)
    return "#F00";
   else
    return "#CCC";
  },
  "getBoothStyle" : function(x, y, sID) {
   var boothStyle = {};
   var w = (!isNaN(ba_map.par.global.boothFlagWidth)) ? ba_map.par.global.boothFlagWidth : 0;
   var h = (!isNaN(ba_map.par.global.boothFlagHeight)) ? ba_map.par.global.boothFlagHeight : 0;
   boothStyle.width = (w>0) ? ba_map.par.global.boothFlagWidth : "auto";
   boothStyle.height = (h>0) ? ba_map.par.global.boothFlagHeight : "auto";
   boothStyle.left = Math.round(x / ba_map.constants.lZ) + ba_map.dnd.hallplan.x;
   boothStyle.top = Math.round(y / ba_map.constants.lZ) - h + ba_map.dnd.hallplan.y;
   boothStyle.containerclass = "standLayer";
   if(ba_map.isInArray(ba_map.drawing.selectedBooths, sID)) {
    boothStyle.background = (ba_map.par.global.boothType=="img") ? "url(" + ba_map.par.global.selectedBoothImage + ba_map.transparencyMode + ") 0 -425px" : ba_map.par.global.selectedBoothColor;
    boothStyle.containerbackground = (ba_map.par.global.boothType=="img") ? "url(" + ba_map.par.global.selectedBoothImage + ba_map.transparencyMode +  ") 100% -450px" : ba_map.par.global.selectedBoothColor;
	boothStyle.containerclass = (ba_map.getQueryString("frontend")) ? "standLayer " + ba_map.getQueryString("frontend") : "standLayer";
	boothStyle.linkclass = (ba_map.getQueryString("frontend")) ? "boothNr selected " + ba_map.getQueryString("frontend") + "-" +  ba_map.transparencyMode.substr(1) : "boothNr selected";
   }
   else {
	boothStyle.background = (ba_map.par.global.boothType=="img") ? "url(" + ba_map.par.global.defaultBoothImage + ba_map.transparencyMode +  ") 0 -375px" : ba_map.par.global.defaultBoothColor;
	boothStyle.containerbackground = (ba_map.par.global.boothType=="img") ? "url(" + ba_map.par.global.defaultBoothImage + ba_map.transparencyMode +  ") 100% -400px" : ba_map.par.global.defaultBoothColor;
	boothStyle.linkclass = "boothNr";
   }  
   return boothStyle;
  },
  "drawGhost" : function(el) {
   var oNode =document.getElementById(el);
   var ghost = oNode.cloneNode(false);
   ghost.id = oNode.id+"_ghost";
   ghost.style.background = "transparent";
   oNode.parentNode.appendChild(ghost);
   ba_map.dnd.overview.ghost = { "ghost" : ghost, "parent" : oNode.parentNode };
   return true;
  },
  "removeGhost" : function() {
   if(ba_map.dnd.overview.ghost.ghost) {
    ba_map.dnd.overview.ghost.parent.removeChild(ba_map.dnd.overview.ghost.ghost);
    ba_map.dnd.overview.ghost = {};
    //ba_map.debug([ba_map.dnd.hallplan.x, ba_map.dnd.hallplan.y]);
   }
  },
  "toggleOverview" : function() {
   var ovVis = (document.getElementById("overview").style.visibility == "visible") ? "hidden" : "visible";
   document.getElementById("overview").style.visibility = ovVis;
   document.getElementById("overviewBorder").style.visibility = ovVis;
   document.getElementById("clipping").style.visibility = ovVis;
   document.getElementById("ovToggleImg").src = "/ngn/images/ovToggle_"+ovVis+".gif";
  },
  "showHallName" : function() {
   if(document.getElementById("hallName")) {
	var c = document.getElementById("hallName");
	var hallName = ba_map.isArray(ba_map.par.hall[ba_map.hallIndex].name) ? ba_map.par.hall[ba_map.hallIndex].name[ba_map.getLanguage()] : ba_map.par.hall[ba_map.hallIndex].name;
	var n = (hallName!="") ? ba_map.par.global.tradeShow + ", " + hallName : ba_map.par.global.tradeShow;
	c.innerHTML = n;
	c.style.display = "block";
	c.style.left = parseInt(ba_map.par.global.availableWidth/2 - c.offsetWidth/2) + "px";
   }
  },
  "setPortalSkin" : function() {
	  
	 //Reiter
	document.getElementById("tab").className = (ba_map.getQueryString("frontend") ? "tabbernav " + ba_map.getQueryString("frontend") + "-tab" : "tabbernav");
	
	//Clipping
	document.getElementById("clipping").className = (ba_map.getQueryString("frontend") ? "clipping " + ba_map.getQueryString("frontend") : "");
	
	//Standsuche all
	document.getElementById("text19").className = (ba_map.getQueryString("frontend") ? "standardA " + ba_map.getQueryString("frontend") : "standardA");
  }
 },
 "toolTip" : {
  "x"         : 0,
  "y"         : 0,
  "bId"       : null,
  "exhibitors" : {
   "getExhibitorsByBooth" : function(bId, x, y) {
    ba_map.toolTip.bId = bId;
    ajax.par.url = "/ngn/hallplan/getExhibitorsByBooth.Ajax.asp?hallID="+ba_map.hallId+"&showID="+ba_map.showId+"&bId="+bId+"&x="+x+"&y="+y+"&instance="+ba_map.par.global.instance+"&organizer="+ba_map.par.global.organizer;
    ajax.par.callback_function = "ba_map.toolTip.exhibitors.showExhibitors";
    ajax.par.return_xml = true;
    ajax.makeHttpRequest();
   },
   "showExhibitors" : function(r) {
    ba_map.toolTip.x  = parseInt(xml.getAttribute(r.documentElement, "x"));
    ba_map.toolTip.y  = parseInt(xml.getAttribute(r.documentElement, "y"));
    var bNr  = xml.getAttribute(r.documentElement, "bNr");
    var ausDisp = document.getElementById("ausstellerDisplay");
	var bgrImg = ba_map.par.global.defaultBoothImage + ba_map.transparencyMode;
    //ausDisp.style.visibility = "hidden";
	ba_map.clearContainer(ausDisp);
	var tt1 = document.createElement("DIV");
	tt1.style.background = "url(" + bgrImg +")";
	tt1.style.padding = "30px 10px 0";
	tt1.style.width =  "190px";
	tt1.style.position = "relative";
	
	var tt2 = document.createElement("DIV");
	tt2.style.background = "url(" + bgrImg +") 0 -343px";
	tt2.style.height = "16px";
	tt2.style.width = "209px";
	
	var ttclose = document.createElement("DIV");
	ttclose.style.position = "absolute";
	ttclose.style.right = "10px";
	ttclose.style.top = "7px";
	ttclose.style.width = "15px";
	ttclose.style.height = "15px";
	ttclose.style.background = "url(../images/spriteRoundedIconsSmall" + ba_map.transparencyMode +") -60px 0";
	ttclose.style.cursor = "pointer";
	ttclose.onclick = function() { ba_map.toolTip.exhibitors.hideToolTip(); };

	
	var tttitle = document.createElement("DIV");
	tttitle.style.position = "absolute";
	tttitle.style.left = "15px";
	tttitle.style.top = "10px";
	tttitle.style.width = "150px";
	tttitle.style.fontWeight = "bold";
	tttitle.style.borderBottom = "1px dotted #000";
	tttitle.innerHTML = sprachArray[3][ba_map.getLanguage()]+ ": "+bNr;
	
	var ttarr = document.createElement("DIV");
	ttarr.id = "arr";
	ttarr.style.position = "absolute";
	//ttarr.style.left = "-5px";
	//ttarr.style.top = "25px";
	ttarr.style.width = "10px";
	ttarr.style.height = "10px";
	ttarr.style.backgroundImage = "url(" + bgrImg + ")";
	//ttarr.style.backgroundPosition = "-17px -360px";
	
	var ttcontainer = document.createElement("DIV");
	
	tt1.appendChild(ttarr);
	tt1.appendChild(ttclose);
	tt1.appendChild(tttitle);
	tt1.appendChild(ttcontainer);
	
	if(xml.getNumber(r, "exhibitor")>0) {
	 var new_c = document.createElement("UL");
     for (var i=0; i < xml.getNumber(r, "exhibitor"); i++) {
	  var new_li = document.createElement("LI");
      new_li.className = "exList";
	  var exId = xml.getAttribute(r.getElementsByTagName("exhibitor")[i], "id");
	  var adress = ba_map.par.global.portalURL+"\/index.php5";
	  new_li.setAttribute("exId", exId);
	  new_li.innerHTML=xml.getChildValue(r.getElementsByTagName("exhibitor")[i], "name", 0);
	  if(exId < 1000000000) {  //freiplazierte MCH!!
	   new_li.onmouseover = function() { css.changerow(this, 1)};
	   new_li.onmouseout = function() { css.changerow(this, 0)};
	   new_li.onclick = function() {
		  ba_map.dnd.hallplan.isLocked=true;
          var locale = (ba_map.getQueryString("language") && ba_map.getQueryString("language")!="undefined") ? "&locale=" + ba_map.getQueryString("language") + "_" + ba_map.getQueryString("language").toUpperCase() : "";
		  var qStr = "?id=" + this.getAttribute('exId') + "&Action=showCompany" + locale;
		  top.location.href = adress + qStr;
		  }; 
	   new_li.style.cursor = "pointer";
	  }
      else {
       new_li.style.textDecoration = "none";
      }
	  new_c.appendChild(new_li);
	 }
	}
	else {
	 var new_c = document.createElement("DIV");
	 new_c.innerHTML = "No exhibitor";
	}
	ttcontainer.appendChild(new_c);
	ausDisp.appendChild(tt1);
	ausDisp.appendChild(tt2);
	if(ttcontainer.offsetHeight > 200) {
	 ttcontainer.style.height = "200px";
	 ttcontainer.style.overflow = "auto";
	}
	var xmove = 1;
	var ymove = 1;
	if(ba_map.toolTip.x+40 > ba_map.par.global.availableWidth) {
	 xmove = -30;
	}
	/*if(ba_map.toolTip.y+20 > ba_map.par.global.availableHeight) {
	 ymove = -30;	
	}*/
	if(ba_map.toolTip.x < 20) {
	 xmove = 30;	
	}
	if(ba_map.toolTip.y < 40) {
	 ymove = 30;	
	}
	ba_map.dnd.hallplan.moveBy({"x" : xmove, "y" : ymove});
	//ba_map.toolTip.exhibitors.moveToolTip();
   },
   "getToolTipText" : function(boothId) {
    if (ba_map.par.global.toolTipText=="booth"||ba_map.par.global.zoom>ba_map.par.global.minimumZoomForNumber) {
     return boothId;
    }
    else return ba_map.par.global.toolTipText;
   },
   "hideToolTip" : function() {
    document.getElementById("ausstellerDisplay").style.visibility = "hidden";
    ba_map.toolTip.bId = null;
   },
   "moveToolTip" : function() { 
    if(ba_map.toolTip.bId) {
     var b;
     if(b = document.getElementById(ba_map.toolTip.bId)) {
      if(b.style.visibility=="visible") {
	   var tt = document.getElementById("ausstellerDisplay");
	   var arr = document.getElementById("arr");
       var x = parseInt(b.style.left);
       var y = parseInt(b.style.top);
	   var xv = 0;
	   var yv = 0;
	   var arrxv = 0;
	   var arryv = 0;
	   var arrclipx = 0;
	   var arrclipy = 0;
	   var q12 = y <= ba_map.par.global.availableHeight / 2;
	   var q13 = x <= ba_map.par.global.availableWidth / 2;
	   var q = 4;
	   if(q12) {
		if(q13) {
		 q = 1;
		 xv = 30;
		 yv = -20;
		 arrxv = -5;
		 arryv = 20;
		 arrclipx = -15;
		 arrclipy = -360;
		}
		else {
		 q = 2;
		 xv = -tt.offsetWidth;
		 yv = -20;
		 arrxv = tt.offsetWidth-7;
		 arryv = 20;
		 arrclipx = -45;
		 arrclipy = -360;
		}
	   }
	   else {
		if(q13) {
		 q = 3;
		 xv = -10;
		 yv = -tt.offsetHeight;
		 arrxv = 20;
		 arryv = tt.offsetHeight-5;
		 arrclipx = 0;
		 arrclipy = -360;
		}
		else {
		 xv = -tt.offsetWidth+30;
		 yv = -tt.offsetHeight;
		 arrxv = tt.offsetWidth-25;
		 arryv = tt.offsetHeight-5;
		 arrclipx = 0;
		 arrclipy = -360;
		}
	   }
	   //alert(q);
		
       //ba_map.debug([x,y]); 
	   try {
		tt.style.left = x+xv+"px";
      	tt.style.top = y+yv+"px";
	   	arr.style.top = ba_map.toMeasure(arryv, "px");
	   	arr.style.left = ba_map.toMeasure(arrxv, "px");
	   	arr.style.backgroundPosition = ba_map.toMeasure(arrclipx, "px") + " "+ ba_map.toMeasure(arrclipy, "px");
       	tt.style.visibility = "visible";
	   }
	   catch(e) {
	   }
      }
     }
    }
   }
  }
 },
 "zoomLabel" : {
  "toggleZoomLabel" : function() {
   var zl = document.getElementById("zoomLabel");
   var zlVis = (zl.style.visibility == "visible") ? "hidden" : "visible";
   zl.style.right = ba_map.dnd.zoom.gridPosition + 12 +"px";
   ba_map.zoomLabel.showZoom(ba_map.par.global.zoom);
   zl.style.visibility = zlVis;
  },
  "showZoom" : function(z) {   
   document.getElementById("zoomLabel").innerHTML = z + "%";
  }
 },
 "screen" : {
  "clipping" : function() {
   var yT, yB, xL, xR;
   var rB, rT, cL, cR;
   var x, y;
   if(ba_map.par.global.boxConstrainedOverview) {
	x = -(ba_map.dnd.hallplan.x);	
	y = -(ba_map.dnd.hallplan.y);
   }
   else {
	x = -1*ba_map.dnd.hallplan.x;	
	y = -1*ba_map.dnd.hallplan.y;
   }
   yT = Math.floor(y*ba_map.constants.lZ);
   yB = Math.floor(yT + ba_map.par.global.availableHeight*ba_map.constants.lZ);
   xL = Math.floor(x*ba_map.constants.lZ);
   xR = Math.floor(xL + ba_map.par.global.availableWidth*ba_map.constants.lZ);
   rT = Math.ceil(yT/(ba_map.par.hall[ba_map.hallIndex].height/ba_map.par.hall[ba_map.hallIndex].rows));
   rB = Math.ceil(yB/(ba_map.par.hall[ba_map.hallIndex].height/ba_map.par.hall[ba_map.hallIndex].rows));
   cL = Math.ceil(xL/(ba_map.par.hall[ba_map.hallIndex].width/ba_map.par.hall[ba_map.hallIndex].cols));
   cR = Math.ceil(xR/(ba_map.par.hall[ba_map.hallIndex].width/ba_map.par.hall[ba_map.hallIndex].cols));
   if(rT==0) rT=1;
   if(cL==0) cL=1;
   //ba_map.dnd.hallplan.toTileArray(rT, rB, cL, cR);
   //ba_map.debug([parent.ifB]);
   return {"byPix" : {"yT" : yT, "yB" : yB, "xL" : xL, "xR": xR}, "byRowsAndCols" : {"rT" : rT, "rB": rB, "cL" : cL, "cR" : cR}};
  }
 },
 "modules" : {
  "print" : {
   "showPrintDialog" : function() {
    if(ba_map.par.global.showPrintDialog) {
     var printType = ba_map.par.global.printType || "default";
     var DOM_a = document.createElement("a");
     switch (printType) {
      case "default":
       var DOM_img = document.createElement("img");
       DOM_img.border = "0";
       DOM_img.hspace = 5;
       DOM_img.align = "absmiddle";
       var DOM_descr = document.createTextNode(sprachArray[20][ba_map.getLanguage()]);
       DOM_a.appendChild(DOM_descr);
       DOM_a.className = "printDescr standardA " + ba_map.getQueryString("frontend");
       DOM_img.src = "../images/printer.gif";
       DOM_a.href = "javascript: ba_map.modules.print.getPrintVersion()";
       DOM_a.appendChild(DOM_img);
       document.getElementById("print").appendChild(DOM_a);
       break;
      case "pdf":
       if(ba_map.par.hall[ba_map.hallIndex].pdfURL) {
        var DOM_descr = document.createTextNode(sprachArray[14][ba_map.getLanguage()]);
        DOM_a.appendChild(DOM_descr);
        DOM_a.className = "printDescr pdfLink standardA " + ba_map.getQueryString("frontend");
        var DOM_li = document.createElement("li");
        DOM_li.id = "pdfWrapper";
        DOM_li.className = "pdfWrapper";
        DOM_li.onclick = function() { window.open(ba_map.par.hall[ba_map.hallIndex].pdfURL)};
        DOM_li.appendChild(DOM_a);
        document.getElementById("tab").appendChild(DOM_li);
       }
       break;
     }
    }
   },
   "getPrintVersion" : function() {
    window.open ("printversion.html?hallID="+ba_map.hallId + "&tradeshowID=" + ba_map.showId + "&language=" + ba_map.getQueryString("language") +"&view=print&x=" + ba_map.dnd.hallplan.x + "&y=" + ba_map.dnd.hallplan.y + "&zoom=" + ba_map.par.global.zoom, "Printversion");
   }
  }
 },
 "search" : {
  "toggleInfo" : function (oEl, list, tab) {
   for (var i=0; i<oEl.childNodes.length; i++) {
    var listCont = oEl.childNodes[i];
    if(listCont.id) {
     if(listCont.id.indexOf("ListCont") > -1) {
      if(listCont.id==list+"ListCont") {
       if(listCont.style.display =="block") {
        listCont.parentNode.parentNode.style.zIndex = 9999;
        listCont.style.display = "none";
        listCont.style.height = 0+"px";
        if(document.getElementById("pdfWrapper")) {
         document.getElementById("pdfWrapper").style.display = "inline";
        }
       }
       else {
        listCont.style.display =  "block";
        listCont.style.height = ba_map.getOffsetHeight(listCont) + "px";
		if(list=="area") {
         listCont.style.height = ba_map.par.global.availableHeight-54 + "px";
		 listCont.style.width = ba_map.par.global.availableWidth-2 + "px";
         listCont.parentNode.parentNode.style.zIndex = 11000;
         if(document.getElementById("pdfWrapper")) {
          document.getElementById("pdfWrapper").style.display = "none";
         }
		}
		else {
         listCont.parentNode.parentNode.style.zIndex = 9999;
        if(document.getElementById("pdfWrapper")) {
         document.getElementById("pdfWrapper").style.display = "inline";
        }
         if(ba_map.getOffsetHeight(listCont)>ba_map.par.global.availableHeight-100) {
          listCont.style.height = ba_map.par.global.availableHeight-100+ "px";
		  listCont.style.width = "300px";
	      listCont.style.overflow = "auto";
		 }
        }
       }
      }
      else {
       listCont.style.height = 0+"px";
       listCont.style.display = "none";
      }
     }
     else if(listCont.id.indexOf("list") > -1) {
      if(listCont.id==tab) {
       listCont.className = (listCont.className=="tabberactive") ? "" : "tabberactive";
      }
      else {
       listCont.className = "";
      }
     }
    }
    if(listCont.hasChildNodes()) {
     ba_map.search.toggleInfo(listCont, list, tab);
    }
   }
  },
  "getAbc" : function() {
   try {  //FIXME: Workaround ART Basel, Tabs in init() programmat. umsetzen
    var cont = document.getElementById("abcCont");
    var abc = ["#", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",  "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", sprachArray[17][ba_map.getLanguage()]];
    for (var i=0; i<abc.length; i++) {
     var newTab = document.createElement("SPAN");
     var par = (abc[i]=="#") ? "numeric" : (abc[i]==sprachArray[17][ba_map.getLanguage()]) ? "all" : abc[i];
     var newTabText = "<a href='javascript: ba_map.search.getExhibitorsByHall(\""+par+"\")' class='standardA " + ba_map.getQueryString("frontend") + "'>"+abc[i]+"</a> ";
     newTab.innerHTML = newTabText;
     var newList = document.createElement("DIV");
     newList.id = "exList" + par;
     newList.style.display = "none";
     cont.appendChild(newTab);
     document.getElementById("exList").appendChild(newList);
    }  
     ba_map.search.abcHeight = cont.offsetHeight;
   }
   catch(e) {
   }
  },
//deprecated
  "setHeight" : function(which) {
   var oH = document.getElementById(which+"ListCont").offsetHeight;
//alert(oH);
   if(oH>300) {
    document.getElementById(which+"ListCont").style.height = oH + "px";
}
   //document.getElementById("listContainer").style.height = document.getElementById("listContainer").offsetHeight + "px";
  },
  //to drawing or deprecated
  "drawCurtain" : function(dir) {
   if(dir==true) {
   var newCurtain = document.createElement("DIV");
   newCurtain.id = "curtain";
   newCurtain.className = "curtain";
   //newCurtain.style.width = document.getElementById("listContainer").offsetWidth + "px";
   //newCurtain.style.height = document.getElementById("listContainer").offsetHeight + document.getElementById("tab").offsetHeight + "px";
   document.body.appendChild(newCurtain);
   }
   else {
    try {
     document.body.removeChild(document.getElementById("curtain"));
    }
    catch(e) {
    }
   }
  },
  "getExhibitorsByHall" : function(initial) {
   ba_map.search.hideExLists();
   var eL = document.getElementById("exList"+initial);
   eL.style.display = "block";   
   var lCont = document.getElementById("exListCont");
   lCont.style.height = ba_map.getOffsetHeight(lCont) + "px";
   if(ba_map.getOffsetHeight(lCont)>ba_map.par.global.availableHeight-100) {
    lCont.style.height = ba_map.par.global.availableHeight-100+ "px";
    lCont.style.overflow = "auto";
   }
   if(!eL.hasChildNodes()) {
    var newStatus = document.createElement("DIV");
    newStatus.id = "status";
    newStatus.style.fontSize = "10px";
    newStatus.style.textAlign = "center";
    var newImg = document.createElement("IMG");
    newImg.src = "../images/working.gif";
    var newMessage = document.createTextNode("loading ...");
    var newLine = document.createElement("BR");
    newStatus.appendChild(newImg);
    newStatus.appendChild(newLine);
    newStatus.appendChild(newMessage);
    eL.appendChild(newStatus);
    ajax.par.url = "/ngn/hallplan/getExhibitorsByHall.Ajax.asp?hallID="+ba_map.hallId+"&showID="+ba_map.showId+"&initial="+initial+"&instance="+ba_map.par.global.instance+"&organizer="+ba_map.par.global.organizer;
    ajax.par.callback_function = "ba_map.search.makeListOfExhibitors";
    ajax.par.return_xml = true;
    ajax.makeHttpRequest();
   }
  },
  "makeListOfExhibitors" : function(r) {
   var ex = "";
   var exIn = xml.getAttribute(r.documentElement, "initial");
   var eL = document.getElementById("exList"+exIn);
   try {
    eL.removeChild(document.getElementById("status"));
   }
   catch(e) {
   }
   var exNum = xml.getNumber(r, "n")
   if(exNum>0) {
    for(var i=0; i<exNum; i++) {
     var bId = xml.getAttribute(r.getElementsByTagName("e")[i], "bId");
     var oEx = xml.getChildValue(r.getElementsByTagName("e")[i], "n", 0);
     ba_map.search.pushList(eL, oEx+ba_map.search.getBooths(r.getElementsByTagName("e")[i]), "ex");
    }
   }
   else {
    ba_map.search.pushList(eL, sprachArray[18][ba_map.getLanguage()] + " \"" + exIn + "\"", "ex");
   }
   var lCont = document.getElementById("exListCont");
   lCont.style.height = ba_map.getOffsetHeight(lCont) + "px";
   if(ba_map.getOffsetHeight(lCont)>ba_map.par.global.availableHeight-100) {
    lCont.style.height = ba_map.par.global.availableHeight-100+ "px";
    lCont.style.overflow = "auto";
   }
  },
  "hideExLists" : function() {
   for (var i=0; i<document.getElementById("exList").childNodes.length; i++) {
    if(document.getElementById("exList").childNodes[i].style.display == "block") {
     document.getElementById("exList").childNodes[i].style.display = "none";
    }
   }
  },
  "pushList" : function (eL, text, cont) {
   var newEx = document.createElement("DIV");
   newEx.style.borderBottom = "1px solid black";
   newEx.innerHTML = text;
   newEx.className = "list";
   newEx.unselectable = "on";
   eL.appendChild(newEx);
  },
  "getBooths" : function (oEx) {
   var bString = "";
   for(var i=0; i<xml.getNumber(oEx, "b"); i++) {
    var e = oEx.getElementsByTagName("b")[i]
    var bId = xml.getAttribute(e, "bId");
    var x = xml.getAttribute(e, "x");
    var y = xml.getAttribute(e, "y");
    bString+=", <a class='standardA " + ba_map.getQueryString("frontend") + "' href='javascript: ba_map.search.toggleInfo(document.getElementById(\"kliotabcontainer\"), \"ex\", \"list1\"); ba_map.drawing.selectedBooths=[]; ba_map.drawing.selectedBooths.push("+bId+"); ba_map.dnd.jumpToBooth("+bId+", "+x+", "+y+")'>"+xml.getChildValue(oEx, "b", i)+"</a>";
   }
   bString+="<br>";
   return bString;
  },
  "getBoothsByHall" : function(strg) {
   if(strg.length>0) {  
    ajax.par.url = "/ngn/hallplan/getBoothsByHall.Ajax.asp?hallID="+ba_map.hallId+"&showID="+ba_map.showId+"&searchstring="+strg+"&instance="+ba_map.par.global.instance+"&organizer="+ba_map.par.global.organizer;
    ajax.par.callback_function = "ba_map.search.makeListOfBooths";
    ajax.par.return_xml = true;
    ajax.makeHttpRequest();
   }
  },
  "makeListOfBooths" : function(r) {
   var eL = document.getElementById("boothList");
   var bNum = xml.getNumber(r, "b");
   while (eL.hasChildNodes()) {
    eL.removeChild(eL.lastChild);
   }
   for(var i=0; i<bNum; i++) {
    var oEx = xml.getChildValue(r.getElementsByTagName("b")[i], "n", 0);
    ba_map.search.pushList(eL, ba_map.search.getBooth(r.getElementsByTagName("b")[i]), "booth");
   }
   if(bNum==1) {
    var b = r.getElementsByTagName("b")[0];
    ba_map.dnd.jumpToBooth(xml.getAttribute(b,("bId")), xml.getAttribute(b,("x")), xml.getAttribute(b,("y")));
   }   
   var lCont = document.getElementById("boothListCont");
   lCont.style.height = ba_map.getOffsetHeight(lCont) + "px";
   if(ba_map.getOffsetHeight(lCont)>ba_map.par.global.availableHeight-100) {
    lCont.style.height = ba_map.par.global.availableHeight-100+ "px";
    lCont.style.overflow = "auto";
   }
  },
  "getBooth" : function (b) {
   var bString;
   var n = xml.getChildValue(b, "n", 0);
   var bId = xml.getAttribute(b, "bId");
   var x = xml.getAttribute(b, "x");
   var y = xml.getAttribute(b, "y");
   bString="<a class='standardA " + ba_map.getQueryString("frontend") + "' href='javascript: ba_map.search.toggleInfo(document.getElementById(\"kliotabcontainer\"), \"booth\", \"list2\"); javascript: ba_map.drawing.selectedBooths=[]; ba_map.drawing.selectedBooths.push("+bId+"); ba_map.dnd.jumpToBooth("+bId+", "+x+", "+y+")'>"+n+"</a>";
   return bString;
  },
  "setAreaTab" : function() {
   if(ba_map.par.global.showArea) {
    var DOM_li = document.createElement("li");
	DOM_li.setAttribute("ignoredimension", "true");
    DOM_li.id = "list3";
    DOM_li.onclick = function() { ba_map.search.toggleInfo(document.getElementById("kliotabcontainer"), "area", "list3")};
    var DOM_a  = document.createElement("a");
	DOM_a.setAttribute("ignoredimension", "true");
    DOM_a.id = "text16";
    DOM_li.appendChild(DOM_a);
    document.getElementById("tab").insertBefore(DOM_li, document.getElementById("tab").firstChild);
    ba_map.DOM_img = document.createElement("IMG");
    ba_map.DOM_img.src = "gelaendeplan_" + ba_map.showId + ".gif";
    //DOM_img.style.borderBottom = "1px solid #778";
    //DOM_img.style.borderRight = "1px solid #778";
	//DOM_img.style.margin = "15px";
    var cont = document.getElementById("areaListCont");
    cont.appendChild(ba_map.DOM_img);
    for(var gr in ba_map.par.global.areaPlanMap) {
     var DOM_ul = document.createElement("UL");
	 DOM_ul.setAttribute("ignoredimension", "true");
     DOM_ul.className = (ba_map.getQueryString("frontend")) ? ba_map.par.global.areaPlanMap[gr].cssClass + " " + ba_map.getQueryString("frontend") : ba_map.par.global.areaPlanMap[gr].cssClass;
     DOM_ul.style.top = ba_map.par.global.areaPlanMap[gr].coordinates.y + "px";
     DOM_ul.style.left = ba_map.par.global.areaPlanMap[gr].coordinates.x + "px";
	 var i=0;
     for(var hall in ba_map.par.global.areaPlanMap[gr].halls) {
      var hallIndex = ba_map.par.global.areaPlanMap[gr].halls[hall].index;
      var DOM_li = document.createElement("LI");
	  if(ba_map.par.hall[hallIndex].id==ba_map.hallId) {
		  DOM_li.className = "active";
	  }
	  var hallName = ba_map.isArray(ba_map.par.hall[hallIndex].name) ? ba_map.par.hall[hallIndex].name[ba_map.getLanguage()] : ba_map.par.hall[hallIndex].name;
      var DOM_text = document.createTextNode(hallName);
      var DOM_a = document.createElement("A");
	  DOM_a.setAttribute("hallId", ba_map.par.hall[hallIndex].id);
	  DOM_a.setAttribute("hallGroup", gr);
	  DOM_a.setAttribute("index", i);
	  i++;
      DOM_a.className = "standardA " + ba_map.getQueryString("frontend");
      DOM_a.onclick = function() { 
                            var el = ba_map.par.global.areaPlanMap[this.getAttribute("hallGroup")].externURL;
                            var url = (el) ? ba_map.par.global.areaPlanMap[this.getAttribute("hallGroup")].externURL[this.getAttribute("index")].url[ba_map.getLanguage()] : "?tradeshowId=" + ba_map.showId + "&hallID=" + this.getAttribute('hallId') + "&language=" + ba_map.getQueryString('language') + "&companyid=" + ba_map.getQueryString('companyid') + "&frontend=" + ba_map.getQueryString('frontend') + "&width=" + ba_map.getQueryString("width") + "&height=" + ba_map.getQueryString("height");
                            if(el && ba_map.par.global.areaPlanMap[this.getAttribute("hallGroup")].externURL[this.getAttribute("index")].target != "_self") {
                             window.open(url, "nw");
                            }
                            else {
								/*FIXME
								  Workaround gonineltec
								*/
								if(el) {
									url += "&language=" + ba_map.getQueryString("language") +
									"&frontend=" + ba_map.getQueryString("frontend") +
									"&companyid=" + ba_map.getQueryString("companyid")
								}
                             location.href=url;
                           }
};
                             
      //DOM_a.className = "boothNr halls";
      DOM_a.appendChild(DOM_text);
      DOM_li.appendChild(DOM_a);
      DOM_ul.appendChild(DOM_li);
     } 
     cont.appendChild(DOM_ul);
    }
   }
   if(ba_map.getQueryString("exground")=="on") {
    ba_map.search.toggleInfo(document.getElementById("kliotabcontainer"), "area", "list3");
    if(document.getElementById("pdfWrapper")) {
     document.getElementById("pdfWrapper").style.display = "none";
    }
   }
  }
 },
 "debug" : function(o) {
  if(ba_map.par.global.debugging==true) {
   var d = document.getElementById("debugger");
   var new_entry = document.createElement("DIV");
   new_entry.style.borderBottom = "2px solid black";
   for(var item in o) {
	var new_item = document.createElement("DIV");
	new_item.style.borderBottom = "1px dotted #ccc";
	new_item.innerHTML = item + ": " + o[item];
	new_entry.appendChild(new_item);
   }
   d.appendChild(new_entry);
  }
 },
 "mouse" : {
  "x" : 0,
  "y" : 0,
  "setCursor" : function(c) {
   document.body.style.cursor = c;
  }
 }
}


