if(typeof (bsn_search)=="undefined"){_b=bsn_search={}}if(typeof (_b.Autosuggest)=="undefined"){_b.Autosuggest={}}else{alert("Autosuggest is already set! b")}_b.AutoSuggest=function(E,D){if(!document.getElementById){return 0}this.fld=_b.DOM.gE(E);if(!this.fld){return 0}this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.cancelShow=false;this.scrollPos=0;this.reachBottom=false;this.ajax=false;if(document.all){this.isMouseDown=false}this.oP=D?D:{};var A,B={minchars:0,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:150,offsety:-5,shownoresults:true,noresults:"No results!",maxheight:250,cache:false,maxentries:25};for(A in B){if(typeof (this.oP[A])!=typeof (B[A])){this.oP[A]=B[A]}}var C=this;this.fld.onkeydown=function(F){return C.onKeyDown(F)};this.fld.onkeyup=function(F){return C.onKeyUp(F)};this.fld.setAttribute("autocomplete","off");this.addListener(this.fld,"blur",function(F){if(!C.isMouseDown){return C.clearSuggestions()}})};_b.AutoSuggest.prototype.addListener=function(B,C,A){if(window.addEventListener){B.addEventListener(C,A,false)}else{B.attachEvent("on"+C,A)}};_b.AutoSuggest.prototype.onKeyDown=function(G){var E=(window.event)?window.event.keyCode:G.keyCode;var D=38;var F=40;var C=13;var B=9;var H=27;var A=1;switch(E){case C:if(this.iHigh==0){this.onReturnKeyPress()}else{this.setHighlightedValue();A=0}break;case D:this.changeHighlight(E);A=0;break;case F:this.changeHighlight(E);A=0;break;case H:this.clearSuggestions();break}return A};_b.AutoSuggest.prototype.onReturnKeyPress=function(){};_b.AutoSuggest.prototype.onKeyUp=function(F){var D=(window.event)?window.event.keyCode:F.keyCode;var C=38;var E=40;var B=13;var A=1;switch(D){default:if(this.fld.value==""){this.sInp="";this.clearSuggestions()}else{this.getSuggestions(this.fld.value)}}return A};_b.AutoSuggest.prototype.getSuggestions=function(G){if(G==this.sInp){return 0}this.cancelShow=false;this.sInp=G;if(G.length<this.oP.minchars){this.aSug=[];this.nInpC=G.length;return 0}var D=this.nInpC;this.nInpC=G.length?G.length:0;var B=this.aSug.length;if(this.nInpC>D&&B&&B<this.oP.maxentries&&this.oP.cache){var A=[];for(var E=0;E<B;E++){if(this.aSug[E].value.substr(0,G.length).toLowerCase()==G.toLowerCase()){A.push(this.aSug[E])}}this.aSug=A;this.createList(this.aSug);return false}else{var F=this;var C=this.sInp;clearTimeout(this.ajID);this.ajID=setTimeout(function(){F.doAjaxRequest(C)},this.oP.delay)}return false};_b.AutoSuggest.prototype.doAjaxRequest=function(C){if(C!=this.fld.value){return false}var F=this;if(typeof (this.oP.script)=="function"){var D=this.oP.script(encodeURIComponent(this.sInp))}else{var D=this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp)}if(!D){return false}var B=this.oP.meth;var C=this.sInp;var A=function(G){F.setSuggestions(G,C)};var E=function(G){};if(this.ajax){this.abortAjax(this.ajax.req)}this.ajax=new _b.Ajax();this.ajax.makeRequest(D,B,A,E)};_b.AutoSuggest.prototype.abortAjax=function(A){if(A){if(A.readyState!=4){A.abort();A=null;return true}}return false};_b.AutoSuggest.prototype.cancelSuggestions=function(){this.cancelShow=true};_b.AutoSuggest.prototype.setSuggestions=function(req,input){if(input!=this.fld.value||this.cancelShow){return false}this.aSug=[];if(this.oP.json){var jsondata=eval("("+req.responseText+")");for(var i=0;i<jsondata.results.length;i++){this.aSug.push({id:jsondata.results[i].id,value:jsondata.results[i].value,info:jsondata.results[i].info})}}else{var xml=req.responseXML;var results=xml.getElementsByTagName("results")[0].childNodes;for(var i=0;i<results.length;i++){if(results[i].hasChildNodes()){this.aSug.push({id:results[i].getAttribute("id"),value:results[i].childNodes[0].nodeValue,info:results[i].getAttribute("info")})}}}this.idAs="as_"+this.fld.id;this.createList(this.aSug)};_b.AutoSuggest.prototype.createList=function(J){var A=this;_b.DOM.remE(this.idAs);this.killTimeout();if(J.length==0&&!this.oP.shownoresults){return false}var B=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});if(document.all){A.isMouseDown=false;B.onmousedown=function(O){A.isMouseDown=true;return false}}var N=_b.DOM.cE("table",{id:"as_table",cellSpacing:0,cellPadding:2,border:0});if(document.all){N.width="95%"}else{N.width="100%"}var I=_b.DOM.cE("tbody",{id:"as_tbody"});for(var H=0;H<J.length;H++){var F=J[H].value;var D=(J[H].id).split("|");var C="";if(D[1]=="property"){C='<span style="color:#999999">Property</span>'}else{if(D[3]){C='<span style="color:#CC9900">Company Name</span>'}else{C='<span style="color:#999999">Category</span>'}}if(F.length>40){var E='<div style="float:left;">'+F.substr(0,40)+'...</div><div style="float:right;">'+C+"</div>"}else{var E='<div style="float:left;">'+F+'</div><div style="float:right;">'+C+"</div>"}var K=_b.DOM.cE("tr",{});var G=_b.DOM.cE("td",{},E,true);G.style.cursor="default";G.title=F;G.name=H+1;G.onclick=function(){A.setHighlightedValue();return false};G.onmouseover=function(){A.setHighlight(this.name)};K.appendChild(G);I.appendChild(K)}N.appendChild(I);B.appendChild(N);var M=document.createElement("div");M.style.cssText="padding-top:8px;";M.innerHTML='<div class="Link17 ver_10">Powered By <a href="http://'+location.hostname+'/businessfinder/" target="_blank">Business Finder</a><hr></div><div  class="Link17 TextGrey">Free Registration : <a href="http://'+location.hostname+'/feedback_company.php" target="_blank">Submit Your Business info</a></div>';B.appendChild(M);var L=_b.DOM.getPos(this.fld);if(!document.layers&&!document.all){B.style.left=(L.x+1)+"px"}else{B.style.left=L.x+"px"}B.style.top=(L.y+this.fld.offsetHeight+this.oP.offsety+4)+"px";B.onmouseover=function(){A.killTimeout()};document.getElementsByTagName("body")[0].appendChild(B);this.iHigh=0;var A=this;this.toID=setTimeout(function(){A.clearSuggestions()},this.oP.timeout)};_b.AutoSuggest.prototype.changeHighlight=function(A){var C=_b.DOM.gE("as_tbody");if(!C){return false}var E;if(A==40){E=this.iHigh+1;if(this.scrollPos<=11){++this.scrollPos}}else{if(A==38){E=this.iHigh-1;if(this.scrollPos>1){--this.scrollPos}}}if(E>C.childNodes.length){E=C.childNodes.length;if(A==40){this.scrollPos=9;this.reachBottom=true}}if(E<1){E=1}if((A==40||A==38)&&(this.scrollPos==12||this.scrollPos==1||(this.reachBottom&&this.scrollPos==9))){var B=$(this.idAs);var D=0;if(this.reachBottom){if(this.scrollPos==1){this.reachBottom=false}else{D=40}}B.scrollTop=(E-this.scrollPos)*17+D}this.setHighlight(E)};_b.AutoSuggest.prototype.setHighlight=function(C){var B=_b.DOM.gE("as_tbody");if(!B){return false}if(this.iHigh>0){this.clearHighlight()}this.iHigh=Number(C);var A=B.childNodes[this.iHigh-1];A.childNodes[0].className="as_highlight";this.killTimeout()};_b.AutoSuggest.prototype.clearHighlight=function(){var B=_b.DOM.gE("as_tbody");if(!B){return false}if(this.iHigh>0){var A=B.childNodes[this.iHigh-1];A.childNodes[0].className="";this.iHigh=0}};_b.AutoSuggest.prototype.setHighlightedValue=function(){if(this.iHigh){if(this.aSug[this.iHigh-1]){this.sInp=this.fld.value=this.aSug[this.iHigh-1].value}this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInp.length,this.sInp.length)}this.clearSuggestions();if(typeof (this.oP.callback)=="function"){this.oP.callback(this.aSug[this.iHigh-1])}}};_b.AutoSuggest.prototype.killTimeout=function(){clearTimeout(this.toID)};_b.AutoSuggest.prototype.resetTimeout=function(){clearTimeout(this.toID);var A=this;this.toID=setTimeout(function(){A.clearSuggestions()},1000)};_b.AutoSuggest.prototype.clearSuggestions=function(){this.killTimeout();var A=_b.DOM.gE(this.idAs);var C=this;if(A){var B=new _b.Fader(A,1,0,250,function(){_b.DOM.remE(C.idAs)})}};if(typeof (_b.Ajax)=="undefined"){_b.Ajax={}}_b.Ajax=function(){this.req={};this.isIE=false};_b.Ajax.prototype.makeRequest=function(C,B,A,D){if(B!="POST"){B="GET"}this.onComplete=A;this.onError=D;var E=this;if(window.XMLHttpRequest){this.req=new XMLHttpRequest();this.req.onreadystatechange=function(){E.processReqChange()};this.req.open("GET",C,true);this.req.send(null)}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req){this.req.onreadystatechange=function(){E.processReqChange()};this.req.open(B,C,true);this.req.send()}}}};_b.Ajax.prototype.processReqChange=function(){if(this.req.readyState==4){if(this.req.status==200){this.onComplete(this.req)}else{this.onError(this.req.status)}}};if(typeof (_b.DOM)=="undefined"){_b.DOM={}}_b.DOM.cE=function(F,B,A,E){var G=document.createElement(F);if(!G){return 0}for(var C in B){G[C]=B[C]}var D=typeof (A);if(D=="string"&&!E){G.appendChild(document.createTextNode(A))}else{if(D=="string"&&E){G.innerHTML=A}else{if(D=="object"){G.appendChild(A)}}}return G};_b.DOM.gE=function(C){var A=typeof (C);if(A=="undefined"){return 0}else{if(A=="string"){var B=document.getElementById(C);if(!B){return 0}else{if(typeof (B.appendChild)!="undefined"){return B}else{return 0}}}else{if(typeof (C.appendChild)!="undefined"){return C}else{return 0}}}};_b.DOM.remE=function(A){var B=this.gE(A);if(!B){return 0}else{if(B.parentNode.removeChild(B)){return true}else{return 0}}};_b.DOM.getPos=function(C){var C=this.gE(C);var B=C;var D=0;if(B.offsetParent){while(B.offsetParent){D+=B.offsetLeft;B=B.offsetParent}}else{if(B.x){D+=B.x}}var B=C;var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetTop;B=B.offsetParent}}else{if(B.y){A+=B.y}}return{x:D,y:A}};if(typeof (_b.Fader)=="undefined"){_b.Fader={}}_b.Fader=function(B,F,E,A,D){if(!B){return 0}this.e=B;this.from=F;this.to=E;this.cb=D;this.nDur=A;this.nInt=50;this.nTime=0;var C=this;this.nID=setInterval(function(){C._fade()},this.nInt)};_b.Fader.prototype._fade=function(){this.nTime+=this.nInt;var A=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);var C=A/100;if(this.e.filters){try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=A}catch(B){this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+A+")"}}else{this.e.style.opacity=C}if(this.nTime==this.nDur){clearInterval(this.nID);if(this.cb!=undefined){this.cb()}}};_b.Fader.prototype._tween=function(B,A,D,C){return A+((D-A)*(B/C))};function updateMapIcon(G,H,L,C,J,K,B,D,F){hideAll();global_title_zone_name=D;if(global_title_zone_name==undefined){global_title_zone_name="all"}if(window.what_new){if(what_new.visible){what_new.hide()}}if(global_cat_id==G&&global_directory==H&&global_main_cat==L&&global_sub_cat==B&&!C){return false}unhighlightDropdown(global_cat_id,global_directory,global_main_cat,global_business_id);highlightDropdown(G,H,L,C);if(B==undefined){traffic.show_small_menu();traffic.outsg_status="closed";traffic.insg_status="closed";traffic.change(traffic.outsg_status);traffic.change(traffic.insg_status)}if(global_this_page.indexOf("gps.php",0)>=0){catName=str_replace(["&","+","-",",","/","(",")"," ","%20"],["","_","_","_","","","_","_"],global_original_cat_name);location.href=baseurl+"/asia_travel/travel/travel_id_"+place_id+"/travel_site_"+address_id+"/"+H+"/"+L+"-"+G+"/"+catName+"/";return }else{if(global_this_page.indexOf("travel_main.php?zonename=Singapore")>=0){catName=str_replace(["&","+","-",",","/","(",")"," ","%20"],["","_","_","_","","","_","_"],global_original_cat_name);location.href=baseurl+"/asia_travel/travel/travel_id_9797/travel_site_22985/"+H+"/"+L+"-"+G+"/"+catName+"/";return }else{if(global_this_page.indexOf("travel_zone.php",0)>=0){catName=str_replace(["&","+","-",",","/","(",")"," ","%20"],["","_","_","_","","","_","_"],global_original_cat_name);location.href=baseurl+"/asiatravel/singaporemap/"+H+"/"+L+"-"+G+"/"+catName+"/";return }}}var A,I;A=G+"_"+C;resetIcon();if($("prem_listing")&&!K&&!C){$("prem_listing").style.display="none";var E=$("content_listing");E.innerHTML="<b>Loading...</b>";E.style.display="block"}if($("ads_place")){$("map_ads").style.display="none";$("ads_place").style.display="none";$("ads_bg").style.display="none";$("lcb_button").style.display="block"}if(client_mode==1){MapAPI.mapClient.levelIndex=6;MapAPI.setMapSource("sg");client_mode=0}if(K==undefined){K=""}if(D!=undefined){var D=D.replace(/_/g," ")}if(MapAPI.mapClient.levelIndex>=4){showMapIcon(G,H,L,C,J,K,B,D,F)}showBusinessLink(G,H,L,C,B)}function showBusinessLink(G,B,E,C,F){if(!$("showRelatedCat")){return""}$("showRelatedCat").style.display="block";$("moreBusinessText").innerHTML="Search Within";if(document.getElementById){var A=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(A){A.onreadystatechange=function(){if(A.readyState==4&&A.status==200){if(A.responseText){$("showRelatedCat").innerHTML=A.responseText}else{$("showRelatedCat").innerHTML="";$("showRelatedCat").style.display="none"}if(location.search.indexOf("test=listview")!=-1){var H=$("showRelatedCat").getElementsByTagName("a");H[1].href="javascript:void(0)";H[1].onclick=function(I){MapAPI.listContainer.load(G,B,E,1)};H=$("showRelatedCat").getElementsByTagName("span");H[0].onclick=function(I){MapAPI.listContainer.hide()}}}else{$("showRelatedCat").innerHTML="<b>Loading...</b>"}};var D="http://"+location.hostname+"/asia_travel/mappage/ajax/businessfinder/get_business_link.php?cat="+G+"&mainCat="+E+"&subCat="+F+"&directory="+B+"&businessId="+C+"&placeId="+place_id+"&addressId="+address_id+"&v="+global.v_c+"&model="+global.model;A.open("GET",D,true);A.send(null)}return false}function showRelatedCat(D,B){if(!$("showRelatedCat")){return""}$("showRelatedCat").style.display="block";if(document.getElementById){var A=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(A){A.onreadystatechange=function(){if(A.readyState==4&&A.status==200){if(A.responseText){$("showRelatedCat").innerHTML=A.responseText}else{$("showRelatedCat").innerHTML="";$("showRelatedCat").style.display="none"}}else{$("showRelatedCat").innerHTML="<b>Loading...</b>"}};if(global_this_page.indexOf("restaurants",0)>=0){var C="http://"+location.hostname+"/asia_travel/mappage/ajax/resto/get_nearby_service.php?cat="+D+"&directory="+B+"&v="+global.v_c}else{var C="http://"+location.hostname+"/asia_travel/mappage/ajax/businessfinder/get_related_service.php?cat="+D+"&directory="+B+"&v="+global.v_c}A.open("GET",C,true);A.send(null)}return false}function setCatName(A){global_cat_name=A.length<=25?A:A.substring(0,22)+"...";global_original_cat_name=A;if($("q")){$("q").value=global_original_cat_name}if($("cat_q")){if($("cat_q").type=="text"||$("cat_q").type=="hidden"){$("cat_q").value=global_original_cat_name}else{$("cat_q").innerHTML=global_original_cat_name}}}function resetIcon(){abortAjax(global_ajax.a);global_feature_ads=global_bubble_flag="";global_bubble.company_id=global_bubble.directory=null;if($("content_listing")){$("content_listing").style.display="none"}if($("featured_ad_listing")){$("featured_ad_listing").style.display="none"}if($("content_listing_paging_top")){$("content_listing_paging_top").parentNode.style.display="none"}if($("content_listing_paging_bottom")){$("content_listing_paging_bottom").style.display="none"}if($("show_related_cat")){$("show_related_cat").innerHTML="";$("show_related_cat").style.display="block"}hideFeaturedAd();hide_element("content_listing_paging");hideAllMapIcon();closeInfoWindow("all");MapAPI.mapDraw.closeToolTips();resetMapIcon()}function resetMapIcon(){if(MapAPI.feature!="dd"){global_flag_status=new Array();var A=new Array();A.push(MapAPI.mapDraw.panelIcon.icons[0]);A.push(MapAPI.mapDraw.panelIcon.icons[1]);MapAPI.mapDraw.panelIcon.icons=new Array();MapAPI.mapDraw.panelIcon.icon_groups=new Array(0,0);MapAPI.mapDraw.panelIcon.icons=A;MapAPI.mapDraw.panelIcon.updatePosition()}}function clear_results(){if($("clear_result")){$("clear_result").style.color="#a8a8a8"}if($("cat_name")){$("cat_name").style.color="#a8a8a8";$("cat_name").onmouseover=function(){showRelatedDropDown(global_last_cat_id,global_last_directory,global_last_cat_name)}}global_last_cat_id=global_cat_id;global_last_directory=global_directory;global_last_cat_name=global_original_cat_name;resetIcon();setCatName("");if(typeof clearActiveDropdown=="function"){clearActiveDropdown()}unhighlightDropdown(global_cat_id,global_directory,global_main_cat,global_business_id);global_data=new Array();global_original_cat_name=global_cat_id=global_directory=global_business_id=global_branch_only="";close_mini_site()}function clear_bus(){closeInfoWindow("all");clearLHS();hide_element("content_listing_header");MapAPI.mapClient.mapDraw.panelIcon.clearBusStop();MapAPI.mapClient.mapDraw.panelLine.deleteLines()}function reset_mappage(C,A,B){MapAPI.mapDraw.closeToolTips();closeInfoWindow("all");clearLHS();hide_element("content_listing_header");if(C){setCatName("");if(typeof clearActiveDropdown=="function"){clearActiveDropdown()}unhighlightDropdown(global_cat_id,global_directory,global_main_cat,global_business_id);global_data=new Array();global_original_cat_name=global_cat_id=global_directory=global_business_id=global_branch_only="";MapAPI.mapClient.mapDraw.panelIcon.hideIcons()}if(A){MapAPI.mapClient.mapDraw.panelIcon.clearBusStop();MapAPI.mapClient.mapDraw.panelLine.deleteLines()}if(B){MapAPI.mapClient.mapDraw.panelIcon.routes.clear()}close_mini_site();resetMapIcon()}function filterCompanies(G){var C=new Array();var E=getLastPos();var F=getMinXY();var B=getMaxXY();for(var D=0;D<G.length;D++){var A=G[D];if(A.x>F[0]&&A.x<B[0]&&A.y>F[1]&&A.y<B[1]){A.distance=Math.sqrt(Math.pow(A.x-E.x,2)+Math.pow(A.y-E.y,2));if(A.e){A.e=str_replace("(n)","&",A.e)}if(A.ms){A.featured_ad=true}C.push(A)}}(global.ccz=="sortName")?C.sort(compareName):C.sort(compare);return C}function compareName(B,A){if(B.t=="biz_prem"&&A.t=="biz"){return -1}else{if(B.t=="biz"&&A.t=="biz_prem"){return 1}else{if(B.t=="biz_prem"&&A.t=="biz_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}else{if(B.t=="res_prem"&&A.t=="res"){return -1}else{if(B.t=="res"&&A.t=="res_prem"){return 1}else{if(B.t=="res_prem"&&A.t=="res_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}else{if(B.t=="property_prem"&&A.t=="property"){return -1}else{if(B.t=="property"&&A.t=="property_prem"){return 1}else{if(B.t=="property_prem"&&A.t=="property_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}}}}}}}}}if(B.company<A.company){return -1}else{return 1}}function compare(B,A){if(B.t=="biz_prem"&&A.t=="biz"){return -1}else{if(B.t=="biz"&&A.t=="biz_prem"){return 1}else{if(B.t=="biz_prem"&&A.t=="biz_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}else{if(B.t=="res_prem"&&A.t=="res"){return -1}else{if(B.t=="res"&&A.t=="res_prem"){return 1}else{if(B.t=="res_prem"&&A.t=="res_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}else{if(B.t=="property_prem"&&A.t=="property"){return -1}else{if(B.t=="property"&&A.t=="property_prem"){return 1}else{if(B.t=="property_prem"&&A.t=="property_prem"){if(B.ap<A.ap){return -1}else{if(B.ap>A.ap){return 1}}}}}}}}}}}return B.distance-A.distance}function FeaturedAd(C,A,B){this.src=C;this.url=A;this.title=B}function show_map_page_menu(B){if(B==""||B==undefined){B="map"}if(!$("scroller_menu")){return }if(document.getElementById){var A=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(A){A.onreadystatechange=function(){if(A.readyState==4&&A.status==200){$("scroller_menu").innerHTML+=A.responseText;var D={script:function(G){var H="search_category";return baseurl+"/asia_travel/mappage/ajax/"+H+".php?cat_q="+G+"&directory="+global_directory+"&mainCat="+global_main_cat+"&v="+global.v_c+global_clear_cache},varname:"cat_q",json:true,shownoresults:false,timeout:300000,maxresults:10,callback:function(H){if(H){var G=(H.id).split("|");setCatName(H.value);if(G[3]!=""){global_branch_only=1}updateMapIcon(G[0],G[1],G[2],G[3],"",global_branch_only)}}};var F=new bsn_search.AutoSuggest("cat_q",D);var E=new moving_menu("moving_menu");highlightDropdown(global_cat_id,global_directory,global_main_cat,global_business_id)}};var C="http://"+location.hostname+"/navigation/sdinc_dropdown_content.php?page="+B+"&v="+global.v_c+global_clear_cache;A.open("GET",C,true);A.send(null)}return false}function highlightDropdown(D,A,C,B){var E="mapdd-"+D+"_"+A+"_"+C+"_"+B;if($(E)){$(E).childNodes[0].style.backgroundColor="#ffeb97"}}function unhighlightDropdown(D,A,C,B){var E="mapdd-"+D+"_"+A+"_"+C+"_"+B;if($(E)){$(E).childNodes[0].style.backgroundColor="#fffce2"}}function btnCloseChange(A){if(A==1){$("closeBtn").style.display="none";$("closeBtnHover").style.display="block"}else{$("closeBtn").style.display="block";$("closeBtnHover").style.display="none"}}function recordListing(B){var A=global_directory+"_"+B.company_id;if(stats[A]==undefined){stats[A]=0}stats[A]++}window.onbeforeunload=function(){var C,A="";if(stats){for(key in stats){C=stats[key];A+=key+"="+C+"&"}if(A!=""){var B=new Image();B.src=baseurl+"/asia_travel/mappage/ajax/stats.php?"+A;document.getElementsByTagName("BODY")[0].appendChild(B);B.style.display="none"}}};function openBottomBox(){$("bottomMapHide").style.display="none";$("bottomMapShow").style.display="block"}function closeBottomBox(){$("bottomMapHide").style.display="block";$("bottomMapShow").style.display="none"}function changeImgFooter(B,A){if(B=="fb"){if(A=="over"){$("fb-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+baseurl+"/img/map/content/Facebook_hover.png')"}else{$("fb-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+baseurl+"/img/map/content/Facebook.png')"}}else{if(A=="over"){$("twitter-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+baseurl+"/img/map/content/Twitter_hover.png')"}else{$("twitter-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+baseurl+"/img/map/content/Twitter.png')"}}}function showEvent(A){if(A=="marathon"&&window.marathon){if($("xmas_div")){$("xmas_div").style.display="none"}if(window.what_new){what_new.hide()}MapAPI.mapClient.ChangeLevel(9);gotoMap(marathon.marker_point.x,marathon.marker_point.y);marathon.show();if($("xmas_div_overlay")){$("xmas_div_overlay").style.display="none"}}else{if(A=="xmas"){if(window.marathon){marathon.hide()}if(window.what_new){what_new.hide()}loadxmas();$("xmas_div_overlay").style.display="block"}}}function loadxmas(){if(document.getElementById("xmas_div")){document.getElementById("xmas_div").style.display="block"}else{xmas_div=document.createElement("div");xmas_div.id="xmas_div";xmas_div.style.cssText="width:679px; height:544px; position:absolute; top:38px; left:21px; z-index:10000;";$("mapContent").appendChild(xmas_div);xmas_div.overlay=document.createElement("div");xmas_div.overlay.id="xmas_div_overlay";xmas_div.overlay.style.cssText="background-color: #000; filter:alpha(opacity=60); -moz-opacity:.60; -khtml-opacity: 0.6; opacity: 0.6; z-index: 9999; position: absolute; top: 2px; left: 0px; display: block;";xmas_div.overlay.style.width="720px";xmas_div.overlay.style.height="622px";$("mapContent").appendChild(xmas_div.overlay)}var E=navigator.appVersion.split("MSIE");var A=parseFloat(E[1]);if(document.getElementById){var C;try{C=new XMLHttpRequest()}catch(D){try{C=new ActiveXObject("Msxml2.XMLHTTP")}catch(D){try{C=new ActiveXObject("Microsoft.XMLHTTP")}catch(D){alert("Your browser does not support AJAX!");return false}}}if((A>=5.5)&&(A<7)){var B="http://"+location.hostname+"/asia_travel/mappage/ajax/xmas/xmas.php?menuhoverie=1"+global_clear_cache+"&v="+global.v_c}else{if(A=7){var B="http://"+location.hostname+"/asia_travel/mappage/ajax/xmas/xmas.php?menuhoverie=2"+global_clear_cache+"&v="+global.v_c}else{if(A=8){var B="http://"+location.hostname+"/asia_travel/mappage/ajax/xmas/xmas.php?menuhoverie=2"+global_clear_cache+"&v="+global.v_c}else{var B="http://"+location.hostname+"/asia_travel/mappage/ajax/xmas/xmas.php?v="+global.v_c+global_clear_cache}}}C.onreadystatechange=function(){if(C.readyState==4){document.getElementById("xmas_div").innerHTML=C.responseText;load();changeDetailXmas("menu_7","1");showReviewXmas("review_1")}};C.open("GET",B,true);C.send(null)}}function track_banner_mainpage(B,D,E,C){var A=new Image();A.src="/asia_travel/mappage/ajax/stats.php?type="+C+"&company_id="+B+"&branch_id="+D+"&company_name="+E+"&pos=main_page";document.getElementsByTagName("BODY")[0].appendChild(A);A.style.display="none"};function click_stats(e,f){var c,d,a="";if(e){a="module="+e;if(f){a+"&"+f}var b=new Image();b.src=baseurl+"/asia_travel/mappage/ajax/stats.php?"+a;document.getElementsByTagName("BODY")[0].appendChild(b)}}function record_stats(b,c,a){if(global_stats[b]){if(a){global_stats[b]++}}else{if(!c){c=1}global_stats[b]=c}}function record_stats_new(a,b){if(global_stats[a]){if(b==undefined||b==""){global_stats[a]++}else{if(global_stats[a][b]){global_stats[a][b]++}else{global_stats[a][b]=1}}}else{if(b==undefined||b==""){global_stats[a]=1}else{global_stats[a]=[];global_stats[a][b]=1}}}function recordListing(b){var a=global_directory+"_"+b.company_id;if(global_stats[a]==undefined){global_stats[a]=0}global_stats[a]++}window.onbeforeunload=function(){var e,a="",d,c;if(global_stats){for(c in global_stats){if(c=="clone"||typeof(c)=="function"||typeof(c)=="reverse"){continue}a+=c+"=";if(global_stats[c].length==undefined){a+=global_stats[c]}else{d=true;for(key2 in global_stats[c]){if(key2=="clone"){continue}if(d){d=false}else{a+=","}a+=key2+":"+global_stats[c][key2]}}if(a!=""){a+="&"}}if(a!=""){a=a.substr(0,a.length-1);var b=new Image();b.src=baseurl+"/asia_travel/mappage/ajax/stats.php?"+a;document.getElementsByTagName("BODY")[0].appendChild(b);b.style.display="none"}}if(typeof(window.SD)!="undefined"&&$("drag_map")){SD.util.purge($("drag_map"))}};function google_analytic(a){if(window._gaq){_gaq.push(["_trackPageview",a])}else{removeElement("GA_Iframe");var b=document.createElement("iframe");b.width=0;b.height=0;b.frameborder=0;b.id="GA_Iframe";document.getElementsByTagName("body")[0].appendChild(b);b.src="/asia_travel/mappage/includes/google_analytic.php?url="+a}};var gbl=new Array();if(global==undefined){var global=new Array()}if(typeof(bsn_main_search)=="undefined"){_b=bsn_main_search={}}if(typeof(_b.Autosuggest)=="undefined"){_b.Autosuggest={}}_b.AutoSuggest=function(e,d){if(!document.getElementById){return 0}this.fld=_b.DOM.gE(e);if(!this.fld){return 0}this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.cancelShow=false;this.submitEventChanged=false;this.ajax=false;if(document.all){this.isMouseDown=false}this.oP=d?d:{};var a,b={minchars:1,meth:"get",varname:"input",className:"autosuggest",timeout:2500,delay:150,offsety:-5,shownoresults:true,noresults:"No results!",maxheight:250,cache:false,maxentries:25};for(a in b){if(typeof(this.oP[a])!=typeof(b[a])){this.oP[a]=b[a]}}var c=this;this.fld.onpaste=function(){setTimeout(function(){showXsearch();c.getSuggestions(c.fld.value)},"10")};this.fld.onkeydown=function(f){return c.onKeyDown(f)};this.fld.onkeyup=function(f){return c.onKeyUp(f)};this.fld.setAttribute("autocomplete","off");this.addListener(this.fld,"blur",function(f){if(!gbl.in_list){return c.clearSuggestions();return hideXsearch()}});this.addListener(this.fld,"mouseover",function(f){gbl.in_list=true});this.addListener(this.fld,"mouseout",function(f){gbl.in_list=false})};_b.AutoSuggest.prototype.addListener=function(b,c,a){if(window.addEventListener){b.addEventListener(c,a,false)}else{b.attachEvent("on"+c,a)}};_b.AutoSuggest.prototype.onKeyDown=function(g){var e=(window.event)?window.event.keyCode:g.keyCode;var d=38;var f=40;var c=13;var b=9;var h=27;var a=1;switch(e){case c:submitSearch(1);break;case d:this.changeHighlight(e);if(this.aSug[this.iHigh-1]){this.fld.value=this.aSug[this.iHigh-1].value}this.cancelSuggestions(this.fld.value);a=0;break;case f:if(this.iHigh<this.aSug.length){this.fld.value=this.aSug[this.iHigh].value;this.changeHighlight(e);this.cancelSuggestions(this.fld.value)}a=0;break;case h:this.clearSuggestions();break}return a};_b.AutoSuggest.prototype.onReturnKeyPress=function(){};_b.AutoSuggest.prototype.onKeyUp=function(f){var d=(window.event)?window.event.keyCode:f.keyCode;var c=38;var e=40;var b=13;var a=1;switch(d){case c:this.cancelSuggestions(this.fld.value);break;case e:this.cancelSuggestions(this.fld.value);break;default:if(this.fld.value.length<this.oP.minchars){this.sInp=this.fld.value;hideXsearch();this.clearSuggestions()}else{showXsearch();this.getSuggestions(this.fld.value)}}return a};_b.AutoSuggest.prototype.getSuggestions=function(g){if(g==this.sInp){return 0}this.cancelShow=false;this.sInp=g;if(g.length<this.oP.minchars){this.aSug=[];this.nInpC=g.length;return 0}var d=this.nInpC;this.nInpC=g.length?g.length:0;var b=this.aSug.length;if(this.nInpC>d&&b&&b<this.oP.maxentries&&this.oP.cache){var a=[];for(var e=0;e<b;e++){if(this.aSug[e].value.substr(0,g.length).toLowerCase()==g.toLowerCase()){a.push(this.aSug[e])}}this.aSug=a;if(this.fld.id=="dd_from"||this.fld.id=="dd_to"){trap="routing";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_result_from"||this.fld.id=="dd_result_to"){trap="routing_result";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="travel_from"||this.fld.id=="travel_to"){trap="travel";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_bus_bubble1"||this.fld.id=="dd_bus_bubble2"){trap="bus_bubble";this.createListddformrouting(this.aSug,trap)}else{this.createList(this.aSug)}}}}return false}else{var f=this;var c=this.sInp;clearTimeout(this.ajID);this.ajID=setTimeout(function(){f.doAjaxRequest(c)},this.oP.delay)}return false};_b.AutoSuggest.prototype.doAjaxRequest=function(c){if(c!=this.fld.value){return false}var f=this;if(typeof(this.oP.script)=="function"){var d=this.oP.script(encodeURIComponent(this.sInp))}else{var d=this.oP.script+this.oP.varname+"="+encodeURIComponent(this.sInp)}if(!d){return false}var b=this.oP.meth;var c=this.sInp;var a=function(g){f.setSuggestions(g,c)};var e=function(g){};if(this.ajax){this.abortAjax(this.ajax.req)}this.ajax=new _b.Ajax();this.ajax.makeRequest(d,b,a,e)};_b.AutoSuggest.prototype.abortAjax=function(a){if(a){if(a.readyState!=4){a.abort();a=null;return true}}return false};_b.AutoSuggest.prototype.cancelSuggestions=function(){this.cancelShow=true};_b.AutoSuggest.prototype.setSuggestions=function(req,input){if(input!=this.fld.value||this.cancelShow){return false}this.aSug=[];if(this.oP.json){var jsondata=eval("("+req.responseText+")");if(jsondata.rs){var n=jsondata.rs.length;for(var i=0;i<n;i++){var tmp={id:jsondata.rs[i].id,value:jsondata.rs[i].v,info:jsondata.rs[i].i,type:jsondata.rs[i].t};if(jsondata.rs[i].p){tmp.param=jsondata.rs[i].p}this.aSug.push(tmp)}}}else{var xml=req.responseXML;var results=xml.getElementsByTagName("results")[0].childNodes;for(var i=0;i<results.length;i++){if(results[i].hasChildNodes()){var tmp={id:results[i].getAttribute("id"),value:results[i].childNodes[0].nodeValue,info:results[i].getAttribute("info"),type:results[i].getAttribute("type")};if(results[i].getAttribute("param")){tmp.param=results[i].getAttribute("param")}this.aSug.push(tmp)}}}this.idAs="as_"+this.fld.id;this.idAs2="as2_"+this.fld.id;this.idAs3="as3_"+this.fld.id;if(this.fld.id=="dd_from"||this.fld.id=="dd_to"){trap="routing";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_result_from"||this.fld.id=="dd_result_to"){trap="routing_result";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="travel_from"||this.fld.id=="travel_to"){trap="travel";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_bus_bubble1"||this.fld.id=="dd_bus_bubble2"){trap="bus_bubble";this.createListddformrouting(this.aSug,trap)}else{this.createList(this.aSug)}}}}};_b.AutoSuggest.prototype.hideList=function(){_b.DOM.remE(this.idAs);_b.DOM.remE(this.idAs2);_b.DOM.remE(this.idAs3);if(!global.promo_tab_autosuggest){if($("map-include")){$("map-include").className="displayhide"}}};_b.AutoSuggest.prototype.createList=function(w){var b=pageIdentifySearch();var x=this;_b.DOM.remE(this.idAs);_b.DOM.remE(this.idAs2);_b.DOM.remE(this.idAs3);this.killTimeout();if(w.length==0&&!this.oP.shownoresults){return false}var ae=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});ae.style.cssText="overflow-x: hidden";if(document.all){x.isMouseDown=false;ae.onmousedown=function(i){x.isMouseDown=true;return false}}var A=_b.DOM.cE("table",{id:"as_table",cellSpacing:0,cellPadding:2,border:0});var U=_b.DOM.cE("tbody",{id:"as_tbody"});var l="",f,d,s,B,O,F,Q,H;var r=w.length,D;D="display: block";var an=false;for(var ac=0;ac<r;ac++){s=w[ac];if(s&&s.param&&s.param.x&&s.param.y){an=true}else{an=false}if(s.param&&s.param.ct==1){H="[Bus Stop] "+s.value}else{H=s.value}if(!H){continue}val2=(H)?H.replace(/'/g,"\\'"):H;if(H.length>71&&this.fld.offsetWidth==406){F=H.substr(0,68)+"..."}else{if(H.length>85&&this.fld.offsetWidth==464){F=H.substr(0,82)+"..."}else{F=H}}B="";O="";Q=get_cat_type_name(s.type);var a="";keyword=$("q").value;keyword=keyword.replace("'","%27");if(Q=="Property"){O='<span style="color:#AD0945">Property</span>';B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="#">Map View</a> | <a href="#">Profile View</a></div>'}else{if(Q=="Company"){f="http://"+location.hostname+"/businessfinder/company_detail.php?companyid="+s.param.bid+"&branchid="+s.param.lid;O='<span style="color:#CC9900">Company Name</span>';af="record_stats_new('auto_suggest', '"+keyword+"_company_cid-"+s.param.bid+"_lid-"+s.param.lid+"_1');";if(b=="businessfinder_preview"||b=="businessfinder_company"||an==false||b=="map_view"||b=="map"){d="http://"+location.hostname+"/asiatravel/singaporemap/business/"+s.param.bid+"/"+s.id+"/";url3="http://"+location.hostname+"/businessfinder/company_detail.php?companyid="+s.param.bid+"&branchid="+s.param.lid;l="as_json_main_search.hideList();";if(b=="businessfinder_preview"||b=="businessfinder_company"||an==false){a='"'+url3+'" onclick="hideAll(); '+af+" "+l+'"'}else{a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}}else{d="http://"+location.hostname+"/businessfinder/company_detail.php?companyid="+s.param.bid+"&branchid="+s.param.lid;l="as_json_main_search.hideList();";a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}var E="";if(s.param.b>1){E=' | <a href="http://'+location.hostname+"/businessfinder/company_branch/"+s.param.bid+"/"+s.param.lid+"/\" onclick=\"record_stats_new('auto_suggest', '"+keyword+"_company_cid-"+s.param.bid+"_lid-"+s.param.lid+"_4');\">All Branches</a>"}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;">'+(an?'<a id="mp_rs_'+(ac+1)+'" href="'+d+"\" onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_company_cid-"+s.param.bid+"_lid-"+s.param.lid+"_2'); "+l+'">Map View</a> | ':"")+"<a  onclick=\"record_stats_new('auto_suggest', '"+keyword+"_company_cid-"+s.param.bid+"_lid-"+s.param.lid+'_3\');" href="'+f+'">Profile view</a> '+E+"</div>"}else{if(Q=="Zone"){O='<span style="color: #99f">'+Q+"</span>";var S=encodeURIComponent(s.value);S=S.replace(/%20/gi,"+");S=S.replace("+District","");if(window.MapAPI){f="javascript:void(0);";l="showZone('"+S+"');load_menu_tab('','','','&zonename="+S+"'); as_json_main_search.hideList(); return false;"}else{f="http://"+location.hostname+"/asia_travel/travel/travel_main.php?zonename="+S;l="MapAPI.viewport.setLevel(13); as_json_main_search.hideList(); return false;"}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="'+f+"\" onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_zone_zn-"+S+"_2');"+l+'">Map View</a></div>'}else{if(Q=="Location"){O='<span style="color: #393">'+Q+"</span>";d="http://"+location.hostname+"/asia_travel/travel/travel_id_"+s.param.pid+"/travel_site_"+s.param.aid+"/";l="as_json_main_search.hideList(); return true;";B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;">'+(an==true?'<a id="mp_rs_'+(ac+1)+'" href="'+d+"\" onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_location_pid-"+s.param.pid+"_aid-"+s.param.aid+"_2'); "+l+'">Map View</a>':"")+"</div>"}else{if(Q=="POI"){O='<span style="color: #393">'+Q+"</span>";if(window.MapAPI){d="javascript:void(0);";l="locclick('"+s.param.x+"','"+s.param.y+"','','','"+s.value+"','',4, '"+s.param.pid+"', '"+s.param.aid+"'); as_json_main_search.hideList(); return false;"}else{d="http://"+location.hostname+"/asiatravel/singaporemap/business/"+s.param.bid+"/"+s.id}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="'+d+"\" onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_poi_catid-"+s.value+"_2');"+l+'">Map View</a></div>'}else{if(Q=="Restaurant"){O='<span style="color: #ee992f">'+Q+"</span>";var K=get_keyword(H);f="http://"+location.hostname+"/restaurants/singapore/reviews/location-"+K+"-"+s.id+".php";if(window.MapAPI){d="javascript:void(0);";l="set_q('"+val2+"');setCatName('"+val2+"'); updateMapIcon('', 'resto', '', "+s.param.eid+", '', '', ''); MapAPI.viewport.setLevel(13);  as_json_main_search.hideList(); return false;"}else{d="http://"+location.hostname+"/asiatravel/singaporemap/restaurant/"+s.param.eid+"/"+s.id+"/";l="as_json_main_search.hideList();"}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="'+d+"\"  onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_resto_resid-"+s.param.eid+"_2');"+l+'">Map View</a> | <a href="'+f+"\" onclick=\"record_stats_new('auto_suggest', '"+keyword+"_resto_resid-"+s.param.eid+"_3');\">Profile View</a></div>"}else{if(Q=="SD Feature"){O='<span style="color: #fc3">'+Q+"</span>";f="http://"+location.hostname+"/"+s.param.o;l="as_json_main_search.hideList();";B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a href="'+f+'"  onclick="'+l+'">Go To Feature</a></div>'}else{if(Q=="Bus Route"){O='<span style="color:#d0a807">Bus Route</span>';if(window.MapAPI){d="#";l="drawBusRoute('"+s.param.o+"',1,1,1); as_json_main_search.hideList(); hideNewDDForm(); dd_remote_button('bus','"+s.param.o+"');return false;"}else{if(s.value.charAt(1)=="B"){d="http://"+location.hostname+"/travel/buses/sbs/"+s.param.o+"/"}else{d="http://"+location.hostname+"/travel/buses/smrt/"+s.param.o+"/"}l="as_json_main_search.hideList();"}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a href="'+d+"\" onclick=\"hideAll(); record_stats_new('auto_suggest', '"+keyword+"_bus_no-"+s.param.o+"_6');"+l+'">Bus Route View</a></div>'}else{if(Q=="Category"){af="record_stats_new('auto_suggest', '"+keyword+"_industry_catid-"+s.param.c+"_1');";O='<span style="color:#d0a807">Industry</span>';var p=get_keyword(H);p=p.replace("'","%27");f="http://"+location.hostname+"/businessfinder/company/"+s.id+"/"+p+"/";url3="";if(s.param.d==1){dir="business"}else{if(s.param.d==2){dir="resto"}else{if(s.param.d==3){dir="property"}}}if(b=="map"){d="javascript:void(0);";l="catclick('"+s.id+"','"+p+"','"+dir+"'); as_json_main_search.hideList(); return false;";a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}else{if(b=="map_view"){if(window.MapAPI){d="javascript:void(0);";l="catclick('"+s.id+"','"+p+"','"+dir+"'); as_json_main_search.hideList(); return false;";a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}else{d="http://"+location.hostname+"/asiatravel/singaporemap/business/-"+s.id+"/"+p+"/";l="as_json_main_search.hideList();";a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}}else{if(b=="businessfinder_company"){url3="http://"+location.hostname+"/businessfinder/company/"+s.id+"/"+p+"/";d="http://"+location.hostname+"/asiatravel/singaporemap/business/-"+s.id+"/"+p+"/";l="as_json_main_search.hideList();";a='"'+url3+'" onclick="hideAll(); '+af+" "+l+'"'}else{if(b=="businessfinder_preview"){url3="http://"+location.hostname+"/businessfinder/preview/"+s.id+"/"+p+"/";d="http://"+location.hostname+"/asiatravel/singaporemap/business/-"+s.id+"/"+p+"/";l="as_json_main_search.hideList();";a='"'+url3+'" onclick="hideAll(); '+af+" "+l+'"'}}}}if(dir=="business"){f="http://"+location.hostname+"/businessfinder/company/"+s.id+"/"+p+"/"}else{if(s.param.bid){f="http://"+location.hostname+"/businessfinder/company/"+s.param.bid+"/"+p+"/"}else{if(dir=="resto"){f="http://"+location.hostname+"/restaurants/resto/"+s.id+"/"+p+"/"}}}B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="'+d+"\" onclick=\"hideAll();  record_stats_new('auto_suggest', '"+keyword+"_industry_catid-"+s.param.c+"_2'); "+l+"\">Map View</a> | <a onclick=\"record_stats_new('auto_suggest', '"+keyword+"_industry_catid-"+s.param.c+'_5\');" href="'+f+'">Directory View</a></div>'}else{if(Q=="Category in Zone"){O='<span style="color:#d0a807">Industry</span>';var p,u;if(s.param.zn&&s.param.cn){p=get_keyword(s.param.cn);u=get_keyword(s.param.zn)}else{var V=new RegExp(/(.*)\b(In|At|near|nearby|near by|around|within|close by|beside|located)\b(.*)/gi);var I=s.value.replace(/[@]/g,"At");I=I.replace(/[\\]/g,"\\");I=I.replace(/[\/]/g,"/");var ab=V.exec(I);if(ab){p=get_keyword(ab[1].replace(/^\s+|\s+$/g,""));u=get_keyword(ab[3].replace(/^\s+|\s+$/g,""))}}f="http://"+location.hostname+"/businessfinder/zone/"+s.param.z+"/"+s.param.c+"/"+p+"/";d="http://"+location.hostname+"/asiatravel/singaporemap/business/-"+s.param.c+"/"+p+"/"+u+"/";B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><a id="mp_rs_'+(ac+1)+'" href="'+d+'" onclick="hideAll();'+l+'">Map View</a> | <a href="'+f+'">Directory View</a></div>';a=d}else{if(Q=="SD Routing"){O='<span style="color:#d0a807">SD Routing</span>';if(window.MapAPI){f="javascript:void(0);";var C=s.id;var t=s.param.lid;var W=s.value;var al="#t/src/c/sdr/alt/1/s/"+C+"/e/"+t+"/w1/0/w2/3/v/"+addslashes(W)+"/o/"+F;var q="onclick=\"getName('"+F+"'); getRoute("+C+", "+t+", 0, 3, '"+addslashes(W)+"'); hideNewDDForm(); dd_remote_button('car',''); return false;\"";var ai="#t/src/c/sdr/alt/2/s/"+C+"/e/"+t+"/w1/1/w2/0/v/"+addslashes(W)+"/o/"+F;var o="onclick=\"getName('"+F+"'); getRoute("+C+", "+t+", 1, 0, '"+addslashes(W)+"'); hideNewDDForm(); dd_remote_button('bus','');  return false;\"";var ag="#t/src/c/sdr/alt/3/s/"+C+"/e/"+t+"/w1/1/w2/1/v/"+addslashes(W)+"/o/"+F;var n="onclick=\"getName('"+F+"'); getRoute("+C+", "+t+", 1, 1, '"+addslashes(W)+"'); hideNewDDForm(); dd_remote_button('mrt','');  return false;\"";var ad="#t/src/c/sdr/alt/4/s/"+C+"/e/"+t+"/w1/1/w2/1/v/"+addslashes(W)+"/o/"+F;var k="onclick=\"getName('"+F+"'); getRoute("+C+", "+t+", 1, 2, '"+addslashes(W)+"'); hideNewDDForm(); dd_remote_button('bus_mrt','');  return false;\"";B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><span style="color:green;">Travel by : </span><a href="'+f+'" '+q+'>Driving Direction</a> | <a href="'+f+'" '+o+'>Bus only</a> | <a href="'+f+'" '+n+'>MRT only</a> | <a href="'+f+'" '+k+">Bus & MRT</a></div>"}else{var C=s.id;var t=s.param.lid;f="http://"+location.hostname+"/routing/automobile_guide/"+C+"_to_"+t+"/major_roads/";d="http://"+location.hostname+"/travel/bus_guide/direction_result/"+C+"_to_"+t+"/minimum_walking_distance/";url3="http://"+location.hostname+"/travel/mrt_guide/direction_result/"+C+"_to_"+t+"/";url4="http://"+location.hostname+"/travel/bus_mrt_guide/direction_result/"+C+"_to_"+t+"/";B='<div id="rs_'+(ac+1)+'" style="'+D+'; padding-bottom: 3px;"><span style="color:green;">Travel by : </span><a href="'+f+'">Driving Direction</a> | <a href="'+d+'">Bus only</a> | <a href="'+url3+'">MRT only</a> | <a href="'+url4+'">Bus & MRT</a></div>'}}}}}}}}}}}}if(Q=="Category"||Q=="Zone"||Q=="SD Feature"){d=f}else{if(Q=="Property"){d=""}else{d=d}}var af;if(Q=="Company"){af="record_stats_new('auto_suggest', '"+keyword+"_company_cid-"+s.param.bid+"_lid-"+s.param.lid+"_1');"}else{if(Q=="Zone"){af="record_stats_new('auto_suggest', '"+keyword+"_zone_zn-"+S+"_1');"}else{if(Q=="Location"){af="record_stats_new('auto_suggest', '"+keyword+"_location_pid-"+s.param.pid+"_aid-"+s.param.aid+"_1');"}else{if(Q=="POI"){af="record_stats_new('auto_suggest', '"+keyword+"_poi_catid-"+s.value+"_1');"}else{if(Q=="Restaurant"){af="record_stats_new('auto_suggest', '"+keyword+"_resto_resid-"+s.param.eid+"_1');"}else{if(Q=="Bus Route"){af="record_stats_new('auto_suggest', '"+keyword+"_bus_no-"+s.param.o+"_1');"}else{if(Q=="Category"){af="record_stats_new('auto_suggest', '"+keyword+"_industry_catid-"+s.param.c+"_1');"}}}}}}}if(a){onclick_all=a}else{if(d==undefined){onclick_all='"'+f+'" '+q}else{if(Q=="Location"||Q=="Bus Route"){onclick_all='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}else{onclick_all='"'+f+'" onclick="hideAll();'+af+" "+l+'"'}}}var c=s.info?'<div style="font-size:10px;">'+s.info+"</div>":"";F='<div style="float:left;"><a href='+onclick_all+' style="color:black; text-decoration:none;" ><div id="rs_title_'+(ac+1)+'" style="font-size:11px;font-weight:bold;">'+F+"</div>"+c+"</a>"+B+'</div><div style="float:right">'+O+"</div>";var ak=_b.DOM.cE("tr",{});var g=_b.DOM.cE("td",{},F,true);g.className="as_nohighlight";g.name=ac+1;g.onmouseover=function(){x.setHighlight(this.name)};ak.appendChild(g);U.appendChild(ak)}A.appendChild(U);ae.appendChild(A);var Z=document.createElement("br");ae.appendChild(Z);var R=!document.layers&&!document.all,ah,aa,Y,T;var L=_b.DOM.getPos(this.fld);if(R){ah=(L.x-3)+"px"}else{ah=(L.x-3)+"px"}aa=(L.y+this.fld.offsetHeight+this.oP.offsety+25)+"px";if(R){Y=(this.fld.offsetWidth+55)+"px"}else{Y=(this.fld.offsetWidth+54)+"px"}gbl.in_list=false;ae.onmouseover=function(){gbl.in_list=true;x.killTimeout()};if(window.addEventListener){ae.addEventListener("DOMMouseScroll",onwheel,false)}ae.onmousewheel=onwheel;ae.onmouseout=function(){gbl.in_list=false};document.getElementsByTagName("body")[0].appendChild(ae);var e=this.fld.offsetHeight+8;var aj=ah;var P=$(this.idAs3);if(P){P.style.cssText="position:absolute;left:"+aj+";top:"+e+"px;padding-top:4px; border-right:1px solid #f3d900; border-bottom:none; border-left:1px solid #f3d900; text-align:center;z-index:10000;width:"+Y+";height:13px;margin:0px;";P.style.backgroundImage='url("http://'+location.hostname+'/img/map/bg-search.gif")';P.style.backgroundRepeat="repeat-x"}else{P=_b.DOM.cE("div",{id:this.idAs3,className:this.oP.className});P.onmouseover=function(){gbl.in_list=true};P.onmouseout=function(){gbl.in_list=false};P.style.cssText="position:absolute;left:"+aj+";top:"+e+"px;padding-top:4px; border-right:1px solid #f3d900; border-bottom:none; border-left:1px solid #f3d900; text-align:center;z-index:10000;width:"+Y+";height:13px;margin:0px;";P.style.backgroundImage='url("http://'+location.hostname+'/img/map/bg-search.gif")';P.style.backgroundRepeat="repeat-x";if(global.show_xz!=1){search_tips()}P.innerHTML=global.temp_searchs;if(P.innerHTML=="undefined"){P.innerHTML="<b>Loading ...</b>"}document.body.appendChild(P)}var j="96%";if(!R){if(ae.offsetHeight>ae.scrollHeight){T="100%";j="300px"}else{T="95%";j="300px"}}else{T="100%"}A.width=T;var y=ae.offsetHeight+60;var am=ah;var N=$(this.idAs2);if(R){suggest_wdth=(this.fld.offsetWidth+65)+"px"}else{suggest_wdth=(this.fld.offsetWidth+65)+"px"}var J=(this.fld.offsetWidth-99)+"px";if(N){N.style.cssText="position:absolute;left:"+am+";top:"+y+"px;border-left:1px solid #f3d900;border-right:1px solid #f3d900;border-bottom:1px solid #f3d900;border-top:0px solid #f3d900;z-index:10000;width:"+suggest_wdth+";height:24px;padding:0px;margin:0px;"}else{N=_b.DOM.cE("div",{id:this.idAs2});var G="http://"+location.hostname+"/feedback_company.php";N.style.cssText="position:absolute;left:"+am+";top:"+y+"px;border-left:1px solid #f3d900;border-right:1px solid #f3d900;border-bottom:1px solid #f3d900;border-top:0px solid #f3d900;z-index:10000;width:"+suggest_wdth+";height:24px;padding:0px;margin:0px;";N.style.backgroundImage='url("http://'+location.hostname+'/img/search/background-repeat.gif")';N.style.backgroundRepeat="repeat-x";var ao=this.fld.value.length>50?this.fld.value.substr(0,47)+"...":this.fld.value;var M="http://"+location.hostname+"/img/search/close-button.gif";var X='<img src="'+M+'" style="position:relative;top:7px;left:'+J+';" name="cls_btn" onMouseOver="activate()"  onMouseOut="deactivate()" onClick="unactive()"/></div>';var h=encodeURIComponent(this.fld.value);h=h.replace("%20","+");N.innerHTML='<div style="position:relative;"><div style="position:absolute;left: 0px; top:-10px; width:575px;"><div style="padding-left:5px;padding-top:3px;font-family:arial;font-size:11px;"><b><a class="sgs" href="'+G+'">Submit Businesses Info</a></b>'+X+"</div></div></div>";document.body.appendChild(N)}ae.style.borderBottom="0";this.iHigh=0;ae.style.left=ah;ae.style.top=aa;ae.style.width=Y;var x=this;this.toID=setTimeout(function(){hideXsearch();x.clearSuggestions()},this.oP.timeout)};_b.AutoSuggest.prototype.createListddformrouting=function(a,D){var u=this;_b.DOM.remE(this.idAs);_b.DOM.remE(this.idAs2);_b.DOM.remE(this.idAs3);this.killTimeout();if(!global.promo_tab_autosuggest){if(a.length==0&&!this.oP.shownoresults){return false}}var h=!document.layers&&!document.all,q,n,k,v;var o=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});o.style.cssText="overflow-x: hidden";if(!h){u.isMouseDown=false;o.onmousedown=function(i){u.isMouseDown=true;return false}}var z=_b.DOM.cE("table",{id:"as_table",cellSpacing:0,cellPadding:2,border:0});var b=_b.DOM.cE("tbody",{id:"as_tbody"});var t=a.length,w;w="display: block";if(t!=0){for(var x=0;x<t;x++){row=a[x];if(row.param&&row.param.ct==1){val="[Bus Stop] "+row.value}else{val=row.value}str_cat="";cat=get_cat_type_name(row.type);if(cat=="Property"){str_cat='<span style="color:#AD0945">Property</span>'}else{if(cat=="Company"){str_cat='<span style="color:#CC9900">Company Name</span>'}else{if(cat=="Zone"){str_cat='<span style="color: #99f">'+cat+"</span>"}else{if(cat=="Location"){str_cat='<span style="color: #393">'+cat+"</span>"}else{if(cat=="Restaurant"){str_cat='<span style="color: #ee992f">'+cat+"</span>"}else{if(cat=="SD Feature"){str_cat='<span style="color: #fc3">'+cat+"</span>"}else{if(cat=="Bus Route"){str_cat='<span style="color:#d0a807">Bus Route</span>'}else{if(cat=="Category"){str_cat='<span style="color:#d0a807">Industry</span>'}else{if(cat=="Category in Zone"){str_cat='<span style="color:#d0a807">Industry</span>'}else{if(cat=="SD Routing"){str_cat='<span style="color:#d0a807">SD Routing</span>'}}}}}}}}}}val_info=row.info;if(D=="routing"){if(cat=="Company"){if(val_info.length>29){val_info=val_info.substr(0,25)+"..."}if(val.length>28){g=val.substr(0,24)+"..."}else{g=val}}else{if(val_info.length>33){val_info=val_info.substr(0,29)+"..."}if(val.length>29){g=val.substr(0,24)+"..."}else{g=val}}}else{if(D=="routing_result"){if(cat=="Company"){if(!global.promo_tab_autosuggest){if(val_info.length>39){val_info=val_info.substr(0,35)+"..."}if(val.length>39){g=val.substr(0,35)+"..."}else{g=val}}else{if(val_info.length>43){val_info=val_info.substr(0,39)+"..."}if(val.length>43){g=val.substr(0,39)+"..."}else{g=val}}}else{if(!global.promo_tab_autosuggest){if(val_info.length>26){val_info=val_info.substr(0,22)+"..."}if(val.length>26){g=val.substr(0,22)+"..."}else{g=val}}else{if(val_info.length>43){val_info=val_info.substr(0,39)+"..."}if(val.length>43){g=val.substr(0,39)+"..."}else{g=val}}}}else{if(D=="travel"){if(val_info.length>43){val_info=val_info.substr(0,39)+"..."}if(val.length>35){g=val.substr(0,31)+"..."}else{g=val}}else{if(D=="bus_bubble"){if(val_info.length>43){val_info=val_info.substr(0,39)+"..."}if(val.length>31){g=val.substr(0,27)+"..."}else{g=val}}}}}var l=val_info?'<div style="font-size:10px;">'+val_info+"</div>":"";g='<div style="float:left;"><div style="font-size:11px;font-weight:bold;">'+g+"</div>"+l+'</div><div style="float:right; text-align:right;font-size:10px;">'+str_cat+"</div>";var c=_b.DOM.cE("tr",{});var f=_b.DOM.cE("td",{},g,true);f.className="as_nohighlight";f.name=x+1;f.onclick=function(){u.setHighlightedValue();u.hideList();return false};f.onmouseover=function(){u.setHighlight(this.name)};c.appendChild(f);b.appendChild(c)}}else{if(document.getElementById("dd_result_from").value!=""){var y=document.getElementById("dd_result_from").value;var g='<div style="float:left;" onclick="document.getElementById(\'ndetail\').style.display=\'block\';"><div style="font-size:11px;font-weight:bold;">\''+y+"' is not found! click to add new company</div></div>"}var c=_b.DOM.cE("tr",{});var f=_b.DOM.cE("td",{},g,true);f.className="as_nohighlight";f.name=x+1;c.appendChild(f);b.appendChild(c)}z.appendChild(b);o.appendChild(z);var A=navigator.appVersion.split("MSIE"),d=parseFloat(A[1]),C=navigator.appName;var p=(C=="Microsoft Internet Explorer"),s=p&&(d>=5.5)&&(d<7),r=p&&(d=7);if(!h){if(o.offsetHeight>o.scrollHeight){v="100%"}else{if(D=="routing"){if(p){if(s){v="94%"}else{if(r){v="100%"}}}}else{if(D=="routing_result"){if(p){if(s){v="93%"}else{if(r){v="100%"}}}}else{if(D=="travel"){if(p){if(s){v="94%"}else{if(r){v="94%"}}}}else{if(D=="bus_bubble"){if(p){if(s){v="94%"}else{if(r){v="94%"}}}}}}}}}else{v="100%"}z.width=v;var B=document.createElement("br");o.appendChild(B);var e=_b.DOM.getPos(this.fld);var m=location.pathname.split("/");var j=m[1];if(m[2]==""){j=m[1]}else{j=m[2]}if(D=="routing"){if(j=="travel"){if(h){q=e.x+"px"}else{if(p){if(s){q=e.x+"px"}else{if(r){q=e.x+"px"}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety+3)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety+0)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+2)+"px"}}}}if(h){k=(this.fld.offsetWidth+0)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+0)+"px"}else{if(r){k=(this.fld.offsetWidth+0)+"px"}}}}}else{if(j=="mrt_guide"||j=="bus_guide"||j=="busmrt_guide"){if(h){q=(e.x-4)+"px"}else{if(p){if(s){q=(e.x-3)+"px"}else{if(r){q=(e.x-4)+"px"}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety+5)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}}}}if(h){k=(this.fld.offsetWidth+17)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+27)+"px"}else{if(r){k=(this.fld.offsetWidth+28)+"px"}}}}}else{if(h){q=(e.x+3)+"px"}else{if(p){if(s){q=(e.x+3)+"px"}else{if(r){q=(e.x+2)+"px"}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety-3)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety-5)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety-3)+"px"}}}}if(h){k=(this.fld.offsetWidth+2)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+1)+"px"}else{if(r){k=(this.fld.offsetWidth+3)+"px"}}}}}}}else{if(D=="routing_result"){if(h){q=(e.x-4)+"px"}else{if(p){if(s){q=e.x-5+"px"}else{if(r){q=e.x-4+"px"}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety+5)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety+3)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+7)+"px"}}}}if(h){k=(this.fld.offsetWidth+16)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+14)+"px"}else{if(r){k=(this.fld.offsetWidth+15)+"px"}}}}}else{if(D=="travel"){if(global.bus_suggest=="bus_route"){if(h){q=(e.x-30)+"px"}else{if(p){if(s){q=e.x-31+"px"}else{if(r){q=e.x-32+"px"}}}}}else{if(global.bus_suggest=="normal_route"){if(h){q=(e.x-66)+"px"}else{if(p){if(s){q=e.x-65+"px"}else{if(r){q=e.x-65+"px"}}}}}else{if(h){q=(e.x-64)+"px"}else{if(p){if(s){q=e.x-66+"px"}else{if(r){q=e.x-63+"px"}}}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety+5)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}}}}if(h){k=(this.fld.offsetWidth+117)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+116)+"px"}else{if(r){k=(this.fld.offsetWidth+117)+"px"}}}}}else{if(D=="bus_bubble"){if(h){q=(e.x-66)+"px"}else{if(p){if(s){q=e.x-66+"px"}else{if(r){q=e.x-66+"px"}}}}if(h){n=(e.y+this.fld.offsetHeight+this.oP.offsety+5)+"px"}else{if(p){if(s){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"px"}}}}if(h){k=(this.fld.offsetWidth+107)+"px"}else{if(p){if(s){k=(this.fld.offsetWidth+107)+"px"}else{if(r){k=(this.fld.offsetWidth+107)+"px"}}}}}}}}o.style.border="1px solid #ccc";o.onmouseover=function(){u.killTimeout()};o.onmousewheel=onwheel;o.onmouseout=function(){u.resetTimeout()};document.getElementsByTagName("body")[0].appendChild(o);this.iHigh=0;o.style.left=q;o.style.top=n;o.style.width=k;var u=this;this.toID=setTimeout(function(){hideXsearch();u.clearSuggestions()},this.oP.timeout)};_b.AutoSuggest.prototype.changeHighlight=function(c){var e=_b.DOM.gE("as_tbody");if(!e){return false}if(!this.submitEventChanged){_b.DOM.gE("fSdSearch").onsubmit=function(h){return false};this.submitEventChanged=true}var g,a=5,b=this.iHigh;if(c==40){g=this.iHigh+1}else{if(c==38){g=this.iHigh-1}}if(g>e.childNodes.length){g=e.childNodes.length}if(g<1){g=1}var d=$(this.idAs);var f=e.childNodes[g-1].childNodes[0];if(c==40&&f.offsetTop+f.offsetHeight>d.scrollTop+d.offsetHeight){d.scrollTop=f.offsetTop+f.offsetHeight-d.offsetHeight+12}else{if(c==38&&f.offsetTop<d.scrollTop){d.scrollTop=f.offsetTop}}this.setHighlight(g)};_b.AutoSuggest.prototype.setHighlight=function(c){var b=_b.DOM.gE("as_tbody");gbl.last_move=c;if(!b){return false}if(this.iHigh>0){this.clearHighlight()}this.iHigh=Number(c);var a=b.childNodes[this.iHigh-1];a.childNodes[0].className="as_highlight";this.killTimeout()};_b.AutoSuggest.prototype.clearHighlight=function(){var b=_b.DOM.gE("as_tbody");if(!b){return false}if(this.iHigh>0){var a=b.childNodes[this.iHigh-1];a.childNodes[0].className="as_nohighlight";this.iHigh=0}};_b.AutoSuggest.prototype.setHighlightedValue=function(){if(this.iHigh){if(this.aSug[this.iHigh-1]){var a=this.aSug[this.iHigh-1].info?(this.aSug[this.iHigh-1].value?", ":"")+this.aSug[this.iHigh-1].info.replace("Add :",""):"";this.sInp=this.fld.value=this.aSug[this.iHigh-1].value+a}this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInp.length,this.sInp.length)}hideXsearch();this.clearSuggestions();if(typeof(this.oP.callback)=="function"){this.oP.callback(this.aSug[this.iHigh-1])}}};_b.AutoSuggest.prototype.killTimeout=function(){clearTimeout(this.toID)};_b.AutoSuggest.prototype.resetTimeout=function(){clearTimeout(this.toID);var a=this;this.toID=setTimeout(function(){hideXsearch();a.clearSuggestions()},1000)};_b.AutoSuggest.prototype.clearSuggestions=function(){this.killTimeout();var c=_b.DOM.gE(this.idAs);var g=_b.DOM.gE(this.idAs2);var f=_b.DOM.gE(this.idAs3);var e=this;_b.DOM.gE("fSdSearch").onsubmit=function(h){return false};this.submitEventChanged=false;if(c){var d=new _b.Fader(c,1,0,250,function(){_b.DOM.remE(e.idAs)})}if(g){var b=new _b.Fader(g,1,0,250,function(){_b.DOM.remE(e.idAs2)})}if(f){var a=new _b.Fader(f,1,0,250,function(){_b.DOM.remE(e.idAs3)})}};if(typeof(_b.Ajax)=="undefined"){_b.Ajax={}}_b.Ajax=function(){this.req={};this.isIE=false};_b.Ajax.prototype.makeRequest=function(c,b,a,d){if(b!="POST"){b="GET"}this.onComplete=a;this.onError=d;var e=this;if(window.XMLHttpRequest){this.req=new XMLHttpRequest();this.req.onreadystatechange=function(){e.processReqChange()};this.req.open("GET",c,true);this.req.send(null)}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req){this.req.onreadystatechange=function(){e.processReqChange()};this.req.open(b,c,true);this.req.send()}}}};_b.Ajax.prototype.processReqChange=function(){if(this.req.readyState==4){if(this.req.status==200){this.onComplete(this.req)}else{this.onError(this.req.status)}}};if(typeof(_b.DOM)=="undefined"){_b.DOM={}}_b.DOM.cE=function(g,c,b,f){var h=document.createElement(g);if(!h){return 0}for(var d in c){h[d]=c[d]}var e=typeof(b);if(e=="string"&&!f){h.appendChild(document.createTextNode(b))}else{if(e=="string"&&f){h.innerHTML=b}else{if(e=="object"){h.appendChild(b)}}}return h};_b.DOM.gE=function(c){var a=typeof(c);if(a=="undefined"){return 0}else{if(a=="string"){var b=document.getElementById(c);if(!b){return 0}else{if(typeof(b.appendChild)!="undefined"){return b}else{return 0}}}else{if(typeof(c.appendChild)!="undefined"){return c}else{return 0}}}};_b.DOM.remE=function(a){var b=this.gE(a);if(!b){return 0}else{if(b.parentNode.removeChild(b)){return true}else{return 0}}};_b.DOM.getPos=function(c){var c=this.gE(c);var b=c;var d=0;if(b.offsetParent){while(b.offsetParent){d+=b.offsetLeft;b=b.offsetParent}}else{if(b.x){d+=b.x}}var b=c;var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return{x:d,y:a}};if(typeof(_b.Fader)=="undefined"){_b.Fader={}}_b.Fader=function(b,f,e,a,d){if(!b){return 0}this.e=b;this.from=f;this.to=e;this.cb=d;this.nDur=a;this.nInt=50;this.nTime=0;var c=this;this.nID=setInterval(function(){c._fade()},this.nInt)};_b.Fader.prototype._fade=function(){this.nTime+=this.nInt;var a=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);var c=a/100;if(this.e.filters){try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=a}catch(b){this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")"}}else{this.e.style.opacity=c}if(this.nTime==this.nDur){clearInterval(this.nID);if(this.cb!=undefined){this.cb()}}};_b.Fader.prototype._tween=function(e,a,g,f){return a+((g-a)*(e/f))};function get_cat_type_name(b){var a="";switch(b){case 1:a="Location";break;case 2:a="Company";break;case 3:a="Restaurant";break;case 4:a="Category";break;case 5:a="Zone";break;case 6:a="SD Feature";break;case 7:a="Bus Route";break;case 8:a="Category in Zone";break;case 9:a="SD Routing";break;case 10:a="POI";break}return a}function get_keyword(a){a=a.replace(/[&\(\)]/g,"");a=a.replace(/[\+\-,\/ ]/g,"_");a=a.replace(/%20/g,"_");return a}var options_search={script:function(d){d=d.replace(/ /gi,"+");d=d.replace(/%20/gi,"+");if(window.MapAPI){if($("current_place")){var b=$("current_place").innerHTML.replace(/ /gi,"+");return"http://"+location.hostname+"/asia_travel/search/search_location.php?v=2&q="+d+global_clear_cache+"&curr_place="+b+"&l="+MapAPI.viewportInfo.levelIndex}else{return"http://"+location.hostname+"/asia_travel/search/search_location.php?v=2&main=1&q="+d+global_clear_cache+"&l="+MapAPI.viewportInfo.levelIndex}}else{if($("current_place")){var a,e,b=$("current_place").innerHTML.replace(/ /gi,"+");var c=getLastPos();if(window.MapAPI){a=MapAPI.viewport.centerScreen.x;e=MapAPI.viewport.centerScreen.y}return"http://"+location.hostname+"/asia_travel/search/search_location.php?v=2&q="+d+global_clear_cache+"&curr_place="+b+"&l=10&x="+a+"&y="+e}else{return"http://"+location.hostname+"/asia_travel/search/search_location.php?v=2&q="+d+(window.MapAPI?global_clear_cache:"")}}},varname:"q",json:true,shownoresults:false,timeout:300000,minchars:1,maxresults:10,callback:function(a){if(a){return false}}};if(location.pathname.indexOf("/realestate/")==-1||location.pathname.indexOf("/jobs/")!=0){var as_json_main_search=new bsn_main_search.AutoSuggest("q",options_search)}function activate(){document.images.cls_btn.src="http://"+location.hostname+"/img/search/close-button-hover.gif";document.images.cls_btn.style.cursor="pointer"}function deactivate(){document.images.cls_btn.src="http://"+location.hostname+"/img/search/close-button.gif"}function unactive(){as_json_main_search.hideList()}function cancelEvent(a){a=a?a:window.event;if(a.stopPropagation){a.stopPropagation()}if(a.preventDefault){a.preventDefault()}a.cancelBubble=true;a.cancel=true;a.returnValue=false;return false}function closebutton(){_b.DOM.remE(this.idAs);_b.DOM.remE(this.idAs2);_b.DOM.remE(this.idAs3);return false}function catclick(c,b,a){cat_name_url=str_replace("_"," ",b);setCatName(cat_name_url);change_title("","","","","","","","","","","","","","","",c,b);updateMapIcon(c,a,"","","","","","","","","",true,false,"")}function bizclick(m,l,p,o,j,q,h,k,f,a,e,r){var s=q?(o?", ":"")+q.replace("Add :",""):"";set_q(o+s);global.dir_nearby="business";global.bid_nearby=p;global.lid_nearby=h;if($("td_greymenu")){$("td_greymenu").innerHTML=""}if($("arrow_pointer_div")){hide_element("arrow_pointer_div")}hide_element("default_side");var i=MapAPI.projection.metricToGeo(m,l);var c=i.lon;var g=i.lat;if(icons.icons.web){icons.remove_group("web")}resetIcon();global.data_ajax="";web=icons.create({css:"free_marker",w:32,h:32,left:248,top:108,x:c,y:g,cursor:"pointer",offset_x:17,offset_y:16},"web");as_json_main_search.hideList();if("nearby_last_idx" in global){global.nearby_last_idx=0}if($("preview_detail")){close_compMinisite()}if(a>1){if(e==1){global.branch_search="biz_prem";change_title("","","","","","","business",p,"","","","",a,e,r);activeTabMapview();$("content_header_listing").style.display="none";updateMapIcon("","business","",p,"","","","","","","",true,false,"",{showloading:false});MapAPI.setCenter(new GeoPoint(103.81682020417014,1.3348813408286913),7)}else{global.branch_search="biz";change_title("","","","","","","business",p,"","","","",a,e,r);activeTabMapview();$("content_header_listing").style.display="none";updateMapIcon("","business","",p,"","","","","","","",true,false,"",{showloading:false});MapAPI.setCenter(new GeoPoint(103.81682020417014,1.3348813408286913),7)}}else{var b=function(u){if(u){var t=u.split(",");setCatName(j);if(t[0]=="biz_prem"){change_title("","","","","","","business",p,"","",t[0],"","","",r);if($("content_header_listing").style.display=="block"){$("content_header_listing").style.display="none"}setcenter_businessimg(k,f,c,g,p,t[0],j,h)}else{change_title("","","","","","","business",p,"","",t[0],t[1],"","",r);var v=function(){updateMapIcon(t[1],"business","","","","","","","","","",true,false,"",{showloading:false});setcenter_businessimg(k,f,c,g,p,t[0],j,h)};getBussinessDropdown(p,"map",v)}}else{setCatName(j);updateMapIcon("","business","",p,h,"","")}};var n=function(){};var d="http://"+location.hostname+"/asia_travel/mappage/ajax_new/get_bizz_type.php?cid="+p+"&v="+global.v_c+global_clear_cache;ajax(d,b,n);hideNewDDForm();if($("content_lhs")){$("content_lhs").style.display=""}MapAPI.setCenter(new GeoPoint(c,g),13);if($("original_pos")){$("original_pos").innerHTML=c+","+g}global.direction=new Array;global.direction["lid"]=h;global.link_from="";global.link_to=""}load_menu_tab("","","","&businessId="+p)}function locclick(j,h,g,d,n,c,b,i){var e=c?(n?", ":"")+c.replace("Add :",""):"";set_q(n+e);var a,k,m,f;if(j>1000){m=MapAPI.projection.metricToGeo(j,h);a=m.lon;k=m.lat}else{a=j;k=h}var l=(b==undefined||b=="")?13:b;MapAPI.setCenter(new GeoPoint(a,k),l);if(icons.icons.web){icons.remove_group("web")}web=icons.create({css:"free_marker",w:32,h:32,left:248,top:108,x:a,y:k,cursor:"pointer",offset_x:17,offset_y:16},"web");moveStarPosition(MapAPI,new Point(350,300));setCatName(n);cek=false;action_map_loc(g,d,i);if($("ovi")){removeElement("ovi")}if("nearby_last_idx" in global){global.nearby_last_idx=0}hideNewDDForm();if($("content_lhs")){$("content_lhs").style.display=""}}function action_map_loc(b,d,f){var a="http://"+location.hostname+"/asia_travel/mappage/ajax_new";var e=function(h){var j=new Array();j=h.split(",");var g=j[0];var i=j[1];var k=function(){change_title(b,d,g,i,global.fullscreen,"");lhsContent_show("about","","first",b,d)};if(f=="undefined"||f==undefined){directory_cid="place"}else{directory_cid="business"}setcat_title(f,directory_cid);updateMapIcon(g,directory_cid,"","","","","","","","","",true,false,k);global.loadPhotopage="show";global.dir_nearby="location";global.cid_nearby=f};var c=a+"/getCatbizz_PlaceCatId.php?place_id="+b+"&address_id="+d+"&v="+global.v_c+global_clear_cache;ajax(c,e)}function set_q(a){$("q").value=decodeURIComponent(a)}function onwheel(a,b){a=a?a:window.event;a.cancelBubble=true;a.cancel=true;if(!a){a=window.event}if(a.wheelDelta){delta=a.wheelDelta/120}else{if(a.detail){delta=-a.detail/3}}if(b!=undefined){if(delta<0){if(b.scrollTop+b.offsetHeight-delta*24<b.scrollHeight){return true}else{if(b.scrollTop+b.offsetHeight<b.scrollHeight){b.scrollTop=b.scrollHeight-b.offsetHeight}cancelEvent(a);return false}}else{if(delta>0){if(b.scrollTop-(delta)*24>0){return true}else{if(b.scrollTop>0){b.scrollTop=0}cancelEvent(a);return false}}}}else{if(delta<0){if(this.scrollTop+this.offsetHeight-delta*24<this.scrollHeight){return true}else{if(this.scrollTop+this.offsetHeight<this.scrollHeight){this.scrollTop=this.scrollHeight-this.offsetHeight}cancelEvent(a);return false}}else{if(delta>0){if(this.scrollTop-(delta)*24>0){return true}else{if(this.scrollTop>0){this.scrollTop=0}cancelEvent(a);return false}}}}}function getName(a){as_json_main_search.clearSuggestions();$("q").value=a}function getRoute(link_id1,link_id2,mode,weight,q){hideAll();if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}var projection=(MapAPI.viewportInfo.levelIndex>4)?"WGS":"Mercator";if(x){x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var xylist=eval("("+x.responseText+")");if(xylist==""){alert("Sorry, we have no route information")}else{var x1=xylist.source.x;var y1=xylist.source.y;var x2=xylist.destination.x;var y2=xylist.destination.y;var wgs_projection=(new SD.projection.Server()).get("UTM WGS-1984 48N");var lonlat1=wgs_projection.metricToGeo(x1,y1);var lonlat2=wgs_projection.metricToGeo(x2,y2);if(mode==undefined){mode=1}if(weight==undefined){weight=0}routing.setMode(mode,weight);var startPin=routing.addMarker({marker:"start",x:lonlat1.lon,y:lonlat1.lat});var endPin=routing.addMarker({marker:"end",x:lonlat2.lon,y:lonlat2.lat});MapAPI.setCenter(lonlat1,get_level());global.active_list="dd"}}};var url="http://"+location.hostname+"/asia_travel/mappage/ajax/get_xy_linkid.php?link_id1="+link_id1+"&link_id2="+link_id2+"&p="+projection+"&v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null)}}function search_tips(f){if(f!=undefined){var a="?id="+f}else{var a=""}var c;try{c=new XMLHttpRequest()}catch(d){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){alert("Your browser does not support AJAX!");return false}}}var b="http://"+location.hostname+"/asia_travel/search/search_tips.php"+a;c.onreadystatechange=function(){if(c.readyState==4){if($("as3_q")){$("as3_q").innerHTML="<span style='color:#ba0000;'>Today Tip's </span>: Search for "+c.responseText}global.temp_searchs="<span style='color:#ba0000;'>Today Tip's </span>: Search for "+c.responseText}};c.open("GET",b,true);c.send(null);global.show_xz=1}function hideAll(){if($("xmas_div_overlay")){$("xmas_div_overlay").style.display="none"}if(window.m1){m1.hide()}if(window.marathon){marathon.hide()}if($("xmas_div")){$("xmas_div").style.display="none"}if($("content_listing_title")){var a=$("content_listing_title").getElementsByTagName("input");for(var b=0;b<a.length;b++){a[b].checked=false}}}function showXsearch(a){if(document.getElementById("q")){if(a=="search"){if($("q").value.length!=0){show_element("img_x_search")}}else{show_element("img_x_search")}}}function hideXsearch(a){if(document.getElementById("q")){hide_element("img_x_search");if($("q")){$("q").value=""}}}var body=document.getElementsByTagName("body")[0];body.onmousedown=function(){if(location.pathname.indexOf("/realestate/")==-1||location.pathname.indexOf("/jobs/")==-1){if(!gbl.in_list){as_json_main_search.clearSuggestions()}}};function $(a){return document.getElementById(a)}function show_element(a){if($(a)){$(a).style.display="block"}}function hide_element(a){if($(a)){$(a).style.display="none"}}function inNumOnly(b){var a=b.charCode?b.charCode:b.keyCode;return((a>=48&&a<=57)||a==36||a==35||a==46||a==13||a==8)}function strTrim(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}function GoFavorite(b,a){if(b!=""){arr=b.split("-");if(arr[0]!="00"){location=arr[1]+"&abddr_id="+arr[0]+a}else{location=arr[1]+a}}}function ShowMap(){if(document.selFav.value!=""){var b=document.selFav.value;var a=/^\d+$/;if(a.test(b)){location="/addressbook/getaddress.php?id="+b}else{location=b}}}function ShowAddress(a,b){if(b!=""){location=a+"/addressbook/newaddressbook.php?abaddr_id="+b+"&abedit=1"}else{alert("Choose Address First")}}var countryInterval="";function showDropMenu1(){show_element("dropMenu1");show_element("tblDropMenu1")}function showPropAds(){show_element("dropMenuPropAds");show_element("tblDropMenuPropAds")}function show_help(){if($("box_search_more_up").style.display=="none"){hide_element("box_search_more");show_element("box_search_more_up");show_element("show_help")}else{show_element("box_search_more");hide_element("box_search_more_up");hide_element("show_help")}}function searchbox_hover(a){if(a==1){$("box_search_left").style.backgroundPosition="-7px -543px";$("box_search_repeat").style.backgroundPosition="0px -35px";$("box_search_right").style.backgroundPosition="-7px -581px"}else{if(mainsearch_focus==false){$("box_search_left").style.backgroundPosition="0px -543px";$("box_search_repeat").style.backgroundPosition="0px 0px";$("box_search_right").style.backgroundPosition="0px -581px"}}}function relatedPlace(b,a){if($("hideRelated").style.display=="none"){show_element("hideRelated");hide_element("showRelated");if(global.city==undefined&&(a==undefined||a=="businessfinder")){moreEgOver("close",a)}if(global.fullscreen){$("fs_bg").style.height="107px";$("photo_satelite_map").style.top="109px";$("closefs").style.top="109px"}}else{hide_element("hideRelated");show_element("showRelated");if(global.city==undefined&&(a==undefined||a=="businessfinder")){moreEgOver("open",a)}if(global.fullscreen){$("fs_bg").style.height="144px";$("photo_satelite_map").style.top="146px";$("closefs").style.top="146px"}}}function moreEgOver(a,b){if(a=="over"){if($("moreEg").style.backgroundPosition=="-241px -88px"){$("moreEg").style.backgroundPosition="-253px -81px"}else{if(b=="businessfinder"&&$("moreEg").style.backgroundPosition=="-262px -7px"){$("moreEg").style.backgroundPosition="-273px 0px"}}}else{if(a=="out"){if($("moreEg").style.backgroundPosition=="-253px -81px"){$("moreEg").style.backgroundPosition="-241px -88px"}else{if(b=="businessfinder"&&$("moreEg").style.backgroundPosition=="-273px 0px"){$("moreEg").style.backgroundPosition="-262px -7px"}}}else{if(a=="close"){if(b=="businessfinder"){$("moreEg").style.backgroundPosition="-241px -88px"}else{$("moreEg").style.backgroundPosition="-241px -88px"}}else{if(a=="open"){if(b=="businessfinder"){$("moreEg").style.backgroundPosition="-241px -81px"}else{$("moreEg").style.backgroundPosition="-241px -81px"}}}}}}function showMenuCountry(b,a){if(b=="show"){show_element("divCountryBox")}else{hide_element("divCountryBox")}}function showMenuId(c,d,b,e,a){if(c=="show"){if(a==1){show_element_ajax(d)}show_element(d);hide_element(b);show_element(e)}else{hide_element(d);hide_element(e);show_element(b)}}function show_element_ajax(c){if(c){var b;try{b=new XMLHttpRequest()}catch(d){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){alert("Your browser does not support AJAX!");return false}}}var a;if(global.fullscreen){a="http://"+location.hostname+"/asia_travel/mappage/ajax/dropzone.php?fullscreen=1"+global_clear_cache+"&v="+global.v_c}else{a="http://"+location.hostname+"/asia_travel/mappage/ajax/dropzone.php?"+global_clear_cache+"&v="+global.v_c}b.onreadystatechange=function(){if(b.readyState==4){$(c).innerHTML=b.responseText}};b.open("GET",a,true);b.send(null)}global.show_ajax_box=1}function showMenuIndonesiaCity(b,a){if(b=="show"){show_element("divCityBox")}else{hide_element("divCityBox")}}function showMenuDistrict(b,a){if(b=="show"){show_element("divDistrictBox")}else{hide_element("divDistrictBox")}}function showMenuLink(a){if(a=="show"){hide_element("hideLink");show_element("showLink")}else{show_element("hideLink");hide_element("showLink")}}function showDropSubmit(){obj=document.getElementById("dropSubmit");obj.style.display="block";obj=document.getElementById("tblDropSubmit");obj.style.display="block"}function hideDropSubmit(){obj=document.getElementById("dropSubmit");obj.style.display="none";obj=document.getElementById("tblDropSubmit");obj.style.display="none"}function checkMouseLeave(b,a){var a=window.event||a;if(b.contains&&a.toElement){return !b.contains(a.toElement)}else{if(a.relatedTarget){return !containsDOM(b,a.relatedTarget)}}}function checkMouseEnter(b,a){var a=window.event||a;if(b.contains&&a.fromElement){return !b.contains(a.fromElement)}else{if(a.relatedTarget){return !containsDOM(b,a.relatedTarget)}}}function containsDOM(a,c){var b=false;do{if((b=a==c)){break}try{c=c.parentNode}catch(d){c=null}}while(c!=null);return b}function submitSearch(g){f=document.fSdSearch;if(f.q.value==""||f.q.value=="Find Businesses, Addresses or Products & Services here"){if($("travel_from")&&$("travel_to")){if($("travel_from").value!=""||$("travel_to").value!=""){alert("Please Select Option Below")}else{alert("You have not entered a keyword \n\n\n Try any of these keywords:\n\n a. Products and Services e.g Reflexology, Beauty\n b. Company Name e.g Asta Spa, Charles & Keith\n c. Addresses e.g Marina Bay Sands, Orchard Rd\n d. Bus Services Number e.g Bus 14\n e. Any Landmark in Singapore e.g Merlion, Beach")}}else{alert("You have not entered a keyword \n\n\n Try any of these keywords:\n\n a. Products and Services e.g Reflexology, Beauty\n b. Company Name e.g Asta Spa, Charles & Keith\n c. Addresses e.g Marina Bay Sands, Orchard Rd\n d. Bus Services Number e.g Bus 14\n e. Any Landmark in Singapore e.g Merlion, Beach")}f.q.focus();return false}else{var e=f.q.value,c,b="";if($("rs_1")){if($("mp_rs_1")){if(($("rs_1")&&!$("rs_2"))||$("rs_title_1").innerHTML.toLowerCase()==e.toLowerCase()){if($("mp_rs_1").href!="javascript:void(0);"&&$("mp_rs_1").href!="#"){location.href=$("mp_rs_1").href;return false}else{if(!window.MapAPI){location.href=$("mp_rs_1").href}else{$("mp_rs_1").onclick();f.q.blur()}return false}return false}}}if(f.search_type){c=f.search_type[0].checked?1:2;b=c?"&t="+c:""}e=encodeURIComponent(e);e=e.replace(/%20/gi,"+");if(f.action.indexOf("company_listing")>0){var a=f.action+"?companyname="+e+""+b}else{var a=f.action+"?q="+e+""+b}if(g==1){a+="&d=1"}location.href=a}}var mainsearch_focus=false,mainsearch_hover=false,mainsearch_state=0,flagHeader=0;function mainSearchFocus(a,e,c,b,d){if(!b&&a.value==c){a.value=""}a.style.color="#000000";mainsearch_focus=true;if(d!=""){updateSearchBox(e,d)}a.select()}function mainSearchBlur(a,d,b,c){a.style.color="#949494";mainsearch_focus=false;if(c!=""){updateSearchBox(d,c)}if(a.value==""){a.value=b}}function updateSearchBox(b,a){if(mainsearch_state==0&&(mainsearch_focus||mainsearch_hover)){if(a=="map"){b.style.background="url(/img/search_bar.png) -92px -42px no-repeat"}else{if(a=="businessfinder"){b.style.background='url("/img/map/text-box-hover.gif") no-repeat scroll 0 0 transparent'}else{b.style.background="url(/img/business_finder/searchbar_bizfinder.png) -92px -42px no-repeat"}}mainsearch_state=1}else{if(mainsearch_state==1&&(!mainsearch_focus&&!mainsearch_hover)){if(a=="map"){b.style.background=""}else{if(a=="businessfinder"){b.style.background='url("/img/map/text-box.gif") no-repeat scroll 0 0 transparent'}else{b.style.background=""}}mainsearch_state=0}}}function showFlagDrop(){if(flagHeader==0){$("show_flag").style.display="block";flagHeader=1}else{$("show_flag").style.display="none";flagHeader=0}}function hoverFlag(a,b){if(a=="hover"){$("flag"+b).className="imgFlag flag"+b+"Small_hover";$("flag"+b+"text").style.color="#000"}else{$("flag"+b).className="imgFlag flag"+b+"Small";$("flag"+b+"text").style.color="#505050"}}function detectMapName(k,g){var c=new Array(103.609808585,106.336713792,100.183203884,103.600675,102.131124378,99.63196794,114.438986201,101.366505152,103.848996221);var j=new Array(1.47421033298,-5.90996588413,5.53096134452,1.617192,2.34513687652,6.48030861,-8.04351119209,3.2765636314,1.21655296465);var a=new Array(104.088063761,107.315837289,100.550669928,104.008627,102.346197544,99.94706918,115.735151469,101.849828314,104.327250213);var h=new Array(1.19945734487,-6.78535607902,5.21541483438,1.423502,2.1495514102,6.15515457,-8.84114745365,2.71148572587,0.597924020327);var b=new Array("sg","jkt","png","jb","mlk","lkw","bali","kl","btm");var e=0,d=b.length;for(e=0;e<d;e++){if(k>=c[e]&&k<=a[e]&&g>=h[e]&&g<=j[e]){return b[e]}}return false}function showHideDiv(a,b){for(i=0;i<b.length;i++){hide_element(b[i])}for(i=0;i<a.length;i++){show_element(a[i])}}function css_sprite(g,p,e,q,a,b,c,j,l,o){var n=document.createElement("div");b=(b==undefined)?"":"left:"+b+"px;";c=(c==undefined)?"":"top:"+(c)+"px;";n.style.cssText="position:absolute; "+b+c+j;var m=document.createElement("div");m.style.cssText="width:"+p+"px; height:"+e+"px; position: relative; overflow:hidden;";var k=document.createElement("div");j=(j==undefined)?"":j;k.className=g;l=(l==undefined)?1000:l;o=(o==undefined)?1000:o;k.style.cssText="width: "+l+"px; height: "+o+"px; position:absolute; left:"+(-q)+"px; top: "+(-a)+"px;";m.appendChild(k);n.appendChild(m);n.setClassName=function(d){n.childNodes[0].childNodes[0].className=d};n.setBgPosition=function(h,d){n.childNodes[0].childNodes[0].style.left=-h+"px";n.childNodes[0].childNodes[0].style.top=-d+"px"};n.getBgPositionLeft=function(){return n.childNodes[0].childNodes[0].style.left};n.getBgPositionTop=function(){return n.childNodes[0].childNodes[0].style.top};return n}function bookmark(a,c){if(window.sidebar){window.sidebar.addPanel(c,a,"http:www.yourwebsiteurl.com")}else{if(window.opera&&window.print){var b=document.createElement("a");b.setAttribute("href",a);b.setAttribute("title",c);b.setAttribute("rel","sidebar");b.click()}else{if(document.all){window.external.AddFavorite(a,c)}}}}function urlencode(a){a=(a+"").toString();return encodeURIComponent(a).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}function google_adsense(){var a="pub-0142502304201029";var d=new Array();var b;var c=false;this.get_format=function(g){var e;switch(g){case 1:e="200x200";break;case 2:e="468x60";break;case 3:e="300x250";break;case 4:e="234x60";break;default:e="336x280";break}return e};this.load=function(l,h,k,j){var g=l+"_"+h;if(!d[g]){var e={format:this.get_format(k),ad_slot:l,hints:j};d[g]=new google.ads.Ad(a,h,e)}else{if(this.e(h).innerHTML==""){d[g].setContainer(h)}d[g].refresh({hints:j})}};this.load_google=function(){if(!c){if(window.google==undefined){url="http://"+location.hostname+"/asia_travel/mappage/ajax/adsense_lib.php";loadScript(url)}google.load("ads","1");c=true}};this.e=function(e){return document.getElementById(e)};this.load_google()}function showHelpTab(a){if(a==1){for(i=1;i<=4;i++){if(i==a){$("helpTab"+i).style.display="block";$("left"+i).className="left_selected";$("menu"+i).className="menu_selected";$("right"+i).className="right_selected"}else{$("helpTab"+i).style.display="none";$("left"+i).className="left_close";$("menu"+i).className="menu";$("right"+i).className="right_close"}}}else{if(a==2){for(i=1;i<=4;i++){if(i==a){$("helpTab"+i).style.display="block";$("left"+i).className="left_selected";$("menu"+i).className="menu_selected";$("right"+i).className="right_selected"}else{$("helpTab"+i).style.display="none";$("left"+i).className="left_close";$("menu"+i).className="menu";$("right"+i).className="right_close"}}}else{if(a==3){for(i=1;i<=4;i++){if(i==a){$("helpTab"+i).style.display="block";$("left"+i).className="left_selected";$("menu"+i).className="menu_selected";$("right"+i).className="right_selected"}else{$("helpTab"+i).style.display="none";$("left"+i).className="left_close";$("menu"+i).className="menu";$("right"+i).className="right_close"}}}else{if(a==4){for(i=1;i<=4;i++){if(i==a){$("helpTab"+i).style.display="block";$("left"+i).className="left_selected";$("menu"+i).className="menu_selected";$("right"+i).className="right_selected"}else{$("helpTab"+i).style.display="none";$("left"+i).className="left_close";$("menu"+i).className="menu";$("right"+i).className="right_close"}}}}}}}function changeButton(a,b){hide_element(a);show_element(b)}function toggleWindow(c,d,a,b){if($(a)){if($(a+"_clicked").style.display=="block"){hide_element(a+"_clicked");show_element(a);hide_element(b)}}show_element(c+"_clicked");show_element(d);hide_element(c)};var anylinkcssmenu={menusmap:{},effects:{delayhide:200,shadow:{enabled:true,opacity:0.3,depth:[5,5]},fade:{enabled:true,duration:500}},dimensions:{},getoffset:function(B,A){return(B.offsetParent)?B[A]+this.getoffset(B.offsetParent,A):B[A]},getoffsetof:function(A){A._offsets={left:this.getoffset(A,"offsetLeft"),top:this.getoffset(A,"offsetTop"),h:A.offsetHeight}},getdimensions:function(A){this.dimensions={anchorw:A.anchorobj.offsetWidth,anchorh:A.anchorobj.offsetHeight,docwidth:(window.innerWidth||this.standardbody.clientWidth)-20,docheight:(window.innerHeight||this.standardbody.clientHeight)-15,docscrollx:window.pageXOffset||this.standardbody.scrollLeft,docscrolly:window.pageYOffset||this.standardbody.scrollTop};if(!this.dimensions.dropmenuw){this.dimensions.dropmenuw=A.dropmenu.offsetWidth;this.dimensions.dropmenuh=A.dropmenu.offsetHeight}},isContained:function(A,B){var B=window.event||B;var C=B.relatedTarget||((B.type=="mouseover")?B.fromElement:B.toElement);while(C&&C!=A){try{C=C.parentNode}catch(B){C=A}}if(C==A){return true}else{return false}},setopacity:function(A,B){A.style.opacity=B;if(typeof A.style.opacity!="string"){A.style.MozOpacity=B;if(A.filters){A.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+B*100+")"}}},showmenu:function(B){var C=anylinkcssmenu.menusmap[B];clearTimeout(C.hidetimer);this.getoffsetof(C.anchorobj);this.getdimensions(C);var A=C.anchorobj._offsets.left+(C.orientation=="lr"?this.dimensions.anchorw:0);var D=C.anchorobj._offsets.top+this.dimensions.anchorh-(C.orientation=="lr"?this.dimensions.anchorh:0);if(A+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){A=A-this.dimensions.dropmenuw+(C.orientation=="lr"?-this.dimensions.anchorw:this.dimensions.anchorw)}if(D+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){D=Math.max(D-this.dimensions.dropmenuh-(C.orientation=="lr"?-this.dimensions.anchorh:this.dimensions.anchorh),this.dimensions.docscrolly)}if(this.effects.fade.enabled){this.setopacity(C.dropmenu,0);if(this.effects.shadow.enabled){this.setopacity(C.shadow,0)}}C.dropmenu.setcss({left:A+"px",top:D+"px",visibility:"visible"});if(this.effects.shadow.enabled){C.shadow.setcss({left:A+anylinkcssmenu.effects.shadow.depth[0]+"px",top:D+anylinkcssmenu.effects.shadow.depth[1]+"px",visibility:"visible"})}if(this.effects.fade.enabled){clearInterval(C.animatetimer);C.curanimatedegree=0;C.starttime=new Date().getTime();C.animatetimer=setInterval(function(){anylinkcssmenu.revealmenu(B)},20)}},revealmenu:function(B){var C=anylinkcssmenu.menusmap[B];var A=new Date().getTime()-C.starttime;if(A<this.effects.fade.duration){this.setopacity(C.dropmenu,C.curanimatedegree);if(this.effects.shadow.enabled){this.setopacity(C.shadow,C.curanimatedegree*this.effects.shadow.opacity)}}else{clearInterval(C.animatetimer);this.setopacity(C.dropmenu,1);C.dropmenu.style.filter=""}C.curanimatedegree=(1-Math.cos((A/this.effects.fade.duration)*Math.PI))/2},setcss:function(A){for(prop in A){this.style[prop]=A[prop]}},hidemenu:function(A){var B=anylinkcssmenu.menusmap[A];clearInterval(B.animatetimer);B.dropmenu.setcss({visibility:"hidden",left:0,top:0});B.shadow.setcss({visibility:"hidden",left:0,top:0})},getElementsByClass:function(A){if(document.querySelectorAll){return document.querySelectorAll("."+A)}else{var E=new RegExp("(^|\\s+)"+A+"($|\\s+)","i");var D=[];var C=document.all?document.all:document.getElementsByTagName("*");for(var B=0;B<C.length;B++){if(typeof C[B].className=="string"&&C[B].className.search(E)!=-1){D[D.length]=C[B]}}return D}},addEvent:function(A,D,B){if(A.length>0){var C=A.shift();if(C.addEventListener){C.addEventListener(B,D,false)}else{if(C.attachEvent){C.attachEvent("on"+B,function(){return D.call(C,window.event)})}}this.addEvent(A,D,B)}},setupmenu:function(B,D,F){this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;var C=D.getAttribute("rel");var A=C.replace(/\[(\w+)\]/,"");var E=this.menusmap[B+F]={id:B+F,anchorobj:D,dropmenu:document.getElementById(A),revealtype:(C.length!=A.length&&RegExp.$1=="click")?"click":"mouseover",orientation:D.getAttribute("rev")=="lr"?"lr":"ud",shadow:document.createElement("div")};E.anchorobj._internalID=B+F;E.anchorobj._isanchor=true;E.dropmenu._internalID=B+F;E.shadow._internalID=B+F;E.shadow.className="anylinkshadow";document.body.appendChild(E.dropmenu);document.body.appendChild(E.shadow);E.dropmenu.setcss=this.setcss;E.shadow.setcss=this.setcss;E.shadow.setcss({width:E.dropmenu.offsetWidth+"px",height:E.dropmenu.offsetHeight+"px"});this.setopacity(E.shadow,this.effects.shadow.opacity);this.addEvent([E.anchorobj,E.dropmenu,E.shadow],function(G){var H=anylinkcssmenu.menusmap[this._internalID];if(this._isanchor&&H.revealtype=="mouseover"&&!anylinkcssmenu.isContained(this,G)){H.showDelay=setTimeout("anylinkcssmenu.showmenu('"+H.id+"')",300)}else{if(typeof this._isanchor=="undefined"){clearTimeout(H.hidetimer)}}},"mouseover");this.addEvent([E.anchorobj,E.dropmenu,E.shadow],function(G){if(!anylinkcssmenu.isContained(this,G)){var H=anylinkcssmenu.menusmap[this._internalID];H.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(H.id)},anylinkcssmenu.effects.delayhide);clearTimeout(H.showDelay)}},"mouseout");this.addEvent([E.anchorobj,E.dropmenu],function(G){var H=anylinkcssmenu.menusmap[this._internalID];if(this._isanchor&&H.revealtype=="click"){if(H.dropmenu.style.visibility=="visible"){anylinkcssmenu.hidemenu(H.id)}else{anylinkcssmenu.showmenu(H.id)}if(G.preventDefault){G.preventDefault()}return false}else{H.hidetimer=setTimeout(function(){anylinkcssmenu.hidemenu(H.id)},anylinkcssmenu.effects.delayhide)}},"click")},init:function(A){var C=this.getElementsByClass(A);for(var B=0;B<C.length;B++){this.setupmenu(A,C[B],B)}}};function close_advertise(){if(!$("adv-button")){return false}var b=navigator.appVersion.split("MSIE");var a=parseFloat(b[1]);if(a>=5.5&&a<7&&document.body.filters){$("adv-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://"+location.hostname+"/img/map/content/adv-button-submit.png')"}else{$("adv-button").src="http://"+location.hostname+"/img/map/content/adv-button-submit.png"}if($("advertise_form")){$("advertise_form").style.display="none"}}function show_advertise(){close_all_form();var d=navigator.appVersion.split("MSIE");var b=parseFloat(d[1]);if(b>=5.5&&b<7&&document.body.filters){$("adv-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://"+location.hostname+"/img/map/content/adv-button-close.png')"}else{$("adv-button").src="http://"+location.hostname+"/img/map/content/adv-button-close.png"}if(global_advertise_form){$("advertise_form").innerHTML=global_advertise_form;$("advertise_form").style.display="block"}else{if(document.getElementById){var a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(a){a.onreadystatechange=function(){if(a.readyState==4&&a.status==200){global_advertise_form=a.responseText;$("advertise_form").innerHTML=a.responseText;$("advertise_form").style.display="block"}else{$("advertise_form").innerHTML="<div align='right'>Loading...</div>"}};var c="http://"+location.hostname+"/asia_travel/mappage/ajax/show_advertise_form.php?v="+global.v_c;a.open("GET",c,true);a.send(null)}return false}}function change_button_advertise(b){var c=navigator.appVersion.split("MSIE");var a=parseFloat(c[1]);if(b=="out"){if(a>=5.5&&a<7&&document.body.filters){$("adv-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://"+location.hostname+"/img/map/content/adv-button-submit.png')"}else{$("adv-button").src="http://"+location.hostname+"/img/map/content/adv-button-submit.png"}}else{if(b=="over"){if(a>=5.5&&a<7&&document.body.filters){$("adv-button").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://"+location.hostname+"/img/map/content/adv-button-hover.png')"}else{$("adv-button").src="http://"+location.hostname+"/img/map/content/adv-button-hover.png"}}}}if($("adv-button")){var elm=$("adv-button");elm.onmouseover=function(){change_button_advertise("over")};elm.onmouseout=function(){change_button_advertise("out")};elm.onclick=function(){click_button_advertise()}}function click_button_advertise(){if(advertise_flag==0){show_advertise();advertise_flag=1}else{close_advertise();advertise_flag=0}}function submitAdvertise(){var e="";var d=document.getElementById("email").value;single_pattern=new RegExp("^[a-zA-Z0-9]+(([_]|\\.|-)?[a-zA-Z0-9])*@([a-zA-Z0-9]+([_]|-?[a-zA-Z0-9])*(\\.))+[a-zA-Z]{2,4}$");if($("name").value==""){e+="- Name is empty\n"}if($("company").value==""){e+="- Company is empty\n"}if($("designation").value==""){e+="- Designation is empty\n"}if($("mobileNumber").value==""||isNaN($("mobileNumber").value)||$("mobileNumber").value.length<8||parseInt($("mobileNumber").value)==0){e+="- Mobile is invalid\n"}if(d.value==""||d.search(single_pattern)){e+="- Email is invalid\n"}if(e){e="Please enter the missing fields:\n"+e;alert(e);return false}$("buttonSubmit").style.display="none";$("buttonDisable").style.display="block";var c="name="+($("name").value)+"&company="+($("company").value)+"&designation="+($("designation").value);c+="&select_PM="+($("select_PM").value)+"&mobileNumber="+($("mobileNumber").value)+"&email="+($("email").value);if(document.getElementById){var a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(a){a.onreadystatechange=function(){if(a.readyState==4&&a.status==200){$("buttonSubmit").style.display="block";$("buttonDisable").style.display="none";if(a.responseText){$("advertise_form").style.display="none";alert("Thank you for your feedback")}else{alert("An error was occur")}}else{}};var b="http://"+location.hostname+"/asia_travel/mappage/ajax/advertise_process.php?v="+global.v_c;a.open("POST",b,true);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.send(c)}return false};function show_map_page_menu_landmark()
{
	if (!$('scroller_menu')) return;
	if (document.getElementById) {
	var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	}
	if (x)
		{		
			x.onreadystatechange = function()
			{
				if (x.readyState == 4 && x.status == 200)
				{
					$('scroller_menu').innerHTML += x.responseText;
					var options = {
						script: function (cat_q) { 
							var search_file = 'search_category'; 
							return baseurl + "/asia_travel/mappage/ajax/"+search_file+".php?cat_q="+cat_q+'&directory='+global_directory+"&mainCat="+global_main_cat+"&v="+global['v_c']+ global_clear_cache;  
						} ,
						varname:"cat_q",
						json:true,
						shownoresults:false,
						timeout:300000,	
						maxresults:10,
						callback: function (val) { 
							if (val)
							{
								var data = (val.id).split("|");
								setCatName(val.value);
								if(data[3] != "") global_branch_only = 1;
								updateMapIcon(data[0], data[1], data[2], data[3], '', global_branch_only);																		
							}
						}
					};
					var as_json = new bsn_search.AutoSuggest('cat_q', options);	
					var dd_menu = new moving_menu('moving_menu');
					highlightDropdown(global_cat_id, global_directory, global_main_cat, global_business_id);
					if(global['type_menu'] == null) global['type_menu'] = 1;
					//if(is_fullscreen != undefined && is_fullscreen == true) $('below_slidebar').style.display = 'none';
					//var active_menu = document.getElementById('active_menu');
					//active_menu = active_menu.innerHTML;
					//if(active_menu!="")
					//	dd_menu.initScroll(active_menu);
				} 
			};
			var url = "http://"+location.hostname+"/navigation/sdinc_dropdown_content.php?page=landmark&v="+global['v_c'];
			x.open("GET", url, true);
			x.send(null);					
		}			
	return false;
}

function changeTypeMenu_landmark(type)
{
	if ($) {
		var xmlhttp;
		try {
			xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			  catch (e) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		
		var url= 'http://' + location.hostname + '/asia_travel/travel_sites/sdinc_dropdown.php?type='+type+'&v='+global['v_c']+ global_clear_cache;
	
		xmlhttp.onreadystatechange=function() {
			if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
				global_dropdown = null;
				$('drop_down').innerHTML = xmlhttp.responseText;
				show_map_page_menu_landmark((global['fullscreen'] == true)?true:'');
				global['type_menu'] = type;
			}
		}
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
}

function dropMainMenu_landmark(className)
{
	if($('dropmain')){
		$('dropmain').parentNode.removeChild($('dropmain'));
		//$('button_dropmain').className = 'new_menu menu_main_arrow';
	}
	else{
		var div = document.createElement('div'), top;
		div.id = 'dropmain';
		if(SD.isIE6) top = 0;
		else top = 0;
		div.style.cssText = 'position: relative; top: '+top+'px; left: 3px; z-index: 1002;';
		var dropmain = (className == 'menu_title_all')?SD.util.createImgSprite('new_menu', 143, 25, 167, 0, '', '', 'cursor: pointer;', '', '', true):SD.util.createImgSprite('new_menu', 143, 25, 312, 0, '', '', 'cursor: pointer;', '', '', true);
		div.onmousedown = function(){ (className == 'menu_title_all')?changeTypeMenu_landmark(2):changeTypeMenu_landmark(1); this.parentNode.removeChild(this); }
		div.appendChild(dropmain);
		$('mainMenuParent').appendChild(div);
		//$('button_dropmain').className = 'new_menu menu_main_arrow_hover';
	}
}///////Drop//////

var DDSPEED = 1;
var DDTIMER = 0;
var ss;
var dd_last_mouseover = null, dd_last_click = null;
var global_left_dropdown_arrow,global_right_dropdown_arrow;
var global_left_dropdown_arrow_top,global_left_dropdown_arrow_left,global_right_dropdown_arrow_top,global_right_dropdown_arrow_left;

function menu(name, left, right)
{
  this.name = name;
  this.left = left;
  this.right = right;
}

function moving_menu(elm_id)
{
  this.root_id = elm_id;
  this.num_menu = 0;
  this.scroll_timer;
  this.curr_scroll_pos = 0;
  this.dest_scroll_pos = 0;
  this.scrolling_table = document.getElementById(this.root_id + '_table');
  this.scroll_width = parseInt(document.getElementById(this.root_id + '_scroll').style.width);
  this.menus = new Array();
  this.right_menu = 0;
  this.total_width = 0;
  this.divider_width = 2;
  this.scroll_timer = false;
  this.move_direction = 0;

  this.init = function()
  {
    var elmt = $(this.root_id + '_div');
    this.num_menu = elmt.getElementsByTagName('dl').length;
    var tds = this.scrolling_table.getElementsByTagName('th');
    var left = this.scrolling_table.style.left;
    if (left == '') left = 0;
    var init_right = parseInt(left) + this.scroll_width;
    for (var i = 0; i < tds.length; i++)
    {
  	  tds[i].onmouseover = function(e) { if (checkMouseEnter(this,e)) { var self = this; this.timer = setTimeout(function() {ddMenu(self.id, 1); } , 300 ); }} ;
      tds[i].onmouseout = function(e) { if (checkMouseLeave(this,e)) { clearTimeout(this.timer); ddMenu(this.id, -1) } };
      var width = parseInt(tds[i].width) + this.divider_width;
      var left = this.total_width;
      var right = this.total_width + width - 1;
			var name = tds[i].id;
      if (init_right >= left && init_right <= right) this.right_menu = i;
      this.menus.push(new menu(name, left, right));
      this.total_width += width;
    }
		this.curr_scroll_pos = parseInt(this.scrolling_table.style.left);
    this.updateNavigation();
  };

	this.getActivePos = function (active_name){
		pos = 0;
		for (var i = 0; i < this.menus.length; i++){
			menu_name = this.menus[i].name;
			pos = this.menus[i].right;
			if(active_name == menu_name){
				break;
			}
    }
		return pos;
	}

	this.initScroll = function(destination){
		if ( destination != 0 && document.getElementById(destination+'-ddheader')) { //if destination 0 then processing this code...
			document.getElementById(destination+'-ddheader').style.backgroundPosition='0px -829px';
		}
	}

  this.updateNavigation = function()
  {
    var obj = this;
    if (this.scroll_width - this.curr_scroll_pos < this.total_width)
    {
      var right_scroll = $(this.root_id + '_right');
      right_scroll.style.backgroundPosition = '0px -28px';
      right_scroll.style.cursor = 'pointer';
      right_scroll.onmousedown = function()
      {
        obj.startScroll(-1);
		page = (location.pathname.indexOf('/businessfinder/')  != -1) ?  'bf' : 'map'
		dropDownStats('right',page,3,1);
      };
      right_scroll.onmouseup = function()
      {
        obj.stopScroll();
      };
			right_scroll.onmouseover = function()
      {
        setHoverArrow('right')
      };
			right_scroll.onmouseout = function()
			{
				obj.stopScroll();
				setOutArrow('right');
			};
    }
    else
    {
      var right_scroll = $(this.root_id + '_right');
	  right_scroll.style.backgroundPosition = "-36px -28px";
	  right_scroll.style.cursor = 'default';
      right_scroll.onmousedown = null;
      right_scroll.onmouseup = null;
			global_right_dropdown_arrow = right_scroll.src;
			global_right_dropdown_arrow_top = right_scroll.style.top;
			global_right_dropdown_arrow_left = right_scroll.style.left;
    }

    if (this.curr_scroll_pos < 0)
    {
      var left_scroll = $(this.root_id + '_left');
	  left_scroll.style.backgroundPosition = "0px 0px";
      left_scroll.style.cursor = 'pointer';
      left_scroll.onmousedown = function()
      {
		page = (location.pathname.indexOf('/businessfinder/')  != -1) ?  'bf' : 'map'
		dropDownStats('left',page,3,0); 
        obj.startScroll(1);
		};
      left_scroll.onmouseup = function()
      {

        obj.stopScroll();
      };
			left_scroll.onmouseover = function()
      {
        setHoverArrow('left')
      };
			left_scroll.onmouseout = function()
			{
				obj.stopScroll();
				setOutArrow('left');
			};
    }
    else
    {
      var left_scroll = $(this.root_id + '_left');
      left_scroll.style.backgroundPosition = '-36px 0px';
	  left_scroll.style.cursor = 'default';
      left_scroll.onmousedown = null;
      left_scroll.onmouseup = null;
			global_left_dropdown_arrow = left_scroll.src;
			global_left_dropdown_arrow_top = left_scroll.style.top;
			global_left_dropdown_arrow_left = left_scroll.style.left;

    }
  };

  this.startScroll = function(direction)
  {
    this.move_direction = direction;
    if (!this.scroll_timer)
    {
      var obj = this;
      this.scroll_timer = setInterval(function()
        {
          obj.scroll();
        }, 10
      );
    }
  };

  this.stopScroll = function()
  {
    if (this.scroll_timer)
    {
      clearInterval(this.scroll_timer);
      this.scroll_timer = false;
      this.updateNavigation();
    }
  };

  this.scroll = function(interval)
  {
		if(interval)
			var move_distance = interval * this.move_direction;
		else
	    var move_distance = this.getMoveDistance() * this.move_direction;
    this.curr_scroll_pos += move_distance;
    if (this.move_direction < 0)
    {
      if (this.scroll_width - this.curr_scroll_pos > this.total_width) this.curr_scroll_pos = this.scroll_width - this.total_width;
      if (this.scroll_width - this.curr_scroll_pos > this.menus[this.right_menu].right && this.right_menu < this.menus.length - 1) ++this.right_menu;
      if (this.scroll_width - this.curr_scroll_pos == this.total_width) this.stopScroll();
    }
    else if (this.move_direction > 0)
    {
      if (this.curr_scroll_pos > 0) this.curr_scroll_pos = 0;
      if (this.scroll_width - this.curr_scroll_pos < this.menus[this.right_menu].left) --this.right_menu;
      if (this.curr_scroll_pos == 0) this.stopScroll();
    }
    this.scrolling_table.style.left = this.curr_scroll_pos + 'px';
  };

  this.getMoveDistance = function()
  {
    return 5;
  };

  this.init();
}
// main function to handle the mouse events //
function ddMenu(elm_id,d){
  var id = elm_id.split('-', 2)[0];
  if(elm_id=="make-up-ddheader") id="make-up";
  var h = $(id + '-ddheader');
  var c = $(id + '-ddcontent');
  if (!c) return;
  var t = $('moving_menu_table');
  var left_t = t.style.left;
  if (left_t == '') left_t = 0;
  else left_t = parseInt(left_t);
  var max_width;
//  if(pageIndetify() == 'map'){
//	var screen_size = get_screen_size();
//	var xele_w = screen_size[0] - 40;
//	max_width = xele_w;
// }
//  else {
	max_width = 967;
//  }
  
  var dropdown_width = 153;
  var plus_left_t = left_t*(-1);
  var style_left_c = (0 + h.offsetLeft + left_t);
  if(style_left_c<=0)
  	style_left_c = 1;
  var offset_right = (plus_left_t + max_width) - h.offsetLeft;
  var temp_style_left_c = style_left_c;
  var cut_right = (dropdown_width - offset_right);
  if(temp_style_left_c + dropdown_width > max_width){
  	style_left_c = temp_style_left_c - cut_right;
  }
  c.style.left = style_left_c - 2 + 'px';
  c.style.top = '-2px';
  if(d == 1){ 
	mouseOverDropdown(h);
    clearTimeout(h.timer);
  
      c.style.display = 'block';
      c.style.height = 'auto';
      c.maxh = c.offsetHeight;
	page = (location.pathname.indexOf('/businessfinder/')  != -1) ?  'bf' : 'map'
	dropDownStats(id, page, 1, 1);
	ddSlide(c,1);
  }else{
    h.timer = setTimeout(function(){ddCollapse(c);mouseOutDropdown(h);},50);
  }
}

// collapse the menu //
function ddCollapse(c){
	ddSlide(c,-1);
}

// cancel the collapse if a user rolls over the dropdown //
function cancelHide(id){
  var h = $(id + '-ddheader');
	mouseOverDropdown(h);
  var c = $(id + '-ddcontent');
  clearTimeout(h.timer);
  if(c.offsetHeight < c.maxh){
	  ddSlide(c,1);
  }
}

// incrementally expand/contract the dropdown and change the opacity //
function ddSlide(c,d){
  var currh = c.offsetHeight;
  var dist;
  if(d == 1){
    c.style.height = c.offsetHeight;
	c.style.opacity = 100;
    c.style.display = 'block';
  }else{
	c.style.opacity = 0;
	c.style.height= 0 + 'px';
    c.style.display = 'none';
  }
  if(dist <= 1 && d == 1){
    dist = 1;
  }  
  c.style.zIndex = '10';
}

function goToParent(parentLink) {
	document.location = parentLink;
}

//ismail
function mouseOverDropdown(elm)
{
	if (dd_last_mouseover != null){
		if (elm != dd_last_mouseover) mouseOutDropdown(dd_last_mouseover);
	}
	if (dd_last_click == elm) return false;

	var cols = elm.getElementsByTagName('td');
	var col = cols[1];
	var old_ie = is_safari = is_ie = false;
	if (navigator.appVersion.indexOf('MSIE') != -1){
		is_ie = true;
		var arVersion = navigator.appVersion.split("MSIE");
		if (parseFloat(arVersion[1]) == 6) old_ie = true;
	}
	else if (navigator.appVersion.indexOf('Safari') != -1 || window.opera) is_safari = true;
	var tmp = elm;
	var first_child;
	if (is_ie) first_child = tmp.childNodes[0]; else first_child = tmp.childNodes[1];

	var widhtx = first_child.offsetWidth;
	if(first_child.parentNode.id != global['bfi_catidactive'])
		first_child.style.cssText = 'width:'+widhtx+'px; background-position:0px -39px; height:22px; margin-left:2px; margin-right:2px;';
	dd_last_mouseover = elm;
}

function mouseOutDropdown(elm)
{ 	
	var is_ie = false; var old_ie = false;
	if (navigator.appVersion.indexOf('MSIE') != -1)	is_ie = true;
	var arVersion = navigator.appVersion.split("MSIE");
	if (parseFloat(arVersion[1]) == 6) old_ie = true;

	var tmp = elm;
	var cols = tmp.getElementsByTagName('td');
	var col = cols[1];
	if(!col) return;
	col.childNodes[0].className = 'bfi_new_menu bfi_menu_arrow_hijau';
	var first_child;
	if (is_ie) first_child = tmp.childNodes[0]; else first_child = tmp.childNodes[1];

	if(global['bfi_catidactive'] != tmp.id)
	first_child.style.cssText = 'background-position:0px -66px; margin-left:2px; margin-right:2px; height:23px;';

	dd_last_mouseover = null;
}

function setHoverArrow(type)
{
	if(type=="left")
	{
		if ($('moving_menu_left').style.backgroundPosition == '0px 0px')
		$('moving_menu_left').style.backgroundPosition = '-18px 0px';
		page = (location.pathname.indexOf('/businessfinder/')  != -1) ?  'bf' : 'map'
		dropDownStats('left', page, 2, 0);
	}
	else
	{
		if ($('moving_menu_right').style.backgroundPosition == '0px -28px')
		$('moving_menu_right').style.backgroundPosition = '-18px -28px';
		page = (location.pathname.indexOf('/businessfinder/')  != -1) ?  'bf' : 'map'
		dropDownStats('right', page, 2, 1);
	}
}

function setOutArrow(type)
{
	if(type=="left"){
		if ($('moving_menu_left').style.backgroundPosition != '-36px 0px')
		$('moving_menu_left').style.backgroundPosition = '0px 0px';
	}else{

		if ($('moving_menu_right').style.backgroundPosition != '-36px -28px')
		$('moving_menu_right').style.backgroundPosition = '0px -28px';
	}
}

function setActiveMainMenu(id, sub)
{
	close_compMinisite();
	closedetailInclude();
	if(global['main_menu_active'] == undefined || (global['main_menu_active'].idMainMenu == id && global['main_menu_active'].idSubMenu != sub) || global['main_menu_active'].idMainMenu != id){
		if(global['main_menu_active'] != null)
			$(global['main_menu_active'].idMainMenu).className = 'map_menu';
	}else if(global['main_menu_active'].idMainMenu == id && global['main_menu_active'].idSubMenu == sub)
		$(id).className = 'map_menu';
	global['main_menu_active'] = {'idMainMenu': id, 'idSubMenu': sub};

}

function setActiveDropDown(aliasMenu,aliasSubMenu){
	if(global['alias_menu_active'] == undefined && global['alias_sub_menu_active'] == undefined){
		global['bfi_catidactive'] = aliasMenu+'-ddheader';
		global['alias_menu_active'] = aliasMenu+'-table';
		global['alias_sub_menu_active'] = aliasSubMenu;
		global['alias_menu_active_before'] = '';
		global['alias_sub_menu_active_before'] = '';
	} else {
		global['alias_menu_active_before'] = global['alias_menu_active'];
		global['alias_sub_menu_active_before'] = global['alias_sub_menu_active'];
		global['bfi_catidactive'] = aliasMenu+'-ddheader';
		global['alias_menu_active'] = aliasMenu+'-table';
		global['alias_sub_menu_active'] = aliasSubMenu;
		$(global['alias_menu_active_before']).style.cssText='background-position: 0px -66px; height:23px; margin-left:2px; margin-right:2px;';
		$(global['alias_sub_menu_active_before']).style.cssText = "";
	}
	if($(global['alias_menu_active'])) $(global['alias_menu_active']).style.cssText='background-position: 0px -208px; height:23px; margin-left:2px; margin-right:2px;';
	if($(global['alias_sub_menu_active'])) $(global['alias_sub_menu_active']).style.cssText = "font-family:Arial;color:#000000; font-size:11px;margin:0; display:block; padding:5px; text-decoration:none; background:url('http://"+location.hostname+"/img/business_finder/navigasi/tick-mark.png') no-repeat; background-color:#fef300; background-position:right; width:160px;";
}

function dropDownStats(menu_name, page, state, is_parent){
	return false;
	// state 1 = mouse over; state 0 = click; state 2 = nav bar state 3 = onclick nav bar;
	if(state == 1){
		if(is_parent == 1)
			google_analytic("/stats/"+page+"/yellow_menu/mouseover/parent/"+menu_name+"/");
		else	
			google_analytic("/stats/"+page+"/yellow_menu/mouseover/child/"+menu_name+"/");
	} else if(state == 2) {
		// is parent 1 = right;
		if(is_parent == 1)
			google_analytic("/stats/"+page+"/yellow_menu/mouseover/right/");
		else
			google_analytic("/stats/"+page+"/yellow_menu/mouseover/left/");
	} else if(state == 3) {
		// is parent 1 = right;
		if(is_parent == 1)
			google_analytic("/stats/"+page+"/yellow_menu/click/right/");
		else
			google_analytic("/stats/"+page+"/yellow_menu/click/left/");
	} else { 
		if(is_parent == 1)
			google_analytic("/stats/"+page+"/yellow_menu/click/parent/"+menu_name+"/");
		else	
			google_analytic("/stats/"+page+"/yellow_menu/click/child/"+menu_name+"/");
	}
}

function clickDropdown(catId,menuName,aliasMenu,aliasMainMenu){
	record_stats_new('dropdown_click', catId); 
	setCatName(menuName); 
	change_title('','','','','','','','','','','','','','','',catId,menuName); 
	updateMapIcon(catId,'business', '', '','', '','', '','','', '', true, false,''); 
	dropDownStats(aliasMenu,'map',0,0); 
	setActiveDropDown(aliasMainMenu,aliasMenu);
}