/**
/**
 * @author Mario
 */

// Set thickbox loading image
tb_pathToImage = "../images/loading-thickbox.gif";

var mycarousel_itemList = [
    {url: "img/gallery/relax_01.jpg", title: "Entrata"},
	{url: "img/gallery/relax_02.jpg", title: "Bar"},
	{url: "img/gallery/relax_03.jpg", title: "Saletta"},
	{url: "img/gallery/relax_04.jpg", title: "Aiuole"},
	{url: "img/gallery/relax_05.jpg", title: "Gazebo"},
	{url: "img/gallery/relax_13.jpg", title: "Viale"},
	{url: "img/gallery/relax_07.jpg", title: "Altalena"},
	{url: "img/gallery/relax_08.jpg", title: "In mezzo alla natura"},
	{url: "img/gallery/relax_09.jpg", title: "Casetta"}
];



function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > mycarousel_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    var url_m = item.url;
    return '<a href="' + url_m + '" title="' + item.title + '"><img src="' + item.url + '"  width="118" border="0" alt="' + item.title + '" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        size: mycarousel_itemList.length,
        itemLoadCallback: {onBeforeAnimation: mycarousel_itemLoadCallback}
    });
});


/****************************************************************
	SEZIONE GESTIONE MENU 
****************************************************************/
	var arrayTab=new Array();
	var arraySecondoLivello=new Array();


	function voceTab(id,descrizione,collegamento,name,traduzione)
	{
		this.id = id;
		this.descrizione = descrizione;
		this.collegamento = collegamento;
		this.name = name;
		this.traduzione = traduzione;
	}

	arrayTab[arrayTab.length]=new voceTab(1,"Il campeggio","index.html","home","The Camping"); 
	arrayTab[arrayTab.length]=new voceTab(1,"Dove Siamo","dove.html","dove","Location");  
	arrayTab[arrayTab.length]=new voceTab(1,"Dintorni","boccadirio.html","dintorni","Surroundings"); 
	arrayTab[arrayTab.length]=new voceTab(1,"Foto","foto.html","foto","Photos"); 
	arrayTab[arrayTab.length]=new voceTab(1,"Contattateci","contatti.html","contatti","Contact us"); 


function menu(name,lingua)
{
	var classeMenu = "";
	
	document.write('<div id="menu"><ul>');

	for (var loopIndex= 0; loopIndex < arrayTab.length; loopIndex++)
	{
		 var voce = arrayTab[loopIndex];
		 
		  classeMenu = "";
		 
		 if (name == voce.name)
			 classeMenu = "class='active'";
		
		 var descrizione = voce.descrizione;
		
		 if (lingua=='eng')
		 	descrizione = voce.traduzione;

		 var collegamento = voce.collegamento;
		
		 if (lingua=='eng')
		 	collegamento = 'eng'+ voce.collegamento;
		
		 document.write('    <li ' +classeMenu+ '><a href="'+ collegamento +'">'+descrizione+'</a></li>');
	}

	document.write('</ul></div>');

}

function footer(name)
{
	document.write('<p id="copy">&copy;2008 Webmaster : &nbsp;&nbsp;&nbsp;<a href="http://www.piandelvoglio.it">www.piandelvoglio.it</a>');
	document.write("</p>");
}

function writeContatore()
{
	var inizioTabellaInterna = false;
	var fineTabellaInterna = false;
	var output="";

	//output +="<br/><span class ='news'>Sei il visitatore numero:<br/><br/></span>";
	output +="<!-- Inizio Codice Shinystat --><script type='text/javascript' language='JavaScript' src='http://codice.shinystat.com/cgi-bin/getcod.cgi?USER=campingrelax'></script>";
	output +="<noscript><a href='http://www.shinystat.com/it' target='_top'>";
	output +="<img src='http://www.shinystat.com/cgi-bin/shinystat.cgi?USER=campingrelax' border='0'></a>";
	output +="</noscript>";
	
	document.write(output);
}


