Img = new Array(); 
function Preload(){
	for (var i=0; i<Preload.arguments.length; i++){
		Img[i]=new Image; 
		Img[i].src=Preload.arguments[i];
	}
}
Preload('img/bottoni/chisiamo_of.gif', 'img/bottoni/chisiamo_on.gif',
		'img/bottoni/dovesiamo_of.gif', 'img/bottoni/dovesiamo_on.gif',
		'img/bottoni/partners_of.gif', 'img/bottoni/partners_on.gif',
		'img/bottoni/prodotti_of.gif', 'img/bottoni/prodotti_on.gif',
		'img/bottoni/servizi_of.gif', 'img/bottoni/servizi_on.gif',
		'img/bottoni/foto_of.gif', 'img/bottoni/foto_on.gif',
		'img/photo/sanita_of.gif', 'img/photo/sanita_on.gif',
		'img/photo/sportivi_of.gif', 'img/photo/sportivi_on.gif',
		'img/photo/civili_of.gif', 'img/photo/civili_on.gif',
		'img/photo/comunita_of.gif', 'img/photo/comunita_on.gif',
		'img/photo/shop_of.gif', 'img/photo/shop_on.gif',
		'img/photo/industria_of.gif', 'img/photo/industria_on.gif');
/*---------------------------------------------------------------------------------------------*/

// Script associato alla funzione dettagli
function dettagli_prodotto(para){
	if (para == 'linoleum'){
		Crea_finestra('dettagli.php?tp='+para,'linoleum','top=10,left=10,width=540,height=395');
	}else if (para == 'laminato'){
		Crea_finestra('dettagli.php?tp='+para,'laminato','top=10,left=10,width=540,height=395');
	}else if (para == 'pvc'){
		Crea_finestra('dettagli.php?tp='+para,'pvc','top=10,left=10,width=540,height=395');
	}
}
/*---------------------------------------------------------------------------------------------*/

// Script ai comandi menu su testa
function load_menu(para)
{
	if(para == 1){
		parent.frames[1].location.reload('testa.php?m=1');
		parent.frames[2].location.reload('chisiamo.php');
	}else if (para == 2){
		parent.frames[1].location.reload('testa.php?m=2');
		parent.frames[2].location.reload('prodotti.php');
	}else if (para == 3){
		parent.frames[1].location.reload('testa.php?m=3');
		parent.frames[2].location.reload('servizi.php');
	}else if (para == 4){
		parent.frames[1].location.reload('testa.php?m=4');
		parent.frames[2].location.reload('photo.php');
	}else if (para == 5){
		parent.frames[1].location.reload('testa.php?m=5');
		parent.frames[2].location.reload('partners.php');
	}
}
/*---------------------------------------------------------------------------------------------*/

// Script generici di gestione delle window
//gestisce apertura di una nuova window e relativo focus
function Crea_finestra(url,winName,features) 
{
	var nw = window.open(url,winName,features + ',toolbar=0,directories=0,location=0,statusbar=0');
	nw.focus();
}
/*****************************************************************************************************************************/

// gestisce chiusura con reload della window padre tramite parameto aggiorna
function termina(aggiorna){  
	window.close();
	if(aggiorna == "aggiorna"){
		window.opener.location.reload(true);
	}
	window.opener.focus();
}
/******************************************************************************************************************************/

// controllo che nella textarea non vengano inseriti pił char di quelli definiti in maxchars
function CheckLength()
	{
	// definisco il numero max di caratteri inseribili nella textarea del commento
	var maxchars=255;
	with (document.guestbook)
		{
		chars=message.value
		if (chars.length > maxchars)
			{
			message.value=chars.substr(0,maxchars);
			message.blur();
			}
		chr.value=maxchars-message.value.length;
		}
	}
/******************************************************************************************************************************/

