var AP_CurObj=null;var AP_Name="";var AP_AddNumber="";var AP_AddStreet="";var AP_AddWard="";var AP_AddDistrict="";var AP_AddProvince="";var AP_Phone="";var AP_Note="";var AP_Coor="";var bIsPlaceAdding=false;function loadAddPlaceFunc(){ClearSearchResult();if(!checkLogin()){var b=BuildMapLink();window.location="login.aspx?"+b.substring(b.indexOf("?")+1);return}bIsPlaceAdding=true;var a="";if(nLanguage==0){a='<div style="padding:10px"><div class="Acor"><span class="Title">Hướng dẫn thêm vị trí</span>        <div class="Content" style="font-size:13px;"><img src="images/img1.gif"/> Nhấp chuột lên bản đồ để thêm điểm.<br/>        Hệ thống sẽ tự động điền các thành phần địa chỉ có thể dùm bạn.<br/><br/>        <img src="images/img1.gif"/> Kéo marker <img src="images/mymap_icon/point-1.gif" height="20px"/> đến vị trí bạn muốn trên bản đồ để thay đổi vị trí.<br/><br/>        <img src="images/img1.gif"/> Nhập thông tin của vị trí và bấm vào nút Lưu.<br/>        <br/>Lưu ý: nếu vị trí có nhiều số điện thoại, bạn hãy nhập dấu " - " để phân cách và vui lòng nhập thông tin bằng tiếng Việt có dấu để việc tìm kiếm được chính xác.</div>        <br/>        <a onclick="unloadAddPlaceFunc();"><b>« Quay lại</b></a></div>'}else{a='<div style="padding:10px"><div class="Acor"><span class="Title">Add place help</span>        <div class="Content" style="font-size:13px;"><img src="images/img1.gif"/> Left-click on map to add a place.<br/>        We will fill detected parts of address for you.<br/><br/>        <img src="images/img1.gif"/> Drag marker <img src="images/mymap_icon/point-1.gif" height="20px"/> on map to change the location of place.<br/><br/>        <img src="images/img1.gif"/> Enter place\'s information and click Save.<br/>        <br/>Note: If the place have more than one phone number, use " - " sign to separate them.</div>        <br/>        <a onclick="unloadAddPlaceFunc();"><b>« Back</b></a></div>'}document.getElementById("searchresult_div").innerHTML=a}function unloadAddPlaceFunc(a){if(document.getElementById("searchoptions")==null){return}Show_Map_Help();bIsPlaceAdding=false;if(AP_CurObj!=null){map.removeOverlay(AP_CurObj);AP_CurObj=null}if(a){if(nLanguage==0){alert("Thêm vị trí thành công. Cám ơn sự đóng góp của bạn.\r\nVị trí này sẽ phải chờ hệ thống của chúng tôi kiểm duyệt.\r\nTạm thời bạn chưa thể tìm thấy nó trên Vietbando.")}else{alert("Location added successfully. Thank for your contribution.\r\nThis location must be checked by our system.\r\nYou cannot find it now.")}}AP_Name="";AP_AddNumber="";AP_AddStreet="";AP_AddWard="";AP_AddDistrict="";AP_AddProvince="";AP_Phone="";AP_Note="";AP_Coor=""}function AP_savePlace(){AP_Name=document.getElementById("txtAPName").value;AP_AddNumber=document.getElementById("txtAddNo").value;AP_AddStreet=document.getElementById("txtAddStreet").value;AP_Keyword=document.getElementById("txtVbdID").value;if(AP_Name!=""&&AP_AddStreet!=""){if(AP_AddNumber=="Số nhà"||AP_AddNumber=="Addr No"){AP_AddNumber=""}var a=new RegExp(/^[A-Za-z0-9_.]*$/g);if(AP_Keyword.length<6||AP_Keyword.length>50||!a.test(AP_Keyword)){if(nLanguage==0){document.getElementById("aperror").innerHTML="Vui lòng nhập VietbandoID từ 6-30 ký tự và chỉ chứa: (a-z A-Z 0-9)."}else{document.getElementById("aperror").innerHTML="Your VietbandoID must be 6-30 characters and only contains: (a-z A-Z 0-9)."}return}else{var d=AJLocationSearch.IsVBDIDAvailable(AP_Keyword).value;if(!d){if(nLanguage==0){document.getElementById("aperror").innerHTML="VietbandoID của bạn đã được dùng bởi người khác. Vui lòng chọn ID khác."}else{document.getElementById("aperror").innerHTML="Your VietbandoID was taken by another user. Please try another."}return}}AP_Phone=document.getElementById("txtPhone").value;AP_Note=document.getElementById("txtNote").value;var b=AP_getObjCoor();var c=AJLocationSearch.AddPlace(AP_Name,AP_AddNumber,AP_AddStreet,AP_AddWard,AP_AddDistrict,AP_AddProvince,AP_Phone,AP_Note,b,AP_Keyword).value;if(!c){if(confirm("Dữ liệu thêm không thành công do phiên làm việc của bạn đã hết hạn\nBạn có muốn đi tới trang đăng nhập?")==true){window.location.href="login.aspx"}return}map.closeInfoWindow();unloadAddPlaceFunc(true)}else{if(nLanguage==0){document.getElementById("aperror").innerHTML="Bạn vui lòng điền đầy đủ thông tin về vị trí."}else{document.getElementById("aperror").innerHTML="Please enter required information."}}}function AP_Cancel(){map.closeInfoWindow();unloadAddPlaceFunc(false)}function AP_showInfoWindow(){var f="mymap_icon/point-1.gif";var n=AJLocationSearch.GetGeoInfoByPoint(AP_CurObj.getPoint().lng()+"",AP_CurObj.getPoint().lat()+"").value.split(",");AP_AddNumber="";AP_AddStreet="";AP_AddWard=n[n.length-3];AP_AddDistrict=n[n.length-2];AP_AddProvince=n[n.length-1];var l=new Array();var g=new Array();var o=(nLanguage==0)?"Thêm mới vị trí":"Add new place";var d=(nLanguage==0)?"Tên vị trí":"Place name";var h=(nLanguage==0)?"Địa chỉ":"Address";var m=(nLanguage==0)?"Điện thoại":"Phone";var k=(nLanguage==0)?"VietbandoID":"VietbandoID";var j=(nLanguage==0)?"(6-30 ký tự)":"(6-30 characters)";var e=(nLanguage==0)?"Mô tả":"Comment";var a=(nLanguage==0)?"*Bạn vui lòng gõ tiếng Việt có dấu":"";var c=(nLanguage==0)?"Lưu":"Save";var p=(nLanguage==0)?"Hủy":"Cancel";var b=(nLanguage==0)?"Dùng làm từ khóa tìm kiếm. Vd: Vietbando":"Vietbando identifier. Ex: Vietbando";g[g.length]='<div id="apForm" class="jForm" style="width:360px">                         <fieldset>						 <legend style="color: #0066cc;"><b>'+o+'</b></legend>						    <div>							    <label for="txtAPName" style="width:75px">'+d+':</label>							    <input id="txtAPName" name="txtAPName" type="text" style="width:250px" />						    </div>						    <div>							    <label for="txtAddNo" style="width:75px">'+h+':</label>							    <input id="txtAddNo" name="txtAddNo" type="text" value="'+((nLanguage==0)?"Số nhà":"Addr No")+'" onfocus="OnFocusAddNumber(this)" style="width:60px" value=""/>							    <input id="txtAddStreet" name="txtAddStreet" type="text"  onfocus="OnFocusAddStreet(this)" style="width:180px" value="'+((n[n.length-4]!=null)?n[n.length-4]:((nLanguage==0)?"Tên đường":"Street name"))+'"><br/>							</div>							<div>							    <p style="margin:2px;left:76px;position:relative;width:250px">'+n[n.length-3]+", "+n[n.length-2]+", "+n[n.length-1]+'</p>						    </div>						    <div>							    <label for="txtPhone" style="width:75px">'+m+':</label>							    <input id="txtPhone" name="txtPhone" type="text" style="width:250px" />						    </div>						    <div>							    <label for="txtVbdID" style="width:75px;">'+k+':</label>							    <input id="txtVbdID" name="txtVbdID" type="text" style="width:150px" /> '+j+"						    </div>						    <div><i>"+b+"</i>						    </div>						    "+e+':<br />						    <textarea rows="3" cols="40" id="txtNote" name="txtNote"  style="height:55px;width:330px"></textarea>						</fieldset>					    <div class="submit" style="text-align:right;">						        <span id="aperror" style="float:left;text-align:left;clear:both;color:red;width:230px">'+a+'</span>						        <input type="button" onclick="AP_savePlace()" value="'+c+'"/>						        <input type="button" onclick="AP_Cancel()" value="'+p+'"/>					        </div>				        </div>';AP_CurObj.openInfoWindow(g.join(""));setTimeout(function(){if(document.getElementById("txtAPName")!=null){document.getElementById("txtAPName").focus()}},500)}function OnFocusAddNumber(a){if(a.value=="Số nhà"||a.value=="Addr No"){a.value=""}}function OnFocusAddStreet(a){if(a.value=="Tên đường"||a.value=="Street name"){a.value=""}}function ShowAddPlacePopup(b){if(AP_CurObj!=null){map.removeOverlay(AP_CurObj);AP_CurObj=null}var a=new GeneralMap.Marker(b,new GeneralMap.Icon("images/mymap_icon/point-1.gif",new GeneralMap.Size(32,32)));a.type=ADDPLACEOBJ;map.addOverlay(a);AP_CurObj=a;a.enableDragging();AP_showInfoWindow();GeneralMap.Event.addListener(a,"dragend",AP_showInfoWindow)}function AP_getObjCoor(){var a=AP_CurObj.getPoint();var b="POINT("+a.lng()+" "+a.lat()+")";
return b}var CateFilter;var KeySearch;var PAGE_ROWS=10;var PAGE_SHOW=7;var DELTA_FROM_CENTER=3;var RelativeDir="";var pTitleLength=50;var popupW=595;var popupH=250;var CurGuid="";var StoreTable;var ContentLocation={IsShow:false,IsSearchInside:false,NormalSearchStatus:"",SearchInsideKey:null,SearchInsideStoreID:null,SelectInsideStoreID:null,Loading:false,OnKeyDownSearchInsideStore:function(a){if(a.keyCode==13){ContentLocation.SearchInsideStore(1)}return false},SearchInsideStore:function(a){ContentLocation.IsSearchInside=true;ContentLocation.SearchInsideKey=document.getElementById("TxtSearchInsideProduct").value;if(ContentLocation.SearchInsideKey==""){return false}ContentLocation.GetProductInsideStore(a)},ViewStoreInfo:function(a,e){if(ContentLocation.Loading&&document.getElementById("popup_max")!=null){return}ContentLocation.Loading=true;StoreTable=AJProductSearch.GetStoreInfo(e).value;CurGuid=StoreTable.Rows[0].GUID;var c=dsResultData.Tables[0].Rows[a-1].Name;var f='<div id="popup_title" class="popup_title">							<p id="PopupTitle">'+c+"</p>						</div>";var b=BuildStoreWindow(a);infoWindow.updateMaxTitle(f);infoWindow.updateMaxContent(b);var d=new GeneralMap.InfoWindowOptions();d.autoPan=true;if(a<=20){HightlightActiveItem(a)}document.getElementById("pmfromhere"+a).onclick=function(){FromHere(LocInfo,text)};document.getElementById("pmtohere"+a).onclick=function(){ToHere(LocInfo,text)};document.getElementById("pmback"+a).onclick=function(){infoWindow.restore()};loadMapMoreInfo(StoreTable.Rows[0].Latitude,StoreTable.Rows[0].Longitude);setTimeout(function(){ContentLocation.ActiveTab("detail",e,CurGuid)},300)},BuildTreeRootID:null,BuildTreeStoreID:null,BuildTree:function(c,b,a){ShowAJLoad("Tree");tree=new dTree("tree",RelativeDir+"Treeview/dtree/");tree.config.inOrder=true;tree.config.useStatusText=true;tree.config.useCookies=false;if(c==0){c=b}ContentLocation.BuildTreeRootID=c;ContentLocation.BuildTreeStoreID=b;AJProductSearch.GetStoreTree(c,ContentLocation.CallBackBuildTree)},CallBackBuildTree:function(b){var e=ContentLocation.BuildTreeRootID;var d=ContentLocation.BuildTreeStoreID;ContentLocation.BuildTreeRootID=null;ContentLocation.BuildTreeStoreID=null;var a=b.value;var c=a.ParentName;tree.add(e,-1,c,"javascript:ContentLocation.TreeClick(0,"+d+")");ContentLocation.BuildChildTree(tree,e,a.Childs);HideAJLoad("Tree","Tree");SafeSetInnerHtml("Tree",tree);tree.openAll(true);ContentLocation.TreeClick(e,d)},BuildChildTree:function(b,d,c){if(c==null||c.length==0){return}for(var a=0;a<c.length;a++){b.add(c[a].StoreID,d,c[a].StoreName,"javascript:ContentLocation.TreeClick("+c[a].StoreID+","+c[a].StoreID+")");ContentLocation.BuildChildTree(b,c[a].StoreID,c[a].Childs)}},TreeClick:function(g,c,a){var b=tree.getNode(c);tree.openTo(c,true);if(g==c){tree.s(b._ai)}var f=new Array();for(var h=0;h<tree.Nodes.length;h++){if(tree.Nodes[h].parentid==c){f[f.length]='<div class="dTreeNode"><img src="'+tree.Nodes[h].icon+'" align="absmiddle" style="margin-right:2px;"/><a onclick="ContentLocation.TreeClick('+g+","+tree.Nodes[h].id+')" class="node">'+tree.Nodes[h].name+"</a></div>"}}if(f.length>0){var d=document.getElementById("ChildView");if(d!=null){d.style.display="block";d.innerHTML=f.join("")}}else{var d=document.getElementById("ChildView");if(d!=null){d.style.display="none"}}SafeSetInnerHtml("CatFilter",ContentLocation.GetCateoryFilter(c));ContentLocation.GetDetailPage(c,1);ContentLocation.ActiveTab("detail",c,CurGuid)},ViewTreeNode:function(b,a){if(document.getElementById("Tree").className!="ajLoading"){ContentLocation.TreeClick(b,b,a)}},GetCateoryFilter:function(a){CateFilter="-1";CateInStore=AJProductSearch.GetCategoryFilter(a).value;return ContentLocation.BuildCateList(a,CateInStore)},BuildCateList:function(d,c){var b="";if(c!=null&&typeof(c)=="object"){if(c.Rows.length>1){b="";if(CateFilter=="-1"){b+="<b>Tất cả</b>"}else{b+='<a onclick="ContentLocation.ChangeSelectCate('+d+", '-1')\">Tất cả</a>"}for(var a=0;a<c.Rows.length;a++){if(c.Rows[a].category_name!=""){if(CateFilter==c.Rows[a].category_name){b+=" | <b>"+c.Rows[a].category_name+"</b>"}else{b+=' | <a onclick="ContentLocation.ChangeSelectCate('+d+", '"+c.Rows[a].category_name+"')\">"+c.Rows[a].category_name+"</a>"}}}}}return b},ChangeSelectCate:function(c,b){ContentLocation.SetCateFilter(c,b);var a=ContentLocation.BuildCateList(c,CateInStore);SafeSetInnerHtml("CatFilter",a)},SetCateFilter:function(b,a){CateFilter=a;ContentLocation.GetDetailPage(b,1)},ActiveTab:function(b,c,a){if(document.getElementById("tab"+b)==null){return}if(document.getElementById("tab"+b).className!="current"){if(document.getElementById(b+"content").innerHTML==""){switch(b){case"overview":ContentLocation.GetOverview(a);break;case"detail":ContentLocation.GetDetail(c);break;case"review":ContentLocation.GetReview(a);break;case"photo":ContentLocation.GetPhoto(a);break;case"video":ContentLocation.GetVideo(a);break}}}else{ContentLocation.Loading=false;return}document.getElementById("taboverview").className="none";document.getElementById("tabdetail").className="none";document.getElementById("tabreview").className="none";document.getElementById("tabphoto").className="none";document.getElementById("tabvideo").className="none";document.getElementById("overviewcontent").className="pcHide";document.getElementById("detailcontent").className="pcHide";document.getElementById("reviewcontent").className="pcHide";document.getElementById("photocontent").className="pcHide";document.getElementById("videocontent").className="pcHide";document.getElementById(b+"content").className="pc";document.getElementById("tab"+b).className="current"},GetProductInsideStore:function(b){ShowAJLoad("row2");SafeSetInnerHtml("row1","");var c=ContentLocation.SearchInsideStoreID;var a=ContentLocation.SearchInsideKey;AJProductSearch.GetProductInsideStore(c,a,b,ContentLocation.CallbackBuildProduct)},GetFistDetailPage:function(e,b){var d=new Array();var c=document.getElementById("popup_max");if(c==null){return}CalculatePopupSize();var f=parseInt(popupW*Global.TreeRatio);var a=popupW-f-50;d[d.length]='<div id="pLeftPanel" style="float:left;width:'+f+'px">								<div id="Tree" class"Tree" style="top:190px;width:'+f+'px"></div>							</div>							<div id="pRightPanel" style="float:right;width:'+a+'px;">							    <div style="margin-bottom:20px; background-color:#EFF9E0;padding:5px">							        Tìm: <input id="TxtSearchInsideProduct" style="width:300px;" type="text" onkeydown="ContentLocation.OnKeyDownSearchInsideStore(event);"/>&nbsp;							        <div id="CatFilter" style="margin-top:5px;"></div>							    </div>							    <div id="sp" class="sp" style="width:'+a+'px;">									<div id="ChildView"></div>									<div id="pResultText" style="margin-bottom:10px;"></div>                                	<div id="DetailPage"></div>								</div>							</div>';SafeSetInnerHtml("detailcontent",d.join(""));CateFilter="-2";ContentLocation.SearchInsideStoreID=b;ContentLocation.SearchInsideKey="";ContentLocation.BuildTree(e,b,"Tree")},GetDetailPage:function(b,a){if(b==null){return""}SafeSetInnerHtml("pResultText","");ShowAJLoad("DetailPage");AJProductSearch.GetProductMatch(b,KeySearch,a,CateFilter,ContentLocation.CallbackBuildProduct)},CallbackBuildProduct:function(m,e){HideAJLoad("DetailPage");SafeSetInnerHtml("DetailPage","");var c=10;var b=m.value;dsProduct=b;var a=new Array();if(b!=null&&typeof(b)=="object"){var n=b.Tables[1].Rows[0].NumResult;var f=b.Tables[1].Rows[0].CurPage;ContentLocation.InsideRootID=null;KeySearch=b.Tables[1].Rows[0].Key;if(n>0&&b.Tables[0].Rows.length>0){SafeSetInnerHtml("pResultText","<span>Danh sách từ <b>"+((f-1)*c+1)+"-"+((f-1)*c+b.Tables[0].Rows.length)+"</b> trong <b>"+n+"</b> thông tin tìm thấy</span>");var j=parseInt((n+PAGE_ROWS-1)/PAGE_ROWS);var g=f;var l=j>PAGE_SHOW?PAGE_SHOW:j;var k=3;var p=(g-1)*PAGE_ROWS;var o=(g-1)*PAGE_ROWS+b.Tables[0].Rows.length;for(var d=0;d<b.Tables[0].Rows.length;d++){var h=b.Tables[0].Rows[d].ID;SafeAppendInnerHtml("DetailPage",ContentLocation.BuildProductMatchItem(b.Tables[0].Rows[d],d))
}if(e.args.CateID==null){SafeAppendInnerHtml("DetailPage",Global.BuildPaging(f,j,n,l,Global.SearchProduct,new Array(e.args.StoreID,null)))}else{SafeAppendInnerHtml("DetailPage",Global.BuildPaging(f,j,n,l,Global.PagingProductMatch,new Array(e.args.StoreID,null)))}}else{}}else{}},BuildProductMatchItem:function(q,h){var m=q.ID;var o=q.Category;var g=q.ProductName;var a=q.Description;var f=q.MinPrice;var r=q.MaxPrice;var k=q.Currency;var j=q.LastEdit;var d=q.Quantity;var c=q.View;var p=q.Rate;var n=q.Manufacture;var l=q.URL;var b=q.Image;if(b==""||b==null){b="images/product_demo.gif"}var e=new Array();e[e.length]="<strong> "+g+'</strong><span style="font-size:9px;color:#666666;"> '+j+"</span>";e[e.length]='<div id="p'+m+'" style="vertical-align:top;clear:both">';e[e.length]='<img height="65" width="88" style="float:left;margin:5px 10px 5px 5px;" src="'+b+'"/>';e[e.length]="<p>";if(o!=null&&o!=""){e[e.length]="Loại: "+o}if(a!=null&&a!=""){if(a.length>80){a=a.substring(0,80)+"..."}e[e.length]="<br/>"+a}e[e.length]='<br/><a onclick="ContentLocation.ShowProductDetail('+m+","+h+')">Xem chi tiết...</a>';e[e.length]='</p><div class="Spacer"></div></div><div class="prInfo" style="border-bottom: solid 1px #cccccc">';if(f!=null&&f!=0&&f!=""&&r!=null&&r!=0&&r!=""&&f!=r){e[e.length]='<span style="color: #999999">Giá: </span> '+f+"-"+r+" "+k}else{if(f!=null&&f!=0&&f!=""){e[e.length]='<span style="color: #999999">Giá: </span> '+f+" "+k}else{e[e.length]=""}}e[e.length]="</div>";return e.join("")},BuildProductDetailItem:function(d,h){var g=d.ID;var l=d.Category;var r=d.ProductName;var s=d.Description;var k=d.MinPrice;var q=d.MaxPrice;var b=d.Currency;var c=d.LastEdit;var f=d.Quantity;var m=d.View;var a=d.Rate;var j=d.Manufacture;var e=d.URL;var p=d.Image;if(p==""||p==null){p="images/product_demo.gif"}var o=new Array();if(h.Tables[0].Rows.length==0){o[o.length]='<img height="65" width="88" style="float:left;margin:5px 10px 5px 5px;" src="images/product_demo.gif"/>'}if(h.Tables[0].Rows.length>0){o[o.length]='<div style="border:0px #cbcbcb solid; border-bottom:0px #cbcbcb solid; margin:10px 0px 0px 0px;"">            <div id="gallery"><ul>';for(var n=0;n<h.Tables[0].Rows.length;n++){o[o.length]='<li><a title="'+r+'" href="'+h.Tables[0].Rows[n]["product_multimedia_path"]+'">                <img height="65" width="65" alt="" src="'+h.Tables[0].Rows[n]["product_multimedia_path"]+'"/></a></li>'}o[o.length]="</ul></div>";o[o.length]='<div style=" background-image:url(images/bgdetail.gif); background-position:bottom; background-repeat:repeat-x;height:15px; margin:0px 2px 0px 2px;">		    <img src="images/detail_info.gif" height="15" style="margin:0px 0px 0px 5px;"/>		    </div></div>'}o[o.length]='<div class="Spacer"></div>';o[o.length]="<p>";if(l!=null&&l!=""){o[o.length]="Loại: "+l}if(s!=null&&s!=""){o[o.length]="<br/>"+s+"</p>"}if(h.Tables[2].Rows.length>0){o[o.length]='<br/><img src="images/img1.gif"/> <b>Thông tin bổ sung: </b><br/><p>';for(var n=0;n<h.Tables[2].Rows.length;n++){o[o.length]=h.Tables[2].Rows[n]["property_name"]+": "+h.Tables[2].Rows[n]["property_value"]+"<br/>"}o[o.length]="</p>"}if(h.Tables[1].Rows.length>0){var d=h.Tables[1].Rows[0];o[o.length]='<br/><img src="images/img1.gif"/> <b>Thông tin khuyến mãi: </b><p>';if(d.promote_discount!=0){o[o.length]="Chiếu khấu: "+d.promote_discount+"%"}if(d.promote_price!=0){o[o.length]="Giảm giá: "+d.promote_price}if(d.promote_gif!=""){o[o.length]="Hình thức khuyến mãi: "+d.promote_gif}if(d.promote_start_date!="01/01/0001"&&d.promote_expires_date!="01/01/0001"){o[o.length]="<br/><br/>Áp dụng từ ngày "+d.promote_start_date+" đến ngày "+d.promote_expires_date}else{if(d.promote_start_date=="01/01/0001"&&d.promote_expires_date!="01/01/0001"){o[o.length]="<br/><br/>Áp dụng đến ngày "+d.promote_expires_date}else{if(d.promote_start_date!="01/01/0001"&&d.promote_expires_date=="01/01/0001"){o[o.length]="<br/><br/>Áp dụng từ ngày "+d.promote_expires_date}}}o[o.length]="</p>"}return o.join("")},ShowProductDetail:function(f,b){if($("#p"+f).height()<200){var a=AJProductSearch.GetProductDetail(f).value;var c="";var d=200;if(a!=null&&typeof(a)=="object"){c=ContentLocation.BuildProductDetailItem(dsProduct.Tables[0].Rows[b],a);var e=document.createElement("div");e.innerHTML=c;e.style.filter="alpha(opacity = 0)";e.style.opacity=0;e.style.width="340px";document.body.appendChild(e);d=e.offsetHeight;document.body.removeChild(e)}$("#p"+f).animate({height:d+"px"},500,function(){this.innerHTML=c;$("#gallery a").lightBox()});$("#p"+f).text("")}else{$("#p"+f).height("")}},GetOverview:function(b){if(b!=null&&b!=""){var a=AJLocationSearch.GetOverview(b).value;if(a!=null){var c=a.Tables[0].Rows[0].Comment;if(c!=null&&c!=""){SafeSetInnerHtml("overviewcontent",c);return}}}SafeSetInnerHtml("overviewcontent",Global.DataUpdating)},GetDetail:function(a){if(a!=null&&a!=-1){var b=StoreTable.Rows[0].RootID;ContentLocation.GetFistDetailPage(a,a)}else{document.getElementById("detailcontent").innerHTML=Global.DataUpdating}},GetReview:function(f,a){if(f==null||f==""||f=="undefined"||f=="null"){return}if(a==null){a="useful"}dtReview=AJLocationSearch.GetReview(f,a).value;var m=new RegExp("\n","g");var g=new Date();var h=g.getDate();var d=g.getMonth()+1;var e=g.getFullYear();var b='<div id="review" class="review" style="width:100%;">';var l=false;if(dtReview!=null){dtReview=dtReview.Tables[0]}if(dtReview!=null&&dtReview.Rows.length>0){if(dtReview.Rows[0].rou==1&&dtReview.Rows[0].UserName!=""&&dtReview.Rows[0].Content!=null){b+='<div id="wrLink">Nhận xét của bạn';b+='				<div class="row">					<p style="left:40px">'+dtReview.Rows[0].Content.replace(m,"<br/>")+'</p>					<p><a href="javascript:ContentLocation.EditReview()">Chỉnh sửa</a>					 - <a href="javascript:ContentLocation.DeleteReview(\''+f+"')\">Xóa</a></p>";if(dtReview.Rows[0].Checked){b+='<span style="color:#336600">Nhận xét của bạn đã được duyệt</span>'}else{b+='<span style="color:red">Nhận xét của bạn đang chờ kiểm duyệt nội dung, chúng tôi sẽ nhanh chóng phản hồi trong thời gian ngắn nhất</span>'}b+="</div></div>";l=true}}if(!l){b+='<p id="wrLink"><a href="javascript:ContentLocation.ShowReviewForm();">Viết nhận xét của bạn</a></p>'}b+='<div id="ReviewForm" class="jForm" style="display:none">					<fieldset>						<legend>Gửi nhận xét</legend>						<div>							<label for="rvTitle">Tiêu đề:</label>							<input id="rvTitle" name="txtTitle" type="text" style="width:400px" />						</div>						<div>							<label for="rating">Đánh giá:</label>							<ul id="rating" class="rating">								<li id="r1" class="starunrated" onmouseover="Rating.displayAsRate(1)" onclick="Rating.setRate(1)" onmouseout="Rating.displayRated()"/>								<li id="r2" class="starunrated" onmouseover="Rating.displayAsRate(2)" onclick="Rating.setRate(2)" onmouseout="Rating.displayRated()"/>								<li id="r3" class="starunrated" onmouseover="Rating.displayAsRate(3)" onclick="Rating.setRate(3)" onmouseout="Rating.displayRated()"/>								<li id="r4" class="starunrated" onmouseover="Rating.displayAsRate(4)" onclick="Rating.setRate(4)" onmouseout="Rating.displayRated()"/>								<li id="r5" class="starunrated" onmouseover="Rating.displayAsRate(5)" onclick="Rating.setRate(5)" onmouseout="Rating.displayRated()"/>							</ul>							<span id="RateExplain" class="gray">(Chưa đánh giá)</span>						</div>						<p style="padding-top:10px"><textarea rows="10" cols="100" id="rvContent" name="rvContent"></textarea></p>					</fieldset>					<div class="submit">						<span id="rverror" style="float:left;color:red"></span>						<input type="button" value="Gửi nhận xét" onclick="ContentLocation.SendReview(\''+f+'\')"/>						<input name="Reset" type="reset" onclick="ContentLocation.HideReviewForm()" value="Hủy" />					</div>				</div>';if(dtReview!=null&&((!l&&dtReview.Rows.length>0)||(l&&dtReview.Rows.length>1))){b+='<p style="text-align:right;">Sắp xếp theo: ';if(a=="useful"){b+="<strong>Nhận xét hay</strong>"}else{b+="<a href=\"javascript:ContentLocation.GetReview('"+f+"','useful');\">Nhận xét hay</a>"
}b+="&nbsp;&nbsp;|&nbsp;&nbsp;";if(a=="date"){b+="<strong>Ngày</strong>"}else{b+="<a href=\"javascript:ContentLocation.GetReview('"+f+"','date');\">Ngày</a>"}b+="&nbsp;&nbsp;|&nbsp;&nbsp;";if(a=="rate"){b+="<strong>Đánh giá</strong>"}else{b+="<a href=\"javascript:ContentLocation.GetReview('"+f+"','rate');\">Đánh giá</a>"}for(var c=0;c<dtReview.Rows.length;c++){if(dtReview.Rows[c].rou==1){continue}if(dtReview.Rows[c].DateAdded!=null){var k=dtReview.Rows[c].DateAdded.split(" ");var j=k[1].split("/");if(j[0]==h&&j[1]==d&&j[2]==e){k[0]="Today"}if(j[0]==h-1&&j[1]==d&&j[2]==e){k[0]="Yesterday"}dtReview.Rows[c].DateAdded=k.join(" ");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Today","Hôm nay");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Yesterday","Hôm qua");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Monday","Thứ hai");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Tuesday","Thứ ba");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Wednesday","Thứ tư");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Thursday","Thứ năm");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Friday","Thứ sáu");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Saturday","Thứ bảy");dtReview.Rows[c].DateAdded=dtReview.Rows[c].DateAdded.replace("Sunday","Chủ nhật")}b+='				<div class="row">					<img class="avatar" src="'+RelativeDir+'images/mymap_icon/media_4.gif"/>					<span class="author">'+dtReview.Rows[c].UserName+'</span> - <span class="date">'+dtReview.Rows[c].DateAdded+"</span>					 - ";for(var n=1;n<=dtReview.Rows[c].Rating;n++){b+='<img src="'+RelativeDir+'images/start_yellow.gif"/>'}for(var n=dtReview.Rows[c].Rating+1;n<=5;n++){b+='<img src="'+RelativeDir+'images/start_gray.gif"/>'}b+="<p>"+dtReview.Rows[c].Content.replace(m,"<br/>")+"</p>						</div>"}b+="</div>"}SafeSetInnerHtml("reviewcontent",b)},EditReview:function(){if(dtReview.Rows[0].Checked){if(confirm("Nhận xét của bạn đã được duyệt, chỉnh sửa nội dung của nhận xét này sẽ dẫn tới việc bạn phải chờ để được kiểm duyệt nội dung lại, bạn đó đồng ý chỉnh sửa không ?")==false){return}}ContentLocation.ShowReviewForm();document.getElementById("rvTitle").value=dtReview.Rows[0].Title;document.getElementById("rvContent").value=dtReview.Rows[0].Content;Rating.setRate(dtReview.Rows[0].Rating)},ShowReviewForm:function(){var a=AJLocationSearch.BeginWriteAReview().value;if(a){document.getElementById("ReviewForm").style.display="";document.getElementById("wrLink").style.display="none"}else{window.location="Login.aspx"}},HideReviewForm:function(){document.getElementById("ReviewForm").style.display="none";document.getElementById("wrLink").style.display="";Rating.setUnRated()},SendReview:function(b){var d=document.getElementById("rvTitle").value;var a=Rating.RatePoint;var c=document.getElementById("rvContent").value;var f=document.getElementById("rverror");if(b==null||b==""){f.innerHTML="Xin lỗi, bạn không thể gửi nhận xét cho vị trí này";return}if(a==0||c==""){f.innerHTML="Vui lòng đánh giá và viết nhận xét của bạn trước khi gửi";return}if(c.length<30){f.innerHTML="Xin lỗi, nhận xét của bạn phải nhiều hơn 30 ký tự";return}var e=AJLocationSearch.SendReview(d,a,c,b).value;if(e){ContentLocation.GetReview(b)}else{f.innerHTML="Nhận xét của bạn không thể gửi được, hãy thử Refresh lại trang"}},DeleteReview:function(b){var a="Bạn thực sự muốn xóa nhận xét này ?";if(dtReview.Rows[0].Checked){a="Nhận xét của bạn đã được duyệt, Bạn có chắc muốn xóa nhận xét này ?"}if(confirm(a)==true){AJLocationSearch.DeleteReview(b);ContentLocation.GetReview(b)}},GetPhoto:function(b){if(b!=null&&b!=""){var a=AJLocationSearch.GetPhoto(b).value;if(a!=null){}}SafeSetInnerHtml("photocontent",Global.DataUpdating)},GetVideo:function(a){if(a!=null&&a!=""){var b=AJLocationSearch.GetVideo(a).value;if(b!=null){}}SafeSetInnerHtml("videocontent",Global.DataUpdating)},LoadMiniMap:function(e,b){var g=document.getElementById("InfoMap");if(g==null){return}var f=new GeneralMap.Map(g);f.addControl(new GeneralMap.SmallZoomControl());f.setCenter(new GeneralMap.LatLng(e,b),10);var c=new GeneralMap.Icon(RelativeDir+"images/mymap_icon/point_7.gif");c.iconSize=new GeneralMap.Size(32,32);var d=new GeneralMap.MarkerOptions(c);var a=new GeneralMap.Marker(new GeneralMap.LatLng(e,b),d);f.addOverlay(a)}};function ShowAJLoad(c){var c=document.getElementById(c);if(c!=null){var b=c.style.width;var a=c.style.height;c.className="ajLoading";c.style.width=b;c.style.height=a;c.innerHTML=""}}function HideAJLoad(b,a){if(document.getElementById(b)!=null){if(a!=null){document.getElementById(b).className=a}else{document.getElementById(b).className=""}}}Rating={RatePoint:0,setUnRated:function(){Rating.RatePoint=0;Rating.displayRated()},displayAsRate:function(b){for(var a=1;a<=b;a++){var c=document.getElementById("r"+a);c.className="starrated"}for(var a=b+1;a<=5;a++){var c=document.getElementById("r"+a);c.className="starunrated"}Rating.displayExplain(b)},setRate:function(a){Rating.displayAsRate(a);Rating.RatePoint=a},displayRated:function(){Rating.displayAsRate(Rating.RatePoint)},displayExplain:function(a){var b=document.getElementById("RateExplain");switch(a){case 0:b.innerHTML="(Chưa đánh giá)";break;case 1:b.innerHTML="(Chưa tốt)";break;case 2:b.innerHTML="(Bình thường)";break;case 3:b.innerHTML="(Tốt)";break;case 4:b.innerHTML="(Rất tốt)";break;case 5:b.innerHTML="(Tuyệt vời)";break}}};function PhoneBinding(g){document.getElementById("topLeftSearchResult").style.display="";isSearching=false;hideBusyDiv();dsResultData=g.value;ClearSearchMapResult();if(plHighlight!=null){map.removeOverlay(plHighlight);plHighlight=null}HideSelectPlaceBox();var c=new Array();c[c.length]='<table id=TablePlace width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto;">';if(dsResultData!=null&&typeof(dsResultData)=="object"){var j=dsResultData.Tables[1].Rows[0].HitSize;KeySearch=dsResultData.Tables[1].Rows[0].Key;var b=dsResultData.Tables[0].Rows.length;var e=parseInt((j+PAGE_ROWS-1)/PAGE_ROWS);var d=dsResultData.Tables[1].Rows[0].PageIdx;var h=e>PAGE_SHOW?PAGE_SHOW:e;var f=1;var a=10;e=(e>a)?a:e;var l=(d-1)*PAGE_ROWS+1;var k=(d-1)*PAGE_ROWS+dsResultData.Tables[0].Rows.length;if(j>0){c[c.length]=Global.GetFoundText("<b>"+KeySearch+"</b>","số điện thoại","phone number",l,k,j)}else{c[c.length]='<tr><td height=20px align=left valign=middle style="font-size:11px;">'+Global.GetNotFoundText("<b>"+KeySearch+"</b>","số điện thoại","phone number","")+"</td></tr>"}c[c.length]=BindResult(dsResultData.Tables[0]);c[c.length]="</table>";c[c.length]=Global.GetComplainLink(KeySearch);c[c.length]=Global.BuildPaging(d,e,j,h,Global.PagingFindPlace)}else{c[c.length]="</table>";c[c.length]=Global.GetNotFoundText("<b>"+KeySearch+"</b>","số điện thoại","phone number","");c[c.length]=Global.GetComplainLink(KeySearch)}ChangeFunctionType(GLOBAL_SEARCH_FUNCTION);document.getElementById("searchresult_div").innerHTML=c.join("");document.getElementById("searchresult_div").style.scrollTop=0;map.fitMultiOverlays(arrSearchMapResult)}function createSMarker(d,g,c,f){if(d==0){f++;var e=new GeneralMap.MarkerOptions(c,function(){return(resultActive==f)?3:2});var b=new GeneralMap.Marker(g,e);b.order=f;b.type=MARKER_POI;map.addOverlay(b);arrSearchMapResult.push(b);GeneralMap.Event.addListener(b,"mouseover",function(){var j=document.getElementById("resultItem_"+f);ResultEntryMouseOver(j);var h=j.parentNode.parentNode.rowIndex;if(h<=5){document.getElementById("searchresult_div").scrollTop=0}else{document.getElementById("searchresult_div").scrollTop=400}});GeneralMap.Event.addListener(b,"mouseout",function(){var h=document.getElementById("resultItem_"+f);ResultEntryMouseOut(h)})}else{var a=new GeneralMap.MarkerOptions(c,function(){return 1});var b=new GeneralMap.Marker(g,a);b.GUID=f;b.order=numMoreData+20+1;b.type=MARKER_MPOI;map.addOverlay(b);arrMorePlaceResult.push(b);numMoreData++;GeneralMap.Event.addListener(b,"click",function(){if(resultActive!=-1){var m=document.getElementById("resultItem_"+resultActive);
ResultEntryInActive(m)}var l=b.order;var p=b.GUID;var k=AJLocationSearch.GetInfo(p).value;if(k!=null&&typeof(k)=="object"&&k.Tables[0].Rows[0]!=null){var j=k.Tables[0].Rows[0];var n=k.Tables[0].Rows[0].Name;var o=CombineAddress(k.Tables[0].Rows[0]);var q=n;if(o!=n&&o!=""){q=n+", "+o}var h=new GeneralMap.InfoWindowOptions();h.offset=new GeneralMap.Size(0,-5);GeneralMap.Event.addListener(infoWindow,"maximizeclick",function(){infoWindow.updateMaxTitle("Loading...");infoWindow.updateMaxContent("Loading...")});GeneralMap.Event.addListener(infoWindow,"maximizeend",function(){ViewDetailInfo(j,l)});GeneralMap.Event.addListener(infoWindow,"restoreend",function(){AtachEventMiniPopup(j,l,q)});b.openInfoWindow(BuildMiniPopupWindow(j,l-1,q,false),h);AtachEventMiniPopup(j,l,q)}})}}function BindResult(d){var j="";for(var e=0;e<d.Rows.length;e++){if(d.Rows[e].DolGisId=="-1"){b=new GeneralMap.LatLng(d.Rows[e].Latitude,d.Rows[e].Longitude);h=new GeneralMap.Icon("./images/mymap_icon/point_6.gif");h.iconSize=new GeneralMap.Size(32,32);var g=new GeneralMap.MarkerOptions(h,function(){return 1});marker=new GeneralMap.Marker(b,g);marker.order=e+1;marker.type=MARKER_POI;map.addOverlay(marker);arrSearchMapResult.push(marker);if(centerObjectNearby!=null){d.Rows[e]=centerObjectNearby;centerObjectNearby=null}continue}CombineAddress(d.Rows[e]);if(d.Rows[e].Website!=null&&d.Rows[e].Website!=""&&d.Rows[e].Website.indexOf("http://")!=0){d.Rows[e].Website="http://"+d.Rows[e].Website}j+=BuildLocationItem(d.Rows[e],e+1);var b=new GeneralMap.LatLng(d.Rows[e].Latitude,d.Rows[e].Longitude);var a=".gif";if(d.Rows[e].Table=="ds_store"){a="red.gif"}var c=d.Rows[e].ShortComment;if(c!=null&&(nLanguage==1&&c=="Placement on map is approximate")||(nLanguage==0&&c=="Vị trí trên bản đồ chỉ là điểm gần đúng")){a="cir.png"}var f=d.Rows[e].Logo;var h;if(f==""||f==null){h=new GeneralMap.Icon("./images/"+(e+1)+a)}else{h=new GeneralMap.Icon(f)}h.iconSize=new GeneralMap.Size(26,29);createSMarker(0,b,h,e)}return j}function ToSafeHTML(a){if(a==null){return""}return a.replace(/'/g,"&#39").replace(/"/g,"&quot;")}function BuildLocationItem(l,v){var f=ToSafeHTML(l.Name);var t=GetShortText(RemoveHTMLTag(l.Comment),160);var x=ToSafeHTML(l.Address);if(f==""){f=l.Name=x;x=l.Address=""}var q=l.Picture;var p=l.Tel;var m=l.Logo;var r=l.Latitude;var e=l.Longitude;var u=l.StoreID;var j=l.Table;var k=l.VietbandoID;var d=l.Property;var B=l.GUID;var n=".gif";if(j=="ds_store"){n="red.gif"}var g=f;var h="";if(j!="ds_store"){switch(j){case"ips_hochiminh":h+='<img src="LocationInfo/HoChiMinh/'+B+'/1.jpg" onerror="this.parentNode.removeChild(this)" style="float:left;margin:3px;" width="50"/>';break;case"ips_hanoi":h+='<img src="LocationInfo/HaNoi/'+B+'/1.jpg" onerror="this.parentNode.removeChild(this)" style="float:left;margin:3px;" width="50"/>';break;default:}}else{if(q!=""&&q!=null){if(q.indexOf("../")==0){q=q.substring(q.indexOf("../"))}h+='<img src="'+q+'" onerror="this.parentNode.removeChild(this)" style="float:left;margin:3px;" width="50"/>'}}h+=x;if(p!=""&&p!=null){h+=" ("+p+")"}if(t!=""&&t!=null){if(t=="Placement on map is approximate"){t=l.ShortComment=(nLanguage==0)?"Vị trí trên bản đồ chỉ là điểm gần đúng":t;n="cir.png"}if(h!=""){h+="<br/>"+t}else{h+=t}}if(d!=""&&d!=null){h+="<br/>"+d}h+='<div class="Spacer"></div>';var w=f;if(x!=f&&x!=""){w=f+", "+x}var z=new Array();z[z.length]='<tr><td align="center" valign="middle">';z[z.length]="<table id=resultItem_"+v+' width="98%" border="0" align="left" cellpadding="0" cellspacing="0" onmouseover="ResultEntryMouseOver(this)" onmouseout="ResultEntryMouseOut(this)" style="border:1px #ffffff solid; border-bottom:1px #efefef solid; margin-left:2px; margin-right:2px;">';z[z.length]='<tr><td colspan="2" style="height:5px;"></td></tr>';z[z.length]="<tr>";z[z.length]='<td align="center" valign="middle" style="width:40px;">';z[z.length]='<img id="resultimage_'+v+'" src="images/'+v+n+'" alt="" /></td>';z[z.length]='<td align="left">';var y="View on map",c="From here",b="To here",A="Detail";if(nLanguage==0){c="Từ đây";b="Đến đây";y="Xem trên bản đồ";A="Chi tiết"}var a="";if(u!=null&&u!=-1&&u!=""&&k!=""){a="font-weight:bold"}z[z.length]='<a style="font-size:12px" onclick="ResultViewDetailCurrentLevel('+v+')">'+g+'</a>    <p style="margin:2px 0px 2px 0px">'+h+"</p>";if(document.getElementById("searchoptions")!=null){z[z.length]='<a class="flnk" onclick="ResultFromHere('+v+",'"+w+"')\">"+c+"</a>";z[z.length]=' <span style="color:#CCC">|</span> <a class="flnk" onclick="ResultToHere('+v+",'"+w+"')\">"+b+"</a>";z[z.length]=' <span style="color:#CCC">|</span> '}z[z.length]='<a class="flnk" onclick="ViewOnMap('+v+')">'+y+"</a>";if(document.getElementById("searchoptions")!=null){if(u!=null&&u!=-1&&u!=""&&k!=""){z[z.length]=' <span style="color:#CCC">|</span> <a class="flnk" target="_blank" style="'+a+'"  href="'+k+'">'+A+"</a>"}else{z[z.length]=' <span style="color:#CCC">|</span> <a class="flnk" style="'+a+'" onclick="ResultViewDetailInfo('+v+')">'+A+"</a>"}}z[z.length]="</td>";var o="./images/"+v+".gif";z[z.length]="</tr>";z[z.length]="<tr>";z[z.length]='<td colspan="2" style="height:5px;"></td>';z[z.length]="</tr>";z[z.length]="</table>";z[z.length]="</td></tr>";return z.join("")}var dsMoreData;var numMoreData=0;function MorePlaceBinding(h){dsMoreData=h.value;if(dsMoreData!=null&&typeof(dsMoreData)=="object"&&isBindingMorePlace){var l=RemoveHTMLTag(dsMoreData.Tables[1].Rows[0].Key);var f=dsMoreData.Tables[1].Rows[0].SearchType;if(l!=RemoveHTMLTag(KeySearch)||f!=TypeSearch){return}var k=dsMoreData.Tables[1].Rows[0].HitSize;var e=parseInt((k+PAGE_ROWS-1)/PAGE_ROWS);var c=dsMoreData.Tables[1].Rows[0].PageIdx;var j=e>PAGE_SHOW?PAGE_SHOW:e;if(c==1){numMoreData=0}var a=10;e=(e>a)?a:e;if(k>0){for(var b=0;b<dsMoreData.Tables[0].Rows.length&&b<11;b++){var d=dsMoreData.Tables[0].Rows[b].GUID;if(d==null||d==""){continue}var g=new GeneralMap.Icon("./images/cmark.gif");g.iconSize=new GeneralMap.Size(10,10);createSMarker(1,new GeneralMap.LatLng(dsMoreData.Tables[0].Rows[b].Latitude,dsMoreData.Tables[0].Rows[b].Longitude),g,d)}if(c+1<=e){setTimeout(function(){CallNextMore(l,c,dsMoreData.Tables[1].Rows[0],TypeSearch)},1000)}}}}function CallNextMore(t,l,o,h){switch(h){case 0:var q=o.What;var n=o.Where;var d,b,f,e;var a=map.getBounds();var d=a.getNorthWest().lng();var b=a.getNorthWest().lat();var f=a.getSouthEast().lng();var e=a.getSouthEast().lat();if(b>e){var r=b;b=e;e=r}AJLocationSearch.FindMorePlace(t,q,n,l+1,map.getLevel(),d,b,f,e,0,MorePlaceBinding);break;case 1:break;case 6:var q=o.What;var g=o.SelName;var k=o.SelAddress;var p=o.SelLng+"";var s=o.SelLat+"";var c=o.Radius;AJLocationSearch.FindMoreNearByPoint(t,q,g,k,p,s,c,l+1,MorePlaceBinding);break;case 7:var m=PathSectionID;var t=o.Key;var q=o.What;var n=o.Where;var j=o.Radius;AJLocationSearch.FindMoreNearByPolyline(ClientID,GetPolylineOrder(m),PlaceToFindPathArray[m].length,t,q,n,l+1,j,MorePlaceBinding);break}}function BuildMiniPopupWindow(l,x,s,b){var F=l.Name;var g=l.Address;var d=l.ShortComment;var e=l.Logo;var f=l.Website;var n=l.VietbandoID;var u=l.Picture;var k=l.Tel;var C=l.Table;var r=l.RootID;var w=l.StoreID;var m=l.URLFriendly;var E=l.GUID;var p=(C!="ds_store")?"ip":"ds";var c="From here",a="To here",q="Search nearby",D="Detail...",o="Search inside",B="Full view",j="Mark this location",z="Add content";if(nLanguage==0){c="Từ đây";a="Đến đây";D="Chi tiết...";q="Tìm xung quanh";o="Tìm bên trong";B="Xem dạng lớn";j="Đánh dấu điểm này";z="Thêm nội dung"}var A=new Array();A[A.length]='<div class="MiniPopup">';A[A.length]='<span class="Title">'+F+"</span>";A[A.length]='<br/><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" />';if(E!=""&&E!=null){if(arrListFavour!=null){var h=false;for(var y=0;y<arrListFavour.length;y++){if(arrListFavour[y][1]==E){h=true;break}}if(document.getElementById("searchoptions")!=null){if(h){A[A.length]=" - "+((nLanguage==0)?"Đã đánh dấu vị trí này":"Location marked")
}else{A[A.length]=' - <span id="divmarkloc"><a class="flnk" id="marklocation'+x+'">'+j+"</a></span>"}}}else{A[A.length]=' - <a class="flnk" id="marklocation'+x+'">'+j+"</a>"}}A[A.length]='<p class="Content">';var v="";if(C!="ds_store"){switch(C){case"ips_hochiminh":v="LocationInfo/HoChiMinh/"+E+"/1.jpg";break;case"ips_hanoi":v="LocationInfo/HaNoi/"+E+"/1.jpg";break;default:}}else{if(u!=""&&u!=null){if(u.indexOf("../")==0){u=u.substring(u.indexOf("../"))}v=u}}var t=new Image();t.onload=function(){setImageDelay("pi"+E,v)};t.onerror=function(){setImageDelay("pi"+E,"images/noImage.gif")};t.src=v;A[A.length]='<img id="pi'+E+'" class="Image"/>';if(g!=""&&g!=null){A[A.length]='<br/><img src="images/diachi.gif" width="20" height="20" align="absmiddle"/>'+g}if(k!=""&&k!=null){A[A.length]='<br/><img src="images/dienthoai.gif" width="20" height="20" align="absmiddle"/>'+k}if(n!=""&&n!=null){A[A.length]='<br/><img src="images/iconsearch.gif" width="20" height="20" align="absmiddle"/><a href="vbdmap.aspx?sk='+n+'">'+n+"</a>"}if(f!=""&&f!=null){A[A.length]='<br/><img src="images/website.gif" width="20" height="20" align="absmiddle"/><a style="color:#558800;text-decoration:underline;" target="_blank" href="'+f+'">'+f+"</a>"}A[A.length]="</p>";A[A.length]="<br/>";if(document.getElementById("searchoptions")!=null){if(E!=""&&E!=null&&p=="ip"){A[A.length]='<a class="flnk" id="createcontent'+x+'" onclick=\'window.open("DS_Manager/ManageStore.aspx?guid='+E+"&type="+p+"\")'>"+z+"</a> - "}if(w!=""&&w!=null&&p!="ip"&&n!=""){A[A.length]='<a class="flnk" target="_blank" href="'+n+'">'+D+"</a>"}else{A[A.length]='<a class="flnk" id="viewdetail'+x+'">'+D+"</a>"}}if(document.getElementById("searchoptions")!=null){A[A.length]='<div class="CommonFunction">';A[A.length]='<a class="flnk" id="fromhere'+x+'">'+c+"</a>";A[A.length]=' - <a class="flnk" id="tohere'+x+'">'+a+"</a>";A[A.length]=' - <a class="flnk" id="viewsearchnearby'+x+'">'+q+"</a>";A[A.length]="</div>"}A[A.length]="</div>";return A.join("")}function AtachEventMiniPopup(b,a,c){if(document.getElementById("searchoptions")==null){return}document.getElementById("fromhere"+(a-1)).onclick=function(){FromHere(b,c)};document.getElementById("tohere"+(a-1)).onclick=function(){ToHere(b,c)};if(document.getElementById("viewdetail"+(a-1))!=null){document.getElementById("viewdetail"+(a-1)).onclick=function(){infoWindow.maximize()}}document.getElementById("viewsearchnearby"+(a-1)).onclick=function(){ViewDetailCurrentLevelWithSearchNearBy(b,a)};$("#marklocation"+(a-1)).click(function(){document.getElementById("divmarkloc").innerHTML=((nLanguage==0)?"Đã đánh dấu vị trí này":"Location marked");AddMarkedLocation(b)})}function BuildStoreWindow(o){var n=dsResultData.Tables[0].Rows[o-1].StoreID;var k=dsResultData.Tables[0].Rows[o-1].RootID;var t=dsResultData.Tables[0].Rows[o-1].Name;var e=dsResultData.Tables[0].Rows[o-1].Address;var a=dsResultData.Tables[0].Rows[o-1].Comment;var c=dsResultData.Tables[0].Rows[o-1].Logo;var d=dsResultData.Tables[0].Rows[o-1].Website;var h=dsResultData.Tables[0].Rows[o-1].VietbandoID;var m=dsResultData.Tables[0].Rows[o-1].Picture;var f=dsResultData.Tables[0].Rows[o-1].Tel;var q=dsResultData.Tables[0].Rows[o-1].Table;var g=dsResultData.Tables[0].Rows[o-1].URLFriendly;var s="Detail",r="Review",j="Overview",l="Photo",b="Video";if(nLanguage==0){s="Chi tiết";r="Nhận xét";j="Tổng quan";l="Hình ảnh";b="Video"}var p=new Array();ContentLocation.SearchInsideStoreID=StoreTable.Rows[0].StoreID;var n=StoreTable.Rows[0].StoreID;CalculatePopupSize();p[p.length]='			        	<div id="popup_max"  class="popup_max">			        	<div id="Info_Map" style="text-align:left;height:150px;float:none">			        		<div id="diadiem" style="float:left; width:250px;">								<img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/spacer.gif" width="10" height="24" align="absmiddle" />								<br />';if(e!=""){p[p.length]='<img src="images/diachi.gif" width="20" height="20" align="absmiddle"/>'+e+"<br />"}if(f!=""){p[p.length]='<img src="images/dienthoai.gif" width="20" height="20" align="absmiddle"/>'+f+"<br />"}if(d!=""&&d!=null){p[p.length]='<img src="images/website.gif" width="20" height="20" align="absmiddle"/><a style="color:#558800;text-decoration:underline;" href="'+d+'">'+d+"</a><br/>"}if(h!=""&&h!=null){p[p.length]='<img src="images/iconsearch.gif" width="20" height="20" align="absmiddle"/><a href="vbdmap.aspx?sk='+h+'">'+h+"</a><br/>"}p[p.length]='<br />								<a style="color:#cc6600;cursor:pointer;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmfromhere'+o+'">Từ đây</a> <span style="color:#cc6600;">|</span> <a style="color:#cc6600;cursor:pointer;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmtohere'+o+'">Đến đây </a><br/> <span style="color:#cc6600;"> </span><a style="color:#cc6600;cursor:pointer;font-weight:bold;font-size:10;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmback'+o+'">« Quay lại</a><img src="images/spacer.gif" width="10" height="20" align="absmiddle" /></td>							</div>							<div id="InfoMap" style="left:70px; width:250px;margin-left:10px; margin-top:5px;height:130px; border:1px #999999 solid;position:relative;">							</div>			        	</div>						<div id="row3">		                <div id="tabs">		                    <a id="taboverview" onclick="ContentLocation.ActiveTab(\'overview\','+n+",'"+CurGuid+"')\"><span>"+j+'</span></a>		                    <a id="tabdetail" onclick="ContentLocation.ActiveTab(\'detail\','+n+",'"+CurGuid+"')\"><span>"+s+'</span></a>		                    <a id="tabreview" onclick="ContentLocation.ActiveTab(\'review\','+n+",'"+CurGuid+"')\"><span>"+r+'</span></a>		                    <a id="tabphoto" onclick="ContentLocation.ActiveTab(\'photo\','+n+",'"+CurGuid+"')\"><span>"+l+'</span></a>		                    <a id="tabvideo" onclick="ContentLocation.ActiveTab(\'video\','+n+",'"+CurGuid+"')\"><span>"+b+'</span></a>	                    </div>	                </div>	                <div class="pContent">						<div class="pcHide" id="overviewcontent"></div>						<div class="pc" id="detailcontent"></div>						<div class="pcHide" id="reviewcontent"></div>						<div class="pcHide" id="photocontent"></div>						<div class="pcHide" id="videocontent"></div>					</div>	            </div>';return p.join("")}function BuildLocationWindow(e,h){var b=RemoveHTMLTag(e.Name);var q=e.Address;var o=e.Comment;var j=e.Logo;var c=e.Website;var p=e.VietbandoID;var n=e.Picture;var l=e.Tel;var r=e.Table;if(q==null){q=""}if(o==null){o=""}if(l==null){l=""}var a="Detail",m="Review",k="Overview",d="Photo",f="Video";if(nLanguage==0){a="Chi tiết";m="Nhận xét";k="Tổng quan";d="Hình ảnh";f="Video"}var g=new Array();CalculatePopupSize();g[g.length]='			        	<div id="popup_max"  class="popup_max" style="width:'+(popupW-10)+"px;height:"+popupH+'px;">			        	<div id="Info_Map" style="text-align:left;height:150px;float:none">			        		<div id="diadiem" style="float:left; width:250px;">								<img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/spacer.gif" width="10" height="24" align="absmiddle" />								<br />';if(q!=""){g[g.length]='<img src="images/diachi.gif" width="20" height="20" align="absmiddle"/>'+q+"<br />"}if(l!=""){g[g.length]='<img src="images/dienthoai.gif" width="20" height="20" align="absmiddle"/>'+l+"<br />"}if(c!=""&&c!=null){g[g.length]='<img src="images/website.gif" width="20" height="20" align="absmiddle"/><a style="color:#558800;text-decoration:underline;" href="'+c+'">'+c+"</a><br/>"}if(p!=""&&p!=null){g[g.length]='<img src="images/iconsearch.gif" width="20" height="20" align="absmiddle"/><a href="vbdmap.aspx?sk='+p+'">'+p+"</a><br/>"
}g[g.length]='<br />								<a style="color:#cc6600;cursor:pointer;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmfromhere'+h+'">Từ đây</a> <span style="color:#cc6600;">|</span> <a style="color:#cc6600;cursor:pointer;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmtohere'+h+'">Đến đây </a><br/> <span style="color:#cc6600;"> </span><a style="color:#cc6600;cursor:pointer;font-weight:bold;font-size:10;" onmouseover="ChangeTextColor(this,\'#558800\')" onmouseout="ChangeTextColor(this,\'#cc6600\')" id="pmback'+h+'">« Quay lại</a><img src="images/spacer.gif" width="10" height="20" align="absmiddle" /></td>							</div>							<div id="InfoMap" style="float:right; width:250px;margin-left:10px; margin-top:5px;height:130px; border:1px #999999 solid;position:relative;">							</div>			        	</div>						<div id="row3">		                <div id="tabs">			                <a id="taboverview" onclick="ContentLocation.ActiveTab(\'overview\',-1,\''+CurGuid+"')\"><span>"+k+"</span></a>			                <a id=\"tabdetail\" onclick=\"ContentLocation.ActiveTab('detail',-1,'"+CurGuid+"')\"><span>"+a+"</span></a>			                <a id=\"tabreview\" onclick=\"ContentLocation.ActiveTab('review',-1,'"+CurGuid+"')\"><span>"+m+"</span></a>			                <a id=\"tabphoto\" onclick=\"ContentLocation.ActiveTab('photo',-1,'"+CurGuid+"')\"><span>"+d+"</span></a>			                <a id=\"tabvideo\" onclick=\"ContentLocation.ActiveTab('video',-1,'"+CurGuid+"')\"><span>"+f+'</span></a>		                </div>	                </div>	                <div class="pContent">						<div class="pcHide" id="overviewcontent"></div>						<div class="pc" id="detailcontent"></div>						<div class="pcHide" id="reviewcontent"></div>						<div class="pcHide" id="photocontent"></div>						<div class="pcHide" id="videocontent"></div>					</div>	            </div>';return g.join("")}function ResultViewDetailInfo(b){var d=dsResultData.Tables[0].Rows[b-1];var a=d.Name;var g=d.Address;var f=a;if(g!=a&&g!=""){f=a+", "+g}var c=BuildMiniPopupWindow(d,b-1,f,false);var e=new GeneralMap.InfoWindowOptions();e.autoPan=true;e.maxContent="Loading...";e.maxTitle="Loading...";e.offset=new GeneralMap.Size(0,-26);GeneralMap.Event.addListener(infoWindow,"maximizeclick",function(){infoWindow.updateMaxTitle("Loading...");infoWindow.updateMaxContent("Loading...")});GeneralMap.Event.addListener(infoWindow,"maximizeend",function(){ViewDetailInfo(d,b)});GeneralMap.Event.addListener(infoWindow,"restoreend",function(){AtachEventMiniPopup(d,b,f)});if(b>20){arrMorePlaceResult[b-20-1].openInfoWindow(c,e)}else{arrSearchMapResult[b-1].openInfoWindow(c,e);HightlightActiveItem(b)}setTimeout(function(){infoWindow.maximize();ViewDetailInfo(d,b);AddLogClick(d,2)},500)}function ViewDetailInfo(b,a){ViewLocationInfo(b,a)}function ViewLocationInfo(b,c){if(c==null){return}var k=b.Latitude;var l=b.Longitude;var a=b.Name;var m=b.Address;var j=b.Comment;var e=b.Logo;var h=b.Picture;var f=b.Tel;CurGuid=b.GUID;var n=a;if(m!=a&&m!=""){n=a+", "+m}var g='<div id="popup_title" class="popup_title" style="width:'+(popupW+10)+'px;">							<p id="PopupTitle">'+a.substr(0,pTitleLength)+((a.length>pTitleLength)?"...":"")+"</p>						</div>";var d='<div align="center" style="width:600px; overflow:hidden">';d+=BuildLocationWindow(b,c);d+="</div>";infoWindow.updateMaxTitle(g);infoWindow.updateMaxContent(d);if(c<=20){HightlightActiveItem(c)}setTimeout(function(){document.getElementById("pmfromhere"+c).onclick=function(){FromHere(b,n)};document.getElementById("pmtohere"+c).onclick=function(){ToHere(b,n)};document.getElementById("pmback"+c).onclick=function(){infoWindow.restore()};loadMapMoreInfo(k,l);ContentLocation.ActiveTab("review",-1,CurGuid)},1000)}var dsBlockHouse=null;var arrBlockHouseObj=new Array();function viewBlockHouse(){if(arrBlockHouseObj.length==0){AJLocationSearch.GetBlockHouse(viewBlockHouseCallback);document.getElementById("avoidblock").checked=true}else{for(var a=0;a<arrBlockHouseObj.length;a++){map.removeOverlay(arrBlockHouseObj[a])}arrBlockHouseObj=new Array();document.getElementById("avoidblock").checked=false}}function viewBlockHouseCallback(f){if(f.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}return}dsBlockHouse=f.value;if(dsBlockHouse!=null){var b=new Array();var d=new GeneralMap.Icon("images/construction.png",new GeneralMap.Size(18,18));var e=new GeneralMap.MarkerOptions(d,null,new GeneralMap.Size(9,9));for(var c=0;c<dsBlockHouse.Tables[0].Rows.length;c++){var a=new GeneralMap.Marker(dsBlockHouse.Tables[0].Rows[c].X+","+dsBlockHouse.Tables[0].Rows[c].Y,e);a.type=BLOCKHOUSEOBJ;a.bhIndex=c;map.addOverlay(a);arrBlockHouseObj[arrBlockHouseObj.length]=a}FitRoadConstruction()}}function FitRoadConstruction(){var g,c;var e,b;var a=map.getBounds();var h=a.getNorthWest();var j=a.getSouthEast();g=h.lng();c=h.lat();e=j.lng();b=j.lat();var k,l,d=false;for(var f=0;f<arrBlockHouseObj.length;f++){k=arrBlockHouseObj[f].getLatLng().lat();l=arrBlockHouseObj[f].getLatLng().lng();if(l<e&&l>g&&k>b&&k<c){d=true;break}}if(!d){map.fitOverlays()}}function showBlockHouseInfoWindow(t){var e=(nLanguage==0)?"Thông tin rào chắn":"Road construction information";var n=(nLanguage==0)?"Số hiệu rào chắn":"Road construction ID";var r=(nLanguage==0)?"Tên dự án":"Project name";var s=(nLanguage==0)?"Gói thầu":"Contract";var f=(nLanguage==0)?"Tuyến đường":"Street";var m=(nLanguage==0)?"Giấy phép":"License number";var d=(nLanguage==0)?"Ngày cấp":"License date";var j=(nLanguage==0)?"Kích thước":"Size";var o=(nLanguage==0)?"Ngày bắt đầu":"Start date";var b=(nLanguage==0)?"Ngày kết thúc":"End date";var k=(nLanguage==0)?"Gia hạn":"Extension";var c=(nLanguage==0)?"Tổ chức giao thông":"Forbidden traffic";var g=(nLanguage==0)?"Vướng Mắc":"Forbidden direction";var l=(nLanguage==0)?"Kiến nghị":"Forbidden range";var h=(nLanguage==0)?"Mô tả":"Description";var p=new Array();var a=dsBlockHouse.Tables[0].Rows[t];p[p.length]='<div id="apForm" class="jForm" style="width:360px">                         <fieldset>						 <legend style="color: #0066cc;"><b>'+e+"</b></legend>";if(a.MA_RAOCHAN!=""){p[p.length]='<div>							    <label style="width:110px">'+n+':</label>							    <label style="width:215px">'+a.MA_RAOCHAN+"</label>						    </div>"}if(a.TENDUAN!=""){p[p.length]='<div>							    <label style="width:110px">'+r+':</label>							    <label style="width:215px">'+a.TENDUAN+"</label>						    </div>"}if(a.TENCONGTRINH!=""){p[p.length]='<div>							    <label style="width:110px">'+s+':</label>							    <label style="width:215px">'+a.TENCONGTRINH+"</label>						    </div>"}if(a.DUONG!=""&&a.QUAN!=""){p[p.length]='<div>							    <label style="width:110px">'+f+':</label>							    <label style="width:215px">'+(a.DUONG+", "+a.QUAN)+"</label>						    </div>"}if(a.GIAYPHEP!=""){p[p.length]='<div>							    <label style="width:110px">'+m+':</label>							    <label style="width:215px">'+a.GIAYPHEP+"</label>						    </div>"}if(a.NGAYCAP!=""){var q=new Date(a.NGAYCAP);p[p.length]='<div>							    <label style="width:110px">'+d+':</label>							    <label style="width:215px">'+(q!="Invalid Date"?getDateString(q):a.NGAYCAP)+"</label>						    </div>"}if(a.CHIEUDAI!=0&&a.CHIEURONG!=0){p[p.length]='<div>							    <label style="width:110px">'+j+':</label>							    <label style="width:215px">'+a.CHIEUDAI+"x"+a.CHIEURONG+"</label>						    </div>"}if(a.MOTAVITRI!=""){p[p.length]='<div>							    <label style="width:110px">'+h+':</label>							    <label style="width:215px">'+a.MOTAVITRI+"</label>						    </div>"}if(a.THOIGIANTHICONG!=""){var q=new Date(a.THOIGIANTHICONG);p[p.length]='<div>							    <label style="width:110px">'+o+':</label>							    <label style="width:215px">'+(q!="Invalid Date"?getDateString(q):a.THOIGIANTHICONG)+"</label>						    </div>"
}if(a.THOIGIANHOANTHANH!=""){var q=new Date(a.THOIGIANHOANTHANH);p[p.length]='<div>							    <label style="width:110px">'+b+':</label>							    <label style="width:215px">'+(q!="Invalid Date"?getDateString(q):a.THOIGIANHOANTHANH)+"</label>						    </div>"}if(a.TOCHUCGIAOTHONG!=""){p[p.length]='<div>							    <label style="width:110px">'+c+':</label>							    <label style="width:215px">'+a.TOCHUCGIAOTHONG+"</label>						    </div>"}if(a.VUONGMAC!=""){p[p.length]='<div>							    <label style="width:110px">'+g+':</label>							    <label style="width:215px">'+a.VUONGMAC+"</label>						    </div>"}if(a.KIENNGHI!=""){p[p.length]='<div>							    <label style="width:110px">'+l+':</label>							    <label style="width:215px">'+a.KIENNGHI+"</label>						    </div>"}p[p.length]='<div>						    <label style="width:325px; height:10px;"></label>					    </div>';p[p.length]="</fieldset>				        </div>";arrBlockHouseObj[t].openInfoWindow(p.join(""))}function getDateString(a){return(getFullDate(a.getDate())+"/"+getFullDate(a.getMonth()+1)+"/"+a.getFullYear())}function getFullDate(a){a=a<10?"0"+a:a;return a}function ClickStatisticsInsert(b,a){AJLocationSearch.ClickStatistics(b,a)}var VIEW_SAT=false;function ContextMenu(g,d,c){this.latlng=g;this.arrContent=d;this.arrHandler=c;this.initialize=b;this.remove=a;this.copy=f;this.redraw=e;function b(n){var h=document.createElement("div");this.id=n.id+"_ContextMenu";h.id=n.id+"_ContextMenu";h.style.border="1px #558800 solid";h.style.position="absolute";h.style.width="150px";h.style.backgroundColor="white";var k="";var o=0;for(var l=this.arrContent.length-1;l>=0;l--){if(this.arrContent[l]=="-"){k+="<tr>";k+="<td align='left' valign='middle' style='height:5px; background-image:url(images/bgpopup.gif);'></td>";k+="</tr>";o+=5}else{k+="<tr>";k+="<td id='"+this.id+"_"+l+"' index='"+l+"' align='left' valign='middle' style='height:20px;cursor:pointer;'>&nbsp;"+this.arrContent[l]+"</td>";k+="</tr>";o+=20}}k="<table width='130' border='0' align='center' cellpadding='0' cellspacing='0' style='width:140px; height:"+o+"px; margin-top:5px;'>"+k;k+="</table>";this.width=150;this.height=o+10;h.style.height=this.height+"px";h.innerHTML=k;n.getContainer().appendChild(h);if(this.arrHandler!=undefined){for(var l=this.arrContent.length-1;l>=0;l--){if(this.arrContent[l]!="-"){var j=document.getElementById(this.id+"_"+l);j.onmouseover=function(){this.style.backgroundColor="#e8fdcb";this.style.color="#000000"};j.onmouseout=function(){this.style.backgroundColor="#FFFFFF";this.style.color="#333333"};var m=this;if(this.arrHandler[l]!=undefined){j.onclick=function(){var p=(browserName=="msie")?this.index:this.getAttribute("index");m.arrHandler[p](m.latlng)}}}}}this.mapObj=n;this.divObj=h;this.redraw();return h}function a(){this.divObj.parentNode.removeChild(this.divObj)}function f(){return new ContextMenu(this.latlng)}function e(){var l=this.mapObj.fromLatLngToContainerPixel(this.latlng);var h=this.mapObj.getContainer();var j=l.x;var k=l.y;if(j+this.width>=parseInt(h.style.width)){j-=this.width}if(k+this.height>=parseInt(h.style.height)){k-=this.height}this.divObj.style.left=j+"px";this.divObj.style.top=k+"px"}}function MapToolbar(a){this.regionName=a;this.initialize=d;this.remove=e;this.copy=b;this.hide=f;this.show=h;this.isHidden=c;this.redraw=j;this.vType=g;function d(l){var m=document.createElement("div");this.id=l.id+"_MapToolbar";m.id=l.id+"_MapToolbar";m.className="MapToolbar";m.style.position="absolute";m.style.textAlign="right";m.style.width="180px";m.style.height="24px";if(VIEW_SAT){m.innerHTML='<ul class="MapToolBar">            <li><div id="ctrlMapType" style="border: 1px solid black; overflow: hidden; position: absolute; background-color:#1F6CB1; text-align: center; width: 75px; cursor: pointer; right: 0px; white-space: nowrap;">            <div style="border-style: solid; border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white; border-width: 1px; font-size:11px;font-family:Verdana; color:white;">            <div id="ctrlMapTypeText" style="-moz-user-select: none; text-align: left; padding-left: 6px; font-weight: bold;">Bản đồ</div>            <div style="position: absolute; top: 7px; right: 5px; vertical-align: middle;"><img src="images/down-arrow.gif"/></div></div></div>            <div id="ctrlMapTypeItemMap" style="display:none; -moz-user-select: none; border-left: 1px solid black; border-right: 1px solid black; position: absolute; background-color:#1F6CB1; text-align: center; width: 75px; cursor: pointer; right: 0px; top: 24px; height: 20px;"><div style="font-size:11px;font-family:Verdana; color:white; text-align: left; padding-left: 6px;">Bản đồ</div></div>            <div id="ctrlMapTypeItemSat" style="display:none; -moz-user-select: none; border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black;position: absolute; background-color:#1F6CB1; text-align: center; width: 75px; cursor: pointer; right: 0px; top: 44px; height: 20px;"><div style="font-size:11px;font-family:Verdana; color:white; text-align: left; padding-left: 6px;">Vệ tinh</div></div></li>            <li><div id="ctrlMore" style="border:1px solid black; overflow:hidden; position:absolute; background-color:#1F6CB1; text-align:center; width:100px; cursor:pointer; right:80px; white-space: nowrap;">            <div style="border-style: solid; border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white; border-width: 1px; font-size:11px;font-family:Verdana; color:white;">            <div id="ctrlMoreText" style="-moz-user-select: none; text-align: left; padding-left: 6px;">Xem thêm...</div>            <div style="position: absolute; top: 7px; right: 5px; vertical-align: middle;"><img src="images/down-arrow.gif"/></div></div></div>            <div id="ctrlMoreItemRoadCons" style="display:none; -moz-user-select: none; border-left: 1px solid black; border-right: 1px solid black; position: absolute; background-color:#1F6CB1; text-align: left; width: 100px; cursor: pointer; right: 80px; top: 24px; height: 20px;"><input id="chkViewRoadCons" type="checkbox"/><img src="images/roadcons.gif"/></div>            <div id="ctrlMoreItemGeo" style="display:none; -moz-user-select: none; border-left: 1px solid black; border-right: 1px solid black; border-bottom: 1px solid black;position: absolute; background-color:#1F6CB1; text-align: left; width: 100px; cursor: pointer; right: 80px; top: 44px; height: 20px;"><input id="chkViewGeo" type="checkbox"/><img src="images/geo.gif"/></div></li>            </ul>'}else{m.innerHTML='<ul class="MapToolBar">            <li><a id="ViewGeo" class="ViewGeoDisable"></a></li>            <li><a id="ViewBlockHouse" class="ViewBlockHouseDis"></a></li>            </ul>'}l.getContainer().appendChild(m);m.style.width=m.offsetWidth+"px";this.mapObj=l;this.divObj=m;this.redraw();if(VIEW_SAT){var s=document.getElementById("ctrlMapType");var x=document.getElementById("ctrlMapTypeText");var p=document.getElementById("ctrlMapTypeItemMap");var r=document.getElementById("ctrlMapTypeItemSat");s.onclick=function(){if(p.style.display=="none"){$("#ctrlMapTypeItemMap").fadeIn("normal");$("#ctrlMapTypeItemSat").fadeIn("normal")}else{$("#ctrlMapTypeItemMap").fadeOut("normal");$("#ctrlMapTypeItemSat").fadeOut("normal")}};var y=function(){this.style.backgroundColor="#628E1F"};var z=function(){this.style.backgroundColor="#1F6CB1"};p.onmouseover=y;p.onmouseout=z;r.onmouseover=y;r.onmouseout=z;p.onclick=function(){$("#ctrlMapTypeItemMap").fadeOut("normal");$("#ctrlMapTypeItemSat").fadeOut("normal");changeMapType(0)};r.onclick=function(){$("#ctrlMapTypeItemMap").fadeOut("normal");$("#ctrlMapTypeItemSat").fadeOut("normal");changeMapType(1)};if(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap){x.innerHTML="Bản đồ"}else{x.innerHTML="Vệ tinh"}var v=document.getElementById("ctrlMore");var w=document.getElementById("ctrlMoreText");var n=document.getElementById("ctrlMoreItemGeo");var u=document.getElementById("ctrlMoreItemRoadCons");var q=document.getElementById("chkViewRoadCons");
var k=document.getElementById("chkViewGeo");v.onclick=function(){if(n.style.display=="none"){$("#ctrlMoreItemGeo").fadeIn("normal");$("#ctrlMoreItemRoadCons").fadeIn("normal")}else{$("#ctrlMoreItemGeo").fadeOut("normal");$("#ctrlMoreItemRoadCons").fadeOut("normal")}};q.onclick=function(){q.checked=!q.checked};k.onclick=function(){k.checked=!k.checked};u.onclick=function(){q.checked=!q.checked;$("#ctrlMoreItemGeo").fadeOut("normal");$("#ctrlMoreItemRoadCons").fadeOut("normal");viewBlockHouse()};n.onclick=function(){k.checked=!k.checked;$("#ctrlMoreItemGeo").fadeOut("normal");$("#ctrlMoreItemRoadCons").fadeOut("normal");TreeBinding.ViewGeoChange()}}else{var o=document.getElementById("ViewGeo");var t=document.getElementById("ViewBlockHouse");o.onclick=function(){if(this.className=="ViewGeoDisable"){this.className="ViewGeoEnable"}else{this.className="ViewGeoDisable"}TreeBinding.ViewGeoChange()};t.onclick=function(){if(this.className=="ViewBlockHouseDis"){this.className="ViewBlockHouseEna"}else{this.className="ViewBlockHouseDis"}viewBlockHouse()}}return m}function e(){this.divObj.parentNode.removeChild(this.divObj)}function b(){return new MapToolbar(this.regionName)}function f(){this.divObj.style.zIndex=-1}function h(){this.divObj.style.zIndex=101}function c(){return(this.divObj.style.display=="")?false:true}function j(){var k=this.mapObj.getContainer();this.divObj.style.left=parseInt(k.style.width)-parseInt(this.divObj.offsetWidth)-5+"px";this.divObj.style.top="5px"}function g(){return"MapToolbar"}}var ControlEvent={OnChangeSearchOption:function(a){if(nLanguage==0){document.getElementById("StatusDiv").innerHTML=Global.NormalSearchStatus}else{document.getElementById("StatusDiv").innerHTML=Global.NormalSearchStatusE}}};var arrFavourite=new Array();function loadFavourite(){var a=getCookie("VBDFavourite");if(a!=null){arrFavourite=a.split("!")}}function addFavourite(b,a){arrFavourite[arrFavourite.length]=b+"@"+a}function saveFavourite(){setCookie("VBDFavourite",arrFavourite.join("!"),true,"","","")}var FindPathArray=new Array();var PlaceStatusArray=new Array();var PlaceToFindPathArray=new Array();var PathPolylineArray=new Array();var arrArrows=new Array();var PlaceArray=new Array(0,0);var currentIndex=-1;var currentSub=-1;var currentFindtype=0;var isFinding=false;var isChanging=false;var isSearching=false;var isFPObjDragging=false;var selectedPoly=null;var currentStep=null;var toFirstFlag=false;var changeContentFlag=false;var PathSectionID=0;function AddPlace(){var c=PlaceArray.length;if(c>25){return}var g=document.getElementById("findpath_div");var e="";e+='<table width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto; ">';if(nLanguage==0){e+="<tr><td align=right height=30 width=9%><img src=images/place_"+c+'.gif></td><td align=left width=80%><input style="border: 1px solid rgb(153, 153, 153); background: rgb(255, 255, 255) url(images/helptimduong.gif) no-repeat scroll left center; width: 270px; margin-left: 5px; height: 17px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size:9pt;" value=\'\' onkeydown="return SearchPlaceEnter(event,this)" onchange="ChangeContent(this)" onfocus="OnforcusTextBoxAB(this)" onblur="OnblurTextBoxAB(this)" type="text"></td><td align=left width=11%><img style="cursor: pointer; margin-left: 2px;" src=images/delete.gif onclick="ClickRemovePlaceButton(this)" title="Xóa vị trí này"></td>'}else{e+="<tr><td align=right height=30 width=9%><img src=images/place_"+c+'.gif></td><td align=left width=80%><input style="border: 1px solid rgb(153, 153, 153); background: rgb(255, 255, 255) url(images/helptimduongE.gif) no-repeat scroll left center; width: 270px; margin-left: 5px; height: 17px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size:9pt;" value=\'\' onkeydown="return SearchPlaceEnter(event,this)" onchange="ChangeContent(this)" onfocus="OnforcusTextBoxAB(this)" onblur="OnblurTextBoxAB(this)" type="text"></td><td align=left width=11%><img style="cursor: pointer; margin-left: 2px;" src=images/delete.gif onclick="ClickRemovePlaceButton(this)" title="Delete this position"></td>'}e+="</tr>";e+="</table>";var d=document.getElementById("directionoptions");var f=GeneralMap.Util.CreateDivElement("direction"+c,"","","","","","",e);g.insertBefore(f,d);var a=GeneralMap.Util.CreateDivElement("guide"+c,"","","","","","","");g.insertBefore(a,d);var b=GeneralMap.Util.CreateDivElement("buffer"+c,"","","100%","5px","","","");g.insertBefore(b,d);PlaceArray.push(0)}function AddPlaceToFind(b,j){var f=PlaceToFindPathArray.length;var a=false;if(toFirstFlag==true){toFirstFlag=false;a=true;f--}if(PlaceToFindPathArray.length==0){f++;toFirstFlag=true}if(f>25||isFinding==true){return}ChangeFunctionType(GLOBAL_FINDPATH_FUNCTION);if(j==undefined){j=b.toUrlValue()}var c=document.getElementById("findpath_div").childNodes[0];var h=document.getElementById("direction"+f);var g=new GeneralMap.Icon("images/place_map_"+f+".gif");g.iconSize=new GeneralMap.Size(26,29);var d=new GeneralMap.Marker(b,g);map.addOverlay(d);d.enableDragging();d.sid=f+",0";d.type=FPMARKEROBJ;GeneralMap.Event.addListener(d,"dragend",function(){isFPObjDragging=false;var k=d.sid.toString().split(",");var l=parseInt(k[0]);if(arrFinish[l]!=null){if(arrFinish.length==1){arrFinish[l].hide();arrFinish.pop();firstStart=true}else{arrFinish[l].hide()}}UpdateShortestPath(d.sid)});GeneralMap.Event.addListener(d,"dragging",function(){isFPObjDragging=true;if(mkD!=null){map.removeOverlay(mkD);mkD=null}ChangeShortestPath(d.sid)});changeContentFlag=true;h.childNodes[0].rows[0].cells[1].childNodes[0].value=j;OnforcusTextBoxAB(h.childNodes[0].rows[0].cells[1].childNodes[0]);FindPathArray.push(1);PlaceStatusArray.push(1);var e=new Array();e.push(d);PlaceToFindPathArray.push(e);if(a==true){PlaceToFindPathArray[1]=PlaceToFindPathArray[0];PlaceToFindPathArray[0]=e}e=new Array();e.push(0);PathPolylineArray.push(e);e=new Array();e.push(0);arrArrows.push(e);PlaceArray[f]=1;PlaceStatusArray[f]=1;if(PlaceToFindPathArray.length>1){AddPlace()}FindShortestPath(f+","+0,0,1)}function AddPlaceFromFind(c,p){var l=0;if(l>25||isFinding==true){return}ChangeFunctionType(GLOBAL_FINDPATH_FUNCTION);if(p==undefined){p=c.toUrlValue()}var d=document.getElementById("findpath_div");var n=new GeneralMap.Icon("images/place_map_0.gif");n.iconSize=new GeneralMap.Size(26,29);var h=new GeneralMap.Marker(c,n);map.addOverlay(h);h.enableDragging();h.sid="0,0";h.type=FPMARKEROBJ;GeneralMap.Event.addListener(h,"dragend",function(){isFPObjDragging=false;var j=h.sid.toString().split(",");var q=parseInt(j[0]);window.status=arrFinish.length+":"+q;if(arrFinish[q]!=null){arrFinish[q].hide()}UpdateShortestPath(h.sid)});GeneralMap.Event.addListener(h,"dragging",function(){isFPObjDragging=true;if(mkD!=null){map.removeOverlay(mkD);mkD=null}ChangeShortestPath(h.sid)});if(toFirstFlag==true){toFirstFlag=false;var o=document.getElementById("direction"+0);o.childNodes[0].rows[0].cells[1].childNodes[0].value=p;OnforcusTextBoxAB(o.childNodes[0].rows[0].cells[1].childNodes[0]);FindPathArray.push(0);PlaceStatusArray.push(1);PlaceArray[0]=1;var k=new Array();k.push(h);PlaceToFindPathArray.push(k);k=new Array();k.push(0);PathPolylineArray.push(k);k=new Array();k.push(0);arrArrows.push(k);FindPathArray.reverse();PlaceStatusArray.reverse();PlaceToFindPathArray.reverse();PlaceStatusArray[0]=1;AddPlace();FindShortestPath("0,0",0,1);return}if(PlaceArray[0]==0){var o=document.getElementById("direction0");o.childNodes[0].rows[0].cells[1].childNodes[0].value=p;OnforcusTextBoxAB(o.childNodes[0].rows[0].cells[1].childNodes[0]);FindPathArray.push(0);PlaceStatusArray.push(0);PlaceArray[0]=1;var k=new Array();k.push(h);PlaceToFindPathArray.push(k);k=new Array();k.push(0);PathPolylineArray.push(k);k=new Array();k.push(0);arrArrows.push(k);PlaceStatusArray[0]=1;return}for(var g=PlaceArray.length-1;g>=0;g--){var o=document.getElementById("direction"+g);
var b=document.getElementById("guide"+g);var f=document.getElementById("buffer"+g);o.childNodes[0].rows[0].cells[0].innerHTML="<img src=images/place_"+(g+1)+".gif />";o.id="direction"+(g+1);b.id="guide"+(g+1);f.id="buffer"+(g+1);var a=new GeneralMap.Icon("images/place_map_"+(g+1)+".gif");if(g<PlaceToFindPathArray.length){for(var e=0;e<PlaceToFindPathArray[g].length;e++){PlaceToFindPathArray[g][e].sid=g+1+","+e}for(var e=0;e<PathPolylineArray[g].length;e++){PathPolylineArray[g][e].sid=(g+1)+","+e}PlaceToFindPathArray[g][0].setIcon(a)}}FindPathArray.push(0);PlaceStatusArray.push(1);PlaceArray.push(0);PlaceToFindPathArray.push(h);PathPolylineArray.push(new Array());arrArrows.push(new Array());for(var g=PlaceArray.length-1;g>0;g--){if(g<PlaceToFindPathArray.length){FindPathArray[g]=FindPathArray[g-1];PlaceStatusArray[g]=PlaceStatusArray[g-1];PlaceToFindPathArray[g]=PlaceToFindPathArray[g-1];PathPolylineArray[g]=PathPolylineArray[g-1];arrArrows[g]=arrArrows[g-1]}PlaceArray[g]=PlaceArray[g-1]}FindPathArray[0]=0;PlaceStatusArray[0]=1;var k=new Array();k.push(h);PlaceToFindPathArray[0]=k;PlaceStatusArray[0]=1;k=new Array();k.push(0);PathPolylineArray[0]=k;k=new Array();k.push(0);arrArrows[0]=k;PlaceArray[0]=1;var m="";m+='<table width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto; ">';l=0;if(nLanguage==0){m+="<tr><td align=right height=30 width=9%><img src=images/place_"+l+'.gif></td><td align=left width=80%><input style="border: 1px solid rgb(153, 153, 153); background: rgb(255, 255, 255)  no-repeat scroll left center; width: 270px; margin-left: 5px; height: 17px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size:9pt;" onkeydown="return SearchPlaceEnter(event,this)" onchange="ChangeContent(this)" onfocus="OnforcusTextBoxAB(this)" onblur="OnblurTextBoxAB(this)" type="text" value=\''+p+'\'></td><td align=left width=11%><img style="cursor: pointer; margin-left: 2px;" src=images/delete.gif onclick="ClickRemovePlaceButton(this)" title="Xóa vị trí này"></td>'}else{m+="<tr><td align=right height=30 width=9%><img src=images/place_"+l+'.gif></td><td align=left width=80%><input style="border: 1px solid rgb(153, 153, 153); background: rgb(255, 255, 255)  no-repeat scroll left center; width: 270px; margin-left: 5px; height: 17px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size:9pt;" onkeydown="return SearchPlaceEnter(event,this)" onchange="ChangeContent(this)" onfocus="OnforcusTextBoxAB(this)" onblur="OnblurTextBoxAB(this)" type="text" value=\''+p+'\'></td><td align=left width=11%><img style="cursor: pointer; margin-left: 2px;" src=images/delete.gif onclick="ClickRemovePlaceButton(this)" title="Delete this position"></td>'}m+="</tr>";m+="</table>";var o=GeneralMap.Util.CreateDivElement("direction0","","","","","","",m);d.insertBefore(o,document.getElementById("direction1"));var b=GeneralMap.Util.CreateDivElement("guide0","","","","","","","");d.insertBefore(b,document.getElementById("direction1"));var f=GeneralMap.Util.CreateDivElement("buffer0","","","100%","5px","","","");d.insertBefore(f,document.getElementById("direction1"));FindShortestPath("0,0",0,1)}function ClickRemovePlaceButton(d){var h=document.getElementById("findpath_div");var f=d.parentNode.parentNode.parentNode.parentNode.parentNode.id;var b=parseInt(f.substring(9,f.length));var a=b+",0";var c=a.split(",");var g=parseInt(c[0]);var e=parseInt(c[1]);RemovePlace(b+",0");if(toFirstFlag==true){return}}function RemovePlace(d,a){ping_connection();if(mkP!=null){map.removeOverlay(mkP);mkP=null}map.closeInfoWindow();var h=document.getElementById("findpath_div");var g=d.split(",");var n=parseInt(g[0]);var b=parseInt(g[1]);if(toFirstFlag==true&&n==1){toFirstFlag=false;map.removeOverlay(PlaceToFindPathArray[0][0]);FindPathArray=new Array();PlaceStatusArray=new Array();PlaceToFindPathArray=new Array();PathPolylineArray=new Array();arrArrows=new Array();PlaceArray=new Array(0,0);var o=document.getElementById("direction1");o.childNodes[0].rows[0].cells[1].childNodes[0].value="";OnblurTextBoxAB(o.childNodes[0].rows[0].cells[1].childNodes[0]);return}if(PlaceArray[n]==0){return}if(b>0){map.removeOverlay(PathPolylineArray[n][b]);map.removeOverlay(arrArrows[n][b]);map.removeOverlay(PlaceToFindPathArray[n][b]);for(var m=b;m<PlaceToFindPathArray[n].length-1;m++){PathPolylineArray[n][m]=PathPolylineArray[n][m+1];arrArrows[n][m]=arrArrows[n][m+1];PathPolylineArray[n][m].sid=n+","+m;PlaceToFindPathArray[n][m]=PlaceToFindPathArray[n][m+1];PlaceToFindPathArray[n][m].sid=n+","+m}PathPolylineArray[n].pop();arrArrows[n].pop();PlaceToFindPathArray[n].pop();AJLocationSearch.RemoveDirectionPlaces(ClientID,GetPolylineOrder(n)+b,1);FindShortestPath(n+",0",1,0,1);return}if(a!=1){if(n==0&&PlaceToFindPathArray.length>1){AJLocationSearch.RemoveDirectionPlaces(ClientID,0,GetPolylineOrder(n+1))}else{if(n==PlaceToFindPathArray.length-1&&n>0){AJLocationSearch.RemoveDirectionPlaces(ClientID,GetPolylineOrder(n-1),GetPolylineOrder(n)-GetPolylineOrder(n-1))}else{AJLocationSearch.RemoveDirectionPlaces(ClientID,GetPolylineOrder(n-1),GetPolylineOrder(n+1)-GetPolylineOrder(n-1)-1)}}}if(n>0){for(var m=PlaceToFindPathArray[n-1].length-1;m>=0;m--){map.removeOverlay(PathPolylineArray[n-1][m]);PathPolylineArray[n-1].pop();map.removeOverlay(arrArrows[n-1][m]);arrArrows[n-1].pop();if(m>0){map.removeOverlay(PlaceToFindPathArray[n-1][m]);PlaceToFindPathArray[n-1].pop()}}}if(n<PlaceToFindPathArray.length-1){for(var m=PlaceToFindPathArray[n].length-1;m>=0;m--){map.removeOverlay(PathPolylineArray[n][m]);PathPolylineArray[n].pop();map.removeOverlay(arrArrows[n][m]);arrArrows[n].pop();map.removeOverlay(PlaceToFindPathArray[n][m]);PlaceToFindPathArray[n].pop()}}else{if(n==PlaceToFindPathArray.length-1){map.removeOverlay(PlaceToFindPathArray[n][0]);PlaceToFindPathArray[n].pop()}}if(PlaceArray.length==2){prev_selectedResAB_Text="";PlaceArray[n]=0;var o=document.getElementById("direction0");o.childNodes[0].rows[0].cells[1].childNodes[0].value="";OnblurTextBoxAB(o.childNodes[0].rows[0].cells[1].childNodes[0])}else{var c=n;if(n==PlaceToFindPathArray.length-1){c=n-1}var o=document.getElementById("direction"+n);var f=document.getElementById("guide"+n);var l=document.getElementById("buffer"+n);h.removeChild(o);h.removeChild(f);h.removeChild(l);o=document.getElementById("direction"+n);f=document.getElementById("guide"+c);if(f!=null){f.innerHTML=""}l=document.getElementById("buffer"+n)}for(var m=n;m<PlaceArray.length;m++){var o=document.getElementById("direction"+m);var f=document.getElementById("guide"+m);var l=document.getElementById("buffer"+m);if(m>=n&&PlaceArray.length>2&&o!=null){o.childNodes[0].rows[0].cells[0].innerHTML="<img src=images/place_"+(m-1)+".gif />";o.id="direction"+(m-1);f.id="guide"+(m-1);l.id="buffer"+(m-1)}if(m<PlaceToFindPathArray.length){FindPathArray[m]=FindPathArray[m+1];PlaceStatusArray[m]=PlaceStatusArray[m+1];var e=new GeneralMap.Icon("images/place_map_"+(m-1)+".gif");if(m!=n){PlaceToFindPathArray[m][0].setIcon(e)}for(var k=0;k<PlaceToFindPathArray[m].length;k++){PlaceToFindPathArray[m][k].sid=(m-1)+","+k}for(var k=0;k<PathPolylineArray[m].length;k++){PathPolylineArray[m][k].sid=(m-1)+","+k}PlaceToFindPathArray[m]=PlaceToFindPathArray[m+1];PathPolylineArray[m]=PathPolylineArray[m+1];arrArrows[m]=arrArrows[m+1]}if(PlaceArray[m+1]!=undefined){PlaceArray[m]=PlaceArray[m+1]}else{PlaceArray[m]=0}}FindPathArray.pop();PlaceStatusArray.pop();PlaceToFindPathArray.pop();PathPolylineArray.pop();arrArrows.pop();if(PlaceArray.length>2){PlaceArray.pop()}if(n==0||n==PlaceToFindPathArray.length){LoadDirectionTool();GetTotalDistance()}else{FindShortestPath(n-1+","+0,0,0)}}function LoadDirectionTool(){if(PlaceToFindPathArray.length==2){document.getElementById("tdreverse").style.display="";document.getElementById("printDirection").style.display=""}else{document.getElementById("tdreverse").style.display="none";
document.getElementById("printDirection").style.display="none"}}function RemovePlace_History(b,g,a){if(mkP!=null){map.removeOverlay(mkP);mkP=null}map.closeInfoWindow();var h=document.getElementById("findpath_div");var e=b.split(",");var c=parseInt(e[0]);var f=parseInt(e[1]);if(PlaceArray[c]==0){return}if(PathPolylineArray[0][0]==0){return}if(PlaceToFindPathArray[0][0]==0){return}if(f>0){if(a){PathPolylineArray[c][f].hide();PlaceToFindPathArray[c][f].hide()}else{PathPolylineArray[c][f].show();PlaceToFindPathArray[c][f].show()}for(var d=f;d<PlaceToFindPathArray[c].length-1;d++){PathPolylineArray[c][d]=PathPolylineArray[c][d+1];PathPolylineArray[c][d].sid=c+","+d;PlaceToFindPathArray[c][d]=PlaceToFindPathArray[c][d+1];PlaceToFindPathArray[c][d].sid=c+","+d}return}if(c>0){for(var d=PlaceToFindPathArray[c-1].length-1;d>=0;d--){if(a){PathPolylineArray[c-1][d].hide()}else{PathPolylineArray[c-1][d].show()}if(d>0){if(a){PlaceToFindPathArray[c-1][d].hide()}else{PlaceToFindPathArray[c-1][d].show()}}}}if(c<PlaceToFindPathArray.length-1){for(var d=PlaceToFindPathArray[c].length-1;d>=0;d--){if(a){PathPolylineArray[c][d].hide();PlaceToFindPathArray[c][d].hide()}else{PathPolylineArray[c][d].show();PlaceToFindPathArray[c][d].show()}}}else{if(c==PlaceToFindPathArray.length-1){if(a){PlaceToFindPathArray[c][0].hide()}else{PlaceToFindPathArray[c][0].show()}}}if(c==0||c==PlaceToFindPathArray.length){LoadDirectionTool();GetTotalDistance()}}function FromHereClick(a){AddPlaceFromFind(a);closeContextMenu()}function ToHereClick(a){AddPlaceToFind(a);closeContextMenu()}function GetPolylineOrder(b){var a=0;if(b==PlaceToFindPathArray.length){return -1}for(var c=0;c<b;c++){a+=PlaceToFindPathArray[c].length}return a}function UpdateShortestPath(a){var c=a.split(",");var b=parseInt(c[0]);var d=parseInt(c[1]);if(PlaceToFindPathArray.length<2||isFinding==true){return}currentIndex=b;currentSub=d;var e=document.getElementById("direction"+b);e.childNodes[0].rows[0].cells[1].childNodes[0].value=PlaceToFindPathArray[b][0].getLatLng().toUrlValue();FindShortestPath(b+","+d,0,0)}function FindAllPath(){if(PlaceToFindPathArray.length<2||isFinding==true){return}ping_connection();if(mkP!=null){map.removeOverlay(mkP);mkP=null}var k=document.getElementById("avoidalley").checked;k=(k)?1:0;var c=document.getElementById("avoidblock").checked;c=(c)?1:0;var b=document.getElementById("vehicle").value;var f="";var g="";var a=map.getLevel();var d=map.getDirectionBounds();for(var h=0;h<PlaceToFindPathArray.length;h++){for(var e=0;e<PlaceToFindPathArray[h].length;e++){f+=PlaceToFindPathArray[h][e].getPoint().lng()+","+PlaceToFindPathArray[h][e].getPoint().lat()+","}if(h>0&&h<PlaceToFindPathArray.length-1){g+=PlaceToFindPathArray[h-1].length+","}}AJLocationSearch.FindShortestPath(ClientID,f,b,g,0,-1,a,d.getNorthWest().lng(),d.getNorthWest().lat(),d.getSouthEast().lng(),d.getSouthEast().lat(),currentFindtype,0,0,0,k,c,0,FindAllPathChange);isFinding=true;showBusyDiv("")}function FindAllPathChange(d){if(d.error!=null){return}var e=d.value;var b=0;for(var c=0;c<PathPolylineArray.length;c++){for(var a=0;a<PathPolylineArray[c].length;a++){if(PathPolylineArray[c][a]!=null&&b<e.length){PathPolylineArray[c][a].setLatLngs(e[b])}if(arrArrows[c][a]!=null&&b<e.length){arrArrows[c][a].setLatLngs(e[b])}b++}}isFinding=false;isChanging=false;FitDirectionOverlays();GetAllPathDirection();document.getElementById("clearPathResultText").style.display=""}function FindShortestPath(e,d,p,a){if(PlaceToFindPathArray.length<2){return}var g=e.split(",");var q=parseInt(g[0]);var b=parseInt(g[1]);currentIndex=q;currentSub=b;if(q<0||q>PlaceToFindPathArray.length-1){return}ping_connection();if(mkP!=null){map.removeOverlay(mkP);mkP=null}var o=document.getElementById("avoidalley").checked;o=(o)?1:0;var k=document.getElementById("avoidblock").checked;k=(k)?1:0;var f=document.getElementById("vehicle").value;var m="";var l="";if(d==1){currentFindtype=1;for(var n=0;n<=b;n++){m+=PlaceToFindPathArray[q][n].getPoint().lng()+","+PlaceToFindPathArray[q][n].getPoint().lat()+","}if(mkD!=null){m+=mkD.getPoint().lng()+","+mkD.getPoint().lat()+","}for(var n=b+1;n<PlaceToFindPathArray[q].length;n++){m+=PlaceToFindPathArray[q][n].getPoint().lng()+","+PlaceToFindPathArray[q][n].getPoint().lat()+","}m+=PlaceToFindPathArray[q+1][0].getPoint().lng()+","+PlaceToFindPathArray[q+1][0].getPoint().lat()}else{currentFindtype=0;if(q>0&&b==0){for(var n=0;n<PlaceToFindPathArray[q-1].length;n++){m+=PlaceToFindPathArray[q-1][n].getPoint().lng()+","+PlaceToFindPathArray[q-1][n].getPoint().lat()+","}}for(var n=0;n<PlaceToFindPathArray[q].length;n++){m+=PlaceToFindPathArray[q][n].getPoint().lng()+","+PlaceToFindPathArray[q][n].getPoint().lat()+","}if(q<PlaceToFindPathArray.length-1){m+=PlaceToFindPathArray[q+1][0].getPoint().lng()+","+PlaceToFindPathArray[q+1][0].getPoint().lat();if(q>0){l=PlaceToFindPathArray[q-1].length.toString()}}}var c=map.getLevel();var j=map.getDirectionBounds();var h=GetPolylineOrder(currentIndex);if(currentIndex==PlaceToFindPathArray.length-1||(currentIndex>0&&b==0&&p==0&&a!=1)){h=GetPolylineOrder(currentIndex-1)}AJLocationSearch.FindShortestPath(ClientID,m,f,l,0,1,c,j.getNorthWest().lng(),j.getNorthWest().lat(),j.getSouthEast().lng(),j.getSouthEast().lat(),currentFindtype,h,currentSub,p,o,k,0,FindShortestPathChange);isFinding=true;showBusyDiv("")}var firstStart=true;var mStart=null;var mFinish=null;var arrFinish=new Array();function FindShortestPathChange(g){if(g==null||g.error!=null||g.value==null){isFinding=false;isChanging=false;hideBusyDiv();return}var l=g.value;var c,a;directionLatLng=map.getCenter();if(currentFindtype==1){var f=(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap)?0.5:0.7;for(var e=0;e<l.length;e++){var n=new GeneralMap.Polyline(l[e],"red",3,"",f);n.sid=currentIndex+","+(e);if(PathPolylineArray[currentIndex][e]!=0&&PathPolylineArray[currentIndex][e]!=null){map.removeOverlay(PathPolylineArray[currentIndex][e])}PathPolylineArray[currentIndex][e]=n;map.addOverlay(n);AddPathMouseMoveEvent(n);var j=new GeneralMap.Arrow(l[e],"end");if(arrArrows[currentIndex][e]!=0&&arrArrows[currentIndex][e]!=null){map.removeOverlay(arrArrows[currentIndex][e])}arrArrows[currentIndex][e]=j;map.addOverlay(j);if(e>0){var b=new GeneralMap.LatLng(n.getVertex(0).lat(),n.getVertex(0).lng());var d=PlaceToFindPathArray[currentIndex][e];c=new GeneralMap.Icon("images/circle.gif");c.iconSize=new GeneralMap.Size(10,10);a=new GeneralMap.MarkerOptions(c,null,new GeneralMap.Size(5,5));if(d==null){d=new GeneralMap.Marker(b,a);d.type=FPMARKEROBJ;PlaceToFindPathArray[currentIndex].push(d);map.addOverlay(d)}d.sid=currentIndex+","+(e);d.setPoint(b);d.enableDragging();GeneralMap.Event.addListener(d,"dragend",function(o){isFPObjDragging=false;FindShortestPath(o.sid,1,0)});GeneralMap.Event.addListener(d,"dragging",function(o){isFPObjDragging=true;if(mkD!=null){map.removeOverlay(mkD);mkD=null}ChangeShortestPath(o.sid)})}}GetPathDirection();return}var m=0;if(currentIndex>0){m=BindPath(l,m,currentIndex-1)}if(currentIndex<PlaceToFindPathArray.length-1){BindPath(l,m,currentIndex)}var h=document.getElementById("direction"+currentIndex);var k=h.childNodes[0].rows[0].cells[1].childNodes[0].value;if(CheckInputDatatype(k)=="string"){FitDirectionOverlays()}GetPathDirection();document.getElementById("clearPathResultText").style.display=""}function BindPath(f,a,d){var c=(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap)?0.5:0.7;for(var b=0;b<PlaceToFindPathArray[d].length;b++){var g=new GeneralMap.Polyline(f[a],"red",3,"",c);g.sid=d+","+b;if(PathPolylineArray[d][b]!=0&&PathPolylineArray[d][b]!=null){map.removeOverlay(PathPolylineArray[d][b])}PathPolylineArray[d][b]=g;map.addOverlay(g);AddPathMouseMoveEvent(g);var e=new GeneralMap.Arrow(f[a],"end");if(arrArrows[d][b]!=0&&arrArrows[d][b]!=null){map.removeOverlay(arrArrows[d][b])}arrArrows[d][b]=e;map.addOverlay(e);a++;PlaceToFindPathArray[d][b].setPoint(g.getVertex(0));PlaceToFindPathArray[d+1][0].setPoint(g.getVertex(g.getVertexCount()-1))
}return a}function AddPathMouseMoveEvent(a){GeneralMap.Event.addListener(a,"mousemove",function(l,j,c){if(!isFPObjDragging){var d=new GeneralMap.Icon("images/circle.gif");d.iconSize=new GeneralMap.Size(10,10);if(mkD!=null){map.removeOverlay(mkD);mkD=null}var e=map.fromLatLngToDivPixel(l);var f=map.fromLatLngToDivPixel(c.latlngs[0][0]);var g=c.latlngs.length;var k=c.latlngs[g-1].length;var h=map.fromLatLngToDivPixel(c.latlngs[g-1][k-1]);if(GeneralMap.Util.Distance(e.x,e.y,f.x,f.y)>150&&GeneralMap.Util.Distance(e.x,e.y,h.x,h.y)>150){var b=new GeneralMap.MarkerOptions(d,null,new GeneralMap.Size(5,5));mkD=new GeneralMap.Marker(l,b);mkD.sid=c.sid;selectedPoly=c.sid;map.addOverlay(mkD);mkD.enableDragging();GeneralMap.Event.addListener(mkD,"mousemove",function(o,u){var m=c.latlngs;var t=new Array();GeneralMap.Util.ClosestPointPolylines(u.lng(),u.lat(),m,t);var v=t[0];var n=map.fromLatLngToDivPixel(v);var p=map.fromLatLngToDivPixel(c.latlngs[0][0]);var q=c.latlngs.length;var s=c.latlngs[q-1].length;var r=map.fromLatLngToDivPixel(c.latlngs[q-1][s-1]);if(GeneralMap.Util.Distance(n.x,n.y,p.x,p.y)>150&&GeneralMap.Util.Distance(n.x,n.y,r.x,r.y)>150){mkD.setPoint(v)}});GeneralMap.Event.addListener(mkD,"dragend",function(){isFPObjDragging=false;FindShortestPath(mkD.sid,1,1)});GeneralMap.Event.addListener(mkD,"dragging",function(){isFPObjDragging=true;ChangeShortestPath(mkD.sid,1)})}}})}function GetAllPathDirection(){AJLocationSearch.GetDirection(GetAllPathDirectionChange)}function GetAllPathDirectionChange(b){if(b.error!=null){return}ChangeFunctionType(GLOBAL_FINDPATH_FUNCTION);var a=ReplaceDirectionText(b.value).split("newsectiontable");hideBusyDiv("");for(var c=0;c<a.length-1;c++){BindPathResult(c,a[c])}GetTotalDistance();isFinding=false;isChanging=false;document.getElementById("clearPathResultText").style.display=""}function BindPathResult(h,d){if(h==0){document.getElementById("guide"+h).innerHTML=d}else{var a=document.getElementById("guide"+h);a.innerHTML=d;var e=document.getElementById("guide"+(h-1));if(e==null||e.getElementsByTagName("table")[1]==null){return}var g=e.getElementsByTagName("table")[1].rows.length;var f=e.getElementsByTagName("table")[1].rows[g-2].cells[0].innerHTML.replace(".","");f=parseInt(f);var c=a.getElementsByTagName("table")[1];if(c==null){return}for(var b=0;b<c.rows.length-1;b++){c.rows[b].cells[0].innerHTML=(f+b+1)+"."}}}function ReplaceDirectionText(a){if(nLanguage==0){a=a.replace(/Start at/g,"Bắt đầu tại điểm");a=a.replace(/Arrive at/g,"Đến đích tại điểm");a=a.replace(/Head on/g,"Đi thẳng");a=a.replace(/Turn right at/g,"Rẽ phải vào");a=a.replace(/Turn left at/g,"Rẽ trái vào");a=a.replace(/Continue on/g,"Đi tiếp");a=a.replace(/Length/g,"Chiều dài");a=a.replace(/Find business on this route/g,"Tìm dịch vụ trên đoạn này");a=a.replace(/We cannot drive between two these locations/g,"Chúng tôi không tìm thấy đường đi giữa hai vị trí này")}return a}function GetPathDirection(){AJLocationSearch.GetDirection(GetPathDirectionChange)}var complexFindPathObject=new Object();function GetPathDirectionChange(c){if(c.error!=null){return}if(currentIndex>PlaceToFindPathArray.length-1){return}isFinding=false;isChanging=false;var b=c.value;b=ReplaceDirectionText(b);var a=b.split("newsectiontable");var d=0;hideBusyDiv("");if(currentFindtype==1){BindPathResult(currentIndex,a[0])}else{if(currentIndex>0){BindPathResult(currentIndex-1,a[d]);d++}if(currentIndex<PlaceToFindPathArray.length-1){BindPathResult(currentIndex,a[d].substring(a[d].indexOf("<TABLE")))}}ChangeFunctionType(GLOBAL_FINDPATH_FUNCTION);GetTotalDistance();document.getElementById("clearPathResultText").style.display=""}var a1,a2,ptMove=null;function ChangeShortestPath(d,c){if(PlaceToFindPathArray.length<2||isChanging==true||isFinding==true){return}var f=d.split(",");var m=parseInt(f[0]);var a=parseInt(f[1]);currentIndex=m;currentSub=a;if(m<0||m>PlaceToFindPathArray.length-1){return}var n=(mkD!=null)?mkD.getPoint():PlaceToFindPathArray[m][a].getPoint();if(ptMove!=null&&ptMove.equals(n)){return}a1=d;a2=c;if(mkP!=null){map.removeOverlay(mkP);mkP=null}var l=document.getElementById("avoidalley").checked;l=(l)?1:0;var h=document.getElementById("avoidblock").checked;h=(h)?1:0;var e=document.getElementById("vehicle").value;var k="";var j="";if(c==1){currentFindtype=1;k+=PlaceToFindPathArray[m][a].getPoint().lng()+","+PlaceToFindPathArray[m][a].getPoint().lat()+",";k+=mkD.getPoint().lng()+","+mkD.getPoint().lat();if(a<PlaceToFindPathArray[m].length-1){k+=","+PlaceToFindPathArray[m][a+1].getPoint().lng()+","+PlaceToFindPathArray[m][a+1].getPoint().lat()}else{k+=","+PlaceToFindPathArray[m+1][0].getPoint().lng()+","+PlaceToFindPathArray[m+1][0].getPoint().lat()}}else{currentFindtype=0;if(m>0&&a==0){k+=PlaceToFindPathArray[m-1][PlaceToFindPathArray[m-1].length-1].getPoint().lng()+","+PlaceToFindPathArray[m-1][PlaceToFindPathArray[m-1].length-1].getPoint().lat()+","}else{if(a>0){k+=PlaceToFindPathArray[m][a-1].getPoint().lng()+","+PlaceToFindPathArray[m][a-1].getPoint().lat()+","}}k+=PlaceToFindPathArray[m][a].getPoint().lng()+","+PlaceToFindPathArray[m][a].getPoint().lat();if(m<PlaceToFindPathArray.length-1&&a>=PlaceToFindPathArray[m].length-1){k+=","+PlaceToFindPathArray[m+1][0].getPoint().lng()+","+PlaceToFindPathArray[m+1][0].getPoint().lat()}else{if(a<PlaceToFindPathArray[m].length-1){k+=","+PlaceToFindPathArray[m][a+1].getPoint().lng()+","+PlaceToFindPathArray[m][a+1].getPoint().lat()}}}var b=map.getLevel();var g=map.getDirectionBounds();if(mkD!=null){ptMove=mkD.getPoint().copy()}else{ptMove=PlaceToFindPathArray[m][a].getPoint().copy()}AJLocationSearch.FindShortestPath(ClientID,k,e,j.toString(),1,1,b,g.getNorthWest().lng(),g.getNorthWest().lat(),g.getSouthEast().lng(),g.getSouthEast().lat(),-1,-1,-1,-1,l,h,0,ChangeShortestPathChange);isChanging=true}function ChangeShortestPathChange(b){if(b.error!=null){return}var c=b.value;if(c==null||c[0]==null||c.length<1||isFinding==true){return}if(currentFindtype==1){for(var a=0;a<c[1].length;a++){c[0].push(c[1][a])}c.pop();PathPolylineArray[currentIndex][currentSub].setLatLngs(c[0]);arrArrows[currentIndex][currentSub].setLatLngs(c[0]);isChanging=false;ChangeShortestPath(a1,a2);return}var a=0;if(currentIndex>0&&currentSub==0){PathPolylineArray[currentIndex-1][PathPolylineArray[currentIndex-1].length-1].setLatLngs(c[0]);arrArrows[currentIndex-1][arrArrows[currentIndex-1].length-1].setLatLngs(c[0]);a++}else{if(currentSub>0){PathPolylineArray[currentIndex][currentSub-1].setLatLngs(c[0]);arrArrows[currentIndex][currentSub-1].setLatLngs(c[0]);a++}}if(currentIndex<PlaceToFindPathArray.length-1){PathPolylineArray[currentIndex][currentSub].setLatLngs(c[a]);arrArrows[currentIndex][currentSub].setLatLngs(c[a])}isChanging=false;ChangeShortestPath(a1,a2);document.getElementById("clearPathResultText").style.display=""}function GetDirectionLatLngs(){if(PlaceToFindPathArray.length<2){return}var b=map.getLevel();var a=map.getDirectionBounds();AJLocationSearch.GetDirectionLatLngs(ClientID,b,a.getNorthWest().lng(),a.getNorthWest().lat(),a.getSouthEast().lng(),a.getSouthEast().lat(),GetDirectionLatLngsChange)}function GetDirectionLatLngsChange(e){if(e.error!=null||e==null||e.value==null){return}var b=e.value;var d=0;for(var c=0;c<PlaceToFindPathArray.length;c++){for(var a=0;a<PlaceToFindPathArray[c].length;a++){if(PathPolylineArray[c][a].setLatLngs!=undefined){PathPolylineArray[c][a].setLatLngs(b[d])}if(arrArrows[c][a].setLatLngs!=undefined){arrArrows[c][a].setLatLngs(b[d])}d++}if(d>=b.length){break}}directionLatLng=map.getCenter();directionLevel=map.getLevel();document.getElementById("clearPathResultText").style.display=""}function FitDirectionOverlays(){var c=new Array();for(var b=0;b<PlaceToFindPathArray.length;b++){for(var a=0;a<PlaceToFindPathArray[b].length;a++){if(PlaceToFindPathArray[b][a]!=null&&PlaceToFindPathArray[b][a].vType!=null){if(PlaceToFindPathArray[b][a].vType()=="VMarker"){c.push(PlaceToFindPathArray[b][a])}}}}for(var b=0;b<PathPolylineArray.length;b++){for(var a=0;
a<PathPolylineArray[b].length;a++){if(PathPolylineArray[b][a]!=null&&PathPolylineArray[b][a].vType!=null){if(PathPolylineArray[b][a].vType()=="VPolyline"){c.push(PathPolylineArray[b][a])}}}}map.fitMultiOverlays(c);c=new Array()}function CloseDirection(b){if(b==undefined||b.parentNode==undefined){b=this}var c=b.parentNode.parentNode.parentNode.parentNode.id;b.innerHTML='<img src=images/mo.gif style="margin-right:6px; " />';b.onclick=OpenDirection;var a=parseInt(c.substring(5,c.length));CloseSubDirection(a)}function CloseSubDirection(c){var a=document.getElementById("guide"+c);var d=0;var b=0;for(d=0;d<a.childNodes.length;d++){if(a.childNodes[d].tagName=="TABLE"){b++}if(b==2){break}}a.childNodes[d].style.display="none"}function OverDirectionGuide(g,k,m){if(g!=currentElement){ChangeBgColor(g,"#eff9e0")}var f=g.parentNode.parentNode.parentNode.id;var n=parseInt(f.substring(5,f.length));var h=g.id.split("_");var j=parseFloat(h[0]);var b=parseFloat(h[1]);if(n>=0){var d=new GeneralMap.LatLng(b,j);var e=map.getLevel();var c=new GeneralMap.Icon("images/blink2.gif");c.iconSize=new GeneralMap.Size(11,11);var a=new GeneralMap.MarkerOptions(c,null,new GeneralMap.Size(5,5));if(mkOP!=null){map.removeOverlay(mkOP);mkOP=null}mkOP=new GeneralMap.Marker(d,a);map.addOverlay(mkOP)}}function OutDirectionGuide(a){if(a!=currentElement){ChangeBgColor(a,"#ffffff")}if(mkOP!=null){map.removeOverlay(mkOP);mkOP=null}}function OpenDirection(){var b=this;var c=b.parentNode.parentNode.parentNode.parentNode.id;b.innerHTML='<img src=images/dong.gif style="margin-right:6px; " />';b.onclick=CloseDirection;var a=parseInt(c.substring(5,c.length));OpenSubDirection(a)}function OpenSubDirection(c){var a=document.getElementById("guide"+c);var d=0;var b=0;for(d=0;d<a.childNodes.length;d++){if(a.childNodes[d].tagName=="TABLE"){b++}if(b==2){break}}a.childNodes[d].style.display=""}function SearchPlaceEnter(d,b){if(d.keyCode==13){var c=b.parentNode.parentNode.parentNode.parentNode.parentNode.id;var a=parseInt(c.substring(9,c.length));PlaceStatusArray[a]=1;if(CheckInputDatatype(b.value)=="coor"){CheckCoorInput(a,b.value)}else{SearchPlace(a,b.value,1)}return false}return true}function ChangeContent(a){}function CheckInputDatatype(b){var a=b.split(",");if(a.length==2&&!isNaN(parseFloat(a[0]))&&!isNaN(parseFloat(a[1]))){return"coor"}else{return"string"}}function CheckCoorInput(a,c){var b=c.split(",");var d=new GeneralMap.LatLng(parseFloat(b[0]),parseFloat(b[1]));if(PlaceToFindPathArray[a]==null){if(a==PlaceToFindPathArray.length&&a==0){AddPlaceFromFind(d)}else{AddPlaceToFind(d)}}else{PlaceToFindPathArray[a][0].setPoint(d);FindShortestPath(a+",0",0,0)}}var currentElement=null;function GetRoadFromShortestPath(f,k){var e=f.parentNode.parentNode.parentNode.id;var h=parseInt(e.substring(5,e.length));var b=f.id.split("_");if(h>=0){var g=f.cells[1].innerHTML;g+=' <span style="white-space:nowrap;">- '+((g.indexOf("Đi")==0)?"":"đi ")+f.cells[2].innerHTML+"</span>";var j='<div class="MiniPopup" style="width:230px;"><p style="padding:2px;font-size:12px">'+g+"</p>";if(nLanguage==0){if(isPlayStep){j+='<div class="DirectFunction">';j+='<a id="dirPrev" class="dirPrevDis" title="Bước trước đó"></a>';j+=' <a id="dirPlay" class="dirStopAvai" title="Dừng" onclick="StopStep('+h+","+f.rowIndex+')"></a>';j+=' <a id="dirNext" class="dirNextDis" title="Bước tiếp theo"></a>';j+="</div></div>"}else{j+='<div class="DirectFunction">';j+='<a id="dirPrev" class="dirPrevAvai" title="Bước trước đó" onclick="ShowStep('+h+","+(f.rowIndex-1)+')"></a>';j+=' <a id="dirPlay" class="dirPlayStepAvai" title="Chạy tự động" onclick="PlayStep('+h+","+f.rowIndex+')"></a>';j+=' <a id="dirNext" class="dirNextAvai" title="Bước tiếp theo" onclick="ShowStep('+h+","+(f.rowIndex+1)+')"></a>';j+="</div></div>"}}var b=new GeneralMap.LatLng(b[1],b[0]);currentStep=f;if(map.getLevel()<11){map.zoomToLevel(11)}var c=new GeneralMap.Icon("images/blink1.gif");c.iconSize=new GeneralMap.Size(11,11);var a=new GeneralMap.MarkerOptions(c,null,new GeneralMap.Size(5,5));if(mkP!=null){map.removeOverlay(mkP);mkP=null}mkP=new GeneralMap.Marker(b,a);map.addOverlay(mkP);var d=new GeneralMap.InfoWindowOptions();d.offset=new GeneralMap.Size(0,5);mkP.openInfoWindow(j,d);if(currentElement!=null){ChangeBgColor(currentElement,"#ffffff")}ChangeBgColor(f,"#E0EDF9");currentElement=f}}var isPlayStep=false;function PlayStep(b,a){isPlayStep=true;ShowStep(b,a,true)}function StopStep(e,a){isPlayStep=false;var c=document.getElementById("dirPrev");c.className="dirPrevAvai";c.onclick=function(){ShowStep(e,a-1)};var b=document.getElementById("dirNext");b.className="dirNextAvai";b.onclick=function(){ShowStep(e,a+1)};var d=document.getElementById("dirPlay");d.className="dirPlayStepAvai";d.onclick=function(){PlayStep(e,a)}}function ShowStep(f,c,b){var a;if(c==-1){f--;if(f<0){return}a=document.getElementById("guide"+f);if(a==null||a.getElementsByTagName("table")[1]==null){return}c=a.getElementsByTagName("table")[1].rows.length-2}else{var e=currentStep.parentNode.rows.length;if(c+1>e-1){f++;c=0}a=document.getElementById("guide"+f);if(a==null||a.getElementsByTagName("table")[1]==null){return}}var d=a.getElementsByTagName("table")[1].rows[c];if(d!=undefined&&d.id.indexOf("_")>0){GetRoadFromShortestPath(d)}if(b){setTimeout(function(){if(isPlayStep){c++;PlayStep(f,c)}},3500)}}function SearchNearByPolylineExt(f,c,e,b,d){ping_connection();var g=null;var j="";SetSearchType(0);showBusyDiv("");if(f==null){if(currentStep!=null){if(currentStep.parentNode==null){return}var a=currentStep.parentNode.parentNode.parentNode.id;g=parseInt(a.substring(5,a.length));if(g==null){g=PlaceToFindPathArray.length}j="Đoạn đường "+GetNodeName(g)}else{j=SearchWhere;if(j.toLowerCase().indexOf("đoạn đường ")==0||j.toLowerCase().indexOf("doan duong ")==0){j=j.substring(11);j=j.replace(/^\s+|\s+$/g,"");g=GetSectionId(j.substring(0,1));if(g==null){g=PlaceToFindPathArray.length}j="Đoạn đường "+j}}}else{g=f}PathSectionID=g;if(g>=PlaceToFindPathArray.length-1){hideBusyDiv();if(nLanguage==0){alert("Không tồn tại đoạn đường bạn yêu cầu")}else{alert("Road is not exist")}ClearPathResult();return}if(c!=null){if(document.getElementById("shortestpathsearchnearby")!=null){document.getElementById("shortestpathsearchnearby").value=c}}else{if(c==null){c=document.getElementById("shortestpathsearchnearby").value;e=""}}if(d==null){d=document.getElementById("shortestpathsearchnearby_radius").value;if(isNaN(d)){d=100}}c=c.replace(/\[quote]/g,'"');FillQueryToTextBox(c+" trên đoạn đường "+GetNodeName(g));document.getElementById("mapinput").style.background="#ffffff";document.getElementById("mapinput").value=c+" trên đoạn đường "+GetNodeName(g);if(j==""){j=SearchWhere}j=j.toLowerCase().replace("doan duong","đoạn đường");var h=j.substring(11).toLowerCase();j=j.substring(0,11)+" "+h;j=j.replace(/^\s+|\s+$/g,"");isSearching=true;AJLocationSearch.SearchNearByPolyline(ClientID,GetPolylineOrder(g),PlaceToFindPathArray[g].length,c,e,j,b,d,SearchNearByPolylineChange)}function SearchNearByPointExt(c,j,g,f,d,h,b,e){ping_connection();var a=false;if(dsResultData!=null&&dsResultData.Tables.length>1){a=dsResultData.Tables[1].Rows[0].IsAddress}SetSearchType(0);showBusyDiv("");if(d!=null){if(document.getElementById("searchnearbypoint")!=null){document.getElementById("searchnearbypoint").value=d}}else{if(d==null){d=document.getElementById("searchnearbypoint").value}}if(e!=null){if(document.getElementById("searchnearbypoint_radius")!=null){document.getElementById("searchnearbypoint_radius").value=e}}else{if(e==null){e=document.getElementById("searchnearbypoint_radius").value}}if(isNaN(e)){e=2000}c=RemoveHTMLTag(c);d=d.replace(/\[quote]/g,'"');document.getElementById("mapinput").value=d+" gần "+c+((j!="")?", "+j:"");isSearching=true;AJLocationSearch.SearchNearByPoint(d,h,c,j,g,f,e,b,SearchNearByPointChange)}function GetNodeName(a){switch(a){case 0:return"A->B";break;case 1:return"B->C";break;case 2:return"C->D";break;case 3:return"D->E";break;case 4:return"E->F";break;case 5:return"F->G";
break;case 6:return"G->H";break;case 7:return"H->I";break;case 8:return"I->J";break;case 9:return"J->K";break;case 10:return"K->L";break;case 11:return"L->M";break;case 12:return"M->N";break;case 13:return"N->O";break;case 14:return"O->P";break;case 15:return"P->Q";break;case 16:return"Q->R";break;case 17:return"R->S";break;case 18:return"S->T";break;case 19:return"T->U";break;case 20:return"U->V";break;case 21:return"V->W";break;case 22:return"W->X";break;case 23:return"X->Y";break;case 24:return"Y->Z";break}}function GetSectionId(a){if(a==null){return}switch(a.toUpperCase()){case"A":return 0;break;case"B":return 1;break;case"C":return 2;break;case"D":return 3;break;case"E":return 4;break;case"F":return 5;break;case"G":return 6;break;case"H":return 7;break;case"I":return 8;break;case"J":return 9;break;case"K":return 10;break;case"L":return 11;break;case"M":return 12;break;case"N":return 13;break;case"O":return 14;break;case"P":return 15;break;case"Q":return 16;break;case"R":return 17;break;case"S":return 18;break;case"T":return 19;break;case"U":return 20;break;case"V":return 21;break;case"W":return 22;break;case"X":return 23;break;case"Y":return 24;break;case"Z":return 25;break}}function SearchNearByPolylineChange(a){isSearching=false;if(a.error!=null){return}hideBusyDiv();map.closeInfoWindow();currentStep=null;dsResultData=a.value;var u=new Array();if((null!=dsResultData)&&("object"==typeof(dsResultData))){var d=dsResultData.Tables[0].Rows.length;var b=dsResultData.Tables[1].Rows[0].HitSize;var v=dsResultData.Tables[1].Rows[0].Key;var j=parseInt((b+PAGE_ROWS-1)/PAGE_ROWS);var o=10;j=(j>o)?o:j;var r=j>PAGE_SHOW?PAGE_SHOW:j;var k=dsResultData.Tables[1].Rows[0].PageIdx;var f=dsResultData.Tables[1].Rows[0].Lx;var e=dsResultData.Tables[1].Rows[0].Ly;var h=dsResultData.Tables[1].Rows[0].Rx;var g=dsResultData.Tables[1].Rows[0].Ry;var l=dsResultData.Tables[1].Rows[0].SearchType;var q=dsResultData.Tables[1].Rows[0].SuggestedKey;var c=dsResultData.Tables[1].Rows[0].Radius;var s=dsResultData.Tables[1].Rows[0].What;var p=dsResultData.Tables[1].Rows[0].Where;var t=(k-1)*PAGE_ROWS+1;var n=t+PAGE_ROWS-1>b?b:t+PAGE_ROWS-1;u[u.length]='<table id=TablePlace width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto;">';var m="<b>"+v+"</b> trên <b>"+p+"</b> trong phạm vi <b>"+c+"(m)</b>";u[u.length]=Global.GetResultText(m,m,"",q,b,dsResultData.Tables[1].Rows[0].IsLonLat,dsResultData.Tables[1].Rows[0].IsAddress,t,n);KeySearch=v;if(k+1<=j&&isFirstSearch){TypeSearch=7;setTimeout(function(){isBindingMorePlace=true;AJLocationSearch.SearchNearByPolyline(ClientID,GetPolylineOrder(PathSectionID),PlaceToFindPathArray[PathSectionID].length,v,s,p,1,c,MorePlaceBinding)},1000)}ClearSearchMapResult();HideSelectPlaceBox();u[u.length]=BindResult(dsResultData.Tables[0]);u[u.length]="</table>";u[u.length]=Global.GetComplainLink(KeySearch);u[u.length]=Global.BuildPaging(k,j,b,r,Global.PagingSearchNearByPolylineExt,new Array(null,v,s,c));ChangeFunctionType(GLOBAL_SEARCH_FUNCTION);document.getElementById("searchresult_div").innerHTML=u.join("");document.getElementById("searchresult_div").scrollTop=0;if(b>0){map.fitMultiOverlays(arrSearchMapResult)}document.getElementById("clearSearchResultText").style.display=""}}function SearchNearByPointChange(a){isSearching=false;if(a.error!=null){return}hideBusyDiv();map.closeInfoWindow();dsResultData=a.value;var C=new Array();if((null!=dsResultData)&&("object"==typeof(dsResultData))){var e=dsResultData.Tables[0].Rows.length;var b=dsResultData.Tables[1].Rows[0].HitSize;var E=dsResultData.Tables[1].Rows[0].Key;var k=parseInt((b+PAGE_ROWS-1)/PAGE_ROWS);var u=10;k=(k>u)?u:k;var x=k>PAGE_SHOW?PAGE_SHOW:k;var o=dsResultData.Tables[1].Rows[0].PageIdx;var g=dsResultData.Tables[1].Rows[0].Lx;var f=dsResultData.Tables[1].Rows[0].Ly;var j=dsResultData.Tables[1].Rows[0].Rx;var h=dsResultData.Tables[1].Rows[0].Ry;var r=dsResultData.Tables[1].Rows[0].SearchType;var w=dsResultData.Tables[1].Rows[0].SuggestedKey;var d=dsResultData.Tables[0].Rows[e-1].Name;var l=dsResultData.Tables[0].Rows[e-1].Address;var v=dsResultData.Tables[0].Rows[e-1].Longitude+"";var D=dsResultData.Tables[0].Rows[e-1].Latitude+"";var c=dsResultData.Tables[1].Rows[0].Radius;var n;if(l!=""){n=d+", "+l}else{n=d}var z=dsResultData.Tables[1].Rows[0].What;var B=(o-1)*PAGE_ROWS+1;var t=B+PAGE_ROWS-1>b?b:B+PAGE_ROWS-1;C[C.length]='<table id=TablePlace width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto;">';var s="<b>"+E+"</b> ở gần <b>"+n+"</b> trong phạm vi <b>"+c+"(m)</b>";C[C.length]=Global.GetResultText(s,s,"",w,b,dsResultData.Tables[1].Rows[0].IsLonLat,dsResultData.Tables[1].Rows[0].IsAddress,B,t);var q;var A;var m;var p;var y=0;KeySearch=E;if(o+1<=k&&isFirstSearch){TypeSearch=6;setTimeout(function(){isBindingMorePlace=true;AJLocationSearch.FindMoreNearByPoint(E,z,d,l,v,D,c,1,MorePlaceBinding)},1000)}ClearSearchMapResult();HideSelectPlaceBox();C[C.length]=BindResult(dsResultData.Tables[0]);C[C.length]="</table>";C[C.length]=Global.GetComplainLink(KeySearch);C[C.length]=Global.BuildPaging(o,k,b,x,Global.PagingSearchNearByPointExt,new Array(d,l,v+"",D+"",E,z,c));ChangeFunctionType(GLOBAL_SEARCH_FUNCTION);document.getElementById("searchresult_div").innerHTML=C.join("");document.getElementById("searchresult_div").scrollTop=0;if(b>0){map.fitMultiOverlays(arrSearchMapResult)}document.getElementById("clearSearchResultText").style.display=""}}function SearchNearByPolylineEnter(d,c,b){var a;if(document.all){a=event.keyCode}else{a=d.keyCode}if(a==13){isFirstSearch=true;SearchNearByPolylineExt(c,null,null,1,null);return false}return true}function SearchNearByPointEnter(g,j,h,c,f,b,a){var d;if(document.all){d=event.keyCode}else{d=g.keyCode}if(d==13){isFirstSearch=true;centerObjectNearby=centerObjectNearbyTemp;SearchNearByPointExt(j,h,c,f,b,"",1,a);return false}return true}function ShowSearchNearByShortestPath(b){var c=b.parentNode.parentNode.parentNode.parentNode.parentNode.id;var a=parseInt(c.substring(5,c.length));var d=new Array();d[d.length]='<table width=270px border=0 cellspacing=0 cellpadding=0 style="margin-left:3px; margin-top:3px;">';d[d.length]="<tr align=left><td colspan=3><strong>";if(nLanguage==0){d[d.length]=' Tìm dịch vụ trên đường đi.</strong><br/> <span style="color:#999999;">VD: khách sạn.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bán kính (m)</span></td></tr>';d[d.length]="<tr><td><input id=shortestpathsearchnearby autocomplete='off' onkeydown=\"return SearchNearByPolylineEnter(event,"+a+', this)" type=text style="font-size:11px; width:155px; height:16px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><input id=shortestpathsearchnearby_radius autocomplete="off" value="100"  onkeydown="return SearchNearByPolylineEnter(event,'+a+')" type=text style="font-size:11px; width:50px; height:16px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><button align=absbottom style="cursor:pointer; margin-bottom:7px; margin-top:7px;width:50px;" onclick=\'SearchNearByPolylineExt('+a+",null,null,1,null)'>Tìm</button></td>"}else{d[d.length]=' Find business on road.</strong><br/> <span style="color:#999999;">Eg: Hotel.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Radius (m)</span></td></tr>';d[d.length]="<tr><td><input id=shortestpathsearchnearby autocomplete='off' onkeydown=\"return SearchNearByPolylineEnter(event,"+a+', this)" type=text style="font-size:11px; width:155px; height:16px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><input id=shortestpathsearchnearby_radius autocomplete="off" value="100"  onkeydown="return SearchNearByPolylineEnter(event,'+a+')" type=text style="font-size:11px; width:50px; height:16px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><button align=absbottom style="cursor:pointer; margin-bottom:7px; margin-top:7px;width:50px;" onclick=\'SearchNearByPolylineExt('+a+",null,null,1,null)'>Find</button></td>"
}d[d.length]=" </tr></table>";if(a>=0){var e=PathPolylineArray[a][0].getVertex(0);currentStep=b;map.openInfoWindow(e,d.join(""));setTimeout(function(){if(document.getElementById("shortestpathsearchnearby")!=null){document.getElementById("shortestpathsearchnearby").focus()}},500)}}var isFindReverse=false;function FindReverseDirection(){if(PlaceToFindPathArray.length!=2){return}isFindReverse=true;var g=document.getElementById("direction0");var d=g.childNodes[0].rows[0].cells[1].childNodes[0].value;g=document.getElementById("direction1");var c=g.childNodes[0].rows[0].cells[1].childNodes[0].value;var f=PlaceToFindPathArray[0][0].getLatLng();var e=PlaceToFindPathArray[1][0].getLatLng();ClearPathResult();AddPlaceFromFind(e,c);AddPlaceToFind(f,d)}function GetTotalDistance(){var c=(nLanguage==0)?"Tổng chiều dài: ":"Total length: ";document.getElementById("FindPathStatus").innerHTML="";var a=0;for(var d=0;d<PlaceToFindPathArray.length-1;d++){var b=document.getElementById("guide"+d).innerHTML;var e=/(Chiều dài:|Length:)(.*?)m/g;b=b.match(e)[0];if(nLanguage==0){b=b.substring(b.indexOf("Chiều dài: ")+11,b.indexOf("m"))}else{b=b.substring(b.indexOf("Length: ")+8,b.indexOf("m"))}if(b.indexOf("k")>-1){a+=parseFloat(b.substring(0,b.length-1))*1000}else{a+=parseFloat(b.substring(0,b.length-1))}}var f="";if(a>1000){f=parseFloat(parseInt(a)/1000).toString()+" km"}else{f=parseFloat(a).toString()+" m"}if(a!=0){document.getElementById("FindPathStatus").innerHTML="<b><span style='color:#0066CC;margin-right:5px;'>"+c+f+"</span></b>"}else{document.getElementById("FindPathStatus").innerHTML=""}}function clearArrows(){if(arrArrows.length>0){for(i=0;i<arrArrows.length;i++){map.removeOverlay(arrArrows[i])}arrArrows=new Array()}}function floatElement(c,d,b,a){if(b==null){b=0}if(a==null){a=0}var e=document.getElementById(c);function f(h){var g=document.getElementById(h);g.setPos=function(j,k){this.style.left=j+"px";this.style.top=k+"px"};g.x=b;g.y=a;return g}window.letFloat=function(){var g=e.scrollTop;ftlObj.y+=parseInt(parseInt(g+a-ftlObj.y)/8);ftlObj.setPos(ftlObj.x,ftlObj.y);setTimeout("letFloat()",10)};ftlObj=f(d);letFloat()}var Global={NormalSearchStatus:'Tìm địa chỉ, dịch vụ, sản phẩm và số điện thoại. <a href="Help/index.html" style="cursor: pointer;">Xem thêm</a>',ProductSearchStatus:'Vd:         <a id="cafe,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Cafe</a>,         <a id="qa,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Quần áo trẻ em</a>,         <a id="ga,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Cơm gà</a>,         <a id="ht,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Hủ tiếu</a>,         <a id="pi,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Pizza</a>,         v.v...',NormalSearchStatusE:'Find addresses, businesses, products and phones. <a href="Help/index.html" style="cursor: pointer;">Learn more</a>',ProductSearchStatusE:'Ex:         <a id="cafe,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Cafe</a>,         <a id="qa,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Quần áo trẻ em</a>,         <a id="ga,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Cơm gà</a>,         <a id="ht,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Hủ tiếu</a>,         <a id="pi,1" onclick="MapExampleClick(this.id)" style="cursor: pointer;">Pizza</a>,         v.v...',GetDataUpdating:function(a,b){return"<p>Dữ liệu đang cập nhật.</p>"},DataUpdating:'<p>Dữ liệu đang cập nhật.</p><p>Nếu bạn muốn cập nhật thông tin cho vị trí này, bạn có thể liên hệ với chúng tôi bằng những hình thức sau:</p>					<ul>					  <li>Thông qua trang góp ý: <a href="vbdfeedback.aspx">Bấm vào đây</a></li><br/>					  <li>Hổ trợ trực tuyến: <a href="ymsgr:sendIM?hotro_vietbando" class="nav2"><img border="0" src="http://opi.yahoo.com/online?u=hotro_vietbando&m=g&t=1"/></a></li>					</ul>',GetResultText:function(j,k,b,g,e,l,a,m,d,f){var h="";var c="Tọa độ:";if(nLanguage==1){c="Coordinate:"}if(e>0){if(l){h='<tr><td height="20px" align="left" valign="middle" style="font-size:11px;">'+c+" <b>"+j.replace("|","")+"</b></td></tr>"}else{if(a){h=Global.GetFoundText("<b>"+j+"</b>","địa chỉ","address",m,d,e)}else{if(b!=""&&k!=""){h=Global.GetFoundText("<b>"+k+"</b> ở <b>"+b+"</b>","","",m,d,e)}else{if(b!=""&&k==""){h=Global.GetFoundText(b,"","",m,d,e)}else{h=Global.GetFoundText(k,"","",m,d,e)}}}}}else{if(l){h=Global.GetNotFoundText(j,"tọa độ","coordinate",g,f)}else{if(a){h=Global.GetNotFoundText("<b>"+j+"</b>","địa chỉ","address",g,f)}else{if(k!=""&&b!=""){h=Global.GetNotFoundText("<b>"+k+"</b> ở <b>"+b+"</b>","","",g,f)}if(k==""){h=Global.GetNotFoundText(b,"","",g,f)}if(b==""){h=Global.GetNotFoundText(k,"","",g,f)}}}}return h},GetNotFoundText:function(b,c,e,d,a){if(nLanguage==0){return'<div style="padding:0px 10px 0px 10px;">					    Không tìm thấy '+c+' <p style="font-size:14px;margin:5px">'+b.replace(/[|]/g,"")+"</p>"+((d!="")?'<p><span style="color:#FF0000; font-size:12px;">Có phải bạn muốn tìm: </span><span style="color:#006699"><a style="text-decoration:underline; cursor:pointer; font-size:12px;" id="dym,0,'+a+'" onclick="MapExampleClick(this.id)">'+d+"</a></span>?</p>":"")+"					    <p>Đề xuất:</p>					    <ul>					      <li>Xin bạn chắc chắn đã viết đúng chính tả.</li>					      <li>Hãy chắc bạn đã chọn đúng vùng cần tìm.					      <br/>thử từ khóa của bạn ở toàn <a onclick=\"TreeBinding.TreeClick(event,0,'Việt Nam','VN')\">Việt Nam</a></li>					      <li>Nếu bạn viết tắt, hãy thử không viết tắt.</li>					      <li>Hãy thử dùng các từ khóa khác có nghĩa tương tự.</li>					    </ul>				    </div>"}else{return'<div style="padding:0px 10px 0px 10px;">				    We couldn\'t found '+e+' <p style="font-size:14px;margin:5px">'+b.replace(/[|]/g,"").replace(/ở gần/g,"near").replace(/ở/g,"in").replace("trong phạm vi","within")+"</p>"+((d!="")?'<p><span style="color:#FF0000; font-size:12px;">Did you mean: </span><span style="color:#006699"><a style="text-decoration:underline; cursor:pointer; font-size:12px;" id="dym,0,'+a+'" onclick="MapExampleClick(this.id)">'+d+"</a></span>?</p>":"")+"				    <p>Suggestion:</p>				    <ul>				      <li>Make sure all keywords are spelled correctly.</li>				      <li>Make sure that you chose the correct region.					      <br/>try your keyword at <a onclick=\"TreeBinding.TreeClick(event,0,'Việt Nam','VN')\">Việt Nam</a></li>				      <li>Please do not use abbreviation.</li>				      <li>Please try another search with synonym keywords.</li>				    </ul>			    </div>"}},GetFoundText:function(j,d,h,f,g,e){if(d==null){d=""}if(h==null){h=""}var c="cho "+d;var a="Kết quả từ";var b="Kết quả tìm kiếm";var k="trong số";j=j.replace(/^\s+|\s+$/g,"");if(nLanguage==1){a="Results from";b="Results";k="of about";c="for "+h;j=j.replace(/ở gần/g,"near").replace(/ở/g,"in").replace("trong phạm vi","within")}if(e>1){return'<tr><td height="20px" align="left" valign="middle" style="font-size:11px;padding:0px 10px 0px 10px">'+a+" <b>"+f+"-"+g+"</b> "+k+" <b>"+e+"</b> "+c+'                    <p style="font-size:14px;margin:5px">'+j.replace("|","")+"</p></td></tr>"}else{return'<tr><td height="20px" align="left" valign="middle" style="font-size:11px;padding:0px 10px 0px 10px">'+b+" "+c+'                    <p style="font-size:14px;margin:5px">'+j.replace("|","")+"</p></td></tr>"}},GetComplainLink:function(a){if(document.getElementById("searchoptions")==null){return""}if(nLanguage==0){return'<div style="padding:0px 10px 0px 10px;">		            <div id="fblnk"><p><b>Bạn không hài lòng về kết quả tìm kiếm?</b></p>                        <ul>                          <li><a onclick="Global.ShowFeedBackForm()">Gửi ý kiến của bạn.</a></li>                          <li><a onclick="loadAddPlaceFunc()">Thêm vị trí của bạn vào bản đồ.</a></li>                        </ul></div>				    <div id="fbForm" class="jForm" style="display:none">					    <fieldset>						    <legend>Gửi phê bình</legend>						    <p id="fbsuggest" style="clear:both;color:red">*Bạn vui lòng gõ tiếng việt có dấu</p>						    <div>							    <label for="fbName">Họ tên:</label>							    <input id="fbName" name="fbName" type="text" style="width:200px" />						    </div>						    <div>							    <label for="fbEmail">Email:</label>							    <input id="fbEmail" name="fbEmail" type="text" style="width:200px" />						    </div>						    Ý kiến của bạn:<br />						    <textarea rows="3" cols="40" id="fbContent" name="fbContent"></textarea>					    </fieldset>					    <div class="submit" style="text-align:left;">						    <p id="fberror" style="clear:both;color:red"></p>						    <input type="button" onclick="Global.SendFeedBack(\''+a+'\')" value="Gửi phê bình"/>						    <input type="button" onclick="Global.HideFeedBackForm()" value="Hủy"/>					    </div>				    </div>				</div>'
}else{return'<div style="padding:0px 10px 0px 10px;">		            <div id="fblnk"><p><b>Can\'t find what you are looking for?</b></p>                        <ul>                          <li><a onclick="Global.ShowFeedBackForm()">Send your feedback.</a></li>                          <li><a onclick="loadAddPlaceFunc()">Add your place to the map.</a></li>                        </ul></div>				    <div id="fbForm" class="jForm" style="display:none">					    <fieldset>						    <legend>Feedback</legend>						    <div>							    <label for="fbName">Name: </label>							    <input id="fbName" name="fbName" type="text" style="width:200px" />						    </div>						    <div>							    <label for="fbEmail">Email:</label>							    <input id="fbEmail" name="fbEmail" type="text" style="width:200px" />						    </div>						    Your opinion:<br />						    <textarea rows="3" cols="40" id="fbContent" name="fbContent"></textarea>					    </fieldset>					    <div class="submit" style="text-align:left;">						    <p id="fberror" style="clear:both;color:red"></p>						    <input type="button" onclick="Global.SendFeedBack(\''+a+'\')" value="Send"/>						    <input type="button" onclick="Global.HideFeedBackForm()" value="Cancel"/>					    </div>				    </div>				</div>'}},ShowFeedBackForm:function(){document.getElementById("fbForm").style.display="";document.getElementById("fblnk").style.display="none"},HideFeedBackForm:function(){document.getElementById("fbForm").style.display="none";document.getElementById("fblnk").style.display="";document.getElementById("fbName").value="";document.getElementById("fbEmail").value="";document.getElementById("fberror").innerHTML=""},SendFeedBack:function(k){var h="Vui lòng điền đầy đủ thông tin";var g="Email của bạn không chính xác";var f="Ý kiến của bạn phải trên 30 ký tự";var j="<b>Cảm ơn bạn, ý kiến của bạn đã được gửi tới ban quản trị</b>";if(nLanguage==1){h="Please enter required information.";g="Your is email is invalid";f="Your opinion must be more than 30 characters";j="<b>Thank you, your feedback has sent successfully</b>"}var d=document.getElementById("fbName").value;var c=document.getElementById("fbEmail").value;var a=document.getElementById("fbContent").value;var b=document.getElementById("fberror");var e=document.getElementById("fblnk");if(d.length==0||c.length==0||a.length==0){b.innerHTML=h;return}if(!Global.CheckEmail(c)){b.innerHTML=g;return}if(a.length<30){b.innerHTML=f;return}var l=AJLocationSearch.SendFeedBack(d,c,"Từ khóa search: "+k+" Ý kiến: "+a).value;if(l){Global.HideFeedBackForm();document.getElementById("fblnk").innerHTML=j}},CheckEmail:function(a){var b=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!b.test(a)){return false}else{return true}},pHPad:30,pVPad:120,pMinW:595,pMinH:250,pMaxW:595,pMaxH:5000,TreeRatio:0.33,LockRequest:false,BuildPaging:function(f,j,l,k,h,g){var c="";if(j>1||l>PAGE_ROWS){var e="First",a="Last",o="Previous",m="Next";if(nLanguage==0){e="Đầu";a="Cuối";o="Trước";m="Sau"}c+='<table style="margin-bottom:20px;margin-top:10px" border="0" align="center" cellpadding="0" cellspacing="0">';c+="<tr>";if(f>1){c+='<td align="center" valign="middle" class="paging" style="cursor:pointer;" onmouseover="ChangeBorderColor(this,\'#66cc00\')" onmouseout="ChangeBorderColor(this,\'#cccccc\')" onclick="'+h(1,g)+'" >'+e+"</td>";c+='<td class="paging_space"></td>';c+='<td align="center" valign="middle" style="width:14px; height:14px;"><img src="'+RelativeDir+'images/backpage.gif" onmouseover="ChangeImageSrc(this,\''+RelativeDir+"images/backpage_over.gif')\" onmouseout=\"ChangeImageSrc(this,'"+RelativeDir+'images/backpage.gif\')" onclick="'+h((f-1),g)+'" style="cursor:pointer;" alt="'+o+'" /></td>';c+='<td class="paging_space"></td>'}var b;var n=0;for(var d=0;d<k;d++){b=f-DELTA_FROM_CENTER+d;if(b<=0){n=DELTA_FROM_CENTER+1-f}if(b>j){break}b+=n;if(b==f){c+='<td align="center" valign="middle" class="paging_active" ><b>'+b+"</b></td>"}else{c+='<td align="center" valign="middle" class="paging" style="cursor:pointer;" onmouseover="ChangeBorderColor(this,\'#66cc00\')" onmouseout="ChangeBorderColor(this,\'#cccccc\')" onclick="'+h(b,g)+'" >'+b+"</td>"}c+='<td class="paging_space"></td>'}if(f<j){c+='<td align="center" valign="middle" style="width:14px; height:14px;"><img src="'+RelativeDir+'images/nextpage.gif" onmouseover="ChangeImageSrc(this,\''+RelativeDir+"images/nextpage_over.gif')\" onmouseout=\"ChangeImageSrc(this,'"+RelativeDir+'images/nextpage.gif\')" onclick="'+h((f+1),g)+'" style="cursor:pointer;" alt="'+m+'" /></td>';c+='<td class="paging_space"></td>';c+='<td align="center" valign="middle" class="paging" style="cursor:pointer;" onmouseover="ChangeBorderColor(this,\'#66cc00\')" onmouseout="ChangeBorderColor(this,\'#cccccc\')" onclick="'+h(j,g)+'" >'+a+"</td>"}c+="</tr>";c+="</table>"}return c},PagingFindPlace:function(b,a){if(a!=null&&a.length>0){return BuildFunction("FindPlace",a,b,0)}else{return"FindPlace("+b+")"}},PagingSearchPlaceForPath:function(b,a){return BuildFunction("SearchPlace",a,b,2)},PagingSearchNearByPolylineExt:function(b,a){return BuildFunction("SearchNearByPolylineExt",a,b,3)},PagingSearchNearByPointExt:function(b,a){return BuildFunction("SearchNearByPointExt",a,b,6)},PagingFindProcductInsideStore:function(b,a){return"ContentLocation.SearchInsideStore("+b+")"},PagingProductMatch:function(b,a){return"ContentLocation.GetDetailPage("+a[0]+","+b+")"},SearchProduct:function(b,a){return"ContentLocation.GetProductInsideStore("+b+")"},TrimSpace:function(a){if(a==null){return""}a=a.replace(/\s+/g," ");a=a.replace(/^\s+|\s+$/g,"");return a},RemoveSpace:function(a){if(a==null){return""}a=a.replace(/\s/g,"");return a}};function BuildFunction(e,d,c,f){var b=e+"(";for(var a=0;a<d.length;a++){if(f!=null&&a==f){b+=c+","}if(typeof(d[a])=="string"){b+="'"+d[a].replace(/'/g,"\\'").replace(/"/g,"&quot;")+"',"}else{b+=d[a]+","}}return b.substr(0,b.length-1)+")"}function SafeSetInnerHtml(c,a){var b=document.getElementById(c);if(b!=null){b.innerHTML=a}}function SafeAppendInnerHtml(c,a){var b=document.getElementById(c);if(b!=null){b.innerHTML+=a}}function installSearchEngine(){if(window.external&&("AddSearchProvider" in window.external)){var a=window.location.href;a=a.substring(0,a.lastIndexOf("/")+1);window.external.AddSearchProvider(a+"vietbando.xml")}else{if(window.sidebar&&("addSearchEngine" in window.sidebar)){}else{alert("No search engine support")}}}function getIFrameDocument(){var a=document.getElementById("historyFrame");var b=a.contentDocument;if(b==undefined){b=a.contentWindow.document}return b}function sessionExists(){var a=getIFrameDocument();try{if(a.body.innerHTML==""){return false}else{return true}}catch(b){return true}}function saveState(){var b=Global.TrimSpace(RemoveHTMLTag(document.getElementById("mapinput").value.replace(/[']/g,"\\'").replace(/,/g,", ")));if(isPhoneNumber(b)){b=Global.RemoveSpace(b.replace(/[ .()]+/g,""))}var d=document.getElementById("iframestate");var c=d.firstChild;while(c&&c.nodeType!=8){c=c.nextSibling}var e=c.nodeValue;e=e.replace(/\%SearchType\%/g,GetSearchType());e=e.replace(/\%SearchKey\%/g,b);var a=e;var f=getIFrameDocument();f.open();f.write(a);f.close()}function loadState(b,c){var a=top.document.getElementById("mapinput");if(b==""){top.document.title="Vietbando";top.document.getElementById("mapinput").value="";top.ClearSearchResult();top.ControlEvent.OnChangeSearchOption()}else{top.document.title=b+" - Vietbando";top.isFirstSearch=true;top.TypeSearch=c;top.SetSearchType(c);top.document.getElementById("mapinput").value=unescape(b);top.FindPlace(1)}}function MessageBox(a){var b=document.createElement("div");b.id="divOverlay";b.style.position="absolute";b.style.zIndex=100;b.style.left="0px";b.style.top="0px";b.style.width=myWidth+"px";b.style.height=myHeight+"px";b.style.backgroundColor="#000000";b.style.filter="alpha(opacity = 0)";b.style.opacity=0;b.innerHTML=a;document.body.appendChild(b);$("#divOverlay").animate({opacity:"0.8"},500)}var Utf8={encode:function(b){b=b.replace(/\r\n/g,"\n");
var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};function includeJavascript(a){var b=document.getElementsByTagName("head").item(0);var c=document.createElement("script");c.setAttribute("language","javascript");c.setAttribute("type","text/javascript");c.setAttribute("src",a);b.appendChild(c);return false}var arrListFavour=new Array();function LoadMarkedLocation(){var c=getCookie("VBDLocFavourite");if(c==null){return}arrListFavour=new Array();c=c.split("Name:");for(var a=0;a<c.length;a++){if(c[a]==""){continue}var b=c[a].split("Guid:");arrListFavour[arrListFavour.length]=new Array(b[0],b[1])}}function AddMarkedLocation(a){arrListFavour[arrListFavour.length]=new Array(RemoveHTMLTag(a.Name),a.GUID);var c="";for(var b=0;b<arrListFavour.length;b++){if(arrListFavour[b][0]!=""){c+="Name:"+arrListFavour[b][0]+"Guid:"+arrListFavour[b][1]}}setCookie("VBDLocFavourite",c,5000,"","","");ShowMarkedLocation()}function ShowMarkedLocation(){var a=document.getElementById("MarkedLocation");if(a==null){return}a.innerHTML=MarkedLocationHTML()}function MarkedLocationHTML(){LoadMarkedLocation();var a="";for(var b=0;b<arrListFavour.length;b++){if(arrListFavour[b][0]==""){continue}a+='<a onclick="DeleteMarkedLocation('+b+')"><img src="images/delete3.gif" align="absmiddle" title="Xóa vị trí này"/></a> <a title="'+arrListFavour[b][0]+'" onclick="ShowLocation(\''+arrListFavour[b][1]+"')\">"+GetShortText(arrListFavour[b][0],35)+"</a><br/>"}if(a!=""){a='<div class="Acor"><span class="Title">Vị trí đã lưu</span>                    <div class="Content">'+a+"</div></div>"}return a}function GetShortText(c,a){if(c==null||c==""){return""}if(c.length<a){return c}var b=c.substring(a).indexOf(" ");if(b<0){return c}return c.substring(0,a+b)+"..."}function DeleteMarkedLocation(a){arrListFavour[a][0]="";var c="";for(var b=0;b<arrListFavour.length;b++){if(arrListFavour[b][0]!=""){c+="Name:"+arrListFavour[b][0]+"Guid:"+arrListFavour[b][1]}}setCookie("VBDLocFavourite",c,5000,"","","");ShowMarkedLocation()}function ShowLocation(a){showBusyDiv();AJLocationSearch.GetInfo(a,LocationBinding)}function LocationBinding(a){isSearching=false;document.getElementById("clearSearchResultText").style.display="";hideBusyDiv();dsResultData=a.value;var c=new Array();if((null!=dsResultData)&&("object"==typeof(dsResultData))){var b=0;CombineAddress(dsResultData.Tables[0].Rows[b]);KeySearch=dsResultData.Tables[0].Rows[b].Name;if(KeySearch==""){KeySearch=dsResultData.Tables[0].Rows[b].Address}ClearSearchMapResult();if(plHighlight!=null){map.removeOverlay(plHighlight);plHighlight=null}HideSelectPlaceBox();isFirstSearch=false;c[c.length]='<table id=TablePlace width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto;">';c[c.length]=Global.GetResultText("<b>"+KeySearch+"</b>","<b>"+KeySearch+"</b>","","",1,false,false,1,1);c[c.length]=BindResult(dsResultData.Tables[0]);c[c.length]="</table>";c[c.length]=Global.GetComplainLink(KeySearch)}else{c[c.length]="</table>";c[c.length]=Global.GetNotFoundText("<b>"+RemoveHTMLTag(document.getElementById("mapinput").value)+"</b>","","","");c[c.length]=Global.GetComplainLink(KeySearch)}ChangeFunctionType(GLOBAL_SEARCH_FUNCTION);document.getElementById("searchresult_div").innerHTML=c.join("");document.getElementById("searchresult_div").scrollTop=0;map.fitMultiOverlays(arrSearchMapResult)}function CombineAddress(a){if(a.Address!=null){return a.Address}var g="";var c=a.Number;var f=a.Street;var d=a.Ward;var e=a.District;var b=a.Province;g+=(c!="")?c+" ":"";g+=(f!="")?f+", ":"";g+=(d!="")?d+", ":"";g+=(e!="")?e+", ":"";g+=b;a.Address=g;return g}var randomLocation;function RandomLocationHTML(){if(randomLocation==null){randomLocation=AJLocationSearch.GetRandomLocation().value}var b="";if((null!=randomLocation)&&("object"==typeof(randomLocation))){for(var c=0;c<randomLocation.Tables[0].Rows.length;c++){var a=randomLocation.Tables[0].Rows[c].Name;b+='<a title="'+a+'" onclick="ShowLocation(\''+randomLocation.Tables[0].Rows[c].GUID+"')\">"+((a.length>42)?(a.substring(0,42)+"..."):a)+"</a><br/>"}if(b!=""){b='<div class="Acor"><span class="Title">Vị trí ngẫu nhiên</span>                        <div class="Content">'+b+"</div></div>"}}return b}function setImageDelay(b,a){var c=document.getElementById(b);if(c==null){setTimeout(function(){setImageDelay(b,a)},200);return}c.src=a}function setCookie(c,e,a,h,d,g){var b=new Date();b.setTime(b.getTime());if(a){a=a*1000*60*60*24}var f=new Date(b.getTime()+(a));document.cookie=c+"="+escape(e)+((a)?";expires="+f.toGMTString():"")+((h)?";path="+h:"")+((d)?";domain="+d:"")+((g)?";secure":"")}function getCookie(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if((!d)&&(c!=document.cookie.substring(0,c.length))){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}function DeleteCookie(a,c,b){if(getCookie(a)){document.cookie=a+"="+((c)?";path="+c:"")+((b)?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}var busyDivTmr=null;function showBusyDiv(f,g){if(g==null||document.getElementById(g)==null){g="leftpanel"}if(f==null||f==""){f='Đang tải dữ liệu, vui lòng chờ trong giây lát.<br/>Nếu chờ quá lâu, bạn hãy bấm <span style="color:black"><b>Ctrl+F5</b></span>.'}var b=document.getElementById(g);var j=document.getElementById("divBusyLP");if(j==null){j=document.createElement("div");j.id="divBusyLP";j.style.position="absolute";j.style.zIndex=5;j.style.left="0px";j.style.top="0px";j.style.width=b.offsetWidth+"px";j.style.height=b.offsetHeight+"px";j.style.backgroundColor="#ffffff";j.style.filter="alpha(opacity = 80)";j.style.opacity=0.8;j.innerHTML="<img width='96px' height='16px' id='loadingImg' src='images/loading.gif' /><a class='a1' id='loadingText' style='font-family:Verdana; font-size:12px; font-weight:bold; color:grey;'>"+f+"</a>";b.appendChild(j);var e=document.getElementById("loadingImg");var k=(parseInt(b.offsetWidth)-parseInt(e.offsetWidth))/2;var h=(parseInt(b.offsetHeight)-parseInt(e.offsetHeight))/2-50;e.style.position="absolute";e.style.left=k+"px";e.style.top=h+"px";var c=document.getElementById("loadingText");var d=(parseInt(b.offsetWidth)-parseInt(c.offsetWidth))/2;var a=(parseInt(b.offsetHeight)-parseInt(c.offsetHeight))/2-10;c.style.position="absolute";c.style.left=d+"px";c.style.top=a+"px"}}function hideBusyDiv(f,e){if(e==null||document.getElementById(e)==null){e="leftpanel"}if(f!=undefined&&f!=""){var d=document.getElementById(e);var c=document.getElementById("loadingText");c.innerText=f;var b=(parseInt(d.offsetWidth)-parseInt(c.offsetWidth))/2;var a=(parseInt(d.offsetHeight)-parseInt(c.offsetHeight))/2-10;c.style.left=b+"px";c.style.top=a+"px"}if(busyDivTmr!=null){clearTimeout(busyDivTmr)}busyDivTmr=setTimeout(removeBusyDiv,100)}function removeBusyDiv(){clearTimeout(busyDivTmr);var a=document.getElementById("leftpanel");var b=document.getElementById("divBusyLP");if(b!=null){a.removeChild(b)}}var myWidth=0,myHeight=0;function calculateWindowSize(){if(typeof(window.innerWidth)=="number"){myWidth=window.innerWidth;myHeight=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;
myHeight=document.body.clientHeight}}}}var strFollowMouse="";function showTip(a,b){if(b==undefined){b=false}if(b){strFollowMouse=a}Tip(a,BGCOLOR,"#FEFFBB",BORDERCOLOR,"#86C327",OPACITY,90,SHADOW,true,JUMPHORZ,true,JUMPHORZ,true,JUMPVERT,true)}function closeTip(a){if(a==undefined){a=false}UnTip();if(a){strFollowMouse=""}else{if(strFollowMouse!=""){Tip(strFollowMouse,BGCOLOR,"#FEFFBB",BORDERCOLOR,"#86C327",OPACITY,90,SHADOW,true,JUMPHORZ,true,JUMPHORZ,true,JUMPVERT,true)}}}function showMapTip(){var k=document.getElementById("container_btZoomIn");var n=document.getElementById("container_btZoomOut");var m=document.getElementById("container_btFit");var l=document.getElementById("container_btLeft");var g=document.getElementById("container_btRight");var b=document.getElementById("container_btTop");var f=document.getElementById("container_btBottom");var d=document.getElementById("container_rulerBar");var e=document.getElementById("container_rulerDiv");var h=document.getElementById("AddPlace");var c=document.getElementById("PrintMap");var j=document.getElementById("SendMap");var o=document.getElementById("lang_en");var a=document.getElementById("lang_vn");if(nLanguage==0){if(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap){k.title="Phóng to bản đồ";n.title="Thu nhỏ bản đồ";m.title="Xem tất cả đối tượng trong khung màn hình";l.title="Qua trái";g.title="Qua phải";b.title="Đi lên";f.title="Đi xuống";f.title="Chọn mức bản đồ";e.title="Mức hiện tại: "+(map.getLevel()+1)}c.title="In bản đồ";j.title="Gửi bản đồ"}else{if(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap){k.title="Zoom in";k.title="Zoom out";m.title="Fit all object on map for screen";l.title="Pan left";g.title="Pan right";b.title="Pan up";f.title="Pan down";f.title="Select map level";e.title="Current level: "+(map.getLevel()+1)}c.title="Print map";j.title="Send map"}if(o){if(nLanguage==0){o.title="English"}else{o.title="Tiếng Anh"}}if(a){if(nLanguage==0){a.title="Vietnamese"}else{a.title="Tiếng Việt"}}}var GLOBAL_SEARCH_ALL=0;var GLOBAL_SEARCH_BUSINESS=1;var GLOBAL_SEARCH_MAP=2;var GLOBAL_SEARCH_ADDRESS=2;var GLOBAL_SEARCH_FUNCTION=3;var GLOBAL_FINDPATH_FUNCTION=4;var GLOBAL_MYMAP_FUNCTION=5;var GLOBAL_ACTIVE_ZINDEX=2;var GLOBAL_HIDDEN_ZINDEX=1;var map;var cMnu=null;var current_searchtype=0;var current_functype;var MARKER_POI=0;var MARKER_AB=1;var MYMAPOBJ=2;var MMCONTROLOBJ=3;var MMAPCONTROLOBJ=4;var FPMARKEROBJ=5;var FPPOLYLINEOBJ=6;var ADDPLACEOBJ=7;var MARKER_MPOI=8;var BLOCKHOUSEOBJ=9;var mkD=null;var mkP=null;var mkOP=null;var arrow=null;var directionLatLng=null;var directionLevel=null;var onlineSupportShow=false;var SearchWhat="";var SearchWhere="";var CurrentCenter;var ClientID;function changeMapType(a){if(GeneralMap.mapType!=a){window.location=BuildMapLink(a)}}function ChangeBorderColor(b,a){if(b!=null){b.style.borderColor=a}}function ChangeTextColor(b,a){if(b!=null){b.style.color=a}}function ChangeFontWeight(a,b){if(a!=null){a.style.fontWeight=b}}function ChangeImageSrc(a,b){if(a!=null){a.src=b}}function ChangeBgColor(b,a){if(b!=null){b.style.backgroundColor=a}}function ChangeBgImageSrc(a,b){a.style.backgroundImage="url("+b+")"}var firstLoadMymap=false;function ChangeFunctionType(d){var b=document.getElementById("centerpanel");if(b==null){return}if(b.className=="splShrink"){shrinkMap()}document.getElementById("search_function_tab").className="";document.getElementById("search_findpath_tab").className="";document.getElementById("search_mymap_tab").className="";current_functype=d;var e="Clear result",c="Create new map";if(nLanguage==0){e="Xóa kết quả";c="Tạo bản đồ mới"}if(d==GLOBAL_SEARCH_FUNCTION){document.getElementById("search_function_tab").className="current";document.getElementById("searchtabdiv").style.display="";document.getElementById("findpathtabdiv").style.display="none";document.getElementById("mymaptabdiv").style.display="none";if(browserName=="msie"){document.getElementById("clearSearchResultText").innerText=e}else{document.getElementById("clearSearchResultText").firstChild.nodeValue=e}document.getElementById("clearSearchResultText").onclick=ClearSearchResult;for(var a=0;a<arrSearchMapResult.length;a++){arrSearchMapResult[a].show()}}else{if(d==GLOBAL_FINDPATH_FUNCTION){document.getElementById("search_findpath_tab").className="current";document.getElementById("searchtabdiv").style.display="none";document.getElementById("findpathtabdiv").style.display="";document.getElementById("mymaptabdiv").style.display="none";if(browserName=="msie"){document.getElementById("clearPathResultText").innerText=e}else{document.getElementById("clearPathResultText").firstChild.nodeValue=e}document.getElementById("clearPathResultText").onclick=ClearPathResult;LoadDirectionTool();for(var a=PlaceToFindPathArray.length-1;a>=0;a--){RemovePlace_History(a+",0",1,false)}}else{if(d==GLOBAL_MYMAP_FUNCTION){document.getElementById("search_mymap_tab").className="current";document.getElementById("searchtabdiv").style.display="none";document.getElementById("findpathtabdiv").style.display="none";document.getElementById("mymaptabdiv").style.display="";if(browserName=="msie"){document.getElementById("createNewMap").firstChild.nodeValue=c}else{document.getElementById("createNewMap").firstChild.nodeValue=c}document.getElementById("createNewMap").onclick=createNewMap;loadMyMap();resizeMyMapDiv()}}}HideSelectPlaceBox()}function closeContextMenu(){if(cMnu!=null){map.removeControl(cMnu);cMnu=null}}var MapLoaded=false;function StartApp(){if(self!=top){top.location.replace(self.location)}if(MapLoaded){return}ResizeWindow();ClientID=Math.round(Math.random()*(1000000-1))+1+"";MapLoaded=true;document.getElementById("mapinput").value="";var g=window.location.href.split("?");var d=new Array();var s=new Array();if(g.length>1){var t=g[1];var p=t.split("&");for(var u=0;u<p.length;u++){var n=p[u].split("=");d.push(n[0]);s.push(n[1])}}var k=d.length;if(d[d.length-1]=="mt"){GeneralMap.mapType=parseInt(s[s.length-1]);k--}var b=0;var j=new GeneralMap.LatLng(14.102783,109.649506);var c=null;var a=null;var o="";var m="";var w=0;var e=getCookie("myVBDRegionCookie");if(e!=null&&e!=""){var x=e.split(":");j=new GeneralMap.LatLng(x[0],x[1]);b=parseInt(x[2])}for(var u=0;u<k;u++){switch(d[u]){case"l":b=parseInt(s[u]);break;case"kv":var v=s[u].split(",");j=new GeneralMap.LatLng(parseFloat(v[0]),parseFloat(v[1]));break;case"fp":var h=s[u].split(";");var v=h[0].split(",");c=new GeneralMap.LatLng(parseFloat(v[0]),parseFloat(v[1]));if(v.length>3){a=new GeneralMap.LatLng(parseFloat(v[2]),parseFloat(v[3]))}v=h[1].split(",");o=unescape(v[0]);m=unescape(v[1]);var r=parseInt(h[3]);if(r==1){r=true}else{r=false}var l=parseInt(h[2]);document.getElementById("avoidalley").checked=r;document.getElementById("vehicle").value=l;break;case"sk":SearchKey=s[u];SearchKey=unescape(SearchKey);if(browserName=="msie"||browserName=="firefox"){if(/%[a-zA-Z0-9]{2}/g.test(s[u])){SearchKey=Utf8.decode(SearchKey).replace(/[+]/g," ")}else{SearchKey=SearchKey.replace(/[+]/g," ")}}else{SearchKey=Utf8.decode(SearchKey).replace(/[+]/g," ")}document.getElementById("mapinput").value=SearchKey;w=1;break;case"st":current_searchtype=parseInt(s[u]);SetSearchType(current_searchtype);break;case"bh":viewBlockHouse();break;case"mi":if(checkLogin()){bSendMyMap=parseInt(s[u]);loadMyMap()}else{bSendMyMap=true;loadMyMapCoor(parseInt(s[u]))}break}}ContextMenu.prototype=new GeneralMap.Control();MapToolbar.prototype=new GeneralMap.Control();var f=document.getElementById("container");map=new GeneralMap.Map(f);map.addControl(new GeneralMap.LargeMapControl());map.addControl(new GeneralMap.ScaleControl());map.addControl(new GeneralMap.OverviewMapControl());map.addControl(new MapToolbar());map.fitOverlays();infoWindow=map.getInfoWindow();if(GetSearchType()==0){SetSearchType(0)}var y=document.getElementById("direction0");if(y!=null){y.childNodes[0].rows[0].cells[1].childNodes[0].value=""}y=document.getElementById("direction1");if(y!=null){y.childNodes[0].rows[0].cells[1].childNodes[0].value=""}if(c!=null){AddPlaceFromFind(c)
}if(a!=null){AddPlaceToFind(a)}y=document.getElementById("direction0");if(y!=null&&o!=""){y.childNodes[0].rows[0].cells[1].childNodes[0].value=o}y=document.getElementById("direction1");if(y!=null&&m!=""){y.childNodes[0].rows[0].cells[1].childNodes[0].value=m}var q=document.getElementById("hdTab");ChangeFunctionType(parseInt(q.value));GeneralMap.Event.addListener(map,"singlerightclick",function(D,E,z){var C=map.fromContainerPixelToLatLng(D);if(C!=null){if(mkD!=null){map.removeOverlay(mkD);mkD=null}closeContextMenu();var B=(nLanguage==0)?["Tâm bản đồ","Tìm xung quanh","Đo khoảng cách","-","Thu nhỏ","Phóng to","-","Đến đây","Từ đây"]:["Center map here","Search nearby","Measure","-","Zoom out","Zoom in","-","To here","From here"];var A=new Array();A[0]=panToCenter;A[1]=searchNearBy;A[2]=measureDistance;A[4]=zoomOut;A[5]=zoomIn;A[7]=ToHereClick;A[8]=FromHereClick;if(z!=null&&z.vType!=undefined){if(z.type==MYMAPOBJ||z.type==MMCONTROLOBJ||z.type==MMAPCONTROLOBJ){if(!bReadOnly){B[B.length]="-";if(nLanguage==0){B[B.length]="Xóa địa điểm";B[B.length]="Cập nhật địa điểm"}else{B[B.length]="Delete place";B[B.length]="Edit place"}A[10]=function(){closeContextMenu();if(z.type==MYMAPOBJ){deleteMyMapCoor(z.mmIndex)}else{deleteMyMapCoor(z.editObjectIndex)}};A[11]=function(){closeContextMenu();clickedPoint=C;if(z.type==MYMAPOBJ){showMyMapInfoWindow(z.mmIndex,1)}else{showMyMapInfoWindow(z.editObjectIndex,1)}};if(z.type==MMAPCONTROLOBJ){if(nLanguage==0){B[B.length]="Thêm điểm"}else{B[B.length]="Insert point"}A[12]=function(){closeContextMenu();var G=z.getLatLng().copy();arrMyMapCoorObj[z.editObjectIndex].insertPoint(z.addPointIndex,G);if(arrMyMapCoorObj[z.editObjectIndex].actionType!="New"){arrMyMapCoorObj[z.editObjectIndex].actionType="Edit"}enableSaveBtn();clearControlPoint();showControlPoint(arrMyMapCoorObj[z.editObjectIndex])}}else{if(z.type==MMCONTROLOBJ){var F=(arrMyMapCoorObj[z.editObjectIndex].vType()=="VPolyline")?2:4;if(arrMyMapCoorObj[z.editObjectIndex].getVertexCount()>F){if(nLanguage==0){B[B.length]="Xóa điểm"}else{B[B.length]="Delete point"}A[12]=function(){closeContextMenu();arrMyMapCoorObj[z.editObjectIndex].deletePoint(z.editPointIndex);if(arrMyMapCoorObj[z.editObjectIndex].actionType!="New"){arrMyMapCoorObj[z.editObjectIndex].actionType="Edit"}enableSaveBtn();clearControlPoint();showControlPoint(arrMyMapCoorObj[z.editObjectIndex])}}}}}}else{if(z.type==FPMARKEROBJ){B[B.length]="-";if(nLanguage==0){B[B.length]="Xóa điểm này"}else{B[B.length]="Delete this point"}A[10]=function(){closeContextMenu();RemovePlace(z.sid)}}}}if(z!=null&&z.vType!=undefined&&z.vType()=="VMarker"){cMnu=new ContextMenu(z.getLatLng(),B,A)}else{cMnu=new ContextMenu(C,B,A)}map.addControl(cMnu)}});GeneralMap.Event.addListener(map,"movestart",function(){closeContextMenu();enableSaveBtn();DisplayPopupScroll("hidden")});GeneralMap.Event.addListener(map,"zoomstart",function(){closeContextMenu();enableSaveBtn()});GeneralMap.Event.addListener(map,"click",function(D,M){if(bIsPlaceAdding&&M!=null){ShowAddPlacePopup(M);return}if(selTbrButton!=null&&selTbrButton.id!="btnMove"&&M!=null){if(selTbrButton.id=="btnAddPoint"||selTbrButton.id=="btnAddText"){closeTip(true);var C=document.getElementById("MyMapCoorList");var K=document.createElement("TABLE");K.setAttribute("width","95%");K.setAttribute("border",0);K.setAttribute("cellPadding",0);K.setAttribute("cellSpacing",0);K.style.marginTop="5px";if(browserName=="msie"){K.style.marginBottom="5px";K.style.marginLeft="5px"}K.style.cursor="pointer";K.setAttribute("id","MyMapCoorList_"+nMyMapCoorObj);K.onclick=function(){clickedPoint=null;showMyMapInfoWindow(this.id.substring(this.id.indexOf("_")+1,this.id.length),0)};K.onmouseover=function(){changeCoorTextStyle(this.id.substring(this.id.indexOf("_")+1,this.id.length))};K.onmouseout=function(){changeCoorTextStyle(this.id.substring(this.id.indexOf("_")+1,this.id.length))};var G=document.createElement("TBODY");var L=document.createElement("TR");var I=document.createElement("TD");I.setAttribute("width","13%");I.setAttribute("rowspan",2);I.setAttribute("align","center");I.setAttribute("valign","middle");var F="";if(selTbrButton.id=="btnAddPoint"){F="<img id='MyMapCoorListImg_"+nMyMapCoorObj+"' src='images/MyMap_icon/point-1.gif' width='32px' height='32px' />"}else{if(selTbrButton.id=="btnAddText"){F+="<img src='images/icon_text.gif' />"}}I.innerHTML=F;L.appendChild(I);I=document.createElement("TD");I.setAttribute("width","87%");I.setAttribute("height","20px");I.setAttribute("align","left");I.setAttribute("valign","middle");F="<span id='MyMapCoorListTitle_"+nMyMapCoorObj+"' style='color:#0066cc; font-weight:bold;' >";if(nLanguage==0){F+="Chưa đặt tên</span><br /><span id='MyMapCoorListDesc_"+nMyMapCoorObj+"' >"}else{F+="Noname</span><br /><span id='MyMapCoorListDesc_"+nMyMapCoorObj+"' >"}F+="&nbsp;&nbsp;&nbsp;";F+="</span>";I.innerHTML=F;L.appendChild(I);G.appendChild(L);K.appendChild(G);C.appendChild(K)}if(selTbrButton.id=="btnAddPoint"){selectToolbarBtn(document.getElementById("btnMove"));var E=new GeneralMap.Marker(M,new GeneralMap.Icon("images/mymap_icon/point-1.gif",new GeneralMap.Size(32,32)));E.type=MYMAPOBJ;E.mmIndex=nMyMapCoorObj;E.actionType="New";map.addOverlay(E);arrMyMapCoorObj[nMyMapCoorObj]=E;nMyMapCoorObj++;E.enableDragging();var z=new Object();z.MyMapCoorID="";z.MyMapID="";if(nLanguage==0){z.ObjectTitle="Chưa đặt tên"}else{z.ObjectTitle="No name"}z.ObjectDesc="";z.Coor="POINT("+M.lng()+" "+M.lat()+")";z.Style=";;;;point-1;";dsMyMapCoor.Tables[0].Rows[dsMyMapCoor.Tables[0].Rows.length]=z;bCreateNewMMObj=true;showMyMapInfoWindow(E.mmIndex,0)}else{if(selTbrButton.id=="btnAddText"){selectToolbarBtn(document.getElementById("btnMove"));var J=new GeneralMap.Text(M,"vietbando");J.type=MYMAPOBJ;J.mmIndex=nMyMapCoorObj;J.actionType="New";map.addOverlay(J);arrMyMapCoorObj[nMyMapCoorObj]=J;nMyMapCoorObj++;J.enableDragging();var z=new Object();z.MyMapCoorID="";z.MyMapID="";if(nLanguage==0){z.ObjectTitle="Chưa đặt tên"}else{z.ObjectTitle="No name"}z.ObjectDesc="";z.Coor="POINT("+M.lng()+" "+M.lat()+")";z.Style="normal;#ff0000;20;Arial;;vietbando";dsMyMapCoor.Tables[0].Rows[dsMyMapCoor.Tables[0].Rows.length]=z;bCreateNewMMObj=true;showMyMapInfoWindow(J.mmIndex,0)}else{if(selTbrButton.id=="btnAddPolyline"){closeTip(true);if(nLanguage==0){showTip("Nhấp chuột để vẽ tiếp.<br/>Nhấp đôi để kết thúc.",true)}else{showTip("Click to continue drawing.<br/>Double-click to end.",true)}map.disableDoubleClickZoom();bDrawingPolyline=true;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}if(arrDrawingPts==null){arrDrawingPts=new Array()}arrDrawingPts[nDrawingPts]=M.copy();nDrawingPts++;if(nDrawingPts==2){var H=new GeneralMap.Polyline(arrDrawingPts);H.type=MYMAPOBJ;H.mmIndex=nMyMapCoorObj;H.actionType="New";map.addOverlay(H);arrMyMapCoorObj[nMyMapCoorObj]=H;nMyMapCoorObj++;GeneralMap.Event.addListener(H,"mouseover",function(){showControlPoint(H)})}else{if(nDrawingPts>2){arrMyMapCoorObj[nMyMapCoorObj-1].setLatLngs(arrDrawingPts)}}}else{if(selTbrButton.id=="btnAddPolygon"){closeTip(true);if(nLanguage==0){showTip("Nhấp chuột để vẽ tiếp.<br/>Nhấp đôi để kết thúc.",true)}else{showTip("Click to continue drawing.<br/>Double-click to end.",true)}map.disableDoubleClickZoom();bDrawingPolyline=true;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}if(arrDrawingPts==null){arrDrawingPts=new Array()}arrDrawingPts[nDrawingPts]=M.copy();nDrawingPts++;if(nDrawingPts==2){var A=new GeneralMap.Polygon(arrDrawingPts);A.type=MYMAPOBJ;A.mmIndex=nMyMapCoorObj;A.reductionTol=0;A.actionType="New";map.addOverlay(A);arrMyMapCoorObj[nMyMapCoorObj]=A;nMyMapCoorObj++;GeneralMap.Event.addListener(A,"mouseover",function(){showControlPoint(A)})}else{if(nDrawingPts>2){arrMyMapCoorObj[nMyMapCoorObj-1].setLatLngs(arrDrawingPts)}}}}}}return}if(isMeasureDistance&&M!=null){bMeasureLine=true;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}if(arrDrawingPtsML==null){arrDrawingPtsML=new Array()}arrDrawingPtsML[nDrawingPtsML]=M.copy();
nDrawingPtsML++;if(nDrawingPtsML==2){var H=new GeneralMap.Polyline(arrDrawingPtsML,"green");map.addOverlay(H);arrMLObj[nMLObj]=H;nMLObj++}else{if(nDrawingPtsML>2){arrMLObj[nMLObj-1].setLatLngs(arrDrawingPtsML)}}if(arrDrawingPtsML.length>1){CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-2],arrDrawingPtsML[arrDrawingPtsML.length-1])}else{CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-1],M)}if(CurrentDistance>=1000){document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+(CurrentDistance/1000)+" km</FONT>"}else{document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+CurrentDistance+" m</FONT>"}TotalDistance+=CurrentDistance;if(TotalDistance>=1000){document.getElementById("lblTotalDistance").innerHTML='<FONT style="color:#FF3300;font-weight:bold">'+(TotalDistance/1000)+" km</FONT>"}else{document.getElementById("lblTotalDistance").innerHTML='<FONT style="color:#FF3300;font-weight:bold">'+TotalDistance+" m</FONT>"}}else{if(D!=null&&D.vType!=undefined){if(D.vType()=="VMarker"&&D.type==MARKER_POI){var B=D.getPoint();ResultViewDetailCurrentLevel(D.order);return}if(bIsPlaceAdding&&(D.type==ADDPLACEOBJ||D.type==MMCONTROLOBJ||D.type==MMAPCONTROLOBJ)){AP_showInfoWindow();return}if(D.type==BLOCKHOUSEOBJ){showBlockHouseInfoWindow(D.bhIndex)}if(D.type==MYMAPOBJ||D.type==MMCONTROLOBJ||D.type==MMAPCONTROLOBJ){clickedPoint=M;if(D.mmIndex!=undefined){showMyMapInfoWindow(D.mmIndex,1)}else{showMyMapInfoWindow(D.editObjectIndex,1)}}}}});GeneralMap.Event.addListener(map,"mousemove",function(L){TreeBinding.HideMapList();if(selTbrButton!=null&&selTbrButton.id!="btnMove"){if(L!=null&&bDrawingPolyline){if(tempPolyline==null){var E=new GeneralMap.PolylineOptions(false,false,"Dot");tempPolyline=new GeneralMap.Polyline([arrDrawingPts[arrDrawingPts.length-1],L]);tempPolyline.opts=E;map.addOverlay(tempPolyline)}else{tempPolyline.setLatLngs([arrDrawingPts[arrDrawingPts.length-1],L])}}return}if(L!=null&&bMeasureLine){if(tempPolyline==null){var E=new GeneralMap.PolylineOptions(false,false,"Dot");tempPolyline=new GeneralMap.Polyline([arrDrawingPtsML[arrDrawingPtsML.length-1],L],"green");tempPolyline.opts=E;map.addOverlay(tempPolyline)}else{tempPolyline.setLatLngs([arrDrawingPtsML[arrDrawingPtsML.length-1],L])}if(arrDrawingPtsML.length>1){if(arrDrawingPtsML[arrDrawingPtsML.length-1].lat()==L.lat()){CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-2],L)}else{CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-1],L)}}else{CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-1],L)}window.status=CurrentDistance+"aa";if(CurrentDistance>=1000){document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+(CurrentDistance/1000)+" km</FONT>"}else{document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+CurrentDistance+" m</FONT>"}return false}if(mkD!=null&&selectedPoly!=null&&!isFPObjDragging&&!bCPDragging){var B=selectedPoly.split(",");var H=parseInt(B[0]);var z=parseInt(B[1]);var A=PathPolylineArray[H][z].latlngs;var K=new Array();GeneralMap.Util.ClosestPointPolylines(L.lng(),L.lat(),A,K);var M=K[0];var D=map.fromLatLngToDivPixel(L);var C=map.fromLatLngToDivPixel(M);var F=map.fromLatLngToDivPixel(A[0][0]);var G=A.length;var J=A[G-1].length;var I=map.fromLatLngToDivPixel(A[G-1][J-1]);if(GeneralMap.Util.Distance(D.x,D.y,C.x,C.y)>300||GeneralMap.Util.Distance(C.x,C.y,F.x,F.y)<150||GeneralMap.Util.Distance(C.x,C.y,I.x,I.y)<150){map.removeOverlay(mkD);mkD=null;selectedPoly=null}else{mkD.setPoint(M)}}if(iMyMapCoorOver!=-1&&!bCPDragging&&!isFPObjDragging){var A=arrMyMapCoorObj[iMyMapCoorOver].latlngs;var K=new Array();GeneralMap.Util.ClosestPointPolyline(L.lng(),L.lat(),A,K);var M=K[0];var D=map.fromLatLngToDivPixel(L);var C=map.fromLatLngToDivPixel(M);if(GeneralMap.Util.Distance(D.x,D.y,C.x,C.y)>300){clearControlPoint();iMyMapCoorOver=-1}}});GeneralMap.Event.addListener(map,"dblclick",function(C,J){if(nDrawingPts>1&&bDrawingPolyline){closeTip(true);var A=document.getElementById("MyMapCoorList");var H=document.createElement("TABLE");H.setAttribute("width","95%");H.setAttribute("border",0);H.setAttribute("cellPadding",0);H.setAttribute("cellSpacing",0);H.style.marginTop="5px";if(browserName=="msie"){H.style.marginBottom="5px";H.style.marginLeft="5px"}H.style.cursor="pointer";H.setAttribute("id","MyMapCoorList_"+(nMyMapCoorObj-1));H.onclick=function(){clickedPoint=null;showMyMapInfoWindow(this.id.substring(this.id.indexOf("_")+1,this.id.length),0)};H.onmouseover=function(){changeCoorTextStyle(this.id.substring(this.id.indexOf("_")+1,this.id.length))};H.onmouseout=function(){changeCoorTextStyle(this.id.substring(this.id.indexOf("_")+1,this.id.length))};var F=document.createElement("TBODY");var I=document.createElement("TR");var G=document.createElement("TD");G.setAttribute("width","13%");G.setAttribute("rowspan",2);G.setAttribute("align","center");G.setAttribute("valign","middle");var E="";if(selTbrButton.id=="btnAddPolyline"){E+="<img src='images/icon_polyline.gif' />"}else{if(selTbrButton.id=="btnAddPolygon"){E+="<img src='images/icon_polygon.gif' />"}}G.innerHTML=E;I.appendChild(G);G=document.createElement("TD");G.setAttribute("width","87%");G.setAttribute("height","20px");G.setAttribute("align","left");G.setAttribute("valign","middle");E="<span id='MyMapCoorListTitle_"+(nMyMapCoorObj-1)+"' style='color:#0066cc; font-weight:bold;' >";if(nLanguage==0){E+="Chưa đặt tên</span><br /><span id='MyMapCoorListDesc_"+(nMyMapCoorObj-1)+"' >"}else{E+="Noname</span><br /><span id='MyMapCoorListDesc_"+(nMyMapCoorObj-1)+"' >"}E+="&nbsp;&nbsp;&nbsp;";E+="</span>";G.innerHTML=E;I.appendChild(G);F.appendChild(I);H.appendChild(F);A.appendChild(H);bDrawingPolyline=false;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}if(browserName!="msie"&&GeneralMap.mapType==GeneralMap.MapType.VietbandoMap){arrDrawingPts.pop();nDrawingPts--}if(selTbrButton.id=="btnAddPolygon"){arrDrawingPts[nDrawingPts]=arrDrawingPts[0].copy();nDrawingPts++}arrMyMapCoorObj[nMyMapCoorObj-1].setLatLngs(arrDrawingPts);var z=new Object();z.MyMapCoorID="";z.MyMapID="";if(nLanguage==0){z.ObjectTitle="Chưa đặt tên"}else{z.ObjectTitle="Noname"}z.ObjectDesc="";var B="";if(selTbrButton.id=="btnAddPolyline"){B="LINESTRING("}else{if(selTbrButton.id=="btnAddPolygon"){B="POLYGON(("}}for(var D=0;D<nDrawingPts;D++){B+=arrDrawingPts[D].lng()+" "+arrDrawingPts[D].lat();if(D<nDrawingPts-1){B+=","}}if(selTbrButton.id=="btnAddPolyline"){B+=")"}else{if(selTbrButton.id=="btnAddPolygon"){B+="))"}}z.Coor=B;if(selTbrButton.id=="btnAddPolyline"){z.Style="3;#ff0000;#ff0000;0.5;;"}else{if(selTbrButton.id=="btnAddPolygon"){z.Style="3;#ff0000;#00ff00;0.3;0.5;"}}dsMyMapCoor.Tables[0].Rows[dsMyMapCoor.Tables[0].Rows.length]=z;arrDrawingPts=null;nDrawingPts=0;bCreateNewMMObj=true;selectToolbarBtn(document.getElementById("btnMove"));showMyMapInfoWindow(arrMyMapCoorObj[nMyMapCoorObj-1].mmIndex,0)}if(nDrawingPtsML>1&&bMeasureLine){bMeasureLine=false;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}if(browserName!="msie"){arrDrawingPtsML.pop();nDrawingPtsML--}if(arrDrawingPtsML.length>1){CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-2],arrDrawingPtsML[arrDrawingPtsML.length-1])}else{CurrentDistance=CalculateDistance(arrDrawingPtsML[arrDrawingPtsML.length-1],J)}if(CurrentDistance>=1000){document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+(CurrentDistance/1000)+" km</FONT>"}else{document.getElementById("lblCurDistance").innerHTML='<FONT style="color:#FF3300">'+CurrentDistance+" m</FONT>"}arrDrawingPtsML=null;nDrawingPtsML=0;isMeasureDistance=false;return false}});GeneralMap.Event.addListener(map,"infowindowclosebuttonclick",function(){if(bIsPlaceAdding){AP_Cancel()}if(iMyMapCoorSel!=-1){changeCoorBkColor(iMyMapCoorSel,false);iMyMapCoorSel=-1}curTitle="";curDesc="";curIcon="";
curText="";curFontFamily="";curFontWeight="";curFontSize="";curFontColor="";curLineColor="";curLineWidth="";curLineOpacity="";curFillColor="";curFillOpacity="";bCreateNewMMObj=false});GeneralMap.Event.addListener(map,"infowindowclose",function(){if(bCreateNewMMObj){map.enableDoubleClickZoom()}if(resultActive!=-1){var z=document.getElementById("resultItem_"+resultActive);if(z!=null){ResultEntryInActive(z)}resultActive=-1}});GeneralMap.Event.addListener(map,"zoomend",function(){GetDirectionLatLngs();TreeBinding.ZoomEnd()});GeneralMap.Event.addListener(map,"moveend",function(){if(CurrentCenter!=null&&arrHightLight.length>0){var A=map.fromLatLngToDivPixel(CurrentCenter);var z=map.fromLatLngToDivPixel(map.getCenter());if(Math.sqrt(GeneralMap.Util.Distance(A.x,A.y,z.x,z.y))>map.getSize().width||Math.sqrt(GeneralMap.Util.Distance(A.x,A.y,z.x,z.y))>map.getSize().height){CurrentCenter=map.getCenter().copy();TreeBinding.ZoomEnd()}}if(directionLatLng!=null&&PlaceToFindPathArray.length>1){var A=map.fromLatLngToDivPixel(directionLatLng);var z=map.fromLatLngToDivPixel(map.getCenter());if(Math.sqrt(GeneralMap.Util.Distance(A.x,A.y,z.x,z.y))>map.getSize().width||Math.sqrt(GeneralMap.Util.Distance(A.x,A.y,z.x,z.y))>map.getSize().height){GetDirectionLatLngs()}}DisplayPopupScroll("auto")});document.getElementById("mapinput").focus();ShowTree();showMapTip();Show_Map_Help();map.setCenter(j,b);current_searchtype=0;if(!sessionExists()){saveState()}}function ResizeWindow(){calculateWindowSize();document.getElementById("tabfunction").style.width=myWidth+"px";var a=document.getElementById("container");var d=document.getElementById("leftpanel");var c=document.getElementById("centerpanel");var b=document.getElementById("copyright");a.style.width=myWidth-a.offsetLeft-5+"px";a.style.height=myHeight-a.offsetTop-25+"px";c.style.height=myHeight-a.offsetTop-25+"px";d.style.height=myHeight-a.offsetTop-25+"px";document.getElementById("bodyleftpanel").style.height=myHeight-a.offsetTop-25+"px";document.getElementById("searchresult_div").style.height=myHeight-a.offsetTop-51+"px";document.getElementById("findpath_div").style.height=myHeight-a.offsetTop-51+"px";document.getElementById("mymap_div").style.height=myHeight-a.offsetTop-51+"px";b.style.top=myHeight-25+"px";if(map!=null){map.checkResize()}}function CalculatePopupSize(){var a=document.getElementById("container");if(a==null){return}popupW=myWidth-a.offsetLeft-Global.pHPad;popupH=myHeight-a.offsetTop-Global.pVPad;popupW=(popupW<Global.pMinW)?Global.pMinW:popupW;popupH=(popupH<Global.pMinH)?Global.pMinH:popupH;popupW=(popupW>Global.pMaxW)?Global.pMaxW:popupW;popupH=(popupH>Global.pMaxH)?Global.pMaxH:popupH}var resultActive=-1;function HightlightActiveItem(a){if(resultActive!=-1){var b=document.getElementById("resultItem_"+resultActive);ResultEntryInActive(b)}if(dsResultData.Tables[0].Rows[a-1].DolGisId!=-1){resultActive=a;var b=document.getElementById("resultItem_"+resultActive);ResultEntryActive(b)}}function ResultEntryMouseOver(b){var a=b.parentNode.parentNode.rowIndex;ChangeBorderColor(b,"#83c327")}function ResultEntryMouseOut(a){ChangeBorderColor(a,"#ffffff");a.style.borderBottom="1px #efefef solid"}function ResultEntryActive(a){ChangeBorderColor(a,"#83c327");ChangeBgColor(a,"#eff9e0")}function ResultEntryInActive(a){if(a==null){return}ChangeBorderColor(a,"#ffffff");a.style.borderBottom="1px #efefef solid";ChangeBgColor(a,"#FFFFFF")}function ResultEntryPlaceABMouseOver(c){var b=c.parentNode.parentNode.rowIndex;var a=document.getElementById("resultimage_placeAB"+b);ChangeImageSrc(a,"images/"+b+"over.gif");ChangeBorderColor(c,"#83c327")}function ResultEntryPlaceABMouseOut(c){var b=c.parentNode.parentNode.rowIndex;var a=document.getElementById("resultimage_placeAB"+b);ChangeImageSrc(a,"images/"+b+".gif");ChangeBorderColor(c,"#ffffff");c.style.borderBottom="1px #efefef solid"}function fullscreen(){var a=document.getElementById("centerpanel");if(a.className=="splExpand"){expandMap()}else{shrinkMap()}}function expandMap(){var b=document.getElementById("leftpanel");var c=document.getElementById("centerpanel");var a=document.getElementById("container");a.style.left="6px";a.style.width=myWidth-a.offsetLeft-5+"px";map.checkResize();$("#leftpanel").animate({width:"0px",borderWidth:"0px"},350);c.className="splShrink";$("#centerpanel").animate({left:"0px"},350)}function shrinkMap(){var b=document.getElementById("leftpanel");var c=document.getElementById("centerpanel");var a=document.getElementById("container");$("#leftpanel").animate({width:"348px",borderWidth:"1px"},350);c.className="splExpand";$("#centerpanel").animate({left:"355px"},350);setTimeout(function(){a.style.left="362px";a.style.width=myWidth-a.offsetLeft-5+"px";map.checkResize()},350)}function showOnlineSupport(b){if(onlineSupportShow){var a="";if(nLanguage==0){a+="<img align=bottom src=images/xuong.gif width=16 height=16 /><span class='listofprovinces'><strong>Hỗ trợ trực tuyến</strong></span>"}else{a+="<img align=bottom src=images/xuong.gif width=16 height=16 /><span class='listofprovinces'><strong>Online support</strong></span>"}b.innerHTML=a;onlineSupportShow=false}else{var a="";if(nLanguage==0){a+="<img align=bottom src=images/len.gif width=16 height=16 /><span class='listofprovinces'><strong>Hỗ trợ trực tuyến</strong></span><br/><br/>"}else{a+="<img align=bottom src=images/len.gif width=16 height=16 /><span class='listofprovinces'><strong>Online support</strong></span><br/><br/>"}a+="Hotline: <span style='color:#FF0000;'><b>0903409848</b></span> gặp anh Dương<br /><br />";a+="<a href='ymsgr:sendIM?hotro_vietbando' class='nav2'><img border=0 src='http://opi.yahoo.com/online?u=hotro_vietbando&m=g&t=1' /></a>";a+="<br /><br />";a+="<a href='skype:hotro_vietbando?chat' class='nav2'><img src='http://download.skype.com/share/skypebuttons/buttons/chat_green_transparent_97x23.png' style='border: none;' width='97' height='23' alt='Ho tro Vietbando' /></a>";b.innerHTML=a;onlineSupportShow=true}}function panToCenter(a){map.panTo(a)}function zoomIn(a){closeContextMenu();map.setCenter(a,map.getLevel()+1)}function zoomOut(a){closeContextMenu();map.setCenter(a,map.getLevel()-1)}isMeasureDistance=false;function measureDistance(a){closeContextMenu();isMeasureDistance=true;ShowPopUpMyMapDistance()}function searchNearBy(a){closeContextMenu();ShowSearchNearByLngLat(a)}function GetDefaultLocationEnter(b){var a;if(document.all){a=event.keyCode}else{a=b.keyCode}if(a==13){GetDefaultLocation()}}function GetDefaultLocation(){var a=document.getElementById("txtDefaultLocation").value;AJLocationSearch.SearchDefaultLocation(a,SearchDefaultLocationChange)}function SearchDefaultLocationChange(f){var c=f.value;if(c==""||c==null){return}var a=c.split("|");arrLatLng=a[1].split(",");level=9;var d=arrLatLng[1];d+=":"+arrLatLng[0]+":"+level+":"+a[0];setCookie("myVBDRegionCookie",d,5000,"","","");map.setCenter(new GeneralMap.LatLng(arrLatLng[1],arrLatLng[0]),level);CancelDefaultLocation();var b=document.getElementById("defaultloc");b.innerHTML='<a onclick="ZoomToDetaultLocation()">'+a[0]+"</a>";b.style.display="";var e=document.getElementById("dltext");if(nLanguage==0){e.innerHTML="Thay đổi vị trí mặc định"}else{e.innerHTML="Change default location"}}function ZoomToDetaultLocation(){var b=getCookie("myVBDRegionCookie");if(b!=null){var a=b.split(":");var d=new GeneralMap.LatLng(a[0],a[1]);var c=parseInt(a[2]);map.setCenter(d,c)}}function RemoveDefaultLocation(){var a=document.getElementById("defaultloc");a.innerHTML="";a.style.display="none";var b=document.getElementById("dltext");if(nLanguage==0){b.innerHTML="Thiết lập vị trí mặc định"}else{b.innerHTML="Set default location"}ShowDefaultLocation();DeleteCookie("myVBDRegionCookie","","")}var isShowLocation=true;function ShowDefaultLocation(){var b=document.getElementById("dfform");if(isShowLocation){isShowLocation=false;var c="";c+='<input autocomplete="off" type=text id=txtDefaultLocation value="" style="width:300px;" onkeydown="GetDefaultLocationEnter(event)"><br/>';
if(nLanguage==0){c+='<input type=button value="Lưu" onclick="GetDefaultLocation()">';c+='<input type=button value="Hủy" onclick="CancelDefaultLocation()">'}else{c+='<input type=button value="Save" onclick="GetDefaultLocation()">';c+='<input type=button value="Cancel" onclick="CancelDefaultLocation()">'}b.innerHTML=c;b.style.display="";if(getCookie("myVBDRegionCookie")){b.innerHTML+='<a style="float:right" onclick="RemoveDefaultLocation()">'+(nLanguage==0?"Xóa":"Remove")+"</a></td>";var a=getCookie("myVBDRegionCookie").split(":");document.getElementById("txtDefaultLocation").value=a[3];document.getElementById("txtDefaultLocation").focus();document.getElementById("txtDefaultLocation").select()}}else{isShowLocation=true;b.style.display="none"}}function CancelDefaultLocation(){isShowLocation=false;ShowDefaultLocation()}function DisplayPopupScroll(c){var b=document.getElementById("popup_max");if(b!=null){b.style.overflow=c}var a=document.getElementById("Tree");if(a!=null){a.style.overflow=c}}(function(){var W=this,ab,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ac=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ab?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ab){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ab}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ac.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ab&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ab){var j=this[0];if(j){if(T.nodeName(j,"option")){return(j.attributes.value||{}).specified?j.value:j.text}if(T.nodeName(j,"select")){var e=j.selectedIndex,b=[],a=j.options,f=j.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=T(g).val();if(f){return c}b.push(c)}}return b}return(j.value||"").replace(/\r/g,"")}return ab}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var k=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,k)>=0||T.inArray(this.text,k)>=0)});if(!k.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ab?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(T.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=T.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,j=this.length;g<j;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){T.each(h,E)}}return this;function c(l,k){return a&&T.nodeName(l,"table")&&T.nodeName(k,"tr")?(l.getElementsByTagName("tbody")[0]||l.appendChild(l.ownerDocument.createElement("tbody"))):l}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ad(){return +new Date}T.extend=T.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!T.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ab){c[g]=a}}}}}return c};var ag=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;
T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&T.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(T.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ab){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ab){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ag.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ab?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,j=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(j,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&j&&j[h]){b=j[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(l,k){return k.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=j.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;j.left=b||0;b=j.pixelLeft+"px";j.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");T.each(g,function(m,j){if(typeof j==="number"){j+=""}if(!j){return}if(typeof j==="string"){j=j.replace(/(<(\w+)[^>]*?)\/>/g,function(r,q,s){return s.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?r:q+"></"+s+">"});var n=j.replace(/^\s+/,"").substring(0,10).toLowerCase();var l=!n.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!n.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||n.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!n.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!n.indexOf("<td")||!n.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!n.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=l[1]+j+l[2];while(l[0]--){a=a.lastChild}if(!T.support.tbody){var k=/<tbody/i.test(j),o=!n.indexOf("<table")&&!k?a.firstChild&&a.firstChild.childNodes:l[1]=="<table>"&&!k?a.childNodes:[];for(var p=o.length-1;p>=0;--p){if(T.nodeName(o[p],"tbody")&&!o[p].childNodes.length){o[p].parentNode.removeChild(o[p])}}}if(!T.support.leadingWhitespace&&/^\s/.test(j)){a.insertBefore(b.createTextNode(j.match(/^\s*/)[0]),a.firstChild)}j=T.makeArray(a.childNodes)}if(j.nodeType){f.push(j)}else{f=T.merge(f,j)}});if(d){for(var c=0;f[c];c++){if(T.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(T.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ab}var e=!T.isXMLDoc(c),a=b!==ab;f=e&&T.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ab}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ab:h}if(!T.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(k,j){return j.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||T.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!T.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=T.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();
T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ad(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ab){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ab){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ab){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ab&&this.length){c=T.data(this[0],d)}return c===ab&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ab){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,m=Object.prototype.toString;var o=function(s,w,aj,ai){aj=aj||[];w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(!s||typeof s!=="string"){return aj}var r=[],u,B,y,x,D,v,t=true;b.lastIndex=0;while((u=b.exec(s))!==null){r.push(u[1]);if(u[2]){v=RegExp.rightContext;break}}if(r.length>1&&g.exec(s)){if(r.length===2&&l.relative[r[0]]){B=k(r[0]+r[1],w)}else{B=l.relative[r[0]]?[w]:o(r.shift(),w);while(r.length){s=r.shift();if(l.relative[s]){s+=r.shift()}B=k(s,B)}}}else{var C=ai?{expr:r.pop(),set:p(ai)}:o.find(r.pop(),r.length===1&&w.parentNode?w.parentNode:w,c(w));B=o.filter(C.expr,C.set);if(r.length>0){y=p(B)}else{t=false}while(r.length){var z=r.pop(),A=z;if(!l.relative[z]){z=""}else{A=r.pop()}if(A==null){A=w}l.relative[z](y,A,c(w))}}if(!y){y=B}if(!y){throw"Syntax error, unrecognized expression: "+(z||s)}if(m.call(y)==="[object Array]"){if(!t){aj.push.apply(aj,y)}else{if(w.nodeType===1){for(var q=0;y[q]!=null;q++){if(y[q]&&(y[q]===true||y[q].nodeType===1&&j(w,y[q]))){aj.push(B[q])}}}else{for(var q=0;y[q]!=null;q++){if(y[q]&&y[q].nodeType===1){aj.push(B[q])}}}}}else{p(y,aj)}if(v){o(v,w,aj,ai);if(n){hasDuplicate=false;aj.sort(n);if(hasDuplicate){for(var q=1;q<aj.length;q++){if(aj[q]===aj[q-1]){aj.splice(q--,1)}}}}}return aj};o.matches=function(r,q){return o(r,null,null,q)};o.find=function(q,x,y){var r,t;if(!q){return[]}for(var u=0,v=l.order.length;u<v;u++){var s=l.order[u],t;if((t=l.match[s].exec(q))){var w=RegExp.leftContext;if(w.substr(w.length-1)!=="\\"){t[1]=(t[1]||"").replace(/\\/g,"");r=l.find[s](t,x,y);if(r!=null){q=q.replace(l.match[s],"");break}}}}if(!r){r=x.getElementsByTagName("*")}return{set:r,expr:q}};o.filter=function(D,ai,A,u){var v=D,y=[],q=ai,s,x,r=ai&&ai[0]&&c(ai[0]);while(D&&ai.length){for(var aj in l.filter){if((s=l.match[aj].exec(D))!=null){var w=l.filter[aj],z,B;x=false;if(q==y){y=[]}if(l.preFilter[aj]){s=l.preFilter[aj](s,q,A,y,u,r);if(!s){x=z=true}else{if(s===true){continue}}}if(s){for(var t=0;(B=q[t])!=null;t++){if(B){z=w(B,s,t,q);var C=u^!!z;if(A&&z!=null){if(C){x=true}else{q[t]=false}}else{if(C){y.push(B);x=true}}}}}if(z!==ab){if(!A){q=y}D=D.replace(l.match[aj],"");if(!x){return[]}break}}}if(D==v){if(x==null){throw"Syntax error, unrecognized expression: "+D}else{break}}v=D}return q};var l=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(q){return q.getAttribute("href")}},relative:{"+":function(q,x,r){var t=typeof x==="string",y=t&&!/\W/.test(x),s=t&&!y;if(y&&!r){x=x.toUpperCase()}for(var u=0,v=q.length,w;u<v;u++){if((w=q[u])){while((w=w.previousSibling)&&w.nodeType!==1){}q[u]=s||w&&w.nodeName===x?w||false:w===x}}if(s){o.filter(x,q,true)}},">":function(v,s,u){var x=typeof s==="string";if(x&&!/\W/.test(s)){s=u?s:s.toUpperCase();for(var r=0,t=v.length;r<t;r++){var w=v[r];if(w){var q=w.parentNode;v[r]=q.nodeName===s?q:false}}}else{for(var r=0,t=v.length;r<t;r++){var w=v[r];if(w){v[r]=x?w.parentNode:w.parentNode===s}}if(x){o.filter(s,v,true)}}},"":function(q,s,u){var r=h++,t=a;if(!s.match(/\W/)){var v=s=u?s:s.toUpperCase();t=d}t("parentNode",s,r,q,v,u)},"~":function(q,s,u){var r=h++,t=a;if(typeof s==="string"&&!s.match(/\W/)){var v=s=u?s:s.toUpperCase();t=d}t("previousSibling",s,r,q,v,u)}},find:{ID:function(s,r,q){if(typeof r.getElementById!=="undefined"&&!q){var t=r.getElementById(s[1]);return t?[t]:[]}},NAME:function(r,v,u){if(typeof v.getElementsByName!=="undefined"){var s=[],w=v.getElementsByName(r[1]);for(var q=0,t=w.length;q<t;q++){if(w[q].getAttribute("name")===r[1]){s.push(w[q])}}return s.length===0?null:s}},TAG:function(r,q){return q.getElementsByTagName(r[1])}},preFilter:{CLASS:function(q,s,r,t,v,u){q=" "+q[1].replace(/\\/g,"")+" ";if(u){return q}for(var x=0,w;(w=s[x])!=null;x++){if(w){if(v^(w.className&&(" "+w.className+" ").indexOf(q)>=0)){if(!r){t.push(w)}}else{if(r){s[x]=false}}}}return false},ID:function(q){return q[1].replace(/\\/g,"")},TAG:function(r,s){for(var q=0;s[q]===false;q++){}return s[q]&&c(s[q])?r[1]:r[1].toUpperCase()},CHILD:function(r){if(r[1]=="nth"){var q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(r[2]=="even"&&"2n"||r[2]=="odd"&&"2n+1"||!/\D/.test(r[2])&&"0n+"+r[2]||r[2]);r[2]=(q[1]+(q[2]||1))-0;r[3]=q[3]-0}r[0]=h++;return r},ATTR:function(w,s,r,t,v,u){var q=w[1].replace(/\\/g,"");if(!u&&l.attrMap[q]){w[1]=l.attrMap[q]}if(w[2]==="~="){w[4]=" "+w[4]+" "}return w},PSEUDO:function(v,s,r,t,u){if(v[1]==="not"){if(v[3].match(b).length>1||/^\w/.test(v[3])){v[3]=o(v[3],null,null,s)}else{var q=o.filter(v[3],s,r,true^u);if(!r){t.push.apply(t,q)}return false}}else{if(l.match.POS.test(v[0])||l.match.CHILD.test(v[0])){return true}}return v},POS:function(q){q.unshift(true);return q}},filters:{enabled:function(q){return q.disabled===false&&q.type!=="hidden"},disabled:function(q){return q.disabled===true},checked:function(q){return q.checked===true},selected:function(q){q.parentNode.selectedIndex;return q.selected===true},parent:function(q){return !!q.firstChild},empty:function(q){return !q.firstChild},has:function(q,r,s){return !!o(s[3],q).length},header:function(q){return/h\d/i.test(q.nodeName)},text:function(q){return"text"===q.type},radio:function(q){return"radio"===q.type},checkbox:function(q){return"checkbox"===q.type},file:function(q){return"file"===q.type
},password:function(q){return"password"===q.type},submit:function(q){return"submit"===q.type},image:function(q){return"image"===q.type},reset:function(q){return"reset"===q.type},button:function(q){return"button"===q.type||q.nodeName.toUpperCase()==="BUTTON"},input:function(q){return/input|select|textarea|button/i.test(q.nodeName)}},setFilters:{first:function(q,r){return r===0},last:function(r,s,t,q){return s===q.length-1},even:function(q,r){return r%2===0},odd:function(q,r){return r%2===1},lt:function(q,r,s){return r<s[3]-0},gt:function(q,r,s){return r>s[3]-0},nth:function(q,r,s){return s[3]-0==r},eq:function(q,r,s){return s[3]-0==r}},filter:{PSEUDO:function(v,r,q,u){var s=r[1],x=l.filters[s];if(x){return x(v,q,r,u)}else{if(s==="contains"){return(v.textContent||v.innerText||"").indexOf(r[3])>=0}else{if(s==="not"){var w=r[3];for(var q=0,t=w.length;q<t;q++){if(w[q]===v){return false}}return true}}}},CHILD:function(x,u){var r=u[1],w=x;switch(r){case"only":case"first":while(w=w.previousSibling){if(w.nodeType===1){return false}}if(r=="first"){return true}w=x;case"last":while(w=w.nextSibling){if(w.nodeType===1){return false}}return true;case"nth":var v=u[2],y=u[3];if(v==1&&y==0){return true}var s=u[0],z=x.parentNode;if(z&&(z.sizcache!==s||!x.nodeIndex)){var t=0;for(w=z.firstChild;w;w=w.nextSibling){if(w.nodeType===1){w.nodeIndex=++t}}z.sizcache=s}var q=x.nodeIndex-y;if(v==0){return q==0}else{return(q%v==0&&q/v>=0)}}},ID:function(q,r){return q.nodeType===1&&q.getAttribute("id")===r},TAG:function(q,r){return(r==="*"&&q.nodeType===1)||q.nodeName===r},CLASS:function(q,r){return(" "+(q.className||q.getAttribute("class"))+" ").indexOf(r)>-1},ATTR:function(v,q){var r=q[1],t=l.attrHandle[r]?l.attrHandle[r](v):v[r]!=null?v[r]:v.getAttribute(r),u=t+"",w=q[2],s=q[4];return t==null?w==="!=":w==="="?u===s:w==="*="?u.indexOf(s)>=0:w==="~="?(" "+u+" ").indexOf(s)>=0:!s?u&&t!==false:w==="!="?u!=s:w==="^="?u.indexOf(s)===0:w==="$="?u.substr(u.length-s.length)===s:w==="|="?u===s||u.substr(0,s.length+1)===s+"-":false},POS:function(v,s,r,u){var t=s[2],q=l.setFilters[t];if(q){return q(v,r,s,u)}}}};var g=l.match.POS;for(var e in l.match){l.match[e]=RegExp(l.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var p=function(q,r){q=Array.prototype.slice.call(q);if(r){r.push.apply(r,q);return r}return q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){p=function(u,q){var s=q||[];if(m.call(u)==="[object Array]"){Array.prototype.push.apply(s,u)}else{if(typeof u.length==="number"){for(var r=0,t=u.length;r<t;r++){s.push(u[r])}}else{for(var r=0;u[r];r++){s.push(u[r])}}}return s}}var n;if(document.documentElement.compareDocumentPosition){n=function(r,s){var q=r.compareDocumentPosition(s)&4?-1:r===s?0:1;if(q===0){hasDuplicate=true}return q}}else{if("sourceIndex" in document.documentElement){n=function(r,s){var q=r.sourceIndex-s.sourceIndex;if(q===0){hasDuplicate=true}return q}}else{if(document.createRange){n=function(q,s){var r=q.ownerDocument.createRange(),t=s.ownerDocument.createRange();r.selectNode(q);r.collapse(true);t.selectNode(s);t.collapse(true);var u=r.compareBoundaryPoints(Range.START_TO_END,t);if(u===0){hasDuplicate=true}return u}}}}(function(){var r=document.createElement("form"),q="script"+(new Date).getTime();r.innerHTML="<input name='"+q+"'/>";var s=document.documentElement;s.insertBefore(r,s.firstChild);if(!!document.getElementById(q)){l.find.ID=function(w,v,u){if(typeof v.getElementById!=="undefined"&&!u){var t=v.getElementById(w[1]);return t?t.id===w[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===w[1]?[t]:ab:[]}};l.filter.ID=function(u,t){var v=typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id");return u.nodeType===1&&v&&v.nodeValue===t}}s.removeChild(r)})();(function(){var q=document.createElement("div");q.appendChild(document.createComment(""));if(q.getElementsByTagName("*").length>0){l.find.TAG=function(t,u){var v=u.getElementsByTagName(t[1]);if(t[1]==="*"){var r=[];for(var s=0;v[s];s++){if(v[s].nodeType===1){r.push(v[s])}}v=r}return v}}q.innerHTML="<a href='#'></a>";if(q.firstChild&&typeof q.firstChild.getAttribute!=="undefined"&&q.firstChild.getAttribute("href")!=="#"){l.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var r=o,q=document.createElement("div");q.innerHTML="<p class='TEST'></p>";if(q.querySelectorAll&&q.querySelectorAll(".TEST").length===0){return}o=function(v,w,t,s){w=w||document;if(!s&&w.nodeType===9&&!c(w)){try{return p(w.querySelectorAll(v),t)}catch(u){}}return r(v,w,t,s)};o.find=r.find;o.filter=r.filter;o.selectors=r.selectors;o.matches=r.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var q=document.createElement("div");q.innerHTML="<div class='test e'></div><div class='test'></div>";if(q.getElementsByClassName("e").length===0){return}q.lastChild.className="e";if(q.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS");l.find.CLASS=function(t,s,r){if(typeof s.getElementsByClassName!=="undefined"&&!r){return s.getElementsByClassName(t[1])}}})()}function d(w,r,s,y,q,z){var A=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(A&&x.nodeType===1){x.sizcache=s;x.sizset=u}x=x[w];var t=false;while(x){if(x.sizcache===s){t=y[x.sizset];break}if(x.nodeType===1&&!z){x.sizcache=s;x.sizset=u}if(x.nodeName===r){t=x;break}x=x[w]}y[u]=t}}}function a(w,r,s,y,q,z){var A=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(A&&x.nodeType===1){x.sizcache=s;x.sizset=u}x=x[w];var t=false;while(x){if(x.sizcache===s){t=y[x.sizset];break}if(x.nodeType===1){if(!z){x.sizcache=s;x.sizset=u}if(typeof r!=="string"){if(x===r){t=true;break}}else{if(o.filter(r,[x]).length>0){t=x;break}}}x=x[w]}y[u]=t}}}var j=document.compareDocumentPosition?function(q,r){return q.compareDocumentPosition(r)&16}:function(q,r){return q!==r&&(q.contains?q.contains(r):true)};var c=function(q){return q.nodeType===9&&q.documentElement.nodeName!=="HTML"||!!q.ownerDocument&&c(q.ownerDocument)};var k=function(t,v){var q=[],x="",w,r=v.nodeType?[v]:v;while((w=l.match.PSEUDO.exec(t))){x+=w[0];t=t.replace(l.match.PSEUDO,"")}t=l.relative[t]?t+"*":t;for(var u=0,s=r.length;u<s;u++){o(t,r[u],q)}return o.filter(x,q)};T.find=o;T.filter=o.filter;T.expr=o.selectors;T.expr[":"]=T.expr.filters;o.selectors.filters.hidden=function(q){return q.offsetWidth===0||q.offsetHeight===0};o.selectors.filters.visible=function(q){return q.offsetWidth>0||q.offsetHeight>0};o.selectors.filters.animated=function(q){return T.grep(T.timers,function(r){return q===r.elem}).length};T.multiFilter=function(q,s,r){if(r){q=":not("+q+")"}return o.matches(q,s)};T.dir=function(r,s){var t=[],q=r[s];while(q&&q!=document){if(q.nodeType==1){t.push(q)}q=q[s]}return t};T.nth=function(u,t,r,q){t=t||1;var s=0;for(;u;u=u[r]){if(u.nodeType==1&&++s==t){break}}return u};T.sibling=function(q,r){var s=[];for(;q;q=q.nextSibling){if(q.nodeType==1&&q!=r){s.push(q)}}return s};return;W.Sizzle=o})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ab){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ab});b.elem=c;T.each(f.split(/\s+/),function(l,k){var j=k.split(".");k=j.shift();d.type=j.slice().sort().join(".");var h=g[k];if(T.event.specialAll[k]){T.event.specialAll[k].setup.call(c,a,j)}if(!h){h=g[k]={};if(!T.event.special[k]||T.event.special[k].setup.call(c,a,j)===false){if(c.addEventListener){c.addEventListener(k,b,false)}else{if(c.attachEvent){c.attachEvent("on"+k,b)}}}}h[d.guid]=d;T.event.global[k]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ab||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))
}}else{if(e.type){c=e.handler;e=e.type}T.each(e.split(/\s+/),function(n,l){var j=l.split(".");l=j.shift();var m=RegExp("(^|\\.)"+j.slice().sort().join(".*\\.")+"(\\.|$)");if(f[l]){if(c){delete f[l][c.guid]}else{for(var k in f[l]){if(m.test(f[l][k].type)){delete f[l][k]}}}if(T.event.specialAll[l]){T.event.specialAll[l].teardown.call(b,j)}for(g in f[l]){break}if(!g){if(!T.event.special[l]||T.event.special[l].teardown.call(b,j)===false){if(b.removeEventListener){b.removeEventListener(l,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+l,T.data(b,"handle"))}}}g=null;delete f[l]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ab}d.result=ab;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(T.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ab){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(c){if(c[aa]){return c}var e=c;c=T.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],af)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],af)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ad();this[aa]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ah=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ah,b)},teardown:function(){T.event.remove(this,a,ah)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function af(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return
}T.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(j,h){if(h=="success"||h=="notmodified"){f.html(g?T("<div/>").append(j.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):j.responseText)}if(a){f.each(a,[j.responseText,h,j])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ad();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(l){l=T.extend(true,l,T.extend(true,{},T.ajaxSettings,l));var a,s=/=\?(&|$)/g,f,b,r=l.type.toUpperCase();if(l.data&&l.processData&&typeof l.data!=="string"){l.data=T.param(l.data)}if(l.dataType=="jsonp"){if(r=="GET"){if(!l.url.match(s)){l.url+=(l.url.match(/\?/)?"&":"?")+(l.jsonp||"callback")+"=?"}}else{if(!l.data||!l.data.match(s)){l.data=(l.data?l.data+"&":"")+(l.jsonp||"callback")+"=?"}}l.dataType="json"}if(l.dataType=="json"&&(l.data&&l.data.match(s)||l.url.match(s))){a="jsonp"+N++;if(l.data){l.data=(l.data+"").replace(s,"="+a+"$1")}l.url=l.url.replace(s,"="+a+"$1");l.dataType="script";W[a]=function(v){b=v;p();m();W[a]=ab;try{delete W[a]}catch(u){}if(q){q.removeChild(d)}}}if(l.dataType=="script"&&l.cache==null){l.cache=false}if(l.cache===false&&r=="GET"){var t=ad();var c=l.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+t+"$2");l.url=c+((c==l.url)?(l.url.match(/\?/)?"&":"?")+"_="+t:"")}if(l.data&&r=="GET"){l.url+=(l.url.match(/\?/)?"&":"?")+l.data;l.data=null}if(l.global&&!T.active++){T.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(l.url);if(l.dataType=="script"&&r=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var q=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=l.url;if(l.scriptCharset){d.charset=l.scriptCharset}if(!a){var j=false;d.onload=d.onreadystatechange=function(){if(!j&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){j=true;p();m();d.onload=d.onreadystatechange=null;q.removeChild(d)}}}q.appendChild(d);return ab}var n=false;var o=l.xhr();if(l.username){o.open(r,l.url,l.async,l.username,l.password)}else{o.open(r,l.url,l.async)}try{if(l.data){o.setRequestHeader("Content-Type",l.contentType)}if(l.ifModified){o.setRequestHeader("If-Modified-Since",T.lastModified[l.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",l.dataType&&l.accepts[l.dataType]?l.accepts[l.dataType]+", */*":l.accepts._default)}catch(e){}if(l.beforeSend&&l.beforeSend(o,l)===false){if(l.global&&!--T.active){T.event.trigger("ajaxStop")}o.abort();return false}if(l.global){T.event.trigger("ajaxSend",[o,l])}var k=function(w){if(o.readyState==0){if(h){clearInterval(h);h=null;if(l.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!n&&o&&(o.readyState==4||w=="timeout")){n=true;if(h){clearInterval(h);h=null}f=w=="timeout"?"timeout":!T.httpSuccess(o)?"error":l.ifModified&&T.httpNotModified(o,l.url)?"notmodified":"success";if(f=="success"){try{b=T.httpData(o,l.dataType,l)}catch(u){f="parsererror"}}if(f=="success"){var v;try{v=o.getResponseHeader("Last-Modified")}catch(u){}if(l.ifModified&&v){T.lastModified[l.url]=v}if(!a){p()}}else{T.handleError(l,o,f)}m();if(w){o.abort()}if(l.async){o=null}}}};if(l.async){var h=setInterval(k,13);if(l.timeout>0){setTimeout(function(){if(o&&!n){k("timeout")}},l.timeout)}}try{o.send(l.data)}catch(e){T.handleError(l,o,null,e)}if(!l.async){k()}function p(){if(l.success){l.success(b,f)}if(l.global){T.event.trigger("ajaxSuccess",[o,l])}}function m(){if(l.complete){l.complete(o,f)}if(l.global){T.event.trigger("ajaxComplete",[o,l])}if(l.global&&!--T.active){T.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==T.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(ae.concat.apply([],ae.slice(0,c)),function(){a[this]=b});return a}T.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=T.data(this[e],"olddisplay");
this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),j,f=this.nodeType==1&&T(this).is(":hidden"),h=this;for(j in a){if(a[j]=="hide"&&f||a[j]=="show"&&!f){return g.complete.call(this)}if((j=="height"||j=="width")&&this.style){g.display=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(p,l){var m=new T.fx(h,g,p);if(/toggle|show|hide/.test(l)){m[l=="toggle"?f?"show":"hide":l](a)}else{var n=l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),k=m.cur(true)||0;if(n){var q=parseFloat(n[2]),o=n[3]||"px";if(o!="px"){h.style[p]=(q||1)+o;k=((q||1)/m.cur(true))*k;h.style[p]=k+o}if(n[1]){q=((n[1]=="-="?-1:1)*q)+k}m.custom(k,q,o)}else{m.custom(k,l,"")}}});return true})},stop:function(b,c){var a=T.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ad();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ab}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ad();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var f=this[0],j=f.offsetParent,k=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,l=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===j){b+=f.offsetTop,g+=f.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=j,j=f.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}l=c}if(l.position==="relative"||l.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(l.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}T.offset={initialize:function(){if(this.initialized){return}var c=document.body,j=document.createElement("div"),g,h,a,f,b,k,e=c.style.marginTop,d='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(k in b){j.style[k]=b[k]}j.innerHTML=d;c.insertBefore(j,c.firstChild);g=j.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(j);this.initialized=true},bodyOffset:function(c){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.fn.extend({position:function(){var b=0,c=0,e;
if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ab?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ab?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();function ChangeLanguage(){var a=location.pathname;if(nLanguage==0){nLanguage=1;var b=a.replace(/[.]aspx/,"E.aspx");if(b!=a){location.href=b}else{location.href=a+"vbdMapE.aspx"}}else{nLanguage=0;b=a.replace(/[E][.]aspx/,".aspx");if(b!=a){location.href=b}else{location.href=a+"vbdMap.aspx"}}}(function(a){a.fn.lightBox=function(q){q=jQuery.extend({overlayBgColor:"#000",overlayOpacity:0.8,fixedNavigation:false,imageLoading:"images/lightbox-ico-loading.gif",imageBtnPrev:"images/lightbox-btn-prev.gif",imageBtnNext:"images/lightbox-btn-next.gif",imageBtnClose:"images/lightbox-btn-close.gif",imageBlank:"images/lightbox-blank.gif",containerBorderSize:10,containerResizeSpeed:400,txtImage:"Image",txtOf:"of",keyToClose:"c",keyToPrev:"p",keyToNext:"n",imageArray:[],activeImage:0},q);var j=this;function s(){p(this,j);return false}function p(w,v){a("embed, object, select").css({visibility:"hidden"});c();q.imageArray.length=0;q.activeImage=0;if(v.length==1){q.imageArray.push(new Array(w.getAttribute("href"),w.getAttribute("title")))}else{for(var u=0;u<v.length;u++){q.imageArray.push(new Array(v[u].getAttribute("href"),v[u].getAttribute("title")))}}while(q.imageArray[q.activeImage][0]!=w.getAttribute("href")){q.activeImage++}m()}function c(){a("body").append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+q.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+q.imageBtnClose+'"></a></div></div></div></div>');var u=f();a("#jquery-overlay").css({backgroundColor:q.overlayBgColor,opacity:q.overlayOpacity,width:u[0],height:u[1]}).fadeIn();var v=h();a("#jquery-lightbox").css({top:v[1]+(u[3]/10),left:v[0]}).show();a("#jquery-overlay,#jquery-lightbox").click(function(){b()});a("#lightbox-loading-link,#lightbox-secNav-btnClose").click(function(){b();return false});a(window).resize(function(){var w=f();a("#jquery-overlay").css({width:w[0],height:w[1]});var x=h();a("#jquery-lightbox").css({top:x[1]+(w[3]/10),left:x[0]})})}function m(){a("#lightbox-loading").show();if(q.fixedNavigation){a("#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}else{a("#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber").hide()}var u=new Image();u.onload=function(){a("#lightbox-image").attr("src",q.imageArray[q.activeImage][0]);var y=f();var x=y[1]-(y[3]/3);var v=(u.height>x)?x:u.height;var w=u.width*(v/u.naturalHeight);a("#lightbox-image").attr("height",v);a("#lightbox-image").attr("width",w);u.height=v;u.width=w;k(u.width,u.height);u.onload=function(){}};u.src=q.imageArray[q.activeImage][0]}function k(x,A){var u=a("#lightbox-container-image-box").width();var z=a("#lightbox-container-image-box").height();var y=(x+(q.containerBorderSize*2));var w=(A+(q.containerBorderSize*2));var v=u-y;var B=z-w;a("#lightbox-container-image-box").animate({width:y,height:w},q.containerResizeSpeed,function(){g()});if((v==0)&&(B==0)){if(a.browser.msie){o(250)}else{o(100)}}a("#lightbox-container-image-data-box").css({width:x});a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({height:A+(q.containerBorderSize*2)})}function g(){a("#lightbox-loading").hide();a("#lightbox-image").fadeIn(function(){l();t()});r()}function l(){a("#lightbox-container-image-data-box").slideDown("fast");a("#lightbox-image-details-caption").hide();if(q.imageArray[q.activeImage][1]){a("#lightbox-image-details-caption").html(q.imageArray[q.activeImage][1]).show()}if(q.imageArray.length>1){a("#lightbox-image-details-currentNumber").html(q.txtImage+" "+(q.activeImage+1)+" "+q.txtOf+" "+q.imageArray.length).show()}}function t(){a("#lightbox-nav").show();a("#lightbox-nav-btnPrev,#lightbox-nav-btnNext").css({background:"transparent url("+q.imageBlank+") no-repeat"});if(q.activeImage!=0){if(q.fixedNavigation){a("#lightbox-nav-btnPrev").css({background:"url("+q.imageBtnPrev+") left 15% no-repeat"}).unbind().bind("click",function(){q.activeImage=q.activeImage-1;m();return false})}else{a("#lightbox-nav-btnPrev").unbind().hover(function(){a(this).css({background:"url("+q.imageBtnPrev+") left 15% no-repeat"})},function(){a(this).css({background:"transparent url("+q.imageBlank+") no-repeat"})}).show().bind("click",function(){q.activeImage=q.activeImage-1;m();return false})}}if(q.activeImage!=(q.imageArray.length-1)){if(q.fixedNavigation){a("#lightbox-nav-btnNext").css({background:"url("+q.imageBtnNext+") right 15% no-repeat"}).unbind().bind("click",function(){q.activeImage=q.activeImage+1;m();return false})}else{a("#lightbox-nav-btnNext").unbind().hover(function(){a(this).css({background:"url("+q.imageBtnNext+") right 15% no-repeat"})},function(){a(this).css({background:"transparent url("+q.imageBlank+") no-repeat"})}).show().bind("click",function(){q.activeImage=q.activeImage+1;m();return false})}}n()}function n(){a(document).keydown(function(u){d(u)})}function e(){a(document).unbind()}function d(u){if(u==null){keycode=event.keyCode;escapeKey=27}else{keycode=u.keyCode;escapeKey=u.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key==q.keyToClose)||(key=="x")||(keycode==escapeKey)){b()}if((key==q.keyToPrev)||(keycode==37)){if(q.activeImage!=0){q.activeImage=q.activeImage-1;m();e()}}if((key==q.keyToNext)||(keycode==39)){if(q.activeImage!=(q.imageArray.length-1)){q.activeImage=q.activeImage+1;m();e()}}}function r(){if((q.imageArray.length-1)>q.activeImage){objNext=new Image();objNext.src=q.imageArray[q.activeImage+1][0]}if(q.activeImage>0){objPrev=new Image();objPrev.src=q.imageArray[q.activeImage-1][0]}}function b(){a("#jquery-lightbox").remove();a("#jquery-overlay").fadeOut(function(){a("#jquery-overlay").remove()});a("embed, object, select").css({visibility:"visible"})}function f(){var w,u;if(window.innerHeight&&window.scrollMaxY){w=window.innerWidth+window.scrollMaxX;u=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){w=document.body.scrollWidth;
u=document.body.scrollHeight}else{w=document.body.offsetWidth;u=document.body.offsetHeight}}var v,x;if(self.innerHeight){if(document.documentElement.clientWidth){v=document.documentElement.clientWidth}else{v=self.innerWidth}x=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){v=document.documentElement.clientWidth;x=document.documentElement.clientHeight}else{if(document.body){v=document.body.clientWidth;x=document.body.clientHeight}}}if(u<x){pageHeight=x}else{pageHeight=u}if(w<v){pageWidth=w}else{pageWidth=v}arrayPageSize=new Array(pageWidth,pageHeight,v,x);return arrayPageSize}function h(){var v,u;if(self.pageYOffset){u=self.pageYOffset;v=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){u=document.documentElement.scrollTop;v=document.documentElement.scrollLeft}else{if(document.body){u=document.body.scrollTop;v=document.body.scrollLeft}}}arrayPageScroll=new Array(v,u);return arrayPageScroll}function o(w){var v=new Date();u=null;do{var u=new Date()}while(u-v<w)}return this.unbind("click").click(s)}})(jQuery);var bMeasureLine=false;var arrDrawingPtsML=null;var nDrawingPtsML=0;var arrMLObj=new Array();var nMLObj=0;var CurrentDistance=0;var TotalDistance=0;function ShowPopUpMyMapDistance(){var e="Current distance :",d="Total distance :",b="images/dokhoangcachE.gif",a="Double-click to end measuring";if(nLanguage==0){e="Khoảng cách đoạn hiện hành :";d="Tổng khoảng cách :";b="images/dokhoangcach.gif";a="Nhấp-đúp để kết thúc quá trình đo khoảng cách"}TotalDistance=0;map.disableDoubleClickZoom();var c='<table width="270" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px #666666 solid">    <tr>    <td height="27" valign="middle" background="images/tt_bgtop.gif"></td>    <td align="left" valign="middle" background="images/tt_bgtop.gif"><img src="'+b+'" width="141" height="20" /></td>    <td align="left" valign="middle" background="images/tt_bgtop.gif"><img src="images/tt_close.gif" width="16" height="16" style="cursor:pointer" onclick=ClosePopupDistance(event)></td>    </tr>    <tr bgcolor=#FFFFFF>    <td width="255" height="25" colspan="3">    <p style="margin:5px">'+e+'<label id="lblCurDistance" ><FONT style="color:#FF3300"></FONT>0</label><br/>    <span style="font-size:9px;color:grey">'+a+"</span><br/><br/>    "+d+'<label id="lblTotalDistance"><FONT style="color:#FF3300;;font-weight:bold"></FONT>0</label><br/>    </p></td>    </tr></table>';myrect=document.getElementById("PopUpMyMapDistance");if(myrect==null){myrect=document.createElement("div");myrect.id="PopUpMyMapDistance";document.body.appendChild(myrect);myrect.style.position="absolute"}myrect.style.zIndex=2001;var f=parseInt(document.getElementById("container").offsetWidth)+parseInt(document.getElementById("container").offsetLeft-260);myrect.style.left=f+"px";myrect.style.top=parseInt(document.getElementById("container").offsetTop)+"px";myrect.innerHTML=c}function ClosePopupDistance(b){if(isMeasureDistance&&bMeasureLine){return}var c=document.getElementById("PopUpMyMapDistance");if(c!=null){document.body.removeChild(c)}for(var a=0;a<nMLObj;a++){map.removeOverlay(arrMLObj[a])}map.enableDoubleClickZoom();isMeasureDistance=false;bMeasureLine=false;arrDrawingPtsML=null;nDrawingPtsML=0;arrMLObj=new Array();nMLObj=0;CurrentDistance=0;TotalDistance=0}function CalculateDistance(a,n){var e,f,h;var c;var o;var j;var g;var l;var m=a.lat();var d=a.lng();var k=n.lat();var b=n.lng();c=m*(Math.PI/180);o=d*(Math.PI/180);j=k*(Math.PI/180);g=b*(Math.PI/180);e=d-b;l=e*(Math.PI/180);h=Math.sin(c)*Math.sin(j)+Math.cos(c)*Math.cos(j)*Math.cos(l);h=Math.acos(h);f=h*180/Math.PI;f=f*60*1.1515;f=f*1.609344*1000;return Math.round(f)}var bCreateNewMMObj=false;var bEditMMObj=false;var bReadOnly=true;var bHaveDeletedMM=-1;var bSendMyMap=false;var bWaitingCreateNewMap=false;var bDrawingPolyline=false;var arrDrawingPts=null;var nDrawingPts=0;var tempPolyline=null;var dsMyMap=null;var dsMyMapCoor=null;var iMyMapOpening=-1;var iMyMapCoorSel=-1;var iMyMapCoorOver=-1;var arrMyMapCoorObj=new Array();var nMyMapCoorObj=0;var arrControlPoint=new Array();var nControlPoint=0;var arrAPControlPoint=new Array();var nAPControlPoint=0;var bCPDragging=false;var clickedPoint=null;var selTbrButton=null;var curTitle="";var curDesc="";var curIcon="";var curText="";var curFontFamily="";var curFontWeight="";var curFontSize="";var curFontColor="";var curLineColor="";var curLineWidth="";var curLineOpacity="";var curFillColor="";var curFillOpacity="";var curColElX=0;var curColElY=0;var Ds_MyMapProperty=null;var colorArr=new Array(new Array("#ff8080","#ffff80","#80ff80","#00ff80","#80ffff","#0080ff","#ff80c0","#ff80ff"),new Array("#ff0000","#ffff00","#80ff00","#00ff40","#00ffff","#0080c0","#8080c0","#ff00ff"),new Array("#804040","#ff8040","#00ff00","#008080","#004080","#8080ff","#800040","#ff0080"),new Array("#800000","#ff8000","#008000","#008040","#0000ff","#0000a0","#800080","#8000ff"),new Array("#400000","#804000","#004000","#004040","#000080","#000040","#400040","#400080"),new Array("#000000","#808000","#808040","#808080","#408080","#c0c0c0","#400040","#ffffff"));var iconArr=new Array(new Array("point-1.gif","point-2.gif","point-3.gif","point-4.gif","star-1.gif","star-2.gif","star-3.gif"),new Array("point-5.gif","point_6.gif","point_7.gif","point_8.gif","heart_1.gif","heart_2.gif","heart_3.gif"),new Array("taxi.gif","bus.gif","airplane.gif","train.gif","bike.gif","truck.gif","ship.gif"),new Array("port.gif","food-1.gif","food-2.gif","food-3.gif","food-4.gif","media_1.gif","media_2.gif"),new Array("media_3.gif","media_4.gif","media_5.gif","media_6.gif","media_7.gif","theatre.gif","hospital.gif"),new Array("hotel.gif","parking.gif","bank.gif","umbrella.gif","park.gif","tool.gif","service.gif"),new Array("post.gif","phone.gif","shopping.gif","petro.gif","home.gif","bag.gif","book.gif"));function resizeMyMapDiv(){var c=document.getElementById("MyMapList");var b=document.getElementById("MyMapArea");var d=document.getElementById("MyMapToolbar");var a=document.getElementById("MyMapCoorList");if(b!=null){b.style.top=parseInt(c.offsetTop)+parseInt(c.offsetHeight)+"px"}if(a!=null){if(!bReadOnly){d.style.height="120px"}else{d.style.height="82px"}a.style.top=(parseInt(d.offsetTop)+parseInt(d.offsetHeight))+"px";a.style.height=(parseInt(b.offsetHeight)-parseInt(d.offsetHeight)-23)+"px"}}function createNewMap(){ArrEditProperty=new Array();ArrDeleteProperty=new Array();flagEditProperty=false;ArrPropertyAsLoad=new Array();Ds_MyMapProperty=null;if(bEditMMObj&&iMyMapOpening!=-1&&checkLogin()){if(nLanguage==0){if(confirm("Bạn có muốn lưu lại bản đồ của bạn không?")){bWaitingCreateNewMap=true;saveMyMap()}else{fnCreateNewMap()}}else{if(confirm("Do you want to save your map?")){bWaitingCreateNewMap=true;saveMyMap()}else{fnCreateNewMap()}}}else{fnCreateNewMap()}}function checkLogin(){var a=document.getElementById("MapTopPanel1_UserName");if((browserName=="msie"&&a.innerText=="")||(browserName!="msie"&&a.firstChild==null)){return false}return true}function fnCreateNewMap(){bEditMMObj=false;bReadOnly=false;if(!checkLogin()){window.location="login.aspx?tab=5";return}closeMyMap();var a=new Object();a.MyMapID="";a.UserID="";a.Title="Chưa đặt tên";a.Description="";a.MapID="vietnam";a.ZoomLevel=map.getLevel();var e=map.getCenter();a.LastPosX=e.lng();a.LastPosY=e.lat();dsMyMap.Tables[0].Rows[dsMyMap.Tables[0].Rows.length]=a;var k=map.getLevel()+"!"+e.lng()+"!"+e.lat();showBusyDiv("Đang tạo bản đồ mới");AJLocationSearch.CreateNewMap(k,createNewMapCallback);var f=document.getElementById("MyMapList");var l=document.createElement("TABLE");l.setAttribute("width","95%");l.setAttribute("border",0);l.setAttribute("align","center");l.setAttribute("cellPadding",0);l.setAttribute("cellSpacing",0);l.style.cursor="pointer";l.style.border="1px #ffffff solid";l.setAttribute("id","MyMapList_"+(dsMyMap.Tables[0].Rows.length-1));l.onclick=function(){loadMyMapCoor(this.id.substring(this.id.indexOf("_")+1,this.id.length))
};l.onmouseover=function(){ChangeBorderColor(this,"#83c327")};l.onmouseout=function(){ChangeBorderColor(this,"#ffffff")};var h=document.createElement("TBODY");var m=document.createElement("TR");var j=document.createElement("TD");j.setAttribute("height","5px");j.setAttribute("colspan",3);m.appendChild(j);h.appendChild(m);m=document.createElement("TR");j=document.createElement("TD");j.setAttribute("width","11%");j.setAttribute("height","25px");j.setAttribute("align","center");j.setAttribute("valign","middle");var d="<img src='images/point_mymap.gif' width='19px' height='18px' />";j.innerHTML=d;m.appendChild(j);j=document.createElement("TD");j.setAttribute("width","82%");j.setAttribute("align","left");j.setAttribute("valign","middle");d="<span id='MyMapListTitle_"+(dsMyMap.Tables[0].Rows.length-1)+"' class='blue'>";d+="Chưa đặt tên</span><br /><span id='MyMapListDesc_"+(dsMyMap.Tables[0].Rows.length-1)+"'>&nbsp;&nbsp;&nbsp;</span>";j.innerHTML=d;m.appendChild(j);j=document.createElement("TD");j.setAttribute("width","7%");j.setAttribute("align","left");j.setAttribute("valign","middle");d="<img onclick='deleteMyMap("+(dsMyMap.Tables[0].Rows.length-1)+")' src='images/delete.gif' width='16' height='16' />";j.innerHTML=d;m.appendChild(j);h.appendChild(m);m=document.createElement("TR");j=document.createElement("TD");j.setAttribute("height","5px");j.setAttribute("colspan",3);m.appendChild(j);h.appendChild(m);l.appendChild(h);f.appendChild(l);if(iMyMapOpening!=-1){document.getElementById("MyMapListTitle_"+iMyMapOpening).className="blue"}iMyMapOpening=(dsMyMap.Tables[0].Rows.length-1);document.getElementById("MyMapListTitle_"+iMyMapOpening).className="green";document.getElementById("MyMapList_"+iMyMapOpening).style.backgroundColor="#eff9e0";bReadOnly=false;if(dsMyMapCoor==null){dsMyMapCoor=new Object();dsMyMapCoor.Tables=new Array();dsMyMapCoor.Tables[0]=new Object();dsMyMapCoor.Tables[0].Rows=new Array()}var c=document.getElementById("MyMapArea");var b=new Array();b[b.length]="<div id='InforOfMyMap' '>";b[b.length]="<div id='MyMapToolbar' style=' height:30px; position:absolute; top:0px; width:100%; background-color:#ffffff; overflow:hidden;'>";b[b.length]="<table border='0' cellpadding='0' cellspacing='0' bgcolor='#f7f7f7' width='100%' style='height:30px;'>";b[b.length]="<tr style='border-bottom:1px #cccccc solid;'>";b[b.length]="<td><img onmouseover=ChangeImageSrc(this,'images/move_over.gif') onmouseout=ChangeImageSrc(this,'images/move.gif') onclick='selectToolbarBtn(this)' src='images/move.gif' id='btnMove' style='margin-right:4px; margin-left:5px;'/></td>";b[b.length]="<td><img onmouseover=ChangeImageSrc(this,'images/point_over.gif') onmouseout=ChangeImageSrc(this,'images/point.gif') onclick='selectToolbarBtn(this)' src='images/point.gif' id='btnAddPoint' style='margin-right:4px;' /></td>";b[b.length]="<td><img onmouseover=ChangeImageSrc(this,'images/text_over.gif') onmouseout=ChangeImageSrc(this,'images/text.gif') onclick='selectToolbarBtn(this)' src='images/text.gif' id='btnAddText' style='margin-right:4px;' /></td>";b[b.length]="<td><img onmouseover=ChangeImageSrc(this,'images/polyline_over.gif') onmouseout=ChangeImageSrc(this,'images/polyline.gif') onclick='selectToolbarBtn(this)' src='images/polyline.gif' id='btnAddPolyline' style='margin-right:4px;' /></td>";b[b.length]="<td><img onmouseover=ChangeImageSrc(this,'images/polygon_over.gif') onmouseout=ChangeImageSrc(this,'images/polygon.gif') onclick='selectToolbarBtn(this)' src='images/polygon.gif' id='btnAddPolygon' style='margin-right:4px;' /></td>";b[b.length]="<td width='200' align='right' valign='middle'>";if(nLanguage==0){b[b.length]="<button onclick='cancelEditMyMap()' style='cursor:pointer; margin-right:3px;'>Quay lại</button>";b[b.length]="<button onclick='saveMyMap()' id='btnSaveMyMap' style='cursor:pointer; margin-right:3px;'>Lưu</button>";b[b.length]="</td>";b[b.length]="</tr>";b[b.length]="</table>";b[b.length]="</div>";b[b.length]="<div id='MyMapInfo' style='height:90px; position:absolute; top:30px; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";b[b.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow-x:hidden; overflow-y:auto; width:95%; margin-bottom:5px; margin-top:5px; '>";b[b.length]="<tr>";b[b.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Tên </strong></td>";b[b.length]="<td width='81%' height='20' align='left' valign='middle'>";b[b.length]="<input id='txtMapTitle' onkeydown='enableSaveBtn()' type='text' style='width:254px; border: 1px solid rgb(153, 153, 153);' value='Chưa đặt tên' />";b[b.length]="</td></tr>";b[b.length]="<tr>";b[b.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Mô tả </strong></td>";b[b.length]="<td align='left' valign='middle'>";var g=(browserName=="firefox")?2:3;b[b.length]="<textarea rows='"+g+"' id='txtMapDesc' onkeydown='enableSaveBtn()' style='width:250px; font-family:Arial; font-size:12px; border: 1px solid rgb(153, 153, 153);' >"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</textarea>";b[b.length]="</td></tr>";b[b.length]="<tr>";b[b.length]="<td colspan='2' >";b[b.length]="<span><b>Thông tin bổ sung :</b></span>";b[b.length]="<div id='MyMapPropertyInfo' style=' width:100%; margin-left:7px;'>";b[b.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:5px;'>";b[b.length]="<tr>";b[b.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Tên </strong></td>";b[b.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Giá trị </strong></td>";b[b.length]="<td width='10%' height='20' valign='middle' ></td></tr>";b[b.length]="</table>";b[b.length]="</div>";b[b.length]="<div align='right' style='height:20px;'> <a id='AddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('MyMapPropertyInfo','MyMapProInfoChild',undefined,undefined)\"><b>&nbsp;<u>Thêm thông tin bổ sung</u></b></a> </div>";b[b.length]="</td></tr>"}else{b[b.length]="<button onclick='cancelEditMyMap()' style='cursor:pointer; margin-right:3px;'>Back</button>";b[b.length]="<button onclick='saveMyMap()' id='btnSaveMyMap' style='cursor:pointer; margin-right:3px;'>Save</button>";b[b.length]="</td>";b[b.length]="</tr>";b[b.length]="</table>";b[b.length]="</div>";b[b.length]="<div id='MyMapInfo' style='height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";b[b.length]="<div id='MyMapInfo' style='height:90px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";b[b.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow-x:hidden; overflow-y:auto; width:95%; margin-bottom:5px; margin-top:5px; '>";b[b.length]="<tr>";b[b.length]="<td width='21%' height='20' align='left' valign='middle'><strong>Name : </strong></td>";b[b.length]="<td width='78%' height='20' align='left' valign='middle'>";b[b.length]="<input id='txtMapTitle' onkeydown='enableSaveBtn()' type='text' style='width:234px; border: 1px solid rgb(153, 153, 153);' value='Chưa đặt tên' />";b[b.length]="</td></tr>";b[b.length]="<tr>";b[b.length]="<td width='21%' height='20' align='left' valign='middle'><strong>Description: </strong></td>";b[b.length]="<td width='78%' align='left' valign='middle'>";var g=(browserName=="firefox")?2:3;b[b.length]="<textarea rows='"+g+"' id='txtMapDesc' onkeydown='enableSaveBtn()' style='width:230px; font-family:Arial; font-size:12px; border: 1px solid rgb(153, 153, 153);' >"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</textarea>";b[b.length]="</td></tr>";b[b.length]="<tr>";b[b.length]="<td colspan='2' >";b[b.length]="<span><b>Additional information :</b></span>";
b[b.length]="<div id='MyMapPropertyInfo' style='position:relative; width:100%; margin-left:7px;'>";b[b.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:5px;'>";b[b.length]="<tr>";b[b.length]="<td width='45%' height='17' valign='middle' align='center'><strong>Name </strong></td>";b[b.length]="<td width='45%' height='17' valign='middle' align='center'><strong>Value </strong></td>";b[b.length]="<td width='10%' height='17' valign='middle' ></td></tr>";b[b.length]="</table>";b[b.length]="</div>";b[b.length]="<div align='right' style='height:20px; margin-right:10px;'> <a id='AddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('MyMapPropertyInfo','MyMapProInfoChild',undefined,undefined)\"><b>&nbsp;<u>Add information</u></b></a> </div>";b[b.length]="</td></tr>"}b[b.length]="</table>";b[b.length]="</div>";b[b.length]="</div>";b[b.length]="<div id='MyMapCoorList' style='position:absolute; width:100%; height:45%; top:120px; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; border-top:2px #efefef solid;'></div>";c.innerHTML=b.join("");selectToolbarBtn(document.getElementById("btnMove"));disableSaveBtn();AddNewPropertyClick("MyMapPropertyInfo","MyMapProInfoChild")}function createNewMapCallback(b){if(b.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}hideBusyDiv();return}var a=b.value.split("!");dsMyMap.Tables[0].Rows[iMyMapOpening].MyMapID=a[0];dsMyMap.Tables[0].Rows[iMyMapOpening].UserID=a[1];hideBusyDiv()}function deleteMyMap(a){bHaveDeletedMM=a;if(nLanguage==0){var d=confirm("Bạn có thật sự muốn xóa bản đồ này?")}else{var d=confirm("Are you sure to delete this map?")}if(d){if(a==iMyMapOpening){closeMyMap();showMyMapHelp()}var c=dsMyMap.Tables[0].Rows[a].MyMapID;if(nLanguage==0){showBusyDiv("Đang xóa bản đồ")}else{showBusyDiv("Deleting")}AJLocationSearch.DeleteMyMap(c,deleteMyMapCallback);var b=document.getElementById("MyMapList");var e=document.getElementById("MyMapList_"+a);b.removeChild(e)}}function deleteMyMapCoor(b){var a=document.getElementById("MyMapCoorList");var c=document.getElementById("MyMapCoorList_"+b);a.removeChild(c);if(arrMyMapCoorObj[b].actionType=="New"){arrMyMapCoorObj[b].actionType="NoAction"}else{arrMyMapCoorObj[b].actionType="Delete"}map.removeOverlay(arrMyMapCoorObj[b]);clearControlPoint()}function deleteMyMapCallback(a){if(a.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}}hideBusyDiv()}function loadMyMap(){if(!checkLogin()){return}if(dsMyMap==null){if(nLanguage==0){showBusyDiv("Đang tải bản đồ")}else{showBusyDiv("Map loading")}ArrEditProperty=new Array();ArrDeleteProperty=new Array();flagEditProperty=false;ArrPropertyAsLoad=new Array();AJLocationSearch.GetAllMyMap(loadMyMapCallback)}}function loadMyMapCallback(f){if(f.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}hideBusyDiv();return}var c=document.getElementById("MyMapList");dsMyMap=f.value;var e=-1;if(dsMyMap!=null){var a=new Array();for(var b=0;b<dsMyMap.Tables[0].Rows.length;b++){a[a.length]="<table width='95%' border='0' align='center' cellpadding='0' cellspacing='0'";a[a.length]=" id='MyMapList_"+b+"' onclick='loadMyMapCoor("+b+")' onmouseover=ChangeBorderColor(this,'#83c327') onmouseout=ChangeBorderColor(this,'#ffffff') style='border:1px #ffffff solid; cursor:pointer;'>";a[a.length]="<tr>";a[a.length]="<td colspan='3' style='height:5px;'></td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td onmouseover='fnMyMapListOver()' onmouseout='fnMyMapListOut()' width='11%' height='25' align='center' valign='middle'><img src='images/point_mymap.gif' width='19' height='18' /></td>";a[a.length]="<td onmouseover='fnMyMapListOver()' onmouseout='fnMyMapListOut()' width='82%' align='left' valign='middle'><span id='MyMapListTitle_"+b+"' class='blue'>";a[a.length]=dsMyMap.Tables[0].Rows[b].Title+"</span><br /><span id='MyMapListDesc_"+b+"'>";var d=dsMyMap.Tables[0].Rows[b].Description;if(d!=""){a[a.length]=d}else{a[a.length]="&nbsp;&nbsp;&nbsp;"}a[a.length]="</span></td>";a[a.length]="<td width='7%' align='left' valign='middle'><img onmouseover='fnBtnDelMyMapOver()' onmouseout='fnBtnDelMyMapOut()' onclick='deleteMyMap("+b+")' src='images/delete.gif' width='16' height='16' /></td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td colspan='3' style='height:5px;'></td>";a[a.length]="</tr>";a[a.length]="</table>";if(dsMyMap.Tables[0].Rows[b].MyMapID==bSendMyMap){e=b;bSendMyMap=false}}c.innerHTML=a.join("")}hideBusyDiv();if(bSendMyMap==false){loadMyMapCoor(e)}else{var g=bSendMyMap;bSendMyMap=true;loadMyMapCoor(g)}}function loadMyMapCoor(a){if(bSendMyMap){showBusyDiv("Đang nạp bản đồ");AJLocationSearch.GetAllMyCoorML(a,loadMyMapCoorCallback)}else{if(bHaveDeletedMM==a){bHaveDeletedMM=-1;return}bHaveDeletedMM=-1;if(a==iMyMapOpening){closeMyMap();showMyMapHelp();return}closeMyMap();if(iMyMapOpening!=-1){document.getElementById("MyMapListTitle_"+iMyMapOpening).className="blue"}iMyMapOpening=a;document.getElementById("MyMapListTitle_"+iMyMapOpening).className="green";document.getElementById("MyMapList_"+iMyMapOpening).style.backgroundColor="#eff9e0";showBusyDiv("Đang nạp bản đồ");AJLocationSearch.GetAllMyCoor(dsMyMap.Tables[0].Rows[iMyMapOpening].MyMapID,loadMyMapCoorCallback)}}function loadMyMapCoorCallback(a){if(a.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}hideBusyDiv();return}bReadOnly=true;fnLoadMyMapCoor(a);bSendMyMap=false;hideBusyDiv()}function fnLoadMyMapCoor(q){var a=document.getElementById("MyMapArea");a.innerHTML="";dsMyMapCoor=q.value;if(dsMyMapCoor!=null){var r=new Array();r[r.length]="<div id='InforOfMyMap' >";r[r.length]="<div id='MyMapToolbar' style=' position:absolute; height:30px; top:0px; width:100%; background-color:#ffffff; overflow:hidden;'>";r[r.length]="<table border='0' cellpadding='0' cellspacing='0' bgcolor='#f7f7f7' width='100%' >";if(!bSendMyMap){Ds_MyMapProperty=AJLocationSearch.GetMyMapProperty(dsMyMap.Tables[0].Rows[iMyMapOpening].MyMapID).value;map.setCenter(new GeneralMap.LatLng(dsMyMap.Tables[0].Rows[iMyMapOpening].LastPosY,dsMyMap.Tables[0].Rows[iMyMapOpening].LastPosX),dsMyMap.Tables[0].Rows[iMyMapOpening].ZoomLevel);r[r.length]="<tr style='border-bottom:1px #cccccc solid;'>";r[r.length]="<td width='100%' align='right' valign='middle'>";if(nLanguage==0){r[r.length]="<button onclick='editMyMap()' id='btnEditMyMap' style='cursor:pointer; margin-right:3px;'>Chỉnh sửa</button>";r[r.length]="<button onclick='closeMyMap();showMyMapHelp();' id='btnCloseMyMap' style='cursor:pointer; margin-right:3px;'>Đóng</button>";r[r.length]="</td>";r[r.length]="</tr>";r[r.length]="</table>";r[r.length]="</div>";r[r.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";r[r.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow-x:hidden; overflow-y:auto; width:95%; margin-bottom:5px; margin-top:5px; '>";r[r.length]="<tr>";r[r.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Tên </strong></td>";r[r.length]="<td width='81%' height='20' align='left' valign='middle' class='blue'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"</td>";
r[r.length]="</tr>";r[r.length]="<tr>";r[r.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Mô tả </strong></td>";r[r.length]="<td width='81%' align='left' valign='middle'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</td>";r[r.length]="</tr>";if(Ds_MyMapProperty!=null&&Ds_MyMapProperty.Tables[0].Rows.length>0){r[r.length]="</table>";r[r.length]="<table width='100%'>";r[r.length]="<tr>";r[r.length]="<td colspan='2'><span><b>Thông tin bổ sung :</b></span></td>";r[r.length]="</tr>";r[r.length]="<tr>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Tên </strong></td>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Giá trị </strong></td>";r[r.length]="</tr>";for(var n=0;n<Ds_MyMapProperty.Tables[0].Rows.length;n++){r[r.length]="<tr>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[n].property_name+"</td>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[n].property_value+"</td>";r[r.length]="</tr>"}}}else{r[r.length]="<button onclick='editMyMap()' id='btnEditMyMap' style='cursor:pointer; margin-right:3px;'>Edit</button>";r[r.length]="<button onclick='closeMyMap();showMyMapHelp();' id='btnCloseMyMap' style='cursor:pointer; margin-right:3px;'>Close</button>";r[r.length]="</td>";r[r.length]="</tr>";r[r.length]="</table>";r[r.length]="</div>";r[r.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";r[r.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:95%; margin-bottom:5px; margin-top:5px; '>";r[r.length]="<tr>";r[r.length]="<td width='30%' height='20' align='left' valign='middle'><strong>Name </strong></td>";r[r.length]="<td width='69%' height='20' align='left' valign='middle' class='blue'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"</td>";r[r.length]="</tr>";r[r.length]="<tr>";r[r.length]="<td width='30%' height='20' align='left' valign='middle'><strong>Description </strong></td>";r[r.length]="<td width='69%' align='left' valign='middle'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</td>";r[r.length]="</tr>";if(Ds_MyMapProperty!=null&&Ds_MyMapProperty.Tables[0].Rows.length>0){r[r.length]="</table>";r[r.length]="<table width='100%'>";r[r.length]="<tr>";r[r.length]="<td colspan='2'><span><b>Addition information :</b></span></td>";r[r.length]="</tr>";r[r.length]="<tr>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Name </strong></td>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Value </strong></td>";r[r.length]="</tr>";for(var n=0;n<Ds_MyMapProperty.Tables[0].Rows.length;n++){r[r.length]="<tr>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[n].property_name+"</td>";r[r.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[n].property_value+"</td>";r[r.length]="</tr>"}}}}r[r.length]="</table>";r[r.length]="</div>";r[r.length]="</div>";var t=document.getElementById("leftpanel").style.height;t=t.substr(0,t.length-2);var j=parseInt(t);var d=j*28/100;var g=j-(d+145);r[r.length]="<div id='MyMapCoorList' style='position:absolute; width:100%; top:120px; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; border-top:2px #efefef solid; height:"+g+"px; '>";for(var n=0;n<dsMyMapCoor.Tables[0].Rows.length;n++){var u=(dsMyMapCoor.Tables[0].Rows[n].Style).toString().split(";");var p=dsMyMapCoor.Tables[0].Rows[n].Coor;r[r.length]="<table id='MyMapCoorList_"+n+"' onclick='clickedPoint=null;showMyMapInfoWindow("+n+", 0)' width='95%' border='0' cellpadding='0' cellspacing='0' style='cursor:pointer;'";r[r.length]=" onmouseover=changeCoorTextStyle("+n+") onmouseout=changeCoorTextStyle("+n+") style='margin-top:5px; margin-bottom:5px; margin-left:5px;'>";r[r.length]="<tr>";r[r.length]="<td width='13%' rowspan='2' align='center' valign='middle'>";if(p.indexOf("POINT")>=0){var s=p.substring(6,p.indexOf(")"));while(s.indexOf(")")!=-1){s=s.replace(")","")}while(s.indexOf("(")!=-1){s=s.replace("(","")}while(s.indexOf(" ")!=-1){s=s.replace(" ",",")}if(u.length>=6&&u[5].length>0){r[r.length]="<img src='images/icon_text.gif' /></td>";var b=new GeneralMap.TextStyle(parseInt(u[2]),u[0],u[1],u[3]);var f=new GeneralMap.Text(s,u[5],b);f.type=MYMAPOBJ;f.mmIndex=nMyMapCoorObj;f.actionType="NoAction";map.addOverlay(f);arrMyMapCoorObj[nMyMapCoorObj]=f;nMyMapCoorObj++;GeneralMap.Event.addListener(f,"dragend",function(k){if(k.actionType!="New"){k.actionType="Edit"}enableSaveBtn()})}else{r[r.length]="<img id='MyMapCoorListImg_"+n+"' src='images/MyMap_icon/"+u[4]+".gif' width='32px' height='32px' /></td>";var c=new GeneralMap.Marker(s,new GeneralMap.Icon("images/MyMap_icon/"+u[4]+".gif",new GeneralMap.Size(32,32)));c.type=MYMAPOBJ;c.mmIndex=nMyMapCoorObj;c.actionType="NoAction";map.addOverlay(c);arrMyMapCoorObj[nMyMapCoorObj]=c;nMyMapCoorObj++;GeneralMap.Event.addListener(c,"dragend",function(k){if(k.actionType!="New"){k.actionType="Edit"}enableSaveBtn()})}}else{if(p.indexOf("LINESTRING")>=0){r[r.length]="<img src='images/icon_polyline.gif' /></td>";var s=p.substring(11,p.indexOf(")"));while(s.indexOf(")")!=-1){s=s.replace(")","")}while(s.indexOf("(")!=-1){s=s.replace("(","")}while(s.indexOf(" ")!=-1){s=s.replace(" ",",")}var h=new GeneralMap.Polyline(s,u[1],parseFloat(u[0]),u[2],parseFloat(u[3]));h.type=MYMAPOBJ;h.mmIndex=nMyMapCoorObj;h.actionType="NoAction";map.addOverlay(h);arrMyMapCoorObj[nMyMapCoorObj]=h;nMyMapCoorObj++;GeneralMap.Event.addListener(h,"mouseover",function(){showControlPoint(h)})}else{if(p.indexOf("POLYGON")>=0){r[r.length]="<img src='images/icon_polygon.gif' /></td>";var s=p.substring(9,p.indexOf("))"));while(s.indexOf(")")!=-1){s=s.replace(")","")}while(s.indexOf("(")!=-1){s=s.replace("(","")}while(s.indexOf(" ")!=-1){s=s.replace(" ",",")}var o=(u[4]=="")?0.5:u[4];var e=new GeneralMap.Polygon(s,u[1],parseFloat(u[0]),u[2],o,parseFloat(u[3]));e.type=MYMAPOBJ;e.mmIndex=nMyMapCoorObj;e.actionType="NoAction";e.reductionTol=0;map.addOverlay(e);arrMyMapCoorObj[nMyMapCoorObj]=e;nMyMapCoorObj++;GeneralMap.Event.addListener(e,"mouseover",function(){showControlPoint(e)})}}}r[r.length]="<td width='87%' height='20' align='left' valign='middle'>";r[r.length]="<span id='MyMapCoorListTitle_"+n+"' style='color:#0066cc; font-weight:bold;' >";r[r.length]=dsMyMapCoor.Tables[0].Rows[n].ObjectTitle+"</span><br /><span id='MyMapCoorListDesc_"+n+"' >";var m=dsMyMapCoor.Tables[0].Rows[n].ObjectDesc;if(m!=""&&m!=null){r[r.length]=m}else{r[r.length]="&nbsp;&nbsp;&nbsp;"}r[r.length]="</span></td>";r[r.length]="</tr>";r[r.length]="</table>"}r[r.length]="</div>";a.innerHTML=r.join("");var l=0}}function disableSaveBtn(){var a=document.getElementById("btnSaveMyMap");if(a!=null){a.style.filter="alpha(opacity = 40)";a.style.opacity=0.4;a.onmouseover=null}bEditMMObj=false}function enableSaveBtn(){var a=document.getElementById("btnSaveMyMap");if(a!=null){a.style.filter="";a.style.opacity=1}bEditMMObj=true}function editMyMap(){bReadOnly=false;map.closeInfoWindow();var b=document.getElementById("InforOfMyMap");var f=new Array();f[f.length]="<div id='MyMapToolbar' style=' position:absolute; height:30px; top:0px; width:100%; background-color:#ffffff; overflow:hidden;'>";f[f.length]="<table border='0' cellpadding='0' cellspacing='0' bgcolor='#f7f7f7' width='100%' style='height:30px;'>";f[f.length]="<tr style='border-bottom:1px #cccccc solid;'>";f[f.length]="<td><img onmouseover=ChangeImageSrc(this,'images/move_over.gif') onmouseout=ChangeImageSrc(this,'images/move.gif') onclick='selectToolbarBtn(this)' src='images/move.gif' id='btnMove' style='margin-right:4px; margin-left:5px;'/></td>";f[f.length]="<td><img onmouseover=ChangeImageSrc(this,'images/point_over.gif') onmouseout=ChangeImageSrc(this,'images/point.gif') onclick='selectToolbarBtn(this)' src='images/point.gif' id='btnAddPoint' style='margin-right:4px;' /></td>";
f[f.length]="<td><img onmouseover=ChangeImageSrc(this,'images/text_over.gif') onmouseout=ChangeImageSrc(this,'images/text.gif') onclick='selectToolbarBtn(this)' src='images/text.gif' id='btnAddText' style='margin-right:4px;' /></td>";f[f.length]="<td><img onmouseover=ChangeImageSrc(this,'images/polyline_over.gif') onmouseout=ChangeImageSrc(this,'images/polyline.gif') onclick='selectToolbarBtn(this)' src='images/polyline.gif' id='btnAddPolyline' style='margin-right:4px;' /></td>";f[f.length]="<td><img onmouseover=ChangeImageSrc(this,'images/polygon_over.gif') onmouseout=ChangeImageSrc(this,'images/polygon.gif') onclick='selectToolbarBtn(this)' src='images/polygon.gif' id='btnAddPolygon' style='margin-right:4px;' /></td>";f[f.length]="<td width='200' align='right' valign='middle'>";if(nLanguage==0){f[f.length]="<button onclick='cancelEditMyMap()' style='cursor:pointer; margin-right:3px;'>Quay lại</button>";f[f.length]="<button onclick='saveMyMap()' id='btnSaveMyMap' style='cursor:pointer; margin-right:3px;'>Lưu</button>";f[f.length]="</td>";f[f.length]="</tr>";f[f.length]="</table>";f[f.length]="</div>";f[f.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";f[f.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow-x:hidden; overflow-y:auto; width:95%; margin-bottom:5px; margin-top:5px; border-bottom:1px #efefef solid;'>";f[f.length]="<tr>";f[f.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Tên </strong></td>";f[f.length]="<td width='81%' height='20' align='left' valign='middle'>";f[f.length]="<input id='txtMapTitle' onkeydown='enableSaveBtn()' type='text' style='width:250px; border: 1px solid rgb(153, 153, 153);' value='"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"' />";f[f.length]="</td></tr>";f[f.length]="<tr>";f[f.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Mô tả </strong></td>";f[f.length]="<td align='left' valign='middle'>";var g=(browserName=="firefox")?2:3;f[f.length]="<textarea rows='"+g+"' id='txtMapDesc' onkeydown='enableSaveBtn()' style='width:250px; font-family:Arial; font-size:11px; border: 1px solid rgb(153, 153, 153);' >"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</textarea>";f[f.length]="</td></tr>";f[f.length]="<tr>";f[f.length]="<td colspan='2' >";f[f.length]="<span><b>Thông tin bổ sung :</b></span></ br>";f[f.length]="<div id='MyMapPropertyInfo' style='position:relative;width:95%; margin-left:4px ;'>";f[f.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:0px;'>";f[f.length]="<tr>";f[f.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Tên </strong></td>";f[f.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Giá trị </strong></td>";f[f.length]="<td width='10%' height='20' valign='middle' ></td></tr>";f[f.length]="</table>";f[f.length]="</div>";f[f.length]="<div align='right' style='height:20px;'> <a id='CoorAddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('MyMapPropertyInfo','MyMapProInfoChild',undefined,undefined)\"><b>&nbsp;<u>Thêm thông tin bổ sung</u>&nbsp;&nbsp;</b></a> </div>";f[f.length]="</td></tr>"}else{f[f.length]="<button onclick='cancelEditMyMap()' style='cursor:pointer; margin-right:3px;'>Back</button>";f[f.length]="<button onclick='saveMyMap()' id='btnSaveMyMap' style='cursor:pointer; margin-right:3px;'>Save</button>";f[f.length]="</td>";f[f.length]="</tr>";f[f.length]="</table>";f[f.length]="</div>";f[f.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";f[f.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:95%; margin-bottom:5px; margin-top:5px; border-bottom:1px #efefef solid;'>";f[f.length]="<tr>";f[f.length]="<td width='30%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Name </strong></td>";f[f.length]="<td width='19%' height='20' align='left' valign='middle'>";f[f.length]="<input id='txtMapTitle' onkeydown='enableSaveBtn()' type='text' style='width:244px; border: 1px solid rgb(153, 153, 153);' value='"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"' />";f[f.length]="</td></tr>";f[f.length]="<tr>";f[f.length]="<td width='30%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Description </strong></td>";f[f.length]="<td width='69%' align='left' valign='middle'>";var g=(browserName=="firefox")?2:3;f[f.length]="<textarea rows='"+g+"' id='txtMapDesc' onkeydown='enableSaveBtn()' style='width:240px; font-family:Arial; font-size:11px; border: 1px solid rgb(153, 153, 153);' >"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</textarea>";f[f.length]="</td></tr>";f[f.length]="<tr>";f[f.length]="<td colspan='2' >";f[f.length]="<span><b>Additional information :</b></span></ br>";f[f.length]="<div id='MyMapPropertyInfo' style='position:relative;width:95%; margin-left:4px ;'>";f[f.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:0px;'>";f[f.length]="<tr>";f[f.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Name </strong></td>";f[f.length]="<td width='45%' height='20' valign='middle' align='center'><strong>value </strong></td>";f[f.length]="<td width='10%' height='20' valign='middle' ></td></tr>";f[f.length]="</table>";f[f.length]="</div>";f[f.length]="<div align='right' style='height:20px;'> <a id='CoorAddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('MyMapPropertyInfo','MyMapProInfoChild',undefined,undefined)\"><b>&nbsp;<u>Add information </u>&nbsp;&nbsp;</b></a> </div>";f[f.length]="</td></tr>"}f[f.length]="</table>";f[f.length]="</div>";b.innerHTML=f.join("");var j=document.getElementById("btnMove");var e=document.getElementById("btnAddPoint");var a=document.getElementById("btnAddText");var c=document.getElementById("btnAddPolyline");var h=document.getElementById("btnAddPolygon");GeneralMap.Event.addDOMListener(j,"mouseover",function(){if(nLanguage==0){showTip("Chọn/chỉnh sửa địa điểm")}else{showTip("Select/edit place")}});GeneralMap.Event.addDOMListener(j,"mouseout",function(){closeTip()});GeneralMap.Event.addDOMListener(e,"mouseover",function(){if(nLanguage==0){showTip("Thêm điểm")}else{showTip("Add point")}});GeneralMap.Event.addDOMListener(e,"mouseout",function(){closeTip()});GeneralMap.Event.addDOMListener(a,"mouseover",function(){if(nLanguage==0){showTip("Thêm điểm")}else{showTip("Add point")}});GeneralMap.Event.addDOMListener(a,"mouseout",function(){closeTip()});GeneralMap.Event.addDOMListener(c,"mouseover",function(){if(nLanguage==0){showTip("Thêm đường")}else{showTip("Add polyline")}});GeneralMap.Event.addDOMListener(c,"mouseout",function(){closeTip()});GeneralMap.Event.addDOMListener(h,"mouseover",function(){if(nLanguage==0){showTip("Thêm vùng")}else{showTip("Add polygon")}});GeneralMap.Event.addDOMListener(h,"mouseout",function(){closeTip()});if(Ds_MyMapProperty!=null&&Ds_MyMapProperty.Tables[0].Rows.length>0){for(var d=0;d<Ds_MyMapProperty.Tables[0].Rows.length;d++){AddNewPropertyClick("MyMapPropertyInfo","MyMapProInfoChild",Ds_MyMapProperty.Tables[0].Rows[d].property_name,Ds_MyMapProperty.Tables[0].Rows[d].property_value)}}else{AddNewPropertyClick("MyMapPropertyInfo","MyMapProInfoChild")}disableSaveBtn();selectToolbarBtn(document.getElementById("btnMove"));for(var d=0;d<nMyMapCoorObj;d++){if(arrMyMapCoorObj[d].vType()=="VMarker"||arrMyMapCoorObj[d].vType()=="VText"){arrMyMapCoorObj[d].enableDragging()
}}}function cancelEditMyMap(){closeTip(true);selTbrButton=null;bReadOnly=true;map.closeInfoWindow();clearControlPoint();var c=document.getElementById("InforOfMyMap");var a=new Array();a[a.length]="<div id='MyMapToolbar' style=' position:absolute; height:30px; top:0px; width:100%; background-color:#ffffff; overflow:hidden;'>";a[a.length]="<table border='0' cellpadding='0' cellspacing='0' bgcolor='#f7f7f7' width='100%' style='height:30px;'>";a[a.length]="<tr style='border-bottom:1px #cccccc solid;'>";a[a.length]="<td width='100%' align='right' valign='middle'>";if(nLanguage==0){a[a.length]="<button onclick='editMyMap()' id='btnEditMyMap' style='cursor:pointer; margin-right:3px;'>Chỉnh sửa</button>";a[a.length]="<button onclick='closeMyMap();showMyMapHelp();' id='btnCloseMyMap' style='cursor:pointer; margin-right:3px;'>Đóng</button>";a[a.length]="</td>";a[a.length]="</tr>";a[a.length]="</table>";a[a.length]="</div>";a[a.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";a[a.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:95%; margin-bottom:5px; margin-top:5px; '>";a[a.length]="<tr>";a[a.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Tên </strong></td>";a[a.length]="<td width='81%' height='20' align='left' valign='middle' class='blue'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"</td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td width='19%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Mô tả </strong></td>";a[a.length]="<td align='left' valign='middle'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</td>";a[a.length]="</tr>";if(Ds_MyMapProperty!=null&&Ds_MyMapProperty.Tables[0].Rows.length>0){a[a.length]="</table>";a[a.length]="<table width='100%'>";a[a.length]="<tr>";a[a.length]="<td colspan='2'><span><b>Thông tin bổ sung :</b></span></td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Tên </strong></td>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Giá trị </strong></td>";a[a.length]="</tr>";for(var b=0;b<Ds_MyMapProperty.Tables[0].Rows.length;b++){a[a.length]="<tr>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[b].property_name+"</td>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[b].property_value+"</td>";a[a.length]="</tr>"}}}else{a[a.length]="<button onclick='editMyMap()' id='btnEditMyMap' style='cursor:pointer; margin-right:3px;'>Edit</button>";a[a.length]="<button onclick='closeMyMap();showMyMapHelp();' id='btnCloseMyMap' style='cursor:pointer; margin-right:3px;'>Close</button>";a[a.length]="</td>";a[a.length]="</tr>";a[a.length]="</table>";a[a.length]="</div>";a[a.length]="<div id='MyMapInfo' style=' height:90px; top:30px; position:absolute; width:100%; background-color:#ffffff; overflow-x:hidden; overflow-y:auto; '>";a[a.length]="<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:95%; margin-bottom:5px; margin-top:5px;'>";a[a.length]="<tr>";a[a.length]="<td width='30%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Name </strong></td>";a[a.length]="<td width='69%' height='20' align='left' valign='middle' class='blue'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Title+"</td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td width='30%' height='20' align='left' valign='middle'>&nbsp;&nbsp;<strong>Description </strong></td>";a[a.length]="<td width='69%' align='left' valign='middle'>"+dsMyMap.Tables[0].Rows[iMyMapOpening].Description+"</td>";a[a.length]="</tr>";if(Ds_MyMapProperty!=null&&Ds_MyMapProperty.Tables[0].Rows.length>0){a[a.length]="</table>";a[a.length]="<table width='100%'>";a[a.length]="<tr>";a[a.length]="<td colspan='2'><span><b>Addition information :</b></span></td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Name </strong></td>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'><strong>Value </strong></td>";a[a.length]="</tr>";for(var b=0;b<Ds_MyMapProperty.Tables[0].Rows.length;b++){a[a.length]="<tr>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[b].property_name+"</td>";a[a.length]="<td width='50%' height='17' valign='middle' align='center'>"+Ds_MyMapProperty.Tables[0].Rows[b].property_value+"</td>";a[a.length]="</tr>"}}}a[a.length]="</table>";a[a.length]="</div>";c.innerHTML=a.join("");for(var b=0;b<nMyMapCoorObj;b++){if(arrMyMapCoorObj[b].vType()=="VMarker"||arrMyMapCoorObj[b].vType()=="VText"){arrMyMapCoorObj[b].disableDragging()}}}var ArrEditProperty=new Array();var ArrDeleteProperty=new Array();function saveMyMap(){if(!bEditMMObj){return}if(nLanguage==0){showBusyDiv("Đang lưu bản đồ")}else{showBusyDiv("Saving")}var C=new Array();var b=new Array();var r=new Array();var a=new Array();for(var v=0;v<nMyMapCoorObj;v++){if(arrMyMapCoorObj[v].actionType!="NoAction"){var A="";if(arrMyMapCoorObj[v].actionType!="Delete"){if(arrMyMapCoorObj[v].vType()=="VMarker"||arrMyMapCoorObj[v].vType()=="VText"){var l=arrMyMapCoorObj[v].getLatLng();A="POINT("+l.lng()+" "+l.lat()+")"}else{if(arrMyMapCoorObj[v].vType()=="VPolyline"){var g=arrMyMapCoorObj[v].getLatLngs();A="LINESTRING(";for(var u=0;u<g.length;u++){A+=g[u].lng()+" "+g[u].lat();if(u<g.length-1){A+=","}}A+=")"}else{if(arrMyMapCoorObj[v].vType()=="VPolygon"){var g=arrMyMapCoorObj[v].getLatLngs();A="POLYGON((";for(var u=0;u<g.length;u++){A+=g[u].lng()+" "+g[u].lat();if(u<g.length-1){A+=","}}A+="))"}}}}var q=dsMyMapCoor.Tables[0].Rows[v];var w=(q.MyMapCoorID!="")?q.MyMapCoorID:"null";var y=(q.ObjectTitle!="")?q.ObjectTitle:"null";var p=(q.ObjectDesc!="")?q.ObjectDesc:"null";var h=(A!="")?A:"null";var s=(q.Style!="")?q.Style:"null";var f=(q.Public!="")?q.Public:"0";if(arrMyMapCoorObj[v].actionType=="New"){if(q.Property!=undefined&&q.Property!=null){C[C.length]=y+"!"+p+"!"+h+"!"+s+"!"+f+"!-"+(v+1);for(var u=0;u<q.Property.length;u++){q.Property[u].MyMapCoorID=(v+1)*(-1);a[a.length]=q.Property[u]}}else{C[C.length]=y+"!"+p+"!"+h+"!"+s+"!"+f+"0"}}else{if(arrMyMapCoorObj[v].actionType=="Edit"){b[b.length]=w+"!"+y+"!"+p+"!"+h+"!"+s+"!"+f}else{if(arrMyMapCoorObj[v].actionType=="Delete"){r[r.length]=w}}}}}var t=C.join("!!");var z=b.join("!!");var B=r.join("!!");var q=dsMyMap.Tables[0].Rows[iMyMapOpening];var k=map.getCenter();var c=document.getElementById("txtMapTitle").value;var n=document.getElementById("txtMapDesc").value;var x=q.MyMapID+"!!"+c+"!!"+n+"!!"+map.getLevel()+"!!"+k.lng()+"!!"+k.lat();var m=GetPropertyForUpdate("MyMapPropertyInfo",Ds_MyMapProperty);var o="";if(ArrDeleteProperty!=null&&ArrDeleteProperty.length>0){for(var v=0;v<ArrDeleteProperty.length-1;v++){o+=ArrDeleteProperty[v].MyMapCoor_property_value_id+","}o+=ArrDeleteProperty[ArrDeleteProperty.length-1].MyMapCoor_property_value_id}AJLocationSearch.SaveMyMap(x,t,z,B,m,a,ArrEditProperty,o,saveMyMapCallback);ArrEditProperty=new Array();ArrDeleteProperty=new Array();flagEditProperty=false;ArrPropertyAsLoad=new Array();var e=document.getElementById("txtMapTitle").value;var d=document.getElementById("txtMapDesc").value;dsMyMap.Tables[0].Rows[iMyMapOpening].Title=e;dsMyMap.Tables[0].Rows[iMyMapOpening].Description=d;dsMyMap.Tables[0].Rows[iMyMapOpening].ZoomLevel=map.getLevel();dsMyMap.Tables[0].Rows[iMyMapOpening].LastPosX=k.lng();dsMyMap.Tables[0].Rows[iMyMapOpening].LastPosY=k.lat();Ds_MyMapProperty=null;if(browserName=="msie"){document.getElementById("MyMapListTitle_"+iMyMapOpening).innerText=e;document.getElementById("MyMapListDesc_"+iMyMapOpening).innerText=d}else{document.getElementById("MyMapListTitle_"+iMyMapOpening).firstChild.nodeValue=e;
document.getElementById("MyMapListDesc_"+iMyMapOpening).firstChild.nodeValue=d}}function saveMyMapCallback(b){if(b.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}hideBusyDiv();return}if(b.value!=null){var a=iMyMapOpening;closeMyMap();if(iMyMapOpening!=-1){document.getElementById("MyMapListTitle_"+iMyMapOpening).className="blue"}iMyMapOpening=a;document.getElementById("MyMapListTitle_"+iMyMapOpening).className="green";document.getElementById("MyMapList_"+iMyMapOpening).style.backgroundColor="#eff9e0";fnLoadMyMapCoor(b);editMyMap()}hideBusyDiv();if(bWaitingCreateNewMap){fnCreateNewMap();bWaitingCreateNewMap=false}}function closeMyMap(){clearControlPoint();map.closeInfoWindow();iMyMapCoorOver=-1;for(var a=0;a<nMyMapCoorObj;a++){if(arrMyMapCoorObj[a].actionType!="Delete"){map.removeOverlay(arrMyMapCoorObj[a])}}arrMyMapCoorObj=new Array();nMyMapCoorObj=0;dsMyMapCoor=null;if(iMyMapOpening!=-1){document.getElementById("MyMapListTitle_"+iMyMapOpening).className="blue";document.getElementById("MyMapList_"+iMyMapOpening).style.backgroundColor="#ffffff"}iMyMapOpening=-1}function showMyMapHelp(){var b=document.getElementById("MyMapArea");var a=new Array();a[a.length]="<table align='left' border='0' cellpadding='0' cellspacing='0' style='width:310px; margin-top:5px; margin-left:5px;'>";a[a.length]="<tr>";a[a.length]="<td width='1' height='20' align='center' valign='middle'></td>";a[a.length]="<td height='20' colspan='2' align='left' valign='middle'><img src='images/iconhelp.gif' align='absmiddle'/><span style='font-size:12px; color:#dd6611;'><strong>Hướng dẫn tạo bản đồ của tôi</strong></span></td>";a[a.length]="</tr>";a[a.length]="<tr>";a[a.length]="<td height='65' colspan='3' align='left' valign='top'>";a[a.length]="<div align='justify'><br/>";if(nLanguage==0){a[a.length]="Bạn phải đăng nhập vào Vietbando để có thể tạo bản đồ riêng cho bạn.<br/><br/>";a[a.length]="Click vào thanh công cụ bên trái bản đồ để thêm các điểm, đường, vùng, nhãn, vào bản đồ của bạn.";a[a.length]="<br/><br/>";a[a.length]="Nhập thông tin về tên, mô tả của các đối tượng, nhấn nút lưu để lưu lại bản đồ.";a[a.length]=" Bạn cũng có thể thêm, xóa, sửa bản đồ của mình. <br/>";a[a.length]="<p align=left>";a[a.length]="<div id='MMOnlineSupport' onclick='showOnlineSupport(this)' style='cursor:pointer;'><img align='bottom' src='images/xuong.gif' width='16' height='16' /><span class='listofprovinces'><strong>Hỗ trợ kỹ thuật</strong></span></div>"}else{a[a.length]="Create your new map.You must login Vietbando.<br/><br/>";a[a.length]="Click on left toolbar to put point, line, region, label on your map.";a[a.length]="<br/><br/>";a[a.length]='Type information for object name, object descriptrion and press "Save" button to save your map.';a[a.length]=" You can insert, delete, edit your map. <br/>";a[a.length]="<p align=left>";a[a.length]="<div id='MMOnlineSupport' onclick='showOnlineSupport(this)' style='cursor:pointer;'><img align='bottom' src='images/xuong.gif' width='16' height='16' /><span class='listofprovinces'><strong>Online support</strong></span></div>"}a[a.length]="</p>";a[a.length]="</div>";a[a.length]="</td>";a[a.length]="</tr>";a[a.length]="</table>";b.innerHTML=a.join("")}function saveMyMapCoor(){var h=document.getElementById("txtTitle").value;var a=document.getElementById("txtDesc").value;var k=document.getElementById("chkPublic").checked;if(k){k=1}else{k=0}dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].ObjectTitle=h;dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].ObjectDesc=a;dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Public=k;if(browserName=="msie"){document.getElementById("MyMapCoorListTitle_"+iMyMapCoorSel).innerText=h;document.getElementById("MyMapCoorListDesc_"+iMyMapCoorSel).innerText=a}else{document.getElementById("MyMapCoorListTitle_"+iMyMapCoorSel).firstChild.nodeValue=h;document.getElementById("MyMapCoorListDesc_"+iMyMapCoorSel).firstChild.nodeValue=a}var f=arrMyMapCoorObj[iMyMapCoorSel];if(f.actionType!="New"){f.actionType="Edit";if(flagEditProperty){var l=new Array();var b=dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].MyMapCoorID;for(var e=0;e<ArrEditProperty.length;e++){if(ArrEditProperty[e].MyMapCoorID!=b){l.push(ArrEditProperty[e])}}ArrEditProperty=l;l=new Array();for(var e=0;e<ArrDeleteProperty.length;e++){if(ArrDeleteProperty[e].MyMapCoorID!=b){l.push(ArrDeleteProperty[e])}}ArrDeleteProperty=l;GetCoorPropertyForUpdate("CoorPropertyInfo")}dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property=GetProperty("CoorPropertyInfo")}else{dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property=GetProperty("CoorPropertyInfo")}if(f.vType()=="VMarker"){var m=document.getElementById("btnShowPro").src;m=m.substring(m.lastIndexOf("/")+1,m.lastIndexOf("."));dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Style=";;;;"+m+";";f.setIcon(new GeneralMap.Icon("images/MyMap_icon/"+m+".gif",new GeneralMap.Size(32,32)));document.getElementById("MyMapCoorListImg_"+iMyMapCoorSel).src="images/MyMap_icon/"+m+".gif";var c=f.getLatLng();dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Coor="POINT("+c.lng()+" "+c.lat()+")"}else{if(f.vType()=="VText"){if(curText!=""){dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Style=curFontWeight+";"+curFontColor+";"+curFontSize+";"+curFontFamily+";;"+curText;var g=new GeneralMap.TextStyle(curFontSize,curFontWeight,curFontColor,curFontFamily);f.setText(curText,g);var c=f.getLatLng();dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Coor="POINT("+c.lng()+" "+c.lat()+")"}}else{if(f.vType()=="VPolyline"){if(curLineColor!=""){dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Style=curLineWidth+";"+curLineColor+";"+curLineColor+";"+(parseFloat(curLineOpacity)/100)+";;";f.setStyle(curLineColor,parseFloat(curLineWidth),curLineColor,parseFloat(curLineOpacity)/100);var j=f.getLatLngs();var d="LINESTRING(";for(var e=0;e<j.length;e++){d+=j[e].lng()+" "+j[e].lat();if(e<j.length-1){d+=","}}d+=")";dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Coor=d}}else{if(f.vType()=="VPolygon"){if(curLineColor!=""){dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Style=curLineWidth+";"+curLineColor+";"+curFillColor+";"+(parseFloat(curLineOpacity)/100)+";"+(parseFloat(curFillOpacity)/100)+";";f.setStyle(curLineColor,parseFloat(curLineWidth),curFillColor,parseFloat(curLineOpacity)/100,parseFloat(curFillOpacity)/100);var j=f.getLatLngs();var d="POLYGON((";for(var e=0;e<j.length;e++){d+=j[e].lng()+" "+j[e].lat();if(e<j.length-1){d+=","}}d+="))";dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Coor=d}}}}}map.closeInfoWindow()}var ArrPropertyAsLoad=new Array();function showMyMapInfoWindow(p,e){if(p>=dsMyMapCoor.Tables[0].Rows.length){return}changeCoorBkColor(iMyMapCoorSel,false);changeCoorBkColor(p,true);iMyMapCoorSel=p;var n=dsMyMapCoor.Tables[0].Rows[p].MyMapCoorID;if(n!=""&&(dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property==null||dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property==undefined)){var g=null;g=AJLocationSearch.GetMyMapCoorProperty(parseInt(dsMyMapCoor.Tables[0].Rows[p].MyMapCoorID)).value;if(g!=null&&g.length>0){dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property=g;var c=ArrPropertyAsLoad.length;ArrPropertyAsLoad[c]=new Object();ArrPropertyAsLoad[c].id=n;ArrPropertyAsLoad[c].value=g}}var m=arrMyMapCoorObj[p];var b=(dsMyMapCoor.Tables[0].Rows[p].Style).toString().split(";");var l=new Array();if(bReadOnly){if(nLanguage==0){l[l.length]="<table><tr><td  align='left' colspan='2'><span class='green'>Thông tin địa điểm</span></td></tr>";l[l.length]="<tr><td align='left' valign='middle' style='width:60px; ' ><span class='blue'>Tên</span></td>";l[l.length]="<td  align='left' valign='middle' style='width:200px; '>";l[l.length]=dsMyMapCoor.Tables[0].Rows[p].ObjectTitle+"</td></tr>";l[l.length]="<tr><td align='left' valign='middle' style='width:60px; '><span class='blue'>Mô tả</span></td><td align='left' valign='middle' style='width:200px; '>"}else{l[l.length]="<table><tr><td  align='left' colspan='2'><span class='green'>Place information</span></td></tr>";
l[l.length]="<tr><td  align='left' valign='middle' style='width:60px; '><span class='blue'>Name</span></td>";l[l.length]="<td align='left' valign='middle' style='width:200px; '>";l[l.length]=dsMyMapCoor.Tables[0].Rows[p].ObjectTitle+"</td></tr>";l[l.length]="<tr><td align='left' valign='middle'><span class='blue'>Description</span></td><td align='left' valign='middle'  >"}var a=dsMyMapCoor.Tables[0].Rows[p].ObjectDesc;if(a!=""){l[l.length]=a}else{l[l.length]="&nbsp;&nbsp;&nbsp;"}l[l.length]="</td></tr>";var o=dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property;if(o!=undefined&&o!=null&&o.length>0){l[l.length]="<tr>";l[l.length]="<td colspan='2'><span><b>Thông tin bổ sung :</b></span></td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td width='50%' height='20' valign='middle' align='center'><strong>Tên </strong></td>";l[l.length]="<td width='50%' height='20' valign='middle' align='center'><strong>Giá trị </strong></td>";l[l.length]="</tr>";for(var h=0;h<o.length;h++){l[l.length]="<tr>";l[l.length]="<td width='50%' height='20' valign='middle' align='center'>"+o[h].property_name+"</td>";l[l.length]="<td width='50%' height='20' valign='middle' align='center'>"+o[h].property_value+"</td>";l[l.length]="</tr>"}}l[l.length]="</table>"}else{var f="";if(nLanguage==0){var k="Thay đổi thuộc tính"}else{var k="Change attribute"}if(m.vType()=="VMarker"){if(curIcon==""){f="mymap_icon/"+b[4]}else{f="mymap_icon/"+curIcon}if(nLanguage==0){k="Chọn biểu tượng"}else{k="Choice symbol"}}else{if(m.vType()=="VText"){f="icon_text"}else{if(m.vType()=="VPolyline"){f="icon_polyline"}else{if(m.vType()=="VPolygon"){f="icon_polygon"}}}}var j;if(nLanguage==0){if(bCreateNewMMObj){j="Tạo mới địa điểm"}else{j="Cập nhật địa điểm"}l[l.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:250px; '>";l[l.length]="<tr>";l[l.length]="<td width='220' align='left' valign='middle' style='height:32px;'><img src='images/spacer.gif' width='2' height='25' align='texttop' /><span style='color:#0066cc; font-size:12px; font-weight:bold;'>"+j+"</span></td>";l[l.length]="<td width='60' style='height:32px;'><span style='float:none; width:32px; height:32px;'>";l[l.length]="<img id='btnShowPro' src='images/"+f+".gif' style='cursor:pointer;' alt='"+k+"'/></span></td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' align='left' valign='top'>";l[l.length]="<div style='font-family:Arial; margin-left:5px;'>";l[l.length]="<table width='100%' border='0' cellpadding='0' cellspacing='0'> ";l[l.length]="<tr><td width='45' height='30' valign='middle' > <b>Tên:</b></td>";l[l.length]="<td width='200' valign='middle'>";if(curTitle==""){l[l.length]="<input id='txtTitle' type='text' style='width:215px;' value='"+dsMyMapCoor.Tables[0].Rows[p].ObjectTitle+"' "}else{l[l.length]="<input id='txtTitle' type='text' style='width:215px;' value='"+curTitle+"' "}l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td height='30' width='45' valign='middle'><b>Mô tả:</b></td>";l[l.length]="<td width='200' valign='middle'>";l[l.length]="<textarea id='txtDesc' name='' cols='' rows='' style='font-family:Arial; font-size:11px; width:215px; height:50px; border:1px #999999 solid; '>";if(curDesc==""){l[l.length]=dsMyMapCoor.Tables[0].Rows[p].ObjectDesc}else{l[l.length]=curDesc}l[l.length]="</textarea>";l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td height='30' colspan='2' valign='middle'>";var d=(dsMyMapCoor.Tables[0].Rows[p].Public==1)?"checked":"";l[l.length]="<input id='chkPublic' type='checkbox' "+d+"/> Chia sẻ địa điểm này với mọi người";l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' >";l[l.length]="<span><b>Thông tin bổ sung :</b></span>";l[l.length]="<p></p>";l[l.length]="<div id='CoorPropertyInfo' style='position:relative; width:95%; height:85px ; margin-left:4px ;  border:1px #cccccc dashed; overflow-y:auto; overflow-x:hidden; '>";l[l.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:5px;'>";l[l.length]="<tr>";l[l.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Tên </strong></td>";l[l.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Giá trị </strong></td>";l[l.length]="<td width='10%' height='20' valign='middle' ></td></tr>";l[l.length]="</table>";l[l.length]="</div>";l[l.length]="<div align='right' style='height:20px;'> <a id='CoorAddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('CoorPropertyInfo','MyMapCoorProInfo',undefined,undefined)\"><b>&nbsp;<u>Thêm thông tin bổ sung</u>&nbsp;&nbsp;</b></a> </div>";l[l.length]="</td></tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' align='right'>";l[l.length]="<button  onclick='saveMyMapCoor()'  id='btnSaveMyMapCoor' style='cursor:pointer;";if(browserName=="msie"){l[l.length]=" '>Đồng ý</button>"}else{l[l.length]=" '>Đồng ý</button>"}l[l.length]="<button  onclick='map.closeInfoWindow()' style='cursor:pointer; ";if(browserName=="msie"){l[l.length]=" '>Bỏ qua</button>"}else{l[l.length]=" '>Bỏ qua</button>"}l[l.length]="&nbsp;&nbsp;</td>";l[l.length]="</tr>";l[l.length]="</table>";l[l.length]="</div>"}else{if(bCreateNewMMObj){j="Create new place"}else{j="Edit place"}l[l.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:250px; '>";l[l.length]="<tr>";l[l.length]="<td width='220' align='left' valign='middle' style='height:32px;'><img src='images/spacer.gif' width='2' height='25' align='texttop' /><span style='color:#0066cc; font-size:12px; font-weight:bold;'>"+j+"</span></td>";l[l.length]="<td width='60' style='height:32px;'><span style='float:none; width:32px; height:32px;'>";l[l.length]="<img id='btnShowPro' src='images/"+f+".gif' style='cursor:pointer;' alt='"+k+"'/></span></td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' align='left' valign='top'>";l[l.length]="<div style='font-family:Arial; margin-left:5px;'>";l[l.length]="<table width='100%' border='0' cellpadding='0' cellspacing='0'> ";l[l.length]="<tr><td width='45' height='30' valign='middle' > <b>Name:</b></td>";l[l.length]="<td width='200' valign='middle'>";if(curTitle==""){l[l.length]="<input id='txtTitle' type='text' style='width:215px;' value='"+dsMyMapCoor.Tables[0].Rows[p].ObjectTitle+"' "}else{l[l.length]="<input id='txtTitle' type='text' style='width:215px;' value='"+curTitle+"' "}l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td height='30' width='45' valign='middle'><b>Description:</b></td>";l[l.length]="<td width='200' valign='middle'>";l[l.length]="<textarea id='txtDesc' name='' cols='' rows='' style='font-family:Arial; font-size:11px; width:215px; height:50px; border:1px #999999 solid; '>";if(curDesc==""){l[l.length]=dsMyMapCoor.Tables[0].Rows[p].ObjectDesc}else{l[l.length]=curDesc}l[l.length]="</textarea>";l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td height='30' colspan='2' valign='middle'>";var d=(dsMyMapCoor.Tables[0].Rows[p].Public==1)?"checked":"";l[l.length]="<input id='chkPublic' type='checkbox' "+d+"/> Share this point to everyone.";l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' >";l[l.length]="<span><b>Additional information :</b></span>";l[l.length]="<p></p>";l[l.length]="<div id='CoorPropertyInfo' style='position:relative; width:95%; height:85px ; margin-left:4px ;  border:1px #cccccc dashed; overflow-y:auto; overflow-x:hidden; '>";l[l.length]="<table  border='0' cellspacing='0' cellpadding='0' align='center' style='overflow:hidden; width:100%; margin-top:5px;'>";l[l.length]="<tr>";l[l.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Name </strong></td>";l[l.length]="<td width='45%' height='20' valign='middle' align='center'><strong>Value </strong></td>";
l[l.length]="<td width='10%' height='20' valign='middle' ></td></tr>";l[l.length]="</table>";l[l.length]="</div>";l[l.length]="<div align='right' style='height:20px;'> <a id='CoorAddNewPropertyStore'  style='color:#0066cc; font-size:11px; font-weight:bold;'  onmouseover=\"ChangeTextColor(this,'#558800')\" onmouseout=\"ChangeTextColor(this,'#0066cc')\" onclick=\"AddNewPropertyClick('CoorPropertyInfo','MyMapCoorProInfo',undefined,undefined)\"><b>&nbsp;<u>Add information</u>&nbsp;&nbsp;</b></a> </div>";l[l.length]="</td></tr>";l[l.length]="<tr>";l[l.length]="<td colspan='2' align='right'>";l[l.length]="<button  onclick='saveMyMapCoor()'  id='btnSaveMyMapCoor' style='cursor:pointer;";if(browserName=="msie"){l[l.length]=" '>OK</button>"}else{l[l.length]=" '>OK</button>"}l[l.length]="<button  onclick='map.closeInfoWindow()' style='cursor:pointer; ";if(browserName=="msie"){l[l.length]=" '>Cancel</button>"}else{l[l.length]=" '>Cancel</button>"}l[l.length]="&nbsp;&nbsp;</td>";l[l.length]="</tr>";l[l.length]="</table>";l[l.length]="</div>"}l[l.length]="</td>";l[l.length]="</tr>";l[l.length]="</table>"}if(e==0||clickedPoint==null){m.openInfoWindow(l.join(""))}else{if(m.vType()=="VMarker"||m.vType()=="VText"){m.openInfoWindow(l.join(""))}else{map.openInfoWindow(clickedPoint,l.join(""))}}if(!bReadOnly){document.getElementById("btnShowPro").onclick=function(){curTitle=document.getElementById("txtTitle").value;curDesc=document.getElementById("txtDesc").value;showMyMapProInfoWindow()};var o=dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Property;if(o!=undefined&&o!=null&&o.length>0){for(var h=0;h<o.length;h++){AddNewPropertyClick("CoorPropertyInfo","MyMapCoorProInfo",o[h].property_name,o[h].property_value)}}else{AddNewPropertyClick("CoorPropertyInfo","MyMapCoorProInfo")}}}function GetMyMapCoorPropertyCallback(a){if(a.error!=null){if(nLanguage==0){alert("Đã có lỗi trong quá trình kết nối đến server. Bạn vui lòng nhấn F5 để refresh lại trang web.")}else{alert("Error occured while trying to connect server. Press F5 to refresh page.")}hideBusyDiv();return}val=a.value}function showMyMapProInfoWindow(){var b=arrMyMapCoorObj[iMyMapCoorSel];var h=(dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].Style).toString().split(";");if(b.vType()=="VMarker"){var e=new Array();e[e.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:200px; background-color:#FFFFFF;'>";e[e.length]="<tr>";if(nLanguage==0){e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 0)' width='280px' align='left' valign='middle' style='height:32px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Quay lại</a></td>"}else{e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 0)' width='280px' align='left' valign='middle' style='height:32px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Back</a></td>"}e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<div style='cursor:pointer; float:left; width:280px;height:155px; margin-top:2px; overflow:auto; background-color:#ffffff;'>";for(var g=0;g<7;g++){for(var d=0;d<7;d++){var a="";if(curIcon==""){a=h[4]+".gif"}else{a=curIcon+".gif"}if(iconArr[g][d]==(a)){e[e.length]="<img width='32px' height='32px' style='border:1px #0066cc solid;' onclick='chooseIcon(this)' src='images/mymap_icon/"+iconArr[g][d]+"'/> "}else{e[e.length]="<img width='32px' height='32px' style='border:1px #ffffff solid;' onclick='chooseIcon(this)' onmouseover='changeMarkerIconStyle(this)' onmouseout='changeMarkerIconStyle(this)' src='images/mymap_icon/"+iconArr[g][d]+"'/> "}}}e[e.length]="</div></td></tr>";e[e.length]="</table>";b.openInfoWindow(e.join(""))}else{if(b.vType()=="VText"){var e=new Array();var f="";e[e.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:200px; background-color:#FFFFFF;'>";e[e.length]="<tr>";if(nLanguage==0){e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 0)' width='280px' align='left' valign='middle' style='height:20px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Quay lại</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Chuỗi hiển thị</b></td>";f=(curText=="")?h[5]:curText;e[e.length]="<td colspan='3'><input id='txtText' onblur='changeSampleText()' onkeyup='changeSampleText()' type='text' value='"+f+"' style='font-family:Arial; width:167px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Phông chữ</b></td>";e[e.length]="<td colspan='3'>";f=(curFontFamily=="")?h[3]:curFontFamily;e[e.length]=getFontListHTMLString(f);e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Kiểu chữ</b></td>";e[e.length]="<td colspan='3'>";f=(curFontWeight=="")?h[0]:curFontWeight;e[e.length]=getWeightListHTMLString(f);e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Cỡ chữ&nbsp;</b></td>";if(browserName=="msie"){e[e.length]="<td>"}else{e[e.length]="<td width='137'>"}f=(curFontSize=="")?h[2]:curFontSize;e[e.length]=getSizeListHTMLString(f);if(browserName=="msie"){e[e.length]="<b>&nbsp;&nbsp;&nbsp;&nbsp;Màu chữ&nbsp;&nbsp;</b>"}else{e[e.length]="<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Màu chữ</b>"}e[e.length]="</td><td colspan='2' valign='center'>";f=(curFontColor=="")?h[1]:curFontColor;e[e.length]="<div id='divTextColor' onclick=showColorChosing(event,'divTextColor') valign='middle' style='background:"+f+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td height='40' colspan='4' align='center'>";e[e.length]="<a class='a1' id='textSample' align='absmiddle'>Sample Text</a>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='4'>";e[e.length]="<button align='right' onclick='saveTextPro()' id='btnSaveTextPro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:206px; margin-right:1px; margin-top:3px;'>Đồng ý</button>"}else{e[e.length]=" margin-left:203px; margin-right:4px; margin-top:9px;'>Đồng ý</button>"}}else{e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 0)' width='280px' align='left' valign='middle' style='height:20px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Back</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Display text</b></td>";f=(curText=="")?h[5]:curText;e[e.length]="<td colspan='3'><input id='txtText' onblur='changeSampleText()' onkeyup='changeSampleText()' type='text' value='"+f+"' style='font-family:Arial; width:167px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Font name</b></td>";e[e.length]="<td colspan='3'>";f=(curFontFamily=="")?h[3]:curFontFamily;e[e.length]=getFontListHTMLString(f);e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Font style</b></td>";e[e.length]="<td colspan='3'>";f=(curFontWeight=="")?h[0]:curFontWeight;
e[e.length]=getWeightListHTMLString(f);e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Font size&nbsp;</b></td>";if(browserName=="msie"){e[e.length]="<td>"}else{e[e.length]="<td width='137'>"}f=(curFontSize=="")?h[2]:curFontSize;e[e.length]=getSizeListHTMLString(f);if(browserName=="msie"){e[e.length]="<b>&nbsp;&nbsp;&nbsp;&nbsp;Text color&nbsp;&nbsp;</b>"}else{e[e.length]="<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Text color</b>"}e[e.length]="</td><td colspan='2' valign='center'>";f=(curFontColor=="")?h[1]:curFontColor;e[e.length]="<div id='divTextColor' onclick=showColorChosing(event,'divTextColor') valign='middle' style='background:"+f+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td height='40' colspan='4' align='center'>";e[e.length]="<a class='a1' id='textSample' align='absmiddle'>Sample Text</a>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='4'>";e[e.length]="<button align='right' onclick='saveTextPro()' id='btnSaveTextPro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:206px; margin-right:1px; margin-top:3px;'>OK</button>"}else{e[e.length]=" margin-left:203px; margin-right:4px; margin-top:9px;'>OK</button>"}}e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";b.openInfoWindow(e.join(""));changeSampleText()}else{if(b.vType()=="VPolyline"){var e=new Array();e[e.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:200px; background-color:#FFFFFF;'>";e[e.length]="<tr>";if(nLanguage==0){e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 1)' width='280px' align='left' valign='middle' style='height:40px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Quay lại</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Màu đường</b></td>";e[e.length]="<td><div id='divLineColor' onclick=showColorChosing(event,'divLineColor') valign='middle' style='background:"+h[1]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Độ rộng đường</b></td>";e[e.length]="<td><input type='text' id='txtLineWidth' value='"+h[0]+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Độ mờ đường</b></td>";e[e.length]="<td><input type='text' id='txtLineOpacity' value='"+(parseFloat(h[3])*100)+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='2'>";e[e.length]="<button align='right' onclick='savePolylinePro()' id='btnSavePolylinePro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:200px; margin-right:1px; margin-top:52px;'>Đồng ý</button>"}else{e[e.length]=" margin-left:200px; margin-right:4px; margin-top:53px;'>Đồng ý</button>"}}else{e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 1)' width='280px' align='left' valign='middle' style='height:40px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Back</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line color</b></td>";e[e.length]="<td><div id='divLineColor' onclick=showColorChosing(event,'divLineColor') valign='middle' style='background:"+h[1]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line width</b></td>";e[e.length]="<td><input type='text' id='txtLineWidth' value='"+h[0]+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line opacity</b></td>";e[e.length]="<td><input type='text' id='txtLineOpacity' value='"+(parseFloat(h[3])*100)+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='2'>";e[e.length]="<button align='right' onclick='savePolylinePro()' id='btnSavePolylinePro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:200px; margin-right:1px; margin-top:52px;'>OK</button>"}else{e[e.length]=" margin-left:200px; margin-right:4px; margin-top:53px;'>OK</button>"}}e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";if(clickedPoint!=null){map.openInfoWindow(clickedPoint,e.join(""))}else{b.openInfoWindow(e.join(""))}}else{if(b.vType()=="VPolygon"){var e=new Array();e[e.length]="<table border='0' cellspacing='0' cellpadding='0' style='width:280px; height:200px; background-color:#FFFFFF;'>";e[e.length]="<tr>";if(nLanguage==0){e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 1)' width='280px' align='left' valign='middle' style='height:32px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Quay lại</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Màu đường</b></td>";e[e.length]="<td><div id='divLineColor' onclick=showColorChosing(event,'divLineColor') valign='middle' style='background:"+h[1]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Độ rộng đường</b></td>";e[e.length]="<td><input id='txtLineWidth' type='text' value='"+h[0]+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Độ mờ đường</b></td>";var c=(h[4]=="")?50:parseFloat(h[4])*100;e[e.length]="<td><input id='txtLineOpacity' type='text' value='"+c+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Màu tô</b></td>";e[e.length]="<td><div id='divFillColor' onclick=showColorChosing(event,'divFillColor') valign='middle' style='background:"+h[2]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Độ mờ tô</b></td>";e[e.length]="<td><input id='txtFillOpacity' type='text' value='"+parseFloat(h[3])*100+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='2'>";e[e.length]="<button align='right' onclick='savePolygonPro()' id='btnSavePolygonPro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:200px; margin-right:1px; margin-top:10px;'>Đồng ý</button>"}else{e[e.length]=" margin-left:203px; margin-right:4px; margin-top:13px;'>Đồng ý</button>"
}}else{e[e.length]="<td onclick='showMyMapInfoWindow("+iMyMapCoorSel+", 1)' width='280px' align='left' valign='middle' style='height:32px;'><img src='images/backpage.gif' align='absmiddle' style='cursor:pointer;' /><a style='color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;' onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999')>Back</a></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td align='left' valign='top'>";e[e.length]="<table width='100%'>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line color</b></td>";e[e.length]="<td><div id='divLineColor' onclick=showColorChosing(event,'divLineColor') valign='middle' style='background:"+h[1]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line width</b></td>";e[e.length]="<td><input id='txtLineWidth' type='text' value='"+h[0]+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Line opacity</b></td>";var c=(h[4]=="")?50:parseFloat(h[4])*100;e[e.length]="<td><input id='txtLineOpacity' type='text' value='"+c+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Fill color</b></td>";e[e.length]="<td><div id='divFillColor' onclick=showColorChosing(event,'divFillColor') valign='middle' style='background:"+h[2]+"; position:relative; width:26px; height:18px; BORDER: #558800 1px solid; vertical-align:middle; cursor:pointer;'></div></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td><b>&nbsp;Fill opacity</b></td>";e[e.length]="<td><input id='txtFillOpacity' type='text' value='"+parseFloat(h[3])*100+"' style='text-align:right; font-family:Arial; width:163px; border:1px #999999 solid; ' /></td>";e[e.length]="</tr>";e[e.length]="<tr>";e[e.length]="<td colspan='2'>";e[e.length]="<button align='right' onclick='savePolygonPro()' id='btnSavePolygonPro' style='cursor:pointer;";if(browserName=="msie"){e[e.length]=" margin-left:200px; margin-right:1px; margin-top:10px;'>OK</button>"}else{e[e.length]=" margin-left:203px; margin-right:4px; margin-top:13px;'>OK</button>"}}e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";e[e.length]="</td>";e[e.length]="</tr>";e[e.length]="</table>";if(clickedPoint!=null){map.openInfoWindow(clickedPoint,e.join(""))}else{b.openInfoWindow(e.join(""))}}}}}}function createCPMarker(c,f,b,e){var h=new GeneralMap.Marker(c.latlngs[b].copy(),f);h.borderStyle="1px "+c.lineColor+" solid";map.addOverlay(h);h.enableDragging();h.editObjectIndex=c.mmIndex;h.editPointIndex=nControlPoint;h.type=MMCONTROLOBJ;arrControlPoint[nControlPoint]=h;nControlPoint++;if(b<e){var g=(c.latlngs[b].lat()+c.latlngs[b+1].lat())/2;var d=(c.latlngs[b].lng()+c.latlngs[b+1].lng())/2;var a=new GeneralMap.Marker(new GeneralMap.LatLng(g,d),f);a.borderStyle="1px "+c.lineColor+" solid";a.opacity=50;map.addOverlay(a);a.enableDragging();a.editObjectIndex=c.mmIndex;a.addPointIndex=nAPControlPoint;a.type=MMAPCONTROLOBJ;arrAPControlPoint[nAPControlPoint]=a;nAPControlPoint++;GeneralMap.Event.addListener(a,"dragging",function(n){bCPDragging=true;var m,l,k;m=arrMyMapCoorObj[iMyMapCoorOver].latlngs[a.addPointIndex].copy();l=a.getLatLng().copy();k=arrMyMapCoorObj[iMyMapCoorOver].latlngs[a.addPointIndex+1].copy();if(tempPolyline==null){var j=new GeneralMap.PolylineOptions(true,false,"Dot");tempPolyline=new GeneralMap.Polyline([m,l,k],arrMyMapCoorObj[iMyMapCoorOver].lineColor);tempPolyline.opts=j;map.addOverlay(tempPolyline)}else{tempPolyline.setLatLngs([m,l,k])}});GeneralMap.Event.addListener(a,"dragend",function(k){bCPDragging=false;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}var j=a.getLatLng().copy();arrMyMapCoorObj[iMyMapCoorOver].insertPoint(a.addPointIndex,j);if(arrMyMapCoorObj[iMyMapCoorOver].actionType!="New"){arrMyMapCoorObj[iMyMapCoorOver].actionType="Edit"}enableSaveBtn();clearControlPoint();showControlPoint(c)})}GeneralMap.Event.addListener(h,"dragging",function(l){bCPDragging=true;var j=arrMyMapCoorObj[iMyMapCoorOver].latlngs.length;var s,q;s=h.editPointIndex-1;q=h.editPointIndex+1;var r,p,o;if(s!=-1){r=arrMyMapCoorObj[iMyMapCoorOver].latlngs[s].copy()}else{if(arrMyMapCoorObj[iMyMapCoorOver].vType()=="VPolygon"){r=arrMyMapCoorObj[iMyMapCoorOver].latlngs[j-2].copy()}}p=h.getLatLng().copy();if(q!=j){o=arrMyMapCoorObj[iMyMapCoorOver].latlngs[q].copy()}if(tempPolyline==null){var k=new GeneralMap.PolylineOptions(true,false,"Dot");if(s==-1){if(arrMyMapCoorObj[iMyMapCoorOver].vType()=="VPolyline"){tempPolyline=new GeneralMap.Polyline([p,o],arrMyMapCoorObj[iMyMapCoorOver].lineColor);var m=(p.lat()+o.lat())/2;var n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}else{tempPolyline=new GeneralMap.Polyline([r,p,o],arrMyMapCoorObj[iMyMapCoorOver].lineColor);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[nAPControlPoint-1].setPoint(new GeneralMap.LatLng(m,n));m=(p.lat()+o.lat())/2;n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}}else{if(q==j){tempPolyline=new GeneralMap.Polyline([r,p],arrMyMapCoorObj[iMyMapCoorOver].lineColor);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[s].setPoint(new GeneralMap.LatLng(m,n))}else{tempPolyline=new GeneralMap.Polyline([r,p,o],arrMyMapCoorObj[iMyMapCoorOver].lineColor);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[s].setPoint(new GeneralMap.LatLng(m,n));m=(p.lat()+o.lat())/2;n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}}tempPolyline.opts=k;map.addOverlay(tempPolyline)}else{if(s==-1){if(arrMyMapCoorObj[iMyMapCoorOver].vType()=="VPolyline"){tempPolyline.setLatLngs([p,o]);var m=(p.lat()+o.lat())/2;var n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}else{tempPolyline.setLatLngs([r,p,o]);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[nAPControlPoint-1].setPoint(new GeneralMap.LatLng(m,n));m=(p.lat()+o.lat())/2;n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}}else{if(q==j){tempPolyline.setLatLngs([r,p]);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[s].setPoint(new GeneralMap.LatLng(m,n))}else{tempPolyline.setLatLngs([r,p,o]);var m=(r.lat()+p.lat())/2;var n=(r.lng()+p.lng())/2;arrAPControlPoint[s].setPoint(new GeneralMap.LatLng(m,n));m=(p.lat()+o.lat())/2;n=(p.lng()+o.lng())/2;arrAPControlPoint[h.editPointIndex].setPoint(new GeneralMap.LatLng(m,n))}}}});GeneralMap.Event.addListener(h,"dragend",function(k){bCPDragging=false;if(tempPolyline!=null){map.removeOverlay(tempPolyline);tempPolyline=null}var j=h.getLatLng().copy();arrMyMapCoorObj[iMyMapCoorOver].setVertex(h.editPointIndex,j);if(arrMyMapCoorObj[iMyMapCoorOver].actionType!="New"){arrMyMapCoorObj[iMyMapCoorOver].actionType="Edit"}enableSaveBtn()})}function showControlPoint(b){if(!bReadOnly&&!bCPDragging){if(selTbrButton!=null&&selTbrButton.id!="btnMove"){return}clearControlPoint();iMyMapCoorOver=b.mmIndex;var f=(b.vType()=="VPolyline")?b.latlngs.length:b.latlngs.length-1;var e=(b.vType()=="VPolyline")?f-1:f;for(var c=0;c<f;c++){var a=new GeneralMap.Icon("images/rec.jpg");a.iconSize=new GeneralMap.Size(8,8);var d=new GeneralMap.MarkerOptions(a,null,new GeneralMap.Size(4,4));createCPMarker(b,d,c,e)}}}function clearControlPoint(){for(var a=0;a<nControlPoint;a++){map.removeOverlay(arrControlPoint[a])}arrControlPoint=new Array();nControlPoint=0;for(var a=0;a<nAPControlPoint;a++){map.removeOverlay(arrAPControlPoint[a])}arrAPControlPoint=new Array();nAPControlPoint=0}function chooseIcon(a){var b=a.src;b=b.substring(b.lastIndexOf("/")+1,b.lastIndexOf("."));curIcon=b;
showMyMapInfoWindow(iMyMapCoorSel,0)}function saveTextPro(){curText=document.getElementById("txtText").value;curFontFamily=document.getElementById("cboFontFamily").value;curFontWeight=document.getElementById("cboFontWeight").value;curFontSize=document.getElementById("cboFontSize").value;var a=document.getElementById("divTextColor").style.background.toString();if(browserName!="msie"){if(a.indexOf(")")>0){a=a.substring(0,a.indexOf(")")+1)}else{a=a.substring(0,a.indexOf(" "))}}curFontColor=a;showMyMapInfoWindow(iMyMapCoorSel,0)}function savePolylinePro(){var a=document.getElementById("divLineColor").style.background.toString();if(browserName!="msie"){if(a.indexOf(")")>0){a=a.substring(0,a.indexOf(")")+1)}else{a=a.substring(0,a.indexOf(" "))}}curLineColor=a;curLineWidth=document.getElementById("txtLineWidth").value;curLineOpacity=document.getElementById("txtLineOpacity").value;showMyMapInfoWindow(iMyMapCoorSel,1)}function savePolygonPro(){var a=document.getElementById("divLineColor").style.background.toString();if(browserName!="msie"){if(a.indexOf(")")>0){a=a.substring(0,a.indexOf(")")+1)}else{a=a.substring(0,a.indexOf(" "))}}curLineColor=a;curLineWidth=document.getElementById("txtLineWidth").value;curLineOpacity=document.getElementById("txtLineOpacity").value;var b=document.getElementById("divFillColor").style.background.toString();if(browserName!="msie"){if(b.indexOf(")")>0){b=b.substring(0,b.indexOf(")")+1)}else{b=b.substring(0,b.indexOf(" "))}}curFillColor=b;curFillOpacity=document.getElementById("txtFillOpacity").value;showMyMapInfoWindow(iMyMapCoorSel,1)}function changeMarkerIconStyle(a){if(a.style.borderColor=="#ffffff"||a.style.borderLeftColor=="rgb(255, 255, 255)"){a.style.border="1px #558800 solid"}else{a.style.border="1px #ffffff solid"}}function changeCoorBkColor(a,c){var b=document.getElementById("MyMapCoorList_"+a);if(b!=undefined){if(c){b.style.backgroundColor="#eff9e0"}else{b.style.backgroundColor="#ffffff"}}}function changeCoorTextStyle(a){var b=document.getElementById("MyMapCoorListTitle_"+a);if(b!=undefined){if(b.style.color=="#0066cc"||b.style.color=="rgb(0, 102, 204)"){b.style.color="#558800";if(nLanguage==0){showTip("Nhấp chuột để xem/chỉnh sửa địa điểm")}else{showTip("Click to view/edit place")}}else{b.style.color="#0066cc";closeTip()}}}function getFontListHTMLString(d){var e=["Arial","Arial Black","Arial Narrow","Times New Roman","Verdana","Tahoma","Currier New","Microsoft Sans Serif","Webdings"];var b="";var a=(browserName=="msie")?171:169;b+="<select id='cboFontFamily' onchange='changeSampleText()' style='font-family:Arial; font-size:12px; width:"+a+"px; border:1px #999999 solid;'>";for(var c=0;c<9;c++){b+="<option value='"+e[c]+"'";if(d==e[c]){b+="selected"}b+=">"+e[c]+"</option>"}b+="</select>";return b}function getSizeListHTMLString(e){var a=[8,10,12,14,16,18,20,22,24];var c="";var b=(browserName=="msie")?60:55;c+="<select id='cboFontSize' onchange='changeSampleText()' style='font-family:Arial; font-size:12px; width:"+b+"px; border:1px #999999 solid;'>";for(var d=0;d<9;d++){c+="<option value='"+a[d]+"'";if(e==a[d]){c+="selected"}c+=">"+a[d]+"</option>"}c+="</select>";return c}function getWeightListHTMLString(e){if(nLanguage==0){var f=["Thường","Đậm"]}else{var f=["Normal","Bold"]}var d=["Normal","Bold"];var b="";var a=(browserName=="msie")?171:169;b+="<select id='cboFontWeight' onchange='changeSampleText()' style='font-family:Arial; font-size:12px; width:"+a+"px; border:1px #999999 solid;'>";for(var c=0;c<2;c++){b+="<option value='"+d[c].toLowerCase()+"'";if(e==d[c].toLowerCase()){b+="selected"}b+=">"+f[c]+"</option>"}b+="</select>";return b}function showColorChosing(c,b){var k=document.createElement("TABLE");k.setAttribute("width",100);k.setAttribute("cellPadding",0);k.setAttribute("cellSpacing",0);k.setAttribute("border",1);k.setAttribute("borderColor","#558800");k.setAttribute("id","basic_color_table");k.style.backgroundColor="white";var f=document.createElement("TBODY");k.appendChild(f);for(var g=0;g<8;g++){var l=document.createElement("TR");for(var d=0;d<6;d++){var j=document.createElement("TD");j.style.backgroundColor=colorArr[d][g];j.style.color=colorArr[d][g];j.style.width=16+"px";j.style.height=16+"px";j.style.borderWidth="1px";j.style.borderColor="#ffffff";j.style.borderStyle="solid";j.setAttribute("id","basic_color_"+g+"_"+d);onClickEvent=function(n,m,e){return(function(){fnOnColorClick(n,m,e)})}(colorArr[d][g],g,d);ondblClickEvent=function(n,m,e){return(function(){fnOnColordblClick(n,m,e,b)})}(colorArr[d][g],g,d);if(document.all){j.attachEvent("onmouseover",onClickEvent);j.attachEvent("onclick",ondblClickEvent)}else{if(document.layers){j.addeventlistener("onmouseover",onClickEvent,false);j.addeventlistener("onclick",ondblClickEvent,false)}else{if(document.getElementById){j.addEventListener("mouseover",onClickEvent,false);j.addEventListener("click",ondblClickEvent,false)}}}var h=document.createTextNode(".");j.appendChild(h);l.appendChild(j)}f.appendChild(l)}var a=document.getElementById("colorChosingPopup");if(a==null){a=document.createElement("div");a.id="colorChosingPopup";if(browserName=="msie"){document.getElementById(b).appendChild(a)}else{document.getElementById(b).parentNode.appendChild(a)}a.style.position="absolute";a.style.zIndex=200;k.style.zIndex=200;a.appendChild(k)}if(browserName=="msie"){a.style.left=event.x-80;a.style.top=event.y-90}else{a.style.left=c.clientX;a.style.top=c.clientY}}function fnOnColorClick(b,a,c){cell=document.getElementById("basic_color_"+curColElX+"_"+curColElY);if(cell!=null){cell.style.borderColor="#ffffff"}curColElX=a;curColElY=c;cell=document.getElementById("basic_color_"+curColElX+"_"+curColElY);if(cell!=null){cell.style.borderColor="#ff0000"}}function fnOnColordblClick(c,a,e,d){document.getElementById(d).style.background=colorArr[e][a];if(document.getElementById("id3")!=null){id3.fillcolor=colorArr[e][a]}var b=document.getElementById("colorChosingPopup");if(b!=null){if(browserName=="msie"){document.getElementById(d).removeChild(b)}else{document.getElementById(d).parentNode.removeChild(b)}}if(document.getElementById("textSample")!=null){changeSampleText()}}function changeSampleText(){var c=document.getElementById("textSample");var a=document.getElementById("txtText").value;if(a==""){a=" "}if(a.length>15){a=a.substring(0,16)}c.innerHTML=a;c.style.fontFamily=document.getElementById("cboFontFamily").value;c.style.fontWeight=document.getElementById("cboFontWeight").value;c.style.fontSize=document.getElementById("cboFontSize").value+"px";var b=document.getElementById("divTextColor").style.background.toString();if(browserName!="msie"){if(b.indexOf(")")>0){b=b.substring(0,b.indexOf(")")+1)}else{b=b.substring(0,b.indexOf(" "))}}c.style.color=b}function selectToolbarBtn(a){clearControlPoint();if(a==selTbrButton){return}if(selTbrButton!=null){var b=selTbrButton.src;b=b.substring(0,b.lastIndexOf("_"));selTbrButton.src=b+".gif";selTbrButton.onmouseover=function(){var c=this.src;if(c.indexOf("_")!=-1){c=c.substring(0,c.lastIndexOf("_"))}else{c=c.substring(0,c.lastIndexOf("."))}this.src=c+"_over.gif"};selTbrButton.onmouseout=function(){var c=this.src;if(c.indexOf("_")!=-1){c=c.substring(0,c.lastIndexOf("_"))}else{c=c.substring(0,c.lastIndexOf("."))}this.src=c+".gif"}}var b=a.src;if(b.indexOf("_")!=-1){b=b.substring(0,b.lastIndexOf("_"))}else{b=b.substring(0,b.lastIndexOf("."))}b+="_down.gif";a.src=b;a.onmouseover=null;a.onmouseout=null;selTbrButton=a;if(a.id!="btnMove"){document.getElementById("container").style.cursor="pointer";if(a.id=="btnAddPoint"||a.id=="btnAddText"){if(nLanguage==0){showTip("Nhấp chuột lên bản đồ để thêm điểm",true)}else{showTip("Click on map to add place",true)}}else{if(nLanguage==0){showTip("Nhấp chuột lên bản đồ để bắt đầu vẽ",true)}else{showTip("Click on map to start drawing line",true)}}}else{document.getElementById("container").style.cursor="url('images/openhand.cur'),auto";closeTip(true)}map.closeInfoWindow()}function fnMyMapListOver(){if(nLanguage==0){showTip("Nhấp chuột để đóng/mở bản đồ")
}else{showTip("Click to open/close mymap")}}function fnMyMapListOut(){closeTip()}function fnBtnDelMyMapOver(){if(nLanguage==0){showTip("Xóa bản đồ")}else{showTip("Delete mymap")}}function fnBtnDelMyMapOut(){closeTip()}function GetProperty(c){var e=document.getElementById(c);var d=new Array();var a="";for(var b=1;b<e.childNodes.length;b++){a=e.childNodes[b].childNodes[0].childNodes[0].childNodes[0].cells[0].childNodes[0].value;if(a!=""){var f=new Object();f.property_name=a;f.property_value=e.childNodes[b].childNodes[0].childNodes[0].childNodes[0].cells[1].childNodes[0].value;d.push(f)}}return d}function ChangeTextColor(b,a){if(b!=null){b.style.color=a}}var PropertyIndex=0;var flagEditProperty=false;function AddNewPropertyClick(f,e,c,h){enableSaveBtn();var g=document.getElementById(f);var d=g.childNodes.length;if(d>1&&g.childNodes[d-1].childNodes[0].childNodes[0].childNodes[0].cells[0].childNodes[0].value==""){return}var a=PropertyIndex+100;var b;if(c!=undefined){if(f!="CoorPropertyInfo"){b='<table border="0" cellspacing="0" cellpadding="0" style=\'margin-top:2px; margin-bottom:2px; margin-left:3px;  width:100%;  \'><tr><td style="width:45%"><input style=\'width:95%; border:1px #999999 solid;\' type="text" tabindex=\''+a+"'  id='PropertyName_"+a+"' value='"+c+"' /></td><td style=\"width:45%\"><input style='width:95%; border:1px #999999 solid;' type=\"text\" id='PropertyValue_"+a+"' tabindex='"+(a+1)+"' value='"+h+"' /></td> <td style=\"width:10%\"><image id='ImgDelete_"+a+'\' src="images/delete.gif" onclick=\'DeleteProperty("'+f+'","'+(e+a)+"\")'/></td> </tr> </table>"}else{b='<table border="0" cellspacing="0" cellpadding="0" style=\'margin-top:2px; margin-bottom:2px; margin-left:3px;  width:100% \'><tr><td style="width:45%"><input style=\'width:95%; border:1px #999999 solid;\' type="text" tabindex=\''+a+"'  id='PropertyName_"+a+"' value='"+c+"' onkeydown='flagEditProperty=true;' /></td><td style=\"width:45%\"><input style='width:95%; border:1px #999999 solid;' type=\"text\" id='PropertyValue_"+a+"' tabindex='"+(a+1)+"' value='"+h+"' onkeydown='flagEditProperty=true;' /></td> <td style=\"width:10%\"><image id='ImgDelete_"+a+'\' src="images/delete.gif" onclick=\'DeleteProperty("'+f+'","'+(e+a)+"\")'/></td> </tr> </table>"}}else{if(f!="CoorPropertyInfo"){b='<table border="0" cellspacing="0" cellpadding="0" style=\'margin-top:2px; margin-bottom:2px; margin-left:3px; width:100%; position:relative; \'><tr><td style="width:45%"><input style=\'width:95%; border:1px #999999 solid;\' type="text" id=\'PropertyName_'+a+"' tabindex='"+a+"' /></td><td style=\"width:45%\"><input style='width:95%; border:1px #999999 solid;' type=\"text\" id='PropertyValue_"+a+"' tabindex='"+(a+1)+"' /></td style=\"width:10%\"> <td><image id='ImgDelete_"+a+'\' src="images/delete.gif" onclick=\'DeleteProperty("'+f+'","'+(e+a)+"\")'/></td> </tr> </table>"}else{b='<table border="0" cellspacing="0" cellpadding="0" style=\'margin-top:2px; margin-bottom:2px; margin-left:3px; width:100% \'><tr><td style="width:45%"><input style=\'width:95%; border:1px #999999 solid;\' type="text" id=\'PropertyName_'+a+"' tabindex='"+a+"' onkeydown='flagEditProperty=true;' /></td><td style=\"width:45%\"><input style='width:95%; border:1px #999999 solid;' type=\"text\" id='PropertyValue_"+a+"' tabindex='"+(a+1)+"' onkeydown='flagEditProperty=true;' /></td style=\"width:10%\"> <td><image id='ImgDelete_"+a+'\' src="images/delete.gif" onclick=\'DeleteProperty("'+f+'","'+(e+a)+"\")'/></td> </tr> </table>"}}PropertyDiv=document.createElement("div");PropertyDiv.id=e+a;PropertyDiv.innerHTML=b;g.appendChild(PropertyDiv);PropertyIndex+=2}function DeleteProperty(b,a){enableSaveBtn();if(b=="CoorPropertyInfo"){flagEditProperty=true}var d=document.getElementById(b);var c=document.getElementById(a);d.removeChild(c)}function GetPropertyForUpdate(a,c){var j=document.getElementById(a);var h=new Array();var d="";var g;var b=(c==null)?0:c.Tables[0].Rows.length;for(g=1;g<j.childNodes.length;g++){d=j.childNodes[g].childNodes[0].childNodes[0].childNodes[0].cells[0].childNodes[0].value;if(d!=""){var f=new Object();f.property_name=d;f.property_value=j.childNodes[g].childNodes[0].childNodes[0].childNodes[0].cells[1].childNodes[0].value;f.MyMap_property_value_id=(b>(g-1))?c.Tables[0].Rows[g-1].mymap_property_value_id:-1;f.MyMapID=dsMyMap.Tables[0].Rows[iMyMapOpening].MyMapID;h.push(f)}}if((g-1)<b){for(var e=g-1;e<b;e++){var f=new Object();f.MyMapID=-1;f.MyMap_property_value_id=c.Tables[0].Rows[e].mymap_property_value_id;h.push(f)}}return h}function GetCoorPropertyForUpdate(b){var j=document.getElementById(b);var a=dsMyMapCoor.Tables[0].Rows[iMyMapCoorSel].MyMapCoorID;var h=null;for(var g=0;g<ArrPropertyAsLoad.length;g++){if(a==ArrPropertyAsLoad[g].id){h=ArrPropertyAsLoad[g].value;break}}var d="";var g;var c=(h!=null&&h!=undefined)?h.length:0;for(g=1;g<j.childNodes.length;g++){d=j.childNodes[g].childNodes[0].childNodes[0].childNodes[0].cells[0].childNodes[0].value;if(d!=""){var f=new Object();f.property_name=d;f.property_value=j.childNodes[g].childNodes[0].childNodes[0].childNodes[0].cells[1].childNodes[0].value;f.MyMapCoor_property_value_id=(c>(g-1))?h[g-1].MyMapCoor_property_value_id:-1;f.MyMapCoorID=a;ArrEditProperty.push(f)}}if((g-1)<c){for(var e=g-1;e<c;e++){var f=new Object();f.MyMapCoorID=-1;f.MyMapCoor_property_value_id=h[e].MyMapCoor_property_value_id;ArrDeleteProperty.push(f)}}}function RemoveElement(c,b){for(var a=b;a<c.length-1;a++){c[a]=c[a+1]}c.pop()}var curHistory="";function SendMap(){var e="Xem bản đồ lớn";if(nLanguage==1){e="View Larger Map"}var f=BuildMapLink();var a="<iframe width='450' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='"+f.replace("vbdMap.aspx","vbdEmbed.aspx")+"'></iframe><br/><small><a href='"+f+"' style='color:#D98923;'>"+e+"</a></small>";curHistory=f;var g="Bạn gửi đường dẫn dưới đây cho bạn bè";if(nLanguage==1){g="Copy this link and send to your friends"}var b="Bạn dùng đường dẫn này nhúng vào website của bạn";if(nLanguage==1){b="Copy this link to embed in your website"}var d="<table style='background-color:White; width:100%; height:100%;'><tr><td style=\"padding-left: 10px;\">"+g+" <a  style=\"right:15px;position:absolute;color:#999999; font-size:11px;font-family:Verdana;cursor:pointer;\" onmouseover=ChangeTextColor(this,'#558800') onmouseout=ChangeTextColor(this,'#999999') onclick=CloseSendMap()>X</a></td></tr>";d+="<tr><td align=center><textarea id='txtMapLink' onclick='this.select()' style='width:340px; height:30px;'>"+f+"</textarea></td></tr>";d+='<tr><td style="padding-left: 10px;">'+b+"</td></tr>";d+="<tr><td align=center><textarea id='txtMapEmbed' onclick='this.select()' style='width:340px; height:30px;'>"+a+"</textarea></td></tr>";d+="</table>";var c=GeneralMap.Util.CreateDivElement("vbd_link",myWidth-380,160,370,125,"absolute","visible",d);c.style.zIndex=1000;c.style.border="solid 1px green";document.body.appendChild(c);document.getElementById("txtMapLink").select()}function BuildMapLink(d){var a=window.location.href;var h=a.lastIndexOf("/");a=a.substring(0,h+1);a+="vbdMap.aspx?";var j="l="+map.getLevel();j+="&kv="+map.getCenter().toUrlValue();var b="";var e="";for(var f=0;f<2;f++){if(f<PlaceToFindPathArray.length){b+=PlaceToFindPathArray[f][0].getLatLng().toUrlValue();var k=document.getElementById("direction"+f);var l=k.childNodes[0].rows[0].cells[1].childNodes[0].value;if(CheckInputDatatype(l)=="string"){e+=escape(l)}}if(f<PlaceToFindPathArray.length-1){b+=",";e+=","}}if(b!=""){var g=document.getElementById("avoidalley").checked;var c=document.getElementById("vehicle").value;if(g==true){g=1}else{g=0}j+="&fp="+b+";"+e+";"+c+";"+g}if(KeySearch!=null&&KeySearch.length>1){b=RemoveHTMLTag(KeySearch.replace(/\s*[|]\s*/g,", ").replace(/,\s*$/g,""));j+="&sk="+b.replace(/[ ]/g,"+")}if(arrBlockHouseObj.length>0){j+="&bh=1"}if(iMyMapOpening!=-1){j+="&mi="+dsMyMap.Tables[0].Rows[iMyMapOpening].MyMapID}if(d==undefined){j+="&mt="+GeneralMap.mapType}else{j+="&mt="+d
}j=a+j;return j}function CloseSendMap(){var a=document.getElementById("vbd_link");if(a!=null){document.body.removeChild(a)}}function PrintResult(){if(current_functype==GLOBAL_FINDPATH_FUNCTION){var l=document.getElementById("vehicle").value;var n="";var f="";var b=map.getLevel();var a=map.getDirectionBounds();var w=0;var e=0;var g=0;var o=0;var c=0;var v=-1;var x="";for(var k=0;k<PlaceStatusArray.length;k++){var y=document.getElementById("direction"+k);x+=y.childNodes[0].rows[0].cells[1].childNodes[0].value+"~"}x=x.substring(0,x.length-1);var u="&";var q="!@";var p=new RegExp(u,"g");x=x.replace(p,q);n="&TextName="+encodeURI(x);var r="";for(var t=0;t<PlaceToFindPathArray.length;t++){for(var s=0;s<PlaceToFindPathArray[t].length;s++){r+=PlaceToFindPathArray[t][s].getPoint().lng()+","+PlaceToFindPathArray[t][s].getPoint().lat()+","}if(t>0&&t<PlaceToFindPathArray.length-1){f+=PlaceToFindPathArray[t-1].length+","}}r=r.substring(0,r.length-1);var m=document.getElementById("avoidalley").checked;m=(m==true)?1:0;var h=document.getElementById("avoidblock").checked;h=(h==true)?1:0;var d="type=1&l="+nLanguage+"&FindString="+r+"&Vehicle="+l+"&Imode="+f.toString()+"&FindMode="+c+"&FindType="+v+"&Level="+b+"&Left="+a.getNorthWest().lng()+"&Top="+a.getSouthEast().lng()+"&Right="+a.getSouthEast().lng()+"&Bottom="+a.getSouthEast().lat()+"&Findopts="+w+"&Index="+e+"&Sub="+g+"&IsInsert="+o+"&Alley="+m+"&Block="+h+"&Lat="+map.getCenter().lat()+"&Lng="+map.getCenter().lng()+""+n;window.open("PrintMapResult.aspx?"+d)}else{var d="type=0";d+="&l="+map.getLevel();d+="&kv="+map.getCenter().toUrlValue();window.open("PrintMapResult.aspx?"+d)}}var Left_Panel_Width=347;var arrSearchMapResult=new Array();var arrMorePlaceResult=new Array();var current_index=0;var Screen_Width=1000;var currentSelectedResAB_Id=-1;var currentSelectedResAB_Lat=-1;var currentSelectedResAB_Lng=-1;var currentSelectedResAB_Text="";var plHighlight=null;var CateFilter;var KeySearch;var TypeSearch;var selectedResAB_Text="";var prev_selectedResAB_Text="";var Count=-1;var RemoveId=0;var MaxHistory=4;var isFirstSearch=false;var isBindingMorePlace=false;var searchFromExample=false;var infoWindow;function doSearch(a){if(a!=null){document.getElementById("mapinput").value=a}var b=RemoveHTMLTag(document.getElementById("mapinput").value.replace(/[']/g,"\\'"));isFirstSearch=true;TypeSearch=0;saveState()}function FindPlaceEnter(b,a){if(b.keyCode==13){doSearch()}return false}function GetSearchType(){return(document.getElementById("searchoptions")!=null)?document.getElementById("searchoptions").value:0}function SetSearchType(a){if(document.getElementById("searchoptions")==null){return}if(a==null||a==undefined){return}document.getElementById("searchoptions").selectedIndex=a;ControlEvent.OnChangeSearchOption(document.getElementById("searchoptions"))}function FindPlace(o,A,y,t,k,h,m,l,r){ping_connection();if(isSearching==true){return}var x,w,e,c,g,f;if(r==null){r=TypeSearch}SetSearchType(r);current_searchtype=GetSearchType();r=current_searchtype;showBusyDiv("");if(A==null){y="";t="";A=document.getElementById("mapinput").value}if(A!=null&&A.length>0){if(k==null||h==null||m==null||l==null){var a=map.getBounds();e=a.getNorthWest().lng();c=a.getNorthWest().lat();g=a.getSouthEast().lng();f=a.getSouthEast().lat();if(c>f){var z=c;c=f;f=z}}else{e=k;c=h;g=m;f=l}var u=map.getLevel();A=A.replace(/\[QUOTE]/g,'"');FillQueryToTextBox(A);document.getElementById("clearSearchResultText").style.display="";if(isFirstSearch){t="$$"+TreeBinding.GetMapPath(", ",false)}searchFromExample=false;var v=SearchWhere.toLowerCase();if(v.indexOf("đoạn đường ")==0||v.indexOf("doan duong ")==0){var j=100;v=v.substring(11).replace(/^\s+|\s+$/g,"");var q=GetSectionId(v[0]);SearchNearByPolylineExt(q,SearchWhat,"",1,j);return}if(v.indexOf("gần ")==0||v.indexOf("gan ")==0){v=v.substring(4).replace(/^\s+|\s+$/g,"");var n=v.indexOf(",");var p=v.substring(0,n);var d=v.substring(n+1);var b=2000;if(n>=0){p=v.substring(0,n);d=v.substring(n+1);d=d.replace(/^\s+|\s+$/g,"")}else{p=v;d=""}SearchNearByPointExt(p,d,"","",SearchWhat,"",o,b);return}if(r==1||isPhoneNumber(A)){AJLocationSearch.SearchResult(A,y,t,o,u,e,c,g,f,1,PhoneBinding);return}AJLocationSearch.SearchResult(A,y,t,o,u,e,c,g,f,r,FindPlaceChange_CallBack);isSearching=true;return}else{hideBusyDiv()}}var connection_timeout=15*60*1000;var last_ping=0;function ping_connection(){var a=new Date();if(a-last_ping>connection_timeout){last_ping=a;AJLocationSearch.ping_connection("1")}}function FillQueryToTextBox(b){b=b.replace(" ở gần "," gần ");b=b.replace(" o gan "," gần ");b=b.replace(" ở trên đoạn đường "," | đoạn đường ");b=b.replace(" o tren doan duong "," | đoạn đường ");b=b.replace(" trên đoạn đường "," | đoạn đường ");b=b.replace(" tren doan duong "," | đoạn đường ");b=b.replace(" ở "," | ở ");b=b.replace(", gần "," gần ");b=b.replace(" gần "," | gần ");b=b.replace(", gan "," gan ");b=b.replace(" gan "," | gan ");var a=b.indexOf("|");if(a!=-1){SearchWhat=Global.TrimSpace(b.substring(0,a));SearchWhere=Global.TrimSpace(b.substring(a+2))}else{if(b.indexOf("$ ")==0){SearchWhere=Global.TrimSpace(b.substring(2));SearchWhat=""}else{SearchWhat=Global.TrimSpace(b);SearchWhere=""}}}var arrLogoPath;var PointArray=new Array();var PAGE_ROWS=10;var PAGE_SHOW=7;var DELTA_FROM_CENTER=3;var dsResultData;function FindPlaceChange_CallBack(a){isSearching=false;hideBusyDiv();dsResultData=a.value;var v=new Array();if((null!=dsResultData)&&("object"==typeof(dsResultData))){var c=dsResultData.Tables[0].Rows.length;var b=dsResultData.Tables[1].Rows[0].HitSize;var w=dsResultData.Tables[1].Rows[0].Key;var t=dsResultData.Tables[1].Rows[0].What;var o=dsResultData.Tables[1].Rows[0].Where;w=w.replace(/\[QUOTE]/g,'"');var q=w.indexOf("|");var m="",k="";if(q>=0){m=Global.TrimSpace(w.substring(0,q));k=Global.TrimSpace(w.substring(q+1))}if(k!=""){if(m!=""){FillQueryToTextBox(m+" | "+k)}else{FillQueryToTextBox("$ "+k)}}else{FillQueryToTextBox(m)}var h=parseInt((b+PAGE_ROWS-1)/PAGE_ROWS);var n=10;h=(h>n)?n:h;var r=h>PAGE_SHOW?PAGE_SHOW:h;var j=dsResultData.Tables[1].Rows[0].PageIdx;var e=dsResultData.Tables[1].Rows[0].Lx;var d=dsResultData.Tables[1].Rows[0].Ly;var g=dsResultData.Tables[1].Rows[0].Rx;var f=dsResultData.Tables[1].Rows[0].Ry;searchType=dsResultData.Tables[1].Rows[0].SearchType;var p=dsResultData.Tables[1].Rows[0].SuggestedKey;var u=(j-1)*PAGE_ROWS+1;var l=u+PAGE_ROWS-1>b?b:u+PAGE_ROWS-1;if(false&&arrMapPath!=null&&arrMapPath.length>0){var s='<div class="dtree"  style="padding: 0px 10px 10px;"><div class="dTreeNode">                                <img id="itree0" alt="" src="Treeview/dtree/img/base.gif"/>                                <div id="map_path_div" style="display:inline;white-space:normal;">';s+=TreeBinding.GetMapPath(" > ",true,true);s+="</div></div>";v[v.length]=s}v[v.length]='<table id=TablePlace width=100% border=0 cellspacing=0 cellpadding=0 style="overflow:auto;">';v[v.length]=Global.GetResultText(w,"<b>"+m+"</b>",k,p,b,dsResultData.Tables[1].Rows[0].IsLonLat,dsResultData.Tables[1].Rows[0].IsAddress,u,l);KeySearch=w;if(j+1<=h&&isFirstSearch){setTimeout(function(){isBindingMorePlace=true;AJLocationSearch.FindMorePlace(w,t,o,1,map.getLevel(),e,d,g,f,searchType,MorePlaceBinding)},1000)}ClearSearchMapResult();if(plHighlight!=null){map.removeOverlay(plHighlight);plHighlight=null}HideSelectPlaceBox();isFirstSearch=false;v[v.length]=BindResult(dsResultData.Tables[0]);v[v.length]="</table>";v[v.length]=Global.GetComplainLink(w);v[v.length]=Global.BuildPaging(j,h,b,r,Global.PagingFindPlace,new Array(RemoveHTMLTag(w),t,o,e,d,g,f,searchType))}else{v[v.length]="</table>";v[v.length]=Global.GetNotFoundText("<b>"+RemoveHTMLTag(document.getElementById("mapinput").value)+"</b>","","","");v[v.length]=Global.GetComplainLink(KeySearch)}ChangeFunctionType(GLOBAL_SEARCH_FUNCTION);document.getElementById("searchresult_div").innerHTML=v.join("");document.getElementById("searchresult_div").scrollTop=0;map.fitMultiOverlays(arrSearchMapResult)}function SearchPage(f,b,e,c,g,d,a){FindPlace(f,b,e,c,g,d,a)
}function ClearSearchMapResult(){unloadAddPlaceFunc();CloseSendMap();for(var a=0;a<arrSearchMapResult.length;a++){map.removeOverlay(arrSearchMapResult[a])}arrSearchMapResult=new Array();resultActive=-1;if(isFirstSearch){isBindingMorePlace=false;for(var a=0;a<arrMorePlaceResult.length;a++){map.removeOverlay(arrMorePlaceResult[a])}arrMorePlaceResult=new Array();isFirstSearch=false}}function ClearSearchResult(){document.getElementById("clearSearchResultText").style.display="none";if(arrMapPath!=null&&arrMapPath.length==0){arrMapPath=new Array();arrMapPath[0]=new Array(0,"Việt Nam","VN")}ClearSearchMapResult();isBindingMorePlace=false;KeySearch="";for(var a=0;a<arrMorePlaceResult.length;a++){map.removeOverlay(arrMorePlaceResult[a])}arrMorePlaceResult=new Array();if(plHighlight!=null){map.removeOverlay(plHighlight);plHighlight=null}if(document.getElementById("searchoptions")!=null){Show_Map_Help()}}function ClearPathResult(){document.getElementById("clearPathResultText").style.display="none";document.getElementById("FindPathStatus").innerHTML="";isFinding=false;isChanging=false;for(var a=PlaceToFindPathArray.length-1;a>=0;a--){RemovePlace(a+",0",1)}AJLocationSearch.RemoveDirectionPlaces(-1,-1);for(var a=0;a<arrFinish.length;a++){map.removeOverlay(arrFinish[a])}arrFinish=new Array();firstStart=true;clearArrows()}function loadMapMoreInfo(e,b){var f=new GeneralMap.Map(document.getElementById("InfoMap"),GeneralMap.mapType);f.addControl(new GeneralMap.SmallZoomControl());f.setCenter(new GeneralMap.LatLng(e,b),10);var c=new GeneralMap.Icon("images/mymap_icon/point_7.gif");c.iconSize=new GeneralMap.Size(32,32);var d=new GeneralMap.MarkerOptions(c);var a=new GeneralMap.Marker(new GeneralMap.LatLng(e,b),d);f.addOverlay(a)}function InfoWindowWithSearchNearBy(l,y,v){var I=l.Name;var g=l.Address;var c=l.ShortComment;var e=l.Logo;var f=l.Website;var p=l.VietbandoID;var w=l.Picture;var k=l.Tel;var D=l.Table;var u=l.RootID;var x=l.StoreID;var o=l.URLFriendly;var H=l.GUID;var r=(D!="ds_store")?"ip":"ds";var n=l.Latitude;var G=l.Longitude;var b="From here",a="To here",t="Search nearby",F="Detail...",q="Search inside",C="Full view",j="Mark this location",A="Add content";if(nLanguage==0){b="Từ đây";a="Đến đây";F="Xem chi tiết...";t="Tìm xung quanh";q="Tìm bên trong";C="Xem dạng lớn";j="Đánh dấu điểm này";A="Thêm nội dung"}var B=new Array();B[B.length]='<div class="MiniPopup">';B[B.length]='<span class="Title">'+I+"</span>";B[B.length]='<br/><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" /><img src="images/start_yellow.gif" />';if(H!=""&&H!=null){if(arrListFavour!=null){var h=false;for(var z=0;z<arrListFavour.length;z++){if(arrListFavour[z][1]==H){h=true;break}}if(h){B[B.length]=" - "+((nLanguage==0)?"Đã đánh dấu vị trí này":"Location marked")}else{B[B.length]=' - <span id="divmarkloc"><a class="flnk" id="marklocation'+y+'">'+j+"</a></span>"}}else{B[B.length]=' - <a class="flnk" id="marklocation'+y+'">'+j+"</a>"}}B[B.length]='<p class="Content">';if(w!=""&&w!=null){if(w.indexOf("../")==0){w=w.substring(w.indexOf("../"))}}if(w==""||w==null){w="images/chuacoanh.gif"}else{B[B.length]='<img src="'+w+'" class="Image"/>'}if(g!=""&&g!=null){B[B.length]='<br/><img src="images/diachi.gif" width="20" height="20" align="absmiddle"/>'+g}if(k!=""&&k!=null){B[B.length]='<br/><img src="images/dienthoai.gif" width="20" height="20" align="absmiddle"/>'+k}if(f!=""&&f!=null){B[B.length]='<br/><img src="images/website.gif" width="20" height="20" align="absmiddle"/><a style="color:#558800;text-decoration:underline;" href="'+f+'">'+f+"</a>"}if(p!=""&&p!=null){B[B.length]='<br/><img src="images/iconsearch.gif" width="20" height="20" align="absmiddle"/><a href="vbdmap.aspx?sk='+p+'">'+p+"</a>"}B[B.length]="</p>";B[B.length]="<br/>";if(H!=""&&H!=null&&r=="ip"){B[B.length]='<a class="flnk" id="createcontent'+y+'" onclick=\'window.open("DS_Manager/ManageStore.aspx?guid='+H+"&type="+r+"\")'>"+A+"</a> - "}B[B.length]='<a class="flnk" id="viewdetail'+y+'">'+F+"</a>";B[B.length]='<div class="CommonFunction" style="padding-left:0px">';var m="Find business near by this point",E="Eg: Hotel",d="Radius(m)",s="Find";if(nLanguage==0){m="Tìm dịch vụ ở gần vị trí này";E="VD: Khách sạn";d="Bán kính(m)";s="Tìm"}B[B.length]='<table width="98%" cellspacing="0" cellpadding="0" style="margin-left:5px;" >';B[B.length]='<tr><td colspan="3" align="left" valign="middle"><b>'+m+"</b></td></tr>";B[B.length]="<tr>";B[B.length]='<td width="51%" align="left" valign="middle" style="font-size:10px; color:#666666; height:10px;">'+E+"</td>";B[B.length]='<td colspan="2" align="left" valign="middle" style="font-size:10px; color:#666666; height:10px;">'+d+"</td>";B[B.length]="</tr>";B[B.length]="<tr>";B[B.length]='<td align="left" valign="middle"><input id="searchnearbypoint" type="text" autocomplete="off" onkeydown="return SearchNearByPointEnter(event,\''+I+"','"+g+"','"+G+"','"+n+'\', null,null)" style="width:120px; height:17px; border:1px #999999 solid; margin-right:3px;" /></td>';B[B.length]='<td width="20%" align="left" valign="middle"><input type="text" autocomplete="off" id="searchnearbypoint_radius" value="2000" onkeydown="return SearchNearByPointEnter(event,\''+I+"','"+g+"','"+G+"','"+n+'\', null,null)" style="width:65px; height:17px; border:1px #999999 solid; margin-right:5px;" /></td>';B[B.length]='<td width="29%" align="left" valign="middle"><input type="button" align="absbottom" style="cursor:pointer;width:50px;" onclick="SearchNearByPointExt(\''+I+"','"+g+"','"+G+"','"+n+"', null,'', 1,null)\" value=\""+s+'" ></td>';B[B.length]="</tr>";B[B.length]='<tr><td colspan="3" align="left" valign="middle"><a style="font-weight:bold;" class="flnk" id="pback'+y+'">« Quay lại</a></td></tr>';B[B.length]='<tr><td colspan="3" align="left" valign="middle"></td></tr>';B[B.length]="</table>";B[B.length]="</div>";return B.join("")}var centerObjectNearbyTemp;var centerObjectNearby;function ViewDetailCurrentLevelWithSearchNearBy(b,a){if(a==null){return}var g;centerObjectNearbyTemp=b;var f=b.Latitude;var d=b.Longitude;if(b.Address!=b.Name&&b.Address!=""){g=b.Name+", "+b.Address}else{g=b.Name}var c=InfoWindowWithSearchNearBy(b,a,g);var e=new GeneralMap.InfoWindowOptions();e.autoPan=true;e.offset=new GeneralMap.Size(0,-26);if(a>20){arrMorePlaceResult[a-20-1].openInfoWindow(c,e)}else{arrSearchMapResult[a-1].openInfoWindow(c,e);HightlightActiveItem(a)}setTimeout(function(){if(document.getElementById("searchnearbypoint")!=null){document.getElementById("searchnearbypoint").focus()}},500);document.getElementById("pback"+a).onclick=function(){ViewDetailCurrentLevel(b,a)}}function ResultViewDetailCurrentLevel(a){ViewDetailCurrentLevel(dsResultData.Tables[0].Rows[a-1],a)}function ViewDetailCurrentLevel(d,b){var a=d.Name;var h=d.Address;var f=d.StoreID;var g=a;if(h!=a&&h!=""){g=a+", "+h}var c=BuildMiniPopupWindow(d,b-1,g,false);var e=new GeneralMap.InfoWindowOptions();e.autoPan=true;if(document.getElementById("searchoptions")!=null){e.maxContent="Loading...";e.maxTitle="Loading..."}if(f!=null&&f!=-1&&f!=""){e.maxContent="";e.maxTitle=""}e.offset=new GeneralMap.Size(0,-26);GeneralMap.Event.addListener(infoWindow,"maximizeclick",function(){});GeneralMap.Event.addListener(infoWindow,"maximizeend",function(){ViewDetailInfo(d,b)});GeneralMap.Event.addListener(infoWindow,"restoreend",function(){AtachEventMiniPopup(d,b,g)});if(b>20){arrMorePlaceResult[b-20-1].openInfoWindow(c,e)}else{arrSearchMapResult[b-1].openInfoWindow(c,e);HightlightActiveItem(b)}AtachEventMiniPopup(d,b,g);AddLogClick(d,2)}function ViewOnMap(a){map.zoomToLevel(12);ResultViewDetailCurrentLevel(a)}function ShowSearchNearByLngLat(e){var a=e.toUrlValue();var b=a.indexOf(",");var d=a.substring(0,b);var c=a.substring(b+1);var f='<table width=270px border=0 cellspacing=0 cellpadding=0 style="margin-left:3px; margin-top:3px;">';f+="<tr align=left><td colspan=3><strong>";if(nLanguage==0){f+=' Tìm dịch vụ ở gần vị trí này.</strong><br/> <span style="color:#999999;">VD: khách sạn.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bán kính (m)</span></td></tr>';
f+='<tr><td><input id=searchnearbypoint autocomplete="off" onkeydown="return SearchNearByPointEnter(event,\''+a+"','','"+c+"','"+d+"', null,null)\" type=text style=\"font-size:11px; width:155px; height:17px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;\" /></td><td><input id=searchnearbypoint_radius autocomplete='off' value='2000' onkeydown=\"return SearchNearByPointEnter(event,'"+a+"','','"+c+"','"+d+'\', null,null)" type=text style="font-size:11px; width:50px; height:17px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><button style="cursor:pointer; width:50px; " onclick="SearchNearByPointExt(\''+a+"','','"+c+"','"+d+"',null,'',1,null)\">Tìm</button></td>"}else{f+=' Find business near by this point.</strong><br/> <span style="color:#999999;">VD: khách sạn.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Radius (m)</span></td></tr>';f+='<tr><td><input id=searchnearbypoint autocomplete="off" onkeydown="return SearchNearByPointEnter(event,\''+a+"','','"+c+"','"+d+"', null,null)\" type=text style=\"font-size:11px; width:155px; height:17px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;\" /></td><td><input id=searchnearbypoint_radius autocomplete='off' value='2000' onkeydown=\"return SearchNearByPointEnter(event,'"+a+"','','"+c+"','"+d+'\', null,null)" type=text style="font-size:11px; width:50px; height:17px; border:1px #999999 solid; margin-top:7px; margin-bottom:7px; margin-right:5px;" /></td><td><button style="cursor:pointer; width:50px; " onclick="SearchNearByPointExt(\''+a+"','','"+c+"','"+d+"',null,'',1,null)\">Find</button></td>"}f+=" </tr></table>";map.openInfoWindow(e,f);setTimeout(function(){if(document.getElementById("searchnearbypoint")!=null){document.getElementById("searchnearbypoint").focus()}},500)}var g_Index;var g_Value;var g_CurPageAB;function SearchPlace(a,c,e){ping_connection();if(isSearching==true){return}g_Index=a;g_Value=c;current_index=a;if(c!=null&&c.length>0){isSearching=true;showBusyDiv("","SelectPlace");var d=map.getBounds();var b=GLOBAL_SEARCH_ALL;AJLocationSearch.SearchResult(c,"","",e,map.getLevel(),d.getNorthWest().lng(),d.getNorthWest().lat(),d.getSouthEast().lng(),d.getSouthEast().lat(),b,FindPathSearch_CallBack)}return false}function FindPathSearch_CallBack(a){isSearching=false;hideBusyDiv("","SelectPlace");var x=a.value;var D=new Array();if((null!=x)&&("object"==typeof(x))){var f=x.Tables[0].Rows.length;var b=x.Tables[1].Rows[0].HitSize;var e=x.Tables[1].Rows[0].IsAddress;var t=x.Tables[1].Rows[0].SuggestedKey;var G=x.Tables[1].Rows[0].Key;var c=x.Tables[1].Rows[0].IsLonLat;var u=G.indexOf("|");var q,o;if(u>=0){q=G.substring(0,u);q=Global.TrimSpace(q);o=G.substring(u+1);o=Global.TrimSpace(o)}var l=parseInt((b+PAGE_ROWS-1)/PAGE_ROWS);var r=10;l=(l>r)?r:l;var w=l>PAGE_SHOW?PAGE_SHOW:l;var m=x.Tables[1].Rows[0].PageIdx;searchType=x.Tables[1].Rows[0].SearchType;var t=x.Tables[1].Rows[0].SuggestedKey;var C=(m-1)*PAGE_ROWS+1;var p=C+PAGE_ROWS-1>b?b:C+PAGE_ROWS-1;if(b==1){var B=x.Tables[0].Rows[0].Address;var j=x.Tables[0].Rows[0].Name;var v=x.Tables[0].Rows[0].Latitude;var d=x.Tables[0].Rows[0].Longitude;var h=v;var F=d;var A=j;if(B!=""){A=j+", "+B}if(e){A=B+((B!="")?", ":"")+j}changeContentFlag=true;AddPlaceAB(current_index,v,d,A);if(PlaceToFindPathArray.length==1){map.setCenter(new GeneralMap.LatLng(h,F),map.getLevel())}return}D[D.length]='<table id="TablePlace" width="93%" border="0" cellspacing="0" cellpadding="0" style="overflow:auto;">';D[D.length]=Global.GetResultText(G,"<b>"+q+"</b>",o,t,b,x.Tables[1].Rows[0].IsLonLat,x.Tables[1].Rows[0].IsAddress,C,p,g_Index);for(var z=0;z<f;z++){var B=x.Tables[0].Rows[z].Address;var j=x.Tables[0].Rows[z].Name;var v=x.Tables[0].Rows[z].Latitude;var d=x.Tables[0].Rows[z].Longitude;var h=x.Tables[0].Rows[z].CenterLat;var F=x.Tables[0].Rows[z].CenterLng;D[D.length]='<tr><td align="center" valign="middle">';var A=j;if(B!=""){A=j+", "+B}if(e){A=B+((B!="")?", ":"")+j}D[D.length]='<table width="99%" border="0" align="left" cellpadding="0" cellspacing="0" onmouseover="ResultEntryPlaceABMouseOver(this)" onmouseout="ResultEntryPlaceABMouseOut(this)" style="border:1px #ffffff solid; border-bottom:1px #efefef solid; margin-left:2px; margin-right:2px;cursor:pointer" onclick="AddPlaceAB('+current_index+","+v+","+d+",'"+A+'\')">            <tr><td colspan="2" style="height:5px;"></td></tr>            <tr>                <td align="center" valign="middle" style="width:40px;">                    <img id="resultimage_placeAB'+(z+1)+'" src="images/'+(z+1)+'.gif"/>                </td>                <td align="left">                    <a>'+j+"</a>";if(B!=""){D[D.length]="<br/>"+B+"<br/>"}D[D.length]="</td></tr>";D[D.length]='<tr><td colspan="2" style="height:5px;"></td></tr>';D[D.length]="</table>";D[D.length]="</td></tr>"}D[D.length]='<tr><td height="10px"></td></tr>';D[D.length]='<tr><td align="center" valign="middle">';var l=parseInt((b+PAGE_ROWS-1)/PAGE_ROWS);var r=10;l=(l>r)?r:l;var w=l>PAGE_SHOW?PAGE_SHOW:l;var m=x.Tables[1].Rows[0].PageIdx;D[D.length]=Global.BuildPaging(m,l,b,w,Global.PagingSearchPlaceForPath,new Array(g_Index,g_Value,m));D[D.length]="</td></tr></table>";var g=document.getElementById("direction"+current_index).offsetTop;var n=document.getElementById("findpath_div").scrollTop;var y=document.getElementById("findpath_div").clientHeight;var k="top";var E=g-n;if(E+280<y){E=E+122}else{E=E+122-261+20;k="bottom"}var s='<table width="100%" height="280" border="0" cellspacing="0" cellpadding="0">        <tr>            <td class="p_topL"></td>            <td class="p_topM"></td>            <td class="p_topR"></td>        </tr>        <tr>            <td class="p_middleL" align="right" valign='+k+'><img src="images/selectplace_tamgiac.gif" /></td>            <td class="p_middle" style="background-color:#FFFFFF">                <div style="width:260px;font-size:11pt;height:24px;color:#E37833">                    <b>Chọn một vị trí cho điểm </b><img src="images/place_'+current_index+'.gif" align="absmiddle" />                    <img style="float:right;cursor:pointer" src="API/images/iwclose.gif" onclick="HideSelectPlaceBox()"/>                </div>                <div id="info_selectplace" style="width:260px; height:210px; overflow:auto;">'+D.join("")+'</div>		        <div style="width:260px; height:20px; text-align:center; padding-top:5px">Click để chọn vị trí</div>		    </td>		    <td class="p_middleR"></td>		</tr>		<tr>		    <td class="p_bottomL"></td>		    <td class="p_bottomM"></td>		    <td class="p_bottomR"></td>		</tr>		</table>';myrect=document.getElementById("SelectPlace");if(myrect==null){myrect=document.createElement("div");myrect.id="SelectPlace";myrect.style.left=345+"px";myrect.style.top=E+"px";myrect.style.position="absolute";myrect.style.overflow="hidden";myrect.style.width=290+"px";myrect.style.height=280+"px";myrect.style.zIndex=400;document.body.appendChild(myrect)}else{myrect.style.top=E+"px"}myrect.innerHTML=s}}function AddPlaceAB(c,e,b,f){if(c==null){c=currentSelectedResAB_Id}if(e==null){e=currentSelectedResAB_Lat}if(b==null){b=currentSelectedResAB_Lng}if(f==null){f=currentSelectedResAB_Text}if(c==-1){HideSelectPlaceBox();return}var d=document.getElementById("direction"+c);f=RemoveHTMLTag(f);var a=PlaceToFindPathArray.length;PlaceStatusArray[c]=1;if(c+1>=a){RemovePlace(c+",0");if(toFirstFlag==false){if(c==0){AddPlaceFromFind(new GeneralMap.LatLng(e,b),f)}else{AddPlaceToFind(new GeneralMap.LatLng(e,b),f)}}else{AddPlaceFromFind(new GeneralMap.LatLng(e,b),f)}}else{d.childNodes[0].rows[0].cells[1].childNodes[0].value=f;PlaceToFindPathArray[c][0].setPoint(new GeneralMap.LatLng(e,b));FindShortestPath(c+",0",0,0,0)}changeContentFlag=false;HideSelectPlaceBox()}function HideSelectPlaceBox(){myrect=document.getElementById("SelectPlace");if(myrect!=null){document.body.removeChild(myrect)}}function ResultFromHere(a,b){FromHere(dsResultData.Tables[0].Rows[a-1],b)
}function ResultToHere(a,b){ToHere(dsResultData.Tables[0].Rows[a-1],b)}function FromHere(a,b){b=RemoveHTMLTag(b);AddPlaceFromFind(new GeneralMap.LatLng(a.Latitude,a.Longitude),b);AddLogClick(a,0)}function ToHere(a,b){b=RemoveHTMLTag(b);AddPlaceToFind(new GeneralMap.LatLng(a.Latitude,a.Longitude),b);AddLogClick(a,1)}function RemoveHTMLTag(a){if(a==null){return""}a=a.replace(/<.*?>|<[/].*?>/g,"");return a}function ShowTree(){TreeBinding.BindTree()}function Show_Map_Help(){var c="Change default location",d="Set default location",j="Instructions",g="Search for location, example:",f="Search nearby, example:",a="Search for address, example:",h="Search for phone number, example:",b="Online support";if(nLanguage==0){c="Thay đổi vị trí mặc định";d="Thiết lập vị trí mặc định";j="Hướng dẫn tìm kiếm";g="Tìm vị trí, ví dụ:";f="Tìm xung quanh vị trí, ví dụ:";a="Tìm địa chỉ, ví dụ:";h="Tìm số điện thoại, ví dụ:";b="Hỗ trợ trực tuyến"}var e=new Array();e[e.length]='<div id="tblMapHelp" style="padding:5px">';e[e.length]='<div>                                <div class="Acor">                                <span class="Title">Tính năng mới</span>                                <div class="Content" >                                    <div style="height:20px"><img src="images/vbd_mobile.gif" align="top"/> <a href="Help/mobile.html?cs=1" style="font-size:10pt">Vietbando Mobile</a> <img src="images/new_small.gif"/></div>                                    <div style="height:20px"><img src="images/vbd_id.gif" align="top"/> <a href="Help/BDQCDN.html" style="font-size:10pt" onclick="ClickStatisticsInsert(\'register_VietbandoID\',\'Đăng ký địa chỉ số - VietbandoID\')">Đăng ký địa chỉ số - VietbandoID</a> <img src="images/new_small.gif"/></div>                                    <div style="height:20px"><img src="vbd_images/vbdicon.ico" align="top"/> <a style="font-size:10pt" onclick="installSearchEngine();ClickStatisticsInsert(\'install_vietbando_engine\',\'Cài đặt Vietbando vào thanh tìm kiếm\')">Cài đặt Vietbando vào thanh tìm kiếm</a></div>                                    <div style="height:20px"><img src="images/additem.gif" align="top"/> <a style="font-size:10pt" onclick="loadAddPlaceFunc();ClickStatisticsInsert(\'add_location\',\'Đưa vị trí của bạn vào bản đồ\')">Đưa vị trí của bạn vào bản đồ.</a></div>                                    <div style="height:20px"><img src="images/additem.gif" align="top"/> <a style="font-size:10pt" onclick="ClickStatisticsInsert(\'add_business\',\'Đưa doanh nghiệp của bạn vào bản đồ\')" href="ds_manager/managestore.aspx">Đưa doanh nghiệp của bạn vào bản đồ</a></div>                                </div>';e[e.length]="</div>";e[e.length]='<div id="MarkedLocation">'+MarkedLocationHTML()+"</div>";e[e.length]='<div class="Acor">                                <span class="Title">'+j+'</span>                                <div class="Content" >                                    <b>'+g+'</b><br>                                        <a id="a,0" onClick="MapExampleClick(this.id)">Hà Nội</a><br>                                        <a id="b,0" onClick="MapExampleClick(this.id)">TPHCM</a><br>                                        <a id="c,0" onClick="MapExampleClick(this.id)">Quận 1, TPHCM</a><br>                                        <a id="d,0" onClick="MapExampleClick(this.id)">Nguyễn Văn Cừ, TPHCM</a><br>                                        <a id="e,0" onClick="MapExampleClick(this.id)">Giao lộ Cách Mạng Tháng Tám &amp; Nguyễn Đình Chiểu</a><br>                                        <a id="f,0" onClick="MapExampleClick(this.id)">Đảo Phú Quốc</a><br>                                        <a id="g,0" onClick="MapExampleClick(this.id)">Khách sạn Caravelle</a><br>                                        <br>                                    <b>'+f+'</b><br>                                        <a id="i,0" onClick="MapExampleClick(this.id)">Nhà hàng gần Khách sạn Caravelle</a><br>                                        <br>                                    <b>'+a+'</b><br>                                        <a id="j,0" onClick="MapExampleClick(this.id)">31A Huỳnh Văn Bánh, Quận Phú Nhuận, TPHCM</a><br>                                        <br>                                    <b>'+h+'</b><br>                                        Vietbando: <a id="k,0" onClick="MapExampleClick(this.id)">39956665</a><br>                                        Khách sạn Rex: <a id="l,0" onClick="MapExampleClick(this.id)">38293115</a><br>                                </ul>                                </div>                                <div id="MMOnlineSupport" onClick="showOnlineSupport(this)" class="link"><img src="images/xuong.gif" width="16" align="bottom" height="16"><span class="listofprovinces"><strong>'+b+"</strong></span></div>";document.getElementById("searchresult_div").innerHTML=e.join("")}function MapExampleClick(c){var a=RemoveHTMLTag(document.getElementById(c).innerHTML);a=a.replace("amp;","").replace("&gt;",">");var b=c.split(",");SetSearchType(b[1]);if(b[2]=="undefined"||b[2]==null){document.getElementById("mapinput").style.background="#ffffff";document.getElementById("mapinput").value=a;searchFromExample=true;doSearch()}else{SearchPlace(b[2],a,1)}}function FindPlaceSpellCheckerClick(a,b){var c=document.getElementById("direction"+a);c.childNodes[0].rows[0].cells[1].childNodes[0].value=b;SearchPlace(a,b,1)}function OnforcusTextBoxAB(a){HideSelectPlaceBox();prev_selectedResAB_Text=a.value;selectedResAB_Text=a.value;a.style.background="#ffffff"}function OnblurTextBoxAB(a){if(a.value==""){if(nLanguage==0){a.style.background="#FFFFFF url(images/helptimduong.gif) left no-repeat"}else{a.style.background="#FFFFFF url(images/helptimduongE.gif) left no-repeat"}}var c=a.parentNode.parentNode.parentNode.parentNode.parentNode.id;var b=parseInt(c.substring(9,c.length));if(selectedResAB_Text!=a.value&&document.getElementById("SelectPlace")==null){if(CheckInputDatatype(a.value)!="coor"){SearchPlace(b,a.value,1)}}}function AddLogClick(a,b){}function isPhoneNumber(a){a=Global.RemoveSpace(a.replace(/[ .()]+/g,""));if(a.length>=6&&!isNaN(a)){return true}else{return false}}var tree;var PreviousSelectNode;var arrMapPath=new Array();arrMapPath[0]=new Array(0,"Việt Nam","VN");var bViewGeo=false;var rgControl;var firstTimeMoveInList=false;TreeBinding={GetMapPath:function(b,a,d){var e="";if(a&&arrMapPath!=null&&arrMapPath.length>0){e='<div id="map_path_div" style="display:inline;white-space:normal;">';for(var c=0;c<arrMapPath.length;c++){var f=b;if(c==0){f=""}if(!d&&c==arrMapPath.length-1){e+=f+arrMapPath[c][1]}else{e+=f+'<a onclick="TreeBinding.TreeClick(event,'+arrMapPath[c][0]+",'"+arrMapPath[c][1]+"','"+arrMapPath[c][2]+"')\">"+arrMapPath[c][1]+"</a>"}}e+="</div>"}else{if(arrMapPath!=null&&isFirstSearch&&NeedFilter&&!searchFromExample){for(var c=1;c<arrMapPath.length;c++){if(arrMapPath[c][2]!="L"){e=b+arrMapPath[c][1]+e}}}}return e},GetNavigatorPath:function(b,a,d){var e="";if(a&&arrMapPath!=null&&arrMapPath.length>0){e='<div id="map_path_div" style="display:inline;white-space:normal;">';for(var c=0;c<arrMapPath.length;c++){var f=b;if(c==0){f=""}if(arrMapPath[c][2]=="W"||arrMapPath[c][2]=="L"){e+=f+arrMapPath[c][1]}else{e+=f+'<a onclick="TreeBinding.NavigatorClick(event,'+arrMapPath[c][0]+",'"+arrMapPath[c][1]+"','"+arrMapPath[c][2]+"')\">"+arrMapPath[c][1]+"</a>"}}e+="</div>"}else{if(arrMapPath!=null&&isFirstSearch&&NeedFilter&&!searchFromExample){for(var c=1;c<arrMapPath.length;c++){e=b+arrMapPath[c][1]+e}}}return e},bToggleListMap:false,ShowMapList:function(f,c,e,d){firstTimeMoveInList=false;var b=document.getElementById("ListMapDiv");if(b!=null&&!TreeBinding.ToggleListMap){var a=document.getElementById("container");b.style.left="362px";b.style.top=a.offsetTop-6+"px";$("#ListMapDiv").animate({height:parseInt(a.style.height)-6+"px",opacity:"0.9"},500,"",function(){if(c=="D"||c=="P"||c=="VN"){TreeBinding.BindTree(f,false,c)}TreeBinding.ShowOnMap(f,c,e,d);
TreeBinding.ToggleListMap=true})}else{if(c=="D"||c=="P"||c=="VN"){TreeBinding.BindTree(f,false,c)}TreeBinding.ShowOnMap(f,c,e,d)}},HideMapList:function(){if(!firstTimeMoveInList){return}var a=document.getElementById("ListMapDiv");if(a!=null&&TreeBinding.ToggleListMap){$("#ListMapDiv").animate({height:"0px",opacity:"0"},500);TreeBinding.ToggleListMap=false}},ToogleListMap:function(d,a,c,b){if(TreeBinding.ToggleListMap){TreeBinding.HideMapList()}else{TreeBinding.ShowMapList(d,a,c,b)}},NavigatorClick:function(f,h,a,c,g,d){if(c=="W"){return}for(var e=0;e<arrMapPath.length;e++){if(arrMapPath[e][2]==c){arrMapPath.length=e;break}}arrMapPath[arrMapPath.length]=new Array(h,a,c);var b=document.getElementById("ListMapDiv");if(b==null){b=document.createElement("div");b.id="ListMapDiv";b.style.border="1px #558800 solid";b.style.position="absolute";b.style.padding="4px 4px 8px 4px";b.style.width="280px";b.style.zIndex="101";b.style.opacity="0.9";b.style.filter="alpha(opacity = 90)";b.style.backgroundColor="white";b.style.overflow="auto";b.onmouseover=function(){firstTimeMoveInList=true};document.body.appendChild(b);TreeBinding.ShowMapList(h,c,g,d)}else{if(tree!=null&&tree.Nodes.length>0&&tree.Nodes[0].id==h){TreeBinding.ToogleListMap(h,c,g,d)}else{b.innerHTML="";TreeBinding.ShowMapList(h,c,g,d)}}},BindTree:function(h,f,a){if(h==null){var e=getCookie("VBDMyCurrentTreeID");var g=getCookie("VBDMyTreeNavigator");if(e&&g){h=e;var g=g.split(",");for(var k=0;k<g.length;k+=3){arrMapPath[k/3]=new Array(g[k],g[k+1],g[k+2])}TreeBinding.ShowOnMap(arrMapPath[arrMapPath.length-1][0],arrMapPath[arrMapPath.length-1][2])}else{h=0}}var j=TreeBinding.GetNavigatorPath(" › ",true,true);document.getElementById("TreeFilter").innerHTML=((nLanguage==0)?"Tìm ở: ":"Search in: ")+j;setCookie("VBDMyCurrentTreeID",h,5000,"","","");setCookie("VBDMyTreeNavigator",arrMapPath,5000,"","","");if(tree!=null&&tree.Nodes.length>0&&tree.Nodes[0].id==h){return}if(a=="W"){return}var b=document.getElementById("ListMapDiv");if(b!=null){var d=new dTree("tree","Treeview/dtree/");d.config.inOrder=true;d.config.useStatusText=true;var c=TreeBinding.GetMapPath(" > ",true,true);d.add(h,-1,c);showBusyDiv("","ListMapDiv");TreeBinding.LoadTree(d,h);hideBusyDiv("","ListMapDiv");if(f){removeArea();removePosition()}if(d.ChildsCount(h)>0){tree=d;b.innerHTML='<div style="float:right">[<a onclick="TreeBinding.HideMapList()">X</a>]</div><div style="padding:0px 10px 10px 10px">'+tree+"</div>";b.scrollTop=0}else{arrMapPath.length=arrMapPath.length-1}}},LoadTree:function(b,e){var j=AJLocationSearch.GetChild(e).value;if(j==null||j.Rows.length==0){return}for(var c=0;c<j.Rows.length;c++){var h=j.Rows[c].Longitude;var g=j.Rows[c].Latitude;var d=j.Rows[c].NAME;var a=j.Rows[c].TYPE;var f=j.Rows[c].ID;b.add(f,e,'<a onclick="TreeBinding.TreeClick(event,'+f+",'"+d+"','"+a+"',"+g+","+h+')">'+d+"</a>","",d,"","",b.icon.folder,b.icon.folderOpen,false)}},ShowOnMap:function(g,b,h,k){if(b=="VN"||b=="NT"){cLatLng=null;CurrentCenter=cLatLng;removeArea();if(arrSearchMapResult==null||arrSearchMapResult.length==0){map.fitOverlays()}return}cID=g;cType=b;cLatLng=new GeneralMap.LatLng(h,k);CurrentCenter=new GeneralMap.LatLng(h,k);if(b=="W"||b=="D"||b=="P"||b=="L"||b=="DC"||b=="UI"){removeArea();var j=AJLocationSearch.GetFitLevel(g,b,map.getSize().width,map.getSize().height).value;var f=new GeneralMap.InfoWindowOptions();f.autoPan=true;if(j!=null){var l=j[0];h=j[1];k=j[2];var c=j[3];var a=j[4];var e=j[5];var d=j[6];if(arrSearchMapResult==null||arrSearchMapResult.length==0){map.setCenter(new GeneralMap.LatLng(h,k),l)}if(bViewGeo){AJLocationSearch.GetAHGeometry(g,l,b,c,a,e,d,DrawGeometry)}f.autoPan=false}}},TreeClick:function(e,g,a,b,f,c){for(var d=0;d<arrMapPath.length;d++){if(arrMapPath[d][2]==b){arrMapPath.length=d;break}}arrMapPath[arrMapPath.length]=new Array(g,a,b);if(b=="D"||b=="P"||b=="VN"){TreeBinding.BindTree(g,false,b)}else{TreeBinding.BindTree(g,false,"W");TreeBinding.HideMapList()}TreeBinding.ShowOnMap(g,b,f,c)},ZoomEnd:function(){removeArea();if(cLatLng!=null&&bViewGeo){var b=map.getLevel();var a=map.getDirectionBounds();AJLocationSearch.GetAHGeometry(cID,b,cType,a.getNorthWest().lng(),a.getNorthWest().lat(),a.getSouthEast().lng(),a.getSouthEast().lat(),DrawGeometry)}},bViewGeo:false,ViewGeoChange:function(){bViewGeo=!bViewGeo;if(bViewGeo){TreeBinding.NavigatorClick(null,arrMapPath[arrMapPath.length-1][0],arrMapPath[arrMapPath.length-1][1],arrMapPath[arrMapPath.length-1][2])}TreeBinding.ShowOnMap(cID,cType)}};var isRegionSelected=false;var pre=-1;var cur=-1;var cLatLng,cID,cType;var arrHightLight=new Array();function DrawGeometry(e){removeArea();var d=e.value;if(d==""){isRegionSelected=false;return}if(d==null){isRegionSelected=false;return}isRegionSelected=true;arrHightLight=new Array();var a=(GeneralMap.mapType==GeneralMap.MapType.VietbandoMap)?0.3:0.5;for(var b=0;b<d.length;b++){if(d[b]!=null&&d[b]!=""){var c=new GeneralMap.Polygon(d[b],"red",3,"#84C221",a,a);map.addOverlay(c);arrHightLight.push(c)}}}function preLoading(a){if(a){ShowAJLoad("bodyleftpanel","bodyLeftPanel")}else{HideAJLoad("bodyleftpanel","bodyLeftPanel")}}function removeArea(){if(arrHightLight!=null){for(var a=0;a<arrHightLight.length;a++){map.removeOverlay(arrHightLight[a])}arrHightLight=new Array()}}function removePosition(){if(arrSearchMapResult!=null){if(arrSearchMapResult.length==1){map.removeOverlay(arrSearchMapResult[0])}}arrSearchMapResult=new Array()}var NeedFilter=true;function FilterChange(a){NeedFilter=a};