var saved_last_pos="",baseurl="http://"+location.hostname,traffic=null;var global_data,global_flag_status=new Array(),global_update_data=true,global_stats=new Array(),stats=new Array();var num_rows_per_page=20,global_page=1,global_highlight={i:-1,prem:0};var categoryList=new Array(),premiumListing=new Array(),slideshow=new Array();var parentCategoryOption=new Array(),show_branch=false,icon_timer,last_click,showOneGroup="",active_tab=0,global_cat_id=0,global_business_id=0,global_branch_only=0;var company_listing_in=new Array(),search_category_id="",index_premium=0,total_company,global_cat_name="none",global_email_form,global_sms_form,global_main_cat=0;var global_mode=1,global_aid,global_pid,global_last_zone_selected="",global_bubble_flag=false,global_bubble=new Object();var global_show_image=false,global_feature_ads=0,moreFlag=0,titleFlag=1,global_directory="",global_parent,global_mini_site=0;var loaded_js=new Array(),loaded_css=new Array(),global_last_cat_id,global_last_directory,global_last_cat_name,global_original_cat_name="",global_sub_cat,testi_position=1;var last_update_bg_side_bar="",global_ajax=new Array(),global_left_dropdown_arrow,global_right_dropdown_arrow,global_dropdown,last_dropdown_position,global_feedback_form=new Array();var prev_t=0,timer=0,spam=1,last_row_start,last_row_end,last_col_start,last_col_end,global=new Array();var do_draw=1,drag_mover=false,global_last_center,global_flag_offset,global_draw=new Object(),global_tweet_form,global_fb_form,global_advertise_form,advertise_flag=0;if(global_clear_cache==undefined){var global_clear_cache=""}var GA;function removeElement(b){var a=$(b);if(a){a.parentNode.removeChild(a)}}function trim(c){if(c){var c=c.replace(/^\s\s*/,""),a=/\s/,b=c.length;while(a.test(c.charAt(--b))){}return c.slice(0,b+1)}else{return""}}function in_array(e,d,a){var c=false,b,a=!!a;for(b in d){if((a&&d[b]===e)||(!a&&d[b]==e)){c=b;break}}return c}function str_replace(l,c,g){var e=l,a=c,k=g;var b=is_array(a),h=is_array(k),e=[].concat(e),a=[].concat(a),d=(k=[].concat(k)).length;while(j=0,d--){if(k[d]){while(k[d]=k[d].split(e[j]).join(b?a[j]||"":a[0]),++j in e){}}}return h?k:k[0]}function is_array(a){return(a instanceof Array)}function loadScript(b){if(loaded_js[b]==1){return}var c=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();c.open("GET",b,false);c.send(null);var a=c.responseText;if(a){var d=document.createElement("script");d.type="text/javascript";if(document.all){d.text=a}else{var f=document.createTextNode(a);d.appendChild(f)}document.getElementsByTagName("head")[0].appendChild(d);loaded_js[b]=1}else{alert("Javascript couldn't be loaded : "+b)}}function loadCSS(b){if(loaded_css[b]==1){return}var f=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();f.open("GET",b,false);f.send(null);var a=f.responseText;if(a){var e=document.createElement("style");e.setAttribute("type","text/css");if(e.styleSheet){e.styleSheet.cssText=a}else{var c=document.createTextNode(a);e.appendChild(c)}var d=document.getElementsByTagName("head")[0];d.appendChild(e);loaded_css[b]=1}else{alert("CSS couldn't be loaded : "+b)}}function copy_obj(b){var d=new Object();for(var a in b){d[a]=b[a]}return d}function abortAjax(a){if(a){if(a.readyState!=4){a.abort();a=null;return true}}return false}function addslashes(a){return(a+"").replace(/([\\"'])/g,"\\$1").replace(/\0/g,"\\0")}function getMouseButton(b){var a=0;if(!b){var b=window.event}if(b.which){a=b.which<2?1:(b.which==2?4:2)}else{if(b.button){a=b.button}}return a}function ajax(b,d,c){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(typeof d=="function"){d(a.responseText)}}else{if(typeof c=="function"){c()}}};a.open("GET",b,true);a.send(null)}return a}function ajaxPost(b,d,e,c){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(typeof e=="function"){e(a.responseText)}}else{if(typeof c=="function"){c()}}};a.open("POST",b,true);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.setRequestHeader("Content-length",parameters.length);a.setRequestHeader("Connection","close");a.send(d)}return a}function ajaxMainSearch(){var a=$("q").value;search_process(a,0,1,"Singapore");return false}function search_process(d,c,e,f){if(document.getElementById){var a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(a){var g=$("content_listing");g.style.display="";g.innerHTML='<div align="center" style="padding-top:50px"><img src="http://'+location.hostname+'/img/map/loading2.gif" width="68" height="87"/></div>';a.onreadystatechange=function(){if(a.readyState==4&&a.status==200){if(a.responseText){clearLHS();$("content_listing_title").innerHTML="Search Result";g.innerHTML=a.responseText;global.active_list="search";showMainSearchPaging(d,c,f);fitListHeight()}}};var b="http://"+location.hostname+"/asia_travel/search/java_search.php?country="+f+"&q="+d+"&more="+c+"&p="+e;a.open("GET",b,true);a.send(null)}return false}function showMainSearchPaging(q,more,country){var elm=$("search_pages");if(elm){var paging=eval("("+elm.innerHTML+")");var page=paging[0];var max_page=paging[1];showPaging(page,max_page,function(p){return"search_process('"+q+"', "+more+", "+p+", '"+country+"')"})}}function print_map(c,e){var f=getLastPos();if(f){var k=f.x;var g=f.y;var a=get_level();if(global_sg_x!=k){url=c.replace("&x="+global_sg_x,"")}url=url.replace("&y="+global_sg_x+"","");url=url.replace(/&level=[^&]*/,"&level="+a);url=url.replace(/&l=\d/,"");url=url+"&x="+k+"&y="+g+"&level="+a;if(window.MapAPI){var b=global.no_busprint;if(routing.route){var h=routing.getMode();var i=routing.getWeight();if(h==0){url=routing.printUrl()}if(h==1&&i==0){if(b){var d=global.direction_busprint;url="http://"+location.hostname+"/travel/bus_guide/print_map_bus.php?no="+b+"&d="+d+"&v="+global.v_c+global_clear_cache}}}else{if(b){var d=global.direction_busprint;url="http://"+location.hostname+"/travel/bus_guide/print_map_bus.php?no="+b+"&d="+d+"&v="+global.v_c+global_clear_cache}url=url.replace(/&s=[^&]*/,"")}}}window.open(url,"printMap");return false}function on_mouse_wheel(b,a){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(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}}}}function setCursor(b){var d=MapAPI.viewport.fakeDiv,c=SD.BASE_URL,a=false;if(SD.isGecko){a=true}if(b==true){if(a){d.style.cursor="-moz-grab"}else{if(d.style.cursor!="url('"+c+"img/openhand.cur'), default"){d.style.cursor="url('"+c+"img/openhand.cur'), default"}}}else{if(b==false){if(a){d.style.cursor="-moz-grabbing"}else{if(d.style.cursor!="url('"+c+"img/closehand.cur'), default"){d.style.cursor="url('"+c+"img/closehand.cur'), default"}}}}}function showTopDestination(a){if(a==1){$("top_destination").style.display="block";$("hide_top_destination").style.display="none";$("show_top_destination").style.display="block"}else{$("top_destination").style.display="none";$("hide_top_destination").style.display="block";$("show_top_destination").style.display="none"}}function parse_hash(e){var a=e.split("/"),f=a.length,d,b=new Array(),c;for(d=0;d<f;d++){if(d%2==0){c=a[d];b[c]=""}else{b[c]=a[d]}}return b}function sleep(a){var c=new Date().getTime();for(var b=0;b<10000000;b++){if((new Date().getTime()-c)>a){break}}}function findPosX(a){var b=0;if(!a){return 0}if(a.offsetParent){while(1){b+=a.offsetLeft;if(!a.offsetParent){break}a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function setWidthContainer(c,d){var b=get_screen_size();var f=$(c);var e=findPosX(f.parentNode);if(!d){d=40}var a=b[0]-e-d;f.style.width=a+"px"}function pageIdentifySearch(){if(location.pathname.indexOf("/asia_travel/")!=-1){return"map_view"}else{if(location.pathname.indexOf("/businessfinder/preview/")!=-1){return"businessfinder_preview"}else{if(location.pathname.indexOf("/businessfinder/company/")!=-1){return"businessfinder_company"}else{if(location.pathname.indexOf("/businessfinder/company_detail")!=-1){return"businessfinder_preview"}else{if(location.pathname.indexOf("/businessfinder/")!=-1){return"businessfinder_company"}else{return"map"}}}}}}function get_screen_size(){var b=0,a=0;if(typeof(window.innerWidth)=="number"){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.clientWidth;a=document.body.clientHeight}}}return Array(b,a)}function findPosY(b){var a=0;if(!b){return 0}if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function fit_to_screen(f){var c=get_screen_size(),e=document.getElementById(f);var d=findPosY(e);var b=c[1]-d-10;e.style.height=b+"px"};function getLastPos(){last_ll=(global.star_pos==undefined)?MapAPI.viewportInfo.centerGeo:global.star_pos;return{x:last_ll.lon,y:last_ll.lat}}function get_center(){var c=new Point,b=MapAPI.viewportInfo;if(is_geo()){var a=MapAPI.viewportInfo.centerGeo;c.x=a.lon;c.y=a.lat;return c}return MapAPI.viewportInfo.centerMetric}function is_geo(){return(MapAPI.viewportInfo.projection.name=="Mercator WGS-1984")?1:0}function getOriginalPos(){var a=$("original_pos").innerHTML;a=a.split(",");return new Vertex(a[0],a[1])}function get_level(){return MapAPI.viewportInfo.levelIndex}function get_width(){return MapAPI.viewportInfo.canvasSize.width}function get_height(){return MapAPI.viewportInfo.canvasSize.height}function setLastPos(a,b){$("last_pos").innerHTML=a+","+b}function hideMapIcon(a){icons.remove_group(a)}function hideAllMapIcon(){icons.remove_all()}function gotoMap(a,c){var b=MapAPI.projection.metricToGeo(a,c);MapAPI.setCenter(b,MapAPI.viewportInfo.levelIndex)}function hide_blur_map(){hide_element("blur_area")}function getMapScale(b){b-=3;var a=new Array(0,5.36289937747,142.488947899,641.200265548,1567.37842689,0.0373347606431,0.112744993964,0.158577057429,0.269473673138,0.538947346276,1.07789469255);return a[b]}function getMapDiv(d,b,f,c){var a=new Object();var e=new Array(0,-17.1508025,-16.2332975,-16.2332975,-16.2332975,72753.8062,131891.0427,132458.9985,132593.172799,132593.172799,132593.172799);a.topX=c.minVertexLongitude+((c.maxVertexLongitude-c.minVertexLongitude)/c.totalMapCol*(b-1));a.topY=c.maxVertexLatitude-((c.maxVertexLatitude-e[f])/c.totalMapRow*d);a.bottomX=c.minVertexLongitude+((c.maxVertexLongitude-c.minVertexLongitude)/c.totalMapCol*b);a.bottomY=c.maxVertexLatitude-((c.maxVertexLatitude-e[f])/c.totalMapRow*(d-1));return a}function goToMotoGP(b,g,e,d){xy=new Vertex(b,g);ll=new Vertex(e,d);var c=MapAPI.mapClient;var a;a=xy;MapAPI.setMapSource("kl");var f=c.vertexToScreen(a.x,a.y);c.ChangeLevel(9);moveStarPosition(c,f);gotoMap(a.x,a.y)}function fix_xy(c,g,e){var f=e?e:get_level(),b=new Point(c,g),a=MapAPI.viewportInfo.projection,d=is_geo();if(d&&c>1000){b=a.metricToGeo(c,g)}else{if(!d&&c<1000){b=a.geoToMetric(c,g)}}return b}function is_last_map(){var b=MapAPI.viewport.viewportInfo.lastCursorDelta,a;var a=MapAPI.viewport.getNextLevel(b>0?true:false);if(a==-1){return true}else{return false}}function moveStarPosition(e,f,c,b){if(c){global.update_star=false;return}if(f==undefined){if(b==true){var d=MapAPI.viewportInfo.centerGeo}else{var a=MapAPI.viewportInfo.lastCursorPosUp;var d=MapAPI.viewportInfo.viewportScreenToGeo(a.x,a.y)}d.x=d.lon;d.y=d.lat}else{if(f){var d=MapAPI.viewportInfo.viewportScreenToGeo(f.x,f.y);d.x=d.lon;d.y=d.lat}}global.star_pos=(b)?MapAPI.viewportInfo.centerGeo:MapAPI.viewportInfo.lastCursorLatLon;if(SD.isIE){ox=6;oy=6}else{ox=8;oy=8}if(icons.icons.star){icons.icons.star[0].setPosition(d)}else{icons.create({css:"free_marker",w:16,h:16,left:131,top:114,x:d.x,y:d.y,offset_x:ox,offset_y:oy,cursor:"grab"},"star")}};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(h){var j=pageIndetify();f=document.fSdSearch;if(f.q.value==""||f.q.value=="Find Businesses, Addresses or Products & Services here"||f.q.value=="Find Places, Businesses 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.value="";f.q.focus();return false}else{var b=f.q.value,l,g="";if(f.search_type){l=f.search_type[0].checked?1:2;g=l?"&t="+l:""}var k=b;b=encodeURIComponent(b);b=b.replace(/%20/gi,"+");if($("rs_1")){if($("mp_rs_1")){var c=pageIdentifySearch();if(($("rs_1")&&!$("rs_2"))||$("rs_title_1").innerHTML.toLowerCase()==k.toLowerCase()){if($("mp_rs_1").href!="javascript:void(0);"&&$("mp_rs_1").href!="#"&&c!="businessfinder_preview"&&c!="businessfinder_company"){if(j=="search"||location.pathname=="/"){var e="http://"+location.hostname+"/asia_travel/search/?q="+b+""+g;location.href=e}else{location.href=$("mp_rs_1").href;return false}}else{if($("cat_id_1")&&!window.MapAPI){if(location.pathname=="/"){var a=$("rs_title_1").innerHTML;a=urlencode(a).replace("%20","+");location.href="http://"+location.hostname+"/asia_travel/search/?q="+a+"&d=1"}else{if(c=="businessfinder_preview"||c=="businessfinder_company"){location.href=$("cat_id_1").href}}}else{if(!window.MapAPI){if(j=="search"){var e="http://"+location.hostname+"/asia_travel/search/?q="+b+""+g;location.href=e}else{location.href=$("mp_rs_1").href}}else{$("mp_rs_1").onclick();f.q.blur()}return false}}return false}}}if(f.action.indexOf("company_listing")>0){var e=f.action+"?companyname="+b+""+g}else{var e=f.action+"?q="+b+""+g}if(h==1){e+="&d=1"}location.href=e}}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){if($("helpTab"+i)){$("helpTab"+i).style.display="block"}if($("left"+i)){$("left"+i).className="left_selected"}if($("menu"+i)){$("menu"+i).className="menu_selected"}if($("right"+i)){$("right"+i).className="right_selected"}}else{if($("helpTab"+i)){$("helpTab"+i).style.display="none"}if($("left"+i)){$("left"+i).className="left_close"}if($("menu"+i)){$("menu"+i).className="menu"}if($("right"+i)){$("right"+i).className="right_close"}}}}else{if(a==2){for(i=1;i<=4;i++){if(i==a){if($("helpTab"+i)){$("helpTab"+i).style.display="block"}if($("left"+i)){$("left"+i).className="left_selected"}if($("menu"+i)){$("menu"+i).className="menu_selected"}if($("right"+i)){$("right"+i).className="right_selected"}}else{if($("helpTab"+i)){$("helpTab"+i).style.display="none"}if($("left"+i)){$("left"+i).className="left_close"}if($("menu"+i)){$("menu"+i).className="menu"}if($("right"+i)){$("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)}function pageIndetify(){if(location.pathname.indexOf("/restaurants/")!=-1||location.pathname.indexOf("/restaurant/")!=-1){return"restaurant"}else{if(location.pathname.indexOf("/realestate/")!=-1){return"realestate"}else{if(location.pathname.indexOf("/jobs/")!=-1){return"jobs"}else{if(location.pathname.indexOf("/search/")!=-1){return"search"}else{if(global.preview_bf){return"map"}else{if(location.pathname.indexOf("/businessfinder/")!=-1){return"businessfinder"}else{return"map"}}}}}}};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};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"||this.oP.mode==1){trap="routing";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_result_from"||this.fld.id=="dd_result_to"||this.oP.mode==1){trap="routing_result";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="travel_from"||this.fld.id=="travel_to"||this.oP.mode==1){trap="travel";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_bus_bubble1"||this.fld.id=="dd_bus_bubble2"||this.oP.mode==1){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"||this.oP.mode==1){trap="routing";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_result_from"||this.fld.id=="dd_result_to"||this.oP.mode==1){trap="routing_result";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="travel_from"||this.fld.id=="travel_to"||this.oP.mode==1){trap="travel";this.createListddformrouting(this.aSug,trap)}else{if(this.fld.id=="dd_bus_bubble1"||this.fld.id=="dd_bus_bubble2"||this.oP.mode==1){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.hasxy!=undefined&&s.param.hasxy==1){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>77&&this.fld.offsetWidth==486||H.length>77&&this.fld.offsetWidth==487){F=H.substr(0,74)+"..."}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","");f="http://"+location.hostname+"/asia_travel/travel/travel_main.php?zonename="+S;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;"><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="http://"+location.hostname+"/asiatravel/singaporemap/restaurant/"+s.param.eid+"/"+s.id+"/";l="as_json_main_search.hideList();"}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>';if(typeof(s.param.su)!="undefined"&&s.param.su!=""){H=s.param.su}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"){if(location.pathname=="/"){d="http://"+location.hostname+"/asiatravel/singaporemap/business/-"+s.id+"/"+p+"/";l="as_json_main_search.hideList();";a='"'+d+'" onclick="hideAll(); '+af+" "+l+'"'}else{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"){if(b=="businessfinder_preview"){f="http://"+location.hostname+"/businessfinder/preview/"+s.id+"/"+p+"/"}else{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 id="cat_id_'+(ac+1)+"\" onclick=\"record_stats_new('auto_suggest', '"+keyword+"_industry_catid-"+s.param.c+'_5\');" href="'+f+'">Directory View</a></div>'}else{if(Q=="Category in Location"){af="record_stats_new('auto_suggest', '"+keyword+"_category_catid-"+s.param.c+"_1');";O='<span style="color:#d0a807">Category</span>';var p=get_keyword(H);p=p.replace("'","%27");f="http://"+location.hostname+"/asia_travel/travel_sites/whats_nearby/cat/"+s.id+"/"+p+"/";url3="";if(b=="map"){d="javascript:void(0);";l="catLocclick('"+s.id+"','"+p+"'); 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="catLocclick('"+s.id+"','"+p+"'); 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+'"'}}}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+"_categor_catid-"+s.param.c+"_2'); "+l+"\">Map View</a> | <a onclick=\"record_stats_new('auto_suggest', '"+keyword+"_category_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');"}else{if(Q=="Category in Location"){af="record_stats_new('auto_suggest', '"+keyword+"_category_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+34)+"px"}else{Y=(this.fld.offsetWidth+33)+"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+44)+"px"}else{suggest_wdth=(this.fld.offsetWidth+44)+"px"}var J=(this.fld.offsetWidth-120)+"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;cursor:pointer;"><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(!global.us_category_suggest){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"}}}}}else{if(h){q=(e.x+0)+"px"}else{if(p){if(s){q=(e.x+0)+"px"}else{if(r){q=(e.x+0)+"px"}}}}}if(!global.us_category_suggest){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"}}}}}else{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+4)+"px"}else{if(r){n=(e.y+this.fld.offsetHeight+this.oP.offsety+4)+"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;case 11:a="Category in Location";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 catLocclick(c,b){var a="place";cat_name_url=str_replace("_"," ",b);setCatName(cat_name_url);change_title("","","","","","","","","","","","","","","",c,b,false);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()}}};
