$(document).ready(function () {
// funzione che disabilita il tasto destro del mouse sulle immagini
        $('img').each(function () {
            $(this)[0].oncontextmenu = function () { return false }
        });
    // SCROLLABLE HOME
    if ($(".scrollable").size() > 0) {
        $(".scrollable").scrollable();
    }
    // ACCORDION 
    if ($("#accordion").size() > 0) {
        // simple accordion
        $("#accordion1a").accordion({
            autoheight: false,
			alwaysOpen: false,
            active: false
        });
        var accTitleCounter = $("#accordion1a .accQuest").size();
        $("#accordion1a .accQuest").each(function () {
            $(this).css("z-index", accTitleCounter--)
        })
        var selectedStyle = $(".accQuest.selected").attr("style")
        $(".accQuest.selected").next().attr("style", selectedStyle)
    }
    // F.A.Q.


    if ($('#faq').size() == 1) {
        $('#faq').accordion({
            active: false,
            header: 'h3',
			alwaysOpen: false,
            animated: 'easeslide',
            autoheight: false
        });
    }


    //facebook share = 0
    element = $(document).find("span.fb_share_count_inner");
    if (element.html() == "&nbsp;") {
        $(document).find("span.fb_share_count_nub_top").removeClass('fb_share_no_count');
        element.parent().removeClass('fb_share_no_count');
        element.html('0');
    }

    // styling the last navs					   
    $("#systemNav li a:last").addClass("last");
    $("#servicesLink li a:last").addClass("last");

    // secondLvl spacing function
    $(".secondLvl").each(function () {
        var ulWidth = $(this).find("ul").width();
        var liSize = $(this).find("li").size();
        var liWidth = ulWidth / liSize
        var liBtnWidth = $(this).find("a.btn_secondlvl").width();
        var liBtnPadding = (liWidth - liBtnWidth) / 2;

        $(this).find("li").css("width", liWidth)
        $(this).find("a.btn_secondlvl").css("margin-left", liBtnPadding)
        //alert (liBtnPadding)
    });


    // McTabNavigator Start
    //$(".secondLvl").addClass("hideOnTop");

    // McTabNavigator Click
    /*$("#firstLvl li a").click(function() 
    {
    //clearTimeout(timer);
    var panelID = $(this).parent().attr("id");
    $("body").removeClass();
    $("#panel_"+panelID).find("li").hide();
    $(".isActive").removeClass("isActive");
    $("#panel_"+panelID).addClass("isActive");
    $("body").addClass("body_"+panelID);
    $("#panel_"+panelID).find("li").each(function(k, v){
    $(this).delay(((k+1)*150)).fadeIn()
    });
    });*/

    // McTabNavigator Animator Run!



    // McTabNavigator in non-Home pages
    if ($("#home").html() == null) {
        //clearTimeout(timer);
        $("#mainNav").addClass("compact");
        $(".secondLvl").hide();

        /*
        $("#firstLvl li a").click(function() 
        {
        $("#mainNav").removeClass("compact");
        $("#mN_compact").hide();
        $(".secondLvl").show();
			
        var panelID = $(this).parent().attr("id");
        $("body").removeClass();
			
        //this is only for coloured sections, but it doesn't make errors on JS debugger for the other non-coloured sections
        $("#sectionPage #page").removeClass();
        $("#sectionPage #page").addClass("section");
        //end
			
        $("#panel_"+panelID).find("li").hide();
        $(".isActive").removeClass("isActive");
        $("#panel_"+panelID).addClass("isActive");
        $("body").addClass("body_"+panelID);
        $("#panel_"+panelID).find("li").each(function(k, v){
        $(this).delay(((k+1)*150)).fadeIn()
        });
        });*/
    }
    else {
        //changeTab(0)
    }

    /*var pagerWidth = $("#pager").width();
    $("#pager").css("width", pagerWidth)
    $("#pager").css("float", "none")
    */

});

//$(window).load(function() {
//  if ($(".side").size() ){ 
//	$(".side").liquidCanvas("[shadow fill{color:#e6ebea}] => roundedRect{radius:10}");
//}

// if ($(".picWrapper").size()){
//$(".picWrapper").liquidCanvas("[shadow fill{color:#ffffff}] => roundedRect{radius:10}")
//}
//});


function extendCalcolatore() {
    $("#calcolatoreCalorie").animate({
        height: '1207px'
    }, 2000, 'swing');

}

function extendDieta() {

     $("#dietaBilanciata").animate({
        height: '1360px'
    }, 2000, 'swing');

}

// McTabNavigator Animation
var timer;
function changeTab(elementIndex) {
    //if (elementIndex>2)
    //	elementIndex=0;

    var panelID = $("#firstLvl li:eq(" + elementIndex + ") a").parent().attr("id");
    $("body").removeClass();
    $("#panel_" + panelID).find("li").hide();
    $(".isActive").removeClass("isActive");
    $("#panel_" + panelID).addClass("isActive");
    $("body").addClass("body_" + panelID);
    $("#panel_" + panelID).find("li").each(function (k, v) {
        $(this).delay(((k + 1) * 150)).fadeIn()
    });

    //elementIndex++;
    //timer = setTimeout('changeTab('+elementIndex+')', 5000);
}

/* FUNZIONI PER IL SEARCH XSLT */

function GoSearch() {
    var field = document.getElementById('searchField');
    if (field != null) {
        var testo = document.getElementById('searchField').value;
        if (testo != '') {
            window.location.href = GetSearchUrl() + '?search=' + encodeURIComponent(testo);
        }
        else {
            //alert(GetSearchUrl() + '?search=')
        }
    }
    return true;
}

function GetSearchUrl()
{
	//Crea la url alla pagina di ricerca dentro ogni home page (ambiente, lavoro, qualità)
	var currentUrl = window.location.href;
	var start = currentUrl.indexOf("/",10);
	var end = currentUrl.indexOf("/",(start+1));
	if (end == -1) {
	    if ((currentUrl.indexOf("/qualita.aspx", 0) > -1) || (currentUrl.indexOf("/lavoro.aspx", 0) > -1) || (currentUrl.indexOf("/ambiente.aspx", 0) > -1)) {
	        //sono dentro ad uno dei 3 sottositi, quindi uso la ricerca interna:
	        end = start;
	        var finalUrl = currentUrl.substring(start, end);

            /* TEMPORANEAMENTE USO LA PAGINA GENERICA DI RICERCA, FINCHE' NON ABBIAMO CONTENUTI NEI SOTTOSITI Lavoro e Ambiente: 
	        if (currentUrl.indexOf("/lavoro.aspx", 0) > -1)
	            finalUrl += '/lavoro/ricerca.aspx';
	        else if (currentUrl.indexOf("/ambiente.aspx", 0) > -1)
	            finalUrl += '/amboente/ricerca.aspx';
	        else
	            finalUrl += '/qualita/ricerca.aspx';
            */
	        finalUrl += '/ricercaext.aspx';
	    }
	    else {
	        //sono in un nodo di root, quindi redirigo alla ricerca con templ. generico:
	        end = start;
	        var finalUrl = currentUrl.substring(start, end);
	        finalUrl += '/ricercaext.aspx';
	    }
        return finalUrl;
	}
	else {
	    var finalUrl = currentUrl.substring(start, end);
	    finalUrl += '/ricerca.aspx';
	    return finalUrl;
	}

}


function gup(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return results[1];
}

function setPreviousSearchValue() {
    var prevSearchString = gup('search');
    if (prevSearchString != '') {
        var field = document.getElementById('searchField');
        if (field != null) {
            //document.getElementById('searchField').value = escape(unescape(prevSearchString));
            document.getElementById('searchField').value = decodeURIComponent(prevSearchString);
        }
        else {
            alert('Error: search field not available!');
        }
    }
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
addLoadEvent(setPreviousSearchValue);

function disableEnterKey(e) {
    var key;
    if (window.event)
        key = window.event.keyCode; //IE
    else
        key = e.which; //firefox     

    if (key == 13) {
        GoSearch();
    }
    return (key != 13);
}

/* END FUNZIONI PER IL SEARCH */

/* GOOGLE MAPS FORNITORI */
function initialize() 
{
    if ($("#mappa_fornitori").size()>0)
    {
		var myOptions = {
			zoom: 3,
			center: new google.maps.LatLng(47.669026, 16.699024),
			mapTypeId: google.maps.MapTypeId.ROADMAP
		}
		var map = new google.maps.Map(document.getElementById("mappa_fornitori"), myOptions);		
		var markerArray = [];
	
		function bindClickEvent()
		{
			$("#ingredienti_select li").click(function() {
				var category = $(this).attr("class");
				for (var i = 0; i < markerArray.length; i++) 
				{  
					markerArray[i].setMap(map);
					if (markerArray[i].category!=category)
					{
						markerArray[i].setMap(null);
						//Swap id of minimap
						if (category!='pesce')
							$("#mappa_thailand_pin").attr("id","mappa_thailand_nopin");
						else
							$("#mappa_thailand_nopin").attr("id","mappa_thailand_pin");
					}										
				} 
			})			
		}
		
		function createMarkers()
		{
			var marker;
			//Carni
            //Castelvetro - Inalca SpA
			markerInalca = new google.maps.Marker({
			    position: new google.maps.LatLng(44.506717, 10.947511),
			  map: map,
			  icon: '/gfx/pointer_carni.png',
			  category: 'carni'
			});
	var contentStringInalca = '<p style="font-size:10px; margin:0; padding:0;"><strong>Inalca SpA</strong><br />Via Spilamberto, 30/C - 41014 Castelvetro (MO) Italy<br /><strong>Dettaglio Prodotti:</strong> Hamburger</p>';
	var infowindowInalca = new google.maps.InfoWindow({
	    content: contentStringInalca,
	            maxWidth: 250
	        });

	        infowindowInalca.setPosition(new google.maps.LatLng(41.646218, 13.212164));

	        markerArray.push(markerInalca);
	        google.maps.event.addListener(markerInalca, 'mouseover', function () {
	            infowindowInalca.open(map, markerInalca);
	        });
	        google.maps.event.addListener(markerInalca, 'mouseout', function () {
	            infowindowInalca.close(map, markerInalca);
	        });
			//San Vittore di Cesena - Amadori
	        markerAmadori = new google.maps.Marker({
			    position: new google.maps.LatLng(44.106222, 12.19727),
			  map: map,
			  icon: '/gfx/pointer_carni.png',
			  category: 'carni'
			});
	        var contentStringAmadori = '<p style="font-size:10px; margin:0; padding:0;"><strong>Amadori</strong><br />Via Del Rio, 400 - 47522 San Vittore di Cesena (FC) Italy<br /><strong>Dettaglio Prodotti:</strong> Pollo</p>';
	        var infowindowAmadori = new google.maps.InfoWindow({
	            content: contentStringAmadori,
                maxWidth: 250
	        });

	        infowindowAmadori.setPosition(new google.maps.LatLng(41.646218, 13.212164));
	       
            markerArray.push(markerAmadori);
            google.maps.event.addListener(markerAmadori, 'mouseover', function () {
	            infowindowAmadori.open(map, markerAmadori);
	        });
	        google.maps.event.addListener(markerAmadori, 'mouseout', function () {
	            infowindowAmadori.close(map, markerAmadori);
	        });
            //Orleans (Francia) - CARGILL FOODS France
	        markerCargill = new google.maps.Marker({
	            position: new google.maps.LatLng(47.901387, 1.903976),
	            map: map,
	            icon: '/gfx/pointer_carni.png',
	            category: 'carni'
	        });
	        var contentStringCargill = '<p style="font-size:10px; margin:0; padding:0;"><strong>CARGILL FOODS France</strong><br />Rue des Foug&eacute;res ZI de la Saussaye SAINT CYR EN VAL - 45075 Orl&eacute;ans Cedex 02<br /><strong>Dettaglio Prodotti:</strong> Pollo</p>';
	        var infowindowCargill = new google.maps.InfoWindow({
	            content: contentStringCargill,
                maxWidth: 250
	        });

	        infowindowCargill.setPosition(new google.maps.LatLng(41.646218, 13.212164));

	        markerArray.push(markerCargill);
	        google.maps.event.addListener(markerCargill, 'mouseover', function () {
	            infowindowCargill.open(map, markerCargill);
	        });
	        google.maps.event.addListener(markerCargill, 'mouseout', function () {
	            infowindowCargill.close(map, markerCargill);
	        });
			//Chemin de Noyelles - MOYPARK France S.A.S
	        markerMoypark = new google.maps.Marker({
	            position: new google.maps.LatLng(50.401912, 2.977874),
	            map: map,
	            icon: '/gfx/pointer_carni.png',
	            category: 'carni'
	        });
	        var contentStringMoypark = '<p style="font-size:10px; margin:0; padding:0;"><strong>Moypark France S.A.A</strong><br />712 Chemin de Noyelles - 62110 H&eacute;nin-Beaumont France<br /><strong>Dettaglio Prodotti:</strong> Pollo</p>';
	        var infowindowMoypark = new google.maps.InfoWindow({
	            content: contentStringMoypark,
	            maxWidth: 250
	        });

	        infowindowMoypark.setPosition(new google.maps.LatLng(50.401912, 2.977874));

	        markerArray.push(markerMoypark);
	        google.maps.event.addListener(markerMoypark, 'mouseover', function () {
	            infowindowMoypark.open(map, markerMoypark);
	        });
	        google.maps.event.addListener(markerMoypark, 'mouseout', function () {
	            infowindowMoypark.close(map, markerMoypark);
	        });
			//Lancashire - McCormick (UK) ltd
	        markerMcCormick = new google.maps.Marker({
	            position: new google.maps.LatLng(51.768477,-0.937958),
	            map: map,
	            icon: '/gfx/pointer_carni.png',
	            category: 'carni'
	        });
	        var contentStringMcCormick = '<p style="font-size:10px; margin:0; padding:0;"><strong>McCormick (UK) ltd</strong><br />Whitelees Road, Littleborough, Lancashire OL15 8BZ<br /><strong>Dettaglio Prodotti:</strong> Pollo</p>';
	        var infowindowMcCormick = new google.maps.InfoWindow({
	            content: contentStringMcCormick,
	            maxWidth: 250
	        });

	        infowindowMcCormick.setPosition(new google.maps.LatLng(41.646218, 13.212164));

	        markerArray.push(markerMcCormick);
	        google.maps.event.addListener(markerMcCormick, 'mouseover', function () {
	            infowindowMcCormick.open(map, markerMcCormick);
	        });
	        google.maps.event.addListener(markerMcCormick, 'mouseout', function () {
	            infowindowMcCormick.close(map, markerMcCormick);
	        });
	        //Pane
            //Bomporto (Mo) - East Balt
			markerEastBalt = new google.maps.Marker({
			  position: new google.maps.LatLng(44.730796, 11.039555),
			  map: map,
			  icon: '/gfx/pointer_pane.png',
			  category: 'pane'
			});
	        var contentStringEastBalt = '<p style="font-size:10px; margin:0; padding:0;"><strong>East Balt</strong><br />Bomporto (MO)<br /><strong>Dettaglio Prodotti:</strong> Pane</p>';
	        var infowindowEastBalt = new google.maps.InfoWindow({
	            content: contentStringEastBalt,
	            maxWidth: 250
	        });

	        infowindowEastBalt.setPosition(new google.maps.LatLng(44.730796, 11.039555));
	       
            markerArray.push(markerEastBalt);
            google.maps.event.addListener(markerEastBalt, 'mouseover', function () {
	            infowindowEastBalt.open(map, markerEastBalt);
	        });
	        google.maps.event.addListener(markerEastBalt, 'mouseout', function () {
	            infowindowEastBalt.close(map, markerEastBalt);
	        });
			
            //Caltagirone - Richetti
	        markerRichetti = new google.maps.Marker({
			 position: new google.maps.LatLng(37.237181, 14.513236),
			  map: map,
			  icon: '/gfx/pointer_pane.png',
			  category: 'pane'
			});
	        var contentStringRichetti = '<p style="font-size:10px; margin:0; padding:0;"><strong>Richetti S.p.A.</strong><br />S.M.Poggiarelli - Z.I. - 95041 Caltagirone (CT) Italy<br /><strong>Dettaglio Prodotti:</strong> Pane all\'origano</p>';
	        var infowindowRichetti = new google.maps.InfoWindow({
	            content: contentStringRichetti,
	            maxWidth: 250
	        });

	        infowindowRichetti.setPosition(new google.maps.LatLng(37.237181, 14.513236));

	        markerArray.push(markerRichetti);
	        google.maps.event.addListener(markerRichetti, 'mouseover', function () {
	            infowindowRichetti.open(map, markerRichetti);
	        });
	        google.maps.event.addListener(markerRichetti, 'mouseout', function () {
	            infowindowRichetti.close(map, markerRichetti);
	        });
			//Verduno (CN) - PANEALBA SRL
			markerPanealba = new google.maps.Marker({
			    position: new google.maps.LatLng(44.676189, 7.917815),
			  map: map,
			  icon: '/gfx/pointer_pane.png',
			  category: 'pane'
			});
	        var contentStringPanealba = '<p style="font-size:10px; margin:0; padding:0;"><strong>PANEALBA SRL</strong><br />Borgata Molino, 20/22/34 - 12060 Verduno (CN) Italy<br /><strong>Dettaglio Prodotti:</strong> Grissini Torinesi</p>';
	        var infowindowPanealba = new google.maps.InfoWindow({
	            content: contentStringPanealba,
	            maxWidth: 250
	        });

	        infowindowPanealba.setPosition(new google.maps.LatLng(44.676189, 7.917815));

	        markerArray.push(markerPanealba);
	        google.maps.event.addListener(markerPanealba, 'mouseover', function () {
	            infowindowPanealba.open(map, markerPanealba);
	        });
	        google.maps.event.addListener(markerPanealba, 'mouseout', function () {
	            infowindowPanealba.close(map, markerPanealba);
	        });

			//Patate
			//Marchfelde (Austria) - Frisch & Frost
	        markerFrisch = new google.maps.Marker({
			  position: new google.maps.LatLng(48.224053, 16.689338),
			  map: map,
			  icon: '/gfx/pointer_patate.png',
			  category: 'patate'
			});
	        var contentStringFrisch = '<p style="font-size:10px; margin:0; padding:0;"><strong>Frisch & Frost</strong><br />2020 Hollabrunn - M&uuml;hlenring Austria<br /><strong>Dettaglio Prodotti:</strong> Patate</p>';
	        var infowindowFrisch = new google.maps.InfoWindow({
	            content: contentStringFrisch,
	            maxWidth: 250
	        });

	        infowindowFrisch.setPosition(new google.maps.LatLng(48.224053, 16.689338));

	        google.maps.event.addListener(markerFrisch, 'mouseover', function () {
	            infowindowFrisch.open(map, markerFrisch);
	        });
	        google.maps.event.addListener(markerFrisch, 'mouseout', function () {
	            infowindowFrisch.close(map, markerFrisch);
	        });
            markerArray.push(markerFrisch);
			
            //Frutta
			//Campogalliano (Mo) - EISBERG ITALIA srl
			markerEisberg = new google.maps.Marker({
			    position: new google.maps.LatLng(44.690208, 10.843799),
			  map: map,
			  icon: '/gfx/pointer_frutta.png',
			  category: 'frutta_verdura'
	        });
	        var contentStringEisberg = '<p style="font-size:10px; margin:0; padding:0;"><strong>Eisberg Italia srl</strong><br />Via Nuova, 13 - 41011 Campogalliano (MO) Italy<br /><strong>Dettaglio Prodotti:</strong> Insalata Iceberg, Cipolle Affettate, Pomodorini Cherry, Pomodori Interi, Insalata Batavia, Rucola</p>';
	        var infowindowEisberg = new google.maps.InfoWindow({
	            content: contentStringEisberg,
	            maxWidth: 250
	        });

	        infowindowEisberg.setPosition(new google.maps.LatLng(44.690208, 10.843799));

	        google.maps.event.addListener(markerEisberg, 'mouseover', function () {
	            infowindowEisberg.open(map, markerEisberg);
	        });
	        google.maps.event.addListener(markerEisberg, 'mouseout', function () {
	            infowindowEisberg.close(map, markerEisberg);
	        });
	        markerArray.push(markerEisberg);
			//Molino Albergati (FE) - Macè
			markerMace = new google.maps.Marker({
			  position: new google.maps.LatLng(44.769372, 11.333622),
			  map: map,
			  icon: '/gfx/pointer_frutta.png',
			  category: 'frutta_verdura'
			});
	        var contentStringMace = '<p style="font-size:10px; margin:0; padding:0;"><strong>Mac&egrave; srl</strong><br />Via Prampolini, 32/A - 44047 Molino Albergati (FE) Italy<br /><strong>Dettaglio Prodotti:</strong> Fruit bag pineapple, Baby carrots, Apple fruit bag, Nectarines fruit bag, Fruit bag kiwi stick</p>';
	        var infowindowMace = new google.maps.InfoWindow({
	            content: contentStringMace,
	            maxWidth: 250
	        });

	        infowindowMace.setPosition(new google.maps.LatLng(44.769372, 11.333622));

	        google.maps.event.addListener(markerMace, 'mouseover', function () {
	            infowindowMace.open(map, markerMace);
	        });
	        google.maps.event.addListener(markerMace, 'mouseout', function () {
	            infowindowMace.close(map, markerMace);
	        });
	        markerArray.push(markerMace);
			//Northampton - Tmi Foods 
	        markerTmi = new google.maps.Marker({
	            position: new google.maps.LatLng(52.262443, -0.945876),
			  map: map,
			  icon: '/gfx/pointer_frutta.png',
			  category: 'frutta_verdura'
	        });
	        var contentStringTmi = '<p style="font-size:10px; margin:0; padding:0;"><strong>Tmi Foods</strong><br />Tmi foods, Lodge Farm Industrial estate Northampton, NN5 7US<br /><strong>Dettaglio Prodotti:</strong> Grilled white onion</p>';
	        var infowindowTmi = new google.maps.InfoWindow({
	            content: contentStringTmi,
	            maxWidth: 250
	        });

	        infowindowTmi.setPosition(new google.maps.LatLng(52.262443, -0.945876));

	        google.maps.event.addListener(markerTmi, 'mouseover', function () {
	            infowindowTmi.open(map, markerTmi);
	        });
	        google.maps.event.addListener(markerTmi, 'mouseout', function () {
	            infowindowTmi.close(map, markerTmi);
	        });
	        markerArray.push(markerTmi);
			
            //Pueblonuevo del Guadiana (Badajoz) - VEGENAT, S.A.
			markerVegenat = new google.maps.Marker({
			    position: new google.maps.LatLng(38.894936, -6.79017),
			  map: map,
			  icon: '/gfx/pointer_frutta.png',
			  category: 'frutta_verdura'
	        });
	        var contentStringVegenat = '<p style="font-size:10px; margin:0; padding:0;"><strong>VEGENAT, S.A.</strong><br />Crta. Badajoz-Montijo km. 24,9 - 06.184 Pueblonuevo del Guadiana (Badajoz) Spain<br /><strong>Dettaglio Prodotti:</strong> Dehydrated Onions</p>';
	        var infowindowVegenat = new google.maps.InfoWindow({
	            content: contentStringVegenat,
	            maxWidth: 250
	        });

	        infowindowVegenat.setPosition(new google.maps.LatLng(38.894936, -6.79017));

	        google.maps.event.addListener(markerVegenat, 'mouseover', function () {
	            infowindowVegenat.open(map, markerVegenat);
	        });
	        google.maps.event.addListener(markerVegenat, 'mouseout', function () {
	            infowindowVegenat.close(map, markerVegenat);
	        });
	        markerArray.push(markerVegenat);

			//Maartensdijk, The Netherlands - Rieber & Søn Holland B.V.
	        markerRieber = new google.maps.Marker({
			  position: new google.maps.LatLng(51.547753, 4.087612),
			  map: map,
			  icon: '/gfx/pointer_frutta.png',
			  category: 'frutta_verdura'
	        });
	        var contentStringRieber = '<p style="font-size:10px; margin:0; padding:0;"><strong>Rieber &amp; S&oslash;n Holland B.V.</strong><br />Nijverheidsweg, 5 - 4695 RC St. Maartensdijk - The Netherlands<br /><strong>Dettaglio Prodotti:</strong> Crispy Fried Onions</p>';
	        var infowindowRieber = new google.maps.InfoWindow({
	            content: contentStringRieber,
	            maxWidth: 250
	        });

	        infowindowRieber.setPosition(new google.maps.LatLng(51.547753, 4.087612));

	        google.maps.event.addListener(markerRieber, 'mouseover', function () {
	            infowindowRieber.open(map, markerRieber);
	        });
	        google.maps.event.addListener(markerRieber, 'mouseout', function () {
	            infowindowRieber.close(map, markerRieber);
	        });
	        markerArray.push(markerRieber);


	        //Formaggio
	        //Morolo (FR) - Scarchilli
	        markerScarchilli = new google.maps.Marker({
	            position: new google.maps.LatLng(41.646218, 13.212164),
	            map: map,
	            icon: '/gfx/pointer_formaggio.png',
	            category: 'formaggio'
	        });

	        var contentStringScarchilli = '<p style="font-size:10px; margin:0; padding:0;"><strong>Societ&agrave; Artigiana Scarchilli S.r.l</strong><br />Contrada Madonna del Piano, 12 - 03017 Morolo (FR) Italy<br /><strong>Dettaglio Prodotti:</strong> Steccato di morolo</p>';
	        var infowindowScarchilli = new google.maps.InfoWindow({
	            content: contentStringScarchilli,
                maxWidth: 250
	        });

	        infowindowScarchilli.setPosition(new google.maps.LatLng(41.646218, 13.212164));

	        google.maps.event.addListener(markerScarchilli, 'mouseover', function () {
	            infowindowScarchilli.open(map, markerScarchilli);
	        });
	        google.maps.event.addListener(markerScarchilli, 'mouseout', function () {
	            infowindowScarchilli.close(map, markerScarchilli);
	        });
			markerArray.push(markerScarchilli);
            //Montorso (Vicenza) - Casearia Albiero
			markerAlbiero = new google.maps.Marker({
			    position: new google.maps.LatLng(45.494585, 11.342665),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});

			var contentStringAlbiero = '<p style="font-size:10px; margin:0; padding:0;"><strong>Casearia Albiero</strong><br />Via Ponte Cocco - 36050 Montorso (VI) Italy<br /><strong>Dettaglio Prodotti:</strong> Provolone</p>';
			var infowindowAlbiero = new google.maps.InfoWindow({
			    content: contentStringAlbiero,
			    maxWidth: 250
             });

			infowindowAlbiero.setPosition(new google.maps.LatLng(45.494585, 11.342665));


			google.maps.event.addListener(markerAlbiero, 'mouseover', function () {
                 infowindowAlbiero.open(map, markerAlbiero);
             });
             google.maps.event.addListener(markerAlbiero, 'mouseout', function () {
                 infowindowAlbiero.close(map, markerAlbiero);
             });
             markerArray.push(markerAlbiero);

			//Povolaro di Dueville - Casearia Altopiano di Asiago Spa
             markerAsiago = new google.maps.Marker({
                 position: new google.maps.LatLng(45.866926, 11.498011),
			  map: map,
			  icon: '/gfx/pointer_formaggio.png',
			  category: 'formaggio'
	        });
	        var contentStringAsiago = '<p style="font-size:10px; margin:0; padding:0;"><strong>Casearia Altopiano di Asiago SpA</strong><br />Via F. Baracca, 14 - 36012 Asiago (VI) Italy<br /><strong>Dettaglio Prodotti:</strong> Asiago a fette, Pecorino a fette</p>';
	        var infowindowAsiago = new google.maps.InfoWindow({
	            content: contentStringAsiago,
	            maxWidth: 250
	        });

	        infowindowAsiago.setPosition(new google.maps.LatLng(45.866926, 11.498011));


	        google.maps.event.addListener(markerAsiago, 'mouseover', function () {
	            infowindowAsiago.open(map, markerAsiago);
	        });
	        google.maps.event.addListener(markerAsiago, 'mouseout', function () {
	            infowindowAsiago.close(map, markerAsiago);
	        });
	        markerArray.push(markerAsiago);
			
			//Montecavolo di Quattro Castella - Parmareggio 
	        markerParmareggio = new google.maps.Marker({
			    position: new google.maps.LatLng(44.631889, 10.536741),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringParmareggio = '<p style="font-size:10px; margin:0; padding:0;"><strong>Parmareggio</strong><br />Montecavolo di Quattro Castella Italy<br /><strong>Dettaglio Prodotti:</strong> Parmigiano Reggiano</p>';
			var infowindowParmareggio = new google.maps.InfoWindow({
			    content: contentStringParmareggio,
			    maxWidth: 250
			});

			infowindowParmareggio.setPosition(new google.maps.LatLng(44.631889, 10.536741));


			google.maps.event.addListener(markerParmareggio, 'mouseover', function () {
			    infowindowParmareggio.open(map, markerParmareggio);
			});
			google.maps.event.addListener(markerParmareggio, 'mouseout', function () {
			    infowindowParmareggio.close(map, markerParmareggio);
			});
			markerArray.push(markerParmareggio);
			
			//Brianza (Monza) - Lat Bri
			markerLatbri = new google.maps.Marker({
			    position: new google.maps.LatLng(45.584006, 9.273014),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringLatbri = '<p style="font-size:10px; margin:0; padding:0;"><strong>Lat Bri</strong><br />Brianza (MB) Italy<br /><strong>Dettaglio Prodotti:</strong> Mozzarella</p>';
			var infowindowLatbri = new google.maps.InfoWindow({
			    content: contentStringLatbri,
			    maxWidth: 250
			});

			infowindowLatbri.setPosition(new google.maps.LatLng(45.584006, 9.273014));


			google.maps.event.addListener(markerLatbri, 'mouseover', function () {
			    infowindowLatbri.open(map, markerLatbri);
			});
			google.maps.event.addListener(markerLatbri, 'mouseout', function () {
			    infowindowLatbri.close(map, markerLatbri);
			});
			markerArray.push(markerLatbri);
			//Zafferana Etnea - Zappalà 
			markerZappala = new google.maps.Marker({
			    position: new google.maps.LatLng(37.690411, 15.105171),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringZappala = '<p style="font-size:10px; margin:0; padding:0;"><strong>Zappal&agrave;</strong><br />Zafferana Etnea Italy<br /><strong>Dettaglio Prodotti:</strong> Pecorino</p>';
			var infowindowZappala = new google.maps.InfoWindow({
			    content: contentStringZappala,
			    maxWidth: 250
			});

			infowindowZappala.setPosition(new google.maps.LatLng(37.690411, 15.105171));


			google.maps.event.addListener(markerZappala, 'mouseover', function () {
			    infowindowZappala.open(map, markerZappala);
			});
			google.maps.event.addListener(markerZappala, 'mouseout', function () {
			    infowindowZappala.close(map, markerZappala);
			});
			markerArray.push(markerZappala);
			
			//Heimenkirch - Hochland 
			markerHochland = new google.maps.Marker({
			    position: new google.maps.LatLng(47.6283, 9.90597),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringHochland = '<p style="font-size:10px; margin:0; padding:0;"><strong>Hochland Deutschland GmbH</strong><br />Kemptener Str., 17 - 88178 Heimenkirch Germany<br /><strong>Dettaglio Prodotti:</strong> Cheddar Shreds, Processed Cheese Emmental, Processed Cheese Cheddar</p>';
			var infowindowHochland = new google.maps.InfoWindow({
			    content: contentStringHochland,
			    maxWidth: 250
			});

			infowindowHochland.setPosition(new google.maps.LatLng(47.6283, 9.90597));


			google.maps.event.addListener(markerHochland, 'mouseover', function () {
			    infowindowHochland.open(map, markerHochland);
			});
			google.maps.event.addListener(markerHochland, 'mouseout', function () {
			    infowindowHochland.close(map, markerHochland);
			});
			markerArray.push(markerHochland);
			
			//Viladecans - Hochland Espanola 
			markerHochlandEs = new google.maps.Marker({
			    position: new google.maps.LatLng(41.31611, 2.019768),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringHochlandEs = '<p style="font-size:10px; margin:0; padding:0;"><strong>Hochland Espanola</strong><br />Viladecans<br /><strong>Dettaglio Prodotti:</strong> Formaggio</p>';
			var infowindowHochlandEs = new google.maps.InfoWindow({
			    content: contentStringHochlandEs,
			    maxWidth: 250
			});

			infowindowHochlandEs.setPosition(new google.maps.LatLng(41.31611, 2.019768));


			google.maps.event.addListener(markerHochlandEs, 'mouseover', function () {
			    infowindowHochlandEs.open(map, markerHochlandEs);
			});
			google.maps.event.addListener(markerHochlandEs, 'mouseout', function () {
			    infowindowHochlandEs.close(map, markerHochlandEs);
			});
			markerArray.push(markerHochlandEs);
			
			//Wangen, Germany - Schreiber Foods Europe GmbH 
			markerSchreiber = new google.maps.Marker({
			    position: new google.maps.LatLng(47.66749, 9.8006),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringSchreiber = '<p style="font-size:10px; margin:0; padding:0;"><strong>Schreiber Foods Europe GmbH</strong><br />Im Unteren Feld, 18 - 88239 Wangen Germany<br /><strong>Dettaglio Prodotti:</strong> Processed Cheese Food Slices with Bacon and Pepper</p>';
			var infowindowSchreibers = new google.maps.InfoWindow({
			    content: contentStringSchreiber,
			    maxWidth: 250
			});

			infowindowSchreibers.setPosition(new google.maps.LatLng(47.66749, 9.8006));


			google.maps.event.addListener(markerSchreiber, 'mouseover', function () {
			    infowindowSchreibers.open(map, markerSchreiber);
			});
			google.maps.event.addListener(markerSchreiber, 'mouseout', function () {
			    infowindowSchreibers.close(map, markerSchreiber);
			});
			markerArray.push(markerSchreiber);
			
			//Lehen 24 Germany - Alpenhain Käsespezialitäten 
			markerAlpenhain = new google.maps.Marker({
			    position: new google.maps.LatLng(48.02479, 12.11441),
			    map: map,
			    icon: '/gfx/pointer_formaggio.png',
			    category: 'formaggio'
			});
			var contentStringAlpenhain = '<p style="font-size:10px; margin:0; padding:0;"><strong>Alpenhain K&auml;sespezialit&auml;ten-Werk Gmbh&CoKG</strong><br />Lehen, 24 - D-83539 Lehen/Pfaffing<br /><strong>Dettaglio Prodotti:</strong> Brie wedges, Mozzarella sticks plain, Mini Camembert, Emmental hearts, Tomato Mozzarella balls, Cream cheese sombreros, Emmental Sneaker, Edam Bacon, Maize hearts, Feta cubes, Cream cheese sombreros, Cascaval bars , Cream cheese amigos, Bacon cheese nuggets</p>';
			var infowindowAlpenhain = new google.maps.InfoWindow({
			    content: contentStringAlpenhain,
			    maxWidth: 250
			});

			infowindowAlpenhain.setPosition(new google.maps.LatLng(48.02479, 12.11441));


			google.maps.event.addListener(markerAlpenhain, 'mouseover', function () {
			    infowindowAlpenhain.open(map, markerAlpenhain);
			});
			google.maps.event.addListener(markerAlpenhain, 'mouseout', function () {
			    infowindowAlpenhain.close(map, markerAlpenhain);
			});
			markerArray.push(markerAlpenhain);

			
			//Salumi
            //fraz. Vezzano - RECLA
			markerRecla = new google.maps.Marker({
			    position: new google.maps.LatLng(46.623812, 10.809958),
			  map: map,
			  icon: '/gfx/pointer_salumi.png',
			  category: 'salumi'
	        });
	var contentStringRecla = '<p style="font-size:10px; margin:0; padding:0;"><strong>Recla srl</strong><br />fraz. Vezzano, zona Produttiva, 2 - 39028 Silandro (BZ) Italy<br /><strong>Dettaglio Prodotti:</strong> Speck fiammiferi e120g atm</p>';
	        var infowindowRecla = new google.maps.InfoWindow({
	            content: contentStringRecla,
	            maxWidth: 250
	        });

	        infowindowRecla.setPosition(new google.maps.LatLng(46.623812, 10.809958));


	        google.maps.event.addListener(markerRecla, 'mouseover', function () {
	            infowindowRecla.open(map, markerRecla);
	        });
	        google.maps.event.addListener(markerRecla, 'mouseout', function () {
	            infowindowRecla.close(map, markerRecla);
	        });
	        markerArray.push(markerRecla);
	        //Busseto (PR)- MONTANA
			markerMontana = new google.maps.Marker({
			    position: new google.maps.LatLng(44.986673, 10.039024),
			  map: map,
			  icon: '/gfx/pointer_salumi.png',
			  category: 'salumi'
	        });
	        var contentStringMontana = '<p style="font-size:10px; margin:0; padding:0;"><strong>Montana Alimentari S.p.A. - WSI 26513</strong><br />Via Europa, 14 - Busseto (PR) Italy<br /><strong>Dettaglio Prodotti:</strong> Bacon strips RTE half slices, Sliced cooked ham, Bresaola della Valtellina I.G:P. sliced</p>';
	        var infowindowMontana = new google.maps.InfoWindow({
	            content: contentStringMontana,
	            maxWidth: 250
	        });

	        infowindowMontana.setPosition(new google.maps.LatLng(44.986673, 10.039024));


	        google.maps.event.addListener(markerMontana, 'mouseover', function () {
	            infowindowMontana.open(map, markerMontana);
	        });
	        google.maps.event.addListener(markerMontana, 'mouseout', function () {
	            infowindowMontana.close(map, markerMontana);
	        });
	        markerArray.push(markerMontana);
			// Postalesio (SO) - MONTANA
	        markerMontanaSo = new google.maps.Marker({
			    position: new google.maps.LatLng(46.161648,9.769483),
			  map: map,
			  icon: '/gfx/pointer_salumi.png',
			  category: 'salumi'
	        });
	        var contentStringMontanaSo = '<p style="font-size:10px; margin:0; padding:0;"><strong>Montana Alimentari S.p.A. - WSI 26513</strong><br />Postalesio (SO) Italy<br /><strong>Dettaglio Prodotti:</strong> Bacon strips RTE half slices, Sliced cooked ham, Bresaola della Valtellina I.G:P. sliced</p>';
	        var infowindowMontanaSo = new google.maps.InfoWindow({
	            content: contentStringMontanaSo,
	            maxWidth: 250
	        });

	        infowindowMontanaSo.setPosition(new google.maps.LatLng(45.197787, 10.577708));


	        google.maps.event.addListener(markerMontanaSo, 'mouseover', function () {
	            infowindowMontanaSo.open(map, markerMontanaSo);
	        });
	        google.maps.event.addListener(markerMontanaSo, 'mouseout', function () {
	            infowindowMontanaSo.close(map, markerMontanaSo);
	        });
	        markerArray.push(markerMontanaSo);
			//Lancashire - McCormick (UK) ltd
	        markerMcCormick2 = new google.maps.Marker({
	            position: new google.maps.LatLng(51.768477, -0.937958),
	            map: map,
	            icon: '/gfx/pointer_salumi.png',
	            category: 'salumi'
	        });
	        var contentStringMcCormick2 = '<p style="font-size:10px; margin:0; padding:0;"><strong>McCormick (UK) ltd</strong><br />Whitelees Road, Littleborough, Lancashire OL15 8BZ<br /><strong>Dettaglio Prodotti:</strong> Bacon</p>';
	        var infowindowMcCormick2 = new google.maps.InfoWindow({
	            content: contentStringMcCormick2,
	            maxWidth: 250
	        });

	        infowindowMcCormick2.setPosition(new google.maps.LatLng(41.646218, 13.212164));

	        google.maps.event.addListener(markerMcCormick2, 'mouseover', function () {
	            infowindowMcCormick2.open(map, markerMcCormick2);
	        });
	        google.maps.event.addListener(markerMcCormick2, 'mouseout', function () {
	            infowindowMcCormick2.close(map, markerMcCormick2);
	        });
	        markerArray.push(markerMcCormick2);

			//Pesce
			//Rønne - Espersen
	        markerEspersen = new google.maps.Marker({
			  position: new google.maps.LatLng(55.101017, 14.708329),
			  map: map,
			  icon: '/gfx/pointer_pesce.png',
			  category: 'pesce'
	        });
	        var contentStringEspersen = '<p style="font-size:10px; margin:0; padding:0;"><strong>A. ESPERSEN A/S</strong><br />Fiskerivej, 1 - DK-3700  Roenne<br /><strong>Dettaglio Prodotti:</strong> FILET-O-FISH</p>';
	        var infowindowEspersen = new google.maps.InfoWindow({
	            content: contentStringEspersen,
	            maxWidth: 250
	        });

	        infowindowEspersen.setPosition(new google.maps.LatLng(55.101017, 14.708329));

	        google.maps.event.addListener(markerEspersen, 'mouseover', function () {
	            infowindowEspersen.open(map, markerEspersen);
	        });
	        google.maps.event.addListener(markerEspersen, 'mouseout', function () {
	            infowindowEspersen.close(map, markerEspersen);
	        });
	        markerArray.push(markerEspersen);
			
			//Vienna - Yuu´n Mee (+ Thailandia nella parte statica)
			markerYuu = new google.maps.Marker({
			  position: new google.maps.LatLng(48.2153, 16.385378),
			  map: map,
			  icon: '/gfx/pointer_pesce.png',
			  category: 'pesce'
	        });
	        var contentStringYuu = '<p style="font-size:10px; margin:0; padding:0;"><strong>Yuu\'n Mee</strong><br />Praterstrasse, 38/1/2.1 - 1020 Vienna Austria<br /><strong>Dettaglio Prodotti:</strong> Shrimps breaded 18-22 gms p pcs</p>';
	        var infowindowYuu = new google.maps.InfoWindow({
	            content: contentStringYuu,
	            maxWidth: 250
	        });

	        infowindowEspersen.setPosition(new google.maps.LatLng(48.2153, 16.385378));

	        google.maps.event.addListener(markerYuu, 'mouseover', function () {
	            infowindowYuu.open(map, markerYuu);
	        });
	        google.maps.event.addListener(markerYuu, 'mouseout', function () {
	            infowindowYuu.close(map, markerYuu);
	        });
	        markerArray.push(markerYuu);
		}
		
		//Run
		createMarkers();
		bindClickEvent();
	}
}
/* END GOOGLE MAPS FORNITORI */




