imgV1 = new Image(); imgV1.src = "/images/Bottone_left.gif"
imgV2 = new Image(); imgV2.src = "/images/Bottone_center.gif"
imgV3 = new Image(); imgV3.src = "/images/Bottone_right.gif"
imgV4 = new Image(); imgV4.src = "/images/barra_generica.gif"
function OpenUrlCenter(Dest, Trg, wi, hi)
{
   window.open (Dest, Trg, "toolbar=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,top=" + ((screen.height-hi)/3) + ",left=" + ((screen.width/2)- wi/2) + ",width=" + wi + ",height=" + hi);
}

function OpenUrlHelp(HelpTxt)
{
	wi = 450 ;
	hi = 316 ;
	window.open ('../utility/help.asp?H='+HelpTxt, 'HELP', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,top='+ ((screen.height/2)-hi/2) +',left='+ ((screen.width/2)- wi/2) +',width='+ wi +',height='+ hi);
}

function ChkEmail(UrlE)
{
  if ((UrlE.value.indexOf("@") == -1) |
      (UrlE.value.indexOf(".") == -1) |
      (UrlE.value.length < 5))
      { return(false); }
    return(true);
}

function ViewHide(NomeId, strVis)	//strVis = "visibile";  strVis = "nascosto";
{
	if( document.all)
	{
		if(eval("document.all."+NomeId))
			eval("document.all."+NomeId+".className='" + strVis + "'");
	}
	else
	{
		if(eval("document.getElementById('"+NomeId+"')"))
			eval("document.getElementById('"+NomeId+"').className='" + strVis + "'");
	}
}

function FindCtrl(NomeId)
{
	if( document.all )
	{
		if(eval("document.all."+NomeId))
			return eval("document.all."+NomeId);
		else
			return null;
	}
	else
	{
		if( document.getElementById(NomeId) )
			return document.getElementById(NomeId);
		else if( document.getElementsByName(NomeId) )
			return document.getElementsByName(NomeId);
		else
			return null;
	}
}

function OpenPrint(UrlRpt)
{
	wi = 750 ;
	hi = 500 ;
	UrlRpt = Replace(UrlRpt,'?','|1|')
	UrlRpt = Replace(UrlRpt,'&','|2|')
	window.open ('/utility/stampa.asp?VIEW=PRN&UrlRpt='+UrlRpt, 'Stampa', 'scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no,top='+ ((screen.height/2)-hi/2) +',left='+ ((screen.width/2)- wi/2) +',width='+ wi +',height='+ hi);
}

function OpenZoom(UrlRpt)
{
	wi = 400 ;
	hi = 450 ;
	UrlRpt = Replace(UrlRpt,'?','|1|')
	UrlRpt = Replace(UrlRpt,'&','|2|')
	window.open ('/utility/stampa.asp?VIEW=ZOOM&UrlRpt='+UrlRpt, 'Zoom', 'scrollbars=yes,resizable=yes,toolbar=no,status=no,menubar=no,top='+ ((screen.height/2)-hi/2) +',left='+ ((screen.width/2)- wi/2) +',width='+ wi +',height='+ hi);
}

function OpenLogin()
{
	wi = 300 ;
	hi = 150 ;
	self.location.href= '/utility/login.asp';
}

function Replace(Txt,Src,Dst)
{
    var Tmp;
    Tmp = "";
    if( Txt.length > 0 )
    {
    	var Cont, ChrL;
        for( Cont = 0 ; Cont < Txt.length ; Cont ++ )
        {
            ChrL = Txt.charAt(Cont);
            if( ChrL == Src )
                Tmp += Dst;
            else
                Tmp += ChrL;
        }
    }
    return (Tmp);
}

function ReplaceString(strTxt,strSrc, strDst)
{
    var Tmp,LenSrc,LenTxt;
    Tmp = "";
    
    LenTxt=strTxt.length;
    LenSrc=strSrc.length;
    
    if( LenTxt > 0 && LenSrc > 0 && LenTxt  > LenSrc)
    {
    	var Cont, strL;
        for( Cont = 0 ; Cont < LenTxt; Cont ++ )
        {
            strL = strTxt.substring(Cont,LenSrc+Cont);
            if( strL == strSrc)
            {
                Tmp += strDst;
                Cont += strSrc.length-1;
            }
            else
            {
                Tmp += strTxt.charAt(Cont);
            }
        }
    }
    else
    {
    	Tmp=strTxt;
    }
    return (Tmp);
}
