// JavaScript Document
function inviaID(id) {
	top.frames["frameNascosto"].location = "dettaglioNews.php?ID="+id;
}
function inviaIDEvidenza(id) {
	top.frames["frameNascosto"].location = "dettaglioEvidenza.php?ID="+id;
}
function inviaIDProdotto(id,id2) {
	top.frames["frameNascosto"].location = "dettaglioProdotto.php?ID="+id+"&IDCATEGORIA="+id2;
}
function visualizza(sTesto,idDiv) {
	var divTesto = document.getElementById(idDiv);
	divTesto.innerHTML = sTesto;
}
function inviaIDdescrizione(id) {
	top.frames["frameNascosto"].location = "descrizioneBreve.php?ID="+id;
}
function inviaMail() {
	top.frames["frameNascosto"].location = "progettazione.php?mail=ok";
}
function openPop(url,nome,tag) {
	window.open(url,nome,tag);
}

var mouseX = 0;
var mouseY = 0;
if (document.layers) 
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getCursor; 
function getCursor(e) {
if (document.layers) {
mouseX = e.pageX;
mouseY = e.pageY;
}
if (document.all) {
mouseX = event.clientX + document.body.scrollLeft;
mouseY = event.clientY + document.body.scrollTop;
}
return true;
}
function showToolTip(name) {
var tip = getHandle(name);
if (tip.timerID)
clearTimeout(tip.timerID);
tip.left = mouseX;
tip.top = mouseY + 20;
if (document.layers)
tip.visibility = "show";
if (document.all)
tip.visibility = "visible";
tip.timerID = setTimeout("hideToolTip('" + name + "')", 20000);
}
function hideToolTip(name) {
var tip = getHandle(name);
if (tip.timerID)
clearTimeout(tip.timerID);
if (document.layers)
tip.visibility = "hide";
if (document.all)
tip.visibility = "hidden";
}
function getHandle(name) {
if (document.layers)
return(document.layers[name]);
if (document.all) {
var block = eval('document.all.' + name + '.style');
return(block);
}
}
function controllaCampi() {
var numeroForm = controllaCampi.arguments[0];
var form = window.document.forms[numeroForm];
for(var i=1; i<arguments.length;i++) {
	var nome = controllaCampi.arguments[i];
	if(nome=="c25") {
		if(!form.elements[nome].checked){
			alert("Il sistema non rileva la selezione del campo 'Autorizzo il trattamento dei dati personali'");
			return false;
			} 
		} else {
			if(form.elements[nome].value==""){
				form.elements[nome].focus();
				alert('I campi contrassegnati * sono obbligatori');
				return false;
			}  else if(nome=="c6") {
if(form.elements[nome].value.indexOf("@")==-1 || form.elements[nome].value.indexOf(".")==-1){
			alert("Il sistema nel campo 'email' é abbilitato per ricevere solo indirizzo e-mail.");
			return false;
			}			}
		}
	}	
}
