function mOvr(src,clrOver){
	src.style.cursor = 'hand';
	src.bgColor = clrOver;
	src.background='http://www.bloo.it/img/bg_tit_vuoto_c_over.gif';
}
function mOut(src,clrIn){
	src.style.cursor = 'default';
	src.bgColor = clrIn;
	src.background='';
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
// Messaggi alert
	function MM_popupMsg(msg) { //v1.0
		document.MM_returnValue = confirm(msg);
	}
// JavaScript Document
//Funzione per abilitare/disabilitare il bottone AggiungiFile
function EnableButtonAddFile(file,nomeControllo) 
{	
	//var btn = document.getElementById('boxadinsert_btnAddFile');
	var btn = document.getElementById(nomeControllo);
	if (btnDisabled != true)
	{
		if(file.value == '')
			btn.disabled = true;
		else
			btn.disabled = false;
	}
	else
		btn.disabled = true;
} 
//Funzione di apertura della finestra popup di Uploading File...
function OpenUpLoadWindow(url,nomeControllo)
{  
	//var ctrl = document.getElementById('boxadinsert_Multimedia');
	var ctrl = document.getElementById(nomeControllo);
	if(ctrl.value != null && ctrl.value != '')
	{
		var leftdist = screen.width/2 -340/2; 
		var topdist =  screen.height/2 -180/2; 
					
		childwin = window.open(url, 'smuploading', 'width=340,height=180,top=' + topdist + ',left=' + leftdist +  ',status=yes,toolbar=no'); 
	}
}
//Funzione generica di apertura window popup (Anteprima file/immagine)
function OpenWindowMultimedia(url,titolo,width,height,isResizable)
{ 
	var childWindow; 
	var destination;
	var withScrollBars;
	
	if (childWindow != null)
	{
		if (childWindow.closed) 
			childWindow=null;
	}		
		
	if (childWindow == null)
	{
		var winwidth = 320;
		var winheight = 200;
		if(width!=null)
			winwidth = width;
		if(height!=null)
			winheight = height;
		
		var leftdist = 0; 
		var topdist = 0; 
		
		childWindow = window.open('','',"height=" + winheight + ",width=" + winwidth + ",top=0,left=0,scrollbars=no,resizable=" + isResizable + ",menubar=no,status=yes");
		
		childWindow.document.title = titolo;
		childWindow.location = url;
	
	}			
	else
	{
		if (!childWindow.closed)
			childWindow.focus();
	}
}
//Funzione per la validazione dei formati dei file supportati dal controllo HTML InputFile 
//I valori dei file supportati verranno configurati nei file XML XmlForInputXXX...
function validateFileType(file,nomeControllo) 
{	
	//var btn = document.getElementById('boxadinsert_btnAddFile');
	var btn = document.getElementById(nomeControllo);
	if ( file.accept == null || file.accept == '' || file.value == '') return true; 
	
	var temp = file.value.split("."); 
	// Ricavo l'estensione del file...
	var ext = temp[temp.length-1]; 
	//..e l' array dei tipi validi...
	var types = file.accept.split(","); 
	
	for ( var t = 0; t < types.length; ++t ) 
	{ 
		temp =  types[t].split("/"); 
		
		if ( temp[1].toLowerCase() == ext.toLowerCase() ) 
		{
			btn.disabled = false;
			btnDisabled = false;
			return true; 
		}
	} 
	alert("Il tipo di file selezionato non e' compatibile con i formati validi: [" + types + "]."); 
	btn.disabled = true;
	btnDisabled = true;
	return false; 
} 

// Nascondi layer
	function hideLayer(whichLayer) {
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById(whichLayer).style.display = "none";
		}
		else if (document.all) {
			// this is the way old msie versions work
			document.all[whichlayer].style.display = "none";
		}
		else if (document.layers) {
			// this is the way nn4 works
			document.layers[whichLayer].display = "none";
		}
	}
	
// Visualizza layer
	function showLayer(whichLayer) {
			//	alert(whichLayer);
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById(whichLayer).style.display = "block";
		}
		else if (document.all) {
			// this is the way old msie versions work
			document.all[whichlayer].style.display = "block";
		}
		else if (document.layers) {
			// this is the way nn4 works
			document.layers[whichLayer].display = "block";
		}
	}
  
