//<![CDATA

var linkAttivo=null;

function shot(str,w,h){    
	
	var option;
	var href;
	
	option="scrollbars=yes, resizable=yes, status=no, location=no, toolbar=no";
			
	href=location.href.substr(0,location.href.lastIndexOf("index.php"));
		
	str=href+str;
	
	if (w && w>0) option+=",width="+w;
	if (h && h>0) option+=",height="+h;
	
	window.open(str,'',option);

}

window.onload=function(){


/**** GOOGLE MAPS ****/

	if (document.getElementById("mappa")){
		
		if (GBrowserIsCompatible()) {
			
			var map = new GMap2(document.getElementById("mappa"));
			map.setCenter(new GLatLng(44.640552,10.873953), 16);
			map.addControl(new GLargeMapControl());
			map.addControl(new GMapTypeControl());
	        map.setMapType(G_HYBRID_MAP);
			
			var point = new GLatLng(44.639152,10.874153);
			var marker = new GMarker(point);
		
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml("<p><b>Re &asymp; Age</b><br />Via Vittorio Bottego, 239<br />41100 Modena</p>");
			});
			map.addOverlay(marker);
		}

		 
		 window.onunload=function(){
			GUnload();
		 }
		 
	}

/**** FINE ****/



	var arVersion = navigator.appVersion.split("MSIE");
	var version = parseFloat(arVersion[1]);
	
	if (version < 7)  {
		
		pngfix();
	}

	for (var i=0; i<document.links.length; i++)
   	if (document.links[i].rel=="external") {
      	document.links[i].target="_blank";
      } 

	
	inserisciSWF();

	if (typeof(do_init)=='function'){
		
		do_init();
		
	}
	
}

function sottomenuOpenClose(){

	$$('h2.menuLat').each(function(h2) {
	
		h2.onclick = function() {
			
			
			if(linkAttivo!="stm"+this.id.substring(4)){
			
				new Effect.BlindDown("stm"+this.id.substring(4),{originalHeight: 0, originalWidth: 0});
				
					if(linkAttivo){
	
						new Effect.toggle(linkAttivo,'blind');
	
					}
		
				linkAttivo="stm"+this.id.substring(4);
			} else {
			
				new Effect.toggle("stm"+this.id.substring(4),'blind');
				
				linkAttivo=null;
			}
		};
	});
}
	
	
function inserisciSWF(){
	
 if (typeof(insertFlash)!='undefined'){
  for (swf in insertFlash){
   var flash = document.getElementById(swf);
   if (flash){
    flash.innerHTML=insertFlash[swf];
   }
  }
 } 
}

function nascondiMostraFlash(visualizza){
 if (insertFlash){
  for (swf in insertFlash){  
   var flash = document.getElementById(swf);
	if (flash){
	   flash.style.visibility=visualizza;
	}
  }
 } 
}

//]]>