function loginverify(a){if(a.email.value==""){alert(lang_login_username);a.email.focus();return false}if(a.password.value==""){alert(lang_login_password);a.password.focus();return false}return true}function getPassword(a){if(a.email.value==""){alert(lang_login_getpassword);a.email.focus();return false}a.ACTION.value="PASSWORD";a.submit();a.ACTION.value="LOGIN"}function tabclick(a){if(a=='tabPics')setTimeout("pdf()",5);if(document.getElementById('tabPics')){document.getElementById('tabPics').style.backgroundPosition='0% -42px';document.getElementById('tabPics'+'Inner').style.backgroundPosition='100% -42px';document.getElementById('tabPics'+'Panel').style.display='none'}if(document.getElementById('tabAll')){document.getElementById('tabAll').style.backgroundPosition='0% -42px';document.getElementById('tabAll'+'Inner').style.backgroundPosition='100% -42px';document.getElementById('tabAll'+'Panel').style.display='none'}if(document.getElementById('tabFriends')){document.getElementById('tabFriends').style.backgroundPosition='0% -42px';document.getElementById('tabFriends'+'Inner').style.backgroundPosition='100% -42px';document.getElementById('tabFriends'+'Panel').style.display='none'}if(document.getElementById('tabLogin')){document.getElementById('tabLogin').style.backgroundPosition='0% -42px';document.getElementById('tabLogin'+'Inner').style.backgroundPosition='100% -42px';document.getElementById('tabLogin'+'Panel').style.display='none'}document.getElementById(a).style.backgroundPosition='0% 0px';document.getElementById(a+'Inner').style.backgroundPosition='100% 0px';document.getElementById(a+'Panel').style.display=''}function rq(a){var b=document.getElementsByTagName("head")[0];var c=document.createElement("script");c.src=a;c.onerror=function(){b.removeChild(this)};c.onreadystatechange=function(){if(this.readyState!=null&&this.readyState!="complete"&&this.readyState!="loaded"){return}b.removeChild(this)};c.onload=c.onreadystatechange;b.appendChild(c)}GMarker.prototype.obj_id="";GMarker.prototype.win_style="";function gd(h){GDownloadUrl(h,function(a,b){var c;var d;var f;var g;if(b==200){c=a;try{eval(c)}catch(e){alert("Data error: "+e.description)}d=c.substr(0,c.indexOf("="));d=d.replace('var j','');f="fa(\""+d+"\",j"+d+")"}else{d=h;g=d.lastIndexOf("/");d=d.substr(g+1,d.length-g-5);f="fa(\""+d+"\",{})"}try{eval(f)}catch(e){alert("error: "+e.description)}})}var application;var dituMapType;var ma;var cl=0;var lk=0;var ce=new Array();var le=new Array();var ls=new Queue();var pls=new Queue();var pcls=new Queue();var fl=new Array();le[2]=0;le[5]=1;le[8]=2;le[11]=3;le[14]=4;function ri(a,b,c){a=a*1000;b=b*1000;a=Math.round(a);b=Math.round(b);if(a<-90*1000)a=a+180*1000;if(b<-180*1000)b=b+360*1000;a=a+90*1000;b=b+180*1000;var d=("000000"+a).substr(("000000"+a).length-6,6);var e=("000000"+b).substr(("000000"+b).length-6,6);var f=le[c]+1;var g=f+""+d+""+e;return g}function rf(a,b,c){var d=ri(a,b,c);var e=d.substr(2,2);var f=d.substr(4,2);var g=d.substr(8,2);var h=d.substr(10,2);e="data/"+e;f=e+"/"+f;g=f+"/"+g;h=g+"/"+h;var i=h+"/"+d+".jdt";return i}function fd(a){if(ce[a]!=undefined){return ce[a]}return false}function pp(a,b,c,d,e){var f;var g;var h;var k;k=a.getZoom();if(k>=14){h=16-14}else if(k>=11){h=16-11}else if(k>=8){h=16-8}else if(k>=5){h=16-5}else if(k>=2){h=16-2}else h=16-2;ls=new Queue();base=0.006*Math.pow(2,h);f=Math.floor(b/base)*base;g=Math.floor(c/base)*base;var x=d-f;x=x<0?(360+x):x;var y=e-g;y=y<0?(180+y):y;var l=Math.ceil(x/base);var m=Math.ceil(y/base);l=l>6?6:l;m=m>6?6:m;var n=g;var o=0;for(var i=0;i<l;i++){g=n;for(var j=0;j<m;j++){var p;var q=ri(g,f,h);var r=rf(g,f,h);if(!(p=fd(q))){lk++;gd(r)}else{sm(q,p,false)}g=g+base;if(g>90)g=g-180;o++}f=f+base;if(f>180)f=f-360}cl=h}var baseIcon=new GIcon();baseIcon.shadow="images/map/manshadow.png";baseIcon.iconSize=new GSize(32,32);baseIcon.shadowSize=new GSize(59,32);baseIcon.iconAnchor=new GPoint(16,34);baseIcon.infoWindowAnchor=new GPoint(16,2);baseIcon.infoShadowAnchor=new GPoint(30,25);function or(a,b){setTimeout("df()",100)}var picon=new GIcon();picon.image="http://www.panoramio.com/img/panoramio-marker.png";picon.shadow="http://www.panoramio.com/img/panoramio-shadow.png";picon.iconSize=new GSize(18,18);picon.shadowSize=new GSize(22,22);picon.iconAnchor=new GPoint(9,9);picon.infoWindowAnchor=new GPoint(9,0);var pmars=Array();function openmarker(a){if(pmars[a]!=undefined){if(pmars[a]!=null){var p=pmars[a];ma.openInfoWindowHtml(new GLatLng(p.latitude,p.longitude),"<div id='infowin' style='height:"+(p.height+80)+"px width:"+(p.width+80)+"px'>"+"<p><a href='http://www.panoramio.com/' target='_blank'><img src='http://www.panoramio.com/img/logo-small.gif' width='119px' height='25px' alt='Panoramio logo' /><\/a></p>"+"<img width='"+p.width+"' height='"+p.height+"' src='"+p.photo_file_url+"'/>"+"<div style='overflow: hidden; width: 240px;'>"+"<p><a target='_blank' class='photo_title' href='"+p.photo_url+"'><strong>"+p.photo_title+"<\/strong><\/a></p>"+"<p>Posted by <a target='_blank' href='"+p.owner_url+"'>"+p.owner_name+"<\/a></p><\/div>"+"<\/div>")}}}function store(a){var b=a.photos;var c=document.getElementById('tabPicsPanel');c.innerHTML='';pmars=Array();for(var i=0;i<b.length;i++){var d=new GMarker(new GLatLng(b[i].latitude,b[i].longitude),{draggable:true,icon:picon});d.photo=b[i];if(i<12){pmars[b[i]['photo_id']]=b[i];c.innerHTML+='<img src="'+b[i].photo_file_url.replace('medium','thumbnail')+'" onclick="javascript:openmarker(\''+b[i]['photo_id']+'\')" width="120" height="85" style="margin:4px;cursor: pointer;">'}d.obj_id='pi'+b[i]['photo_id'];GEvent.addListener(d,"click",function(){var p=this.photo;this.openInfoWindowHtml("<div id='infowin' style='height:"+(p.height+80)+"px width:"+(p.width+80)+"px'>"+"<p><a href='http://www.panoramio.com/' target='_blank'><img src='http://www.panoramio.com/img/logo-small.gif' width='119px' height='25px' alt='Panoramio logo' /><\/a></p>"+"<img width='"+p.width+"' height='"+p.height+"' src='"+p.photo_file_url+"'/>"+"<div style='overflow: hidden; width: 240px;'>"+"<p><a target='_blank' class='photo_title' href='"+p.photo_url+"'><strong>"+p.photo_title+"<\/strong><\/a></p>"+"<p>Posted by <a target='_blank' href='"+p.owner_url+"'>"+p.owner_name+"<\/a></p><\/div>"+"<\/div>")});if(undefined==fl[d.obj_id]){pls.push(d)}}c.innerHTML+='<br>'+lang_marker_image_copyright}function df(){if(lk)return;var a=ma.getBounds();var b=a.getSouthWest();var c=a.getNorthEast();pp(ma,b.lng(),b.lat(),c.lng(),c.lat())}function pdf(){var a=ma.getBounds();var b=a.getSouthWest();var c=a.getNorthEast();var d='http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=20&minx='+b.lng()+'&miny='+b.lat()+'&maxx='+c.lng()+'&maxy='+c.lat()+'&size=medium&callback=store';rq(d)}function fa(a,b){lk--;sm(a,b,true)}function sm(a,b,c){if(c){ce[a]=b}for(var a in b){if(undefined!=fl[b[a]['i']])continue;if(b[a]['g']==0){var d=new GIcon(baseIcon);if(b[a]['c']=='Park'||b[a]['c']=='公园')d.image="images/map/park.png";else d.image="images/map/purple-dot.png";var e=new GMarker(new GLatLng(b[a]['y'],b[a]['x']),{draggable:true,icon:d});e.obj_id=b[a]['i'];GEvent.addListener(e,'click',function(){this.openExtInfoWindow(ma,"simple_window","<div>Loading...</div>",{ajaxUrl:"placeinfo.php?id="+this.obj_id,beakOffset:3})});if(undefined==fl[b[a]['i']]){ls.push(e)}continue}var d=new GIcon(baseIcon);var f="custom_info_window_blue";if(b[a]['g']==2){d.image="images/map/woman.png";f="custom_info_window_red"}else{d.image="images/map/man.png";f="custom_info_window_blue"}if(b[a]['p']!=0&&b[a]['p']!='')d.image="photos/"+b[a]['p'];var e=new GMarker(new GLatLng(b[a]['y'],b[a]['x']),{draggable:true,icon:d});e.obj_id=b[a]['i'];e.win_style=f;GEvent.addListener(e,'click',function(){this.openExtInfoWindow(ma,this.win_style,"<div>Loading...</div>",{ajaxUrl:"infowin.php?id="+this.obj_id,beakOffset:3})});if(undefined==fl[b[a]['i']]){ls.push(e)}}}function setMapCenter(a,b,c){ma.setCenter(new GLatLng(a,b),c)}var copyright=new GCopyright(1,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),0,"Map data: ©2007 Mapabc.com");var copyrightCollection=new GCopyrightCollection("©2007 Google - ");copyrightCollection.addCopyright(copyright);var dituTileLayer=new GTileLayer(copyrightCollection,1,17);dituTileLayer.getTileUrl=function(a,b){return"http://servicetile.mapabc.com/googlechina/maptile?v=cn1&hl=zh-CN&s=G&x="+a.x+"&y="+a.y+"&zoom="+(17-b)};dituMapType=new GMapType([dituTileLayer],new GMercatorProjection(23),"地图",{shortName:"ditu",alt:"Show maps from Google China"});function showmarker(){if(!ls.empty()){var a=ls.pop();if(undefined==fl[a.obj_id]){fl[a.obj_id]=1;ma.addOverlay(a)}}if(!pls.empty()){var a=pls.pop();if(undefined==fl[a.obj_id]){fl[a.obj_id]=1;ma.addOverlay(a);pcls.push(a);if(pcls.size()>20){var a=pcls.pop();if(undefined!=fl[a.obj_id])fl[a.obj_id]=undefined;ma.removeOverlay(a);a=null}}}}function MyApplication(){this.map=new GMap2(document.getElementById("map_canvas"));ma=this.map;this.map.enableScrollWheelZoom();if(init_map=='cn')this.map.setCenter(new GLatLng(init_lat,init_lng),init_zoom,dituMapType);else this.map.setCenter(new GLatLng(init_lat,init_lng),init_zoom,G_NORMAL_MAP);this.map.addControl(new GMapTypeControl());this.map.addControl(new GLargeMapControl());this.map.addMapType(dituMapType);setInterval("showmarker()",5);GEvent.bind(this.map,"zoomend",this,function(a,b){or(this.map,"zoomend");if(document.getElementById('tabPics'+'Panel').style.display!='none')pdf()});GEvent.bind(this.map,"moveend",this,function(){or(this.map,"moveend")});GEvent.bind(this.map,"dragend",this,function(){or(this.map,"dragend");if(document.getElementById('tabPics'+'Panel').style.display!='none')pdf()});or(this.map,"load")}