﻿
 function menu_minisito(current)
    {
	
	    /*
		if ($('galleria')){
			$('galleria').style.display='none';
		}
		if ($('mappa')){
			$('mappa').style.display='none';
		}
		if ($('giudizio')){
			$('giudizio').style.display='none';
		}
		if ($('alto')){
			$('alto').style.display='none';
		}
		$(current).style.display='';
		*/
		var GAL = document.getElementById('galleria');
		var MAP = document.getElementById('mappa');
		var GIU = document.getElementById('giudizio');
		var ALT = document.getElementById('alto');
		
		var CUR = document.getElementById(current);
		
		if (GAL && CUR.id != 'galleria'){
			GAL.style.display = 'none';
		}
		if (MAP && CUR.id != 'mappa'){
			MAP.style.display = 'none';
		}
		if (GIU && CUR.id != 'giudizio'){
			GIU.style.display = 'none';
		}
		if (ALT && CUR.id != 'alto'){
			ALT.style.display = 'none';
		}
		
		//CUR.style.display='block';
		//alert(CUR.style.display);
		if (CUR.style.display == 'block'){
			CUR.style.display = 'none';
		}else{
			CUR.style.display = 'block';
		}
		
		
    }
	
	
	
function Expansion(ID) 
	{
		var XPRE= document.getElementById(ID);
		if (XPRE.style.display == 'none') 
		{
		alert();
		}
		else 
		{
		XPRE.style.display='none'; 
		}
	}
	
function GetMap(Lat, Lon, level, name, pinmap, address, photo)
     {
        map = new VEMap('VE_Map');
        map.LoadMap(new VELatLong(Lat, Lon), level ,'h' ,false);   
        map.HideDashboard();
        map.SetShapesAccuracy(VEShapeAccuracy.Pushpin);
        var pin = new VEShape(VEShapeType.Pushpin, new VELatLong(Lat, Lon));
        pin.SetTitle(name);
	    pin.SetCustomIcon(pinmap);
        pin.SetDescription(address);
        pin.SetPhotoURL(photo);
        map.AddShape(pin);
        window.setTimeout(switchMapStyle, 1000);
     }   
	 
 function switchMapStyle(Lat, Lon)
    {      
        map.SetMapStyle(VEMapStyle.Birdseye);
        map.SetCenter(new VELatLong(Lat, Lon));
    }  
    
function hideLoader(){
    $('loader').className = 'hidden';
}

/* cookies */
function createCookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    }
    return null;
}

function eraseCookie(name) {
    createCookie(name, "", -1);
}
