GMap2.prototype.showBounds=function(bounds_,opt_options){var opts=opt_options||{};opts.top=opt_options.top*1||0;opts.left=opt_options.left*1||0;opts.bottom=opt_options.bottom*1||0;opts.right=opt_options.right*1||0;opts.save=opt_options.save||true;opts.disableSetCenter=opt_options.disableSetCenter||false;opts.maxZoom=opt_options.maxZoom*1||30;var ty=this.getCurrentMapType();var port=this.getSize();if(!opts.disableSetCenter){var virtualPort=new GSize(port.width-opts.left-opts.right,port.height-opts.top-opts.bottom);var goodZoom=ty.getBoundsZoomLevel(bounds_,virtualPort);this.setZoom(Math.min(goodZoom,opts.maxZoom));var xOffs=(opts.left-opts.right)/2;var yOffs=(opts.top-opts.bottom)/2;var bPxCenter=this.fromLatLngToDivPixel(bounds_.getCenter());var newCenter=this.fromDivPixelToLatLng(new GPoint(bPxCenter.x-xOffs,bPxCenter.y-yOffs));this.setCenter(newCenter);if(opts.save){this.savePosition()}}var portBounds=new GLatLngBounds;portBounds.extend(this.fromContainerPixelToLatLng(new GPoint(opts.left,port.height-opts.bottom)));portBounds.extend(this.fromContainerPixelToLatLng(new GPoint(port.width-opts.right,opts.top)));return portBounds};$(function(){$(".lbxn").each(function(i){$(this).hover(function(){$("#rollovershow_"+$(this).attr("id")).show()},function(){$("#rollovershow_"+$(this).attr("id")).hide()})});$("#showLegends").click(function(){showLegend()});$("#hideLegends").click(function(){hideLegend()})});function showLegend(){$("#legends").show();$("#hideLegends").show();$("#showLegends").hide();setScrollMap()}function hideLegend(){$("#legends").hide();$("#showLegends").show();$("#hideLegends").hide();setScrollMap()}var menuYloc=189;var mapHeight=250;function setScrollMap(){mapHt=$("#floatmap").height();if(mapHt!=null){pgmid=$(".overpad").height();$(".mapdiv").height(mapHt);offset=menuYloc+"px";if($(document).scrollTop()>menuYloc){if($(document).scrollTop()>parseInt(menuYloc)+parseInt($("#map_canvas").height())){offset=$(document).scrollTop()-$("#map_canvas").height()-25+"px";if($("#legends").css("display")=="none"){offset=$(document).scrollTop()+10+"px"}}else{if($("#legends").css("display")=="none"){offset=$(document).scrollTop()+10+"px";if($(".padsigleleft").height()<mapHt){offset=menuYloc+"px"}}else{offset=menuYloc+"px"}}}midval=pgmid+parseInt($(".menu").height())+parseInt($(".header").height())-mapHt;if($("#legends").css("display")!="none"){midval=pgmid+parseInt($(".menu").height())+parseInt($(".header").height())-mapHt+5}offsetval=parseInt(offset);if(offsetval<midval){$("#floatmap").animate({top:offset},{duration:1000,easing:"easeOutQuint",queue:false})}else{if(pgmid-$(".hetit").height()>mapHt){if($("#legends").css("display")=="none"){offset=parseInt($(document).scrollTop())-(parseInt($(document).scrollTop())-parseInt(midval))-18+"px"}else{offset=parseInt($(document).scrollTop())-(parseInt($(document).scrollTop())-(parseInt(midval)-55))+"px";if($(".padsigleleft").height()<mapHt){offset=menuYloc+"px"}}$("#floatmap").animate({top:offset},{duration:1000,easing:"easeOutQuint",queue:false})}else{offset=menuYloc+"px";$("#floatmap").animate({top:offset},{duration:1000,easing:"easeOutQuint",queue:false})}}}}var length=0;var rows=0;var totpages=0;var current=1;var start=length*current;$(document).ready(function(){if($("#floatmap")!=undefined){if($("#floatmap").css("top")!=undefined){menuYloc=parseInt($("#floatmap").css("top").substring(0,$("#floatmap").css("top").indexOf("px")))}}setScrollMap();window.onscroll=document.documentElement.onscroll=setScrollMap;length=$("#length").val();rows=$("#rows").val();totpages=Math.ceil(rows/length);pagingLoad()});function pagingLoad(){var str=location.href;var strvalue=str.split("#",2);if(strvalue[1]!=undefined){current=parseInt(strvalue[1])}else{current=1}var pages=Math.ceil(rows/length);if(current>0&&current<=pages&&pages>1){start=length*current;pagingshow(current,0)}}function pagingshow(page,initial){$("#floatmap").animate({top:menuYloc},{duration:1000,easing:"easeOutQuint",queue:false});var val="";$(".pagingbox").each(function(i){if($(this).attr("page_id")==page){$(this).show()}else{$(this).hide()}});current=page;showpageChange(start,length,rows,current);if(initial!=1){$("html, body").animate({scrollTop:150})}}function showpageChange(start_fn,length_fn,row_fn,getvar_fn){separator="";margin=1;linkpaths=Array();val=0;pages=Math.ceil(row_fn/length_fn);current=getvar_fn;pagerstart=current-margin;pagerstart=pagerstart<1?1:pagerstart;pagerend=current+margin;pagerend=pagerend>pages?Math.ceil(row_fn/length_fn):pagerend;if(pages>3){var initcnt=4;if(pages<11){initcnt=5}for(i=0;i<initcnt;i++){linkpaths[i]=i}}for(i=pagerstart;i<pagerend+1;i++){linkpaths[i]=i}if(pages>3){var finalcnt=2;if(pages<11){finalcnt=5}for(i=pages-finalcnt;i<pages+1;i++){linkpaths[i]=i}}str=Array();val=0;i=1;var cntpag=0;var cntdot=0;for(j=0;j<linkpaths.length;j++){if(linkpaths[j]!=undefined&&linkpaths[j]!=0){cntpag++;k=j;if(k!="next"&&k!="last"){if(k==getvar_fn){str[i]="<div class=\"pagine_num\" page_id=\""+k+"\"><span class=\"crnt\">"+k+"</span></div>";i++}else{if(val!=k-1){str[i]="<div class=\"divleft pagespc\" style=\"border:none;\">...</div>";i++;cntdot++}str[i]="<div class=\"pagine_num\" page_id=\""+k+"\"><a id=\"pagdiv_gery\" href=\"#"+k+"\" onclick=\"javascript:pagingshow("+k+",0)\" name=\""+k+"\">"+k+"</a></div>";i++}}val=k}}str=str.join("");if(pages>0){rt="<span class=\"pgs\">Pages</span>"}else{rt="<span class=\"pgs\"></span>"}rt+=str;var pageWidth=100+parseInt(cntdot*50)+(parseInt(cntpag)-1)*34;$(".paging").width(pageWidth+"px");$("#paging").html(rt)}
