// JavaScript Document

function clear_input(element)
{
    element.value = "";
    element.onfocus = null;
}

<!--
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.id; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve essere un indirizzo E-mail valido.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
    } if (errors) alert('Si sono verificati i seguenti errori:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->

function bottoneAvvisoElimina() {
	
	return confirm('Vuoi eliminare?');

}


 
$(document).ready(function()
{
  //hide the all of the element with class msg_body
  $(".msg_body").hide();
  //toggle the componenet with class msg_body
  $(".msg_head").click(function()
  {
	if ($(".msg_body").is(":visible")) {
		 $(".msg_body").hide(600);
	 } 
		 
	if ($(this).next().is(":visible")) {
		 $(this).next().hide(600);
	 } else {
    $(this).next().slideToggle(600);
	 }
  });
});




<!-- Begin

// Compare two options within a list by VALUES

function compareOptionValues(a, b) 

{ 
  // Radix 10: for numeric values
  // Radix 36: for alphanumeric values
  var sA = parseInt( a.value, 36 );  
  var sB = parseInt( b.value, 36 );  
  return sA - sB;

}

// Compare two options within a list by TEXT

function compareOptionText(a, b) 

{ 
  // Radix 10: for numeric values
  // Radix 36: for alphanumeric values
  var sA = parseInt( a.text, 36 );  
  var sB = parseInt( b.text, 36 );  
  return sA - sB;
}

// Dual list move function

function moveDualList( srcList, destList, moveAll ) 

{
	
	
	   
  // Do nothing if nothing is selected
  if (  ( srcList.selectedIndex == -1 ) && ( moveAll == false )   )
  {
    return;
  }
  newDestList = new Array( destList.options.length );
  var len = 0;
  for( len = 0; len < destList.options.length; len++ ) 
  {
    if ( destList.options[ len ] != null )
    {
      newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
	 
    }
  }
  for( var i = 0; i < srcList.options.length; i++ ) 
  { 
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
    {
       // Statements to perform if option is selected

       // Incorporate into new list
       newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
       len++;
 	   
    }
	
  }
  // Sort out the new destination list

  //newDestList.sort( compareOptionValues );   // BY VALUES
  newDestList.sort( compareOptionText );   // BY TEXT
  
  
  // Populate the destination with the items from the new array
  for ( var j = 0; j < newDestList.length; j++ ) 
  {
    if ( newDestList[ j ] != null )
    {
      destList.options[ j ] = newDestList[ j ];
	  
    }
	
	
  }
  
  // Erase source list selected elements
  for( var i = srcList.options.length - 1; i >= 0; i-- ) 
  { 
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
    {
       // Erase Source
       //srcList.options[i].value = "";
       //srcList.options[i].text  = "";
       srcList.options[i]       = null;
	   
		
    }
  }
  for( var i = 0; i < srcList.length; i++ ) {
	   
	   srcList.options[i].selected = true;
	   }
	   
	for( var i = 0; i < destList.length; i++ ) {
	   
	   destList.options[i].selected = true;
	   }
	
	   
} // End of moveDualList()
//  End -->


<!--
function test(value) {
 if (value == '60') {
  document.getElementById('ngiorni').disabled = false;
  document.getElementById('ngiorni').style.borderColor = "#FF0000";
 } else {
  document.getElementById('ngiorni').disabled = true;
  document.getElementById('ngiorni').style.borderColor = "#000000";
 }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->


// APRIRE POPUP CON NYRO MODAL
$(function() {
  	$('.nyroModal').nyroModal();
	});


