<!--
var numb = '0123456789';
var numbTel = '0123456789-/ ';
var lwr = 'abcdefghijklmnopqrstuvwxyz';
var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

function rand(max)
{
	return (Math.floor(Math.random()*max)); 
}
function WScreen()
{
	return screen.availWidth;
}	
function HScreen()
{
	return screen.availHeight;
}	 		
function WImg(nome)
{
	return (document.getElementById(nome)).offsetWidth;
}
function HImg(nome)
{
	return (document.getElementById(nome)).offsetHeight;
}	
function WDiv(nome)
{
	return document.getElementById(nome).offsetWidth;
}
function HDiv(nome)
{
	return document.getElementById(nome).offsetHeight;
}
function isIE()
{
	return document.all?true:false;
}
function currX(nome)
{
	return (document.getElementById(nome)).currX;
}
function currY(nome)
{
	return (document.getElementById(nome)).currY;
}
function LeftDiv(nome)
{
	return document.getElementById(nome).style.left;	
}

function TopDiv(nome)
{
	return document.getElementById(nome).style.top;	
}

function filterResults(n_win, n_docel, n_body)
{
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel))) 	n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
function WClient() 
{
	if( ! document.isIE ) document.isIE=isIE();
	if(document.isIE == false) return window.innerWidth;
	return filterResults
	(
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function HClient() 
{	
	if( ! document.isIE ) document.isIE=isIE();
	if(document.isIE == false) return window.innerHeight;
	return filterResults 
	(
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function initPanelRandom(nome,nPath,xs,ys,w,h,xe,ye,speed,tocall)
{
	var obj=document.getElementById(nome);
	
	if( ! speed ) speed=0.1;
	obj.speed=speed;
	nPath++;
	obj.ie=false;
	if(isIE())
	{
		obj.ie=true;
	  obj.scrw=w;
	  obj.scrh=h;
	  obj.di=Math.sqrt(Math.pow(obj.scrw,2)+Math.pow(obj.scrh,2));  
	}
	obj.tid=0;
	obj.nPath=nPath;
	obj.CurrPath=0;
  obj.left=xs+'px';
	obj.top=ys+'px';
	obj.path=new Array(nPath*2);
	for(i=0;i<nPath-1;i++)
	{
		obj.path[(i*2)+0]=rand(w);
		obj.path[(i*2)+1]=rand(h);
	}
	obj.path[((nPath-1)*2)+0]=xe;
  obj.path[((nPath-1)*2)+1]=ye;
  obj.currX=xs;
  obj.currY=ys;
  obj.destX=obj.path[0];
  obj.destY=obj.path[1];
  obj.endX=xe;
  obj.endY=ye;  

 	if( tocall )
	{
  	obj.tocall=document.getElementById(tocall);
	}
	else obj.tocall=0;
}
function initPanelRandomSense(nome,nPath,xs,ys,w,h,dxm,dym,xe,ye,speed,tocall)
{
	var obj=document.getElementById(nome);
	
	if( ! speed ) speed=0.1;
	obj.speed=speed;
	nPath++;
	obj.ie=false;
	if(isIE())
	{
		obj.ie=true;
	  obj.scrw=w;
	  obj.scrh=h;
	  obj.di=Math.sqrt(Math.pow(obj.scrw,2)+Math.pow(obj.scrh,2));  
	}
	obj.tid=0;
	obj.nPath=nPath;
	obj.CurrPath=0;
  obj.left=xs+'px';
	obj.top=ys+'px';
	obj.path=new Array(nPath*2);
	obj.path[0]=rand(w);
	obj.path[1]=rand(h);
	for(i=1;i<nPath-1;i++)
	{
		if(rand(2)>0) obj.path[(i*2)+0]=obj.path[((i-1)*2)+0]+rand(dxm);
		else          obj.path[(i*2)+0]=obj.path[((i-1)*2)+0]-rand(dxm); 
		if(rand(2)>0) obj.path[(i*2)+1]=obj.path[((i-1)*2)+1]+rand(dym);
		else          obj.path[(i*2)+1]=obj.path[((i-1)*2)+1]-rand(dym);
	}
	obj.path[((nPath-1)*2)+0]=xe;
  obj.path[((nPath-1)*2)+1]=ye;
  obj.currX=xs;
  obj.currY=ys;
  obj.destX=obj.path[0];
  obj.destY=obj.path[1];
  obj.endX=xe;
  obj.endY=ye;  

 	if( tocall )
	{
  	obj.tocall=document.getElementById(tocall);
	}
	else obj.tocall=0;
}
function initPanel(nome,nPath,xs,ys,w,h,xe,ye,speed,tocall)
{
	var obj=document.getElementById(nome);
		
	if( ! speed ) speed=0.1;
	obj.speed=speed;
	nPath++;
	obj.ie=false;
	if(isIE())
	{
		obj.ie=true;
	  obj.scrw=w;
	  obj.scrh=h;
	  obj.di=Math.sqrt(Math.pow(obj.scrw,2)+Math.pow(obj.scrh,2));  
	}
	obj.tid=0;
	obj.nPath=nPath;
	obj.CurrPath=0;
  obj.left=xs+'px';
	obj.top=ys+'px';
	obj.path=new Array(nPath*2);
	if(nPath==1)
	{
		obj.path[0]=xe;
		obj.path[1]=ye;
	}
  obj.currX=xs;
  obj.currY=ys;
  obj.destX=xe;
  obj.destY=ye;
  obj.endX=xe;
  obj.endY=ye;  
  
 	if( tocall )
	{
  	obj.tocall=document.getElementById(tocall);
	}
	else obj.tocall=0;
}
function RandomizePath(n,mx,my)
{
	vett=new Array(n);
	for(i=0;i<n;i++)
	{
		vett[(i*2)+0]=rand(mx);
		vett[(i*2)+1]=rand(my);
	}
	return vett;
}
function AddObj(obj)
{
	if( ! document.AnimationVector)
	{
		document.AnimationVector = new Array();
		document.AnimationVector.length=0;
	}
	return document.AnimationVector.push(obj);
}
function AddNamedObj(nome)
{
	return AddObj(document.getElementById(nome));
}
function AnimateObjs()
{
	if(document.tid) clearTimeout(document.tid);
	document.tid=0;

	if(document.AnimationVectorTemp) document.AnimationVectorTemp.length=0;
	else
	{ 
		document.AnimationVectorTemp=new Array(); 
		document.AnimationVectorTemp.length=0; 
	}
	do
	{
		o=document.AnimationVector.pop();
		if( moveOBJ_sub(o) != 0) document.AnimationVectorTemp.push(o);
		else if(o.tocall!=0)
		{ 
			document.AnimationVectorTemp.push(o.tocall); 
			o.tocall=0;
		}
			
	}while(document.AnimationVector.length!=0);
	
	if(document.AnimationVectorTemp.length > 0 )
	{
		document.AnimationVector.length=0;
		document.AnimationVector=document.AnimationVectorTemp.slice();
		document.AnimationVectorTemp.length=0;
		return document.tid=setTimeout('AnimateObjs()',41.666666666666666666666666666667);
	}
	else 
	{
		if(document.tocallFinally!=-1) return document.tocallFinally();
		else 													 return 0;
	}
}
function moveOBJ_sub(o)
{
	if( ! o.speed) o.speed=0.1;
	
	if(o.currX>o.destX)								o.currX=(o.currX-(Math.abs(o.destX-o.currX)*o.speed)); 
	else if(o.currX<o.destX)					o.currX=(o.currX+(Math.abs(o.destX-o.currX)*o.speed)); 
	if(o.currY>o.destY)   						o.currY=(o.currY-(Math.abs(o.destY-o.currY)*o.speed)); 
	else if(o.currY<o.destY)					o.currY=(o.currY+(Math.abs(o.destY-o.currY)*o.speed)); 
		
	var match=0;
  if(Math.abs(o.destX-o.currX)<1.0){ o.currX=o.destX; match++; } 
  else match--;

	if(Math.abs(o.destY-o.currY)<1.0){ o.currY=o.destY; match++; } 
  else match--;

	o.style.left=o.currX;
	o.style.top=o.currY;
		
	if(o.ie)
	{
		o.style.filter='alpha(opacity='+
			(32+(64/((Math.sqrt(Math.pow(o.endX-o.currX,2)+Math.pow(o.endY-o.currY,2))*64)/o.di)))
				+')';
	}
	if( match >= 2)
	{
		if(o.CurrPath!=o.nPath-1)
		{	
			o.CurrPath++;
			o.destX=o.path[(o.CurrPath*2)+0];
			o.destY=o.path[(o.CurrPath*2)+1];
			return -1;
		}
		else return 0; 
	}
	else return -1;
}
function StartAnimation(tout,tocallFinally)
{
	if( ! tout ) tout = 1;
	if( ! tocallFinally ) document.tocallFinally=-1;
	else 									document.tocallFinally=tocallFinally;
	return setTimeout(AnimateObjs,tout);
}
function OpenWindowMax( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=no,menubar=no,scrollbars=yes,resizable=yes,toolbar=no';
   sOptions = sOptions + ',width=' + (screen.width).toString();
   sOptions = sOptions + ',height=' + (screen.Height).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0,fullscreen=1';

   wOpen = window.open( '', aWinName, 'fullscreen=1');//sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.width, screen.Height );
   return wOpen;
}
function isEmail(string) 
{
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)
		return 1;
	else
		return 0;
}
function isValid(parm,val) 
{
	if (parm == "") return true;
	for (i=0; i<parm.length; i++) 
	{
		if (val.indexOf(parm.charAt(i),0) == -1) return false;
	}
	return true;
}
function isNum(parm) 
{
	return isValid(parm,numb);
}
function isLower(parm)
{
	return isValid(parm,lwr);
}
function isUpper(parm) 
{
	return isValid(parm,upr);
}
function isAlpha(parm) 
{
	return isValid(parm,lwr+upr);
}
function isAlphanum(parm) 
{
	return isValid(parm,lwr+upr+numb);
} 
function isTel(parm) 
{
	return isValid(parm,numbTel);
}
function hideLoadingBar()
{
	var obj=document.getElementById("LoadingTabImg");
	obj.style.visibility="hidden";
	var obj=document.getElementById("LoadingTab");
	obj.style.left=-1000;
	obj.style.top=-1000;	
}
//-->
