        
    var PR_Verso;
    var PR_Win = 602;
    var PR_Width = (PR_NFoto * PR_FotoW);
    var PR_PosMax = PR_Width - PR_Win;
    var PR_Pos = 0;
    var PR_FotoSel = 0;
    var PR_AnimTimer=0, PR_AnimStartTime;

    function PR_SetPosDiv() {
        var vdx = "inline";
        var vsx = "inline";
        var el = document.getElementById('PR_Foto');
        if ( PR_Pos<=0) {
            vdx = 'none';
            PR_Pos=0;
        } else if (PR_Pos>=PR_PosMax) {
            vsx = 'none';
            PR_Pos=PR_PosMax;
        }
        document.getElementById('PR_NavDX').style.display = vdx;
        document.getElementById('PR_NavSX').style.display = vsx;
        el.style.left = (PR_Pos * -1) + "px";
    }

    function PR_Muovi() {
        if ( PR_Verso > 0) {
            PR_Pos = PR_Pos + PR_ValVerso;
            if ( PR_Pos >= PR_PosMax ) {
                PR_Pos = PR_PosMax;
                StopMov();
            }
        } else {
            PR_Pos = PR_Pos - PR_ValVerso;
            if ( PR_Pos <= 0 ) {
                PR_Pos = 0;
                StopMov();
            }
        }
        PR_SetPosDiv();
    }

    function PR_Goto( id ) {
        var x = prodotti[new String(id)][0];
        PR_Pos = (x-1) * PR_FotoW;
        if ( PR_Pos >= PR_PosMax ) PR_Pos = PR_PosMax;
        if ( PR_Pos <= 0 ) PR_Pos = 0;
    }

    function StarMov( Verso ){
        PR_Verso = Verso;
        if ( PR_AnimTimer ) clearInterval(PR_AnimTimer);
        PR_AnimStartTime = new Date().getTime();
        PR_AnimTimer = setInterval( PR_Muovi, PR_Speed ); 
    }

    function StopMov(){ 
        clearInterval(PR_AnimTimer); 
    }

    function BtDxMOver() {
        document.getElementById('PR_DX').src='../images/scorrimentoDXa.gif';
        StarMov( -1 );
    }
    
    function BtDxMOut() {
        document.getElementById('PR_DX').src='../images/scorrimentoDX.gif';
        StopMov();
    }
    
    function BtSxMOver() {
        document.getElementById('PR_SX').src='../images/scorrimentoSXa.gif';
        StarMov( 1 );
    }
    
    function BtSxMOut() {
        document.getElementById('PR_SX').src='../images/scorrimentoSX.gif';
        StopMov();
    }

    function Init( id ) {
        if (PR_PosMax<=0) {
            document.getElementById('PR_NavSX').style.display = 'none';
            document.getElementById('PR_NavDX').style.display = 'none';
        }
        document.getElementById('PR_Foto').style.width = PR_Width + 'px';
        for (var i=1; i<=PR_NFoto; i++) { PR_SetOp( i, PR_OpOff); }
        PR_Pos = 0;        
        if ( id ){
            PR_ImgIn(id);
            PR_SetFlash(id);
            PR_Goto(id);
        }        
        PR_SetPosDiv();
    }

    function PR_SetOp( id, liv ) {
        var el = document.getElementById( 'PR_Foto_' + id );        
        el.style.filter = "alpha(opacity="+ liv +")";
        el.style.opacity = liv / 100;
    }

    function ScorriSX() {
        return
    } 
    
    function ScorriDX() {
        return
    } 
    
    function PR_Seleziona ( id ) {
        if ( PR_FotoSel > 0 ) {
            PR_SetOp( PR_FotoSel, PR_OpOff);
            document.getElementById('PR_Foto_' + PR_FotoSel).className = "PR_Foto";
            PR_FotoSel = 0;
        }
        if ( id > 0 ) {
            PR_FotoSel = id;
            document.getElementById('PR_Foto_' + PR_FotoSel).className = "PR_FotoSel";
        }
    }
    
    function PR_SetFlash ( id ) {
        PR_Seleziona( id );
        document.getElementById("PR_IFrame").src = "prodottiSwf.asp?swf=" + prodotti[new String(id)][2];
    }
    
    function PR_SetSoloFlash ( id ) {
        document.getElementById("PR_IFrame").src = "anim.asp?id=" + id;
    }

    function PR_ImgIn( id ) {
        document.getElementById("PR_Desc").innerHTML = prodotti[new String(id)][1];
        PR_SetOp( id, 100);
    }
 
    function PR_ImgOut( id ) {
        document.getElementById("PR_Desc").innerHTML = '';
        if ( id != PR_FotoSel) PR_SetOp( id, PR_OpOff);
    }

