function gwMap(Name,AreaID,RecordID,Type) { var _Name = null; var _AreaID = null; var _RecordID = null; var _Type = null; var _Map = null; var _Size = null; if (Name != undefined) { this._Name = Name; this._AreaID = AreaID; this._RecordID = RecordID; this._Type = Type; this._Size = 0; var oDiv = document.getElementById(Name); oDiv.style["width"] = 501; oDiv.style["height"] = 334; oDiv.style["background"] = "#CCC"; this.load(); } } gwMap.prototype.zoom = function(e) { if (this._Size == 0) { this._Size = 1; } else { this._Size = 0; } this.display(); } gwMap.prototype.display = function() { var oDiv = document.getElementById(this._Name); var mapD = this._Map; var sWidth = 501; var sHeight = 334; var z = 2; if (mapD != undefined) { oDiv.innerHTML = ""; if (this._Size == 0) { var bkgI = mapD.src; bkgI = bkgI.replace(/maps/,"maps\/small"); oDiv.style.backgroundImage = "url("+bkgI+")"; oDiv.style["zIndex"] = 0; oDiv.style["position"] = "relative"; oDiv.style["left"] = null; oDiv.style["border"] = "1px solid #000"; } else { oDiv.style.backgroundImage = "url("+mapD.src+");"; sWidth = 1002; sHeight = 668; oDiv.style["zIndex"] = 20; oDiv.style["position"] = "absolute"; oDiv.style["left"] = 25; oDiv.style["border"] = "10px solid #000"; z = 22; } oDiv.style["width"] = sWidth; oDiv.style["height"] = sHeight; var baseX = findPosX(oDiv); var baseY = findPosY(oDiv); baseX = 0; baseY = 0; var le= mapD.locs.length; for(var i=0;i
"+ name + "
Loc: " + x + ", " + y; } else { alt = "" + name +"
Loc: " + x + ", " + y; } oDiv.innerHTML += "
"; } } else { oDiv.innerHTML = "no map data available"; } } gwMap.prototype.load = function() { var oMap = this; var oDiv = document.getElementById(this._Name); var provider = new oyXMLRPCProvider(); var mapLoadComplete = function(jsonData) { oMap._Map = jsonData; oMap.display(); } var myOnLog = function(msg) { oDiv.innerHTML = "error, "+msg+ "\n"; } if (provider.isSupported()) { provider.onComplete = mapLoadComplete; provider.onError = myOnLog; oDiv.innerHTML = "Loading, please wait.
If map does not display, please bug report this on the forums with your browser settings and any javascript errors."; provider.submit("/json/map2.php?AreaID="+this._AreaID+"&RecordID="+this._RecordID+"&Type="+this._Type); } else { oDiv.innerHTML = "
Interactive maps are not supported by your web browser."; } }