// JScript source code
function MO(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="T";
}
function MU(e)
{
if (!e)
var e=window.event;
var S=e.srcElement;
while (S.tagName!="TD")
{S=S.parentElement;}
S.className="P";
}

var oBlinkInterval
function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
      clearInterval(oBlinkInterval)
      if (s.style.visibility=='visible')
        oBlinkInterval = setInterval('blinkIt()',2000);      
      else
        oBlinkInterval = setInterval('blinkIt()',500);      
   }
 }
}
oBlinkInterval = setInterval('blinkIt()',500);

function absoluteO(o){
	o.style.display="block";
	o.style.visibility="visible";
  o.style.position="absolute";
  o.style.top=0;
  o.style.left=0;
}
function hideO(o)
{
	o.style.display='none';
	o.style.visibility = 'hidden';
}
function showO(o)
{
	o.style.display='inline';
	o.style.visibility = 'visible';
}

function hideObyId(id)
{
	var o
	o = document.getElementById(id);
	o.style.display='none';
	o.style.visibility = 'hidden';

}
function showObyId(id)
{
	var o
	o = document.getElementById(id);
	o.style.display='inline';
	o.style.visibility = 'visible';
}

function alltrim(sString) 
{
var newString='', i=0
while (i < sString.length)
{
	if (sString.substr(i,1) != ' ')
		{
		newString += sString.substr(i,1);
		}
	i++;
}
return newString
}

//when you need to disable all select in a page
function disableSELECT()
{
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('select').length;i++){
      s=document.all.tags('select')[i];
      s.style.visibility = 'hidden';
   }
 }
}
function enableSELECT()
{
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('select').length;i++){
      s=document.all.tags('select')[i];
			s.style.position = 'static';
    }
 }
}
function hideSELECT()
{
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('select').length;i++){
      s=document.all.tags('select')[i];
			s.style.position ='absolute';
			s.style.top = -100;
   }
 }
}

function makexsubmitEx() {
document.writeln("<div id='div_msg' class='l0'>");
document.writeln("	<img border='0' id='img_sfondo' src='/images/sfondo_trasparente.png'  />");
document.writeln("</div>");
document.writeln("<div id='div_msg_box'class='l0'>");
document.writeln("	<img border='0' id='Img1' src='/images/wait_msg.gif'  />");
document.writeln("</div>");
var o
	o = document.getElementById('div_msg');
	o.height = screen.availHeight;
	o.width = screen.availWidth;
	o = document.getElementById('img_sfondo');
	o.style.height = screen.availHeight;
	o.style.width = screen.availWidth;
	o = document.getElementById('div_msg_box');
	o.style.top = ((screen.availHeight / 2) - 100);
	o.style.left = ((screen.availWidth / 2) - 200);
}

function xsubmitEx(bsubmit) 	{
	var o, xpage
	if (bsubmit==null) bsubmit = true;
	window.scroll(0,0);
	o = document.getElementById('div_msg');
	o.style.visibility='visible';
	o = document.getElementById('div_msg_box');
	o.style.visibility = 'visible';	
	if (IE) {
		o = document.activeElement;
		if (o == null) {
			xpage = document.forms[0];
			}
		else {
			xpage = o.form;
			if (xpage == null) xpage = document.forms[0];
			}
		hideSELECT();
	}
	else {
		xpage = document.forms[0];
	}		
	if (bsubmit=true) xpage.submit();
}

function hltr(id) {
var o
	o = document.getElementById(id);
	o.className = 'hltr';
}		
function nhltr(id) {
var o
	o = document.getElementById(id);
	o.className = '';
}		

      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57) && (charCode!=46 && charCode!=44)) {
			alert('Inserire soltanto numeri, punto o virgola');
			return false;
		}
         return true;
      }

	function checkInput(evt, regExp, msg) {
		var re = new RegExp(regExp);
		var charCode = (evt.which) ? evt.which : evt.keyCode
		var m = re.exec(String.fromCharCode(charCode));
		if (m == null) {
			alert(msg);
			return false;
		}
		return true;
	  }
	  
	  function checkTime(o, msg) {
		var re = new RegExp(/^\d{1,2}:\d{2}([ap]m)?$/);
		var m = re.exec(o.value.toString());
		if (o.value.toString().replace(' ','').toLowerCase() == 'chiuso') return true;
		if (m == null) {
			if ( msg == null)
			alert('Inserire orari nel formato hh:mm es. 08:00.');
			else alert(msg);			
			return false;
		}
		return true;  
	  }
	  

