var isIE = (document.all && !window.opera)?true:false; /* * Constructor for the popup object .Although first argument is the * invoking POI.This constructor will be called from the POI constructor. */ function MQPopup(ParentContainer) { var popupWidth = "251px"; this.UId = getguid(); //create the container div var oDiv = document.createElement("div"); oDiv.id = "popupcontainer" + this.UId; oDiv.align='right'; oDiv.style.position = "absolute"; oDiv.style.align = "right"; oDiv.style.textAlign="left"; oDiv.style.margin = "10px"; oDiv.style.width = "267px"; oDiv.style.visibility = "visible"; oDiv.style.backgroundImage = 'url("images/poi-icon-off.png")'; oDiv.style.backgroundRepeat = 'repeat'; var brow = "-NS"; // if (__mqcontainer.browser.isIE) { // brow = "-IE"; // } else if (__mqcontainer.browser.isNS) { // brow = "-NS"; // } //create the top section var oSubDiv = document.createElement("div"); oSubDiv.id = "popuptop" + this.UId ; oSubDiv.className = "mqPopuptop" +brow; oSubDiv.style.width = popupWidth; oSubDiv.style.height = "14px"; oSubDiv.style.marginTop = "0px"; oDiv.appendChild(oSubDiv); //create the middle section oSubDiv = document.createElement("div"); oSubDiv.id = "popupmiddle" + this.UId ; oSubDiv.className = "mqPopupmiddle" +brow; oSubDiv.style.width = popupWidth; oSubDiv.style.minHeight = "35px"; oDiv.appendChild(oSubDiv); oSubDiv = document.createElement("div"); oSubDiv.id = "popupbottom" + this.UId ; oSubDiv.className = "mqPopupbottom" +brow; oSubDiv.style.width = popupWidth; oSubDiv.style.height = "19px"; oDiv.appendChild(oSubDiv); //create the pointer arrow oSubDiv = document.createElement("div"); oSubDiv.id = "popuppointer" + this.UId; // oSubDiv.className = "mqPopuppointer" +brow; // oSubDiv.style.position = "absolute"; // oSubDiv.style.top = "14px"; // oSubDiv.style.height = "31px"; // oSubDiv.style.width = "17px"; // oSubDiv.style.marginTop = "0px"; oDiv.appendChild(oSubDiv); oDiv.style.left = "10px"; oDiv.style.top = "10px"; oDiv.style.visibility = "hidden"; oDiv.style.zIndex = 2; var parentObj = (ParentContainer)? document.getElementById(ParentContainer) : document.getElementsByTagName("body").item(0); try { parentObj.appendChild(oDiv); } catch(e) { alert("An exception occurred in the script. Error name: " + e.name + ". Error message: " + e.message); } this.popupDiv = oDiv; this.popupId = ""; this.timeOutId = null; this.getTimeOutId = function(){return this.timeOutId;} this.setTimeOutId = function(strTimeOutId) { if (this.timeOutId) { clearTimeout(this.timeOutId); } this.timeOutId = strTimeOutId; } this.getState = function() { return (this.popupId); } /* * This is a function to set the popup over x,y position * having content as provided in html String. */ this.show = function (strX,strY,strHtmlText) { if(strHtmlText == undefined || strHtmlText == null) return; var OdivLeft = parseInt(strX) - 10; var OdivTop = parseInt(strY) - 34 ; var popupmidDiv; var brow = "-NS"; // if (__mqcontainer.browser.isIE) { // brow = "-IE"; // } else if (__mqcontainer.browser.isNS) { // brow = "-NS"; // } strHtmlText="
' + strHtmlText + '
'; } popupmidDiv.document.open(); popupmidDiv.document.write(htmlText2); popupmidDiv.document.close(); } var closeDiv = document.createElement("div"); closeDiv.className = "mqPopupclose"; currentpopup = this; closeDiv.onclick = function() { currentpopup.popupDiv.style.visibility = "hidden"; currentpopup.popupId = ""; } popupmidDiv.appendChild(closeDiv); this.popupDiv.onmouseout = function (evt) { var relatedObj; if (!evt) var evt = window.event; if (evt.relatedTarget) relatedObj = evt.relatedTarget; else if (evt.toElement) relatedObj = evt.toElement; var idStr = (relatedObj)?relatedObj.id : ""; var parentIdstr = (relatedObj && relatedObj.offsetParent)? relatedObj.offsetParent.id : ""; if (idStr.indexOf('popup')== -1 && parentIdstr.indexOf('popup')== -1) { currentpopup.hide(1000); } } this.popupDiv.onmouseover = function (evt) { currentpopup.setTimeOutId(null); } var popupPointerDiv = getElementById("popuppointer" + this.UId ); if(parseInt(strX) < 235) { popupPointerDiv.className = "mqPopuppointer" +brow; popupPointerDiv.style.position = "absolute"; popupPointerDiv.style.top = "14px"; popupPointerDiv.style.left = "0px"; popupPointerDiv.style.height = "31px"; popupPointerDiv.style.width = "17px"; popupPointerDiv.style.marginTop = "0px"; } else { popupPointerDiv.className = "mqPopuprightpointer" +brow; popupPointerDiv.style.position = "absolute"; popupPointerDiv.style.top = "14px"; popupPointerDiv.style.left = "257px"; popupPointerDiv.style.height = "31px"; popupPointerDiv.style.width = "17px"; popupPointerDiv.style.marginTop = "0px"; OdivLeft = OdivLeft - 271; } if(parseInt(strY) > 250) { popupPointerDiv.style.top = "42px"; OdivTop = OdivTop - 28; } this.popupDiv.style.zindex = 2; this.popupDiv.style.position = "absolute"; this.popupDiv.style.left = OdivLeft+ "px"; this.popupDiv.style.top = OdivTop+ "px"; this.popupDiv.style.visibility = "visible"; } this.showPopUpOverLocColl = function(strX,strY,strTargetPOIId,MQLocationCollection_locCol,iTolerance,strMapId) { var size = eval("__mqcontainer.map." +strMapId).MQMap.locations.getSize(); var transaction = eval("__mqcontainer.map." +strMapId).MQMap.locations.getTransaction(); var showLink = transaction=="locMap"?false:true; var htmlString = ""; var targetPOI; this.popupId = strTargetPOIId; var func = eval("__mqcontainer.map." + strMapId).MQMap.onRollover; var popupEnabled = eval("__mqcontainer.map." + strMapId).MQMap.rolloverPopups; var displayEnabled = eval("__mqcontainer.map." + strMapId).MQMap.popupContentDisplay; for (var i=0; i < size ;i++) { var currentLocation = MQLocationCollection_locCol.getAt(i); if ( currentLocation.poiLayer && strTargetPOIId == currentLocation.poiLayer.id ) { targetPOI=currentLocation; break; } } seperatorFlag = false; var locCollection = new MQLocationCollection(); for (var i=0; i < size ;i++) { var currentLocation = MQLocationCollection_locCol.getAt(i); if ( isAcceptable(parseInt(targetPOI.getX()),parseInt(targetPOI.getY()),parseInt(currentLocation.getX()),parseInt(currentLocation.getY()),iTolerance) ) { if(func) locCollection.add(currentLocation); if (seperatorFlag) { if(htmlString == "") { } else { // htmlString = htmlString + "