var domain ='';
var domainRef ='';
function init(d, dr) {
	domain = d;
	domainRef = dr;
	$(document).ready(function(){
		// fix breadcrumbs
		$("#breadcrumbs li:last").removeAttr('class');
		$("#breadcrumbs li").each(function(){
			if ($(this).attr('class')) {
				$(this).find(".breadcrumb-title").wrapInner('<a href="'+$(this).attr('class')+'"></a>');
			}
		});
		
		$("ul.sf-menu").supersubs({ 
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    40,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        });
		$("ul.sf-menu").superfish();

	// fix forms
		$(".siteForm").attr("rel", d+$(".siteForm").attr("name"));
		
		stripeTable();
	});
}
jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++) {
    jQuery("<img>").attr("src", domainRef+arguments[i]);
  }
}
function stripeTable() {
	// works backwards because the index of the first row is 0. :) nice
	$("table.stripe tr:even").addClass("odd");
	$("table.stripe tr:odd").addClass("even");
}

$(function(){
        $(".navMenu").buildMenu({
          template:"menuVoices.html",
          additionalData:"pippo=1",
          menuWidth:180,
          openOnRight:false,
          menuSelector: ".menuContainer",
          iconPath:"images/layout/",
          hasImages:false,
          fadeInTime:300,
          fadeOutTime:100,
          minZindex:"auto",
          opacity:.95,
          shadow:false,
          openOnClick:false,
          closeOnMouseOut:true,
          closeAfter:200
        });
    });

function toggleLayer(whichLayer, iState) 
	{
  		if (document.getElementById) 
			{
   				var style2 = document.getElementById(whichLayer).style
				style2.display =iState ? '' : 'none'
 		 	}
	}
	
