imgLoaded =  false;

function images_preloading() {
	if (document.images) {
		imagesPath = "buttons/";

		home_off = new Image();
		home_off.src = imagesPath + "home0.jpg";
		home_on = new Image();
		home_on.src = imagesPath + "home1.jpg";

		associazione_off= new Image();
		associazione_off.src = imagesPath + "associazione0.jpg";
		associazione_on = new Image();
		associazione_on.src = imagesPath + "associazione1.jpg";
		
		banditi_off= new Image();
		banditi_off.src = imagesPath + "banditi0.jpg";
		banditi_on = new Image();
		banditi_on.src = imagesPath + "banditi1.jpg";

		contatti_off= new Image();
		contatti_off.src = imagesPath + "contatti0.jpg";
		contatti_on = new Image();
		contatti_on.src = imagesPath + "contatti1.jpg";

		scrivici_off= new Image();
		scrivici_off.src = imagesPath + "scrivici0.jpg";
		scrivici_on = new Image();	
		scrivici_on.src = imagesPath + "scrivici1.jpg";

		gallery_off= new Image();
		gallery_off.src = imagesPath + "gallery0.jpg";
		gallery_on = new Image();
		gallery_on.src = imagesPath + "gallery1.jpg";

		eventi_off= new Image();
		eventi_off.src = imagesPath + "eventi0.jpg";
		eventi_on = new Image();
		eventi_on.src = imagesPath + "eventi1.jpg";

		guest_off= new Image();
		guest_off.src = imagesPath + "guest0.jpg";
		guest_on = new Image();
		guest_on.src = imagesPath + "guest1.jpg";

		chat_off= new Image();
		chat_off.src = imagesPath + "chat0.jpg";
		chat_on = new Image();
		chat_on.src = imagesPath + "chat1.jpg";

		forum_off= new Image();
		forum_off.src = imagesPath + "forum0.jpg";
		forum_on = new Image();
		forum_on.src = imagesPath + "forum1.jpg";

		bvilla_off= new Image();
		bvilla_off.src = imagesPath + "bvilla0.jpg";
		bvilla_on = new Image();
		bvilla_on.src = imagesPath + "bvilla1.jpg";

		soci_off= new Image();
		soci_off.src = imagesPath + "soci0.jpg";
		soci_on = new Image();
		soci_on.src = imagesPath + "soci1.jpg";

		lm_off= new Image();
		lm_off.src = imagesPath + "lm0.jpg";
		lm_on = new Image();
		lm_on.src = imagesPath + "lm1.jpg";


		al_off= new Image();
		al_off.src = imagesPath + "al0.jpg";
		al_on = new Image();
		al_on.src = imagesPath + "al1.jpg";





		imgLoaded = true;
		return true;
	}
}

function MM_preloadImages() { //v3.0
	var d=document;
	if(d.images) {
		if(! d.MM_p) d.MM_p=new Array();
		var i, j=d.MM_p.length, a=MM_preloadImages.arguments;
		for (i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0) { d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; }
	}
}

//Enter path of images to be preloaded inside parenthesis. Extend list as desired.
//onLoad="MM_preloadImages('YourImage.gif','...')"


function imgOn(imgName) {
	if (document.images && imgLoaded) {
		document[imgName].src = eval(imgName + "_on.src");
		return true;
	}
}

function imgOff(imgName) {
	if (document.images && imgLoaded) {
		document[imgName].src = eval(imgName + "_off.src");
		return true;
	}
}
