<!--

var virtualpath = "/a1";

//**************************************************************
// apre in una finestra il file ModifyFile per la creazione e la modifica di
// file testo
// Importante valorizzare la variabile/vairabili virtualpath anche per JavaScript

function openDoc(myvar)
	{
//	alert(myvar)
	ShowWin(virtualpath +  "/admin/gestionefile/ModifyFile.php?" + myvar)
	}



function test() {
alert("WORKS?")
return false;
}

// MM 19 nov 2003
function UpdateCounter(pNomeForm,Campo,Counter,maxInput){
	

			var frm = pNomeForm;
		var frmCampo = pNomeForm(Campo);
		if (frmCampo.value.length > maxInput){
		frmCampo.value= frmCampo.value.substring(0,maxInput);
			Disp = 0;
		}
		else{
			Disp = maxInput - frmCampo.value.length;
		}
		frm(Counter).value = Disp;
	}




function changeSrc(myurl){
alert(myurl)
//var a = document.myform.st.value;
//document.getElementById("myIframe").src=myurl;
document.location.href=myurl;
return false;
}
function linkoff(){
	return false;
}


//document.write ("navigation included");
//alert(document.NavForm.LI.value)

function NavForm(URL){
document.all.datastato.action = URL;
// Invio form personal data
document.all.datastato.submit();
}



function ShowWin(url)
{
//alert(url)
	f=url;
	w=(screen.width-(screen.width/2))/2;
	h=(screen.height-(screen.height/2))/2;
	fin=window.open(f,"nomefin","toolbar=0, location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=720,height=600,screenX=w,screenY=h");
}


function ShowWinSmall(url)
{
	f=url;
	w=(screen.width-(screen.width/2))/2;
	h=(screen.height-(screen.height/2))/2;
	fin=window.open(f,"pippo","toolbar=0, location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=200,height=100,screenX=w,screenY=h");
}


function ShowWinSmall2(url)
{
	f=url;
	w=(screen.width-(screen.width/2))/2;
	h=(screen.height-(screen.height/2))/2;
	fin=window.open(f,"pippo","toolbar=0, location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=200,height=200,screenX=w,screenY=h");
}


// 2004-10-11

function textCounter(field,counter,maxlimit,linecounter) {
	
	var fieldWidth =  parseInt(field.style.width);
	var charcnt = field.value.length;        
	// trim the extra text
	
	if (charcnt > maxlimit) { 
		field.value = field.value.substring(0, maxlimit);
	}else { 

	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";

	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"background-color");

	}

}

function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}

function openBigPicture(url) 
{ 
//alert(url)
U=url; 
w=(screen.width-(screen.width/2))/2; 
h=(screen.height-(screen.height/2))/2; 
//finestra=window.open(U,"nomefin","toolbar=0, location=no,directories=0,status=0,menubar=0,scrollbars=0, resizable=0,copyhistory=0,width=720,height=354, screenX=w,screenY=h"); 
var load = window.open(U,'mappa','scrollbars=no,menubar=no,height=640,width=640,resizable=yes,toolbar=no,location=no,status=no');
} 
function visualizzaDiv() {
//document.getElementById(idiv).style.visibility='visible';
//alert(document.getElementById("contatti_conta").value)
vcontatti_conta=document.getElementById("contatti_conta").value;
if (vcontatti_conta==1){ 
// get the div element
d = document.getElementById('smallMap');
// set the width
d.style.width="720px";
d.style.height="354px";
document.getElementById("smallMap" ).style.backgroundImage =  "url(images/mappa_ingrosso_giovannini_2.gif)"; 
document.getElementById("smallMap" ).title="Click per ridurre";  
document.getElementById("contatti_conta").value=2;
}
if (vcontatti_conta==2){ 
d.style.width="424px";
d.style.height="337px";
document.getElementById("smallMap" ).style.backgroundImage =  "url(images/mappa_ingrosso_giovannini_small.png)"; 
document.getElementById("smallMap" ).title="Click per ingrandire";
document.getElementById("contatti_conta").value=1;

}
}


//-->
