pageId = ""; VSrhData = ""; VPData = ""; VSData = ""; srhTpl = ""; PTpl = ""; SATpl = ""; TATpl = ""; VcurStateData = ""; currentZoom = 99; function Sdis(Tpl,typeTpl) { MAX = new miniAx() SATpl = unescape(Tpl); TATpl = unescape(typeTpl); p2 = new p2t(); sdata = eval(VSData); typelist = VSData.list.type; px = new p2t(); types = ""; for(var i in typelist) { types = types + px.p2t(typelist[i],TATpl); } sdata.type_list = types; tmp = p2.p2t(sdata,SATpl); res = ""; res = p2.p2t(sdata,SATpl); customData = new Object(); customData['pid'] = pageId; res = p2.p2t(customData,res); MAX.w2w("Acc_A",res); } function listGoNext(p) { MHR = new MPHR(); MHR.animReq = false; MHR.resIsJs = true; VPData = ""; MHR.GET('/Ax?m=nextFromResultSet&Vid='+VcurStateData+'&pf=' + p); } function listGoPrev(p) { listGoNext(p); } function listGoPage(p) { listGoNext(((p-1)*100)); } function Pdis(Tpl,Ntpl) { MAX = new miniAx(); PTpl = unescape(Tpl); my_Ntpl = new Object(); my_Ntpl.navBar = unescape(Ntpl); p2 = new p2t(); Plist = eval(VPData); res = ""; for(i in Plist) { res = res + p2.p2t(Plist[i],PTpl); } MAX.w2w("pointRes",res); MAX.w2w("pNav",my_Ntpl.navBar); MAX.w2w("pNavbot",my_Ntpl.navBar); } function miniAx() { this.w2w = function(w,s) { document.getElementById(w).innerHTML = s; } this.c2c = function(w) { return document.getElementById(w).innerHTML; } this.gobj = function(w) { return document.getElementById(w); } } function p2t() { this.pa = ""; this.p2t = function(d,t) { for(var i in d) { if(!this.ia(d[i]) && !this.io(d[i])) { s = '@@' + i + '@@'; sp = 0; sp = t.indexOf(s); bp = 0; while( sp > -1) { t = t.substring(0,sp) + d[i] + t.substring((sp+s.length)); bp = sp+s.length; sp = t.indexOf(s,bp); } } else { t = this.p2t_l2(d[i],t,i); this.pa = ""; } } return t; } this.p2t_l2 = function(d,t,p) { if(p) { this.pa = this.pa + p + ":"; } for(var i in d) { if(!this.ia(d[i]) && !this.io(d[i]) ) { s = '@@' + this.pa + i + '@@'; sp = 0; sp = t.indexOf(s); bp = 0; while( sp > -1) { t = t.substring(0,sp) + d[i] + t.substring((sp+s.length)); bp = sp+s.length; sp = t.indexOf(s,bp); } } else { t = this.p2t_l2(d[i],t,i); Vna = this.pa.split(":"); Vna.pop(); Vna.pop(); this.pa = Vna.join(":") + ':' ; } } return t; } this.ia = function(v) { return (v instanceof Array); } this.io = function(v) { if(this.ia(v)) { return false; } else { return (v !== null) && (typeof(v) == 'object'); }} } function tkjh() { MAX = new miniAx(); alert(MAX.c2c('srh_result')); } function tt(Tpl) { t = unescape(Tpl); p2 = new p2t(); MAX = new miniAx(); res = p2.p2t(eval(VSrhData),t); res = res.replace(/Status Code/gi,'asdasdasd'); MAX.w2w('srh_result',res); } function MPHR() { this.url = ''; this.busy = false; this.xmlhttp = null; this.resTarget = false; this.resIsJs = false; this.animReq = true; // reset object properties this.reset = function() { // set unassigned event handlers this.onloading = function(){ }; this.onloaded = function(){ }; this.oninteractive = function(){ }; // this.oncomplete = function(){ }; this.onabort = function(){ }; this.onerror = function(){ }; this.url = ''; this.busy = false; this.xmlhttp = null; } this.oncomplete = function() { if(this.resIsJs) { eval(this.get_text()); } else { if(this.resTarget) { this.w2w(this.resTarget,this.get_text()); } } } this.w2w = function(w,s) { document.getElementById(w).innerHTML = s; } this.c2c = function(w) { return document.getElementById(w).innerHTML; } this.gobj = function(w) { return document.getElementById(w); } // create HTMLHTTP object this.build = function() { if (window.XMLHttpRequest) this.xmlhttp = new XMLHttpRequest(); else if (window.ActiveXObject) this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); else { } } // sedn GET request this.GET = function(url) { this.build(); if (!this.xmlhttp) { this.onerror(this); return false; } if(this.resTarget) { if(this.animReq) { this.w2w(this.resTarget,getProReq(this.resTarget)); } } var ref = this; this.url = url; this.busy = true; this.xmlhttp.onreadystatechange = function(){ ref.xmlhttp_onreadystatechange(); }; this.xmlhttp.open('GET','' + url); this.xmlhttp.send(null); }; this.POST = function(url, a_param) { // not implemented yet }; // handle onreadystatechange event this.xmlhttp_onreadystatechange = function() { if(this.xmlhttp.readyState == 1) this.onloading(this); else if(this.xmlhttp.readyState == 2) this.onloaded(this); else if(this.xmlhttp.readyState == 3) this.oninteractive(this); else if(this.xmlhttp.readyState == 4) { try { if (this.xmlhttp.status == 0) { this.onabort(this); } else if(this.xmlhttp.status == 200) { this.oncomplete(this); } else { this.onerror(this); } this.busy = false; } catch(err) { this.onerror(this); this.busy = false; } } } // getter method for HTTP headers this.get_header = function(name) { return this.xmlhttp.getResponseHeader(name); }; this.get_text = function() { return this.xmlhttp.responseText; }; this.get_xml = function() { return this.xmlhttp.responseXML; }; this.reset(); } // end class function dialDis(dialdata) { MAX = new miniAx(); MAX.w2w("dialupInfo",unescape(dialdata)); } function noAccess(ttpl) { MAX = new miniAx(); MAX.w2w("Acc_A",unescape(ttpl)); } function doSrh(srh,pid,stype) { currentZoom = 99; if(stype) { MHR = new MPHR(); MHR.animReq = false; MHR.resIsJs = true; MHR.GET('/Ax?m=geoloc&S=' + srh + '&Pid=' + pid + '&Type=' + stype); } else { MHR = new MPHR(); MHR.animReq = false; MHR.resIsJs = true; MHR.GET('/Ax?m=geoloc&S=' + srh + '&Pid=' + pid); } pageId = pid; MAX = new miniAx(); MAX.w2w("srh_result",""); MAX.w2w("pointRes",""); MAX.w2w("pNav",""); MAX.w2w("pNavbot",""); } function getpoint(lat,lon,cid,acc,cattype) { MHR = new MPHR(); MHR.animReq = false; MHR.resIsJs = true; if(cattype) { MHR.GET('/Ax?m=pointaround&lat=' + lat + '&lon=' + lon + '&cid=' + cid + '&acc=' + acc + '&pageid=' + pageId + '&cattype=' + cattype); } else { MHR.GET('/Ax?m=pointaround&lat=' + lat + '&lon=' + lon + '&cid=' + cid + '&acc=' + acc + '&pageid=' + pageId); } } function notFound(tpl) { MAX = new miniAx() tpl = unescape(tpl); MAX.w2w("srh_result",tpl); } function sPop(Vfile,W,H) { window.open("https://secure.mobilitypass.com/" + Vfile ,'_blank','scrollbars=no,status=no,width=' + W + ',height=' + H); } function preLoad() { MM_preloadImages('images/manu_1_b.gif','images/manu_2_b.gif','images/manu_3_b.gif','images/manu_4_b.gif','images/manu_5_b.gif','images/manu_6_b.gif','images/manu_7_b.gif','images/manu_8_b.gif','images/manu_9_b.gif'); } function zoomMap(zType,zl) { if(currentZoom == 99) { if(zl == 1) { currentZoom = 3; } else if(zl > 6) { currentZoom = 14; } else if(zl > 4) { currentZoom = 10; } else { currentZoom = 6; } } if (zType == "IN") { currentZoom = currentZoom + 1; myImgPoint.src = '/dynmap.gif?lat=' + VSrhData['Placemark']['0']['Point']['coordinates']['0'] + '&lon=' + VSrhData['Placemark']['0']['Point']['coordinates']['1'] + '&w=240&h=240&zoom=' + currentZoom zoomIndicator.innerHTML = currentZoom; } if (zType == "OUT") { currentZoom = currentZoom - 1; if (currentZoom == 0) { currentZoom = 1; } myImgPoint.src = '/dynmap.gif?lat=' + VSrhData['Placemark']['0']['Point']['coordinates']['0'] + '&lon=' + VSrhData['Placemark']['0']['Point']['coordinates']['1'] + '&w=240&h=240&zoom=' + currentZoom zoomIndicator.innerHTML = currentZoom; } } function MapMgr() { this.mapdata = false; this.point_tpl = ''; // reset object properties this.addOnMap = function(map,mdata) { this.mapdata = mdata; this.mapobj = map; point = new Object(); for(i in this.mapdata) { this.mapobj.addOverlay(this.createMarker(this.mapdata[i])); } } this.createMarker = function(pdata) { point = new GLatLng(pdata.lat,pdata.lon); var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { p2 = new p2t(); cHtml = p2.p2t(pdata,unescape(Ptpl)); marker.openInfoWindowHtml(cHtml); }); return marker; } }