function normalizeCampo(campo){
        document.getElementById(campo).style.border = "1px solid #ddd";
        document.getElementById(campo).style.borderTop = "1px solid #999";
        document.getElementById(campo).style.borderLeft = "1px solid #999";
}

function conferma_elimina(url){
	if(confirm("Conferma eliminazione documento!")){
		window.document.location.href=url;
  }
}

function conferma_eliminaCli(url){
	if(confirm("Conferma eliminazione Cliente!")){
		window.document.location.href=url;
  }
}

var myPopup;
function popup(url,h,w){
 if (popup.arguments[1]){
 	myWidth=popup.arguments[1];
 }
 else
  myWidth=w;
 if (popup.arguments[2]){
  myHeight=popup.arguments[2];
 }
 else
  myHeight=h;
	if(screen.width > myWidth){
    myLeft=(screen.width-myWidth)/2;
 }
 if(screen.height > myHeight){
    myTop=(screen.height-myHeight)/2;
 }
 if(myPopup){
    myPopup.close();
 }
 myPopup=window.open(url,'myWin','toolbar=no,status=no,resizable=yes,menubar=no,scrollbars=no,width='+myWidth+',height='+myHeight+',top='+myTop+',left='+myLeft+'');
 myPopup.focus();
 return myPopup;
}
function nascondiCliente(){
	if(document.getElementById('tipo').value=="circolareCliente"){
		document.getElementById('nCircolare').style.visibility="hidden";
		document.getElementById('nCircolare').style.display="none";
		document.getElementById('cliente').style.visibility="visible";
		document.getElementById('cliente').style.display="block";
	}else if(document.getElementById('tipo').value=="circolarePubblica"){
		document.getElementById('cliente').style.visibility="hidden";
		document.getElementById('cliente').style.display="none";
		document.getElementById('nCircolare').style.visibility="visible";
		document.getElementById('nCircolare').style.display="block";
	}
	
	else{
		document.getElementById('cliente').style.visibility="hidden";
		document.getElementById('cliente').style.display="none";
		document.getElementById('nCircolare').style.visibility="hidden";
		document.getElementById('nCircolare').style.display="none";
	}
}

function initArray() {  // Thanks JavaScript Mailing List for this function
	this.length = initArray.arguments.length
	for (var i = 0; i < this.length; i++)
	this[i+1] = initArray.arguments[i]
}

var JourArray = new initArray("Domenica","Luned&igrave;","Marted&igrave;","Mercoled&igrave;","Gioved&igrave;","Venerd&igrave;","Sabato");

 var MoisArray = new initArray("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");

 var DateJour = new Date();
 
 var an = DateJour.getYear();
 
 if (an < 1900) {
 	an = an + 1900;
 }

function Calendariodelgiorno() {

   var PictArray = new initArray("Dimanche.gif","Lundi.gif","Mardi.gif","Mercredi.gif",

                                "Jeudi.gif","Vendredi.gif","Samedi.gif");

   //document.write("<TABLE WIDTH=100 HEIGHT=85 CELLPADDING=0 CELLSPACING=0><TR><TH BACKGROUND=" + PictArray[(DateJour.getDay()+1)] + "><FONT FACE='verdana' SIZE=1>" + JourArray[(DateJour.getDay()+1)] + "</FONT><BR><FONT FACE='verdana' SIZE=4 COLOR=#FF6600>" + DateJour.getDate() + "</FONT><BR><FONT FACE='verdana' SIZE=1>" + MoisArray[(DateJour.getMonth()+1)] + " " + an + "</FONT></TH></TR></TABLE>");
	document.write("<table align=\"center\" style=\"text-align: center\" cellpadding=\"5\"><tr><td style=\"font-size: 12px; font-family: verdana\">" + JourArray[(DateJour.getDay()+1)] + "<br><span style=\"color: #ff6600; font-size: 16px\">" + DateJour.getDate() + "</span><br>" + MoisArray[(DateJour.getMonth()+1)] + " " + an + "</td></tr></table>");
	
}

function DateduJour() {

   // cr�e par Philippe PETIT le 07/05/97
   // d'autres sources sont disponible sur
   // http://ourworld.compuserve.com/homepages/lucpetitic

   document.write(JourArray[(DateJour.getDay()+1)]," ",DateJour.getDate()," ");

   document.write(MoisArray[(DateJour.getMonth()+1)]," ");

   document.write(an);

}
