var home = "http://www.5bird.com"; var HOME_URL = "http://www.5bird.com"; var debug = false; function GetUrlParam( paramName ){ var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ; var oMatch = oRegex.exec( window.top.location.search ) ; if ( oMatch && oMatch.length > 1 ) return oMatch[1] ; else return '' ; } function overlayer(b,e,f){ if(b){$('#'+e).fadeIn();$('#dialog-mask').show();} else {$('#'+e).fadeOut();$('#dialog-mask').hide();} eval(f+"()"); } function foo(){} function loadLogin(){ st(true); if($('#overlayer_content').html().indexOf('cache_l_r') == -1) $('#overlayer_content').load(home+'/account/userlogin.php?url='+GetUrlParam( 'return_url' ),function(){st(false);}) else st(false); } function loadLoginINT(){ overlayer(true,'goverlayer','loadLogin'); } function valid(s){ var e=s.split('&');var i=0; while( i'+m+' ';}) } var aCookie = document.cookie.split("; "); function createCookie(name,value,hours) { if (hours) { var date = new Date(); date.setTime(date.getTime()+(hours*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(CookieEleName){ var cookieValue = ""; for (var i=0; i < aCookie.length; i++){ var CookieArray = aCookie[i].split("="); if (CookieEleName == CookieArray[0]){ cookieValue = unescape(decodeURI(CookieArray[1])); } } return cookieValue; } var is_scale = true; var BlogInfoCache = new Array(); function load(lat,lung,zoom,xmlUrl,BlogId,MapDivId){ if(GBrowserIsCompatible()) { map = new GMap2(document.getElementById(MapDivId)); map.setCenter(new GLatLng(lat, lung ), zoom); map.addControl(new GMapTypeControl()); map.addControl(new GLargeMapControl()); map.addControl(new GScaleControl()); map.enableScrollWheelZoom(); addMarkers(xmlUrl,BlogId); } } function cosBlogRoll(map,lat,lng,curMarkerHtml,order,BlogId,is_me,gender){ var point = new GLatLng(lat,lng); map.addOverlay(createMarker(point,curMarkerHtml,order,BlogId,is_me,gender)); } function createMarker(point,curMarkerHtml, number,BlogId,is_me,gender) { var icon = new GIcon(); icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; if( gender == 1 ) icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); var marker = new GMarker(point,icon); if(is_me) marker = new GMarker(point); GEvent.addListener(marker, "click", function() { var url = HOME_URL+'/do.php?action=showBlogInfo&id='+ BlogId; // cache if(( BlogInfoCache[ BlogId ] != null )&&( BlogInfoCache[ BlogId ].length>10 )){ marker.openInfoWindowHtml(BlogInfoCache[ BlogId ]); } else{ marker.openInfoWindowHtml("
Loading...
"); $.ajax({ url: url, type: 'GET', dataType: 'html', timeout: 10000, error: function(){ marker.openInfoWindowHtml("处理超时,请重试!"); }, success: function(html){ marker.openInfoWindowHtml(html); BlogInfoCache[ BlogId ] = html; } }); } }); return marker; } function Zoom(lat,lung,zoom){ map.setCenter(new GLatLng(lat, lung), zoom); } var markXMLcache = new Array(); function addMarkers(xmlUrl,BlogId){ var data; if( markXMLcache[xmlUrl] == null ){ GDownloadUrl(xmlUrl, function(d, responseCode) { markXMLcache[xmlUrl] = d; retriveMarker(d,BlogId); }); } else{ retriveMarker( markXMLcache[xmlUrl] ,BlogId) ;} } function retriveMarker(d,BlogId){ var xml = GXml.parse(d); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var thisBlogId = markers[i].getAttribute("blogid"); var gender = markers[i].getAttribute("gender"); if( thisBlogId == BlogId ) is_me = true; else is_me = false; cosBlogRoll( map,parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng")), '',i,thisBlogId,is_me,gender); } $("#ajax-status").hide(); } var screen_name = new Array(); var userlocation = new Array(); var msgtext = new Array(); var profile_image_url = new Array(); var total_msg_num = 0; if( readCookie('retry_time') > 0 ) var retry_time = readCookie('retry_time');else var retry_time=0; function TTLine(o){ if( readCookie('retry_time') > 60 ){ return false; } retry_time ++; createCookie('retry_time',retry_time,1); var url =null; if(o==null)url = "http://twitter.com/statuses/public_timeline.json?&callback=?"; var d= new Date().toLocaleString() + "("+retry_time+")"; $.getJSON(url, function(data){ $.each(data, function(i, item) { screen_name[i] = item.user['screen_name'] ; userlocation[i] = item.user['location']; if(userlocation[i]!=null) userlocation[i]=userlocation[i].replace('iphone:',''); msgtext[i] = replaceReg(null,item.text)+item.source; profile_image_url[i] = item.user['profile_image_url'] ; total_msg_num = i; } ) total_msg_num ++ ; return d ; }); return d ; } //get twitter info by name function getTTinfo(obj){ var name = obj.html(); st(true); var url = "http://twitter.com/users/show/"+name+".json?&callback=?"; $.getJSON(url, function(data){ var ustatus = replaceReg(null,data.status.text)+data.status.source; var ret = '' +data.screen_name; //ret += '

Following:' + data.friends_count+'

' ; ret += '

Followers:' + data.followers_count+'

'; ret += '

updates:' + data.statuses_count + '

'; ret += '

lastmessage:' + ustatus + '

'; obj.html( ret ); st(false); }); }