
function hideObject(Selez){
	divSel = document.getElementById(Selez);
	divSel.innerHTML='';
	divSel.style.display='none';
}

function cambiaColore(Selez){
	document.getElementById(Selez).className="cambiaColore";
}

function ripColore(Selez){
	document.getElementById(Selez).className="bg_campi";
}

function hoverDiv(target){
	document.getElementById(target).className="titPannHover";
}

function outDiv(target){
	document.getElementById(target).className="titPann";
}

function hoverDivB(target){
	document.getElementById(target).className="DivPannColl";
}

function outDivB(target){
	document.getElementById(target).className="artPann";
}

function hoverDivC(target){
	document.getElementById(target).className="ConCat1B";
}

function outDivC(target){
	document.getElementById(target).className="ConCat1";
}

function apriForm(){
	var divSelA = document.getElementById('formCommenti');
	var divSelC = document.getElementById('CloseForm');

	if(divSelA.style.display=='none'){

		divSelA.style.display='block';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriForm()"><strong>Inserisci Commento</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriForm()"><img src="../images/chiudiDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}else{

		divSelA.style.display='none';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriForm()"><strong>Inserisci Commento</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriForm()"><img src="../images/apriDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}


}


function apriBotta(){
	var divSelA = document.getElementById('formCommenti');
	var divSelC = document.getElementById('CloseForm');

	if(divSelA.style.display=='none'){

		divSelA.style.display='block';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriBotta()"><strong>Inserisci Quesito</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriBotta()"><img src="images/chiudiDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}else{

		divSelA.style.display='none';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriBotta()"><strong>Inserisci Quesito</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriBotta()"><img src="images/apriDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}


}


function apriRisposta(){
	var divSelA = document.getElementById('formCommenti');
	var divSelC = document.getElementById('CloseForm');

	if(divSelA.style.display=='none'){

		divSelA.style.display='block';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriRisposta()"><strong>Inserisci Risposta</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriRisposta()"><img src="images/chiudiDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}else{

		divSelA.style.display='none';
		divSelC.innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="23%"><div align="left"><a href="javascript:void(0)" onclick="apriRisposta()"><strong>Inserisci Risposta</strong></a></div></td><td width="72%"><hr align="center" size="2" style="color:#E0E0E0"/></td><td width="1%"><div align="right"><a href="javascript:void(0)" onclick="apriRisposta()"><img src="images/apriDiv.gif" alt="Apri form" border="0"/></a></div></td></tr></table>';

	}


}

//  Controlli  //
function controlloMAIL(){

	var nomecont = document.getElementById('nome_cont').value;
	var email = document.getElementById('email').value;
	var testoTXT = document.getElementById('testoTXT').value;

	if(nomecont==''||email==''||testoTXT==''){

		alert('I campi con l\' asterisco (*) sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function controlloCOLLABORA(){

	var nomecont = document.getElementById('nome_cont').value;
	var cognome  = document.getElementById('cognome').value;
	var nick     = document.getElementById('nick').value;
	var email    = document.getElementById('email').value;
	var testoTXT = document.getElementById('testoTXT').value;

	if(nomecont==''||cognome==''||testoTXT==''){

		alert('I campi con l\' asterisco (*) sono obbligatori');
		return false
		
	}

}

// Popup curriclulum
function curriculum(ID){
	open('curriculum.php?id='+ID,'','width=600, height=400, resizable=no, status=no, scrollbars=yes, location=no')
}


function apriArticolo(ID){
	open('anteprima_articolo.php?id='+ID,'','width=800, height=600, resizable=no, status=no, scrollbars=yes, location=no')
}


function contatta(ID){
	open('contatta.php?id='+ID,'','width=400, height=400, resizable=no, status=no, scrollbars=yes, location=no')
}

function caricaFile(){
	open('../upload/index.php','','width=400, height=400, resizable=no, status=no, scrollbars=yes, location=no')
}

function conferma(){
	risposta = confirm("Se hai scelto di NON pubblicare questo articolo, verrą eliminato!\nProcedere?");

	if(risposta){
		return true;
	}else{
		return false;
	}
}

function confermaDEL(){
	risposta = confirm("Confermi l'eliminazione Utente?");

	if(risposta){
		return true;
	}else{
		return false;
	}
}
//  Controlli  //
function controlloLOGIN(){

	var nome = document.getElementById('ulogin').value;
	var pass = document.getElementById('upass').value;

	if(nome==''||pass==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function controlloLOGINbis(){

	var nome = document.getElementById('ulogin2').value;
	var pass = document.getElementById('upass2').value;

	if(nome==''||pass==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function controlloNL(){

	var email = document.getElementById('newsmail').value;

	if(email==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function controlloSEGNALA(){

	var emailss = document.getElementById('emailss').value;

	if(emailss==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //

function controlloISCRIZIONE(){

	function trim(stringa){
	while (stringa.substring(0,1) == ' '){        
		stringa = stringa.substring(1, stringa.length);    
		}   
	while (stringa.substring(stringa.length-1, stringa.length) == ' '){
		stringa = stringa.substring(0,stringa.length-1);    
		}    
		return stringa;
}

var username		= trim(document.getElementById('username2').value);
var passwordN		= trim(document.getElementById('passwordN').value);
var passwordR		= trim(document.getElementById('passwordR').value);
var nomeOr			= trim(document.getElementById('nomeOr').value);
var cognome			= trim(document.getElementById('cognome').value);
var email			= trim(document.getElementById('email').value);
var nascita			= trim(document.getElementById('nascita').value);
var provincia		= trim(document.getElementById('provincia').value);
var nazione			= trim(document.getElementById('nazione').value);
var residenza		= trim(document.getElementById('residenza').value);
var cellulare		= trim(document.getElementById('cellulare').value);
var fisso			= trim(document.getElementById('fisso').value);
var curriculum		= trim(document.getElementById('curriculum').value);
var motivo			= trim(document.getElementById('motivo').value);

	if(username=='' || passwordN=='' || passwordR=='' || nomeOr=='' || cognome=='' || email=='' || nascita=='' || provincia=='' || nazione=='' || residenza=='' || cellulare=='' || fisso=='' || curriculum=='' || motivo==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function contIns(){

	var InsCommText = document.getElementById('InsCommText').value;
	var codcaptcha  = document.getElementById('codcaptcha').value;

	if(InsCommText==''||codcaptcha==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}

//  Controlli  //
function contForum(){

	var InsCommText = document.getElementById('titolo').value;
	var codcaptcha  = document.getElementById('comm').value;

	if(InsCommText==''||codcaptcha==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}

//  Controlli  //
function contRisp(){

	var codcaptcha  = document.getElementById('comm').value;

	if(codcaptcha==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}

//  Controlli  //
function contCONTATTI(){

	var InsCommText = document.getElementById('InsCommText').value;
	var codcaptcha  = document.getElementById('codcaptcha').value;

	if(InsCommText==''||codcaptcha==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}
//  Controlli  //
function controlloRECUPERO(){

	var recpass = document.getElementById('recpass').value;

	if(recpass==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}

// CONTOLLO ARTICOLI
function controlloINSART(){

	var ctitolo    = document.getElementById('ctitolo').value;
	var ccategoria = document.getElementById('ccategoria').value;
	var elm3       = document.getElementById('elm3').value;

	if(ctitolo==''||ccategoria==''||elm3==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}

//  Controlli  //
function controlloSEARCH(){

	var valore = document.getElementById('cerca').value;

	if(valore==''){

		alert('Tutti i campi sono obbligatori');
		return false
		
	}

}