mirai=new Object();
mirai.MiraiConfig={};
mirai.configs=[];
mirai.initied=false;
mirai.miraiLoaded=false;
mirai.miraiSRC="http://www.hotelsearch.com/javascript/mirai/";
mirai.isDebug=false;
mirai.https=false;
mirai.loaded={};
mirai.appLoaded={};
mirai.timeout=10000;
mirai.timeoutdep=13000;
mirai.timetotry=150;
mirai.idTimeoutCheckLoaded=null;
mirai.dojoLoading=false;
mirai.dojoLoaded=false;
mirai.dojoSRC="http://www.hotelsearch.com/javascript/dojoxd/";
mirai.dojoXD=true;
mirai.idTimeoutCheckDojoLoaded=null;
mirai.jqueryLoading=false;
mirai.jqueryLoaded=false;
mirai.jquerySRC="http://www.hotelsearch.com/javascript/jquery/";
mirai.idTimeoutCheckJQueryLoaded=null;
mirai.bodyLoading=false;
mirai.bodyLoaded=false;
mirai.appendConfig=function(_1){
if(!this.initied&&_1.https!=undefined){
this.https=_1.https;
}
if(this.https){
this.miraiSRC="https://www.hotelsearch.com/javascript/mirai/";
this.dojoSRC="https://www.hotelsearch.com/javascript/dojoxd/";
this.jquerySRC="https://www.hotelsearch.com/javascript/jquery/";
}
if(!this.initied&&_1.prefix!=undefined){
this.miraiSRC=_1.prefix;
}
if(!this.initied){
this.initied=true;
}
_1.miraiLoaded=false;
_1.dojoLoaded=false;
_1.jqueryLoaded=false;
_1.callPending=false;
_1.callDone=false;
this.configs.push(_1);
if(_1.loadDojo){
if(!this.dojoLoading&&!this.dojoLoaded){
var _2=true;
}else{
var _2=false;
}
if(_2&&_1.isDebug!=undefined){
this.isDebug=_1.isDebug;
}
if(_2&&_1.xdDojo!=undefined){
this.dojoXD=_1.xdDojo;
}
if(_2&&_1.prefixDojo!=undefined){
this.dojoSRC=_1.prefixDojo;
}
if(!this.dojoLoading){
this.loadDojoLibrary();
}
this.checkDojo();
}
if(_1.loadJQuery){
if(!this.jqueryLoading&&!this.jqueryLoaded){
var _3=true;
}else{
var _3=false;
}
if(_3&&_1.prefixJQuery!=undefined){
this.jquerySRC=_1.prefixJQuery;
}
if(!this.jqueryLoading){
this.loadJQueryLibrary();
}
this.checkJQuery();
}
if(_1.checkBodyLoaded&&!this.bodyLoaded&&!this.bodyLoading){
var _4=this;
this.addEvent(window,"load",function(){
_4.bodyLoaded=true;
});
}
if(_1.loadDojo||_1.loadJQuery||_1.checkBodyLoaded){
return;
}
this.checkMiraiLoaded();
};
mirai.checkMiraiLoaded=function(){
var _5=this;
var _6=true;
var _7=true;
var _8=true;
var _9=true;
for(var c=0;c<this.configs.length;c++){
var _b=this.configs[c];
if(_b.checkBodyLoaded&&!mirai.bodyLoaded){
_9=false;
}else{
if(_b.loadDojo&&!_b.dojoLoaded){
_7=false;
}else{
if(_b.loadJQuery&&!this.jqueryLoaded){
_8=false;
}else{
if(!_b.miraiLoaded){
var _c=true;
if(_b.depsMirai!=undefined){
for(var i=0;i<_b.depsMirai.length;i++){
var _e=_b.depsMirai[i];
if(_e.indexOf("mirai.")!=0){
_e="mirai."+_e;
}
if((!this.loaded[_e]||!this.isLoaded(_e))&&!this.isTimeOut(_e)){
if(!this.isLoading(_e)){
this.require(_e);
}
_c=false;
}
}
}
if(!_c){
_6=false;
}else{
this.configs[c].miraiLoaded=true;
if(_b.callback){
this.configs[c].callPending=true;
}
}
}
}
}
}
}
if(!_9){
setTimeout(function(){
_5.checkMiraiLoaded();
},this.timetotry);
}
if(!_7){
this.checkDojo();
}
if(!_8){
this.checkJQuery();
}else{
if(_6){
for(var c=0;c<this.configs.length;c++){
var _b=this.configs[c];
if(_b.callPending&&!_b.callDone){
this.configs[c].callPending=false;
this.configs[c].callDone=true;
this.configs[c].callback.call();
}
}
this.miraiLoaded=true;
}else{
setTimeout(function(){
_5.checkMiraiLoaded();
},this.timetotry);
}
}
};
mirai.dojoRequire=function(_f){
if(this.dojoLoaded){
dojo.require(_f);
return;
}
var _10={};
_10.loadDojo=true;
_10.depsDojo=new Array(_f);
this.appendConfig(_10);
};
mirai.require=function(lib,_12){
try{
if(this.isLoaded(lib)==true){
try{
_12.call();
return;
}
catch(e){
return;
}
}
}
catch(e){
var ee=2;
}
this._newLib(lib,{},_12);
this._loadScript(lib);
};
mirai.loadExternal=function(lib,_15){
this.require(lib,_15);
};
mirai.requireIf=function(lib,_17,_18){
try{
if(this.isLoaded(lib)==true){
try{
_18.call();
return;
}
catch(e){
return;
}
}
}
catch(e){
var ee=2;
}
var _1a=true;
for(d in _17){
if(!this.loaded[_17[d]]||!this.isLoaded(_17[d])){
this.require(_17[d]);
_1a=false;
}
}
if(_1a){
this.require(lib,_18);
}else{
var _1b=this;
this._newLib(lib,_17,_18);
setTimeout(function(){
_1b.checkLoadedIf(lib);
},this.timetotry);
}
};
mirai.loadExternalIf=function(lib,_1d,_1e){
this.requireIf(lib,_1d,_1e);
};
mirai.checkLoaded=function(lib){
try{
if(this.isLoaded(lib)==true){
if(this.loaded[lib].callback.length){
for(var i=0;i<this.loaded[lib].callback.length;i++){
this.loaded[lib].callback[i].call();
}
this.loaded[lib].callback=new Array();
}
}else{
if(this.loaded[lib].timeout>=this.timeout){
this.loaded[lib].timedout=true;
alert("Timeout Loading:"+lib);
return;
}
var _21=this;
this.loaded[lib].timeout=this.loaded[lib].timeout+this.timetotry;
setTimeout(function(){
_21.checkLoaded(lib);
},this.timetotry);
}
}
catch(e){
var ee=2;
}
};
mirai.checkLoadedIf=function(lib){
try{
var _24=true;
for(d in this.loaded[lib].deps){
if(!this.loaded[this.loaded[lib].deps[d]]||!this.loaded[this.loaded[lib].deps[d]].loaded){
_24=false;
}
}
if(_24){
this.require(lib,this.loaded[lib].callback);
}else{
if(this.loaded[lib].timeout>=this.timeoutdep){
this.loaded[lib].timedout=true;
alert("Timeout Loading Dependencies:"+lib);
return;
}
var _25=this;
this.loaded[lib].timeout=this.loaded[lib].timeout+this.timetotry;
setTimeout(function(){
_25.checkLoadedIf(lib);
},this.timetotry);
}
}
catch(e){
var ee=2;
}
};
mirai.setLoaded=function(lib){
if(!this.loaded[lib]){
this._newLib(lib,{});
}
this.loaded[lib].loading=false;
this.loaded[lib].loaded=true;
};
mirai.setAppLoaded=function(app){
this.appLoaded[app]=true;
};
mirai.isLoaded=function(lib){
try{
return this.loaded[lib].loaded;
}
catch(e){
return false;
}
};
mirai.isAppLoaded=function(app){
try{
return this.appLoaded[app];
}
catch(e){
return false;
}
};
mirai.isLoading=function(lib){
try{
return this.loaded[lib].loading;
}
catch(e){
return false;
}
};
mirai.isTimeOut=function(lib){
try{
return this.loaded[lib].timedout;
}
catch(e){
return false;
}
};
mirai._newLib=function(lib,_2e,_2f){
if(!this.loaded[lib]){
this.loaded[lib]={};
this.loaded[lib].deps=_2e;
this.loaded[lib].loading=false;
this.loaded[lib].loaded=false;
this.loaded[lib].timeout=0;
this.loaded[lib].timedout=false;
this.loaded[lib].callback=new Array();
}
if(_2f){
this.loaded[lib].callback.push(_2f);
}
};
mirai._loadScript=function(lib){
if(!this.loaded[lib].loading){
this.loaded[lib].loading=true;
var _31=lib;
_31=_31.replace("mirai.","");
_31=_31.replace(".","/")+".js";
var _32=document.createElement("script");
_32.type="text/javascript";
_32.src=this.miraiSRC+"/src/"+_31;
document.getElementsByTagName("head")[0].appendChild(_32);
var _33=this;
setTimeout(function(){
_33.checkLoaded(lib);
},this.timetotry);
}
};
mirai.loadDojoLibrary=function(){
this.dojoLoading=true;
djConfig={};
if(this.dojoXD){
djConfig.useXDomain=true;
}
if(this.isDebug){
djConfig.isDebug=true;
}
document.write("<script type=\"text/javascript\" src=\""+this.dojoSRC+"dojo.js\"><"+"/script>");
};
mirai.checkDojo=function(){
try{
dojo.setModulePrefix("dojo",this.dojoSRC+"src");
try{
for(var c=0;c<this.configs.length;c++){
var _35=this.configs[c];
if(_35.loadDojo&&!_35.dojoLoaded){
if(_35.depsDojo){
for(var i=0;i<_35.depsDojo.length;i++){
var d=_35.depsDojo[i];
if(d.indexOf("dojo.")!=0){
d="dojo."+d;
}
dojo.require(d);
}
}
this.configs[c].dojoLoaded=true;
}
}
}
catch(e){
var ee=2;
}
var _39=this;
if(!this.dojoLoaded){
dojo.addOnLoad(function(){
_39.setDojoLoaded();
});
}else{
this.checkMiraiLoaded();
}
}
catch(e){
var _39=this;
setTimeout(function(){
_39.checkDojo();
},150);
return;
}
};
mirai.setDojoLoaded=function(){
this.dojoLoaded=true;
this.checkMiraiLoaded();
};
mirai.loadJQueryLibrary=function(){
this.jqueryLoading=true;
document.write("<script type=\"text/javascript\" src=\""+this.jquerySRC+"jquery-latest.pack.js\"><"+"/script>");
};
mirai.checkJQuery=function(){
try{
if(!this.jqueryLoaded){
try{
var _3a=jQuery;
this.setJQueryLoaded();
}
catch(e){
var _3b=this;
setTimeout(function(){
_3b.checkJQuery();
},2000);
}
}else{
this.checkMiraiLoaded();
}
}
catch(e){
var _3b=this;
setTimeout(function(){
_3b.checkJQuery();
},2000);
return;
}
};
mirai.setJQueryLoaded=function(){
this.jqueryLoaded=true;
this.checkMiraiLoaded();
};
mirai.addEvent=function(obj,_3d,_3e){
if(obj.addEventListener){
obj.addEventListener(_3d,_3e,false);
}else{
if(obj.attachEvent){
obj.attachEvent("on"+_3d,_3e);
}
}
};
mirai.getTagsByType=function(_3f){
var _40=new Array();
var _41=document.getElementsByTagName("div");
for(var i=0;i<_41.length;i++){
for(var j=0;j<_41[i].attributes.length;j++){
var _44=_41[i].attributes[j];
if((_44.name=="miraiType"||_44.name=="miraitype")&&_44.value==_3f){
_40.push(_41[i]);
}
}
}
return _40;
};
mirai.getAttributeFromTag=function(tag,_46){
var _47=_46.toLowerCase();
for(var j=0;j<tag.attributes.length;j++){
var _49=tag.attributes[j];
if(_49.name==_46||_49.name==_47){
return _49.value;
}
}
};
mirai.extend=function(_4a,_4b){
function inheritance(){
}
inheritance.prototype=_4b.prototype;
_4a.prototype=new inheritance();
_4a.prototype.constructor=_4a;
_4a.baseConstructor=_4b;
_4a.superClass=_4b.prototype;
};
try{
mirai.appendConfig(MiraiConfig);
}
catch(e){
var ee=2;
}
mirai.io=new Object;
mirai.io.BindScript=function(_4c){
dojo.debug("mirai.io.BindScript.constructor: begin");
this.request={};
this.request["url"]=_4c["url"];
this.request["load"]=_4c["load"];
this.request["error"]=_4c["error"];
dojo.debugShallow(this.request);
this.parameters={};
this._loadOrg=this.request["load"];
var _4d=this;
this.request["load"]=function(_4e,_4f,evt){
_4d._loadOrg(_4e,decodeURIComponent(_4f));
};
dojo.debug("mirai.io.BindScript.constructor: end");
};
mirai.io.BindScript.prototype.addParameter=function(_51,_52){
this.parameters[_51]=_52;
};
mirai.io.BindScript.prototype.clearParameters=function(){
dojo.debug("mirai.io.BindScript.clearParameters");
this.parameters={};
};
mirai.io.BindScript.prototype.send=function(){
dojo.debug("mirai.io.BindScript.send: begin");
this.parameters["ref"]=document.location;
dojo.debug("mirai.io.BindScript.send: referer->"+this.parameters["ref"]);
try{
var _53=[];
for(var _54 in this.parameters){
_53.push(_54+"="+encodeURIComponent(this.parameters[_54]));
}
var _55="?"+_53.join("&");
}
catch(e){
var _55="";
}
var _56={};
_56["url"]=this.request["url"]+_55;
_56["load"]=this.request["load"];
_56["error"]=this.request["error"];
_56["transport"]="ScriptSrcTransport";
_56["jsonParamName"]="callback";
_56["mimetype"]="text/plain";
dojo.io.bind(_56);
dojo.debugShallow(_56);
dojo.debug("mirai.io.BindScript.send: end");
};
mirai.io.FileUpload=function(_57){
dojo.debug("mirai.io.FileUpload.constructor: begin");
this.request={};
this.request["url"]=_57["url"];
this.request["load"]=_57["load"];
this.request["error"]=_57["error"];
this.request["form"]=_57["form"];
dojo.debugShallow(this.request);
this.parameters={};
var _58=this;
this._loadOrg=this.request["load"];
this.request["load"]=function(_59,_5a,evt){
_58._loadOrg(_59,_5a,evt);
};
dojo.debug("mirai.io.FileUpload.constructor: end");
};
mirai.io.FileUpload.prototype.setForm=function(_5c){
this.request["form"]=_5c;
};
mirai.io.FileUpload.prototype.addParameter=function(_5d,_5e){
this.parameters[_5d]=_5e;
};
mirai.io.FileUpload.prototype.clearParameters=function(){
dojo.debug("mirai.io.FileUpload.clearParameters");
this.parameters={};
};
mirai.io.FileUpload.prototype.send=function(_5f){
dojo.debug("mirai.io.FileUpload.send: begin");
var _60={};
_60.url=this.request["url"];
_60.mimetype="text/plain";
_60.handler=this.request["load"];
_60.error=this.request["error"];
_60.transport="IframeTransport";
_60.formNode=this.request["form"];
try{
for(var _61 in this.parameters){
this._addParameter(_61,this.parameters[_61]);
}
this._addParameter("fileField",_5f);
}
catch(e){
var ee=2;
}
dojo.io.bind(_60);
dojo.debugShallow(_60);
dojo.debug("mirai.io.FileUpload.send: end");
};
mirai.io.FileUpload.prototype._addParameter=function(_63,_64){
if(!this.request["form"][_63]){
var _65=document.createElement("input");
_65.setAttribute("type","hidden");
_65.setAttribute("name",_63);
_65.setAttribute("value",_64);
this.request["form"].appendChild(_65);
}
};
try{
mirai.setLoaded("mirai.io");
}
catch(e){
var ee=2;
}
mirai.json=new Object();
mirai.json.JSONDecode=function(_66){
return dojo.json.evalJson(_66);
};
mirai.json.JSONEncode=function(_67){
return dojo.json.serialize(_67);
};
try{
mirai.setLoaded("mirai.json");
}
catch(e){
var ee=2;
}
mirai.googlemapResultDefaults={urlservice:"http://webservices.hotelsearch.com/server/services2hotels_json.php",skinconfiguration:"HS_RESULT_SEARCH",skinsearch:"HS_RESULT",where:null,gevent:null,id:null,language:1,cid:null,startSize:"small",smallSize:{width:"300px",height:"250px"},bigSize:{width:"550px",height:"350px"},showIcons:true};
mirai.googlemapResult=function(_68){
this.params=dojo.lang.mixin({},mirai.googlemapResultDefaults);
if(_68){
this.params=dojo.lang.mixin(this.params,_68);
}
var css=document.createElement("link");
css.rel="stylesheet";
css.type="text/css";
css.href="/css/gmap.css";
document.documentElement.childNodes[0].appendChild(css);
this.ready=false;
this._modulesok=false;
var _6a=this;
mirai.requireIf("mirai.googlemap",["mirai.io","mirai.json"],function(){
_6a.init.call(_6a);
});
};
mirai.googlemapResult.prototype.init=function(){
this.miraigmap=new mirai.googlemap(this.params.where,this.params.gevent);
this.mapSize=null;
if(!this.params.smallSize){
if(!this.params.bigSize){
alert("Error in map area size definition");
return;
}
var _6b="big";
}else{
var _6b="small";
if(this.params.startSize=="big"&&this.params.bigSize){
var _6b="big";
}
}
this.changeSize(_6b,false);
if(this.params.center){
var _6c={};
_6c.center=this.params.center;
_6c.zoom=this.params.zoom;
_6c.controls="none";
this.miraigmap.setCenter(_6c);
}
var _6d=this;
var _6e=function(_6f,_70,evt){
_6d.parseGMapConf.call(_6d,_6f,_70);
};
var _72=function(_73,_74,evt){
_6d.parseGMap.call(_6d,_73,_74);
};
var _76=function(_77,_78,evt){
_6d.parseInfoWindow.call(_6d,_77,_78);
};
var _7a=function(_7b,_7c,evt){
_6d.parseGetGMapFromLocation.call(_6d,_7b,_7c);
};
var _7e=function(_7f,_80,evt){
_6d.parseSetGMap.call(_6d,_7f,_80);
};
var _82=function(){
_6d.showError.call(_6d);
};
var _83={};
_83["url"]=this.params.urlservice;
_83["load"]=_6e;
_83["error"]=_82;
this.ws_gmapconf=new mirai.io.BindScript(_83);
_83["load"]=_72;
this.ws_gmap=new mirai.io.BindScript(_83);
_83["load"]=_76;
this.ws_infowindow=new mirai.io.BindScript(_83);
_83["load"]=_7a;
this.ws_getgmapfromlocation=new mirai.io.BindScript(_83);
_83["load"]=_7e;
this.ws_setgmap=new mirai.io.BindScript(_83);
this.fixedgmapvalues=new Array();
this.fixedgmapvaluesAuxIds={};
this.fixedgmapvaluesAuxPos={};
this.unknowngmapvalues={};
this.fixedmarkers={};
this.ipmarkers={};
this.armarkers={};
this.interestplacesfilter=null;
this.hotelsfilter=null;
this.ready=true;
};
mirai.googlemapResult.prototype.showError=function(){
alert("error");
};
mirai.googlemapResult.prototype.getGMapConf=function(){
var _84=mirai.getTagsByType("googlemap");
var ids=new Array();
for(var i=0;i<_84.length;i++){
var id=mirai.getAttributeFromTag(_84[i],"entityId");
var pos=mirai.getAttributeFromTag(_84[i],"entityPosition");
if(pos<100){
ids.push(id);
this.fixedgmapvaluesAuxIds[id]=_84[i].id;
this.fixedgmapvaluesAuxPos[id]=pos;
}else{
var _89={};
_89["id"]=_84[i].id;
_89["pos"]=pos;
this.unknowngmapvalues[id]=_89;
}
}
this.ws_gmapconf.clearParameters();
this.ws_gmapconf.addParameter("id","1");
this.ws_gmapconf.addParameter("action","getGMapConf");
this.ws_gmapconf.addParameter("skin",this.params.skinconfiguration);
this.ws_gmapconf.addParameter("language",this.params.language);
this.ws_gmapconf.addParameter("cid",this.params.cid);
this.ws_gmapconf.addParameter("entities",mirai.json.JSONEncode(ids));
this.ws_gmapconf.send();
};
mirai.googlemapResult.prototype.showIcons=function(){
var _8a=this;
if(this.params.setGMap){
for(var i in this.unknowngmapvalues){
var _8c=document.createElement("img");
_8c.src=this.miraigmap.iconsurl+"hunknown.png";
_8c.style.cursor="hand";
_8c.style.cursor="pointer";
_8c.idMirai=i;
var _8d=function(){
_8a.setPosition(this.idMirai);
};
if(this.params.setGMap){
_8c.onclick=_8d;
}
document.getElementById(this.unknowngmapvalues[i]["id"]).appendChild(_8c);
}
}
for(var i=0;i<this.fixedgmapvalues.length;i++){
var _8c=document.createElement("img");
_8c.src=this.miraigmap.iconsurl+this.fixedgmapvalues[i]["i"]["f"];
_8c.style.cursor="hand";
_8c.style.cursor="pointer";
_8c.idMirai=i;
var _8e=function(){
_8a.params.iconWithMap(this.idMirai);
};
if(this.params.iconWithMap){
_8c.onclick=_8e;
}
document.getElementById(this.fixedgmapvalues[i].auxId).appendChild(_8c);
}
};
mirai.googlemapResult.prototype.parseGMapConf=function(_8f,_90){
_90=mirai.json.JSONDecode(_90);
this.fixedgmapvalues=_90.fixedgmapvalues;
this.configFixedValues();
this.hotelsfilter=mirai.json.JSONEncode(_90["hotelsfilter"]);
this.interestplacesfilter=mirai.json.JSONEncode(_90["interestplacesfilter"]);
var _91=this;
if(!this.miraigmap.map.movlist){
this.miraigmap.map.movlist=GEvent.addListener(this.miraigmap.map,"moveend",function(){
_91.getGMap.call(_91);
});
}
this.getGMap();
this.showIcons();
};
mirai.googlemapResult.prototype.configFixedValues=function(){
this.lastpos=0;
for(var i=0;i<this.fixedgmapvalues.length;i++){
var id=this.fixedgmapvalues[i]["id"];
var pos=this.fixedgmapvaluesAuxPos[id];
this.fixedgmapvalues[i].entityPosition=pos;
this.fixedgmapvalues[i].auxId=this.fixedgmapvaluesAuxIds[id];
this.fixedgmapvalues[i]["i"]["f"]="h"+pos+".png";
this.fixedgmapvalues[i]["i"]["p"]=new Array();
this.fixedgmapvalues[i]["i"]["p"]["lat"]=17;
this.fixedgmapvalues[i]["i"]["p"]["lng"]=32;
if(pos>this.lastpos){
this.lastpos=pos;
}
}
var _95=new GLatLngBounds();
if(this.params.center){
_95.extend(this.params.center);
}
for(var i=0;i<this.fixedgmapvalues.length;i++){
if(this.fixedgmapvalues[i]["p"]!="none"){
_95.extend(new GLatLng(this.fixedgmapvalues[i]["p"]["lat"],this.fixedgmapvalues[i]["p"]["lng"]));
}
}
zoommap=this.miraigmap.map.getBoundsZoomLevel(_95);
var _96={};
_96.center=_95.getCenter();
_96.zoom=zoommap;
this.miraigmap.setCenter(_96);
};
mirai.googlemapResult.prototype.getGMapValues=function(){
return this.fixedgmapvalues;
};
mirai.googlemapResult.prototype.getUnknownGMapValues=function(){
return this.unknowngmapvalues;
};
mirai.googlemapResult.prototype.getGMap=function(){
var _97=this.miraigmap.map.getBounds();
var sw=_97.getSouthWest();
var ne=_97.getNorthEast();
this.ws_gmap.clearParameters();
this.ws_gmap.addParameter("action","getGMap");
this.ws_gmap.addParameter("id",this.params.id);
this.ws_gmap.addParameter("skin",this.params.skinsearch);
this.ws_gmap.addParameter("language",this.params.language);
this.ws_gmap.addParameter("cid",this.params.cid);
this.ws_gmap.addParameter("interestplacesfilter",this.interestplacesfilter);
this.ws_gmap.addParameter("hotelsfilter",this.hotelsfilter);
this.ws_gmap.addParameter("zoom",17-this.miraigmap.map.getZoom());
this.ws_gmap.addParameter("swlat",sw.lat());
this.ws_gmap.addParameter("swlng",sw.lng());
this.ws_gmap.addParameter("nelat",ne.lat());
this.ws_gmap.addParameter("nelng",ne.lng());
this.ws_gmap.send();
};
mirai.googlemapResult.prototype.parseGMap=function(_9a,_9b){
_9b=mirai.json.JSONDecode(_9b);
var msg="";
var _9d=this;
try{
iplaces=_9b["interestplaces"];
this.ipmarkers=this.miraigmap.clearMarkersIf(this.ipmarkers,iplaces);
if(this.mapSize=="big"){
var _9e=function(_9f){
_9d.getInfoWindow.call(_9d,_9f,"IP");
};
}else{
var _9e=function(_a0){
return;
};
}
for(var i=0;i<iplaces.length;i++){
try{
if(!this.ipmarkers[iplaces[i]["id"]]){
this.ipmarkers[iplaces[i]["id"]]=this.miraigmap.addMarker(iplaces[i],_9e);
this.ipmarkers[iplaces[i]["id"]].markertype="IP";
}
}
catch(e){
var eee=2;
}
}
}
catch(e){
var eee=2;
}
var i=0;
try{
areas=_9b["areas"];
this.armarkers=this.miraigmap.clearMarkersIf(this.armarkers,areas);
if(this.mapSize=="big"){
var _9e=function(_a3){
_9d.getInfoWindow.call(_9d,_a3,"PO");
};
}else{
var _9e=function(_a4){
return;
};
}
for(i=0;i<areas.length;i++){
try{
if(!this.armarkers[areas[i]["id"]]){
this.armarkers[areas[i]["id"]]=this.miraigmap.addPolygon(areas[i],_9e);
this.armarkers[areas[i]["id"]].markertype="PO";
}
}
catch(e){
var eee=2;
}
}
}
catch(e){
var eee=2;
}
for(var _a5=0;_a5<this.fixedgmapvalues.length;_a5++){
if(this.mapSize=="small"){
if(this.params.smallMapAction){
var _9e=this.params.smallMapAction;
}else{
var _9e=function(_a6){
return;
};
}
}else{
var _9e=null;
}
if(this.fixedgmapvalues[_a5]["p"]!="none"){
var id=this.fixedgmapvalues[_a5]["id"];
if(this.fixedmarkers[id]){
this.miraigmap.map.removeOverlay(this.fixedmarkers[id]);
}
this.fixedmarkers[id]=this.miraigmap.addMarker(this.fixedgmapvalues[_a5],_9e);
}
}
};
mirai.googlemapResult.prototype.getInfoWindow=function(_a8,_a9){
if(!_a9){
return;
}
var id=_a8.id;
switch(_a9){
case "MAIN":
if(_a9=="MAIN"&&this.mainmarkerObj&&this.mainmarkerObj.html){
this.miraigmap.map.openInfoWindowHtml(this.mainmarkerObj.iconpos,this.mainmarkerObj.html);
return;
}
break;
case "IP":
if(this.ipmarkers[id]&&this.ipmarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.ipmarkers[id].iconpos,this.ipmarkers[id].html);
return;
}
break;
case "PO":
if(this.armarkers[id]&&this.armarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.armarkers[id].iconpos,this.armarkers[id].html);
return;
}
break;
case "HOTEL":
if(this.fixedmarkers[id]&&this.fixedmarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.fixedmarkers[id].iconpos,this.fixedmarkers[id].html);
return;
}
break;
}
if(_a9=="MAIN"){
this.mainmarkerObj=_a8;
}
this.ws_infowindow.clearParameters();
this.ws_infowindow.addParameter("action","getInfoWindow");
this.ws_infowindow.addParameter("id",this.params.id);
this.ws_infowindow.addParameter("skin",this.params.skinconfiguration);
this.ws_infowindow.addParameter("language",this.params.language);
this.ws_infowindow.addParameter("cid",this.params.cid);
this.ws_infowindow.addParameter("identity",id);
this.ws_infowindow.addParameter("type",_a9);
this.ws_infowindow.send();
};
mirai.googlemapResult.prototype.parseInfoWindow=function(_ab,_ac){
_ac=mirai.json.JSONDecode(_ac);
var id=_ac["id"];
switch(_ac["t"]){
case "MAIN":
this.miraigmap.map.openInfoWindowHtml(this.mainmarkerObj.iconpos,_ac["i"]);
this.mainmarkerObj.html=_ac["i"];
break;
case "IP":
this.miraigmap.map.openInfoWindowHtml(this.ipmarkers[id].iconpos,_ac["i"]);
this.ipmarkers[id].html=_ac["i"];
break;
case "PO":
this.miraigmap.map.openInfoWindowHtml(this.armarkers[id].iconpos,_ac["i"]);
this.armarkers[id].html=_ac["i"];
break;
case "HOTEL":
this.miraigmap.map.openInfoWindowHtml(this.fixedmarkers[id].iconpos,_ac["i"]);
this.fixedmarkers[id].html=_ac["i"];
break;
}
};
mirai.googlemapResult.prototype.changeSize=function(_ae,_af){
if(_ae==this.mapSize){
return;
}
if((_ae=="big"&&!this.params.bigSize)||(_ae=="small"&&!this.params.smallSize)){
return;
}
this.mapSize=_ae;
if(_ae=="big"&&this.params.bigSize){
startSize=this.params.bigSize;
}
if(_ae=="small"&&this.params.smallSize){
startSize=this.params.smallSize;
}
this.miraigmap.where.style.width=startSize.width;
this.miraigmap.where.style.height=startSize.height;
if(_af){
this.miraigmap.clearMarkers();
this.fixedmarkers={};
this.ipmarkers={};
this.armarkers={};
}
this.miraigmap.map.checkResize();
if(this.fixedgmapvalues&&this.fixedgmapvalues.length){
var _b0=new GLatLngBounds();
if(this.params.center){
_b0.extend(this.params.center);
}
for(var _b1=0;_b1<this.fixedgmapvalues.length;_b1++){
if(this.fixedgmapvalues[_b1]["p"]!="none"){
_b0.extend(new GLatLng(this.fixedgmapvalues[_b1]["p"]["lat"],this.fixedgmapvalues[_b1]["p"]["lng"]));
}
}
zoommap=this.miraigmap.map.getBoundsZoomLevel(_b0);
var _b2={};
_b2.center=_b0.getCenter();
_b2.zoom=zoommap;
this.miraigmap.setCenter(_b2);
}
if(this.mapSize=="small"){
this.miraigmap.setControls("standard");
}
if(this.mapSize=="big"){
this.miraigmap.setControls("standard");
}
};
mirai.googlemapResult.prototype.setPosition=function(id){
if(!id){
return;
}
var _b4=this;
var _b5=dojo.html.getViewportSize();
if(!this.setmap){
this.setmapdiv=document.createElement("div");
this.setmapdiv.style.position="absolute";
this.setmapdiv.style.width=(_b5[0]-80)+"px";
this.setmapdiv.style.height=(_b5[1]-80)+"px";
this.setmapdivmenu=document.createElement("div");
this.setmapdivmenu.style.width=(_b5[0]-80)+"px";
this.setmapdivmenu.style.height="20px";
this.setmapdivmenu.className="GM_menu";
this.setmapdiv.appendChild(this.setmapdivmenu);
this.setmapdivmap=document.createElement("div");
this.setmapdivmap.style.width=(_b5[0]-80)+"px";
this.setmapdivmap.style.height=(_b5[1]-100)+"px";
this.setmapdiv.appendChild(this.setmapdivmap);
document.body.appendChild(this.setmapdiv);
this.setmap=new mirai.googlemap(this.setmapdivmap,this.params.gevent,true);
window.onscroll=function(){
_b4.moveSetGMap();
};
}
this.setmapdivmenu.innerHTML="&nbsp;";
this.setmapspanmenu=document.createElement("span");
this.setmapdivmenu.appendChild(this.setmapspanmenu);
this.setmapspanmenu.onclick=function(){
_b4.setGMap();
};
this.setmapspanmenu.innerHTML="Guardar Posicion |";
this.setmapspanmenu=document.createElement("span");
this.setmapdivmenu.appendChild(this.setmapspanmenu);
this.setmapspanmenu.onclick=function(){
_b4.closeSetGMap();
};
this.setmapspanmenu.innerHTML=" Cerrar Ventana";
var _b6=dojo.html.getScrollOffset();
this.setmapdiv.style.top=(_b6[1]+40)+"px";
this.setmapdiv.style.left=(_b6[0]+40)+"px";
this.idToSet=id;
this.getGMapFromLocation();
};
mirai.googlemapResult.prototype.moveSetGMap=function(){
var _b7=dojo.html.getScrollOffset();
this.setmapdiv.style.top=(_b7[1]+40)+"px";
this.setmapdiv.style.left=(_b7[0]+40)+"px";
};
mirai.googlemapResult.prototype.closeSetGMap=function(){
this.setmap.setControls("none");
this.setmapdiv.style.display="none";
};
mirai.googlemapResult.prototype.getGMapFromLocation=function(){
this.ws_getgmapfromlocation.clearParameters();
this.ws_getgmapfromlocation.addParameter("id","1");
this.ws_getgmapfromlocation.addParameter("action","getGMapPositionFromLocation");
this.ws_getgmapfromlocation.addParameter("skin",this.params.skinconfiguration);
this.ws_getgmapfromlocation.addParameter("language",this.params.language);
this.ws_getgmapfromlocation.addParameter("cid",this.params.cid);
this.ws_getgmapfromlocation.addParameter("identity",this.idToSet);
this.ws_getgmapfromlocation.send();
};
mirai.googlemapResult.prototype.parseGetGMapFromLocation=function(_b8,_b9){
_b9=mirai.json.JSONDecode(_b9);
this.setmapdiv.style.display="block";
this.setmap.setControls("standard");
this.setmap.map.clearOverlays();
var _ba={};
_ba["center"]=new GLatLng(parseFloat(_b9["result"]["p"]["lat"]),parseFloat(_b9["result"]["p"]["lng"]));
_ba["zoom"]=17-parseInt(_b9["result"]["z"],10);
this.setmap.setCenter(_ba);
var _bb=this;
this.setmapmarker=new GMarker(_ba["center"],{draggable:true});
this.setmap.gevent.addListener(this.setmap.map,"click",function(_bc,_bd){
_bb.changeSetMapPosition(_bd);
});
this.setmap.map.addOverlay(this.setmapmarker);
};
mirai.googlemapResult.prototype.changeSetMapPosition=function(_be){
this.setmapmarker.setPoint(_be);
};
mirai.googlemapResult.prototype.setGMap=function(){
var _bf=this.setmapmarker.getPoint();
var _c0={};
_c0["p"]={};
_c0["p"]["lat"]=_bf.lat();
_c0["p"]["lng"]=_bf.lng();
this.ws_setgmap.clearParameters();
this.ws_setgmap.addParameter("id","1");
this.ws_setgmap.addParameter("action","setGMapPosition");
this.ws_setgmap.addParameter("skin",this.params.skinconfiguration);
this.ws_setgmap.addParameter("language",this.params.language);
this.ws_setgmap.addParameter("cid",this.params.cid);
this.ws_setgmap.addParameter("identity",this.idToSet);
this.ws_setgmap.addParameter("position",mirai.json.JSONEncode(_c0));
this.ws_setgmap.send();
};
mirai.googlemapResult.prototype.parseSetGMap=function(_c1,_c2){
_c2=mirai.json.JSONDecode(_c2);
this.setmap.map.clearOverlays();
var _c3={};
_c3["center"]=new GLatLng(parseFloat(_c2["result"]["p"]["lat"]),parseFloat(_c2["result"]["p"]["lng"]));
this.setmap.setCenter(_c3);
this.setmapmarker=new GMarker(_c3["center"]);
this.setmap.map.addOverlay(this.setmapmarker);
alert("gracias por su colaboracion");
var id=this.idToSet;
this.fixedgmapvalues.push(_c2["result"]);
this.fixedgmapvaluesAuxIds[id]=this.unknowngmapvalues[id]["id"];
this.fixedgmapvaluesAuxPos[id]=parseInt(this.lastpos,10)+1;
this.configFixedValues();
this.getGMap();
this.showIcons();
this.closeSetGMap();
};
try{
mirai.setLoaded("mirai.googlemapResult");
}
catch(e){
var ee=2;
}
mirai.googlemapHSDefaults={urlservice:"http://webservices.hotelsearch.com/wsdl/services2hotels_json.php",skinconfiguration:"HS_SEARCH",skinsearch:"HS",where:null,gevent:null,id:null,language:1,cid:"T1sJ7wSFOcK6yjjfUZsQKrPL8cXnJrc",checkresize:false,showWaiting:true,showCross:true,logoarea:{width:"200px",border:"0px",background:"transparent",fontSize:"9pt"},searcharea:{width:"200px",border:"1px solid",borderColor:"black",background:"white",fontSize:"9pt"},statusarea:{width:"200px",height:"35px",border:"1px solid",borderColor:"black",background:"white",fontSize:"9pt"},iplacesfilterarea:{width:"200px",border:"1px solid",borderColor:"black",background:"white",fontSize:"9pt"},hotelsfilterarea:{width:"200px",border:"1px solid",borderColor:"black",background:"white",fontSize:"9pt"},titlearea:{textAlign:"center",width:"199px",height:"25px",border:"1px solid",borderColor:"black",background:"black",color:"white",fontWeight:"bold",fontSize:"11pt"}};
mirai.googlemapHS=function(_c5){
this.appLoaded=false;
this.params=dojo.lang.mixin({},mirai.googlemapHSDefaults);
if(_c5){
this.params=dojo.lang.mixin(this.params,_c5);
}
this._modulesok=false;
var _c6=this;
mirai.requireIf("mirai.googlemap",["mirai.io","mirai.json"],function(){
_c6.init.call(_c6);
});
var css=document.createElement("link");
css.rel="stylesheet";
css.type="text/css";
css.href="/css/gmap.css";
document.documentElement.childNodes[0].appendChild(css);
};
mirai.googlemapHS.prototype.init=function(){
this.miraigmap=new mirai.googlemap(this.params.where,this.params.gevent);
var _c8=this;
var _c9=function(_ca,_cb,evt){
_c8.parseGMapConf.call(_c8,_ca,_cb);
};
var _cd=function(_ce,_cf,evt){
_c8.parseGMap.call(_c8,_ce,_cf);
};
var _d1=function(_d2,_d3,evt){
_c8.parseInfoWindow.call(_c8,_d2,_d3);
};
var _d5=function(){
_c8.showError.call(_c8);
};
var _d6={};
_d6["url"]=this.params.urlservice;
_d6["load"]=_c9;
_d6["error"]=_d5;
this.ws_gmapconf=new mirai.io.BindScript(_d6);
_d6["load"]=_cd;
this.ws_gmap=new mirai.io.BindScript(_d6);
_d6["load"]=_d1;
this.ws_infowindow=new mirai.io.BindScript(_d6);
this.mainmarker=null;
this.mainmarkerObj=null;
this.hotelmarkers={};
this.ipmarkers={};
this.armarkers={};
this.interestplacesfilter=null;
this.hotelsfilter=null;
this.getGMapConf();
};
mirai.googlemapHS.prototype.showError=function(){
alert("error");
};
mirai.googlemapHS.prototype.getGMapConf=function(){
this.ws_gmapconf.clearParameters();
this.ws_gmapconf.addParameter("action","getGMapConf");
this.ws_gmapconf.addParameter("id",this.params.id);
this.ws_gmapconf.addParameter("skin",this.params.skinconfiguration);
this.ws_gmapconf.addParameter("language",this.params.language);
this.ws_gmapconf.addParameter("cid",this.params.cid);
this.ws_gmapconf.send();
};
mirai.googlemapHS.prototype.parseGMapConf=function(_d7,_d8){
_d8=mirai.json.JSONDecode(_d8);
var _d9={};
_d9["center"]=new GLatLng(parseFloat(_d8["point"]["lat"]),parseFloat(_d8["point"]["lng"]));
_d9["zoom"]=17-parseInt(_d8["zoom"],10);
this.miraigmap.setCenter(_d9);
if(this.params.checkresize){
this.miraigmap.checkResize();
this.miraigmap.reOrganizeLayout("right");
}
if(this.params.showCross){
this.miraigmap.setCross(true);
}else{
this.miraigmap.setCross(false);
}
this.miraigmap.setControls("standard");
this.i18n=_d8["i18n"];
this.mainmarker=_d8["gmapvalue"];
if(_d8["areas"]["statusarea"]&&this.params.checkresize){
var _da={};
_da["id"]="statusarea";
_da["layout"]="right";
_da["classname"]="GM_modulo resultados";
this.statusarea=this.miraigmap.addWriteArea(_da);
}
if(_d8["areas"]["searcharea"]&&this.params.checkresize){
var _da={};
_da["id"]="searcharea";
_da["layout"]="right";
_da["style"]=this.params.searcharea;
this.searcharea=this.miraigmap.addWriteArea(_da);
this.showSearchArea();
}
this.hotelsfilter=mirai.json.JSONEncode(_d8["hotelsfilter"]);
if(_d8["areas"]["hotelfilterarea"]&&this.params.checkresize){
var _da={};
_da["id"]="hotelfilterarea";
_da["layout"]="right";
_da["classname"]="GM_modulo alto";
if(this.i18n["titles"]&&this.i18n["titles"]["hotelfilter"]){
_da["title"]=this.i18n["titles"]["hotelfilter"];
_da["titleclassname"]="titulo";
}
this.hotelfilterarea=this.miraigmap.addWriteArea(_da);
this.showHotelsFilter();
}
this.interestplacesfilter=mirai.json.JSONEncode(_d8["interestplacesfilter"]);
if(_d8["areas"]["ipfilterarea"]&&this.params.checkresize){
var _da={};
_da["id"]="ipfilterarea";
_da["layout"]="right";
_da["classname"]="GM_modulo puntosInteresantes";
if(this.i18n["titles"]&&this.i18n["titles"]["ipfilter"]){
_da["title"]=this.i18n["titles"]["ipfilter"];
_da["titleclassname"]="titulo";
}
this.ipfilterarea=this.miraigmap.addWriteArea(_da);
this.showInterestPlacesFilter();
}
var _db=this;
var _dc=function(_dd){
_db.getInfoWindow.call(_db,_dd,"MAIN");
};
this.miraigmap.addMarker(this.mainmarker,_dc);
var _db=this;
if(!this.miraigmap.map.movlist){
this.miraigmap.map.movlist=GEvent.addListener(this.miraigmap.map,"moveend",function(){
_db.getGMap.call(_db);
});
}
if(this.params.showWaiting){
if(this.i18n["main"]["logo"]){
this.miraigmap.setWaiting(this.i18n["main"]["logo"]);
}else{
this.miraigmap.setWaiting();
}
}
this.getGMap();
};
mirai.googlemapHS.prototype.getGMap=function(){
var _de=this.miraigmap.map.getBounds();
var sw=_de.getSouthWest();
var ne=_de.getNorthEast();
this.ws_gmap.clearParameters();
this.ws_gmap.addParameter("action","getGMap");
this.ws_gmap.addParameter("id",this.params.id);
this.ws_gmap.addParameter("skin",this.params.skinsearch);
this.ws_gmap.addParameter("language",this.params.language);
this.ws_gmap.addParameter("cid",this.params.cid);
this.ws_gmap.addParameter("interestplacesfilter",this.interestplacesfilter);
this.ws_gmap.addParameter("hotelsfilter",this.hotelsfilter);
this.ws_gmap.addParameter("zoom",17-this.miraigmap.map.getZoom());
this.ws_gmap.addParameter("swlat",sw.lat());
this.ws_gmap.addParameter("swlng",sw.lng());
this.ws_gmap.addParameter("nelat",ne.lat());
this.ws_gmap.addParameter("nelng",ne.lng());
this.ws_gmap.send();
if(this.params.showWaiting){
this.miraigmap.changeWaiting();
}
this.writeStatus("&nbsp;"+this.i18n["main"]["label"]["searching"]+"...");
};
mirai.googlemapHS.prototype.parseGMap=function(_e1,_e2){
this.writeStatus(this.i18n["main"]["label"]["processing"]+"....");
_e2=mirai.json.JSONDecode(_e2);
var msg="";
var _e4=this;
try{
iplaces=_e2["interestplaces"];
var _e5=function(_e6){
_e4.getInfoWindow.call(_e4,_e6,"IP");
};
this.ipmarkers=this.miraigmap.clearMarkersIf(this.ipmarkers,iplaces);
for(var i=0;i<iplaces.length;i++){
try{
if(!this.ipmarkers[iplaces[i]["id"]]){
this.ipmarkers[iplaces[i]["id"]]=this.miraigmap.addMarker(iplaces[i],_e5);
this.ipmarkers[iplaces[i]["id"]].markertype="IP";
}
}
catch(e){
var eee=2;
}
}
}
catch(e){
var eee=2;
}
var i=0;
try{
areas=_e2["areas"];
var _e5=function(_e9){
_e4.getInfoWindow.call(_e4,_e9,"PO");
};
this.armarkers=this.miraigmap.clearMarkersIf(this.armarkers,areas);
for(i=0;i<areas.length;i++){
try{
if(!this.armarkers[areas[i]["id"]]){
this.armarkers[areas[i]["id"]]=this.miraigmap.addPolygon(areas[i],_e5);
this.armarkers[areas[i]["id"]].markertype="PO";
}
}
catch(e){
var eee=2;
}
}
}
catch(e){
var eee=2;
}
var i=0;
try{
hotels=_e2["hotels"];
var _e5=function(_ea){
_e4.getInfoWindow.call(_e4,_ea,"HOTEL");
};
this.hotelmarkers=this.miraigmap.clearMarkersIf(this.hotelmarkers,hotels);
for(i=0;i<hotels.length;i++){
try{
if(!this.hotelmarkers[hotels[i]["id"]]){
this.hotelmarkers[hotels[i]["id"]]=this.miraigmap.addMarker(hotels[i],_e5);
this.hotelmarkers[hotels[i]["id"]].markertype="PO";
}
}
catch(e){
var eee=2;
}
}
if(hotels.length){
msg="&nbsp;"+hotels.length+"&nbsp;"+this.i18n["main"]["label"]["hotelsfound"]+msg;
}else{
msg="&nbsp; 0 "+this.i18n["main"]["label"]["hotelsfound"]+msg;
}
}
catch(e){
var eee=2;
}
if(msg){
this.writeStatus(msg);
}else{
this.writeStatus("&nbsp;"+this.i18n["main"]["label"]["hotelsnotfound"]);
}
if(this.params.showWaiting){
this.miraigmap.changeWaiting();
}
this.miraigmap.reOrganizeLayout("right");
this.appLoaded=true;
mirai.setAppLoaded("googlemapHS");
};
mirai.googlemapHS.prototype.getInfoWindow=function(_eb,_ec){
if(!_ec){
return;
}
var id=_eb.id;
switch(_ec){
case "MAIN":
if(_ec=="MAIN"&&this.mainmarkerObj&&this.mainmarkerObj.html){
this.miraigmap.map.openInfoWindowHtml(this.mainmarkerObj.iconpos,this.mainmarkerObj.html);
return;
}
break;
case "IP":
if(this.ipmarkers[id]&&this.ipmarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.ipmarkers[id].iconpos,this.ipmarkers[id].html);
return;
}
break;
case "PO":
if(this.armarkers[id]&&this.armarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.armarkers[id].iconpos,this.armarkers[id].html);
return;
}
break;
case "HOTEL":
if(this.hotelmarkers[id]&&this.hotelmarkers[id].html!="true"){
this.miraigmap.map.openInfoWindowHtml(this.hotelmarkers[id].iconpos,this.hotelmarkers[id].html);
return;
}
break;
}
if(_ec=="MAIN"){
this.mainmarkerObj=_eb;
}
this.ws_infowindow.clearParameters();
this.ws_infowindow.addParameter("action","getInfoWindow");
this.ws_infowindow.addParameter("id",this.params.id);
this.ws_infowindow.addParameter("skin",this.params.skinconfiguration);
this.ws_infowindow.addParameter("language",this.params.language);
this.ws_infowindow.addParameter("cid",this.params.cid);
this.ws_infowindow.addParameter("identity",id);
this.ws_infowindow.addParameter("type",_ec);
this.ws_infowindow.send();
};
mirai.googlemapHS.prototype.parseInfoWindow=function(_ee,_ef){
_ef=mirai.json.JSONDecode(_ef);
var id=_ef["id"];
switch(_ef["t"]){
case "MAIN":
this.miraigmap.map.openInfoWindowHtml(this.mainmarkerObj.iconpos,_ef["i"]);
this.mainmarkerObj.html=_ef["i"];
break;
case "IP":
this.miraigmap.map.openInfoWindowHtml(this.ipmarkers[id].iconpos,_ef["i"]);
this.ipmarkers[id].html=_ef["i"];
break;
case "PO":
this.miraigmap.map.openInfoWindowHtml(this.armarkers[id].iconpos,_ef["i"]);
this.armarkers[id].html=_ef["i"];
break;
case "HOTEL":
this.miraigmap.map.openInfoWindowHtml(this.hotelmarkers[id].iconpos,_ef["i"]);
this.hotelmarkers[id].html=_ef["i"];
break;
}
};
mirai.googlemapHS.prototype.showSearchArea=function(msg){
var _f2=document.createElement("input");
_f2.type="text";
_f2.size="25";
this.searcharea.appendChild(_f2);
var _f3=document.createElement("input");
_f3.type="button";
_f3.value="Search";
_f3.text=_f2;
this.searcharea.appendChild(_f3);
var _f4=this;
_f3.onclick=function(){
_f4.miraigmap.searchGeocode(this.text.value,function(_f5){
_f4.receiveAddress.call(_f4,_f5);
});
};
};
mirai.googlemapHS.prototype.receiveAddress=function(_f6){
if(_f6.Status.code!=200){
alert("Address not found.");
}else{
this.writeStatus(_f6.Placemark.length+" address found");
var _f7=_f6.Placemark[0];
var _f8=new GLatLng(_f7.Point.coordinates[1],_f7.Point.coordinates[0]);
this.miraigmap.map.setCenter(_f8);
}
};
mirai.googlemapHS.prototype.writeStatus=function(msg){
if(this.statusarea){
this.statusarea.innerHTML=msg;
}
};
mirai.googlemapHS.prototype.showInterestPlacesFilter=function(){
var _fa=this;
var _fb=function(){
_fa.changeInterestPlacesFilter.call(_fa,this);
};
var _fc=document.createElement("div");
this.ipfilterarea.appendChild(_fc);
var _fd={where:_fc,type:"checkbox",filter:this._decodeFilter(this.interestplacesfilter,"gtypeaccepted"),filtername:"ipfilter",i18n:this.i18n["ip"],callback:_fb,onlyone:false};
this.ipfilterObj=new mirai.googlemapFilterHS(_fd);
};
mirai.googlemapHS.prototype.changeInterestPlacesFilter=function(_fe){
var _ff=mirai.json.JSONDecode(this.interestplacesfilter);
if(dojo.lang.find(_ff["gtypeaccepted"],_fe.value)>=0){
_ff["gtypeaccepted"]=this._removeIdfFromFilter(_ff["gtypeaccepted"],_fe.value);
}else{
_ff["gtypeaccepted"].push(_fe.value);
}
this.interestplacesfilter=mirai.json.JSONEncode(_ff);
this.getGMap();
};
mirai.googlemapHS.prototype.showHotelsFilter=function(){
var _100=this;
var func=function(){
_100.changeHotelsFilter.call(_100,this);
};
if(this.i18n["hotel"]){
var _102=document.createElement("div");
this.hotelfilterarea.appendChild(_102);
_102.className="alojamiento";
var _103=document.createElement("div");
_102.appendChild(_103);
var icon=document.createElement("img");
icon.src="http://www.hotelsearch.com/images/google_maps/hoteles.png";
icon.style.width="32px";
icon.style.height="27px";
_103.appendChild(icon);
var _105=document.createElement("span");
_103.appendChild(_105);
_105.appendChild(document.createTextNode(this.i18n["main"]["label"]["helpwithro"]));
var _103=document.createElement("div");
_102.appendChild(_103);
var icon=document.createElement("img");
icon.src="http://www.hotelsearch.com/images/google_maps/hotelSin.png";
icon.style.width="32px";
icon.style.height="27px";
_103.appendChild(icon);
var _105=document.createElement("span");
_103.appendChild(_105);
_105.appendChild(document.createTextNode(this.i18n["main"]["label"]["helpwithoutro"]));
var _103=document.createElement("div");
_102.appendChild(_103);
var icon=document.createElement("img");
icon.src="http://www.hotelsearch.com/images/google_maps/all.png";
icon.style.width="28px";
icon.style.height="27px";
_103.appendChild(icon);
var _106=this._decodeFilter(this.hotelsfilter,"isclient");
var _107=document.createElement("input");
_107.type="checkbox";
_107.className="solo";
_103.appendChild(_107);
_107.value=0;
_107.onclick=function(){
_100.changeHotelsFilter.call(_100,this.value);
};
if(_106){
_107.checked=true;
}else{
_107.checked=false;
}
var _105=document.createElement("span");
_103.appendChild(_105);
_105.appendChild(document.createTextNode(this.i18n["main"]["label"]["seeonlyclients"]));
var br=document.createElement("br");
_102.appendChild(br);
var _105=document.createElement("p");
_105.className="encabezado";
_102.appendChild(_105);
_105.appendChild(document.createTextNode(this.i18n["main"]["label"]["sectiontype"]));
var _109={where:_102,filter:this._decodeFilter(this.hotelsfilter,"typegroupaccepted"),filtername:"hotelfilter",i18n:this.i18n["hotel"],callback:func};
this.hotelfilterObj=new mirai.googlemapFilterHS(_109);
}
if(this.i18n["category"]){
var _105=document.createElement("p");
_105.className="encabezado";
this.hotelfilterarea.appendChild(_105);
_105.appendChild(document.createTextNode(this.i18n["main"]["label"]["sectioncategory"]));
var _102=document.createElement("div");
this.hotelfilterarea.appendChild(_102);
_102.className="categoria";
var _109={where:_102,filter:this._decodeFilter(this.hotelsfilter,"categoryaccepted"),filtername:"hotelcategoryfilter",i18n:this.i18n["category"],callback:func};
this.hotelcategoryfilterObj=new mirai.googlemapFilterHS(_109);
}
if(this.hotelfilterObj&&this.hotelcategoryfilterObj&&this.hotelfilterObj.lastchecked.value>1){
this.hotelcategoryfilterObj.disableInputs();
this.hotelcategoryfilterObj.lastchecked=this.hotelcategoryfilterObj.allvalues;
this._changeFilter(this.hotelsfilter,"categoryaccepted",this.hotelcategoryfilterObj.disableFilter(_109.filter));
}
return;
};
mirai.googlemapHS.prototype.changeHotelsFilter=function(_10a){
var id=parseInt(_10a.value,10);
if(id&&_10a.name=="hotelfilter"+id){
if(id>0){
if(this.hotelcategoryfilterObj){
if(_10a.value==1&&!this.hotelcategoryfilterObj.isFullEnabled()){
if(this.hotelcategoryfilterObj.isFullDisabled()){
this.hotelcategoryfilterObj.enableInputs();
}
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"categoryaccepted",this.hotelcategoryfilterObj.enableFilter());
}else{
if((this.hotelfilterObj.lastchecked.value==1||this.hotelfilterObj.lastchecked.value==-1)&&_10a.value!=1&&!this.hotelcategoryfilterObj.isFullDisabled()){
if(this.hotelcategoryfilterObj.isFullEnabled()||!this.hotelcategoryfilterObj.isFilterEnabled()){
this.hotelcategoryfilterObj.disableInputs();
}
if(this.hotelcategoryfilterObj.isFilterEnabled()){
var _10c=this._decodeFilter(this.hotelsfilter,"categoryaccepted");
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"categoryaccepted",this.hotelcategoryfilterObj.disableFilter(_10c));
}
}
}
}
var _10c=new Array();
_10c.push(id);
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"typegroupaccepted",_10c);
}else{
if(this.hotelcategoryfilterObj&&!this.hotelcategoryfilterObj.isFilterEnabled()){
this.hotelcategoryfilterObj.enableInputs();
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"categoryaccepted",this.hotelcategoryfilterObj.enableFilter());
}
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"typegroupaccepted",this.hotelfilterObj.disableFilter());
}
this.hotelfilterObj.setChecked(_10a.id);
}else{
if(id&&_10a.name=="hotelcategoryfilter"+id){
if(id>0){
var _10c=new Array();
_10c.push(id);
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"categoryaccepted",_10c);
}else{
this.hotelsfilter=this._changeFilter(this.hotelsfilter,"categoryaccepted",this.hotelcategoryfilterObj.disableFilter());
}
this.hotelcategoryfilterObj.setChecked(_10a.id);
}else{
var _10d=mirai.json.JSONDecode(this.hotelsfilter);
if(_10d["isclient"]){
_10d["isclient"]=false;
}else{
_10d["isclient"]=true;
}
this.hotelsfilter=mirai.json.JSONEncode(_10d);
}
}
this.getGMap();
};
mirai.googlemapHS.prototype._decodeFilter=function(_10e,_10f){
return mirai.json.JSONDecode(_10e)[_10f];
};
mirai.googlemapHS.prototype._changeFilter=function(_110,_111,_112){
if(!_112){
return _110;
}
var _113=mirai.json.JSONDecode(_110);
_113[_111]=_112;
return mirai.json.JSONEncode(_113);
};
mirai.googlemapHS.prototype._removeIdfFromFilter=function(_114,idf){
try{
var nArr=new Array();
for(var i=0;i<_114.length;i++){
if(_114[i]!=idf){
nArr.push(_114[i]);
}
}
return nArr;
}
catch(e){
return layout;
}
};
mirai.googlemapFilterHSDefaults={filternone:new Array(),onlyone:true,type:"radio"};
mirai.googlemapFilterHS=function(_118){
this.params=dojo.lang.mixin({},mirai.googlemapFilterHSDefaults);
this.params=dojo.lang.mixin(this.params,_118);
this.inputs={};
this.lastchecked=null;
this.lastfilter=this.params["filter"];
this.enabled=true;
this.inputsenabled=true;
this.allvalues=null;
for(var id in this.params["i18n"]["label"]){
var area=document.createElement("div");
this.params["where"].appendChild(area);
this.className="inputfilter";
if(this.params["i18n"]["icon"]&&this.params["i18n"]["icon"][id]){
var icon=document.createElement("img");
icon.src=this.params["i18n"]["icon"][id];
icon.style.width="32";
icon.style.height="27";
area.appendChild(icon);
}
var _11c=document.createElement("input");
_11c.type=this.params["type"];
_11c.name=this.params["filtername"]+id;
_11c.id=this.params["filtername"]+id;
_11c.value=id;
_11c.classname="solo";
area.appendChild(_11c);
this.inputs[_11c.id]=_11c;
if(id==-1){
this.allvalues=_11c;
}
if(dojo.lang.find(this.params["filter"],id)>=0){
this._checkInput(_11c);
this.lastchecked=_11c;
}
_11c.onclick=this.params["callback"];
var _11d=document.createElement("span");
area.appendChild(_11d);
_11d.appendChild(document.createTextNode(" "+this.params["i18n"]["label"][id]));
}
};
mirai.googlemapFilterHS.prototype.setChecked=function(id){
if(this.lastchecked&&this.lastchecked.id==id){
return;
}
this._checkInput(this.inputs[id]);
if(this.params["onlyone"]&&this.inputs[id].checked){
this._uncheckInput(this.lastchecked);
}
this.lastchecked=this.inputs[id];
};
mirai.googlemapFilterHS.prototype.disableFilter=function(_11f){
if(this.enabled){
this.lastfilter=_11f;
this.enabled=false;
}
return this.params.filternone;
};
mirai.googlemapFilterHS.prototype.enableFilter=function(){
if(!this.enabled){
this.enabled=true;
return this.lastfilter;
}
return null;
};
mirai.googlemapFilterHS.prototype.getFilterToApply=function(_120){
if(this.enabled){
return _120;
}else{
return this.params.filternone;
}
};
mirai.googlemapFilterHS.prototype.isFullEnabled=function(){
return (this.enabled&&this.inputsenabled);
};
mirai.googlemapFilterHS.prototype.isFullDisabled=function(){
return (!this.enabled&&!this.inputsenabled);
};
mirai.googlemapFilterHS.prototype.isFilterEnabled=function(){
return this.enabled;
};
mirai.googlemapFilterHS.prototype.disableInputs=function(){
for(var id in this.inputs){
this.inputs[id].disabled=true;
}
if(this.lastchecked){
this._uncheckInput(this.lastchecked);
}
this.inputsenabled=false;
};
mirai.googlemapFilterHS.prototype.enableInputs=function(){
for(var id in this.inputs){
this.inputs[id].disabled=false;
}
if(this.lastchecked){
this._checkInput(this.lastchecked);
}
this.inputsenabled=true;
};
mirai.googlemapFilterHS.prototype._checkInput=function(_123){
if(!_123){
return;
}
switch(this.params["type"]){
case "checkbox":
_123.checked="checked";
break;
case "radio":
_123.checked="checked";
break;
}
};
mirai.googlemapFilterHS.prototype._uncheckInput=function(_124){
if(!_124){
return;
}
switch(this.params["type"]){
case "checkbox":
_124.checked=false;
break;
case "radio":
_124.checked=null;
break;
}
};
try{
mirai.setLoaded("mirai.googlemapHS");
}
catch(e){
var ee=2;
}
mirai.googlemap=new Object;
mirai.googlemapDefaults={writearea:{width:"175px",border:"1px solid",borderColor:"black",background:"white"}};
mirai.googlemap=function(_125,_126,_127){
this.where=_125;
this.gevent=GEvent;
this.loading=document.createElement("div");
this.loading.style.position="absolute";
document.body.appendChild(this.loading);
this.loading.innerHTML="Loading map......please wait";
try{
var pos=dojo.style.getAbsolutePosition(this.where);
this.loading.style.top=(pos.y+5)+"px";
this.loading.style.left=(pos.x+5)+"px";
}
catch(e){
var ee=2;
}
this.crossid=null;
this.iconsurl="http://www.hotelsearch.com/search/gimages/";
if(!_127){
this.map=new GMap2(this.where);
}else{
this.map=new GMap2(this.where,{draggableCursor:"crosshair",draggingCursor:"pointer"});
}
this.geocoder=new GClientGeocoder();
this.writeAreas={"top":{},"bottom":{},"left":{},"right":{}};
this.writeAreasLayout={};
this.controlSet=new Array();
this.tooltip=document.createElement("div");
this.map.getPane(G_MAP_FLOAT_PANE).appendChild(this.tooltip);
this.tooltip.style.visibility="hidden";
this.tooltip.style.display="inline";
this.tooltip.defaultstyle="font-family:Trebuchet MS, Verdana, Sans-serif;font-size:11px;border:1px solid;border-color:black;background:white;display:inline;white-space:nowrap;";
};
mirai.googlemap.prototype.addWriteArea=function(_12a){
if(!_12a["classname"]){
var _12b=dojo.lang.mixin({},mirai.googlemapDefaults.writearea);
if(_12a["style"]){
_12b=dojo.lang.mixin(_12b,_12a["style"]);
}
}
if(_12a["layout"]){
var _12c=_12a["layout"];
}
var _12c="right";
var id=_12a["id"];
if(this.writeAreasLayout[id]){
var _12e=this.writeAreas[this.writeAreasLayout[id]];
document.body.removeChild(_12e[id]);
this.writeAreas[this.writeAreasLayout[id]]=this._removeAreaFromLayout(_12e,id);
this.reOrganizeLayout(this.writeAreasLayout[id]);
}
var _12f=document.createElement("div");
_12f.style.position="absolute";
_12f.idarea=id;
_12f.layout=_12c;
if(_12a["classname"]){
_12f.className=_12a["classname"];
}else{
_12f.areaconfig=_12b;
}
document.body.appendChild(_12f);
if(_12a["title"]){
if(!_12a["titleclassname"]){
var _130=_12a["titlestyle"];
}
var _131=document.createElement("div");
_12f.appendChild(_131);
if(_12a["titleclassname"]){
_131.className=_12a["titleclassname"];
}else{
for(var _132 in _130){
_131.style[_132]=_130[_132];
}
}
_131.innerHTML=_12a["title"];
}
var _133=document.createElement("div");
_12f.appendChild(_133);
_133.className="contenido";
if(!_12f.className){
for(var _132 in _12b){
_12f.style[_132]=_12b[_132];
}
}
this.writeAreasLayout[id]=_12c;
this.writeAreas[_12c][id]=_12f;
this.reOrganizeLayout(this.writeAreasLayout[id]);
return _133;
};
mirai.googlemap.prototype.reOrganizeLayout=function(_134){
var pos=dojo.style.getAbsolutePosition(this.where);
var _136=pos.x+dojo.style.getContentBoxWidth(this.where);
var _137=this.writeAreas[_134];
switch(_134){
case "right":
var posy=35;
for(var id in _137){
_137[id].style.top=posy+"px";
_137[id].style.left=(_136-dojo.style.getContentBoxWidth(_137[id])-10)+"px";
posy+=dojo.style.getContentBoxHeight(_137[id])+3;
}
break;
}
};
mirai.googlemap.prototype._removeAreaFromLayout=function(_13a,id){
try{
var nArr=new Array();
for(var i in _13a){
if(i!=id){
nArr[i]=_13a[i];
}
}
return nArr;
}
catch(e){
return _13a;
}
};
mirai.googlemap.prototype.setCenter=function(_13e){
this.loading.style.visibility="hidden";
this.centermap=_13e["center"];
this.zoommap=_13e["zoom"];
if(!_13e["type"]){
this.typemap=G_MAP_TYPE;
}else{
this.typemap=_13e["type"];
}
this.map.setCenter(this.centermap,this.zoommap,this.typemap);
};
mirai.googlemap.prototype.setConfig=function(_13f){
this.setControls(_13f["controls"]);
this.setIconsURL(_13f["iconsurl"]);
this.crossid=null;
this.setCross(_13f["cross"],_13f["crossimage"]);
};
mirai.googlemap.prototype.setToolTipClassName=function(_140){
this.tooltip.defaultclassname=_140;
};
mirai.googlemap.prototype.setControls=function(_141){
for(var i=0;i<this.controlSet.length;i++){
this.map.removeControl(this.controlSet[i]);
}
this.controlSet=new Array();
if(!_141){
this.controls="standard";
}else{
if(_141=="plus"){
this.controls="plus";
}else{
if(_141=="standard"){
this.controls="standard";
}else{
this.controls="none";
}
}
}
if(this.controls=="standard"||this.controls=="plus"){
this.controlSet.push(new GLargeMapControl());
this.controlSet.push(new GMapTypeControl());
this.controlSet.push(new GScaleControl());
var _143=new GKeyboardHandler(this.map);
}
if(this.controls=="plus"){
this.controlSet.push(new GOverviewMapControl());
}
for(var i=0;i<this.controlSet.length;i++){
this.map.addControl(this.controlSet[i]);
}
};
mirai.googlemap.prototype.setIconsURL=function(_144){
if(!_144){
this.iconsurl="http://www.hotelsearch.com/search/gimages/";
}else{
this.iconsurl=config["iconsurl"];
}
};
mirai.googlemap.prototype.searchGeocode=function(_145,_146){
var _147=this;
this.geocoder.getLocations(_145,_146);
};
mirai.googlemap.prototype.clearMarkers=function(){
this.tooltip.style.visibility="hidden";
this.map.clearOverlays();
};
mirai.googlemap.prototype.clearMarkersIf=function(_148,_149){
for(id in _148){
var _14a=false;
if(_149){
for(var i=0;i<_149.length;i++){
if(id==_149[i]["id"]){
_14a=true;
break;
}
}
}
if(!_14a){
try{
if(_148[id].marker){
this.map.removeOverlay(_148[id].marker);
}
}
catch(e){
var ee=2;
}
this.map.removeOverlay(_148[id]);
_148[id]=null;
}
}
return _148;
};
mirai.googlemap.prototype.addMarker=function(_14d,_14e){
var _14f=null;
var _150=new GLatLng(parseFloat(_14d["p"]["lat"]),parseFloat(_14d["p"]["lng"]));
if(_14d["i"]!="default"){
var _151=new GPoint(parseFloat(_14d["i"]["p"]["lat"]),parseFloat(_14d["i"]["p"]["lng"]));
var _152=new GIcon();
_152.image=this.iconsurl+_14d["i"]["f"];
if(!_14d["i"]["s"]||!_14d["i"]["s"]["w"]){
_152.iconSize=new GSize(33,32);
}else{
_152.iconSize=new GSize(parseInt(_14d["i"]["s"]["w"],10),parseInt(_14d["i"]["s"]["h"],10));
}
_152.shadowSize=new GSize(0,0);
_152.iconAnchor=_151;
_152.infoWindowAnchor=_151;
_152.infoShadowAnchor=_151;
try{
_14f=new GMarker(_150,new GMarkerOptions(_152));
}
catch(e){
_14f=new GMarker(_150,_152);
}
}else{
_14f=new GMarker(_150);
}
_14f.id=_14d["id"];
_14f.miraigmap=this;
_14f.titledShowed=false;
_14f.iconpos=_150;
if(_14d["i"]["t"]){
if(!this.tooltip.defaultclassname){
_14f.title="<div style=\""+this.tooltip.defaultstyle+"\">&nbsp;"+_14d["i"]["t"]+"&nbsp;</div>";
}else{
_14f.title="<div class=\""+this.tooltip.defaultclassname+"\">&nbsp;"+_14d["i"]["t"]+"&nbsp;</div>";
}
_14f.showTitle=function(){
if(!this.titledShowed&&!this.infowindowShowed){
this.titledShowed=true;
this.miraigmap.tooltip.innerHTML=this.title;
var pos=this.miraigmap.getMarkerPosition(this.miraigmap.map,this);
pos.apply(this.miraigmap.tooltip);
this.miraigmap.tooltip.style.visibility="visible";
}
};
_14f.hideTitle=function(){
if(this.titledShowed){
this.titledShowed=false;
this.miraigmap.tooltip.style.visibility="hidden";
}
};
this.gevent.addListener(_14f,"mouseover",function(){
_14f.showTitle.call(_14f);
});
this.gevent.addListener(_14f,"mouseout",function(){
_14f.hideTitle.call(_14f);
});
}
if(_14d["i"]["iw"]){
_14f.html=_14d["i"]["iw"];
if(!_14e&&_14d["i"]["iw"]!="true"){
_14f.showInfo=function(){
_14f.titledShowed=false;
this.miraigmap.tooltip.style.visibility="hidden";
this.miraigmap.map.openInfoWindowHtml(this.iconpos,this.html);
};
}else{
_14f.funcInfoWindow=_14e;
_14f.showInfo=function(){
_14f.titledShowed=false;
this.miraigmap.tooltip.style.visibility="hidden";
this.funcInfoWindow(this);
};
}
this.gevent.addListener(_14f,"click",function(){
_14f.showInfo.call(_14f);
});
}
this.map.addOverlay(_14f);
return _14f;
};
mirai.googlemap.prototype.addPolygon=function(_154,_155){
var _156=this.addMarker(_154,_155);
var _157=new Array();
for(var i=0;i<_154["ps"].length;i++){
_157.push(new GLatLng(parseFloat(_154["ps"][i]["lat"]),parseFloat(_154["ps"][i]["lng"])));
}
var _159=new GPolyline(_157,_154["c"],parseInt(_154["w"],10),parseFloat(_154["o"]));
_159.marker=_156;
this.map.addOverlay(_159);
return _159;
};
mirai.googlemap.prototype.getMarkerPosition=function(map,_15b){
var _15c=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.fromDivPixelToLatLng(new GPoint(0,0),true),map.getZoom());
var _15d=map.getCurrentMapType().getProjection().fromLatLngToPixel(_15b.getPoint(),map.getZoom());
var _15e=_15b.getIcon().iconAnchor;
try{
var _15f=_15b.getIcon().iconSize.width;
}
catch(e){
var _15f=0;
}
try{
var _160=_15b.miraigmap.tooltip.clientHeight;
}
catch(e){
var _160=0;
}
return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(_15d.x-_15c.x-_15e.x,_15d.y-_15c.y-_15e.y-_160));
};
mirai.googlemap.prototype.setCross=function(_161,_162){
if(this.crossid){
try{
document.body.removeChild(document.getElementById(this.crossid));
}
catch(e){
var ee=2;
alert("error");
}
this.crossid=null;
this.crossimage=null;
}
if(!_161){
this.crossid=null;
this.crossimage=null;
return;
}else{
if(!_162){
this.crossimage="http://www.hotelsearch.com/imagesv01/crosshair.png";
}else{
this.crossimage;
}
}
try{
this.crossid=this.where.id+"_crossimage";
var _161=document.createElement("img");
_161.id=this.crossid;
_161.style.position="absolute";
_161.src=this.crossimage;
document.body.appendChild(_161);
var _164=this.map.fromLatLngToDivPixel(this.map.getCenter());
var pos=dojo.style.getAbsolutePosition(this.where);
_161.style.top=(pos.y+_164.y-8)+"px";
_161.style.left=(pos.x+_164.x-8)+"px";
}
catch(e){
var ee=2;
}
};
mirai.googlemap.prototype.setWaiting=function(logo){
var css=document.createElement("link");
css.rel="stylesheet";
css.type="text/css";
css.href="/css/waiting.css";
document.documentElement.childNodes[0].appendChild(css);
this.waitingarea=document.createElement("div");
this.waitingarea.style.display="none";
document.body.appendChild(this.waitingarea);
this.waitingarea.style.textAlign="center";
var html=" \t    <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"loaderContainer\" onClick=\"return false;\"> \t\t<tr> \t\t  <td id=\"loaderContainerWH\"> \t\t  \t<div id=\"loader\"> \t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> \t\t\t\t\t<tr> \t\t\t\t    \t<td> \t\t\t\t\t      <p>";
if(!logo){
html+=" \t\t\t<img src=\"http://www.hotelsearch.com/mre/images/loading.gif\" height=\"32\" width=\"32\" alt=\"\"/> \t\t\t\t\t      <strong><br/>Please wait ...<br/></strong>";
}else{
html+="<img src=\""+logo+"\" alt=\"\"/>";
}
html+=" \t\t\t\t\t      </p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</table> \t\t\t</div> \t\t</td> \t\t</tr> \t\t</table>";
this.waitingarea.innerHTML=html;
};
mirai.googlemap.prototype.changeWaiting=function(){
if(this.waitingarea.style.display=="none"){
this.waitingarea.style.display="inline";
}else{
this.waitingarea.style.display="none";
}
};
mirai.googlemap.prototype.checkResize=function(){
var _169=this;
if(window.attachEvent){
}else{
window.addEventListener("resize",function(){
resizeMap(_169.where);
_169.map.checkResize();
_169.map.setCenter(_169.centermap,_169.zoommap);
_169.reOrganizeLayout("right");
},false);
}
this.map.addControl(new GOverviewMapControl());
resizeMap(this.where);
this.map.checkResize();
this.map.setCenter(this.centermap,this.zoommap);
function resizeMap(_16a){
var _16b=0;
for(var elem=_16a;elem!=null;elem=elem.offsetParent){
_16b+=elem.offsetTop;
}
var _16d=getWindowHeight();
var _16e=_16d-_16b-10;
try{
if(_16e>=0){
_16a.style.height=_16e+"px";
}
}
catch(e){
var ee=2;
}
}
function getWindowHeight(){
if(window.self&&self.innerHeight){
return self.innerHeight;
}
if(document.documentElement&&document.documentElement.clientHeight){
return document.documentElement.clientHeight;
}
return 0;
}
};
try{
mirai.setLoaded("mirai.googlemap");
}
catch(e){
var ee=2;
}
mirai.Autocomplete=new Object();
mirai.Autocomplete=function(_170){
var _171={minLengthText:0,useCache:true,keyDelay:100,css:{},propertiesDivResults:{}};
this.request=_171;
jQuery.extend(this.request,_170);
this.nCountElem=-1;
this.bElemSelected=false;
this.numId=-999;
this.offset=0;
this.cache={};
this.salida=new Array();
this.aDataLinkResults=new Array();
this.posRelojOn="-1.6em";
this.posRelojOff="0.2em";
this.masResultados=new Array("","More results...","M\xe1s resultados...","\u3055\u3089\u306b\u691c\u7d22\u2026","","weitere Ergebnisse...","Plus de r\xe9sultats...");
this.sinResultados=new Array("","No results","Sin resultados","\u8a72\u5f53\u3059\u308b\u7d50\u679c\u304c\u3042\u308a\u307e\u305b\u3093","","Keine Ergebnisse","Pas de r\xe9sultats");
this.noConexion=new Array("","Can't contact with server","Sin conexi\xf3n con el servidor","\u30b5\u30fc\u30d0\u30fc\u3068\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093","Impossible d'\xe9tablir la connexion avec le serveur","Server nicht erreichbar","");
try{
this.myName=this.request.myName;
}
catch(e){
alert("error: 'myName' no declarado");
}
try{
this.name=this.request.name;
}
catch(e){
alert("error: 'name' no declarado");
}
try{
this.url=this.request.url;
}
catch(e){
alert("error: 'url' no declarado");
}
try{
this.postdata=this.request.postdata;
}
catch(e){
alert("error: 'objeto postdata' no declarado");
}
this.bFastAction=(typeof (this.request.bFastAction)=="undefined")?false:this.request.bFastAction;
this.bMoreResults=(typeof (this.request.bMoreResults)=="undefined")?true:this.request.bMoreResults;
this.minLengthText=(typeof (this.request.minLengthText)=="undefined")?1:this.request.minLengthText;
this.useCache=(typeof (this.request.useCache)=="undefined")?1:this.request.useCache;
this.keyDelay=(typeof (this.request.keyDelay)=="undefined")?100:this.request.keyDelay;
this.targetAction=(typeof (this.request.targetAction)=="undefined")?"_self":this.request.targetAction;
this.bExactWord=(typeof (this.request.bExactWord)=="undefined")?"false":this.request.bExactWord;
this.idForm="#"+this.request.idForm;
this.postdata.idioma=(typeof (this.postdata.idioma)=="undefined")?$(this.idForm+" input[@name=language]").attr("value"):this.postdata.idioma;
this.postdata.modo=(typeof (this.postdata.modo)=="undefined")?0:this.postdata.modo;
this.request.target=$(this.idForm+" input[@miraiType=autocomplete_searchtxt]").attr("id");
this.target="#"+this.request.target;
var _172=$(this.target).attr("value");
this.bDelTxtIniTarget=(_172!="");
this.maxLengthText=new Array(23,40);
this.cssClass={};
this.cssClass.cResults="cResults";
this.cssClass.lista="searchlist";
this.cssClass.elemLista="cline";
this.cssClass.linkResults="cLinkResults";
this.cssClass.moreResults="cMoreResults";
this.cssClass.valorNum="cValorNum";
this.cssClass.valorText="cValorText";
jQuery.extend(this.cssClass,this.request.css);
this._createDivData(this.request.propertiesDivResults);
var _173=this;
$(this.target).bind("keyup",function(evt){
_173.keyUp(evt);
});
$(this.target).bind("focus",function(evt){
_173._focoOn(evt);
_173.showOrHide();
});
if(!this.bMoreResults){
$(this.target).bind("blur",function(evt){
setTimeout(function(){
_173._focoOff(evt);
_173.showOrHide();
},"100");
});
}
$(this.idForm).bind("submit","false");
this.request.submitId=$(this.idForm+" input[@type=submit]").attr("id");
if(!this.request.submitId){
this.request.submitId="idSubmit_"+this.request.target;
$(this.idForm+" input[@type=submit]").attr("id",this.request.submitId);
}
this.submitId="#"+this.request.submitId;
if(this.bFastAction){
try{
$(this.submitId).css({"visibility":"hidden","display":"none"});
}
catch(e){
}
}else{
try{
$(this.submitId).removeAttr("type");
$(this.submitId).attr("type","button");
}
catch(e){
}
$(this.submitId).bind("click",function(evt){
_173.exeAction(evt);
});
}
$(this.idForm).append("<input type='hidden' id='autocomplete_xwd' name='autocomplete_xwd' value='"+this.bExactWord+"' />");
};
mirai.Autocomplete.prototype.keyUp=function(evt){
if(this.lastTimeout){
window.clearTimeout(this.lastTimeout);
}
this.showOrHide();
if(this.checkKey(evt)){
this.checkText();
}
return true;
};
mirai.Autocomplete.prototype.checkText=function(){
this.lastText=$.trim($(this.target).attr("value"));
this.offset=0;
this.postdata.offset=0;
var _179=this;
if(this.lastText&&this.lastText.length>=this.minLengthText){
if(this.useCache){
this.lastTimeout=setTimeout(function(){
_179.getDataFromCache();
},this.keyDelay);
}else{
this.lastTimeout=setTimeout(function(){
_179.getData();
},this.keyDelay);
}
}else{
this.lastTimeout=null;
$("#Data1_idResults_"+this.request.target).removeClass("alto14em");
$("#Data1_idResults_"+this.request.target).html("");
this.offset=0;
}
};
mirai.Autocomplete.prototype.getDataFromCache=function(){
var tmp=$(this.target).attr("value")+"_"+this.postdata.modo+"_"+this.offset+"_"+this.postdata.idioma;
if(this.postdata.countryid){
tmp+="_"+this.postdata.countryid;
}
if(this.cache[tmp]){
this.showData(this.cache[tmp]);
}else{
this.getData();
}
};
mirai.Autocomplete.prototype.setDataInCache=function(text,_17c){
this.cache[text]={"text":text,"result":_17c};
};
mirai.Autocomplete.prototype.getData=function(){
var tmp=$(this.target).attr("value")+"_"+this.postdata.modo+"_"+this.offset+"_"+this.postdata.idioma;
if(this.postdata.countryid){
tmp+="_"+this.postdata.countryid;
}
var _17e="{'text' : '"+tmp+"', 'result' : {}}";
this.parseData(_17e);
};
mirai.Autocomplete.prototype.parseData=function(_17f){
eval("var valued="+_17f);
this.setDataInCache(valued["text"],valued["result"]);
if(this.offset>0){
$("#Data1_idResults_"+this.request.target).addClass("alto14em");
}else{
$("#Data1_idResults_"+this.request.target).removeClass("alto14em");
}
this.showData(valued);
};
mirai.Autocomplete.prototype.showData=function(_180){
$("#Data1_idResults_"+this.request.target).html(_180["result"]);
$("#Info1_idResults_"+_this.request.target).html("");
$(this.target).css("background-position","right "+this.posRelojOff);
};
mirai.Autocomplete.prototype._createDivData=function(prop){
var pos=this._getAbsolutePos(document.getElementById(this.request.target));
var _183={offsetTop:(document.getElementById(this.request.target).offsetHeight+2),offsetLeft:0};
jQuery.extend(_183,prop);
var _css={_css:"position:absolute; top:"+(pos.y+_183.offsetTop)+"px; left:"+(pos.x+_183.offsetLeft)+"px; display:none;"};
jQuery.extend(_183,_css);
htmlnewcapa="<div id='idResults_"+this.request.target+"' class='"+this.cssClass.cResults+"' style='"+_183._css+"'></div>";
$(this.idForm).append(htmlnewcapa);
var _185=$("#idResults_"+this.request.target).css("width");
var _186="<div id='idInfoBar_"+this.request.target+"' style='width:"+_185+"; height:1.5em;'>"+"<div style='width:75%; height:1.5em; text-align:left; float:left; border:0;' id='Info1_idResults_"+this.request.target+"'></div>"+"<div style='width:23%; height:1.5em; text-align:right; float:left;' id='Info2_idResults_"+this.request.target+"'>"+"<a href='javascript:;' id='idCloseResults_"+this.request.target+"' onclick='mirai.Autocomplete.prototype.closeResults(\""+this.request.target+"\");' style='display:none; text-decoration:none; text-align:right; font-size:1em; font-weight:bold; margin-left:0.5em; padding:0 0.2em; border:0;'>"+"<img src='/imagesv01/countrysearch/img/close.png' alt='X' border='0' />"+"</a>"+"</div>"+"<div style='clear:both;'></div>"+"</div>";
var _187="<div style='text-align:right; width:98%; height:1.5em;' id='Info3_idResults_"+this.request.target+"'>"+"<a href='javascript:;' id='idMoreResults_"+this.request.target+"' style='display:none; text-decoration:none; text-align:right; font-size:1em; font-weight:bold; padding:0 0.1em; border:0; font-style:italic;'>"+this.masResultados[this.postdata.idioma]+"</a>"+"</div>";
$("#idResults_"+this.request.target).append(_186);
$("#idResults_"+this.request.target).append("<div style='width:"+_185+"; overflow:auto;' id='Data1_idResults_"+this.request.target+"'></div>");
$("#idResults_"+this.request.target).append(_187);
};
mirai.Autocomplete.prototype._getAbsolutePos=function(el){
var SL=0,ST=0;
var _18a=/^div$/i.test(el.tagName);
if(_18a&&el.scrollLeft){
SL=el.scrollLeft;
}
if(_18a&&el.scrollTop){
ST=el.scrollTop;
}
var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};
if(el.offsetParent){
var tmp=this._getAbsolutePos(el.offsetParent);
r.x+=tmp.x;
r.y+=tmp.y;
}
return r;
};
mirai.Autocomplete.prototype.gotoResult=function(i,dato,_18f){
if(i>-1){
var elem="#idElemFind_txt_"+this.request.target+"_"+i;
$(this.target).attr("value",($(elem).attr("miraiTxtFind")).toLowerCase());
}
if(typeof _18f=="undefined"){
_18f=false;
}
var id="#idResultsList_"+this.request.target;
var idP="#idResults_"+this.request.target;
$(id).html("");
if(this.bFastAction&&!_18f){
if(this.bElemSelected){
this.bElemSelected=false;
this.bFastAction=false;
}
$(idP).css("display","none");
this.exeAction(1);
}else{
this.keyUp();
if(this.bElemSelected){
this.bFastAction=true;
}
}
};
mirai.Autocomplete.prototype.checkKey=function(e){
var bRes=true;
if(typeof e=="undefined"){
return bRes;
}
if(e.keyCode){
keycode=e.keyCode;
}else{
keycode=e.which;
}
character=String.fromCharCode(keycode);
var _195=$("#idResults_"+this.request.target+" li").length-1;
var _196=0;
if($(this.target).attr("value")==""){
$(this.target).css("background-position","right "+this.posRelojOff);
}
switch(keycode){
case 5000:
case 40:
this.nCountElem++;
if(this.nCountElem>_195){
this.nCountElem=_195;
}
$("#idResults_"+_this.request.target+" li a").each(function(i){
$(this).removeClass("cSelected");
});
$("#idElemFind_"+this.request.target+"_"+this.nCountElem).addClass("cSelected");
this.scrolling("idElemFind_txt_"+this.request.target+"_"+this.nCountElem,"Data1_idResults_"+this.request.target,"down");
bRes=false;
break;
case 5001:
case 38:
this.nCountElem--;
if(this.nCountElem<_196){
this.nCountElem=0;
}
$("#idResults_"+_this.request.target+" li a").each(function(){
$(this).removeClass("cSelected");
});
$("#idElemFind_"+this.request.target+"_"+this.nCountElem).addClass("cSelected");
this.scrolling("idElemFind_txt_"+this.request.target+"_"+this.nCountElem,"Data1_idResults_"+this.request.target,"up");
bRes=false;
break;
case 5002:
case 13:
if(this.nCountElem>-1){
this.bElemSelected=true;
this.bFastAction=false;
this.whenClickElementFinded(this);
bRes=false;
}else{
if(this.bElemSelected&&this.bFastAction){
this.whenClickElementFinded(this);
bRes=false;
}
}
this.nCountElem=-1;
break;
default:
this.nCountElem=-1;
if(this.bDelTxtIniTarget){
$(this.target).attr("value",character);
this.bDelTxtIniTarget=false;
}
}
return bRes;
};
mirai.Autocomplete.prototype.scrolling=function(toId,inId,_19a){
var _19b=parseInt($("#"+toId).height());
var _19c=parseInt($("#"+inId).height());
var pos=_19b*this.nCountElem;
var _19e=document.getElementById(inId).scrollTop;
$("#salida").attr("value","alto_elem:"+_19b+" alto_result:"+_19c+" - pos:"+pos+" - scrolltop:"+_19e);
if(_19c<(pos+_19b)&&_19a=="down"){
document.getElementById(inId).scrollTop=pos-_19c+_19b;
}
if(_19c>(pos+_19b-_19c)&&_19a=="up"&&_19e>0){
document.getElementById(inId).scrollTop=_19e-_19b;
}
};
mirai.Autocomplete.prototype._focoOn=function(evt){
var _1a0=this;
if(_1a0.numId==-999){
var kkk=eval(this.myName),ikk=0,lkk=kkk.length;
for(;ikk<lkk;ikk++){
if(kkk[ikk].name==this.name){
_1a0.numId=ikk;
ikk=10000;
}
}
}
if(this.bDelTxtIniTarget){
$(this.target).attr("value","");
this.bDelTxtIniTarget=false;
}
$("#idResults_"+this.request.target).css("visibility","visible");
if(this.bMoreResults){
var aObj=eval(this.myName);
var l=aObj.length;
var i=0;
var t="";
for(;i<l;i++){
if(i!=this.numId){
t=aObj[i].request.target;
$("#idResults_"+t).css("visibility","hidden");
}
}
}
};
mirai.Autocomplete.prototype._focoOff=function(evt){
$("#idResults_"+this.request.target).css("visibility","hidden");
};
mirai.Autocomplete.prototype.showOrHide=function(){
if($(this.target).attr("value").length>0){
var pos=this._getAbsolutePos(document.getElementById(this.request.target));
var _1a8={offsetTop:(document.getElementById(this.request.target).offsetHeight+2),offsetLeft:0};
$("#idResults_"+this.request.target).css({"display":"block","position":"absolute","top":(pos.y+_1a8.offsetTop)+"px","left":(pos.x+_1a8.offsetLeft)+"px"});
}else{
$("#idResults_"+this.request.target).css("display","none");
$("#Data1_idResults_"+this.request.target).html("");
}
};
mirai.Autocomplete.prototype.closeResults=function(_1a9){
if(typeof (_1a9)=="undefined"){
if(typeof (this.request.target)!="undefined"){
_1a9=this.request.target;
}
}
try{
$("#idResults_"+_1a9).css("display","none");
}
catch(e){
}
};
mirai.Autocomplete.prototype.whenClickElementFinded=function(_1aa,_1ab){
try{
_1aa.offset=0;
_1aa.postdata.offset=0;
_1aa.gotoResult(_1aa.nCountElem,_1aa.aDataLinkResults[_1aa.nCountElem],_1ab);
}
catch(e){
var ee=2;
}
};
mirai.Autocomplete.prototype.exeAction=function(e){
$(this.idForm).unbind("submit");
$("#autocomplete_xwd").attr("value",this.bExactWord);
document.getElementById(this.request.idForm).submit();
};
mirai.Autocomplete.prototype.strpos=function(_1ae,_1af,_1b0){
var l=_1ae.length;
var n=_1af.length;
var _1b3;
if(_1b0==null){
_1b0=0;
}
for(var i=_1b0;i<l;i++){
if(_1ae.charAt(i)==_1af.charAt(0)){
_1b3=1;
for(var j=1;j<n;j++){
if(_1ae.charAt(i+j)==_1af.charAt(j)){
_1b3++;
}else{
_1b3=0;
break;
}
}
if(_1b3==n){
return (i);
}
}
}
return (-1);
};
mirai.AutocompletePost=function(_1b6){
mirai.AutocompletePost.baseConstructor.call(this,_1b6);
};
mirai.extend(mirai.AutocompletePost,mirai.Autocomplete);
mirai.AutocompletePost.prototype.getData=function(_1b7){
var _1b8=this;
if(typeof (_1b7)=="undefined"){
_1b7=0;
}else{
this.offset=_1b7;
_1b8.postdata.offset=_1b7;
}
$("#Info1_idResults_"+_1b8.request.target).html("Buscando...");
$(this.target).css("background-position","right "+this.posRelojOn);
try{
this.postdata.searchtxt=$(this.target).attr("value");
this.postdata.offset=_1b7;
$.post(this.url,this.postdata,function(_1b9){
_1b8.parseData(_1b9);
});
}
catch(e){
alert(this.noConexion[this.postadata.idioma]+"\n"+e.message);
}
};
mirai.AutocompletePost.prototype.showData=function(val){
_this=this;
if($(_this.target).attr("value")==""){
return false;
}
var tmp=$(_this.target).attr("value")+"_"+_this.postdata.modo+"_"+_this.offset+"_"+_this.postdata.idioma;
if(_this.postdata.countryid){
tmp+="_"+_this.postdata.countryid;
}
if(val["text"]!=tmp){
$("#Info1_idResults_"+_this.request.target).html("");
$(this.target).css("background-position","right "+this.posRelojOff);
return false;
}
var _1bc=val["result"];
var _1bd="";
var _1be="";
var _1bf,pTxt,lTxt,lThis,partTxt0,partTxt1,partTxt2;
var _1c0=(typeof (_1bc)=="object")?_1bc.length:-1;
if(_1bc[0][0]=="No results"||typeof (_1bc)=="string"||_1c0==0||_1c0==-1){
_1bd+=_this.sinResultados[_this.postdata.idioma];
}else{
aHotels=eval(_1bc);
if(_this.offset==0){
_1bd+="<div class='"+_this.cssClass.moreResults+"' id='idMasResults_"+_this.request.target+"'></div>";
_1bd+="<div class='"+_this.cssClass.lista+"'>";
_1bd+="<ul id='idResultsList_"+_this.request.target+"'>";
}
try{
$.each(aHotels,function(i){
if(i>=_this.postdata.numResults){
return;
}
var _1c2=$(_this.target).attr("value").toLowerCase();
var pTxt=_this.strpos(this[0].toLowerCase(),_1c2);
var lTxt=_1c2.length;
var _1c5=this[0].length;
var _1c6=this[0];
if(_1c5>this.maxLengthText){
this[0]=this[0].substring(0,this.maxLengthText)+"...";
}
partTxt0=this[0].substring(0,pTxt);
partTxt1=this[0].substring(pTxt,lTxt+pTxt);
partTxt2=this[0].substring(pTxt+lTxt,_1c5);
_1be=partTxt0+"<strong>"+partTxt1+"</strong>"+partTxt2;
_this.aDataLinkResults[i]=this[1];
_1bd+="<li class='"+_this.cssClass.elemLista+"'>";
_1bd+="<a href='javascript:;' id='idElemFind_"+_this.request.target+"_"+(i+_this.offset)+"' class='"+_this.cssClass.linkResults+"'>";
_1bd+="<span class='"+_this.cssClass.valorNum+"'>";
var _1c7=(this[2]>1)?"es":"";
if(_this.postdata.modo==0){
_1bd+="&nbsp;["+this[2]+"  hotel"+_1c7+"]";
}
_1bd+="</span>";
_1bd+="<span miraiTxtFind='"+_1c6+"' id='idElemFind_txt_"+_this.request.target+"_"+(i+_this.offset)+"' class='"+_this.cssClass.valorText+"'>";
_1bd+=_1be;
_1bd+="</span>";
_1bd+="</a>";
if(_this.postdata.bWatchSearch){
_1bd+="<div class='"+_this.cssClass.valorNum+"'>[ "+this[3]+" ]</div>";
}
_1bd+="<div style='clear:both;'></div></li>";
_1bd+="</li>";
});
}
catch(z){
_1bd=this.sinResultados[this.postadata.idioma]+" (error)";
}
if(_this.offset==0){
_1bd+="</ul>";
_1bd+="</div>";
}
}
if(_this.offset>0){
var _1c8=$("#idResultsList_"+_this.request.target).html();
var _1c9=$("#Data1_idResults_"+_this.request.target).height();
$("#idResultsList_"+_this.request.target).html(_1c8+_1bd);
$("#Data1_idResults_"+_this.request.target).height(_1c9);
}else{
$("#Data1_idResults_"+_this.request.target).html(_1bd);
}
document.getElementById("Data1_idResults_"+this.request.target).scrollTop=document.getElementById("Data1_idResults_"+this.request.target).offsetHeight*(this.offset/this.postdata.numResults);
if(_1c0==_this.postdata.numResults&&_this.bMoreResults){
$("#idMoreResults_"+this.request.target).css("display","inline");
}else{
$("#idMoreResults_"+this.request.target).css("display","none");
}
$("#idCloseResults_"+this.request.target).css("display","inline");
$("#Info1_idResults_"+_this.request.target).html("");
$(this.target).css("background-position","right "+this.posRelojOff);
_this.nCountElem=$("#idResults_"+_this.request.target+" li").length-_1c0-1;
$("#idMoreResults_"+_this.request.target).unbind("click");
$("#idMoreResults_"+_this.request.target).bind("click",function(){
_this.getData(_this.offset+_this.postdata.numResults);
document.getElementById(_this.request.target).focus();
});
$.each($("li > a"),function(i){
$(this).bind("click",function(){
var tmp=$(this).attr("id").split("_");
_this.nCountElem=tmp[tmp.length-1];
_this.whenClickElementFinded(_this,true);
});
});
};
try{
mirai.setLoaded("mirai.autocomplete");
}
catch(e){
var ee=2;
}


