var JSjquery		= "http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js";
var JSjquery_easy	= "http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js";
/*var JSscrollTo		= "/lib/plugin/jquery.scrollTo-min.js";
var JSlocalScroll	= "/lib/plugin/jquery.localscroll-min.js";
var JSserialScroll	= "/lib/plugin/jquery.serialScroll-min.js";
var JScodaslider	= "/lib/plugin/coda-slider/coda-slider.js";*/
var JSFB			= "http://connect.facebook.net/"+lang+"_"+country.toUpperCase()+"/all.js#xfbml=1";
//var JSPO			= "https://apis.google.com/js/plusone.js";

yepnope({
	load: [JSjquery, JSjquery_easy, JSFB],
	callback : function(url, result, key) {
		//console.info(url, result, key);
		window.scrollTo(0, 1);
		switch (key) {
			case "0": $('#PP').click(function() {getPN();}); showSubMenu(); break;
			case "1": $(".new_window").attr({target: "_blank", rel: "nofollow"}); break;
			//case "2": yepnope(JSlocalScroll); yepnope(JSserialScroll); yepnope(JScodaslider); break;
		}
	}
});

//$(document).ready(function() {
function showSubMenu() {
	$("#menu li ul").hide(); 
	$("#menu li").hover(
		function () {$(this).children("ul").slideDown("slow");},
        function () {$(this).children("ul").slideUp();}
	);
}
//});

/**
 * mostra i recapiti per il preventivo personalizzato
 */
function getPN() {
	$('#PP_testo').slideToggle('slow', function() {
		$('#PP_numero').slideToggle('slow');
	});
}

function printMail(nome, dominio, testo) {
	document.write('<a href=\"mailto:' + nome + '@' + dominio + '\">');
	if (testo=='') {document.write(nome + '@' + dominio)}
	else {document.write(testo)};
	document.write('</a>')
}

if (!MY_DEBUG) {
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3248724-30']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
}

