/**
 * @author SECI
 */

function conferma()
	{
		return confirm ("Confermi questa operazione?");
	}
	
function metti_in_stampa(idstampa, valore)
	{
		if (valore=='1')
		{document.getElementById(idstampa).value='si';}
		else
		{document.getElementById(idstampa).value='no';}
	}
	
function go_esci()
	{
		location.href='index.php?logout=TRUE';
	}
function go_areariservata()
	{
		location.href='Utility/switch_reserved.php';
	}

function specialChar(c, x)
	{
		document.getElementById(x).value+=c;
	}
	
function loader()
	{
		document.getElementById('loader').style.display='none'; 
		document.getElementById('context').style.display='';
	}

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
	{
		if(!document.forms[FormName])
		return;
		var objCheckBoxes = document.forms[FormName].elements[FieldName];
		if(!objCheckBoxes)
		return;
		var countCheckBoxes = objCheckBoxes.length;
		if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
		else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
		objCheckBoxes[i].checked = CheckValue;
}

function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 