var MSAct,MapSel=null,Frame={Map:"1",Earth:"2",Gmap:"3"},Work={Error:"0",Success:"1",Exist:"2",None:"3",MailFail:"4",Expired:"5"},MapInfo=new MapLoginInfo("","","","");function MapLoginInfo(c,d,a,b){this.Session=c;this.Layout=d;this.MapName=b;this.Location=a}function MapSelection(b,a){this.count=b;this.properties=a}function GetSelAddrId(c){var b="",a=c.GetSelectedLayers();if(a.length==1)if(a[0].name=="Addr")MapSel!=null&&MapSel.count==1&&$.each(MapSel.properties,function(){if(this.name=="an_id"){b=this.value;return false}});return b}function GetSelMarkId(c){var b="",a=c.GetSelectedLayers();if(a.length==1)if(a[0].name=="LandMark")MapSel!=null&&MapSel.count==1&&$.each(MapSel.properties,function(){if(this.name=="lid"){b=this.value;return false}});return b}function GetSelId(e,c,d){var b="",a=e.GetSelectedLayers();if(a.length==1)if(a[0].name==c)MapSel!=null&&MapSel.count==1&&$.each(MapSel.properties,function(){if(this.name==d){b=this.value;return false}});return b}function UpdateLocLayer(a,b){$.post(GetAjax("Map"),{type:1,id:MapInfo.Session,map:MapInfo.MapName,x:a,y:b},function(a){if(a==Work.Success);})}function GetAjax(c,a){var b="../Work/"+c+".ashx";if(a!=null)b+=a;return b}function Split2Array(a,c){if(a!=null&&a!=""){var b=[];b=a.split(c);return b}else return null}function DialogInit(a){$(a).dialog({bgiframe:true,zIndex:1e4,autoOpen:false,modal:true,overlay:{backgroundColor:"#CCC",opacity:.75}})}function OpenDialog(a,c,e,b,d){if($(a)&&!c){$(a).dialog("close");return}if(b==null||b=="")b="auto";$(a).dialog("option","height",b);$(a).dialog("option","width",e);$(a).dialog("option","title",d);$(a)&&c&&$(a).dialog("open").show().focus()}function OpenWindow(h,f,c){var d=getPageSize(),g=20,e=(d.width-800)/2,a=window.open("",f,"menubar,status,scrollbars,resizable,width=800,height=600,top="+g+",left="+e);if(!a)return false;var b="";b+="<html><head></head><body><form id='formid' method='post' action='"+h+"'>";if(c)typeof c==="object"&&jQuery.each(c,function(c,a){b+="<input type='hidden' name='"+c+"' value='"+a+"'/>"});b+="</form><script type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";a.document.write(b);a.focus();return a}function SonvToWide(e){for(var c=[],b=e,d="",a=0;a<b.length;a++){if(b.charCodeAt(a)<=57&&b.charCodeAt(a)>=48)c[a]=b.charCodeAt(a)+65248;else c[a]=b.charCodeAt(a);d+=String.fromCharCode(c[a])}return d}function checkNumeric(b,c){var a=window.event?b.keyCode:b.which;if((a<48||a>57)&&a!=46)return false;else if(a==46&&c.value.indexOf(".")>=0)return false;else return true}function IsTopForm(){return top.location.href==self.location.href}function getPageSize(){var b={};if(document.documentElement&&document.documentElement.clientHeight){var a=document.documentElement;b.width=a.clientWidth>a.scrollWidth?a.clientWidth-1:a.scrollWidth;b.height=a.clientHeight>a.scrollHeight?a.clientHeight:a.scrollHeight}else{var a=document.body;b.width=window.innerWidth>a.scrollWidth?window.innerWidth:a.scrollWidth;b.height=window.innerHeight>a.scrollHeight?window.innerHeight:a.scrollHeight}return b}function GetLocation(){var a=location.href;a=a.substring(7,a.length);var b=a.split("/");return b}function IsNoInput(a){var b=true;if(a==null||a=="")rule=".needInput";else rule="input[id^="+a+"]";$(rule).each(function(){if($(this).val()!=""){b=false;return false}});return b}function IsNeedInput(b){var c=false,a;if(b==null||b=="")a=".needInput";else a="input[id^="+b+"]";$(a).each(function(){if($(this).val()==""){c=true;return false}});return c}