function OpenWin (Url,Nome,Parametri)
{
	NewWin = null
	NewWin = open(Url, Nome, Parametri)
	NewWin.focus()
}
function OpenWinAdmin (Url,Nome,Parametri)
{
	NewWin = null
	NewWin = open(Url,Nome,Parametri)
	NewWin.moveTo(screen.availWidth/100*30,0)
	NewWin.resizeTo(screen.availWidth/100*70,screen.availHeight)
	NewWin.focus()
}
function OpenWinAgeAttReg(Par)
{
	OpenWin('/Agenti/Attivita/AttivitaRegistra.asp?' + Par,'AttivitaRegistra','width=600,left=20,top=20,height=500,toolbar=no,directories=no,location=no,status=no,statusbar=no,resizable=0,menubar=no,scrollbars=yes')
}
function OpenWinAgeAtt()
{
	OpenWin('/Agenti/Attivita/Attivita.asp','AttivitaAgente','width=750,left=0,top=0,height=screen.availHeight,toolbar=no,directories=no,location=no,status=no,statusbar=no,resizable=1,menubar=no,scrollbars=yes')
}
function FinestraConferma(Testo)
{
	Risp = confirm(Testo)
	return Risp
}

function InviaForm(NomeForm, ParametriAgg)
{
	NomeForm.action = NomeForm.action + ParametriAgg
	NomeForm.submit()
}

function CtrlDivFromBox (BoxValue)
{
	if (BoxValue == 0)
		return ('none')
	else
		return ('')
}
function RidWinImg(NomeImg, LargAgg, AltAgg)
{
	var oImg = document.all[NomeImg];
	var w, h;
	if (oImg.width+30 > window.screen.width)
		w = window.screen.width;
	else
		w = oImg.width+LargAgg;
	if (oImg.height+40 > window.screen.height)
		h = window.screen.height;
	else
		h = oImg.height+AltAgg;
	window.resizeTo(w,h);
//			window.moveTo((window.screen.width-w)/2,(window.screen.height-h)/2);					
}
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1


function doOutline(e) {
	var targetId, srcElement, targetElement;
	srcElement=ns6? e.target : event.srcElement
//	srcElement = window.event.srcElement;
	if (srcElement.className == "Outline"||srcElement.className == "Outline2") {
		srcElement = srcElement.id
		srcElement = srcElement.substr(0, srcElement.length-1);
		targetId = srcElement + "s";
		srcElement = srcElement + "i";
		srcElement = document.getElementById(srcElement);
		targetElement = document.getElementById(targetId);
		if (srcElement != null) {
			var NuovaImmagine = srcElement.src
			if (targetElement.style.display == "none") {
				targetElement.style.display = "";
				srcElement.src = NuovaImmagine.replace("Chiuso", "Aperto");
			} else {
				targetElement.style.display = "none";
				srcElement.src = NuovaImmagine.replace("Aperto", "Chiuso");
			}
		}
	}
}

document.onclick = doOutline;

// Captcha
function myLayer (x){
//individuo l'oggetto
if(document.layers){ // browser="NN4"; 
lay=document.layers[x];
} 
if(document.all){ // browser="IE"; 
lay=eval("document.all." + x);
} 
if(!document.all && document.getElementById){ // browser="NN6+ or IE5+ if you're willing to dump the !document.all stuff"; 
lay=document.getElementById(x);
}
return lay;
}
function fnCaptcha(){
var numero=Math.random()*7*666;
var numero=Math.floor(numero);

myLayer("captchaNumber").innerHTML = numero;

document.FrmFeedback.captchaHidden.value = numero;
}
// fine CAPTCHA

