var _myLat=''; var _myLon=''; var _dm='http://www.gopetslive.com'; var _LD='en'; var _idm='/files/userphoto'; var _ino=parseInt(''); var _dmp=_dm+'/php'; var _dmi='http://img.gopetslive.com/maptiles'; var _spr='
Indicator Loading...
'; var _tmode=''; var _tstr=''; var _tMarker = ''; var _Pt=new Array(); var _Po=new Object(); var _Ms=new Array(); var _timeout=''; var _moveend_mode = ''; var _mMapError = ''; var _worldMapNo = '' ; var MapMenuSrc_shop_on='http://img.gopetslive.com/maptiles/icons/icon_shop.gif'; var MapMenuSrc_shop_off='http://img.gopetslive.com/maptiles/icons/icon_shop_off.gif'; var MapMenuSrc_sale_on='http://img.gopetslive.com/maptiles/icons/icon_sale.gif'; var MapMenuSrc_sale_off='http://img.gopetslive.com/maptiles/icons/icon_sale_off.gif'; var MapMenuSrc_owner_on='http://img.gopetslive.com/maptiles/icons/icon_owner.gif'; var MapMenuSrc_owner_off='http://img.gopetslive.com/maptiles/icons/icon_owner_off.gif'; var MapMenuSrc_myland_on='http://img.gopetslive.com/maptiles/icons/icon_myland.gif'; var MapMenuSrc_myland_off='http://img.gopetslive.com/maptiles/icons/icon_myland_off.gif'; function _fop(){Element.show('processingbox');} function _fcp(){Element.hide('processingbox');} if (GBrowserIsCompatible()){ var sLon=getCookie('glng')?getCookie('glng'):_myLon?_myLon:'-132.8851318359375'; var sLat=getCookie('glat')?getCookie('glat'):_myLat?_myLat:'79.58242108045'; var sZoom=getCookie('gzoom')?parseInt(getCookie('gzoom')):8;//8 var map; map=new GMap2($('map')); map.setCenter(new GLatLng(sLat,sLon),sZoom); var tlayers=[new GTileLayer(new GCopyrightCollection('GoPets Ltd.'),2,11)]; tlayers[0].getTileUrl=function(a,b){var tURL=_dmi+'/index.php?x='+(a.x)+'&y='+(a.y)+'&zoom='+b;return tURL;}; tlayers[0].getCopyright=function(a,b){return{prefix:'ⓒ ',copyrightTexts:['2006. GoPets Ltd. ']};}; var cmap=new GMapType(tlayers,G_SATELLITE_MAP.getProjection(),'GoPets',{maxResolution:11,minResolution:2,errorMessage:_mMapError}); map.addMapType(cmap); map.addControl(new GSmallMapControl()); map.addControl(new GOverviewMapControl()); map.setCenter(new GLatLng(sLat,sLon),sZoom,cmap); GEvent.addListener(map,'move',function(){setCookie('glng',map.getCenter().x,'','/');setCookie('glat',map.getCenter().y,'','/');setCookie('gzoom',map.getZoom(),'','/');if( map.getZoom() > 5 ){ $('MapMenu_owner').style.display='';}else{ $('MapMenu_owner').style.display='none'; }}); GEvent.addListener(map,'moveend',function(){setCookie('glng',map.getCenter().x,'','/');setCookie('glat',map.getCenter().y,'','/');setCookie('gzoom',map.getZoom(),'','/');if(_moveend_mode=='owner'){_fIo(_moveend_mode);}}); function _fgI(iconn){var icon=new GIcon();icon.image=_dmi+'/icons/icon_'+iconn+'.gif';icon.iconSize=new GSize(20,20);icon.iconAnchor=new GPoint(10,10);icon.infoWindowAnchor=new GPoint(10,10);return icon;} function _fcM(point,memo,iconn,iconv,uno,uid,pno,lvl){ var marker=new GMarker(point,_fgI(iconn)); if (iconn=='sale'){GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('
'+_fb1(iconv)+'
');});} if (iconn=='owner'){GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('
'+_fui(iconn,iconv,uno,uid,pno,lvl)+'
');});} if (iconn=='shop'){GEvent.addListener(marker,'mouseover',function(){marker.openInfoWindowHtml('
'+memo+'
');});} if (iconn=='usershop'){GEvent.addListener(marker,'mouseover',function(){marker.openInfoWindowHtml('
'+memo+'
');});} if (iconn=='myland'){GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('
'+_fui(iconn,iconv,uno,uid,pno,lvl)+'
');});} if (iconn=='friendland'){GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('
'+_fui(iconn,iconv,uno,uid,pno,lvl)+'
');});} return marker; } function _fIShop(){ _fI('shop'); _fI('usershop'); } function _fI(mode,oinfo){ var zoom = map.getZoom() ; if(zoom <= 5){ $('MapMenu_owner').style.display='none'; return false;}else{ $('MapMenu_owner').style.display='';} if(_tmode.indexOf(mode)==-1){ _tmode+=','+mode+','; _fIo(mode); _fMMchg(mode, 'off'); }else{ _tmode=_tmode.replace(','+mode+',',''); if(!oinfo)map.closeInfoWindow(); _fIc(mode); _fMMchg(mode, 'on'); _moveend_mode = ''; } } function _fMMchg(mode, onoff){ if($('MapMenu_'+mode)){ var tmpsrc=eval('MapMenuSrc_'+mode+'_'+onoff); $('MapMenu_'+mode).src=tmpsrc; } } function _fIc(mode){for(var i in _Pt){if(i==mode){for(var j in _Pt[i]){map.removeOverlay(_Pt[i][j]);}i='';j='';return false;}}} function _fIo(mode){ _moveend_mode = mode; if(map.getZoom() <= 5) return false; _fop(); var param = ''; if(mode=='friendland'){if(!$('fid').value){_fcp();return false;}var param='&uID='+$('fid').value;} if(mode == 'owner') { var BoundaryLocation = map.getBounds(); var BoundarySW = BoundaryLocation.getSouthWest(); var BoundaryNE = BoundaryLocation.getNorthEast(); var BoudarySWLatitude = BoundarySW.lat() ;//위도 Latitude var BoundarySWLongitude = BoundarySW.lng() ;//경도 longitude //북동쪽 var BoundaryNELatitude = BoundaryNE.lat(); var BoundaryNELongitude = BoundaryNE.lng(); /*alert('BoudarySWLatitude:'+BoudarySWLatitude); alert('BoundarySWLongitude:'+BoundarySWLongitude); alert('BoundaryNELongitude:'+BoundaryNELongitude); alert('BoundaryNELatitude:'+BoundaryNELatitude); */ } GDownloadUrl(_dmp+'/world/mapdata.php?mode='+mode+param+'&SWLat='+BoudarySWLatitude+'&SWLon='+BoundarySWLongitude+'&NELat='+BoundaryNELatitude+'&NELon='+BoundaryNELongitude,function(data,responseCode){ var xml=GXml.parse(data); var markers=xml.documentElement.getElementsByTagName('marker'); _fIc(mode) ; _Pt[mode]=new Array(); for (var i=0; i < markers.length; i++){ var tlat=parseFloat(markers[i].getAttribute('lat')); var tlng=parseFloat(markers[i].getAttribute('lng')); var ticonn=markers[i].getAttribute('iconn'); var ticonv=markers[i].getAttribute('iconv'); var tmemo=markers[i].getAttribute('memo'); var tuno=markers[i].getAttribute('uno'); var tuid=markers[i].getAttribute('uid'); var tpno=markers[i].getAttribute('pno'); var tlvl=markers[i].getAttribute('lvl'); //if ( mode=='shop' ) _Ms[ticonv]={'lat':tlat,'lng':tlng,'memo':tmemo}; if ( !isNaN(tlat) && !isNaN(tlng) ){ var tpoint=new GLatLng(tlat,tlng); Maker=_fcM(tpoint,tmemo,ticonn,ticonv,tuno,tuid,tpno,tlvl); map.addOverlay(Maker); _Pt[mode][i]=Maker; } } _fcp(); }); } function _fgS(){ _fop(); GDownloadUrl(_dmp+'/world/mapdata.php?mode=shop',function(data,responseCode){ var xml=GXml.parse(data); var markers=xml.documentElement.getElementsByTagName('marker'); for (var i=0; i < markers.length; i++){ var tlat=parseFloat(markers[i].getAttribute('lat')); var tlng=parseFloat(markers[i].getAttribute('lng')); var ticonn=markers[i].getAttribute('iconn'); var ticonv=markers[i].getAttribute('iconv'); var tmemo=markers[i].getAttribute('memo'); var tuno=markers[i].getAttribute('uno'); var tuid=markers[i].getAttribute('uid'); var tpno=markers[i].getAttribute('pno'); var tlvl=markers[i].getAttribute('lvl'); _Ms[ticonv]={'lat':tlat,'lng':tlng,'memo':tmemo}; } }); } //_fgS();shop 주석 처리 function _fsp(){setCookie('glng',_fgP().x,'','/');setCookie('glat',_fgP().y,'','/');setCookie('gzoom',map.getZoom(),'','/');} function _fvP(shopNo){ if ( _tMarker ) { map.removeOverlay(_tMarker); map.closeInfoWindow(); } if(_Ms[shopNo]){ var tp=new GLatLng(_Ms[shopNo].lat,_Ms[shopNo].lng,map.getZoom()); var marker=new GMarker(tp,_fgI('shop')); map.addOverlay(marker); GEvent.addListener(marker,'click',function(){marker.openInfoWindowHtml('
'+_Ms[shopNo].memo+'
');}); marker.openInfoWindowHtml('
'+_Ms[shopNo].memo+'
'); _fP(_Ms[shopNo].lat,_Ms[shopNo].lng); _tMarker = marker; } } function _fP(tLat,tLon){map.setCenter(new GLatLng(tLat,tLon));} function _fgP(){map.getCenter();} function _fdOL(Iid){$(Iid).innerHTML=_spr;alert('tt');} function _fb1(tno){return '
[This land is currently for sale]
';} function _fb2(tno){$('saleinfowindow'+tno).innerHTML='
[Buy Land ]

If you click on the the buy buttom in the lower column,
you will become the owner of the land.
';} function _fb3(tno){ if ( tno ){ new Ajax.Request( _dmp+'/world/map.php', { onLoading:_fdOL('saleinfowindow'+tno), onComplete: function (originalRequest){ var tms=''; var orgR=originalRequest.responseText.split(','); tms=_fb4(orgR[0], orgR[2]); _fI('sale',1); _fI('myland',1); setTimeout( "_fI('sale',1)",100); setTimeout( "_fI('myland',1)",100); $('saleinfowindow'+orgR[1]).innerHTML='
[Buy Land ]

'+tms+'
'; }, method:'get', parameters:'mode=buyTile&tno='+tno+'' } ); } }; function _fb4(orgR, ts){ if(orgR=='[0]') tms='Congratulations! You have become a GoPets land owner!!

Take advantage of the benefits as more are expected to be added we hope to see you here often.'; if(orgR=='[1]') tms='You were unable to purchase the land. Please try again.'; if(orgR=='[2]') tms='This land has already been sold.'; if(orgR=='[3]') tms='This land is not for sale. '; if(orgR=='[4]') tms='You\'ve been logged out. Please login again.'; if(orgR=='[5]') tms='You don\'t have enough Shells'; if(orgR=='[6]') tms='Sorry! You almost close to buy. But other user a little bit faster than you.
Please, try next chance.
Now, next chance remain time what can buy land.
{remaintime}.'; if(orgR=='[6]'){ var remainT=_fb5(ts); tms = _fb6(tms,remainT); _timeout = setTimeout('_fdTime('+remainT+',\'remaintime\')', 1000); tms += '
※ Possible to happen that time delay a little depends on the International network status.'; } return tms; } function _fb6(str,remainT){ return str.replace('{remaintime}', ''+sec2hms(remainT,3)+''); } function _fb5(ts){ if ( ts ) { var localTime = new Date(); var localZone = localTime.getTimezoneOffset() + ''; localZone *= 60; var stime = localTime.getTime() + ''; stime = stime.substr(0, stime.length-3); remainT = 2*60*60 + parseInt(ts) - parseInt(stime) - 540*60 - parseInt(localZone); } else { remainT = 2*60*60; } return remainT; } function _fui(iconn,iconv,uNo,uID,pNo,lvl){ var out='
You are welcome to visit '+uID+' land.
'; out+='
See Profile
'; if(_ino!=uNo)out+=''; out+='
Send message
'; if ( lvl >= 14 ) out+='
Go to shop
'; //if (uNo==_ino) out+='
Sell land
'; out+='
'; return out; } function _fui2(Iid,uNo){ if ( uNo ){ _tstr=Iid; new Ajax.Updater( _tstr, _dmp+'/world/map.php', { onLoading:_fdOL(_tstr), onComplete: function (){ _fcp(); }, method:'get', parameters:'mode=requestLDtop&uNo='+uNo+'&vNo='+_ino } ); } }; function _fs1(Iid,tno){$(Iid).innerHTML='
[Sell land]
If you sell the land,you will lose the ownership and the benefits.

And you will be given 50back.
Are you sure you wish to sell?
';} function _fs2(Iid,tno){ if(tno){ _tstr=Iid; new Ajax.Request( _dmp+'/world/map.php', { onLoading:_fdOL(_tstr), onComplete: function (originalRequest){ var tms=''; var orgR=originalRequest.responseText.split(',');; if(orgR[0]=='[0]') tms='The sale of the land has been successfully completed.
50
Another land is currently for sale so take a look at it. '; if(orgR[0]=='[1]') tms='You were unable to sell the land. '; if(orgR[0]=='[2]') tms='You are not the owner of this land. '; if(orgR[0]=='[3]') tms='This land is not for sale. '; if(orgR[0]=='[4]') tms='Seller information is incorrect.!'; if(orgR[0]=='[5]') tms='You don\'t have enough Shells'; _fI('myland',1); setTimeout( "_fI('myland',1)",100); $(_tstr).innerHTML='
[Sell land]
'+tms+'

'; _tstr=''; tms=''; }, method:'get', parameters:'mode=sellTile&tno='+tno+'' } ); } }; _fcp(); _fI('myland'); }else{$('map').innerHTML='Sorry, the Google Maps API is not compatible with this browser';_fcp();} /*위도 경도에 값 가지고 세팅 하기*/ function getBoundaryLocationInfo(mode){ var BoundaryLocation = map.getBounds(); var BoundarySW = BoundaryLocation.getSouthWest(); var BoundaryNE = BoundaryLocation.getNorthEast(); var zoom = map.getZoom() ; alert('zoom:'+zoom); getIcons(BoundarySW, BoundaryNE); } function getIcons(BoundarySW, BoundaryNE){ //남서쪽 var BoudarySWLatitude = BoundarySW.lat() - 5;//위도 Latitude var BoundarySWLongitude = BoundarySW.lng() - 5;//경도 longitude //북동쪽 var BoundaryNELatitude = BoundaryNE.lat() - 5; var BoundaryNELongitude = BoundaryNE.lng() - 5; var mode = 'owner'; _fI('owner',1); var param = ''; GDownloadUrl(_dmp+'/world/mapdata.php?mode='+mode+param+'&SWLat='+BoudarySWLatitude+'&SWLon='+BoundarySWLongitude+'&NELat='+BoundaryNELatitude+'&NELon='+BoundaryNELongitude,function(data,responseCode){ var xml=GXml.parse(data); var markers=xml.documentElement.getElementsByTagName('marker'); _Pt[mode]=new Array(); for (var i=0; i < markers.length; i++){ var tlat=parseFloat(markers[i].getAttribute('lat')); var tlng=parseFloat(markers[i].getAttribute('lng')); var ticonn=markers[i].getAttribute('iconn'); var ticonv=markers[i].getAttribute('iconv'); var tmemo=markers[i].getAttribute('memo'); var tuno=markers[i].getAttribute('uno'); var tuid=markers[i].getAttribute('uid'); var tpno=markers[i].getAttribute('pno'); var tlvl=markers[i].getAttribute('lvl'); //if ( mode=='shop' ) _Ms[ticonv]={'lat':tlat,'lng':tlng,'memo':tmemo}; if ( !isNaN(tlat) && !isNaN(tlng) ){ var tpoint=new GLatLng(tlat,tlng); Maker=_fcM(tpoint,tmemo,ticonn,ticonv,tuno,tuid,tpno,tlvl); map.addOverlay(Maker); _Pt[mode][i]=Maker; } } _fcp(); }); } var screen_Y; var Step_one_content = '[Land Lottery]

* What is the Land Lottery?
It\'s a chance for you to win a piece of land at a reduced price!

Lottery open to enter: every Saturday through Thursday
Winners announced: every Friday (KST)
         (180 users per week)
Entry fee : 50 Gold

You have one chance to enter per Lottery; winners are chosen at random.

* The entry fee of 50 Gold is to be paid at the time you enter. You will be refunded your 50 Gold if you are not chosen.

[ Enter Land Lottery ] [ Details of Your Land Lottery Entry ]'; function close_lot(){ document.getElementById("lottery_box").style.display="none"; } function Lottery_one_step(evt){ document.getElementById("ajax_content").innerHTML = Step_one_content; document.getElementById("ajax_content_div").style.display = "none"; doPlay(evt); } function doPlay(evt, Y_px){ if(!window.event){ document.getElementById('lottery_box').style.marginLeft = (evt.pageX - 300)+"px"; document.getElementById('lottery_box').style.marginTop = (evt.pageY - 285)+"px"; screen_Y = evt.pageY - 305; }else{ document.getElementById('lottery_box').style.marginLeft = document.body.parentElement ? (event.clientX + document.body.scrollLeft+document.body.parentElement.scrollLeft - 300)+'px' : event.clientX + document.body.scrollLeft+'px'; document.getElementById('lottery_box').style.marginTop = document.body.parentElement ? (event.clientY + document.body.scrollTop+document.body.parentElement.scrollTop - 285)+'px' : event.clientY + document.body.scrollTop+'px'; screen_Y = event.clientY + document.body.scrollTop+document.body.parentElement.scrollTop -305; } if(Y_px) document.getElementById('lottery_box').style.marginTop = (screen_Y + Y_px)+"px"; document.getElementById('lottery_box').style.display=""; } function lottery_enter(){ new Ajax.Request( "http://www.gopetslive.com/php/world/map.php", { method:"post", onComplete:lottery_enter_response, parameters: "mode=lotteryEnter", evalScripts:false, asynchronous:true } ); } function lottery_enter_response(originalRequest){ //put returned XML in the textarea var result = originalRequest.responseText; switch(result){ case "success": document.getElementById('lottery_box').style.marginTop = (screen_Y + 150)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

Lottery entering has been successfully done.

* You will get 50 Gold shells refunded the day we announce winners if your entry was not chosen.

[ Details of Your Land Lottery Entry ]'; document.getElementById("ajax_content_div").style.display = "none"; break; case "duplication": document.getElementById('lottery_box').style.marginTop = (screen_Y + 210)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

You have already entered the Land Lottery this week.'; document.getElementById("ajax_content_div").style.display = "none"; break; case "login_error": document.getElementById('lottery_box').style.marginTop = (screen_Y + 210)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

Please Login.'; document.getElementById("ajax_content_div").style.display = "none"; break; case "lowGold": document.getElementById('lottery_box').style.marginTop = (screen_Y + 210)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

You don\'t have enough money'; document.getElementById("ajax_content_div").style.display = "none"; break; default: break } } function lottery_list(){ new Ajax.Request( "http://www.gopetslive.com/php/world/map.php", { method:"post", onComplete:lottery_list_response, parameters: "mode=lotteryList", evalScripts:false, asynchronous:true } ); } function lottery_list_response(originalRequest){ //put returned XML in the textarea var result = originalRequest.responseText; lottery_list_content = result.split(":::"); if(lottery_list_content[0] == "login_error") { document.getElementById('lottery_box').style.marginTop = (screen_Y + 210)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

Please Login.'; document.getElementById("ajax_content_div").style.display = "none"; return false; } document.getElementById('lottery_box').style.marginTop = (screen_Y + 140)+"px"; document.getElementById("ajax_content").innerHTML = lottery_list_content[0] + lottery_list_content[1] + ''; document.getElementById("ajax_content_div").style.display = "none"; } function step_one_open(){ document.getElementById('lottery_box').style.marginTop = (screen_Y)+"px"; document.getElementById("ajax_content").innerHTML = Step_one_content; document.getElementById("ajax_content_div").style.display = "none"; } function Lottery_result(event){ doPlay(event, 60); Lottery_result_rcv(); } function Lottery_result_rcv(){ new Ajax.Request( "http://www.gopetslive.com/php/world/map.php", { method:"post", onComplete:lottery_result_response, parameters: "mode=lotteryResult", evalScripts:false, asynchronous:true } ); } function lottery_result_response(originalRequest){ //put returned XML in the textarea var result = originalRequest.responseText; document.getElementById('lottery_box').style.marginTop = (screen_Y + 165)+"px"; announcement_output = result.split(":::"); if(announcement_output[0] == "login_error") { document.getElementById('lottery_box').style.marginTop = (screen_Y + 210)+"px"; document.getElementById("ajax_content").innerHTML = '[Land Lottery]

Please Login.'; document.getElementById("ajax_content_div").style.display = "none"; return false; } document.getElementById("ajax_content").innerHTML = announcement_output[0]; document.getElementById("ajax_content_div").innerHTML = announcement_output[1]; } function _fsFL(evt) // searchFriendsLand { var tmpContents = '[Find my friend\'s land]
Friend\'s ID :
'; $("ajax_content").innerHTML = tmpContents; Element.hide("ajax_content_div"); _fcDP(evt, $("lottery_box"), -150, -80); Element.show("lottery_box"); $("fid").focus(); } function _fsFL2(mode) // searchFriendsLand { _tmode=_tmode.replace(","+mode+",",""); _fIc(mode); Element.hide("lottery_box"); setTimeout("_fI('"+mode+"')", 500); } function _fcDP(evt, oBox, x, y){ if(!window.event){ document.getElementById('lottery_box').style.marginLeft = (evt.pageX + x)+"px"; document.getElementById('lottery_box').style.marginTop = (evt.pageY + y)+"px"; }else{ document.getElementById('lottery_box').style.marginLeft = document.body.parentElement ? (event.clientX + document.body.scrollLeft+document.body.parentElement.scrollLeft + x)+'px' : event.clientX + document.body.scrollLeft+'px'; document.getElementById('lottery_box').style.marginTop = document.body.parentElement ? (event.clientY + document.body.scrollTop+document.body.parentElement.scrollTop + y)+'px' : event.clientY + document.body.scrollTop+'px'; } } function _fdTime(time,objID){ if ( $(objID) && !map.getInfoWindow().isHidden() ) { time--; if(time<0)time=2*60*60+time; setTimeout("_fdTime("+time+",'"+objID+"')", 1000); $(objID).innerHTML=sec2hms(time,3); } else { clearTimeout(_timeout); } } function _fdTime2(time,objID,deltatime,dmode){ if(!deltatime)deltatime=1; if(!dmode)dmode=3; if ( $(objID) ) { time-=deltatime; if(time<0)time=2*60*60+time; nextt=deltatime*1000; _timeout2=setTimeout("_fdTime2("+time+",'"+objID+"',"+deltatime+","+dmode+")", nextt); $(objID).innerHTML=sec2hms(time,dmode); } else { clearTimeout(_timeout2); } }