;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);var LazyLoader={};LazyLoader.timer={};LazyLoader.scripts=[];LazyLoader.load=function(a,b,c){var d=null,properties=null;try{LazyLoader.scripts.push(a);var f=document.createElement("script");f.src=a;f.type="text/javascript";b.get(0).appendChild(f);if(c){f.onreadystatechange=function(){if(f.readyState==='loaded'||f.readyState==='complete'){c();jQuery(f).remove()}};f.onload=function(){c();jQuery(f).remove();return};try{if(($.browser.webkit&&!navigator.userAgent.match(/Version\/3/))||$.browser.opera){LazyLoader.timer[a]=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(LazyLoader.timer[a]);c()}},10)}}catch(e){}}}catch(er){alert(er)}};var xrayAd={div:null,viewport:null,thresold:200,elements:[],adBlockCount:0,w:160,h:200,init:function(){this.div=$('#xrayAd');if(!this.div){this.div=$('<div>',{id:'xrayAd',css:{position:'fixed',top:10,left:10,width:this.w,height:this.h,zIndex:10000,background:'rgba(0,0,0, 0.5)'}});this.div.appendTo($('body'))}},viewportUpdate:function(){if(!this.viewport){this.viewport=$('<div>',{id:'xrayAdViewport',css:{position:'absolute',width:this.w,height:10,zIndex:10001,background:'rgba(255,255,255, 0.3)'}});this.viewport.appendTo(this.div)}if(!this.viewThresoldTop){this.viewThresoldTop=$('<div>',{id:'xrayAdThresold',css:{position:'absolute',width:this.w,height:1,zIndex:10002,background:'rgba(255,0,0, 0.5)'}});this.viewThresoldTop.appendTo(this.div);this.viewThresoldBottom=this.viewThresoldTop.clone().appendTo(this.div)}this.bodyHeight=$(document).height();this.bodyWidth=$(window).width();var g=($(window).height()/this.bodyHeight)*xrayAd.h,vT=($(window).scrollTop()/this.bodyHeight)*xrayAd.h;this.viewport.css({height:g,top:vT});this.viewThresoldTop.css({top:(($(window).scrollTop()-xrayAd.thresold)/this.bodyHeight)*xrayAd.h});this.viewThresoldBottom.css({top:(($(window).scrollTop()+xrayAd.thresold)/this.bodyHeight)*xrayAd.h+g-1});if(this.div&&this.div.length){var h=this.div.find('.xrayAdBlock');$.each(h,function(a,b){var c=$(this);var d=$(xrayAd.elements[a]);if(c.length&&d.length){var e={};e.off=d.offset();if(e.off){e.top=(e.off.top/xrayAd.bodyHeight)*xrayAd.h;e.left=(e.off.left/xrayAd.bodyWidth)*xrayAd.w;e.w=(Math.max(d.width(),10)/xrayAd.bodyWidth)*xrayAd.w;e.h=(Math.max(d.height(),10)/xrayAd.bodyHeight)*xrayAd.h;var f='#FF0071';f=(d.data('loading')==='true'?'orange':f);f=(d.data('loaded')==='true'?'#00FF00':f);c.css({top:e.top,left:e.left,width:e.w,height:e.h,borderColor:f})}}})}},load:function(b,c){this.thresold=c||0;this.init();var d=$('<div>',{'class':'xrayAdBlock','css':{position:'absolute',background:'#ffffff',border:'1px solid #FF0071',top:0,left:0,width:0,height:0,zIndex:10003}});$.each(b,function(){d.clone().attr('xrayblock','xrayAdBlock_'+(xrayAd.adBlockCount++)).appendTo(xrayAd.div);$(this).bind('onCompleteXray',function(){xrayAd.viewportUpdate()});$(this).bind('onLoadXray',function(){xrayAd.viewportUpdate()});xrayAd.elements.push(this)});xrayAd.viewportUpdate();$(window).bind("scroll",function(a){xrayAd.viewportUpdate()})}};(function($){$.lazyLoadAdRunning=false;$.lazyLoadAdTimers=[];$.fn.lazyLoadAd=function(h){var j={threshold:0,failurelimit:1,forceLoad:false,event:"scroll",viewport:window,placeholder:false,onLoad:false,onComplete:false,timeout:1500,debug:false,xray:false};if(h){$.extend(j,h)}function _debug(){if(typeof console!=='undefined'&&j.debug){var a=[];for(var i=0;i<arguments.length;i++){a.push(arguments[i])}try{console.log('LazyLoadAD |',a)}catch(e){}}}if(j.xray&&(typeof xrayAd==='object')){xrayAd.load(this,j.threshold)}var k=this;$(j.viewport).bind("checkLazyLoadAd",function(){var b=0;k.each(function(){if($.lazyLoadAdRunning){if($.lazyLoadAdTimers.runTimeOut){clearTimeout($.lazyLoadAdTimers.runTimeOut)}$.lazyLoadAdTimers.runTimeOut=setTimeout(function(){$(j.viewport).trigger("checkLazyLoadAd")},300);return false}else if(j.forceLoad===true){$(this).trigger("load")}else if(!$.belowthefold(this,j)&&!$.abovethetop(this,j)){$(this).trigger("load")}else{if(b++>j.failurelimit){return false}}});var c=$.grep(k,function(a){return!(($(a).data('loaded')==='true')?true:false)});k=$(c)});if("scroll"===j.event){$(j.viewport).bind("scroll",function(a){if(k.length===0){return false}$(j.viewport).trigger("checkLazyLoadAd")})}this.each(function(d,f){var g=$(this);if(undefined===g.attr("original")){g.attr("original",g.attr("src"))}g.isLoaded=function(){return((g.data('loaded')==='true')?true:false)};g.bind("debug",function(e,a){a=a||'start';if(j.xray){if(a==='start'){g.trigger('onLoadXray')}else if(a==='error'){g.trigger('onErrorXray')}else if(a==='complete'){g.trigger('onCompleteXray')}}if(j.debug){if(a==='start'){g.css({border:'3px solid orange'})}else if(a==='error'){g.css({border:'3px solid red'})}else if(a==='complete'){g.css({border:'3px solid green'})}}});g.one('onComplete',function(){_debug('---> lazyLoadComplete');$(g).removeAttr("original");$.lazyLoadAdRunning=false;g.data('loaded','true');g.trigger('debug','complete');if(typeof j.onComplete==='function'){try{j.onComplete()}catch(e){}}});g.stack=[];g.makinaBlock=false;g.bind('makina_go',function(){if(g.makinaBlock){return false}if(g.stack.length>0){var a=g.stack.shift();var b=g.find('.wrapAd');if(!b.length){b=$('<div class="wrapAd"></div>').clone();b.appendTo(g)}var c=$('<div>').clone().appendTo(b);if(typeof a==='string'){c.replaceWith(a)}else if(typeof a==='object'){if(a.is('script')){if(a.attr('src')){_debug('JS to load !! --> '+a.attr('src'));LazyLoader.load(a.attr('src'),g,function(){g.makinaBlock=false;_debug('JS to load !! ++> '+a.attr('src'));g.trigger('makina_go')})}else{c.replaceWith(a)}}else{c.replaceWith(a)}}g.trigger('makina_go')}else{if($.lazyLoadAdTimers.loadJS){clearTimeout($.lazyLoadAdTimers.loadJS)}$.lazyLoadAdTimers.loadJS=setTimeout(function(){g.trigger('onComplete')},j.timeout)}});g.bind('docWrite_direct',function(e,a){var b=$(a);_debug('Fragment Direct Write : ',b,b.length);$.each(b,function(){g.stack.push($(this))});g.trigger('makina_go')});g.bind('docWrite_delayed',function(e,a){_debug('Fragment Delayed Write : ',a);g.numWrappers--;_debug("Fragment append : ",g.numWrappers,a);g.docHtmlCurrent+=a;if(g.numWrappers===0){a=g.docHtmlCurrent;g.docHtmlCurrent='';setTimeout(function(){g.stack.push(a);g.docHtmlCurrent='';g.trigger('makina_go')},0)}});g.numWrappers=0;g.docHtmlCurrent='';g.bind('docWrite_overload',function(){document._writeOriginal=document.write;document.write=document.writeln=function(){var a=arguments,id=null;var b='';for(var i=0;i<a.length;i++){b+=a[i]}var c='',directWrite=false;try{c=$(b);directWrite=((c.is('div')||c.is('script'))?true:false)}catch(e){}g.history[g.fragmentId]=g.history[g.fragmentId]||{};if(g.history[g.fragmentId][b]===undefined){g.history[g.fragmentId][b]=true;if(directWrite){g.trigger('docWrite_direct',b)}else{g.numWrappers++;setTimeout(function(){g.trigger('docWrite_delayed',b)},0)}}}});g.bind('evalCode',function(){var a=[],script,regexp=/<code[^>]*>([\s\S]*?)<\/code>/gi;while((script=regexp.exec(g.html()))){var b=script[1];b=b.replace('<!--//<![CDATA[','').replace('//]]>-->','').replace('<!--','').replace('//-->','');b=b.replace(/\&gt\;/g,'>').replace(/\&lt\;/g,'<');a.push($.trim(b))}try{a=(a.length?a.join('\n'):'');_debug('Script to eval : ',a);if(a!==''){eval(a)}}catch(e){}});g.bind('loadJS',function(e,a){var b=null,script=null;if(a.src){b=a.callback||null;a=a.src}if(a.indexOf('?')===-1){a+='?_='+(new Date().getTime())}else{a+='&_='+(new Date().getTime())}_debug('loadJS :: ',a);LazyLoader.load(a,g,function(){_debug('loadJS COMPLETE :: '+a);if(b){b()}else{$.lazyLoadAdTimers.loadJS=setTimeout(function(){g.trigger('onComplete')},j.timeout)}})});g.one("load",function(){if(!g.isLoaded()){$.lazyLoadAdRunning=true;g.data('loading','true');g.trigger('debug','start');var a=$(g).attr("original");g.history={};_debug('------------------------------  Lazy Load Ad CALL ----');_debug('Context : ',g);g.trigger('docWrite_overload');g.trigger('evalCode');if(a){g.trigger('loadJS',a)}}});if("scroll"!==j.event){g.bind(j.event,function(a){if(!g.isLoaded()){g.trigger("load")}})}});$(j.viewport).trigger('checkLazyLoadAd');return this};$.belowthefold=function(a,b){var c=0;if(b.viewport===undefined||b.viewport===window){c=$(window).height()+$(window).scrollTop()}else{c=$(b.viewport).offset().top+$(b.viewport).height()}return c<=$(a).offset().top-b.threshold};$.abovethetop=function(a,b){var c=0;if(b.viewport===undefined||b.viewport===window){c=$(window).scrollTop()}else{c=$(b.viewport).offset().top}return c>=$(a).offset().top+b.threshold+$(a).height()}})(jQuery);Class=function(){var Class=function(){this.initialize.apply(this,arguments);};var extended={};var parent,initialize,Type;for(var i=0,len=arguments.length;i<len;++i){Type=arguments[i];if(typeof Type=="function"){if(i==0&&len>1){initialize=Type.prototype.initialize;Type.prototype.initialize=function(){};extended=new Type();if(initialize===undefined){delete Type.prototype.initialize;}else{Type.prototype.initialize=initialize;}}
parent=Type.prototype;}else{parent=Type;}
extendTo(extended,parent);}
Class.prototype=extended;return Class;};extendTo=function(destination,source){destination=destination||{};if(source){for(var property in source){var value=source[property];if(value!==undefined){destination[property]=value;}}
var sourceIsEvt=typeof window.Event=="function"&&source instanceof window.Event;if(!sourceIsEvt&&source.hasOwnProperty&&source.hasOwnProperty('toString')){destination.toString=source.toString;}}
return destination;};var map,editmode,options,sitelayer,geocoder;var mapx,mapy=0;var g_changecountry=0;$=jQuery.noConflict();$(document).ready(function(){initialize();});function initialize(){$("#superfish ul.sf-menu").superfish({dropShadows:false,speed:'fast'});$("#topmenu ul.sf-top-menu").superfish({dropShadows:false,speed:'fast'});$("#region").change(function(){changeRegion(g_activity,$(this).val());});$("#country").change(function(){changeCountry();});var sumbox=$("#summarybox");if(sumbox.length>0)sumbox.val('0'+g_timeperiod);$("#summary-load").hide();sumbox.change(function(){$("#summary-load").show();sitelayer.getSites($(this).val());});$("#find").focus(function(){if($(this).attr("value")=="Enter your location")$(this).attr("value","");});$("#find").blur(function(){if($(this).attr("value")=="")$(this).attr("value","Enter your location");});$("#findb").click(function(){if($("#find").attr("value")!="")search();});$("#map").mousemove(function(e){mapx=e.pageX;mapy=e.pageY;});$("#find").keypress(function(e){if(e.which==13){if($(this).attr("value")!="")search();}});$("#country").val(g_country);$("#region").val(g_region);if(g_map&&!charts){pageload();}
if($("#find").length>0){$("#find").autocomplete({source:function(req,add){$.ajax({data:({'r':"location",'t':'auto','a':g_activity,'country':g_country,'q':req.term}),success:function(data){var suggestions=data.split("\n");suggestions.pop();add(suggestions);}});},select:function(e,ui){var location=ui.item.value;var urlpath="/"+rewriteOutput(g_aname)+"/"+rewriteOutput(g_country)+"/"+rewriteOutput(location);window.location.href=urlpath;}});}
$(".hot-el").click(function(){var str=$(this).attr('rel');var el=$('.my-weather');el.append(makeHotLink(str));setCookie_MyWeather("myweather-"+str,str);$(".myweather-help").remove();});$(".el-rm").live("click",function(){var cookie=$(this).attr('rel');var el=$(this).parent().parent();el.remove();deleteCookie_MyWeather("myweather-"+cookie);return false;});$('a[href=#top]').click(function(){$('html, body').animate({scrollTop:0},'slow');return false;});getCookies_MyWeather();if(g_aname)setCookie('defaultactivity',g_aname,365);}
$.extend({scope:function(fn,scope){return function(){return fn.apply(scope,arguments);}}});$.fn.setJCookie=function(value){setCookie($(this[0]).attr("id"),value,365)}
$.ajaxSetup({url:"/ajr.php",type:"POST",dataType:'text json',data:({'country':g_country,'swellmap':g_swellmap}),error:function(xhr,desc,exception){}});$(window).unload(function(){if(g_activity)pageunload();});var errmsg={unfound:"Sorry a weather forecast for this location could not be found",search:"<p class='alert'>Your location has not been found. Please check the spelling or try a nearby place.</p>",fcast:"<br>Sorry, there is temporarily no forecast."}
var tooltips={myweathermain:"<h3>This is for saving your favourite weather locations</h3><h3>Click on a location's <span class='hot-el'></span> icon to add a location to this menu.</h3>"}
function pageload(){var centerPos=null;var zoom=null;var latlng=null;var countryChange=parseInt(getCookie('countrychange'));if((countryChange==1)||!(getCookie('map-pos-lon'))){zoom=g_zoom;latlng=g_latlng;}
else if(getCookie('map-pos-lon')){zoom=parseFloat(getCookie('map-zoom'));if(zoom<5){latlng=g_latlng;}
else{var cookieLon=parseFloat(getCookie('map-pos-lon'));var cookieLat=parseFloat(getCookie('map-pos-lat'));latlng=new google.maps.LatLng(cookieLat,cookieLon);}}
var mapOptions={zoom:zoom,center:latlng,mapTypeId:google.maps.MapTypeId.HYBRID,mapTypeControl:true,navigationControl:true,streetViewControl:false,navigationControlOptions:{style:google.maps.NavigationControlStyle.ZOOM_PAN}};map=new google.maps.Map(document.getElementById("map"),mapOptions);var latlngpt=document.createElement('DIV');latlngpt.id='latlngpt';latlngpt.style.top='8px';map.controls[google.maps.ControlPosition.RIGHT_TOP].push(latlngpt);google.maps.event.addListener(map,"mousemove",function(pt){document.getElementById("latlngpt").innerHTML=Math.round(pt.latLng.lng()*1000)/1000+", "+Math.round(pt.latLng.lat()*1000)/1000;});if(g_activity>1)regionlayer=new RegionLayer(map,g_activity);sitelayer=new SiteLayer(map,g_activity,g_aicon);}
function pageunload(){if(g_map){var center=map.getCenter();if(charts){setCookie('map-chart-pos-lon',center.lng(),365);setCookie('map-chart-pos-lat',center.lat(),365);setCookie('map-chart-zoom',map.getZoom(),365);}
else{setCookie('map-pos-lon',center.lng(),365);setCookie('map-pos-lat',center.lat(),365);setCookie('map-zoom',map.getZoom(),365);}}
setCookie('countrychange',g_changecountry,365);}
function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString())+"; path=/";}
function setCookie_MyWeather(id,str){setCookie(id,str,365);}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function getCookies_MyWeather(){var check_name="myweather";var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;var el=$('.my-weather');for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name.indexOf(check_name)!=-1){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));}
el.append(makeHotLink(cookie_value));}
a_temp_cookie=null;cookie_name='';cookie_value='';}
if(!b_cookie_found){el.append("<li class='myweather-help'>"+tooltips.myweathermain+"</li>");}}
function deleteCookie_MyWeather(id){setCookie(id,"",-1);}
function makeHotLink(value){var ar=new Array();ar=value.split("/",3);var textlink=rewriteInput(ar[0])+" > "+rewriteInput(ar[1])+" > "+rewriteInput(ar[2]);return"<li><a href='/"+value+"' title='"+textlink+"' rel='"+value+"'><span class='el-rm ' rel='"+value+"' title='Delete bookmark'></span>"+textlink+"</a></li>";}
function rewriteOutput(output){var rewrite='/';if(output)rewrite=output.replace(/ /g,'-');return rewrite.toLowerCase();}
function rewriteInput(input){var rewrite='/';if(input)rewrite=input.replace(/-/g,' ');return rewrite;}
function search(){$("#searchlist").html("<img src='/style/img/ajax-loader.gif'>");var site=$('#find').val();if(site.length>0){$.ajax({data:({'r':"location",'t':'search','a':g_activity,'s':site}),success:function(json){displaySiteResults(json,true);}});}}
function displaySiteResults(sites,search){var sitecount=0;var list=(search)?$('#searchlist'):$('#sitelist');list.show();list.html("");var str="";if(sites){for(var item in sites){var fontsize=cloudFontSize(sites[item].views);if(g_map){if(g_activity==2){}
else{str=" <a style='font-size: "+fontsize+"px; margin-left: 6px;' title='See detailed 7 day forecast' href='/"+rewriteOutput(g_aname)+"/"+rewriteOutput(g_cname)+"/"+rewriteOutput(sites[item].name)+"'>  "+sites[item].name+"  </a> ";}
list.append(str);}
else{var urlpath=rewriteOutput(g_aname)+"/"+rewriteOutput(g_cname)+"/"+rewriteOutput(sites[item].name);list.append(" <a style='font-size: "+fontsize+"px; margin-left: 6px;' title='See detailed 7 day forecast' href='/"+urlpath+"'>  "+sites[item].name+"  </a> ");}
sitecount++;}
if(g_map&&sitecount==1){map.setCenter(new google.maps.LatLng(sites[item].lat,sites[item].lon));map.setZoom(10);}
else if(sitecount==1){urlnew='/'+rewriteOutput(g_aname)+'/'+rewriteOutput(g_cname)+'/'+rewriteOutput(sites[item].name);window.location.href=urlnew;}}
else{list.html("Your location could not be found. Check your spelling or try a nearby location.");}}
function cloudFontSize(views){var i=parseInt(views);fontSize=Math.ceil(10+(Math.min(1,(i/100))*6));return fontSize;}
function changeCountry(){g_changecountry=1;setCookie('country',$("#country").val(),365);var urlnew=rewriteOutput("/"+g_aname);window.location.href=urlnew;}
function updateRegions(activity,country){var html="";if(country){$.ajax({data:({'r':"location",'t':'country_regions','a':activity,'country':country}),success:function(json){$('#region')[0].options.length=0;html="<option value=''>Select an area</option>";for(var item in json){html+="<option value='"+item+"'>"+json[item].name+"</option>";}
$('#region').html(html);}});}}
function changeRegion(activity,region){if(region){if(g_map){var zoom=9;$.ajax({data:({'r':"location",'t':'region','a':activity,'siteid':region}),success:function(json){zoom=(charts)?8:parseInt(json.zoom);if(json.y1){var sw=new google.maps.LatLng(json.y1,json.x1);var ne=new google.maps.LatLng(json.y2,json.x2);var bounds=new google.maps.LatLngBounds(sw,ne);map.fitBounds(bounds);map.setZoom(zoom);}
else{map.setCenter(new google.maps.LatLng(json.lat,json.lon));map.setZoom(parseInt(zoom));}}});}
getRegionSites(activity,region);}
else{if(g_map){$('#sitelist').html("");map.setCenter(g_latlng);map.setZoom(g_zoom);}}}
function getRegionSites(activity,region){var list=$("#sitelist");if(g_chart_activity>0)activity=g_chart_activity;list.html("<img src='/style/img/ajax-loader.gif'>");$.ajax({data:({'r':"location",'t':'sites','a':activity,'siteid':region}),success:function(resp){displaySiteResults(resp);}});}
