
	function precaricaimmagini(){
		if (document.images){
			var filediimmagini = precaricaimmagini.arguments;
			var matriceprecaricate = new Array();
			for (var i=0; i<filediimmagini.length; i++){
				matriceprecaricate[i] = new Image;
				matriceprecaricate[i].src = filediimmagini[i];
			}
		}
	}

	function show(id) {
		ns4 = (document.layers)? true:false
		ie4 = (document.all)? true:false
        if (ns4) 
				document.layers[id].visibility = "show"
	        else 
				if (ie4) 
					document.all[id].style.visibility = "visible"
	}

	function hide(id) {
        if (ns4) 
				document.layers[id].visibility = "hide"
	        else 
				if (ie4) 
					document.all[id].style.visibility = "hidden"
	}



	function updateOpener() {
	    window.opener.document.form1.nickname.value = document.Logon.nickname.value;
	    window.opener.document.form1.password.value = document.Logon.password.value;
	    window.opener.document.form1.submit();
		window.close();
	} 
	

	function cod_fiscale(){
		var cf_length=document.attivazione.cod_fisc.value.length;
		if (cf_length != 16){
			alert("Il codice fiscale è inesatto\nDeve essere composto da 16 caratteri!");
	        document.attivazione.cod_fisc.focus(); 
	        return true; 
		}
		document.attivazione.submit() 
	} 

	function controlla(){
		var lunghezza=document.mod_pass.password_new.value.length;
		if (lunghezza==0){
			alert("La password vuota non è valida!");
			document.mod_pass.password_new.focus(); 
	        document.mod_pass.password_new.select(); 
	        return true; 
		}
	
		var cf_length=document.mod_pass.password_new.value;
		var cf_length1=document.mod_pass.password_new2.value;
		if (cf_length != cf_length1){
			alert("Hai scritto due password diverse!");
	        document.mod_pass.password_new.focus(); 
	        document.mod_pass.password_new.select(); 
	        return true; 
		}
	
		      document.mod_pass.submit() 
	 } 


	function win_resize(what,img_width,img_height){
		var screen_width=window.screen.width;
		var screen_height=window.screen.height;
		var winame='Immagine_prodotto';
		var where_witdth=(screen_width-img_width) / 2;
		var where_height=(screen_height-img_height) / 2;
		how='scrollbars=1,toolbar=0,width='+img_width+',height='+img_height+',top='+where_height+',left='+where_witdth+',alwaysRaised=1,dependent=1';
		window.open(what,winame,how);
	}	
	
	

//sniffer browser

var brN4=document.layers?true:false;
var brIE=document.all?true:false;
var brMz=document.getElementById?true:false;
var brOp=window.opera?true:false;

//scambia immagine
//lang = lingua (it, en, de, fr...)
//id = id immagine (deve essere uguale al nome)

function on(root,lang,id){
document.images[id].src=root+'img/'+lang+'/on_'+id+'.gif'
return true;
}

function off(root,lang,id){
document.images[id].src=root+'img/'+lang+'/'+id+'.gif'
return true;
}


//sposta layer nella posizione corretta

function mL(nome)
{
 	if (brN4||brMz)
		var scrx = window.innerWidth;
	if (brIE)
		var scrx = document.body.clientWidth;

	var basex = 234;		
	var sw = 770 //larghezza della pagina		

		scrx=scrx<=sw?sw:scrx;

	layerleft = parseInt(basex+(.5*(parseInt(scrx)-sw)))+'px'; //unità misura inserita per compatibilità con Mozilla.
	
			layerObj=brN4?document.layers[nome]:brIE?document.all[nome].style:document.getElementById(nome).style;
			layerObj.left = layerleft ;
}

function load_prov() {
	document.regsoc.action.value='load_prov';	
	document.regsoc.submit();
}