var saved_last_pos="",baseurl="http://"+location.hostname,traffic=null;var global_data,global_flag_status=new Array(),global_update_data=true,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,backup_scale_width,backup_scale_height,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=""};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(d,c){if(d.t=="biz_prem"&&c.t=="biz"){return -1}else{if(d.t=="biz"&&c.t=="biz_prem"){return 1}else{if(d.t=="biz_prem"&&c.t=="biz_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}else{if(d.t=="res_prem"&&c.t=="res"){return -1}else{if(d.t=="res"&&c.t=="res_prem"){return 1}else{if(d.t=="res_prem"&&c.t=="res_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}else{if(d.t=="property_prem"&&c.t=="property"){return -1}else{if(d.t=="property"&&c.t=="property_prem"){return 1}else{if(d.t=="property_prem"&&c.t=="property_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}}}}}}}}}if(d.company<c.company){return -1}else{return 1}}function compare(d,c){if(d.t=="biz_prem"&&c.t=="biz"){return -1}else{if(d.t=="biz"&&c.t=="biz_prem"){return 1}else{if(d.t=="biz_prem"&&c.t=="biz_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}else{if(d.t=="res_prem"&&c.t=="res"){return -1}else{if(d.t=="res"&&c.t=="res_prem"){return 1}else{if(d.t=="res_prem"&&c.t=="res_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}else{if(d.t=="property_prem"&&c.t=="property"){return -1}else{if(d.t=="property"&&c.t=="property_prem"){return 1}else{if(d.t=="property_prem"&&c.t=="property_prem"){if(d.ap<c.ap){return -1}else{if(d.ap>c.ap){return 1}}}}}}}}}}}return d.distance-c.distance}function FeaturedAd(c,a,b){this.src=c;this.url=a;this.title=b}function show_map_page_menu(){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 c={script:function(f){var g="search_category";return baseurl+"/asia_travel/mappage/ajax/"+g+".php?cat_q="+f+"&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(g){if(g){var f=(g.id).split("|");setCatName(g.value);if(f[3]!=""){global_branch_only=1}updateMapIcon(f[0],f[1],f[2],f[3],"",global_branch_only)}}};var e=new bsn_search.AutoSuggest("cat_q",c);var d=new moving_menu("moving_menu");highlightDropdown(global_cat_id,global_directory,global_main_cat,global_business_id)}};var b="http://"+location.hostname+"/asia_travel/mappage/singapore/sdinc_dropdown_content.php?v="+global.v_c;a.open("GET",b,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 f=navigator.appVersion.split("MSIE");var a=parseFloat(f[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 showBottomTab(A){if(A=="1"){$("one").style.display="block";$("two").style.display="none";$("three").style.display="none";$("four").style.display="none"}else{if(A=="2"){$("one").style.display="none";$("two").style.display="block";$("three").style.display="none";$("four").style.display="none"}else{if(A=="3"){$("one").style.display="none";$("two").style.display="none";$("three").style.display="block";$("four").style.display="none"}else{if(A=="4"){$("one").style.display="none";$("two").style.display="none";$("three").style.display="none";$("four").style.display="block"}}}}}function showDrop(B,A){obj=document.getElementById(B);obj.style.display="block";obj=document.getElementById(A);obj.style.display="block"}function hideDrop(B,A){obj=document.getElementById(B);obj.style.display="none";obj=document.getElementById(A);obj.style.display="none"};function removeElement(b){var a=$(b);if(a){a.parentNode.removeChild(a)}}function showLoading(c,e,d){if(!$("loading_bar")){var b=$(c);b.innerHTML="";var f=document.createElement("div");f.id="loading_bar";f.style.position="relative";var a=document.createElement("img");a.src="http://"+location.hostname+"/img/map/loading2.gif";a.style.cssText="position:absolute; top:"+e+"px; left:"+d+"px;";f.appendChild(a);b.appendChild(f)}}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)}}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 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(stats[b]){if(a){stats[b]++}}else{if(!c){c=1}stats[b]=c}}function print_map(a,c){var d=getLastPos();if(d){var g=d.x;var e=d.y;if(MapAPI.mapClient.levelIndex<=4){var k=fix_xy(g,e);g=k.x;e=k.y}if(global_sg_x!=g){url=a.replace("&x="+global_sg_x,"")}url=url.replace("&y="+global_sg_x+"","");url=url.replace(/&level=[^&]*/,"&level="+global_curr_level);url=url.replace(/&l=\d/,"");url=url+"&x="+g+"&y="+e;if(window.MapAPI){var h=MapAPI.mapDraw.panelIcon.routes;var f=MapAPI.mapDraw.panelIcon.bus_route;if(h.start&&h.end){url=h.getPrintURL()}else{if(f){var i=f.number;var b=f.direction;url="http://"+location.hostname+"/travel/bus_guide/print_map_bus.php?no="+i+"&d="+b+"&v="+global.v_c+global_clear_cache}else{url=url.replace(/&s=[^&]*/,"");url+="&s="+MapAPI.mapClient.mapName}}}}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 getLastPos(){var a=$("last_pos").innerHTML;a=a.split(",");return new Vertex(a[0],a[1])}function getOriginalPos(){var a=$("original_pos").innerHTML;a=a.split(",");return new Vertex(a[0],a[1])}function setLastPos(a,b){$("last_pos").innerHTML=a+","+b}function hideMapIcon(a){MapAPI.mapDraw.hideIcon(a)}function hideAllMapIcon(){MapAPI.mapDraw.hideAllIcon()}function unHideMapIcon(b,a){MapAPI.mapDraw.unHideIcon(b,a)}function unHideAllMapIcon(){MapAPI.mapDraw.unHideAllIcon()}function showIconInZoneOnly(a){MapAPI.mapDraw.showIconInZoneOnly(a)}function showIconInDistance(a){a=parseFloat(a);MapAPI.mapDraw.showIconInDistance(a)}function showOneGroupOnly(a){MapAPI.mapDraw.showOneGroupOnly(a)}function gotoMap(a,c){var b=fix_xy(a,c);MapAPI.mapClient.setCenterVertex(b);setLastPos(b.x,b.y);MapAPI.mapClient.DrawMap()}function hide_blur_map(){hide_element("blur_area")}function getMinXY(){var d=10;var b=MapAPI.mapClient.centerVertex.x;var a=MapAPI.mapClient.centerVertex.y;var c=getMapScale(global_curr_level);min_x=b+(1/c*-(360-d));min_y=a+(1/c*-(300-d));return Array(min_x,min_y)}function getMaxXY(){var d=10;var b=MapAPI.mapClient.centerVertex.x;var a=MapAPI.mapClient.centerVertex.y;var c=getMapScale(global_curr_level);max_x=b+(1/c*(360-d));max_y=a+(1/c*(300-d));return Array(max_x,max_y)}function getMapScale(b){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.minLon+((c.maxLon-c.minLon)/c.maxCol*(b-1));a.topY=c.maxLat-((c.maxLat-e[f])/c.maxRow*d);a.bottomX=c.minLon+((c.maxLon-c.minLon)/c.maxCol*b);a.bottomY=c.maxLat-((c.maxLat-e[f])/c.maxRow*(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 showBuildingImage(layer,row_start,row_end,col_start,col_end,show_loading){abortAjax(global_ajax.b);var switcher=$("photo_switcher");var cb=$("photo_cb");cb.onclick=function(e){stopPropagate(e);hideBuildingImage()};var imgs=switcher.getElementsByTagName("img");imgs[0].onmouseout=null;imgs[0].src="http://"+location.hostname+"/img/map/photo_active.gif";if(global.level==undefined){global.level=8}global_show_image=true;if(global_curr_level<9){if(global.level<9){MapAPI.mapClient.createPhotoContainer();MapAPI.mapClient.InitPhoto(last_col_start,last_row_start,last_col_end,last_row_end)}}else{if(row_start==undefined){row_start=last_row_start;row_end=last_row_end;col_start=last_col_start;col_end=last_col_end;show_loading=true}var img_size=10;if(global_curr_level==10){img_size=30}else{if(global_curr_level==9){img_size=20}}if($){global_ajax.b=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(global_ajax.b){global_ajax.b.onreadystatechange=function(){if(global_ajax.b.readyState==4){if($("photo_cb").checked&&global_ajax.b.responseText&&global.on_animated!=true){var images=eval("("+global_ajax.b.responseText+")");for(var i=0;i<images.length;i++){displayImage(images[i].simage_id,images[i].x_addr,images[i].y_addr,img_size,img_size,images[i].place_name,images[i].portrait,images[i].imgLink)}MapAPI.mapDraw.panelImage.updatePosition()}hide_blur_map()}else{if(show_loading){show_blur_map()}}};var url="http://"+location.hostname+"/malaysia/include/get_building_image.php?level="+global_curr_level+"&colStart="+col_start+"&colEnd="+col_end+"&rowStart="+row_start+"&rowEnd="+row_end+"&s="+global.city+global_clear_cache;global_ajax.b.open("GET",url,true);global_ajax.b.send(null)}}return true}function displayImage(C,J,H,L,D,I,K){var A=MapAPI.mapDraw.addBuildingImage(C,J,H,L,D,I);var E=I;var M,F,G;if(K){if(I.length>20){E=I.substr(0,17)+"..."}var B='<div class="TextBold arial ver_14" style="padding-bottom: 7px" title="'+I+'">'+E+"</div>";M=185;F=280;B+='<div align="center"><img src="http://'+location.hostname+"/stock_images/travel/show_map_image.php?imageId="+C+'&mode=1" width="150" height="230"/></div>';G="bldg_portrait"}else{if(I.length>28){E=I.substr(0,25)+"..."}var B='<div class="TextBold arial ver_14" style="padding-bottom: 7px" title="'+I+'">'+E+"</div>";M=265;F=200;B+='<div align="center"><img src="http://'+location.hostname+"/stock_images/travel/show_map_image.php?imageId="+C+'&mode=2" width="230" height="150"/></div>';G="bldg_landscape"}VEvent.addListener(A,"click",function(N){MapAPI.mapDraw.openBubble(M,F,new Point(J,H),B)})}function hideBuildingImage(){if(global.level==undefined){global.level=8}abortAjax(global_ajax.b);MapAPI.mapDraw.closeInfoWindow(1);MapAPI.mapDraw.closeToolTips();MapAPI.mapClient.removePhotoContainer();resetPhotoController();return true}function resetPhotoController(){var C=document.getElementById("photo_switcher");var A=document.getElementById("photo_cb");if(A){A.onclick=function(D){showBuildingImage();stopPropagate(D)};var B=C.getElementsByTagName("img")[0];B.onmouseout=function(){this.src="http://"+location.hostname+"/img/map/photo_inactive.gif";return false};B.src="http://"+location.hostname+"/img/map/photo_inactive.gif";C.onclick=function(){if(document.createEventObject){var D=document.createEventObject();A.fireEvent("onclick",D);A.checked=!A.checked}else{var D=document.createEvent("MouseEvent");D.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);A.dispatchEvent(D)}return false};global_show_image=false}}function stopPropagate(A){A=A?A:window.event;if(A.stopPropagation){A.stopPropagation()}A.cancelBubble=true;A.cancel=true;return false};function getAdsContent(D,B){var C;var A=ads_img_path+D;if(B==1){C='<img src="'+A+'" id="ads_img" border="0" style="display:inline;" />'}else{if(B==2){C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="468" height="60"><param name="movie" value="'+A+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+A+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="468" height="60"></embed></object>'}}return C}function showAds(){ads_ctr++;$("map_ads").style.display="block";$("ads_bg").style.display="block";$("ads_place").style.display="block";curr_ads=(ads_ctr-1)%total_ads;$("ads_link").href=ads_link[curr_ads];if(ads_type[curr_ads]!=3){$("ads_content").innerHTML=getAdsContent(ads_path[curr_ads],ads_type[curr_ads])}$("lcb_button").style.display="none"}function closeAds(){$("map_ads").style.display="none";$("ads_bg").style.display="none";$("ads_place").style.display="none";$("lcb_button").style.display="block"}function moveMap(A,D){var B=new Vertex(A,D);MapAPI.mapDraw.panelIcon.panByOffset(A,D);MapAPI.mapClient.setCenterVertex(B);MapAPI.mapClient.DrawMap();var C=$("last_pos").innerHTML;C=C.split(",");prev_x=C[0];prev_y=C[1];if($("last_pos")){$("last_pos").innerHTML=(B.x)+","+(B.y)}if($("star_icon"+star_id)){$("star_icon"+star_id).style.display="block";$("star_icon"+star_id).style.left=(MapAPI.mapClient.mapWidth/2)+"px";$("star_icon"+star_id).style.top=(MapAPI.mapClient.mapHeight/2)+"px"}}function backToOriginalMapPos(){moveMap(prev_x,prev_y);backToOriginalAdsPos();closeAds();mode=null}function backToOriginalAdsPos(){$("ads_loc_url").innerHTML=ads_bottom_text[curr_ads];$("ads_place").style.top="45px";$("ads_bg").style.top="20px"}function moveAdsToTop(){$("ads_loc_url").innerHTML='<a href="javascript:void(0);" onclick="backToOriginalMapPos();">Click here to back to previous location</a>'}function goToAdsLoc(){mode="ads";var A=ads_loc[curr_ads];moveMap(A.x,A.y);moveAdsToTop()}function show_blur_map(){if($("blur_area")){$("blur_area").style.display="block"}else{var C=document.createElement("div");var A=MapAPI.mapClient.mapWidth,B=MapAPI.mapClient.mapHeight;C.id="blur_area";C.style.cssText="z-index:55;position:absolute;background:#FFFFFF;filter:alpha(opacity=60);-moz-opacity:.60;-khtml-opacity: 0.6;opacity: 0.6;width:"+A+"px;height:"+B+"px;top:0px;left:0px;";C.innerHTML='<img src="'+baseurl+'/img/map/loading_map.gif" style="position:absolute;top:150px;left:305px;">';var D=$("imgDiv");D.appendChild(C)}}function show_mini_site(B){if($("mini_site").innerHTML&&global_mini_site==B){show_element("mini_site");return false}global_mini_site=B;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){$("mini_site").style.display="block";$("mini_site").innerHTML=A.responseText}}};var C="http://"+location.hostname+"/asia_travel/mappage/mini_site.php?businessId="+B+"&directory="+global_directory+"&v="+global.v+global_clear_cache;A.open("GET",C,true);A.send(null)}return false}function close_mini_site(){hide_element("mini_site");hide_element("bg_mini_site");hide_element("closeMiniSite")}function showZone(D,A,B){MapAPI.removePreloadMap();MapAPI.mapDraw.panelLine.deleteLines();MapAPI.mapDraw.panelDraw.deleteGeofences();var C="zone_"+str_replace("+","",D);if($(global_last_zone_selected)){$(global_last_zone_selected).style.fontWeight=""}if($(C)){$(C).style.fontWeight="bold";global_last_zone_selected=C}if(D=="all"||D==""){unHideAllMapIcon();MapAPI.mapDraw.panelIcon.updatePosition();hideBoxInZone()}else{if(D=="2000"){MapAPI.mapDraw.addGeofence(default_xy.x,default_xy.y,parseFloat(D));MapAPI.mapClient.ChangeLevel(3);showIconInDistance(D)}else{MapAPI.mapClient.ChangeLevel(5);MapAPI.updateScaleImage();drawZone(D,A,B)}}showMenuId("hide","divDistrictBox","imgUpKl","imgDownKl")}function drawZone(E,A,B){if(document.getElementById){var D=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(D){D.onreadystatechange=function(){if(D.readyState==4&&D.status==200){var H=new Array(),J,T=(D.responseText).split("\n");var R=new Array();var P=T[0].split(",");var M=T[1].split(",");var I=P.length;var Q,O;if(T[2]){var G=T[2].split(",");Q=G[0];O=G[1];for(J=0;J<I;J++){H.push(new Vertex(P[J],M[J]))}}else{var F=0,S=0,L=9999999,N=9999999;for(J=0;J<I;J++){H.push(new Vertex(P[J],M[J]));if(P[J]>F){F=P[J]}if(P[J]<N){N=P[J]}if(M[J]>S){S=M[J]}if(M[J]<L){L=M[J]}}Q=(parseFloat(F)+parseFloat(N))/2;O=(parseFloat(S)+parseFloat(L))/2}MapAPI.mapClient.setCenterVertex(new Vertex(Q,O));var K=MapAPI.mapClient.vertexToScreen(Q,O);MapAPI.mapClient.DrawMap();MapAPI.mapDraw.hideAllIcon();moveStarPosition(MapAPI.mapClient,K);H.push(new Vertex(P[0],M[0]));MapAPI.mapDraw.addLine(H);MapAPI.mapDraw.addLine(R)}};var C="http://"+location.hostname+"/"+B+"/include/get_zone.php?zonename="+E+"&zonedata="+A+global_clear_cache;D.open("GET",C,true);D.send(null)}return false}function setIconForCompany(I,K,C,F,N,J,B){var A=F.length,E=200;var H,M,G,L;M=250;if(K=="business"){G=95}else{G=235}E=110;global.branch=false;for(var D=0;D<A;D++){L=F[D].x+"_"+F[D].y;if(global_flag_status[L]==1&&F[D].type.indexOf("prem")==-1){continue}global_flag_status[L]=1;if(F[D].type=="biz_prem"||F[D].type=="res_prem"){index_premium++}createIcon(F[D],I,C,H,M,G,E,N,D)}index_premium=0;if(B){MapAPI.mapDraw.panelIcon.lockStar(true);MapAPI.mapDraw.panelIcon.updatePosition();MapAPI.mapDraw.panelIcon.lockStar(false)}}function createIcon(Z,I,V,M,L,S,X,C,A){var P,O,T=0,R=0,U=0,Q="",B=0,F="";var K=Z.x,J=Z.y,E=Z.type,W=Z.zonename,D=Z.distance,G=index_premium;if(V==""||(E.indexOf("prem")==-1&&!C)){if(E.indexOf("prem")!=-1){O=30;P=23;U=1;X="_prem_"+index_premium;Q="star"+X+".gif"}else{Q="star110.png";O=15;P=15}}else{if(C){O=30;P=23;switch(V){case"1060":Q="biz_map/kopitiam.gif";B=1;break;case"791":Q="biz_map/coffee_bean_pointer.gif";B=1;break;case"1472":Q="biz_map/primadeli_point.gif";B=1;break;case"564":Q="biz_map/delifrance_point.gif";B=1;break;case"120794":Q="biz_map/DBS.gif";B=1;break;case"81332":Q="biz_map/Q_M.gif";B=1;break;case"123699":Q="biz_map/guardian.gif";B=1;break;case"82096":Q="biz_map/raffles.gif";B=1;break;case"78698":Q="biz_map/pizza.gif";B=1;break;case"119940":Q="biz_map/vhive.gif";B=1;break;case"29485":X=200;B=1;break;case"33679":Q="biz_map/gain_city.gif";B=1;break;case"41706":Q="biz_map/homefix.gif";B=1;break;case"56915":Q="biz_map/leehwa_jewellery.gif";B=1;break;case"103838":Q="biz_map/this_fashion.gif";B=1;break;case"103688":Q="biz_map/theresa.gif";B=1;break;case"75697":Q="biz_map/osim.gif";B=1;break;default:if(E.indexOf("prem")!=-1){Q="star_prem_"+index_premium+".gif"}}if(B==1){global.branch=true}}else{O=30;P=23;X="_prem_"+index_premium;Q="star"+X+".gif"}U=1}if(Q==""){Q="star110.png";O=15;P=15}K=parseFloat(K)+T;J=parseFloat(J)+R;var H=MapAPI.mapDraw.addIcon(K,J,P,O,X,I+"_"+V,Q);if(U==1){H.setZIndex(10)}H.zone=W;H.distance=D;var Y=MapAPI.mapDraw.panelIcon.icons.length-1;if(W!=global_zonename&&global_zonename!="all"){H.hideIcon()}var N=Z.company;M=initHTMLBubble(Z);if(U==0){VEvent.addListener(H,"mouseover",function(a){if(global_bubble_flag==Z.company_id){return false}highlightCompany(A,U);H.tooltip_timer=setTimeout(function(){var c=(Z.phone==undefined)?"":"Tel : "+Z.phone;var e=' | <a href="http://'+location.hostname+"/businessfinder/company_detail.php?companyid="+Z.company_id+"&branchid="+Z.link_id+'" target="_blank" style="color:#009142">More Info</a>';var b="";if(Z.email){b=' | <a href="javascript:void(0);" onclick = "window.open(\'http://'+location.hostname+"/asia_travel/mappage/email.php?dir="+global_directory+"&id="+Z.company_id+"')\">Email</a>"}var f=N.length>39?N.substr(0,36)+"...":N;var g="<u>"+f+'</u><br><div style="padding-left:0px;" class="Link17 ver_10">'+c+b+"</div>";var d=MapAPI.mapDraw.toolTipsHtml(new Point(K,J),g,19,Z.type);d.obj.onmouseout=null;VEvent.addListener(d,"click",function(i){if(global_bubble.company_id!=Z.company_id||global_bubble.directory!=global_directory){global_bubble_flag=Z.company_id;var h=MapAPI.mapDraw.openInfoWindowHtml(1,L,S,new Point(K,J),M,i,Z.type);getHTMLBubble(Z,h);MapAPI.mapDraw.closeToolTips()}});VEvent.addListener(d,"mouseover",function(h){highlightCompany(A,U);return false});VEvent.addListener(d,"mouseout",function(h){if(checkMouseLeave(d.obj,h)){MapAPI.mapDraw.closeToolTips();unhighlightCompany(A,U);return false}})},300)})}else{VEvent.addListener(H,"mouseover",function(){if(global_bubble_flag==Z.company_id){return false}highlightCompany(A,U);if(Z.featured_ad){showFeaturedAd(Z)}else{hideFeaturedAd()}H.tooltip_timer=setTimeout(function(){var b=(Z.phone==undefined)?"":"Tel : "+Z.phone;var c=' | <a href="http://'+location.hostname+"/businessfinder/company_detail.php?companyid="+Z.company_id+"&branchid="+Z.link_id+'" target="_blank" style="color:#009142">More Info</a>';var a="";if(Z.email){a=' | <a href="javascript:void(0);" onclick = "window.open(\'http://'+location.hostname+"/asia_travel/mappage/email.php?dir="+global_directory+"&id="+Z.company_id+"')\">Email</a>"}var d=N.length>39?N.substr(0,36)+"...":N;var f=Z.miniSite==1?'<br><a href="javascript:void(0);" onclick="show_mini_site('+Z.company_id+')">View mini site</a>':"";var e=(G?G+". ":"")+"<u>"+d+'</u><br><div style="padding-left:15px;line-height:13px" class="Link17 ver_10">'+b+a+f+"</div>";tooltips=MapAPI.mapDraw.toolTipsHtml(new Point(K,J),e,19,Z.type);tooltips.obj.onmouseout=null;if(Z.miniSite==1){VEvent.addListener(tooltips,"click",function(){show_mini_site(Z.company_id);MapAPI.mapDraw.closeToolTips()})}else{if(global.branch){VEvent.addListener(tooltips,"click",function(h){if(global_bubble.company_id!=Z.company_id||global_bubble.directory!=global_directory){global_bubble_flag=Z.company_id;var g=MapAPI.mapDraw.openInfoWindowHtml(1,L,S,new Point(K,J),M,h,Z.type);getHTMLBubble(Z,g);MapAPI.mapDraw.closeToolTips()}})}}VEvent.addListener(tooltips,"mouseover",function(){if(G){if($("p_"+G)){$("p_"+G).style.backgroundColor="#000080";$("p_"+G).style.color="#FFFFFF"}}highlightCompany(A,U);return false});VEvent.addListener(tooltips,"mouseout",function(g){if(checkMouseLeave(tooltips.obj,g)){if(G){if($("p_"+G)){$("p_"+G).style.backgroundColor="";$("p_"+G).style.color="#000080"}}MapAPI.mapDraw.closeToolTips();unhighlightCompany(A,U)}return false})},300)})}if((U!=1&&Z.miniSite!=1)||global.branch){VEvent.addListener(H,"click",function(b){clearTimeout(H.tooltip_timer);if(global_bubble.company_id!=Z.company_id||global_bubble.directory!=global_directory){MapAPI.mapDraw.closeToolTips();global_bubble_flag=Z.company_id;var a=MapAPI.mapDraw.openInfoWindowHtml(1,L,S,new Point(K,J),M,b,Z.type);getHTMLBubble(Z,a)}return false})}else{if(Z.miniSite==1){VEvent.addListener(H,"click",function(){show_mini_site(Z.company_id);MapAPI.mapDraw.closeToolTips()})}}VEvent.addListener(H,"mouseout",function(){clearTimeout(H.tooltip_timer);unhighlightCompany(A,U);return false})}function initHTMLBubble(E){var B=E.company;if(global_directory=="property"){var A="http://"+location.hostname+"/realestate/property_detail.php?id="+E.company_id;B=E.company+" ("+E.company_id+")"}else{if(global_directory=="resto"){var D=str_replace(["&"," "],"_",E.company);D=str_replace([".","'",","],"",D);var A="http://"+location.hostname+"/restaurants/singapore/reviews/location-"+D+"-"+E.company_id+".php"}else{var A="http://"+location.hostname+"/businessfinder/company_detail.php?companyid="+E.company_id+"&branchid="+E.link_id}}var C="<div class='arial ver_12 TextBold Link14' style='width:210px;'><a target='_blank' href='"+A+"'>"+B+"</a></div>";if(E.phone!=undefined||E.email){C+="<div class='arial ver_11 Link19' style='line-height: 12px'>";if(E.phone!=undefined){C+="Tel: "+E.phone;if(E.email){C+=" | "}}if(E.email){C+="<a target='_blank' href='http://"+location.hostname+"/asia_travel/mappage/email.php?directory=business&id="+E.company_id+"'>Email</a>"}if(E.featured_ad){if(E.miniSite==1){C+=(E.phone!=undefined||E.email?"<br/>":"")+"<a href='javascript:void(0)' onclick='show_mini_site("+E.company_id+")'>View Mini Site</a>"}if(E.video==1){C+=' <span><a href="javascript:void(0)" onclick="show_mini_site('+E.company_id+')"><img src="http://'+location.hostname+'/img/map/content/video_icon.gif" border="0"></span>'}}C+="</div>"}C+="<div id='map_bubble_content_loading' class='arial ver_11'>Loading...</div>";return C}function showMapIcon(cat_id,directory,mainCat,businessId,linkId,branch_only,assign_star,biz_in){abortAjax(global_ajax.a);if(document.getElementById){global_ajax.a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(global_ajax.a){global_ajax.a.onreadystatechange=function(){if(global_ajax.a.readyState==4){var companies="";if(global_ajax.a.responseText){companies=eval("("+global_ajax.a.responseText+")")}global_data=filterCompanies(companies);global_directory=directory;global_cat_id=cat_id;global_main_cat=mainCat;global_business_id=businessId;global_branch_only=branch_only;setIconForCompany(cat_id,directory,businessId,global_data,branch_only,assign_star,1);fitListHeight();showCompanyList(global_data,1);if(global_zonename=="2000"){showIconInDistance(global_zonename)}else{if(global_zonename!="all"){showIconInZoneOnly(global_zonename)}}hide_blur_map()}else{show_blur_map()}};var url="http://"+location.hostname+"/asia_travel/mappage/ajax/businessfinder/get_company.php?cat="+cat_id+"&mainCat="+mainCat+"&directory="+directory+"&businessId="+businessId+"&place_id="+place_id+"&address_id="+address_id+"&branch="+branch_only+"&level="+global_curr_level+"&colStart="+last_col_start+"&colEnd="+last_col_end+"&rowStart="+last_row_start+"&rowEnd="+last_row_end+"&biz_in="+biz_in+"&zonename="+global_zonename+"&v="+global.v+global_clear_cache;global_ajax.a.open("GET",url,true);global_ajax.a.send(null)}return false}var global_counter=0;function update_data(rowStart,rowEnd,colStart,colEnd,update_icon_position){if(update_icon_position==undefined){update_icon_position=true}abortAjax(global_ajax.a);if(rowEnd<=0||colEnd<=0){hide_blur_map();return false}else{if(colStart>MapAPI.mapClient.mapScale.maxCol||rowStart>MapAPI.mapClient.mapScale.maxRow){hide_blur_map();return false}}if(!global_cat_id&&!global_business_id){hide_blur_map();return false}if(document.getElementById){global_ajax.a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(global_ajax.a){global_ajax.a.onreadystatechange=function(){if(global_ajax.a.readyState==4){var companies=new Array();if(global_ajax.a.responseText&&global.on_animated!=true){companies=eval("("+global_ajax.a.responseText+")");global_data=filterCompanies(companies);setIconForCompany(global_cat_id,global_directory,global_business_id,global_data,global_branch_only,"",update_icon_position);showCompanyList(global_data,1);global.need_update=false}hide_blur_map()}};var url="http://"+location.hostname+"/asia_travel/mappage/ajax/businessfinder/get_company.php?cat="+global_cat_id+"&mainCat="+global_main_cat+"&directory="+global_directory+"&businessId="+global_business_id+"&place_id="+place_id+"&address_id="+address_id+"&branch="+global_branch_only+"&level="+global_curr_level+"&colStart="+colStart+"&colEnd="+colEnd+"&rowStart="+rowStart+"&rowEnd="+rowEnd+"&zonename="+global_zonename+"&v="+global.v+global_clear_cache;global_ajax.a.open("GET",url,true);global_ajax.a.send(null)}return false}function closeInfoWindow(A){if(A=="all"){MapAPI.mapDraw.closeInfoWindow("1")}else{MapAPI.mapDraw.closeInfoWindow(A)}}function getSubMenuPremiumTab(C,E,B){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($("submenu_content")){$("submenu_content").innerHTML=A.responseText}B.fitHeight();if($("slide_show")){loadScript("/js/production/map/slide_show.js");loadCSS("/css/slide_show.css");var F=new slide_show("slide_show");F.init_nav_prev("slide_show_nav_prev","/img/map/left-arrow.gif","/img/map/left-arrow-hover.gif","/img/map/left-arrow-stop.gif");F.init_nav_next("slide_show_nav_next","/img/map/right-arrow.gif","/img/map/right-arrow-hover.gif","/img/map/right-arrow-stop.gif")}}else{if($("submenu_content")){$("submenu_content").innerHTML="Loading..."}}};var D="http://"+location.hostname+"/asia_travel/mappage/ajax/get_bubble_sub_menu.php?company_id="+C+"&directory="+global_directory+"&type="+E+"&v="+global.v+global_clear_cache;A.open("GET",D,true);A.send(null)}}function selectSubMenuPremium(B){var C,D=3;for(C=1;C<=D;C++){if($("bubble_tab_content_"+C)){$("bubble_tab_content_"+C).style.display=(C==B)?"block":"none"}if($("bubble_tab_"+C)){$("bubble_tab_"+C).style.cssText=(C==B)?"background-color:#ffffff;color:#000000;":""}var A=MapAPI.mapDraw.popup[1];A.fitHeight()}}function selectSubMenuBus(B){var D,F=4,C,E=false;for(D=1;D<=F;D++){if($("bubble_tab_content_"+D)){$("bubble_tab_content_"+D).style.display=(D==B)?"block":"none"}if($("bubble_tab_"+D)){if(D==B){$("bubble_tab_"+D).childNodes[0].href="javascript:void(0)";C=$("bubble_tab_"+D).getElementsByTagName("div");if(C.length!=3){C=$("bubble_tab_"+D).innerHTML;$("bubble_tab_"+D).innerHTML='<div style="float:left; height: 22px"><img src="http://'+location.hostname+'/img/map/bus/tab_active_left.gif" width="2" height="22"/></div><div style="padding: 3px 5px 2px 5px; float:left; background: white url(\'http://'+location.hostname+"/img/map/bus/tab_active_center.gif') repeat-x\">"+C+'</div><div style="float:left; height: 22px"><img src="http://'+location.hostname+'/img/map/bus/tab_active_right.gif" width="2" height="22"/></div>'}$("bubble_tab_"+D).style.padding="";$("bubble_tab_"+D).style.borderLeft="";E=false}else{C=$("bubble_tab_"+D).getElementsByTagName("div");if(C.length==3){C[1].childNodes[0].href="javascript:selectSubMenuBus("+D+")";$("bubble_tab_"+D).innerHTML=C[1].innerHTML;$("bubble_tab_"+D).style.padding="0px 7px"}if(E&&($("bubble_tab_"+D).style.borderLeft==""||$("bubble_tab_"+D).style.borderLeft=="medium none")){if(MapAPI.browser.name=="IE"){$("bubble_tab_"+D).style.borderLeft="2px outset #fff"}else{$("bubble_tab_"+D).style.borderLeft="2px groove #fff"}$("bubble_tab_"+D).style.padding="0px 7px 0px 5px"}else{if(!E&&$("bubble_tab_"+D).style.borderLeft){$("bubble_tab_"+D).style.padding="0px 7px";$("bubble_tab_"+D).style.borderLeft=""}}E=true}}var A=MapAPI.mapDraw.popup[1];A.fitHeight()}}function getHTMLBubble(D,B){B.fitHeight();global_bubble.company_id=D.company_id;global_bubble.directory=global_directory;global_bubble.loading=true;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($("map_bubble_content_loading")){$("map_bubble_content_loading").style.display="none"}$("map_bubble_content").innerHTML+=A.responseText;B.fitHeight();if(D.type!="biz"||$("submenu_content")){B.fitHeight();setTimeout(function(){getSubMenuPremiumTab(D.company_id,D.type,B)},750)}}global_bubble.loading=false};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/get_bubble.php?type="+D.type+"&company_id="+D.company_id+"&directory="+global_directory+"&link_id="+D.link_id+"&v="+global.v+global_clear_cache;A.open("GET",C,true);A.send(null)}}function getBusCPBubbleContent(data,bubble,title){var border_style;if(MapAPI.browser.name=="IE"){border_style="outset"}else{border_style="groove"}bubble.fitHeight();global_bubble.loading=true;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){if(data.type=="bus"){var busstops=eval("("+x.responseText+")");var buses=busstops.b;var html='<table cellspacing="0" cellpadding="0" border="0" class="ver_12 arial TextGreen Link19"><tbody><tr><td id="bubble_tab_1" bgcolor="#e4e5e9"><div style="float:left; height: 22px"><img src="http://'+location.hostname+'/img/map/bus/tab_active_left.gif" width="2" height="22"/></div><div style="padding: 3px 5px 2px 5px; float:left; background: white url(\'http://'+location.hostname+'/img/map/bus/tab_active_center.gif\') repeat-x"><a href="javascript:void(0)">Info</a></div><div style="float:left; height: 22px"><img src="http://'+location.hostname+'/img/map/bus/tab_active_right.gif" width="2" height="22"/></div></td>';if(busstops.image_id){html+='<td id="bubble_tab_2" bgcolor="#e4e5e9" style="padding: 0px 7px"><a href="javascript:selectSubMenuBus(2)">Photo</a></td>'}html+='<td id="bubble_tab_3" bgcolor="#e4e5e9" style="'+(busstops.image_id?"padding: 0px 7px 0px 5px; border-left: 2px "+border_style+" #fff":"padding: 0px 7px")+'"><a href="javascript:selectSubMenuBus(3)">To & From Here</a></td>';html+='<td id="bubble_tab_4" bgcolor="#e4e5e9" style="padding: 0px 7px 0px 5px; border-left: 2px '+border_style+' #fff"><a href="javascript:selectSubMenuBus(4)">Bus Route Search</a></td>';html+='</tr></tbody></table><div id="bubble_tab_content_1" class="arial ver_12" style="background-color:#ffffff;padding: 5px 8px">Buses at this stop:<div style="background-color:#ffffff;width:100%;height:100%;position:relative">';for(var i=0;i<buses.length;i++){html+='<span class="sbs_bus"><a href="javascript:void(0);" onclick="drawBusRoute(\''+buses[i].i+"',"+buses[i].d+", '"+data.id+'\')" title="Click to draw this bus route">'+buses[i].i+"</a></span>"}html+='</div><div style="clear:both;padding-top:10px;width:100%; font-size:1px"></div></div>';if(busstops.image_id){html+='<div id="bubble_tab_content_2" class="arial ver_12" style="background-color:#ffffff;padding: 5px 8px; display: none; text-align: center"><a href="'+busstops.image_url+'" target="_blank"><img src="http://'+location.hostname+"/stock_images/travel/simg.php?r="+busstops.image_id+'&bo=4" title="'+data.title+'"/></a></div>'}html+='<div id="bubble_tab_content_3" class="arial ver_12" style="background-color:#ffffff;padding: 5px 8px; display: none;"><form name="bus_bubble_3" onsubmit="return false" style="margin:0px"><table><tr><td height="22">From</td><td>:</td><td><div id="bus_from1"><input type="text" value="'+title+'" readonly="readonly" title="'+title+'" class="arial ver_11" size="37" onmousedown="stopPropagate(event)" style="background-color:#ebebe4; border: 1px solid #969696; padding: 2px 1px; *padding: 2px 2px"/></div><div id="bus_from2" style="display:none"><input id="dd_bus_bubble1" class="arial ver_11" type="text" size="37" onmousedown="stopPropagate(event);"/></div><input type="hidden" name="x1" value="'+data.x_addr+'"/><input type="hidden" name="y1" value="'+data.y_addr+'"/></td><td rowspan="2" valign="middle" style="padding-left: 5px"><img src="http://'+location.hostname+'/img/map/bus/swap_side_nav.gif" width="19" height="23" style="cursor:pointer" onclick="swapBus()" onmouseover="this.src=\'http://'+location.hostname+"/img/map/bus/swap_side_nav_hover.gif'\" onmouseout=\"this.src='http://"+location.hostname+'/img/map/bus/swap_side_nav.gif\'" title="Swap to another direction"/></td></tr><tr><td height="22">To</td><td>:</td><td><div id="bus_to1"><input id="dd_bus_bubble2" class="arial ver_11" type="text" size="37" onmousedown="stopPropagate(event);"/></div><div id="bus_to2" style="display:none"><input type="text" value="'+title+'" readonly="readonly" title="'+title+'" class="arial ver_11" size="37" onmousedown="stopPropagate(event)" style="background-color:#ebebe4; border: 1px solid #969696; padding: 2px 1px; *padding: 2px 2px;"/></div><input type="hidden" name="x2"/><input type="hidden" name="y2"/></td></tr></table><img src="http://'+location.hostname+'/img/dd_search/dd_panel/go-button-bus.jpg" width="139" height="47" style="position:relative; left: 145px; cursor:pointer" onclick="byBus()" title="Search Bus Route"/></form></div>';html+='<div id="bubble_tab_content_4" class="arial ver_12" style="background-color:#ffffff;padding: 5px 8px; display: none;"><div>Bus Service Number <input type="text" size="5" maxlength="5" onmousedown="stopPropagate(event);"/></div><img src="http://'+location.hostname+'/img/dd_search/dd_panel/go-button-bus.jpg" width="139" height="47" style="position:relative; left: 145px; cursor:pointer" onclick="searchBus(this)" title="Search Bus Service Route"/></div>'}else{if(data.type=="cp"){var cps=eval("("+x.responseText+")");if(cps.length>0){var html='<div class="arial ver_12" style="padding-bottom: 10px">Rates at this car park:</div>';html+='<table class="arial ver_11 carpark_bubble"><tr><th>Day</th><th>Rate</th></tr>';for(var i=0;i<cps.length;i++){html+="<tr><td>"+cps[i].day+"</td><td>"+cps[i].rate+"</td></tr>"}html+="</table>"}else{var html='<span class="arial ver_12">Sorry, rates are not available currently.</span>'}}}$("map_bubble_content").innerHTML='<div style="padding-bottom: 7px; padding-right: 9px"><span class="arial ver_14"><b>'+title+(title.charAt(title.length-1)=="."?"":".")+"</b>&nbsp;Bus stop no: "+data.id+"</span></div>"+html;bubble.fitHeight();loadScript("/routing/js/autoSuggest1.js");var options_from={script:function(dd_bus_bubble1){return"http://"+location.hostname+"/asia_travel/mappage/ajax/search_location.php?q="+dd_bus_bubble1+"&v="+global.v_c+global_clear_cache},varname:"dd_bus_bubble1",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(dd_bus_bubble1){if(dd_bus_bubble1){document.bus_bubble_3.x1.value=dd_bus_bubble1.x;document.bus_bubble_3.y1.value=dd_bus_bubble1.y}}};new bsn.AutoSuggest("dd_bus_bubble1",options_from);var options_to={script:function(dd_bus_bubble2){return"http://"+location.hostname+"/asia_travel/mappage/ajax/search_location.php?q="+dd_bus_bubble2+"&v="+global.v_c+global_clear_cache},varname:"dd_bus_bubble2",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(dd_bus_bubble2){if(dd_bus_bubble2){document.bus_bubble_3.x2.value=dd_bus_bubble2.x;document.bus_bubble_3.y2.value=dd_bus_bubble2.y}}};new bsn.AutoSuggest("dd_bus_bubble2",options_to)}global_bubble.loading=false};var url="http://"+location.hostname+"/asia_travel/mappage/ajax/get_buscp_bubble.php?type="+data.type+"&id="+data.id+"&v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null)}}function searchBus(B){var A=B.parentNode.getElementsByTagName("input")[0].value;if(A){reset_mappage(true,true,true);drawBusRoute(A,1,1,true)}}function swapBus(){if($("bus_from1").style.display==""){$("bus_from1").style.display="none";$("bus_from2").style.display="";$("bus_to1").style.display="none";$("bus_to2").style.display="";$("dd_bus_bubble1").value=$("dd_bus_bubble2").value}else{$("bus_from1").style.display="";$("bus_from2").style.display="none";$("bus_to1").style.display="";$("bus_to2").style.display="none";$("dd_bus_bubble2").value=$("dd_bus_bubble1").value}var A=document.bus_bubble_3.x1.value;document.bus_bubble_3.x1.value=document.bus_bubble_3.x2.value;document.bus_bubble_3.x2.value=A;A=document.bus_bubble_3.y1.value;document.bus_bubble_3.y1.value=document.bus_bubble_3.y2.value;document.bus_bubble_3.y2.value=A}function byBus(){var F=document.bus_bubble_3;var C=F.x1.value,B=F.x2.value,E=F.y1.value,D=F.y2.value;var A=MapAPI.mapDraw.panelIcon.routes;var H=new WGSProjection();if($("bus_from1").style.display==""){if($("dd_bus_bubble2").value==""||B==""||D==""){alert("Please input end address");return false}var G=H.geoToUTM(D,B,MapAPI.mapClient.mapSource.mapZone,MapAPI.mapClient.mapSource.isSouth);B=G.x;D=G.y}else{if($("dd_bus_bubble1").value==""||C==""||E==""){alert("Please input start address");return false}var G=H.geoToUTM(E,C,MapAPI.mapClient.mapSource.mapZone,MapAPI.mapClient.mapSource.isSouth);C=G.x;E=G.y}A.setMode(1,0);A.drawStart(C,E);A.drawEnd(B,D);A.updatePosition();A.drawRoute();showRouteList(A,1)}function drawBusRoute(no,direction,bus_stop_id,go_center){reset_mappage(true,true,true);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){var xylist=x.responseText;if(xylist=='""'){MapAPI.mapDraw.panelLine.deleteLines();alert("Sorry, we have no route information for this bus service")}else{var center_point=false;xylist=eval("("+xylist+")");MapAPI.mapDraw.panelLine.deleteLines();MapAPI.mapDraw.panelLine.useDirection=true;if(xylist[1]){var tmp=xylist[1].split(",");var points=new Array();for(var i=0,len=tmp.length;i<len;i+=2){points.push(new Vertex(tmp[i],tmp[i+1]))}MapAPI.mapDraw.addLine(points)}if(xylist[2]){var tmp=xylist[2].split(",");var points=new Array();for(var i=0,len=tmp.length;i<len;i+=2){points.push(new Vertex(tmp[i],tmp[i+1]))}MapAPI.mapDraw.addLine(points,"#9400D3")}if(xylist.d){drawBusStops(no,direction,xylist.d);if(go_center){center_point=xylist.d[bus_stop_id-1]}}MapAPI.mapDraw.panelLine.updatePosition();if(center_point){MapAPI.mapClient.setCenterVertex(center_point);setLastPos(center_point.x,center_point.y);MapAPI.mapClient.DrawMap()}hideDDForm()}hide_element("loading_route")}};show_element("loading_route");if(no.search(/\d$/)!=-1){no=no.toLowerCase().replace(/^0+/,"")}else{no=no.toLowerCase()}var longlat="";if(MapAPI.mapClient.mapScale.mode=="Mercator"){longlat="&longlat=1"}var url="http://"+location.hostname+"/asia_travel/mappage/ajax/get_bus_service_route.php?no="+no+"&d="+direction+longlat+"&v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null);showBusRouteList(no,direction,bus_stop_id)}}function drawBusStops(E,D,C){if(!MapAPI.mapDraw.panelIcon.bus_routes){MapAPI.mapDraw.panelIcon.bus_route=new BusRoute(MapAPI.mapClient)}for(var B=0,A=C.length;B<A;B++){drawBusStop(B+1,E,D,C[B])}}function drawBusStop(H,I,F,C){var E,B,A=new Object(),D,G;E=MapAPI.mapDraw.panelIcon.addBusStop(I,F,C.x,C.y,H,17,17);E.obj.onclick=function(K){B='<div style="padding-bottom: 7px; padding-right: 9px"><span class="arial ver_14"><b>'+C.t+(C.t.charAt(C.t.length-1)=="."?"":".")+"</b>&nbsp;Bus stop no: "+C.i+'</span></div><div id="map_bubble_content_loading" class="arial ver_11">Loading...</div>';var J=fix_xy(C.x,C.y);D=MapAPI.mapDraw.openBubble(330,225,J,B);A.id=C.i;A.title=C.t;A.type="bus";A.x_addr=C.x;A.y_addr=C.y;getBusCPBubbleContent(A,D,C.t);MapAPI.mapDraw.closeToolTips()}}function showZoneAuto(E,A,B,D){MapAPI.removePreloadMap();MapAPI.mapDraw.panelLine.deleteLines();MapAPI.mapDraw.panelDraw.deleteGeofences();var C="zone_"+str_replace("+","",E);if($(global_last_zone_selected)){$(global_last_zone_selected).style.fontWeight=""}if($(C)){$(C).style.fontWeight="bold";global_last_zone_selected=C}if(E=="all"||E==""){unHideAllMapIcon();MapAPI.mapDraw.panelIcon.updatePosition();hideBoxInZone()}else{if(E=="2000"){MapAPI.mapDraw.addGeofence(default_xy.x,default_xy.y,parseFloat(E));MapAPI.mapClient.ChangeLevel(3);showIconInDistance(E)}else{MapAPI.updateScaleImage();drawZoneAuto(E,A,B,D)}}showMenuId("hide","divDistrictBox","imgUpKl","imgDownKl")}function drawZoneAuto(F,A,B,E){if(document.getElementById){var D=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(D){D.onreadystatechange=function(){if(D.readyState==4&&D.status==200){var I=new Array(),K,T=(D.responseText).split("\n");var Q=T[0].split(",");var N=T[1].split(",");var J=Q.length;var R,P;if(T[2]){var H=T[2].split(",");R=H[0];P=H[1];for(K=0;K<J;K++){I.push(new Vertex(Q[K],N[K]))}}else{var G=0,S=0,M=9999999,O=9999999;for(K=0;K<J;K++){I.push(new Vertex(Q[K],N[K]));if(Q[K]>G){G=Q[K]}if(Q[K]<O){O=Q[K]}if(N[K]>S){S=N[K]}if(N[K]<M){M=N[K]}}R=(parseFloat(G)+parseFloat(O))/2;P=(parseFloat(S)+parseFloat(M))/2}MapAPI.mapClient.loadMapSource(E);MapAPI.mapClient.mapScale=copy_obj(MapAPI.mapClient.mapSource.getFirstScaleLevel(5));MapAPI.mapClient.mapSource.name=E;MapAPI.mapClient.setCenterVertex(new Vertex(R,P));var L=MapAPI.mapClient.vertexToScreen(R,P);MapAPI.mapClient.levelIndex=5;MapAPI.mapClient.DrawMap();MapAPI.mapDraw.hideAllIcon();moveStarPosition(MapAPI.mapClient,L);MapAPI.mapDraw.addLine(I)}};var C="http://"+location.hostname+"/"+B+"/include/get_zone.php?zonename="+F+"&zonedata="+A;D.open("GET",C,true);D.send(null)}return false};function change_mappage_title(A,D,C,F){var E=function(G){$("show_titleMap").innerHTML='<div style="padding-top: 18px;"><div style="border-left: 1px solid rgb(233, 233, 233); padding-left: 13px; height: 100%;"><div style="width: 240px; position: relative; z-index: 1; top: -5px;">'+G+"</div></div></div>"};var B=baseurl+"/malaysia/inface/container/get_mappage_title.php?travel_id="+A+"&travel_site="+D+"&state_id="+C+"&state_name="+F+global_clear_cache+"&v="+global.v;ajax(B,E)}function showBusDD(B){if(B){loadScript("/routing/js/autoSuggest1.js");show_element("show_dd");var D={script:function(F){return baseurl+"/routing/search_location.php?q="+F},varname:"dd_from",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(F){if(F){document.search_form.new_link_id_1.value=F.id}}};var A=new bsn.AutoSuggest("dd_from",D);var C={script:function(F){return baseurl+"/routing/search_location.php?q="+F},varname:"dd_to",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(F){if(F){document.search_form.new_link_id_2.value=F.id}}};var E=new bsn.AutoSuggest("dd_to",C);if($("content_listing")){fitListHeight()}}else{hide_element("show_dd")}}function hideBusDDForm(){hide_element("show_dd");if($("content_listing")){fitListHeight()}}function showDropDown(B,A){if(A=="show"){$(B).style.display="block"}else{$(B).style.display="none"}}function showDropZone(A){if(A=="show"){$("divDropZone").style.display="block";statDivZone=1}else{$("divDropZone").style.display="none";statDivZone=0}}function showMore(){if(!moreFlag){$("moreText").innerHTML='<a href="javascript:void(0)" onclick="showMore()">Close</a>';$("moreLink").style.display="block";moreFlag=1}else{$("moreText").innerHTML='<a href="javascript:void(0)" onclick="showMore()">More</a>..';$("moreLink").style.display="none";moreFlag=0}}function showSearchResult(A){if(!$("close_search_result")){return }if(!A){$("close_search_result").innerHTML='<a href="javascript:void(0);" title="Minimize Search Result" onclick="showSearchResult(true)"><img src="'+baseurl+'/img/map/content/close-active.gif" border="0" title="Minimize" onmouseover="this.src=\''+baseurl+"/img/map/content/close-unactive.gif'\" onmouseout=\"this.src='"+baseurl+"/img/map/content/close-active.gif'\"  /></a>";$("divTitleHide").style.display="none";$("divTitleShow").style.display="block";$("hide_tab").style.display="none";$("show_tab").style.display="block";$("content_listing").style.height=$("featured_ad_listing").style.display=="none"?"439px":"231px";A=1}else{if($("close_search_result")){$("close_search_result").innerHTML='<a href="javascript:void(0);" title="Maximize Search Result" onclick="showSearchResult(false)"><img src="'+baseurl+'/img/map/content/maximize-active.gif" border="0" title="Maximize" onmouseover="this.src=\''+baseurl+"/img/map/content/maximize-unactive.gif'\" onmouseout=\"this.src='"+baseurl+"/img/map/content/maximize-active.gif'\"  /></a>"}$("divTitleHide").style.display="block";$("divTitleShow").style.display="none";$("hide_tab").style.display="block";$("show_tab").style.display="none";$("content_listing").style.height=$("featured_ad_listing").style.display=="none"?"539px":"331px";A=0}}function smProceed(C){var B=$("phonenum");var D=B.value;if((D.length>=8)&&(D.length<=10)&&(D.substr(0,2)!="65")&&((D.substr(0,1)=="8")||(D.substr(0,1)=="9"))){var E=$("last_pos").innerHTML.split(",");var A=baseurl+"/payment/services/smsmap/confirm.php?"+C+"&dest="+D;if(window.global_curr_level!=undefined){A+="&x="+E[0]+"&y="+E[1]+"&level="+global_curr_level}window.open(A)}else{alert("Please specify a valid mobile number");B.focus()}}function submit_form_dd(){var E=document.search_form,C="";if(E.mode[0].checked){mode=E.mode[0].value}else{if(E.mode[1].checked){mode=E.mode[1].value}else{C="Please select Your Mode of Transport"}}if(C==""){var G=E.new_link_id_1.value;var D=E.dd_from.value;var F=E.new_link_id_2.value;var B=E.dd_to.value;if(G==0||D==""){alert("Please input start address");E.new_link_id_1.focus()}else{if(F==0||D==""){alert("Please input end address");E.new_link_id_2.focus()}else{if(G==F){alert("Start address and input address can not be same");E.new_link_id_1.focus()}else{var A;if(mode=="bus"){A="http://"+location.hostname+"/travel/bus_guide/main/"+G+"_to_"+F+"/"}else{A="http://"+location.hostname+"/routing/automobile_guide/"+G+"_to_"+F+"/major_roads/"}if(E.new_window.checked){window.open(A)}else{location.href=A}}}}}else{alert(C)}}function changeGloMode(B){var C,D=document.search_form,A,E;global_mode=!global_mode;if(global_mode){if(B){E=D.dd_to.value;D.dd_to.value=D.dd_from.value;D.dd_from.value=E}else{$("mode1_from").style.display="block";$("mode1_to").style.display="block";$("mode2_from").style.display="none";$("mode2_to").style.display="none";D.dd_to.value=D.dd_from.value}A=D.new_link_id_2.value;D.new_link_id_2.value=D.new_link_id_1.value;D.new_link_id_1.value=A}else{if(B){E=D.dd_from.value;D.dd_from.value=D.dd_to.value;D.dd_to.value=E}else{$("mode2_from").style.display="block";$("mode2_to").style.display="block";$("mode1_from").style.display="none";$("mode1_to").style.display="none";D.dd_from.value=D.dd_to.value}A=D.new_link_id_1.value;D.new_link_id_1.value=D.new_link_id_2.value;D.new_link_id_2.value=A}}function showRelatedDropDown(F,B,D){if(!$("showRelatedDropDown")){var G=document.createElement("div");G.id="showRelatedDropDown";G.style.cssText="position:absolute;top:20px;left:8px;z-index:10;border:1px #999999 solid; background:#FFFFFF; line-height:15px; padding:2px;width:220px";var E=$("content_listing_title").appendChild(G)}show_element("showRelatedDropDown");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){$("showRelatedDropDown").innerHTML=A.responseText}else{$("showRelatedDropDown").innerHTML="";hide_element("showRelatedDropDown")}}else{$("showRelatedDropDown").innerHTML="Loading..."}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/businessfinder/get_related_service_dropdown.php?cat="+F+"&directory="+B+"&cat_name="+D;A.open("GET",C,true);A.send(null)}return false};function createLocationBox(C,A){if(!$("get_location_box")){var D=$("imgDiv");var B=document.createElement("div");B.id="get_location_box";B.style.cssText="position:absolute; top:0px; right:0px; z-index:1000; width:414px;";B.innerHTML=C;D.appendChild(B)}}function getLocationBox(G){if(document.getElementById){var A=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(A){A.onreadystatechange=function(){close_all_form();if(A.readyState==4&&A.status==200){closeLoadingLocationBox();createLocationBox(A.responseText,G)}else{showLoadingLocationBox(G)}};var D=getLastPos();var C=getOriginalPos();var F="",E="";if(D.x==C.x&&D.y==C.y){F="&same=1"}saved_last_pos=D;D=D.x+","+D.y;if(window.MapAPI){E="&s="+MapAPI.mapClient.mapName}else{E="&s="+global.s}var B="http://"+location.hostname+"/malaysia/inface/container/get_location_code.php?last_pos="+D+"&l="+global_curr_level+"&type="+G+F+E+"&v="+global.v_c;A.open("GET",B,true);A.send(null)}return false}function showLoadingLocationBox(C){if($("loading_box")){$("loading_box").style.display="block"}else{var B=document.createElement("div");B.id="loading_box";B.style.cssText="position:absolute; top:0px; right:0px; width:414px; z-index:1000; height:226px; overflow:hidden;  background-color:#FFFFFF; border:1px solid #CCCCCC;";var A=document.createElement("img");A.src="http://"+location.hostname+"/img/map/loading-icon.gif";A.style.cssText="position:absolute; top:70px; z-index:1; left: 180px;";B.appendChild(A);var E=document.createElement("div");E.style.cssText="position:absolute; top:5px; right:-350px; width:375px; z-index:1000; height:200px; font-size:12px";E.innerHTML='<a href="javascript:void(0);" onclick="javascript:closeLoadingLocationBox();">[x]</a>';B.appendChild(E);var D=$("imgDiv");D.appendChild(B)}}function closeLoadingLocationBox(){if($("loading_box")){$("loading_box").style.display="none"}}function openLocationBox(A){closeLoadingLocationBox();if(saved_last_pos==getLastPos()){showLocationBox()}else{if($("get_location_box")){removeElement("get_location_box")}getLocationBox(A)}}function closeLocationBox(){if($("get_location_box")){$("get_location_box").style.display="none"}}function showLocationBox(){if($("get_location_box")){$("get_location_box").style.display="block"}}function close_email_form(){hide_element("email_form")}function show_email_form(){close_all_form();if($("email_form")){$("email_form").innerHTML=global_email_form;$("email_form").style.display="block"}else{var B=document.createElement("div");B.id="email_form";B.style.cssText="position:absolute;left:55px;top:0px;z-index:20;";var D=$("imgDiv");D.appendChild(B);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_email_form=A.responseText;$("email_form").innerHTML=A.responseText}else{$("email_form").innerHTML="<b>Loading...</b>"}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/show_email_form.php?v="+global.v;A.open("GET",C,true);A.send(null)}return false}}function showLink(){$("show_link").style.display="block";$("show_link").value=getMapLink()}function close_sms_form(){if($("sms_form")){$("sms_form").style.display="none"}}function show_sms_form(E){close_all_form();if($("sms_form")){$("sms_form").innerHTML=global_sms_form;$("sms_form").style.display="block"}else{var B=document.createElement("div");B.id="sms_form";B.style.cssText="position:absolute;left:116px;top:0px;z-index:20;";var D=$("imgDiv");D.appendChild(B);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_sms_form=A.responseText;$("sms_form").innerHTML=A.responseText}else{$("sms_form").innerHTML="<b>Loading...</b>"}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/show_sms_form.php?"+E+"&v="+global.v;A.open("GET",C,true);A.send(null)}return false}}function changeWidgetColor(A){if(A=="blue"){$("blueWidget").style.display="block";$("blackWidget").style.display="none";$("blueWidgetScript").style.display="block";$("blackWidgetScript").style.display="none";$("blueBox").style.border="1px solid #FDB002";$("blueBox").style.padding="1px";$("blackBox").style.border="";$("blackBox").style.padding=""}else{$("blueWidget").style.display="none";$("blackWidget").style.display="block";$("blueBox").style.display="block";$("blackBox").style.display="block";$("blueWidgetScript").style.display="none";$("blackWidgetScript").style.display="block";$("blueBox").style.border="";$("blueBox").style.padding="";$("blackBox").style.border="1px solid #FDB002";$("blackBox").style.padding="1px"}}function getMapLink(){var B=getLastPos(),C=global_this_page+"?";var B=getLastPos();var A=getOriginalPos();if(B.x==A.x&&B.y==A.y){C=global_this_page}else{C=global_this_page+"?x="+B.x+"&y="+B.y}return C}function submitEmail(){var D=document.frmEmail;var F=D.toEmail.value;var G=D.fromEmail.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}$");pattern=new RegExp("^[a-zA-Z0-9]+(([_]|\\.|-)?[a-zA-Z0-9])*@([a-zA-Z0-9]+([_]|-?[a-zA-Z0-9])*(\\.))+[a-zA-Z]{2,4}(,[a-zA-Z0-9]+(([_]|\\.|-)?[a-zA-Z0-9])*@([a-zA-Z0-9]+([_]|-?[a-zA-Z0-9])*(\\.))+[a-zA-Z]{2,4})*$");if(F.search(pattern)){alert("Please input a valid email address, separate email with comma(,)");D.toEmail.focus();return false}if(G.search(single_pattern)){alert("Please input a valid email address");D.fromEmail.focus();return false}if(D.txtImage.value==""){alert("Please input the Code");D.txtImage.focus();return false}var C=str_replace("&","%26",getMapLink());var E="newsletters="+(D.newsletters.value)+"&subject="+(D.subject.value)+"&link="+C+"&txtImage="+(D.txtImage.value)+"&toEmail="+(D.toEmail.value)+"&message="+(D.message.value)+"&body="+(D.body.value)+"&fromEmail="+(D.fromEmail.value)+"&title="+(D.title.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){$("email_form").style.display="none";alert("We will endeavor to ensure that the attached map link in the email will reach your address.")}else{if(A.readyState==4&&A.status==401){D.txtImage.focus();D.txtImage.style.backgroundColor="#ffff00";alert("Invalid code")}else{}}};var B="http://"+location.hostname+"/asia_travel/mappage/ajax/emailmap_process.php?v="+global.v;A.open("POST",B,true);A.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.send(E)}return false}function close_feedback(){hide_element("feedback_list")}function show_feedback(){close_all_form();if($("feedback_list")){$("feedback_list").style.display="block"}else{var B=document.createElement("div");B.id="feedback_list";B.style.cssText="position:relative;left:0px;top:0px;z-index:2001;";var D=$("feedback_div");D.onmouseout=function(E){if(checkMouseLeave(D,E)){close_feedback()}};D.appendChild(B);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){$("feedback_list").innerHTML=A.responseText}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/show_feedback.php?v="+global.v;A.open("GET",C,true);A.send(null)}return false}}function close_feedback_form(){if($("feedback_form_outdatedmaps")){$("feedback_form_outdatedmaps").style.display="none"}if($("feedback_form_general")){$("feedback_form_general").style.display="none"}if($("feedback_form_postalcode")){$("feedback_form_postalcode").style.display="none"}}function show_feedback_form(E){close_all_form();if($("feedback_form_"+E)){$("feedback_form_"+E).innerHTML=global_feedback_form[E];$("feedback_form_"+E).style.display="block"}else{var B=document.createElement("div");B.id="feedback_form_"+E;B.style.cssText="position:absolute;left:116px;top:0px;z-index:20;";var D=$("imgDiv");D.appendChild(B);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_feedback_form[E]=A.responseText;$("feedback_form_"+E).innerHTML=A.responseText}else{$("feedback_form_"+E).innerHTML="<b>Loading...</b>"}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/show_feedback_form.php?type="+E+"&v="+global.v;A.open("GET",C,true);A.send(null)}return false}}function submitFeedback(C){var F="";var E=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($("title").value==""){F+="- Title is empty\n"}if($("name").value==""){F+="- Name is empty\n"}if(E.value==""||E.search(single_pattern)){F+="- Email is not valid\n"}if($("phone").value==""||isNaN($("phone").value)){F+="- Phone is not valid\n"}if(C=="outdatedmaps"){if($("kind").value==""){F+="- Type of Error is empty\n"}if($("descerror").value==""){F+="- The Error is empty\n"}}else{if(C=="general"){if($("descerror").value==""){F+="- Suggestion is empty\n"}}else{if($("codeerror").value==""){F+="- Describe the Error is empty\n"}if($("misspostal").value==""||isNaN($("misspostal").value)){F+="- Missing Postal Code is not valid\n"}}}if(F){F="Error was occur:\n"+F;alert(F);return false}$("buttonSubmit").style.display="none";$("buttonDisable").style.display="block";var D="valTitle="+($("title").value)+"&valEmail="+($("email").value)+"&valName="+($("name").value)+"&valPhone="+$("phone").value;if(C=="outdatedmaps"){D+="&valKind="+($("kind").value)+"&valDescerror="+($("descerror").value)}else{if(C=="general"){D+="&valDescerror="+($("descerror").value)}else{D+="&valCodeerror="+($("codeerror").value)+"&valMisspostal="+($("misspostal").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){$("feedback_form_"+C).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/feedback_process.php?type="+C+"&v="+global.v;A.open("POST",B,true);A.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.send(D)}return false}function close_tweet(){if($("tweet_form")){$("tweet_form").style.display="none"}}function show_tweet(){close_all_form();if($("tweet_form")){$("tweet_form").innerHTML=global_tweet_form;$("tweet_form").style.display="block"}else{var D=document.createElement("div");D.id="tweet_form";D.style.cssText="position:absolute;left:260px;top:0px;z-index:20;";var C=$("imgDiv");C.appendChild(D);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_tweet_form=A.responseText;$("tweet_form").innerHTML=A.responseText}else{$("tweet_form").innerHTML="<b>Loading...</b>"}};var B="http://"+location.hostname+"/asia_travel/mappage/ajax/show_tweet_form.php?v="+global.v;A.open("GET",B,true);A.send(null)}return false}}function close_fb(){if($("fb_form")){$("fb_form").style.display="none"}}function show_fb(){close_all_form();if($("fb_form")){$("fb_form").innerHTML=global_fb_form;$("fb_form").style.display="block"}else{var D=document.createElement("div");D.id="fb_form";D.style.cssText="position:absolute;left:163px;top:0px;z-index:1000;";var C=$("imgDiv");C.appendChild(D);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_fb_form=A.responseText;$("fb_form").innerHTML=A.responseText}else{$("fb_form").innerHTML="<b>Loading...</b>"}};var B="http://"+location.hostname+"/asia_travel/mappage/ajax/show_fb_form.php?v="+global.v;A.open("GET",B,true);A.send(null)}return false}}function close_all_form(){close_email_form();close_sms_form();close_feedback();close_feedback_form();close_fb();close_tweet();closeLocationBox()}function showDDForm(){close_all_form();if($("dd_form")){$("dd_form").style.display="block";MapAPI.ddContainer.div_box.onclick=hideDDForm}else{var B=document.createElement("div"),F,E;B.id="dd_form";if(MapAPI.feature=="busmrt"){F=0;E=170}else{F=0;E=213}B.style.cssText="position:absolute;left:"+E+"px;top:"+F+"px;z-index:20; line-height: 17px";var D=$("imgDiv");D.appendChild(B);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_sms_form=A.responseText;$("dd_form").innerHTML=A.responseText;loadScript("/routing/js/autoSuggest1.js");var J={script:function(K){return baseurl+"/asia_travel/mappage/ajax/search_location.php?q="+K+global_clear_cache},varname:"dd_from",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(K){if(K){document.travel_form.new_link_id_1.value=K.id;document.travel_form.x1.value=K.x;document.travel_form.y1.value=K.y}}};var H=new bsn.AutoSuggest("travel_from",J);var G={script:function(K){return baseurl+"/asia_travel/mappage/ajax/search_location.php?q="+K+global_clear_cache},varname:"dd_to",json:true,shownoresults:false,timeout:5000,minchars:2,maxresults:10,callback:function(K){if(K){document.travel_form.new_link_id_2.value=K.id;document.travel_form.x2.value=K.x;document.travel_form.y2.value=K.y}}};var I=new bsn.AutoSuggest("travel_to",G)}else{$("dd_form").innerHTML="<b>Loading...</b>"}};var C="http://"+location.hostname+"/asia_travel/mappage/ajax/show_dd_form.php?v="+global.v_c;A.open("GET",C,true);A.send(null)}MapAPI.ddContainer.div_box.onclick=hideDDForm;return false}}function ddChange(C,A){var B;if(C==0){if(A==0){B="Shortest Distance"}else{if(A==3){B="Major Roads"}else{B="Expressway"}}$("dd_button").src="http://"+location.hostname+"/img/dd_search/dd_panel/go-button-white.jpg";$("bus_service_div").style.display="none";$("customize_route").style.paddingLeft="10px";$("bus_mode_route").style.display="none"}else{if(A==0){B="Bus"}else{if(A==1){B="MRT"}else{B="Bus & MRT"}}$("dd_button").src="http://"+location.hostname+"/img/dd_search/dd_panel/go-button-bus.jpg";if(A==0){$("bus_service_div").style.display="";$("bus_mode_route").style.display="";$("customize_route").style.paddingLeft="30px"}else{$("bus_service_div").style.display="none";$("bus_mode_route").style.display="none";$("customize_route").style.paddingLeft="10px"}}MapAPI.ddContainer.div_text.innerHTML=B;MapAPI.mapDraw.panelIcon.routes.setMode(C,A);if(MapAPI.mapDraw.panelIcon.routes.start&&MapAPI.mapDraw.panelIcon.routes.end){hideDDForm();MapAPI.mapDraw.panelIcon.routes.drawRoute();showRouteList(MapAPI.mapDraw.panelIcon.routes,1)}}function hideDDForm(){if($("dd_form")){$("dd_form").style.display="none";MapAPI.ddContainer.div_box.onclick=showDDForm}};function Traffic(parent_id){this.parent_id=parent_id;this.code="";this.ajax_path;this.mapapi=MapAPI;this.outsg_status="";this.insg_status="mini";this.show_default=false;this.first=true;this.init=function(code){this.ajax_path="http://"+location.hostname+"/asia_travel/mappage/ajax/traffic_show";if(code=="rw"){this.show_big2_menu();$("bc_rw").checked=true;this.show_traffic("rw");$("bc_cc").checked=true;this.show_traffic("cc")}else{if(code=="tc"){this.show_big2_menu();$("bc_cc").checked=true;this.show_traffic("cc");this.show_default=9703;$("bc_tc").checked=true;this.show_traffic("tc")}else{if(code=="erp"){this.show_big2_menu();$("bc_cc").checked=true;this.show_traffic("cc");$("bc_erp").checked=true;this.show_traffic("erp")}else{if(code=="WC"){this.show_big_menu();this.show_default=2702;$("cb_cc").checked=true;this.show_traffic("cc")}else{if(code=="TC"){this.show_big_menu();this.show_default=4713;$("cb_cc").checked=true;this.show_traffic("cc")}else{if(code=="cc"){this.show_big_menu();$("cb_cc").checked=true;this.show_traffic("cc")}else{this.show_big_menu();$("cb_in").checked=true;this.show_traffic("in");$("cb_cc").checked=true;this.show_traffic("cc");if(this.mapapi.mapClient.levelIndex<4||this.mapapi.mapClient.mapName!="sg"){this.show_small_menu()}}}}}}}};this.show_small_menu=function(){hide_element("menu_big");if($("menu_small")){show_element("menu_small")}else{var self=this;var parent=$(this.parent_id);var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){var menu=css_sprite("map_legend_ie",104,31,39,34,"","","right: 0px; z-index:10; cursor: pointer;")}else{var menu=css_sprite("map_legend",104,31,39,34,"","","right: 0px; z-index:10; cursor: pointer;")}menu.id="menu_small";menu.onclick=function(){if(self.insg_status=="mini"){if(!$("menu_big")){traffic.show_big_menu()}else{show_element("menu_big")}}else{if(self.insg_status=="max"){if(!$("menu_big2")){traffic.show_big2_menu()}else{show_element("menu_big2")}}else{if(self.insg_status=="closed"){self.insg_status="mini";if(!$("menu_big")){traffic.show_big_menu()}else{show_element("menu_big")}}}}};parent.appendChild(menu)}};this.show_big2_menu=function(){this.insg_status="max";hide_element("menu_small");hide_element("menu_big");var parent=$(this.parent_id);var menu=document.createElement("div");menu.id="menu_big2";menu.style.cssText="position:absolute;top:0px;right:0px;width:104px; height:194px;z-index:100;line-height:15px;cursor:default;";var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){var background=css_sprite("map_legend_ie",104,190,144,34)}else{var background=css_sprite("map_legend",104,190,144,34)}var self=this;var menu_content=document.createElement("div");menu_content.className="arial";menu_content.style.cssText="position:absolute;top:20px;padding-left:10px;z-index:101;";var offset_set=document.all?18:16;var feature_list=Array("Car Park Rates","ERP Rates","Traffic Cams","Slow Traffic","Accidents","Road Works","Causeway Cams");var feature_code=Array("cpr","erp","tc","st","in","rw","cc");var code="",feature_str="",feature="";var offset_ie=(document.all)?"height:17px;width:15px;":"";feature_str='<div style="padding-bottom:1px;">View : </div>';for(var i=0;i<feature_list.length;i++){code=feature_code[i];feature=feature_list[i];feature_str+='<input type="checkbox" id="bc_'+code+'" onclick="traffic.show_traffic(\''+code+'\');" style="padding:0px; margin:0px;'+offset_ie+'"> <span onclick="$(\'bc_'+code+"').checked = !$('bc_"+code+"').checked; traffic.show_traffic('"+code+'\');" style="font-size:9px; line-height:100%">'+feature+"</span>";if(i<feature_list.length-1){feature_str+="<br/>"}}menu_content.innerHTML=feature_str+'<div class="TextBold" align="center" style="margin-top:-3px;"><a href="'+baseurl+'/mileageclaims/" target="_blank" style="color:#CA0B0B;"><u>Mileage Claims</u></a></div>';var moreUp=css_sprite("map_legend",80,15,141,0,8,170);moreUp.style.cursor="pointer";moreUp.onclick=function(){hide_element("menu_big2");if(!$("menu_big")){traffic.show_big_menu()}show_element("menu_big");$("cb_in").checked=$("bc_in").checked;$("cb_cc").checked=$("bc_cc").checked;self.insg_status="mini"};moreUp.onmouseover=function(){moreUp.setBgPosition(141,17)};moreUp.onmouseout=function(){moreUp.setBgPosition(141,0)};var closeButton=css_sprite("map_legend",14,15,222,0,89,170);closeButton.style.cursor="pointer";closeButton.onclick=function(){hide_element("menu_big");hide_element("menu_big2");traffic.show_small_menu(true);self.outsg_status="closed";self.insg_status="closed"};closeButton.onmouseover=function(){closeButton.setBgPosition(222,17)};closeButton.onmouseout=function(){closeButton.setBgPosition(222,0)};if((version>=5.5)&&(version<7)&&(document.body.filters)){var arrow=css_sprite("map_legend_ie",40,30,117,267,"",0,"right: 0px;")}else{var arrow=css_sprite("map_legend",40,30,117,267,"",0,"right: 0px;")}arrow.title="Close Driver's Kit";arrow.onclick=function(){hide_element("menu_big");hide_element("menu_big2");traffic.show_small_menu(true);self.insg_status="closed"};menu.appendChild(background);parent.appendChild(menu);menu.appendChild(moreUp);menu.appendChild(closeButton);menu.appendChild(menu_content);menu.appendChild(arrow)};this.show_big_menu=function(){hide_element("menu_small");if($("menu_big2")){hide_element("menu_big2")}if($("menu_big")){show_element("menu_big")}else{var parent=$(this.parent_id);var menu=document.createElement("div");menu.id="menu_big";menu.style.cssText="position:absolute;top:0px;right:0px;width:104px; height:100px;z-index:100;line-height:15px;cursor:default;";var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){var background=css_sprite("map_legend_ie",104,97,39,66)}else{var background=css_sprite("map_legend",104,97,39,66)}var menu_content=document.createElement("div");menu_content.className="arial";menu_content.style.cssText="position:absolute;top:20px;padding-left:10px;z-index:101;";var offset_set=document.all?18:16;var feature_list=Array("Accidents","Causeway Cams");var feature_code=Array("in","cc");var code="",feature_str="",feature="";var offset_ie=(document.all)?"height:17px;width:15px;":"";feature_str='<div style="padding-bottom:1px;">View : </div>';for(var i=0;i<feature_list.length;i++){code=feature_code[i];feature=feature_list[i];feature_str+='<input type="checkbox" id="cb_'+code+'" onclick="traffic.show_traffic(\''+code+'\');" style="padding:0px; margin:0px;'+offset_ie+'"> <span onclick="$(\'cb_'+code+"').checked = !$('cb_"+code+"').checked; traffic.show_traffic('"+code+'\');" style="font-size:9px; line-height:100%">'+feature+"</span>";if(i<feature_list.length-1){feature_str+="<br/>"}}menu_content.innerHTML=feature_str;var self=this;var moreDown=css_sprite("map_legend",80,15,60,0,8,76,"z-index:1;");moreDown.style.cursor="pointer";moreDown.onclick=function(){hide_element("menu_big");if(!$("menu_big2")){traffic.show_big2_menu()}$("bc_in").checked=$("cb_in").checked;$("bc_cc").checked=$("cb_cc").checked;show_element("menu_big2");self.insg_status="max"};moreDown.onmouseover=function(){moreDown.setBgPosition(60,17)};moreDown.onmouseout=function(){moreDown.setBgPosition(60,0)};var closeButton=css_sprite("map_legend",14,15,222,0,89,76,"z-index:1;");closeButton.style.cursor="pointer";closeButton.onclick=function(){hide_element("menu_big");hide_element("menu_big2");traffic.show_small_menu(true);self.outsg_status="closed";self.insg_status="closed"};closeButton.onmouseover=function(){closeButton.setBgPosition(222,17)};closeButton.onmouseout=function(){closeButton.setBgPosition(222,0)};if((version>=5.5)&&(version<7)&&(document.body.filters)){var arrow=css_sprite("map_legend_ie",40,30,117,267,"",0,"right: 0px;")}else{var arrow=css_sprite("map_legend",40,30,117,267,"",0,"right: 0px; cursor: pointer;")}arrow.title="Close Driver's Kit";arrow.onclick=function(){traffic.show_small_menu(true);self.insg_status="closed"};menu.appendChild(moreDown);menu.appendChild(closeButton);menu.appendChild(background);menu.appendChild(menu_content);menu.appendChild(arrow);parent.appendChild(menu)}};this.change=function(status){if(status=="closed"){hide_element("menu_big");hide_element("menu_big2");show_element("menu_small")}else{if(status=="nothing"){hide_element("menu_big");hide_element("menu_big2");hide_element("menu_small")}else{if(status=="mini"){hide_element("menu_big2");show_element("menu_small");show_element("menu_big")}else{if(status=="max"){hide_element("menu_big");show_element("menu_small");show_element("menu_big2")}}}}};this.show_traffic=function(code){this.code=code;var elm;if(this.insg_status=="mini"){elm=$("cb_"+code)}else{elm=$("bc_"+code)}if(elm.checked){switch(code){case"cpr":this.show_carpark();break;case"erp":this.show_erp();break;case"tc":this.show_camera(0);break;case"cc":this.show_camera(1);break;case"in":this.show_incident("");break;case"rw":this.show_incident(1);break;case"st":this.show_incident(8);break;case"tf":$("cb_tf").checked=false;alert("This traffic flow feature  will be available soon.");break;case"ac":$("cb_ac").checked=false;alert("This traffic accident feature  will be available soon.");break}}else{this.hide_icon(code);this.mapapi.mapDraw.closeInfoWindow(1)}};this.show_traffic_widget=function(code){this.code=code;switch(code){case"cpr":this.show_carpark(true);break;case"erp":this.show_erp();break;case"tc":this.show_camera(0);break;case"cc":this.show_camera(1);break;case"in":this.show_incident("");break;case"rw":this.show_incident(1);break;case"st":this.show_incident(8);break}};this.show_carpark=function(flag){if(this.mapapi.mapClient.levelIndex<9){if(!flag){$("bc_"+this.code).checked=false}else{global.interupted=true}show_alert_box("CAR PARK RATES ALERT: ","Pls zoom in to Map level 9 & 10 (street level) to view Car Park rates");return}if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(x){var self=this;x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var data=eval("("+x.responseText+")"),html,icon;if(data){var n=data.length,bubble;var bubble_event="onmouseover=\"global['on_bubble'] = true;\" onmouseout=\"global['on_bubble'] = false;\"";var bubble_options={bo:new Point(0,-5),arrow_style:1};for(var i=0;i<n;i++){bubble=new Array();var icon=self.set_icon_attribute(48,41,baseurl+"/img/mappointer/traffic_show/CP-rates.png",26,26);bubble.w=250;bubble.h=60;bubble.html='<div class="ver_12" style="width:95%">'+data[i]["desc"]+'</div><div id="bubble_cp_'+data[i]["id"]+'" '+bubble_event+' style="padding-top:5px"></div>';self.create_icon(data[i],icon,bubble,bubble_options,function(map_bubble,params){traffic.show_carpark_bubble(map_bubble,params)},data[i]["id"]);delete bubble}MapAPI.mapDraw.drawStickers()}}};var url=this.ajax_path+"/get_carpark.php?v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null)}};this.show_erp=function(){if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(x){var self=this;x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var data=eval("("+x.responseText+")");var html,icon,params,bubble;var bubble_options={bo:new Point(0,-5),arrow_style:1};if(data){var n=data.length,click_callback=new Array();for(var i=0;i<n;i++){params=new Array(),bubble=new Array();icon=self.set_icon_attribute(63,42,baseurl+"/img/mappointer/traffic_show/ERP-gates.png",45,20);bubble.w=320;bubble.h=250;bubble.html='<div id="erp_'+i+'"></div>';click_callback[i]=function(map_bubble,params){traffic.show_erp_bubble(map_bubble,params)};params.id="erp_"+i;params.data=data[i];self.create_icon(data[i],icon,bubble,bubble_options,click_callback[i],params);delete params,bubble}MapAPI.mapDraw.drawStickers()}}};var url=this.ajax_path+"/get_erp.php?l="+this.mapapi.mapClient.levelIndex+"&v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null)}},this.show_incident=function(mode){if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(x){var self=this;x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var data=eval("("+x.responseText+")"),html,icon;if(data){var n=data.length,bubble,icon_data;if(n>=1){var bubble_options={bo:new Point(9,0),arrow_style:1};for(var i=0;i<n;i++){bubble=new Array();var type=data[i].type;icon_data=self.get_incident_icon(type);var icon=self.set_icon_attribute(icon_data[0],icon_data[1],icon_data[2]);bubble.w=385;bubble.h=230;var type_name=self.get_incident_type(type);var x_trans=data[i]["x"];var y_trans=data[i]["y"];var new_xy=new fix_xy(x_trans,y_trans,6);hg="250";bubble.html='<div style="font-family:tahoma; font-weight:bold; font-size:12px;" >'+type_name+'</div></div><div align="left"  style="width:334px;  clear:both; font-family:tahoma; font-weight:normal; font-size:11px;">'+data[i]["desc"]+'</div><div style="height:'+hg+'px; position: relative">';var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){bubble.html+='<div style="position: absolute; top: '+Math.round((195-icon_data[1])/2-5)+"px; left: "+Math.round((353-icon_data[0])/2)+"px; height:"+icon_data[1]+"px; width: "+icon_data[0]+"px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+icon_data[2]+');"></div>'}else{bubble.html+='<img src="'+icon_data[2]+'" width="'+icon_data[0]+'" height="'+icon_data[1]+'" style="position: absolute; top: '+Math.round((195-icon_data[1])/2-5)+"px; left: "+Math.round((353-icon_data[0])/2)+'px"/>'}bubble.html+='<img src="http://'+location.hostname+"/new_singapore.cgi?x="+new_xy.x+"&y="+new_xy.y+'&level=10&sizex=353&sizey=195" width="353px" height="195px" /></div>';var tmp_icon=self.create_icon(data[i],icon,bubble,bubble_options,function(map_bubble){var module="incident_"+type;self.get_ads(map_bubble,module,true)});if(data[i].type==0){tmp_icon.obj.style.zIndex=9}delete bubble}MapAPI.mapDraw.drawStickers()}else{if(mode==8){if($("bc_st").checked){$("bc_st").checked=false}if(self.first==false){show_alert_box("SLOW TRAFFICS ALERT: ","No known hazardous road and traffic conditions currently in Singapore. \nHappy Driving!")}}else{if(mode==1){if($("bc_rw").checked){$("bc_rw").checked=false}if(self.first==false){title="ROAD WORKS ALERT : ";url="http://"+location.hostname+"/businessfinder/company_detail.php?companyid=127499&branchid=6091";message='<div align="center"><span style="color:green;font-size:14px;letter-spacing:0.5px;">&quot;No Road Works Reported. Enjoy your drive&quot;</span><br /><span style="font-size:10px;">Message brought to you by &quot;<a href='+url+' target="_blank" style="text-decoration:underline;color:#000;">Exclusive Limo & Car Rentals</a>&quot;</span></div>';show_alert_box(title,message)}}else{$("cb_in").checked=false;if(self.first==false){show_alert_box("TRAFFICS ALERT: ","Traffic is currently smooth flowing in Singapore \nDo Drive Safely & Carefully")}}}}self.first=false}}};var url=this.ajax_path+"/get_incident.php?l="+this.mapapi.mapClient.levelIndex+"&v="+global.v_c+"&r="+Math.random()+global_clear_cache+"&mode="+mode;x.open("GET",url,true);x.send(null)}};this.get_incident_type=function(type){var type_name=new Array();type_name[0]="Road Accidents";type_name[1]="Major Road works";type_name[8]="Slow Traffic";type_name[3]="Vehicle Breakdown";type_name[9]="Other Incidents";type_name[4]="Weather";type_name[5]="Obstacle";type_name[7]="Road Block";type_name[11]="Diversion";type_name[14]="Unattended Vehicle";return type_name[type]};this.get_incident_icon=function(type){if(type==3){return new Array(50,39,"http://"+location.hostname+"/img/mappointer/traffic_show/car_break_down.png")}else{if(type==11){return new Array(30,30,"http://"+location.hostname+"/img/mappointer/traffic_show/diversion.png")}else{if(type==1){return new Array(34,31,"http://"+location.hostname+"/img/mappointer/traffic_show/major-road-work.png")}else{if(type==5){return new Array(32,36,"http://"+location.hostname+"/img/mappointer/traffic_show/obstacle.png")}else{if(type==7){return new Array(33,36,"http://"+location.hostname+"/img/mappointer/traffic_show/road-block.png")}else{if(type==8){return new Array(33,36,"http://"+location.hostname+"/img/mappointer/traffic_show/slow-traffic.png")}else{if(type==4){return new Array(33,37,"http://"+location.hostname+"/img/mappointer/traffic_show/weather.png")}else{if(type==14){return new Array(40,25,"http://"+location.hostname+"/img/mappointer/traffic_show/unattended-vehicle.png")}else{if(type==0){return new Array(42,23,"http://"+location.hostname+"/img/mappointer/traffic_show/accident.png")}else{return new Array(27,23,"http://"+location.hostname+"/img/mappointer/traffic_show/other-incidents.png")}}}}}}}}}};this.get_ads=function(map_bubble,module,fit){if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(x){var self=this;x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var img=map_bubble.content.getElementsByTagName("img")[0];if(fit){img.onload=function(){map_bubble.fitHeight()}}var tmp=img.parentNode;tmp.innerHTML+=x.responseText;if(fit){map_bubble.fitHeight()}}};var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5)&&(version<7)&&(document.body.filters)){var old_ie="&ie=1"}else{var old_ie=""}var url=this.ajax_path+"/get_traffic_sponsor.php?module="+module+old_ie+"&v="+global.v_c+global_clear_cache;x.open("GET",url,true);x.send(null)}if(fit){map_bubble.fitHeight()}};this.show_erp_bubble=function(map_bubble,params){var url=this.ajax_path+"/get_bubble_erp.php?id="+params.data["id"]+"&v="+global.v_c+global_clear_cache;var success_callback=function(response){$(params.id).innerHTML=response;var erp_list=$("erpDataList");if(erp_list){if(window.addEventListener){erp_list.addEventListener("DOMMouseScroll",function(e){if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true;e.cancel=true;e.returnValue=false;return false},false)}erp_list.onmousewheel=function(e){e=e?e:window.event;e.cancelBubble=true;e.cancel=true;delta=e.wheelDelta/120;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(e);return false}}else{if(delta>0){if(this.scrollTop-(delta)*24>0){return true}else{if(this.scrollTop>0){this.scrollTop=0}cancelEvent(e);return false}}}}}};var loading_callback=function(){$(params.id).innerHTML="Loading..."};ajax(url,success_callback,loading_callback)};this.show_carpark_bubble=function(map_bubble,id){var url=this.ajax_path+"/get_carpark_bubble.php?id="+id+"&v="+global.v_c+global_clear_cache;var success_callback=function(response){var cps=eval("("+response+")");var old_cp_day="";var cp_day="";if(cps.length>0){var html='<div class="arial ver_12" style="padding-bottom: 10px">Rates at this car park:</div>';html+='<table class="arial ver_11 carpark_bubble"><tr><th>Day</th><th>Rate</th></tr>';for(var i=0;i<cps.length;i++){if(old_cp_day!=cps[i].day){cp_day=cps[i].day;old_cp_day=cps[i].day}else{cp_day="&nbsp;"}html+='<tr><td valign="top" nowrap>'+cp_day+'</td><td valign="top">'+cps[i].rate+"</td></tr>"}html+="</table>"}else{var html='<span class="arial ver_12">Sorry, rates are not available currently.</span>'}$("bubble_cp_"+id).innerHTML=html;map_bubble.fitHeight()};var loading_callback=function(){$("bubble_cp_"+id).innerHTML="Loading..."};ajax(url,success_callback,loading_callback)};this.change_vcc_type=function(type_id,zone,day_type){var url=this.ajax_path+"/get_bubble_erp_detail.php?type_id="+type_id+"&zone="+zone+"&day_type="+day_type+"&v="+global.v_c+global_clear_cache;var success_callback=function(response){$("erpDataList").innerHTML=response};var loading_callback=function(){$("erpDataList").innerHTML="Loading..."};ajax(url,success_callback,loading_callback)};this.show_camera=function(is_causeway){if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(x){var self=this;x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){var data=eval("("+x.responseText+")"),html,icon;if(data){var n=data.length,bubble;var bubble_options={bo:new Point(34,-23),arrow_style:1};for(var i=0;i<n;i++){bubble=new Array();var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if(is_causeway){bubble.h=406;if(data[i]["id"]=="2702"){var icon=self.set_icon_attribute(78,41,baseurl+"/img/mappointer/traffic_show/cc_woodlands.png")}else{var icon=self.set_icon_attribute(78,41,baseurl+"/img/mappointer/traffic_show/cc_tuas.png")}bubble_options={bo:new Point(7,-7),arrow_style:1};bubble.html='<div align="center"><table cellpadding="0" cellspacing="0" width="100"><tr><td><div><div style="font-family:tahoma; font-size:12px; font-weight:bold;" align="left">'+data[i]["desc"]+'</div><div style="font-family:tahoma; font-size:11px;" align="left">Last Captured: '+data[i].t+'</div></div></td></tr><tr><td><img height="288px" src="'+baseurl+"/img/traffic_data/camera/"+data[i]["id"]+".jpg?r="+Math.random()+'" onerror="this.src=\''+baseurl+"/img/mappointer/traffic_show/unavailable.jpg'\"/></td></tr></table></div>"}else{bubble.h=412;var icon=self.set_icon_attribute(39,30,baseurl+"/img/mappointer/traffic_show/traffic-camera.png",0,35);bubble.html='<div align="center"><table cellpadding="0" cellspacing="0" width="100"><tr><td><div><div style="font-family:tahoma; font-size:12px; font-weight:bold;" align="left">'+data[i]["desc"]+'</div><div align="left" style="clear:both; font-family:tahoma; font-size:11px;">Last Captured: '+data[i].t+'</div></div></td></tr><tr><td><img height="288px"  src="'+baseurl+"/img/traffic_data/camera/"+data[i]["id"]+".jpg?r="+Math.random()+'" onerror="this.src=\''+baseurl+"/img/mappointer/traffic_show/unavailable.jpg'\"/></td></tr></table></div>"}bubble.w=417;self.create_icon(data[i],icon,bubble,bubble_options,function(map_bubble){var module="camera_"+is_causeway;self.get_ads(map_bubble,module,false)});if(data[i]["id"]==self.show_default){var point=fix_xy(data[i]["x"],data[i]["y"]);var map_bubble=MapAPI.mapDraw.openBubble(bubble.w,bubble.h,point,bubble.html,bubble_options);var module="camera_"+is_causeway;self.get_ads(map_bubble,module,false)}delete bubble}MapAPI.mapDraw.drawStickers()}}};var url=this.ajax_path+"/get_camera.php?l="+this.mapapi.mapClient.levelIndex+"&v="+global.v_c+global_clear_cache+"&is_causeway="+is_causeway;if(is_causeway){url+="&r="+Math.random()}x.open("GET",url,true);x.send(null)}};this.set_icon_attribute=function(w,h,url,offset_x,offset_y){var icon=new Array();icon.w=w;icon.h=h;icon.url=url;icon.offset_x=offset_x?offset_x:0;icon.offset_y=offset_y?offset_y:0;return icon};this.create_icon=function(data,icon,bubble,bubble_options,callback,callback_params){var x=data.x,y=data.y,code=data.c?data.c:this.code;obj_icon=this.mapapi.mapDraw.stickIcon(x,y,icon.w,icon.h,icon.url,code);if(icon.offset_x||icon.offset_y){obj_icon.setPointerOffset(new Point(icon.offset_x,icon.offset_y))}VEvent.addListener(obj_icon,"click",function(){var point=fix_xy(x,y);var map_bubble=MapAPI.mapDraw.openBubble(bubble.w,bubble.h,point,bubble.html,bubble_options);if(typeof callback=="function"){callback(map_bubble,callback_params)}});return obj_icon};this.hide_icon=function(code){this.mapapi.mapDraw.panelIcon.removeStickers(code)};this.show_lhs=function(){};this.change_map_source=function(){var stickers=this.mapapi.mapDraw.panelIcon.stickers;for(key in stickers){this.hide_icon(key);if(key=="erp"&&$("cb_erp").checked){this.show_erp()}else{if(key=="tc"&&$("cb_tc").checked){this.show_camera()}}}};this.hide=function(){hide_element("menu_big");hide_element("menu_small");this.minimized=false};this.show=function(){show_element("menu_big")}}function show_alert_box(i,k){var c=document.createElement("div");c.id="div_2";c.style.cssText="width:380px;height:107px;background:url(bg_alert_box) repeat-x;z-index:10000;position:absolute;left:502px;top:200px;border-left:1px solid #7fa0bb;border-right:1px solid #7fa0bb;";c.style.backgroundImage='url("http://'+location.hostname+'/img/map/alert_box/bg_tile.gif")';c.style.backgroundRepeat="repeat-x";document.body.appendChild(c);c.overlay=document.createElement("div");c.overlay.id="div_alert_overlay";page_size=getPageSize();var a=baseurl+"/dragmap/xg/img/x.gif";c.overlay.style.cssText="background:url(bg_alert); z-index: 9999; position: absolute; top: 0px; left: 0px; display: block;back";c.overlay.style.width="100%";c.overlay.style.height=page_size[1]+"px";c.overlay.style.display="block";document.body.appendChild(c.overlay);var f=document.createElement("img");f.src="http://"+location.hostname+"/img/map/alert_box/close_btn.gif";f.style.cssText="position:absolute;top: 15px;left:358px;";f.width="14";f.height="14";f.title="Close Box Alert";f.style.cursor="pointer";var j=this;f.onclick=function(){c.style.display="none";c.overlay.style.display="none";return false};c.appendChild(f);var l=document.createElement("div");l.id="alert_title";l.innerHTML=i;l.style.cssText="font-family:tahoma;position:absolute;top:15px;left:18px;font-size:11px;font-weight:bold;letter-spacing:0.2px;";c.appendChild(l);var h=document.createElement("img");h.src="http://"+location.hostname+"/img/map/alert_box/alert-box_seru.gif";h.style.cssText="position:absolute;top: 45px;left:12px;";h.width="30";h.height="26";c.appendChild(h);var g=document.createElement("div");g.id="alert_content";g.innerHTML=k;var d=navigator.appVersion.split("MSIE");var e=parseFloat(d[1]);if((e>=5.5)&&(e<7)){g.style.cssText="margin-left:6px;font-family:tahoma;position:absolute;top:45px;left:46px;font-size:11px;"}else{g.style.cssText="margin-left:2px;font-family:tahoma;position:absolute;top:45px;left:46px;font-size:11px;"}c.appendChild(g);var b=document.createElement("img");b.src="http://"+location.hostname+"/img/map/alert_box/ok_btn.gif";b.style.cssText="position:absolute;top: 82px;left:170px;";b.width="42";b.height="17";b.style.cursor="pointer";var j=this;b.onclick=function(){c.style.display="none";c.overlay.style.display="none";return false};c.appendChild(b)}function getPageSize(){if(window.innerHeight&&window.scrollMaxY){y=window.innerHeight+window.scrollMaxY;x=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollHeight>document.body.offsetHeight){y=document.body.scrollHeight;x=document.body.scrollWidth}else{y=document.body.offsetHeight;x=document.body.offsetWidth}}pageSize=new Array(x,y);return pageSize}function fix_xy(b,g,d){var f=d?d:MapAPI.mapClient.levelIndex,a=new Point(b,g),e=new WGSProjection();if(f<=4&&b>1000){var c=e.utmToGeo(b,g,MapAPI.mapClient.mapSource.mapZone,MapAPI.mapClient.mapSource.isSouth);a.x=c.y;a.y=c.x}else{if(f>=5&&b<1000){a=e.geoToUTM(g,b,48,0)}}return a};function showCompanyList(R,f){var d;if(!$("content_listing")){return false}global.active_list="business";var O=$("content_listing"),p;show_element("content_listing_header");$("content_listing_header").style.backgroundColor="#ffffff";O.style.display="block";var x="";var m="updateMapIcon('"+global_cat_id+"', '"+global_directory+"', '"+global_main_cat+"','"+global_business_id+"','','"+global_branch_only+"','','');";m="setCatName('"+addslashes(global_original_cat_name)+"'); "+m;function a(V){var V=V.replace(/^\s\s*/,""),j=/\s/,U=V.length;while(j.test(V.charAt(--U))){}return V.slice(0,U+1)}var P='<table width="100%" class="arial"><tr><td class="ver_14 TextBold Link28" style="padding-left: 5px" align="left"><a id="cat_name" href="javascript:void(0);" onclick="'+m+'" title="'+global_original_cat_name+'">'+a(global_cat_name)+'</a></td><td align="right" class="Link17" width="40" style="padding-right:3px"><a id="clear_result" title="Reset &amp; Clear Results" onclick="clear_results();" href="javascript:void(0);">[Clear]</a></td></tr></table>';$("content_listing_header").style.display="block";$("content_listing_title").style.display="block";$("content_listing_title").innerHTML=P;var N="";N=getRadioButtonHtml();x+='<table width="100%" cellspacing="0" class="content_listing">';if(R.length==0){x+='<tr><td width="12" valign="top" style="padding-top:3px"><img src="http://'+location.hostname+'/img/arrow/arrow_green.gif" width="8" height="9"/></td><td class="arial Link17" style="padding-top:3px">No listings found in this Map.';if(MapAPI.mapClient.levelIndex>1){x+='<br/>&raquo; Try Zooming Out to <a href="javascript:void(0)" onclick="MapAPI.mapClient.ChangeLevel('+(MapAPI.mapClient.levelIndex-1)+')">Level '+(MapAPI.mapClient.levelIndex-1)+"</a>"}x+="</td></tr>";if(N){$("content_listing_paging_top").parentNode.style.display="block";$("content_listing_paging_top").innerHTML=N}else{$("content_listing_paging_top").parentNode.style.display="none";$("content_listing_paging_top").innerHTML=""}$("content_listing_paging_bottom").style.display="none";$("content_listing_paging_bottom").innerHTML=""}else{var T=num_rows_per_page*(f-1);var t=T+num_rows_per_page;if(t>R.length){t=R.length}var S=1;for(var M=T;M<t;M++){if(R[M].c){var E=R[M].c.replace(/'/g,"\\'")}else{var E=""}x+="<tr>";if(R[M].t=="biz_prem"){var o="highlightMapIcon("+M+");";var I="unhighlightMapIcon("+M+");";var c="";if(R[M].ms==1){c="show_mini_site("+R[M].cid+")"}var B="updateBgSideBar("+(S-1)+"); displayFeaturedAd("+M+"); if (global_feature_ads != "+R[M].cid+") {close_mini_site();} "+c;if(MapAPI.browser.name=="IE"&&MapAPI.browser.version>=5.5&&MapAPI.browser.version<7){var C="left_star_ie"}else{var C="left_star"}var k='<div align="center" onclick="'+B+'" style="cursor:pointer;"><div style="position: absolute;"><div style="overflow: hidden; width: 16px; height: 20px; position: relative;"><div class="'+C+'" style="width: 159px; height: 219px; position: absolute; left: -'+((M%10)*16)+"px; top: -"+(Math.floor(M/10)*20)+'px;"/></div></div></div>';var b='<div class="Link99 ver_12 TextBold"><a href="javascript:void(0)" onmouseout="'+I+'" onmouseover="'+o+'" onclick="'+B+'">'+R[M].c+"</a></div>";var r="";if(R[M].p!=""||R[M].f!=""){var G=new Array();if(R[M].p!=undefined){G.push("Tel: "+R[M].p)}if(R[M].f!=undefined){G.push("Fax: "+R[M].f)}r+="<div>"+G.join(", ")+"</div>"}var s='<div class="Link19 TextGreen ver_11">';if(R[M].ms==1){s+='<a href="javascript:void(0)" onclick="show_mini_site('+R[M].cid+')"><img src="http://'+location.hostname+'/img/business_finder/btn-microsite.gif" border="0" align="left"></a>&nbsp; | '}s+='<a target="_blank" href="http://'+location.hostname+"/businessfinder/company_detail.php?companyid="+R[M].cid+"&branchid="+R[M].lid+'">view profile</a>';if(R[M].e!=""){s+=' | <a href="javascript:void(0)" onclick="window.open(\'http://'+location.hostname+"/businessfinder/email.php?idCompany="+R[M].cid+"')\">Email</a>"}s+="</div>";if(this.i_hightlight==M){if(s){more="&nbsp;"+s}x='<div class="premium listing" style="padding:0 5px 4px;"><div id="comList_'+(S-1)+'"><table class="arial" width="100%" bgcolor="#f2f5f7" cellspacing="5"><tr><td width="17" valign="top">'+k+"</td><td>"+b+r+s+"</td></tr></table></div></td></div>"+x}else{x+='<td class="premium_listing"><div id="comList_'+(S-1)+'"><table class="arial" width="100%" bgcolor="#f2f5f7" cellspacing="5"><tr><td width="17" valign="top">'+k+"</td><td>"+b+r+s+"</td></tr></table></div></td>"}}else{if(R[M].t=="res_prem"){var g=str_replace(["&"," "],"_",R[M].c);g=str_replace([".","'",","],"",g);var J="http://"+location.hostname+"/restaurants/singapore/reviews/location-"+g+"-"+R[M].cid+".php";var o="highlightMapIcon("+M+");";var I="unhighlightMapIcon("+M+");";var c="";if(R[M].ms==1){c="show_mini_site("+R[M].cid+")"}var B="updateBgSideBar("+(S-1)+"); displayFeaturedAd("+M+"); if (global_feature_ads != "+R[M].cid+") {close_mini_site();} "+c;if(MapAPI.browser.name=="IE"&&MapAPI.browser.version>=5.5&&MapAPI.browser.version<7){var C="left_star_ie"}else{var C="left_star"}var k='<div align="center" onmouseover="'+o+'" onclick="'+B+'" style="cursor:pointer"><div style="position: absolute;"><div style="overflow: hidden; width: 16px; height: 20px; position: relative;"><div class="'+C+'" style="width: 159px; height: 219px; position: absolute; left: -'+((M%10)*16)+"px; top: -"+(Math.floor(M/10)*20)+'px;"/></div></div></div>';var b='<div class="Link99 ver_12 TextBold"><a href="javascript:void(0)" onmouseout="'+I+'" onmouseover="'+o+'" onclick="'+B+'">'+R[M].c+"</a></div>";var r="";if(R[M].p!=undefined||R[M].f!=undefined){var G=new Array();if(R[M].p!=undefined){G.push("Tel: "+R[M].p)}r+="<div>"+G.join(", ")+"</div>"}var L="http://"+location.hostname+"/restaurants/singapore/reviews/review-"+g+"-"+R[M].rv+".php";if(R[M].ms==1){var s='<div class="Link19 TextGreen ver_11"><a href="javascript:void(0)" onclick="show_mini_site('+R[M].cid+')"><img src="http://'+location.hostname+'/img/business_finder/btn-microsite.gif" border="0" align="left"></a>&nbsp; | ';s+='<a target="_blank" href="'+J+'">view profile</a>'}else{var s='<div class="Link19 Text30 ver_11">'}if(R[M].e!=""){s+=' | <a href="javascript:void(0)" onclick="window.open(\'http://'+location.hostname+"/restaurants/email.php?estAddId="+R[M].cid+"')\">Email</a>"}if(R[M].v==1){s+=' <span><a href="javascript:void(0)" onclick="show_mini_site('+R[M].cid+')"><img src="http://'+location.hostname+'/img/map/content/video_icon.gif" border="0"></span>'}s+="</div>";if(this.i_hightlight==M){if(s){more="&nbsp;"+s}x='<div class="premium listing" style="padding:0 5px 4px;"><div id="comList_'+(S-1)+'"><table class="arial" width="100%" bgcolor="#f2f5f7" cellspacing="5"><tr><td width="17" valign="top">'+k+"</td><td>"+b+r+s+"</td></tr></table></div></td></div>"+x}else{x+='<td class="premium_listing"><div id="comList_'+(S-1)+'"><table class="arial" width="100%" bgcolor="#f2f5f7" cellspacing="5"><tr><td width="17" valign="top">'+k+"</td><td>"+b+r+s+"</td></tr></table></div></td>"}}else{if(R[M].t=="res_nsew"){var w="";var Q=R[M].c;if(R[M].t=="property"){var Q=R[M].c+" ("+R[M].cid+")"}var o="highlightMapIcon("+M+");";var B="updateBgSideBar("+(S-1)+"); close_mini_site(); showCompanyDetail("+M+");";var b='<div class="Link99 ver_12 TextBold"><a href="javascript:void(0)" onmouseout="MapAPI.mapDraw.closeToolTips()" onmouseover="'+o+'" onclick="'+B+'">'+Q+"</a></div>";b+='<div class="Link18 ver_11">';if(R[M].rt){b+="<b>Total Resto: "+R[M].rt+"</b><br>"}b+="</div>";if(this.i_hightlight==M){if(s){more="&nbsp;"+s}x='<div class="free_listing" style="padding:0 5px 4px;"><div id="comList_'+(S-1)+'"><table class="arial ver_11" width="100%"><tr><td>'+b+"</td></tr></table></div></td></div>"+x}else{x+='<td class="free_listing"><div id="comList_'+(S-1)+'"><table class="arial ver_11" width="100%"><tr><td>'+b+"</td></tr></table></div></td>"}}else{if(R[M].t=="res"){var w="http://"+location.hostname+"/restaurants/email.php?estAddId="+R[M].cid}else{var w="http://"+location.hostname+"/businessfinder/email.php?idCompany="+R[M].cid}E=str_replace('"',"",E);var Q=R[M].c;if(R[M].t=="property"){var Q=R[M].c+" ("+R[M].cid+")"}var o="highlightMapIcon("+M+");";var I="unhighlightMapIcon("+M+");";var B="updateBgSideBar("+(S-1)+"); close_mini_site(); showCompanyDetail("+M+");";var b='<div class="Link99 ver_12 TextBold"><a href="javascript:void(0)" onmouseout="'+I+'" onmouseover="'+o+'" onclick="'+B+'">'+Q+"</a></div>";if(R[M].t=="ayg"){b+='<div class="Link18 ver_11">';if(R[M].eventDate){b+="<b>Date: "+R[M].eventDate+"</b><br>"}b+='<a href="javascript:void(0)" onmouseout="MapAPI.mapDraw.closeToolTips()" onmouseover="'+o+'" onclick="'+B+'">'+R[M].ad+"</a>";b+="</div>"}var r="";if(R[M].p!=undefined||R[M].f!=undefined){var G=new Array();if(R[M].p!=""&&R[M].p!=undefined){G.push("Tel: "+R[M].p)}r+='<span class="ver_11">'+G.join(", ")+"</span>"}if(R[M].t=="res"){var E=str_replace(["&"," "],"_",R[M].c);E=str_replace([".","'",",",'"'],"",E);var J="http://"+location.hostname+"/restaurants/singapore/reviews/location-"+E+"-"+R[M].cid+".php";var u="http://"+location.hostname+"/feedback_resto.php?restoid="+R[M].rid}else{if(R[M].t=="property"){var J="http://"+location.hostname+"/realestate/property_detail.php?id="+R[M].cid}else{var J="http://"+location.hostname+"/businessfinder/company_detail.php?companyid="+R[M].cid+"&branchid="+R[M].lid;var u="http://"+location.hostname+"/feedback_company.php?companyid="+R[M].cid+"&branch_id="+R[M].lid}}var s="";if(R[M].t=="property"){var s='<span class="Link19 TextGreen ver_11"><a target="_blank" href="'+J+'">view detail</a></span>'}else{if(R[M].t!="ayg"){var s='<span class="Link19 TextGreen ver_11"><a target="_blank" href="'+J+'">view profile</a> | <a target="_blank" href="'+u+'">Edit</a></span>'}}if(R[M].t=="property"){var q="";var h="",A=R[M].pt1.toLowerCase();if(R[M].room_type){q=R[M].room_type+","}if(A=="private"){h="Price: $"+R[M].pr+", "+q+"<br/>"+R[M].fa+R[M].ft+" "+s}else{if(A=="hdb"){var y=R[M].pt2.split(" - ");if(y[1]){type=y[1]}else{type=R[M].pt2}h="Price: $"+R[M].pr+", "+R[M].fa+R[M].ft+"<br/>"+type+" "+s}else{if(A=="commercial"){h="Price: $"+R[M].pr+", "+R[M].fa+R[M].ft+"<br/>"+R[M].pt1+" - "+R[M].pt2+" "+s}}}if(this.i_hightlight==M){if(s){more="&nbsp;"+s}x='<div class="free_listing" style="padding:0 5px 4px;"><div id="comList_'+(S-1)+'"><table class="arial ver_11" width="100%"><tr><td>'+b+h+"</td></tr></table></div></td></div>"+x}else{x+='<td class="free_listing"><div id="comList_'+(S-1)+'"><table class="arial ver_11" width="100%"><tr><td>'+b+h+"</td></tr></table></div></td>"}}else{if(this.i_hightlight==M){if(s){more="&nbsp;"+s}x='<div class="content_listing" style="padding:0 5px 4px;"><div class="free_listing"><div id="comList_'+(S-1)+'"><table class="arial" width="100%"><tr><td>'+b+r+more+"</td></tr></table></div></td></div></div>"+x}else{x+='<td class="free_listing"><div id="comList_'+(S-1)+'"><table class="arial" width="100%"><tr><td>'+b+r;if(s){x+="&nbsp;"+s}x+="</td></tr></table></div></td>"}}}}}x+="</tr>";if(global_feature_ads==R[M].cid){p="ada"}++S}x+="</table>";if(p!="ada"){hideFeaturedAd()}var n="";var F=Math.ceil(R.length/num_rows_per_page);if(F>=1){var z=8;if(f>8){z=6}var v=Math.floor((f-1)/z)*z+1;n+='<div class="ver_11 Link17" style="padding:5px;padding-left:7px">Page';if(v>1){n+='&nbsp;<a style="border: 1px solid #c0c0c0; padding: 2px;" title="Go To Page 1" onclick="listCompany(1)" href="javascript:void(0);">1</a>';n+='&nbsp;<a style="border-right: 1px solid #000000; padding: 2px" title="Show Prev 6 Page(s)" onclick="listCompany('+(v-1)+')" href="javascript:void(0);">&laquo;</a>'}for(var M=v,K=0;M<=F&&K<z;M++,K++){if(M==f){n+='&nbsp;<span style="border: 1px solid #c0c0c0; padding: 2px;" class="TextBold TextMerah">'+M+"</span>"}else{n+='&nbsp;<a style="border: 1px solid #c0c0c0; padding: 2px;" title="Go To Page '+M+'" onclick="listCompany('+M+')" href="javascript:void(0);">'+M+"</a>"}}if(v+z<F){n+='&nbsp;<a style="border-left: 1px solid #000000; padding: 2px" title="Show Next 6 Page(s)" onclick="listCompany('+M+')" href="javascript:void(0);">&raquo;</a>'}n+="</div>"}$("content_listing_paging_top").parentNode.style.display="block";if(N){$("content_listing_paging_top").innerHTML=N}else{$("content_listing_paging_top").innerHTML=n}$("content_listing_paging_bottom").style.display="block";$("content_listing_paging_bottom").innerHTML=n}O.innerHTML=x;if(place_id=="0"){if($("content_listing_title2")){$("content_listing_title2").style.display="block";$("content_listing_title2").innerHTML=P;$("content_listing_title").style.display="none";$("content_listing_title").innerHTML="";if($("map_page_title")){$("map_page_title").style.display="none"}}}else{if(place_id>0){if(location.pathname.indexOf("travel_id_")!=-1){if($("map_page_title")){$("map_page_title").style.display="block"}if($("content_title_map")){$("content_title_map").style.display="block"}$("content_listing_title").style.display="block";$("content_listing_title").innerHTML=P;$("content_listing_paging_top").style.display="none";if($("content_listing_paging_top2")){if(N){$("content_listing_paging_top2").innerHTML=N}else{$("content_listing_paging_top2").innerHTML=n}if($("content_listing_paging_top2").innerHTML=="undefined"){$("content_listing_paging_top2").style.display="none"}else{$("content_listing_paging_top2").style.display="block"}$("content_listing_paging_top2").parentNode.style.display="block"}}else{if($("content_listing_title2")){$("content_listing_title2").style.display="block";if(global_title_zone_name){if(global_title_zone_name=="all"){global_title_zone_name="";var D="updateMapIcon('"+global_cat_id+"', '"+global_directory+"', '"+global_main_cat+"','"+global_business_id+"','','"+global_branch_only+"','','','');";D="setCatName('"+addslashes(global_original_cat_name)+"'); "+D;var H='<table width="100%" class="arial"><tr><td class="ver_14 TextBold Link28" style="padding-left: 5px" align="left"><a id="cat_name" href="javascript:void(0);" onclick="'+D+'" title="'+a(global_cat_name)+" in "+global_title_zone_name+'">'+a(global_cat_name)+'</a></td><td align="right" class="Link17" width="40" style="padding-right:3px"><a id="clear_result" title="Reset &amp; Clear Results" onclick="clear_results();" href="javascript:void(0);">[Clear]</a></td></tr></table>'}else{global_title_zone_name=global_title_zone_name.replace(/_/g," ");var D="updateMapIcon('"+global_cat_id+"', '"+global_directory+"', '"+global_main_cat+"','"+global_business_id+"','','"+global_branch_only+"','','"+global_title_zone_name+"','');";D="setCatName('"+addslashes(global_original_cat_name)+"'); "+D;var H='<table width="100%" class="arial"><tr><td class="ver_14 TextBold Link28" style="padding-left: 5px" align="left"><a id="cat_name" href="javascript:void(0);" onclick="'+D+'" title="'+a(global_cat_name)+" in "+global_title_zone_name+'">'+a(global_cat_name)+" in "+global_title_zone_name+'</a></td><td align="right" class="Link17" width="40" style="padding-right:3px"><a id="clear_result" title="Reset &amp; Clear Results" onclick="clear_results();" href="javascript:void(0);">[Clear]</a></td></tr></table>'}$("content_listing_title2").innerHTML=H}else{$("content_listing_title2").innerHTML=P}$("content_listing_title").style.display="none";$("content_listing_title").innerHTML="";if($("map_page_title")){$("map_page_title").style.display="none"}}}}else{if($("map_page_title")){$("map_page_title").style.display="block"}if($("content-ads")){$("content-ads").style.display="block"}}}}function listCompany(a){global_page=a;showCompanyList(global_data,a)}function showCompanyDetail(k){var a=global_data[k];if(global_bubble_flag==a.cid){return false}var j,c,d="";var b=110;var m=false,i=global_data[k].x,g=global_data[k].y;j=250;if(global_directory=="business"){c=170}else{c=235}MapAPI.mapDraw.closeToolTips();e=new Object();e.addr_x=i;e.addr_y=g;d=initHTMLBubble(a);var f=MapAPI.mapDraw.openInfoWindowHtml(1,j,c,new Point(i,g),d,e,a.t);getHTMLBubble(a,f);global_bubble_flag=a.cid}function displayFeaturedAd(a){var b=global_data[a];if(b.featured_ad!=undefined){showFeaturedAd(b)}}function showFeaturedAd(c){if(global_feature_ads==c.cid){return}var d=$("featured_ad_listing");d.innerHTML="";showLoadingFeaturedAd();showSearchResult(true);if(c.featured_ad!=undefined){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==""){d.style.display="none"}else{d.innerHTML=a.responseText}global_feature_ads=c.cid;fitListHeight()}};var b="http://"+location.hostname+"/asia_travel/mappage/ajax/show_feature_ads.php?directory="+global_directory+"&businessId="+c.cid+"&v="+global.v_c;a.open("GET",b,true);a.send(null)}}}function hideFeaturedAd(){hide_element("featured_ad_listing");close_mini_site();fitListHeight();global_feature_ads=0}function updateBgSideBar(b){if(last_update_bg_side_bar){var a=last_update_bg_side_bar-1;if($("comList_"+a)){$("comList_"+a).style.backgroundColor=""}}if($("comList_"+b)){$("comList_"+b).style.backgroundColor="#EEEDFF"}last_update_bg_side_bar=b+1}function highlightCompany(b,a){this.i_hightlight=b;$("content_listing").scrollTop=0;var d=Math.floor(b/num_rows_per_page)+1;if(d!=global_page||global.active_list!="business"){listCompany(d)}showCompanyList(global_data,d);if(global_highlight.i!=-1&&global_highlight.i!=b){unhighlightCompany(global_highlight.i,global_highlight.prem)}var c=b%num_rows_per_page;if($("comList_"+c)){if(global_directory=="property"){$("comList_"+c).style.backgroundColor="#ffdef7"}else{if(a==0&&(last_update_bg_side_bar!=b+1)){$("comList_"+c).style.backgroundColor="#fcedbd"}else{if(a==1){$("comList_"+c).childNodes[0].bgColor="#fcedbd"}}}global_highlight.i=b;global_highlight.prem=a;$("content_listing").scrollTop=$("comList_"+c).parentNode.offsetTop}}function unhighlightCompany(b,a){global_highlight.i=-1;var c=b%num_rows_per_page;if($("comList_"+c)){if(global_directory=="property"){$("comList_"+c).style.backgroundColor=""}else{if(a==0){$("comList_"+c).style.backgroundColor=""}else{if(a==1){$("comList_"+c).childNodes[0].bgColor="#f2f5f7"}}}}}function unhighlightMapIcon(a,b){if(global_directory!="business"){MapAPI.mapDraw.closeToolTips();data=global_data[a]}if(data.t.indexOf("_prem")!=-1){var c=data.i;c.obj.src=c.obj.src.replace("_hover","");c.obj.style.zIndex=10}else{MapAPI.mapDraw.panelIcon.removeIcon(data.i)}}function highlightMapIcon(n,i){data=global_data[n];if(global_directory!="business"){if(global_bubble_flag==data.cid){return false}}if(data.x==""||data.x==0){alert("Sorry this advertiser does not wish to show the location on the map");return}var b=(data.p==undefined)?"":"Tel : "+data.p;var o=' | <a href="http://'+location.hostname+"/businessfinder/company_detail.php?companyid="+data.cid+"&branchid="+data.lid+'" target="_blank" style="color:#009142">More Info</a>';var k="";if(data.e){k=' | <a href="javascript:void(0);" onclick = "window.open(\'http://'+location.hostname+"/asia_travel/mappage/email.php?dir="+global_directory+"id="+data.cid+"')\">Email</a>"}var g=data.c.length>39?data.c.substr(0,36)+"...":data.c;if(data.t.indexOf("_prem")!=-1){var d=data.i;if(MapAPI.mapClient.levelIndex>6){var f=d.obj.src.substr(d.obj.src.indexOf("star_prem_")+4,d.obj.src.length)}else{var f=d.obj.src.substr(d.obj.src.indexOf("prem/star")+4,d.obj.src.length)}var h=f.split(".");d.obj.src=d.obj.src.replace("_hover","");d.obj.src=d.obj.src.replace(f,h[0]+"_hover."+h[1]);recordListing(data);var j=data.ms==1?'<br><a href="javascript:void(0);" onclick="show_mini_site('+data.cid+')">View mini site</a>':"";var c=(n+1)+". <u>"+g+'</u><br><div style="padding-left:15px;line-height:13px;" class="Link17 ver_10">'+b+k+j+"</div>";d.obj.style.zIndex=11}else{if(data.t=="property"){if(typeof data.i!="object"){var a="";a="star"+data.i.substr(0,(data.i.length-4))+"_hover.png";var m=l=tempIs="";tempIs=data.is.split("x");m=tempIs[0];l=tempIs[1];var d=new MapIcon(data.x,data.y,11,MapAPI.mapClient,m,l,"star","","",a)}else{var m=l=tempIs="";tempIs=data.is.split("x");m=tempIs[0];l=tempIs[1];var d=new MapIcon(data.x,data.y,11,MapAPI.mapClient,m,l,"star","","",data.i.icon_file)}}else{var d=new MapIcon(data.x,data.y,11,MapAPI.mapClient,15,15,"star","","","star110_hover.png")}d.updatePosition(MapAPI.mapClient);MapAPI.mapClient.mapContainer.appendChild(d.obj);d.appended=true;var c=(i?i+". ":"")+"<u>"+g+'</u><br><div style="padding-left:0px;line-height:13px;" class="Link17 ver_10">'+b+k+"</div>"}data.i=d;if(global_directory!="business"){MapAPI.mapDraw.toolTipsHtml(new Point(data.x,data.y),c,19,data.t)}}function showLoadingFeaturedAd(){if($("featured_ad_listing")){var b=document.createElement("img");b.style.position="absolute";b.style.top="65px";b.style.left="100px";b.alt="Loading...";b.src="http://"+location.hostname+"/img/map/loading-icon.gif";var a=document.createElement("div");a.style.overflow="hidden";a.style.width="255px";a.style.height=(document.all)?"210px":"208px";a.style.position="relative";a.appendChild(b);$("featured_ad_listing").appendChild(a);$("featured_ad_listing").style.display="block";fitListHeight()}}function fitListHeight(){if(global.active_list=="business"){if($("show_titleMap")){var a=$("show_titleMap").offsetHeight+$("show_tab").offsetHeight+$("hide_tab").offsetHeight+$("featured_ad_listing").offsetHeight;if($("content_listing_title2")){if(location.pathname.indexOf("travel_id_")!=-1){$("content_listing").style.height=(572-a)+"px"}else{$("content_listing").style.height=(617-a)+"px"}}else{$("content_listing").style.height=(569-a)+"px"}}}else{if(global.active_list=="dd"){if($("show_titleMap")){var a=$("show_titleMap").offsetHeight+$("show_tab").offsetHeight+$("hide_tab").offsetHeight+$("featured_ad_listing").offsetHeight;if($("content_listing_paging_top").parentNode.style.display=="none"){$("content_listing").style.height=(568-a)+"px"}else{$("content_listing").style.height=(545-a)+"px"}}}else{if(global.active_list=="bus"){var b=31;if(global.city!=undefined){b=27}$("content_listing").style.height=$("content_td").offsetHeight-($("show_titleMap").offsetHeight+$("show_tab").offsetHeight+$("hide_tab").offsetHeight+$("featured_ad_listing").offsetHeight+$("content_listing_title").offsetHeight+$("content_listing_paging_top").offsetHeight+b)+"px"}else{if(global.active_list=="search"){$("content_listing").style.height=$("content_td").offsetHeight-($("show_titleMap").offsetHeight+$("show_tab").offsetHeight+$("hide_tab").offsetHeight+$("featured_ad_listing").offsetHeight+$("content_listing_title").offsetHeight+$("content_listing_paging_top").offsetHeight+4)+"px"}}}}}function update_prop(f,a){var g=global_data.length,b=new Array();if(a!="all"){global.data_bk=global_data;for(var c=0,d=0;d<g;d++){if(f=="tenure"&&global_data[d]["tn"]==a){b[c]=global_data[d];c++}else{if(f=="zone"&&global_data[d]["ns"]==a){b[c]=global_data[d];c++}else{if(f=="hdb"&&global_data[d]["pt2"].indexOf(a+" Room")>-1){b[c]=global_data[d];c++}}}}global[f]=a}else{b=global.data_bk;global[f]="all"}resetIcon();setIconForCompany(global_cat_id,global_directory,global_business_id,b,global_branch_only,"",true);showCompanyList(b,1)}function getRadioButtonHtml(){if(global_directory=="property"){var d=Array();if(global_cat_id.toLowerCase()=="hdb"&&global_sub_cat==""){var g=Array("update_prop('hdb','all');","update_prop('hdb','3');","update_prop('hdb','4');","update_prop('hdb','5');");if(global_sub_cat){var h=global_sub_cat.split("-");if(h[1]){var c=h[1].replace(" ","")}else{var c=global_sub_cat}}else{var c=global.hdb}switch(c){case"3":d[1]="checked";break;case"4":d[2]="checked";break;case"5":d[3]="checked";break;default:d[0]="checked";break}var b='<div class="arial ver_12 Link17" style="padding-left:5px;word-spacing:1px;"><input name="tenure" type="radio" value="all" onclick="'+g[0]+'" '+d[0]+' />All <input name="tenure" type="radio" value="3" onclick="'+g[1]+'" '+d[1]+' />3 Rm <input name="tenure" type="radio" value="4" onclick="'+g[2]+'" '+d[2]+' />4 Rm <input name="tenure" type="radio" value="5" onclick="'+g[3]+'" '+d[3]+" />5 Rm</div>"}else{if(global_main_cat.toLowerCase()=="rent"||global_cat_id.toLowerCase()=="hdb"){var a=Array("update_prop('zone','all');","update_prop('zone','3');","update_prop('zone','4');","update_prop('zone','2');","update_prop('zone','5');");switch(global.zone){case"2":d[1]="checked";break;case"3":d[2]="checked";break;case"4":d[3]="checked";break;case"5":d[4]="checked";break;default:d[0]="checked";break}var b='<div class="arial ver_12 Link17"><input name="tenure" type="radio" value="all" onclick="'+a[0]+'" '+d[0]+' />All <input name="tenure" type="radio" value="3" onclick="'+a[1]+'" '+d[2]+' />North <input name="tenure" type="radio" value="4" onclick="'+a[2]+'" '+d[3]+' />South <input name="tenure" type="radio" value="2" onclick="'+a[3]+'" '+d[1]+' />East <input name="tenure" type="radio" value="5" onclick="'+a[4]+'" '+d[4]+" />West</div>"}else{var f=Array("update_prop('tenure','all');","update_prop('tenure','a');","update_prop('tenure','b');");switch(global.tenure){case"a":d[1]="checked";break;case"b":d[2]="checked";break;default:d[0]="checked";break}var b='<div class="arial ver_12 Link17" style="padding-left:7px"><input name="tenure" type="radio" value="all" onclick="'+f[0]+'" '+d[0]+' /> All <input name="tenure" type="radio" value="a" onclick="'+f[1]+'" '+d[1]+' /> 99 Years <input name="tenure" type="radio" value="b" onclick="'+f[2]+'" '+d[2]+" /> Freehold</div>"}}}return b}function showRouteList(a,g,n){var h=$("content_listing_title");if(h){$("content_listing_header").style.display="";$("content_listing_header").style.backgroundColor="#ffffff";var y="";if(a.mode==1){if(a.weight==0){y="Bus Directions"}else{if(a.weight==1){y="MRT Directions"}else{if(a.weight==2){y="Bus & MRT Directions"}}}}else{y="Driving Directions"}h.innerHTML="<div style='text-align: left; padding: 5px'><table cellpadding='0' cellspacing='0' border='0' width='100%'><tr><td class='TextBold ver_14 arial'>"+y+"</td><td class='Link17 arial' align='right'><a href='javascript:void(0)' onclick='MapAPI.mapDraw.panelIcon.routes.clear()'>[Clear]</a></td></tr></table></div>";h.style.display=""}global.active_list="dd";$("content_listing_paging_top").parentNode.style.display="none";$("content_listing_paging_bottom").style.display="none";h=$("content_listing");h.style.display="";if(a.start&&a.end){var j=new WGSProjection();h.innerHTML='<div align="center" style="padding-top:50px"><img src="http://'+location.hostname+'/img/map/loading2.gif" width="68" height="87"/></div>';abortAjax(global_ajax.d);if(document.getElementById){global_ajax.d=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(global_ajax.d){global_ajax.d.onreadystatechange=function(){if(global_ajax.d.readyState==4){try{if(h){h.innerHTML=global_ajax.d.responseText;showRoutePaging();fitListHeight();if(n){focusRoute(n)}if(g==1){MapAPI.mapDraw.panelIcon.clearCheckpoints();drawCheckpoints()}}global.curr_dd_page=g}catch(i){}}};var f=a.start;var o=a.end;var x="";if(a.via&&a.via.length>0){x="&via="+a.via[0].x+","+a.via[0].y;for(var t=1;t<a.via.length;t++){x+=";"+a.via[t].x+","+a.via[t].y}}var p="",r=a.mslinks;if(r.length>0){p="&mslink="+r[0];for(var t=1;t<r.length;t++){p+=","+r[t]}}var s="";if(n){s="&sel="+n}var q="";if(a.keyword){q="&srch="+a.keyword}var w=f.x,c=f.y,u=o.x,b=o.y;if(isNaN(w)||isNaN(c)||isNaN(u)||isNaN(b)){h.innerHTML='<div class="ver_11" style="padding: 5px">We could not find routes.</div>';return false}var v=getLastPos();var k=MapAPI.mapClient.detectMapName(v.x,v.y);if(k==false){k="sg"}if(a.mode==1){var m="";if(MapAPI.browser.name=="IE"&&MapAPI.browser.version>=5.5&&MapAPI.browser.version<7){m="&ie=1"}if(a.weight==0){var d="http://"+location.hostname+"/travel/ajax/bus/bus_detail.php?x1="+w+"&y1="+c+"&x2="+u+"&y2="+b+q+"&p="+g+m+"&s="+k+"&v="+global.v_c+global_clear_cache}else{if(a.weight==1){var d="http://"+location.hostname+"/travel/ajax/mrt/mrt_detail.php?x1="+w+"&y1="+c+"&x2="+u+"&y2="+b+q+"&p="+g+m+"&s="+k+"&v="+global.v_c+global_clear_cache}else{var d="http://"+location.hostname+"/travel/ajax/busmrt/busmrt_detail.php?x1="+w+"&y1="+c+"&x2="+u+"&y2="+b+q+"&p="+g+m+"&s="+k+"&v="+global.v_c+global_clear_cache}}}else{if(a.mode==0){var m="";if(MapAPI.browser.name=="IE"&&MapAPI.browser.version>=5.5&&MapAPI.browser.version<7){m="&ie=1"}if(a.weight==2){var d="http://"+location.hostname+"/routing/ajax/routing_detail.php?x1="+w+"&y1="+c+"&x2="+u+"&y2="+b+"&exp_name="+a.exp_name+"&weight="+a.weight+x+p+s+q+"&p="+g+m+"&s="+k+"&v="+global.v_c+global_clear_cache}else{var d="http://"+location.hostname+"/routing/ajax/routing_detail.php?x1="+w+"&y1="+c+"&x2="+u+"&y2="+b+"&weight="+a.weight+x+p+s+q+"&p="+g+m+"&s="+k+"&v="+global.v_c+global_clear_cache}}}global_ajax.d.open("GET",d,true);global_ajax.d.send(null)}}else{if(a.start&&!a.end){h.innerHTML='<div class="ver_11" style="padding-left:5px; padding-top: 5px">Please define your end destination</div>'}else{h.innerHTML=""}}}function showRoutePaging(){var elm=$("dd_pages");if(elm){var paging=eval("("+elm.innerHTML+")");var page=paging[0];var max_page=paging[1];showPaging(page,max_page,function(p){return"go_to_page_dd("+p+")"})}}function showPaging(g,a,f){var c="";if(a>=1){var h=8;if(g>8){h=6}var k=Math.floor((g-1)/h)*h+1;c+='<div class="ver_11 Link17" style="padding:5px;padding-left:7px">Page';if(k>1){c+='&nbsp;<a style="border: 1px solid #c0c0c0; padding: 2px;" title="Go To Page 1" onclick="'+f(1)+'" href="javascript:void(0);">1</a>';c+='&nbsp;<a style="border-right: 1px solid #000000; padding: 2px" title="Show Prev 6 Page(s)" onclick="'+f(k-1)+'" href="javascript:void(0);">&laquo;</a>'}for(var d=k,b=0;d<=a&&b<h;d++,b++){if(d==g){c+='&nbsp;<span style="border: 1px solid #c0c0c0; padding: 2px;" class="TextBold TextMerah">'+d+"</span>"}else{c+='&nbsp;<a style="border: 1px solid #c0c0c0; padding: 2px;" title="Go To Page '+d+'" onclick="'+f(d)+'" href="javascript:void(0);">'+d+"</a>"}}if(k+h<a){c+='&nbsp;<a style="border-left: 1px solid #000000; padding: 2px" title="Show Next 6 Page(s)" onclick="'+f(d)+'" href="javascript:void(0);">&raquo;</a>'}c+="</div>";if($("content_listing_paging_top2")){$("content_listing_paging_top2").parentNode.style.display="block";$("content_listing_paging_top2").innerHTML=c;$("content_listing_paging_top2").style.display="block"}$("content_listing_paging_bottom").style.display="block";$("content_listing_paging_bottom").innerHTML=c}}function clearLHS(){if($("content_listing")){$("content_listing").innerHTML=""}if($("content_listing_title")){$("content_listing_title").innerHTML=""}if($("content_listing_paging_top")){$("content_listing_paging_top").innerHTML=""}if($("content_listing_paging_top2")){$("content_listing_paging_top2").innerHTML="";$("content_listing_paging_top2").parentNode.style.display="none"}if($("content_listing_paging_bottom")){$("content_listing_paging_bottom").innerHTML=""}if(global_data&&global_data.length>0&&MapAPI.mapClient.levelIndex>=4){listCompany(global_page)}else{$("content_listing").style.display="none"}}function hideLHS(){var a=$("show_result");if(a&&a.style.display!="none"){a.style.display="none";if($("content_listing_paging_bottom")){$("content_listing_paging_bottom").style.display="none"}}}function showLHS(){var a=$("show_result");if(a&&a.style.display!="block"){a.style.display="block";if($("content_listing_paging_bottom")){$("content_listing_paging_bottom").style.display="block"}}}function routeMouseOver(c,a){if(!window.MapAPI){return false}if($("content_listing")){var b=Math.ceil(c/6);if(MapAPI.mapDraw.panelIcon.routes.mode==0&&(b!=global.curr_dd_page||global.active_list!="dd")){go_to_page_dd(b,c);global.curr_dd_page=b}else{focusRoute(c,a)}}}function focusRoute(c,a){var b=$("trNav"+c);if(b!=null){if(a){$("content_listing").scrollTop=b.offsetTop}b.bgColor="#ffffaa";if($("img_num_"+c)){$("img_num_"+c).className="star_route_hover"}if(MapAPI.mapDraw.panelIcon.routes.checkpoints[c-2]){MapAPI.mapDraw.panelIcon.routes.checkpoints[c-2].obj.childNodes[0].childNodes[0].childNodes[0].className="star_route_hover"}}}function routeMouseOut(b){if(!window.MapAPI){return false}if($("content_listing")){var a=$("trNav"+b);if(a!=null){a.bgColor="#ffffff";if($("img_num_"+b)){$("img_num_"+b).className="star_route"}if(MapAPI.mapDraw.panelIcon.routes.checkpoints[b-2]){MapAPI.mapDraw.panelIcon.routes.checkpoints[b-2].obj.childNodes[0].childNodes[0].childNodes[0].className="star_route"}}}}function go_to_page_dd(a,b){showRouteList(MapAPI.mapDraw.panelIcon.routes,a,b)}function drawCheckpoints(){var elm=$("dd_checkpoints");if(elm){try{var map_name=$("dd_map_name").innerHTML;var map_detail=MapAPI.mapClient.getMapDetail(map_name);var map_zone=map_detail[0];var is_south=map_detail[1];var checkpoints=eval("("+elm.innerHTML+")"),cp,icon;var length=checkpoints.length;if(length>0){var wgs=new WGSProjection();MapAPI.mapDraw.panelIcon.routes.start.attachDDEvent(1);for(var i=1;i<length-1;i++){cp=checkpoints[i];if(MapAPI.mapClient.levelIndex<=4){var xy=wgs.utmToGeo(cp.x,cp.y,map_zone,is_south);icon=MapAPI.mapDraw.panelIcon.addCheckpoint(xy.y,xy.x,i+1,17,17,cp.mslink)}else{icon=MapAPI.mapDraw.panelIcon.addCheckpoint(cp.x,cp.y,i+1,17,17,cp.mslink)}}MapAPI.mapDraw.panelIcon.routes.end.attachDDEvent(length)}}catch(e){}}}function skipRoute(a){if(confirm("Avoiding this maneuver will remove it and recalculate your route.")){MapAPI.mapDraw.panelIcon.routes.mslinks.push(a);MapAPI.mapDraw.panelIcon.routes.drawRoute();showRouteList(MapAPI.mapDraw.panelIcon.routes,1)}}function showBusRouteList(g,f,i,b){var h;global.active_list="bus";h=$("content_listing");h.style.display="";if(document.getElementById){var a=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}if(a){h.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){try{if(h){if(a.responseText==""){$("content_listing_header").style.display="none";$("content_listing").style.borderTop="0px";h.innerHTML='<div class="ver_11" style="padding: 5px">Sorry, we have no route information for this bus service</div>'}else{h.innerHTML=a.responseText;showBusRoutePaging(g,f);if(typeof i=="string"){i=parseInt($("bus_focus").innerHTML)}showBusRouteHeader(g,f);showClearBus();fitListHeight();focusBusStop(i,b)}}}catch(j){}}};show_element("loading_route");if(g.search(/\d$/)!=-1){g=g.toLowerCase().replace(/^0+/,"")}else{g=g.toLowerCase()}if(typeof i=="string"){var d="&sid="+i}else{var d="&id="+i}var c="http://"+location.hostname+"/asia_travel/mappage/ajax/get_bus_service_detail.php?no="+g+"&d="+f+d+"&v="+global.v_c+global_clear_cache;a.open("GET",c,true);a.send(null)}}function busStopMouseOver(d,c,f,a){if($("content_listing")){var b=Math.ceil(f/15);if($("img_num_"+f)){$("img_num_"+f).className="star_route_hover"}if(f>1&&f<MapAPI.mapDraw.panelIcon.bus_route.bus_stops.length&&MapAPI.mapDraw.panelIcon.bus_route.bus_stops[f-1]){MapAPI.mapDraw.panelIcon.bus_route.bus_stops[f-1].obj.childNodes[0].childNodes[0].childNodes[0].className="star_route_hover"}if(b!=global.curr_bus_page||global.active_list!="bus"){showBusRouteList(d,c,f,a);global.curr_bus_page=b}else{focusBusStop(f,a)}}}function busStopMouseOut(a,c){if($("content_listing")){var b=$("trNav"+c);if(b!=null){b.bgColor="#ffffff";if($("img_num_"+c)){$("img_num_"+c).className="star_route"}}if(c>1&&c<MapAPI.mapDraw.panelIcon.bus_route.bus_stops.length&&MapAPI.mapDraw.panelIcon.bus_route.bus_stops[c-1]){MapAPI.mapDraw.panelIcon.bus_route.bus_stops[c-1].obj.childNodes[0].childNodes[0].childNodes[0].className="star_route"}}}function focusBusStop(c,a){var b=$("trNav"+c);if(b!=null){if(a){$("content_listing").scrollTop=b.offsetTop}b.bgColor="#ffffaa";if(a&&$("img_num_"+c)){$("img_num_"+c).src="http://"+location.hostname+"/img/dd_search/digit/"+c+"_red.gif"}else{if(!a&&MapAPI.mapDraw.panelIcon.bus_route.bus_stops[c-1]&&c>1&&c<MapAPI.mapDraw.panelIcon.bus_route.bus_stops.length){MapAPI.mapDraw.panelIcon.bus_route.bus_stops[c-1].obj.src="http://"+location.hostname+"/img/dd_search/digit/"+c+"_red.gif"}}}}function showBusRoutePaging(no,direction){var elm=$("bus_paging");if(elm){var paging=eval("("+elm.innerHTML+")");var page=paging[0];var max_page=paging[1];showPaging(page,max_page,function(p){return"showBusRouteList('"+no+"', "+direction+", "+((p-1)*15+1)+")"});global.curr_bus_page=page}}function showBusRouteHeader(no,direction){var elm=$("content_listing_title");if(elm){var header_info=eval("("+$("bus_header_info").innerHTML+")");var num_dir=header_info[0];var is_loop=header_info[1];var from=header_info[2];var to=header_info[3];var type=header_info[4];$("content_listing_header").style.backgroundColor="#f4f4f4";$("content_listing_header").style.display="block";var type_bus,type_bus_bg;if(type=="sbs"){type_bus_bg="#fb0000";type_bus="SBS Bus No"}else{if(type=="smrt"){type_bus_bg="#4b0082";type_bus="SMRT Bus No"}else{type_bus_bg="#4b0082";type_bus="Undefined Bus No"}}var content_title='<div style="text-align: left; padding: 4px 0px 4px 8px"><div style="text-align: center; background-color:'+type_bus_bg+'; padding: 2px; width: 92px"><div style="background-color:'+type_bus_bg+'; border: 1px solid #fff; font-size: 21pt; width: 90px" class="TextPutih"><div class="ver_11" style="padding-top:1px">'+type_bus+'</div><div style="line-height: 80%; padding-bottom: 4px">'+no.toUpperCase()+"</div></div></div>";if(is_loop){content_title+='<div style="position:absolute; top: 4px; left: 104px"><img src="http://'+location.hostname+'/img/map/bus/loop_side_nav.gif" width="19" height="46"/></div>'}if(num_dir>1){content_title+='<div class="ver_11 TextBold" style="position: absolute; top: 12px; left: 150px">';if(direction==1){content_title+='Direction 1<br/><span class="TextSilver">Direction 2</span>'}else{content_title+='<span class="TextSilver">Direction 1</span><br/>Direction 2'}content_title+="</div>"}content_title+="</div>";if(from&&to){content_title+='<div style="background-color: #f8f9f8; text-align:left; padding-left: 7px"><table class="ver_10 arial" cellspacing="1" cellpadding="0">';content_title+='<tr><td width="35">From</td><td width="5">:</td><td>'+(direction==1?from:to)+"</td></tr><tr><td>To</td><td>:</td><td>"+(direction==1?to:from)+"</td></tr>";content_title+="</table>";if(num_dir>1){swap_dir=direction==1?2:1;content_title+='<div style="position:absolute; right: 6px; top: 57px"><img src="http://'+location.hostname+'/img/map/bus/swap_side_nav.gif" width="19" height="23" style="cursor:pointer" title="Swap to another direction" onmouseover="this.src=\'http://'+location.hostname+"/img/map/bus/swap_side_nav_hover.gif'\" onmouseout=\"this.src='http://"+location.hostname+"/img/map/bus/swap_side_nav.gif'\" onclick=\"drawBusRoute('"+no+"', "+swap_dir+', 1)"/></div>'}content_title+="</div>"}elm.innerHTML=content_title;elm.style.display=""}}function showClearBus(){var b=$("content_listing_title");if(b){var a='<div style="position: absolute; right: 6px; top: '+(b.offsetHeight+2)+'px; z-index: 1"><img src="http://'+location.hostname+'/img/map/bus/clear.gif" width="61" height="18" onmouseover="this.src=\'http://'+location.hostname+"/img/map/bus/clear_hover.gif'\" onmouseout=\"this.src='http://"+location.hostname+'/img/map/bus/clear.gif\'" style="cursor:pointer" title="Clear Bus Route" onclick="clear_bus()"/></div>';b.innerHTML+=a}}function goToBusStop(q,n,o,m,a,p){var b,g;var f='<div style="padding-bottom: 7px; padding-right: 9px"><span class="arial ver_14"><b>'+p+(p.charAt(p.length-1)=="."?"":".")+"</b>&nbsp;Bus stop no: "+a+'</span></div><div id="map_bubble_content_loading" class="arial ver_11">Loading...</div>';var d=new Object();if(MapAPI.mapClient.mapScale.mode=="WGS"){b=q;g=n}else{b=o;g=m}MapAPI.mapClient.setCenterVertex(new Vertex(b,g));setLastPos(b,g);var r=MapAPI.mapDraw.panelIcon.bus_route.bus_stops,j;for(var c=0,h=r.length;c<h;c++){j=r[c];if(j.updatePosition(MapAPI.mapClient)){MapAPI.mapDraw.panelIcon.appendIcon(j)}else{MapAPI.mapDraw.panelIcon.removeIcon(j)}}MapAPI.mapClient.DrawMap();var k=MapAPI.mapDraw.openBubble(330,225,new Point(b,g),f);d.id=a;d.title=p;d.type="bus";d.x_addr=b;d.y_addr=g;getBusCPBubbleContent(d,k,p);MapAPI.mapDraw.closeToolTips()}function showScheduleAd(d){var c=$("schAds");if(c){c.innerHTML="";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==""){c.style.display="none"}else{c.innerHTML=a.responseText}}else{var f="http://"+location.hostname+"/img/map/loading-icon.gif";c.innerHTML='<div style="width:248x;height:123px;padding-top:15px;padding-left:10px;"><div style="padding-top:30px;"><img src="'+f+'" border="0"></div></div>'}};var b="http://"+location.hostname+"/asia_travel/mappage/ajax/show_schedule_cat.php?id="+d+"&v="+global.v_c+global_clear_cache;a.open("GET",b,true);a.send(null)}}};function F1_Sepang(a){this.ma=a;this.flag_point=new Vertex(804230.49,305571.18);this.flag_point_ll=new Vertex(101.73615703824,2.761409);this.start_point=new Vertex(804444.09,305538.18);this.dot_points=new Array(new Vertex(804333.09,305529.18),new Vertex(803751.09,305543.58));this.dot_images=new Array("Grandstand.png","K1.png");this.init()}F1_Sepang.prototype.init=function(){var h=this.ma.mapClient;var j=this;var a;if(h.mapScale.mode=="Mercator"){a=this.flag_point_ll}else{a=this.flag_point}var f=this.ma.mapDraw.stickIcon(a.x,a.y,92,58,"http://"+location.hostname+"/img/map/f1/my/motogp.png","f1");f.setPointerOffset(new Point(0,0));f.obj.onclick=function(){h.ChangeLevel(9);gotoMap(j.flag_point.x,j.flag_point.y)};var b=this.ma.mapDraw.stickIcon(this.start_point.x,this.start_point.y,90,69,"http://"+location.hostname+"/img/map/f1/my/GreenDot.png","f1_dot");b.obj.onmouseover=function(){b.obj.onload=function(){this.style.width="219px";this.style.height="69px"};b.setImageSrc("http://"+location.hostname+"/img/map/f1/my/StartFinish.png?v="+global.v_i)};b.obj.onmouseout=function(){b.obj.onload=function(){this.style.width="90px";this.style.height="69px"};b.setImageSrc("http://"+location.hostname+"/img/map/f1/my/GreenDot.png")};if(window.addEventListener){b.obj.addEventListener("DOMMouseScroll",this.onMouseWheel,false)}b.obj.onmousewheel=this.onMouseWheel;b.obj.ondblclick=this.onDoubleClick;var g,c;for(var d=0,e=this.dot_points.length;d<e;d++){this.drawIcon(d)}};F1_Sepang.prototype.drawIcon=function(b){var c=this.ma.mapDraw.stickIcon(this.dot_points[b].x,this.dot_points[b].y,48,49,"http://"+location.hostname+"/img/map/f1/my/RedDot.png?v="+global.v_i,"f1_dot");var d=this.dot_images[b];var a=this;c.obj.onmouseover=function(f){c.obj.onload=function(){this.style.width="282px";this.style.height="116px";this.style.zIndex=9};c.setImageSrc("http://"+location.hostname+"/img/map/f1/my/"+a.dot_images[b]+"?v="+global.v_i)};c.obj.onmouseout=function(){c.obj.onload=function(){this.style.width="48px";this.style.height="49px";this.style.zIndex=8};c.setImageSrc("http://"+location.hostname+"/img/map/f1/my/RedDot.png?v="+global.v_i)};if(window.addEventListener){c.obj.addEventListener("DOMMouseScroll",this.onMouseWheel,false)}c.obj.onmousewheel=this.onMouseWheel;c.obj.ondblclick=this.onDoubleClick};F1_Sepang.prototype.onMouseWheel=function(a){cancelEvent(a);return false};F1_Sepang.prototype.onDoubleClick=function(a){cancelEvent(a);return false};
