	var myfont_face = "Georgia";	var myfont_size = "10";	var myfont_color = "#000000";
	var myback_color = "";	var mypre_text = "";	var mywidth = 300;	
	var my12_hour = 0;	var myupdate = 1;	
	var DisplayDate = 1;

        var ie4=document.all
        var ns4=document.layers
        var ns6=document.getElementById&&!document.all
	var dn = "";
	var mn = "";
	var old = "";	var DaysOfWeek = new Array(7);
		DaysOfWeek[0] = "Domenica";
		DaysOfWeek[1] = "Lunedi";
		DaysOfWeek[2] = "Martedi";
		DaysOfWeek[3] = "Mercoledi";
		DaysOfWeek[4] = "Giovedi";
		DaysOfWeek[5] = "Venerdi";
		DaysOfWeek[6] = "Sabato";

	var MonthsOfYear = new Array(12);
		MonthsOfYear[0] = "Gennaio";
		MonthsOfYear[1] = "Febbraio";
		MonthsOfYear[2] = "Marzo";
		MonthsOfYear[3] = "Aprile";
		MonthsOfYear[4] = "Maggio";
		MonthsOfYear[5] = "Giugno";
		MonthsOfYear[6] = "Luglio";
		MonthsOfYear[7] = "Agosto";
		MonthsOfYear[8] = "Settembre";
		MonthsOfYear[9] = "Ottobre";
		MonthsOfYear[10] = "Novembre";
		MonthsOfYear[11] = "Dicembre";	var ClockUpdate = new Array(3);
		ClockUpdate[0] = 0;
		ClockUpdate[1] = 1000;
		ClockUpdate[2] = 60000;	
		old ="true";
		if (ie4||ns6) { document.write('<div id="LiveClockIE"></div>'); }
	else if (document.layers) { document.write('<div  id="ClockPosNS"></div>'); }
	else { old = "true"; show_clock(); }	function show_clock() {
		if (old == "die") { return; }
		if (ns4)
                document.ClockPosNS.visibility="show"
	
		var Digital = new Date();
		var day = Digital.getDay();
		var mday = Digital.getDate();
		var month = Digital.getMonth();
		var hours = Digital.getHours();

		var minutes = Digital.getMinutes();
		var seconds = Digital.getSeconds();		
		if (my12_hour) {
			dn = "AM";
			if (hours > 12) { dn = "PM"; hours = hours - 12; }
			if (hours == 0) { hours = 12; }
		} else {
			dn = "";
		}
		if (minutes <= 9) { minutes = "0"+minutes; }
		if (seconds <= 9) { seconds = "0"+seconds; }		myclock = '';
		myclock += '';
		myclock += mypre_text;
		myclock += hours+':'+minutes;
		if ((myupdate < 2) || (myupdate == 0)) { myclock += ':'+seconds; }
		myclock += ' '+dn;
		if (DisplayDate) { myclock += ' di '+DaysOfWeek[day]+', '+mday+mn+' '+MonthsOfYear[month]; }
		myclock += '';

		if (old == "true") {
			document.write(myclock);
			old = "die";
			//show_clock();
			return;
			
		}

	// Write the clock to the layer:
		if (ns4) {
			clockpos = document.ClockPosNS;
			liveclock = clockpos.document.LiveClockNS;
			liveclock.document.write(myclock);
			liveclock.document.close();
		} else if (ie4) {
			LiveClockIE.innerHTML = myclock;
		} else if (ns6){
			document.getElementById("LiveClockIE").innerHTML = myclock;
                }            

	if (myupdate != 0) { setTimeout("show_clock()",ClockUpdate[myupdate]); }
}
function PreparaDati(frm){
  stringa = ""; 
  var form = document.getElementById(frm);
  var numeroElementi = form.elements.length;  
  for(var i = 0; i < numeroElementi; i++){
    if(i < numeroElementi-1){
      stringa += form.elements[i].name+"="+encodeURIComponent(form.elements[i].value)+"&";
    }else{
      stringa += form.elements[i].name+"="+encodeURIComponent(form.elements[i].value);
    }  
  }
return stringa;
}
function Nascondi(dachiudere){
if (document.getElementById(dachiudere).style.display=="none"){
//document.getElementById(cico).style.display="none";
document.getElementById(dachiudere).style.display="";
cico=dachiudere;
}else{
//if (cico!=dachiudere){
document.getElementById(dachiudere).style.display="none";
//}
}
}
function createObject() {
	var request_type = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         request_type = new XMLHttpRequest();
         if (request_type.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            request_type.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            request_type = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               request_type = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!request_type) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
return request_type;
}

var http = createObject();
//var http =new XMLHttpRequest();
var nocache = 0;
function PostAjax(dachiudere,pagina,frm){
var params=PreparaDati(frm);
//if (document.getElementById(dachiudere).style.display=="none"){

document.getElementById(dachiudere).innerHTML ='Attendere';
nocache = Math.random();
var url = pagina;
http.open("POST", url, true);

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		document.getElementById(dachiudere).innerHTML =http.responseText;
	}else{
		document.getElementById(dachiudere).innerHTML =Attendere();
	}
}
http.send(params);

//document.getElementById(dachiudere).style.display="";
//cico=dachiudere;
//}else{

//document.getElementById(dachiudere).style.display="none";

//}
}

function Attendere() {
return 'Attendere';
}

if ( document.all )
{
	function blink_show()
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'visible';
		}
		
		window.setTimeout( 'blink_hide()', 700 );
	}
	
	function blink_hide()
	{
		blink_tags  = document.all.tags('blink');
		blink_count = blink_tags.length;
		for ( i = 0; i < blink_count; i++ )
		{
			blink_tags[i].style.visibility = 'hidden';
		}
		
		window.setTimeout( 'blink_show()', 250 );
	}
	

}


//  End -->
function ChangeImg(fl,im){
	document.getElementById(im).src='fl'	
}
function Sicuro(id,pagina){
	if (confirm('Sei sicuro di voler eliminare ?')){
		document.location.href=pagina + '&del=' + id;
	}
}
function popup(a,x,y,z)
{
	var str = "height=" + y + ",innerHeight=" + y;
    str += ",width=" + x + ",innerWidth=" + x;
    if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
	    var xc = (aw - x) / 2;
	    var yc = (ah - y) / 2;
	    str += ",left=" + xc + ",screenX=" + xc;
	    str += ",top=" + yc + ",screenY=" + yc;
	}
	window.open(a, '', str +",scrollbars="+ z);
}
function _add_more() {
		var txt = "<br><input type=\"file\" name=\"item_file[]\" style=\"width:340px\">";
		document.getElementById("dvFile").innerHTML += txt;
	}
function validate(f){
	var chkFlg = false;
	for(var i=0; i < f.length; i++) {
		if(f.elements[i].type=="file" && f.elements[i].value != "") {
			chkFlg = true;
		}
	}
	if(!chkFlg) {
		alert('Please browse/choose at least one file');
		return false;
	}
	f.pgaction.value='upload';
	return true;
}
function Video(vid){
document.getElementById("VIDEO").URL = vid;
}	
function ChiudiPres(dachiudere){
	document.getElementById(dachiudere).style.display="none";	
}
