
 function initialize_maps() {
			  
				var centro = new google.maps.LatLng(43.074223,12.596364);
				var myOptions = {
				  //identifica il livello di zoom 
				  zoom: 11, 
				 
				  center: centro, 
				  //indica il tipo di mappa utilizzato
				   //mapTypeId: google.maps.MapTypeId.TERRAIN
				   mapTypeId: google.maps.MapTypeId.HYBRID 
				}
				//istanzia la mappa
				var map = new google.maps.Map(document.getElementById("maps"), myOptions);
				var coordinate_marker=new google.maps.LatLng(43.074223,12.596364);
				var marker = new google.maps.Marker({
					position: coordinate_marker, 
					map: map,
					title:"Carfagna Sandro Camere",
					icon:"images/menu/icona.png"
				}); 
			  }


function  setGallery(link){
                               if (noFlash){openImage(link);} else {
	
				var obj = swfobject.getObjectById("LeftFlash");				
				if (obj && typeof obj.JStoASviaExternalInterface != "undefined") {
				obj.JStoASviaExternalInterface(link);	
				}
				}
}
function  openImage(link){
                               $("#center_noflash").css('display','none');
                               $("#preload_noflash").css('display','block');
                               $.ajax({
		type: "POST",
		url: "noflashcangeimage.php",
                data: "img="+link,
		success: function(risp){
			$("#center_noflash").html(risp);
                        $("#center_noflash").fadeIn();
                        $("#preload_noflash").css('display','none');
		}
        	});
                              
                
}
function  setTextTop(link3,link2){
                               if (!noFlash){
				var objtesto = swfobject.getObjectById("TopFlash");				
				if (objtesto && typeof objtesto.CambiaTesto != "undefined") {
				objtesto.CambiaTesto(link3,link2);
				}
                                } else {
                                 $("#top_noflash_testo").html(link3);
                                 $("#top_noflash_testo2").html(link2); 
                                }

}
function  openPage(link){
	     if (($("#myform").data("validator")) != null){ $("#myform").data("validator").reset(); }
				
				$("#ConTesti").css('margin-top','50px');
				$("#Testi").load("testi.php?obj="+(link.replace(" ","_")),function() {
				resizeDiv();
				});			
			}
			
function  Esegui(id){
	
	openPage((""+menu[id]).toLowerCase())
	setTextTop(menu[id])
	
	
}
if (noFlash){
//$('#Control').html($('#Content').position().left)
var size = getViewportSize();
		if (size[0]<=1096){$('#Content').css('left','540px');} else {$('#Content').css('left','50%');} ;
		if (size[1]<=700){$('#Content').css('top','350px');} else {$('#Content').css('top','50%');} 
        } 
        
        
$(".Cornice").hover(
  function () {
	if (!$(this).data('clicked')){
	$(this).css('background-color', '#6d4a37');
	}
  }, 
  function () {
	if (!$(this).data('clicked')){
        $(this).css('background-color', '#c4b7a7');
	}
  }
);
$("#chic").click(function () {
$("#ConTesti").css('margin-top','50px');
  setTextTop("E-MAIL","");
  email_click=1;
  menu_att=-1;
  $("#Testi").load("email.php",function() {
				resizeDiv();
				
	});
    });

$(".button_orizzontale").click(function () {
	
	var menu_tmp=parseInt($(this).attr('menu_id'))
	
	$(".button_orizzontale").css('color', '#FCF7EF').css('font-weight', '400');
	if (scale<=0.9) {$(this).css('font-weight', '600');}
	$(this).css('color', '#FFFFFF')	
	$(".button_orizzontale").children("div .Cornice").data('clicked','');
	$(".button_orizzontale").children("div .Cornice").css('background-color', '#c4b7a7');
	$(this).children("div .Cornice").css('background-color', '#FFFFFF');
	$(this).children("div .Cornice").data('clicked',true);
	if (menu_att!=menu_tmp){
	if (email_click!=1){menu_att=menu_tmp; Esegui(menu_att);} else { email_click=0;}
	}	
	
    // $(this).attr('disabled', 'disabled');
    
    });
$(".button_orizzontale").hover(
  function () { $(this).css('color', "#FFFFFF"); if (scale<=0.9) {  $(this).css('font-weight','600');}  }, 
  function () { if (!$(this).children("div .Cornice").data('clicked')){ $(this).css('color', "#FCF7EF");
  $(this).css('font-weight','400');}  }
  );


$("#chic").hover(
  function () {
	
    //.css('margin-top',-$(this).position().top+'px'
    $(this).attr("src", "images/menu/chiocciola_over.png"); 
     $("#email").css('display','none').fadeIn(200);
     }, 
  function () {
	$(this).attr("src", "images/menu/chiocciola.png"); 
   $("#email").css('display','block').fadeOut(100);

  });
  
  $("#phon").hover(
  function () {
	 $(this).attr("src", "images/menu/phone_over.png"); 
     $("#telefono").css('display','none').fadeIn(200);
     }, 
  function () {
   $("#telefono").css('display','block').fadeOut(100);
   $(this).attr("src", "images/menu/phone.png"); 
  }
  );
  $("#lett").hover(
  function () {
	$(this).attr("src", "images/menu/lettera_over.png"); 
     $("#indirizzo").css('display','none').fadeIn(200);
     }, 
  function () {
   $(this).attr("src", "images/menu/lettera.png"); 	
   $("#indirizzo").css('display','block').fadeOut(100);

  }
);
  $("#botRichiesta").hover(
  function () {
    $('#botRichiesta .bottone').css('font-weight','600') 
     }, 
  function () {
    $('#botRichiesta .bottone').css('font-weight','400')
  }
);
  

$("#sf_BR").click(function () {
$("#ConTesti").css('margin-top','0px');
  setTextTop("DISPONIBILITA'","richiesta");
 $("#Testi").load("prenota.php",function() {
				resizeDiv();
	});

});


setTextTop("HOME","")				
openPage("home");
resizeDiv();
/* 
 $("#Testi").load("prenota.php",function() {
	//			resizeDiv();
	});*/
