function f_print_login(tipo) {
    try{
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_tabLoginTop_1').style.display = 'none';
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_tabLoginTop_2').style.display = 'none';
        if(!tipo) tipo = 1;
	if(tipo==1){
             _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_tabLoginTop_1').style.display = 'block';
	}else if(tipo==2){
             _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_tabLoginTop_2').style.display = 'block';
	}
    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('f_print_login()  \n error: ' + e.message);
    }
}

/*function f_print_login(tipo){
    try{
        var print_form = '';
        if(tipo==1){

            print_form = '<table border="0" width="280" id="table12" cellspacing="0" cellpadding="0">';
            print_form += '	<tr>';
            print_form += '		<td align="center" width="137"><div id="div_bt_home" class="bt_login_on">'+lang['LOGIN']+'</div></td>';
            print_form += '		<td width="5"></td>';
            print_form += '		<td align="center" width="137"><a href="javascript:f_print_login(2);"><div id="div_bt_home" class="bt_login_off" onmouseout="this.className=\'bt_login_off\'" onmouseover="this.className=\'bt_login_over\'">'+lang['LOST_PASSWORD']+'</div></a></td>';
            print_form += '	</tr>';
            print_form += '</table>';
            print_form += '<table border="0" width="90%" id="table1" cellspacing="0" cellpadding="0">';
            print_form += '	<tr><td height="3"></td></tr>';
            print_form += '	<tr><td bgcolor="#9FB8C6" height="1"></td></tr>';
            print_form += '	<tr><td height="3"></td></tr>';
            print_form += '</table>';
            print_form += '<table border="0" width="280" id="table13" cellspacing="0" cellpadding="0"><tr><td>';
            print_form += '<form method="POST" action="http://www.histats.com/newg/viewstats/index.php">';
            print_form += '<input type="hidden" name="DOLOGIN" value="1">';
            print_form += '<input type="hidden" name="cnt" value="g_cp">';
            print_form += '<table border="0" width="280" id="table14" cellspacing="0" cellpadding="0">';
            print_form += '	<tr>';
            print_form += '		<td width="60"><font class="txt_V_10_grey">'+lang['mail']+'</font></td>';
            print_form += '		<td width="115"><input type="text" name="user" size="20" class="inputText_gr" tabindex="1"></td>';
            print_form += '		<td width="105" align="center">';
            print_form += '                              <table border="0" width="100%" id="table35" cellspacing="0" cellpadding="0"><tr><td width="85" align="center">';
            print_form += '                                        <select size="1" name="useiplogin" id="useiplogin" style="font-size: 10px; font-family: Arial; color: #666666" tabindex="3">';
            print_form += '                                                <option value="1" selected>cookie</option>';
            print_form += '                                                <option value="2">cookie + IP</option>';
            print_form += '                                        </select>';
            print_form += '                                </td>';
            print_form += '                                <td width="20" align="center">';
            print_form += '                                        <img border="0" src="http://www.histats.com/images/help_16.gif" width="16" height="16" onmouseover="doTooltip_testo(event,\''+lang['tip_logip_cookie']+'\');" onmouseout="hideTip();">';
            print_form += '                                </td>';
            print_form += '                                </tr></table>';
            print_form += '     </td>';
            print_form += '	</tr>';
            print_form += '	<tr>';
            print_form += '		<td width="60"><font class="txt_V_10_grey">'+lang['password']+'</font></td>';
            print_form += '		<td width="115"><input type="password" name="pass" size="20" class="inputText_gr" tabindex="2"></td>';
            print_form += '		<td width="105" align="center"><input name="Button2"  type="submit" value="'+lang['LOGIN']+'" class="buttonLOGIN" tabindex="3"></td>';
            print_form += '	</tr>';
            print_form += '</table>';
            print_form += '</form>';
            print_form += '</td></tr></table>';
        }else if(tipo==2){
            print_form = '<table border="0" width="280" id="table10" cellspacing="0" cellpadding="0">';
            print_form += '	<tr>';
            print_form += '		<td align="center" width="137"><a href="javascript:f_print_login(1);"><div id="div_bt_home" class="bt_login_off" onmouseout="this.className=\'bt_login_off\'" onmouseover="this.className=\'bt_login_over\'">'+lang['LOGIN']+'</div></a></td>';
            print_form += '		<td width="5"></td>';
            print_form += '		<td align="center" width="137"><div id="div_bt_home" class="bt_login_on">'+lang['LOST_PASSWORD']+'</div></td>';
            print_form += '	</tr>';
            print_form += '</table>';
            print_form += '<hr color="#9FB8C6" width="280" size="1" align="center">';
            print_form += '<table border="0" width="280" id="table1" cellspacing="0" cellpadding="0"><tr><td>';
            print_form += '<form method="POST" action="http://www.histats.com/newg/viewstats/?cnt=p_fps&st=1"><input name="forg_type" value="2" type="hidden">';
            print_form += '<table border="0" width="280" id="table11" cellspacing="0" cellpadding="0">';
            print_form += '	<tr>';
            print_form += '		<td width="50"><font class="txt_V_10_grey">mail</font></td>';
            print_form += '		<td width="160"><input type="text" name="forg_mail" size="27" class="inputText_gr" tabindex="1"></td>';
            print_form += '		<td align="center" width="70"><input name="Button2" type="submit" value="'+lang['SEND']+'" class="buttonLOGIN" tabindex="2"></td>';
            print_form += '	</tr>';
            print_form += '</table>';
            print_form += '</form>';
            print_form += '</td></tr></table>';
        }
        document.getElementById('div_tabLoginTop').innerHTML = print_form ;
    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('f_print_login()  \n error: ' + e.message);
    }
}
*/
//mostra link help to translate in top
function f_showHelpTranslate(nl) {
    var txt_lang = '';
    var str_link = '';
    switch(nl){
        case 1:
            txt_lang = 'ENGLISH';
            str_link = 'en';
            break;
        case 2:
            txt_lang = 'ITALIAN';
            str_link = 'it';
            break;
        case 3:
            txt_lang = 'SPANISH';
            str_link = 'es';
            break;
        case 4:
            txt_lang = 'FRENCH';
            str_link = 'fr';
            break;
        case 5:
            txt_lang = 'DOITCH';
            str_link = 'de';
            break;
    }
    var print_help = '<table border="0" width="150" id="table9" cellspacing="0" cellpadding="0"><tr>';
    print_help += '<td width="20" align="center"><img border="0" src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/arrow_dx.gif" width="12" height="8"></td>';
    print_help += '<td align="center"><a href="http://www.histats.com/transl_' + str_link + '.php" class="txt_V_10_w">'+ _proxy_jslib_handle(lang, ('help_us_to_translate'), 0, 0)+' '+txt_lang +'</a></td>';
    print_help += '<td width="20" align="center"><img border="0" src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/arrow_sx.gif" width="12" height="8"></td>';
    print_help += '</tr></table>';
     _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_link_helpTranslate'), 'innerHTML', '=', ( print_help));
}


function f_changePage(voceSelect) {
    switch(voceSelect){
        case 1://home con sbobba flash
            f_printHOME();
            break;
        case 2://features
            f_printFEATURES();
            break;
        case 3://counters
            f_printCOUNTERS();
            break;
    }


}


var glob_arr_showFla = new (Array)();

function f_set_bgColor_prvC(colorBG,nc) {
	 _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_cPRV_'+nc).style.backgroundColor = colorBG;
}

function fInDiv(nc,swf_w, swf_h , tipoC) {
      if( _proxy_jslib_handle(glob_arr_showFla, (nc), 0, 0) !=1){

              for(var chiave in  _proxy_jslib_handle(C_G, (tipoC), 0, 0)){
                   if( _proxy_jslib_handle(glob_arr_showFla, ( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0)), 0, 0)==1){
                       fInDiv_img( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0));
                        _proxy_jslib_assign('', glob_arr_showFla, ( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0)), '=', (0));
                   }
               }


              var swf_counter = '<embed src="http://s11.histats.com/'+nc+'.swf?esterno=1&var_esterno='+ _proxy_jslib_handle(lang, ('contval_pagine'), 0, 0)+'=672#'+ _proxy_jslib_handle(lang, ('contval_visitatori'), 0, 0)+'=54#'+ _proxy_jslib_handle(lang, ('contval_vis.oggi'), 0, 0)+'=62#'+ _proxy_jslib_handle(lang, ('contval_pag.oggi'), 0, 0)+'=90#'+ _proxy_jslib_handle(lang, ('contval_online'), 0, 0)+'=10#"" width="'+swf_w+'" height="'+swf_h+'" quality="high" bgcolor="#ffffff"  name="ImageFader2" align="middle" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
              var print_contenuto = '<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" style="border: 2px solid #808080">';
              print_contenuto += '	<tr>';
              print_contenuto += '		<td align="left">';
              print_contenuto += '<table border="1"  id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#FFFFFF">';
              print_contenuto += '	<tr><td width="15" height="15" bgcolor="#FFFFFF" onclick="f_set_bgColor_prvC(\'FFFFFF\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#FFCC00" onclick="f_set_bgColor_prvC(\'FFCC00\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#CC0000" onclick="f_set_bgColor_prvC(\'CC0000\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#6600CC" onclick="f_set_bgColor_prvC(\'6600CC\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#003399" onclick="f_set_bgColor_prvC(\'003399\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#3399FF" onclick="f_set_bgColor_prvC(\'3399FF\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#006600" onclick="f_set_bgColor_prvC(\'006600\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#999999" onclick="f_set_bgColor_prvC(\'999999\','+nc+');"></td>';
              print_contenuto += '	<td width="15" height="15" bgcolor="#000000" onclick="f_set_bgColor_prvC(\'000000\','+nc+');"></td></tr>';
              print_contenuto += '</table>';
              print_contenuto += '		</td></tr>';
              print_contenuto += '		<tr><td align="center" width="100%" height="100%"><br>'+swf_counter+'<br><br></td>';
              print_contenuto += '	</tr>';
              print_contenuto += '</table>';

               _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_cPRV_'+nc), 'innerHTML', '=', (print_contenuto));
               _proxy_jslib_assign('', glob_arr_showFla, (nc), '=', (1));
              //setTimeout('fInDiv_img('+nc+');',30000);
      }


}
function fInDiv_img(nc) {
       _proxy_jslib_assign('', glob_arr_showFla, (nc), '=', (0));
      var print_contenuto = '<table border="0" width="100%" id="table1" height="100%" cellspacing="0" cellpadding="0"><tr><td align="center"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/screen_counter/0/'+nc+'.gif" border="0"></td></tr></table>';
       _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_cPRV_'+nc).style.backgroundColor = 'FFFFFF';
       _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_cPRV_'+nc), 'innerHTML', '=', ( print_contenuto));

}



function f_printCOUNTERS(tipoC) {
    if(!tipoC ) tipoC = 0;
    var print_COUNTERS = '';
    var print_COUNTERS_ty = '';
    var count_riga = 1;
    var tmp_stile_bt = '';
    var tmp_bg_tip = '';
    print_COUNTERS_ty += '';


    print_COUNTERS += '		<table border="0" width="799" id="table14" cellspacing="0" cellpadding="0" height="20" >';
    print_COUNTERS += '			<tr align="center" valign="center">';

    tmp_stile_bt = 'td_bt_counter_off';
    if(tipoC == 7) tmp_stile_bt = 'td_bt_counter_on';

    print_COUNTERS += '<td width="100" class="'+tmp_stile_bt+'" onclick="f_printCOUNTERS(7);"><a href="javascript:f_printCOUNTERS(7);" class="txt_10_dg"><font color="#990000"><b>'+ _proxy_jslib_handle(lang, ('hidden_tracker'), 0, 0)+'</b></font></a></td>';
    for (var chiave_t in C_G){

        tmp_stile_bt = 'td_bt_counter_off';

        if(tipoC == chiave_t) tmp_stile_bt = 'td_bt_counter_on';

        print_COUNTERS += '<td width="100" class="'+tmp_stile_bt+'" onclick="f_printCOUNTERS('+chiave_t+');"><a href="javascript:f_printCOUNTERS('+chiave_t+');" class="txt_10_dg">'+  _proxy_jslib_handle(C_name, (chiave_t), 0, 0)+ '</a></td>';
    }
    print_COUNTERS += '			</tr>';
    print_COUNTERS += '		</table>';

    print_COUNTERS += '<table border="0" width="799" id="table14" cellspacing="0" cellpadding="0" >';
    print_COUNTERS += '	<tr>';
    print_COUNTERS += '		<td  valign="top" width="800" align="center>';
    print_COUNTERS += '			<br>';
    print_COUNTERS += '				<table border="0" width="790" id="table15" cellspacing="0" cellpadding="0">';
    print_COUNTERS += '					<tr>';


    if(tipoC==7){
        print_COUNTERS += '<td align="center"><br><font class="txt_16_mb">'+ _proxy_jslib_handle(lang, ('hidden_tracker_desc'), 0, 0)+'</font></td>';
    }else{


        var ar_colonne = new (Array)();
        ar_colonne[1] = new (Array)();
        ar_colonne[2] = new (Array)();

        //separo i counter + larghi di 240 in un array
        for(var chiave in  _proxy_jslib_handle(C_G, (tipoC), 0, 0)){

            if( _proxy_jslib_handle(C_w, ( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0)), 0, 0)>240){
                 _proxy_jslib_assign('', ar_colonne[2], ( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0)), '=', ( 0));
            }else{
                 _proxy_jslib_assign('', ar_colonne[1], ( _proxy_jslib_handle( _proxy_jslib_handle(C_G, (tipoC), 0, 0), (chiave), 0, 0)), '=', ( 0));
            }
        }

        var ar_ordinati_w = new (Array)();
        var scorri_C = 2;
        for(var chiave in ar_colonne[2]){
             _proxy_jslib_assign('', ar_ordinati_w, (scorri_C), '=', ( chiave));
            scorri_C += 3;
        }

        var scorri_C = 0;
        var tmp_settato = 0;
        for(var chiave in ar_colonne[1]){
            if(! _proxy_jslib_handle(ar_ordinati_w, (scorri_C), 0, 0)){
                 _proxy_jslib_assign('', ar_ordinati_w, (scorri_C), '=', ( chiave));
                scorri_C ++;
            }else{
                tmp_settato = 1;
                while( _proxy_jslib_handle(ar_ordinati_w, (scorri_C), 0, 0)){
                    scorri_C ++;
                }
                 _proxy_jslib_assign('', ar_ordinati_w, (scorri_C), '=', ( chiave));
            }
        }
        //ordino oarray in ordine crescente per chiave
        var ar_ordinatoC = new (Array)();
        var b=0;
        for(var chiave in ar_ordinati_w){
             _proxy_jslib_assign('', ar_ordinatoC, (b), '=', (  _proxy_jslib_handle(ar_ordinati_w, (b), 0, 0)));
            b++;
        }

        //stampo
        count_riga = 0;
        for(var chiave in ar_ordinatoC){
            tmp_bg_tip = 'bg_tip.gif';
            if(  _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)==512 ||  _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)==514 ||  _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)==600 ||  _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)==602 ||  _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)==604){
                tmp_bg_tip = 'bg_tip_D.gif';
            }

            print_COUNTERS_ty += '<td align="center" width="33%"><div id="div_cPRV_'+ _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)+'" style="width:100%;height:100%" onmouseover="fInDiv(\''+ _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)+'\', '+ _proxy_jslib_handle(C_w, ( _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)), 0, 0)+' , '+ _proxy_jslib_handle(C_h, ( _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)), 0, 0)+',\''+tipoC+'\');" ><table border="0" width="100%" id="table1" height="100%" cellspacing="0" cellpadding="0"><tr><td align="center"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/screen_counter/'+GLOB_lang_curr+'/'+ _proxy_jslib_handle(ar_ordinatoC, (chiave), 0, 0)+'.gif" border="0"></td></tr></table></div></td>';

            //print_COUNTERS_ty += '<td align="center"><a onmouseover="mostradiv1(event,\''+ar_ordinatoC[chiave]+'\', '+C_w[ar_ordinatoC[chiave]]+' , '+C_h[ar_ordinatoC[chiave]]+' , \'http://www.histats.com/newg/images/'+tmp_bg_tip+'\');" onmouseout="nascdiv();"><img src="http://www.histats.com/images/screen_counter/'+GLOB_lang_curr+'/'+ar_ordinatoC[chiave]+'.gif" border="0"></a></td>';
            count_riga++;
            if(count_riga>=3){
                print_COUNTERS_ty += '</tr><tr>';
                count_riga=0;
            }
        }

    }


    print_COUNTERS += print_COUNTERS_ty

 print_COUNTERS += '					</tr>';
    print_COUNTERS += '					</table>';

    print_COUNTERS += '			</td></tr></table>';

     _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_contenuto_counters'), 'innerHTML', '=', ( print_COUNTERS));


}


function Show(What, CheckURL) {
    var a, i;
    if(CheckURL){
        i =  _proxy_jslib_handle(document, 'URL', '', 0, 0).indexOf("#");
        if(i != -1){
            Show( _proxy_jslib_handle(document, 'URL', '', 0, 0).substring(i+1, _proxy_jslib_handle(document, 'URL', '', 0, 0).length));
            return;
        }
    }
    if(What==1){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('err show');
    }
}
Show('', _proxy_jslib_handle(document, 'URL', '', 0, 0));

//-----------------------------------------FUNZIONI PER GESTIRE IL TOOLTIP LISTA COUNTER ANTEPRIMA


var divName = 'mydiv'; // div that is to follow the mouse

var offX = 15;          // X offset from mouse position
var offY = 15;          // Y offset from mouse position
var divnascost = 1;

function mouseX(evt) {
    if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft :  _proxy_jslib_handle(document, 'body', '', 0, 0).scrollLeft); else return 0;
}
function mouseY(evt) {
    if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop :  _proxy_jslib_handle(document, 'body', '', 0, 0).scrollTop); else return 0;
}

function follow(evt) {
    if(divnascost==0){
        if((parseInt(mouseX(evt))+ 250) >  _proxy_jslib_handle(document, 'body', '', 0, 0).offsetWidth){
            offX=-300;
        }else{
            offX=15;
        }
        if ( _proxy_jslib_handle(document, 'getElementById', '', 0, 0)) {
            var obj =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(divName).style; obj.visibility = 'visible';
            obj.left = (parseInt(mouseX(evt))+offX) + 'px';
             _proxy_jslib_assign('', obj, 'top', '=', ( (parseInt(mouseY(evt))+offY) + 'px'));
        }
    }
}
document.onmousemove = follow;

function mostradiv1(e, n_c, swf_w, swf_h, bg_tb) {
    divnascost=0;
    n_c= '<table border="0" width="290" height="140" id="table1" cellspacing="0" cellpadding="0" background="'+bg_tb+'"><tr><td><div align="center"><embed src="http://s11.histats.com/'+n_c+'.swf?esterno=1&var_esterno='+ _proxy_jslib_handle(lang, ('contval_pagine'), 0, 0)+'=672#'+ _proxy_jslib_handle(lang, ('contval_visitatori'), 0, 0)+'=54#'+ _proxy_jslib_handle(lang, ('contval_vis.oggi'), 0, 0)+'=62#'+ _proxy_jslib_handle(lang, ('contval_pag.oggi'), 0, 0)+'=90#'+ _proxy_jslib_handle(lang, ('contval_online'), 0, 0)+'=10#"" width="'+swf_w+'" height="'+swf_h+'" quality="high" bgcolor="#ffffff"  name="ImageFader2" align="middle" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></div></td></tr></table>';

     _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('mydiv'), 'innerHTML', '=', ( n_c));
    offX=15;
    // mydiv.style.display = 'none';
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("mydiv").style.display = 'block';
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("mydiv").style.visibility = 'visible';


}

function nascdiv() {
     _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('mydiv'), 'innerHTML', '=', ( ""));

    divnascost=1;
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("mydiv").style.display = 'none';
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("mydiv").style.left = -400;

}

//------------------------GESTISCE IL TABBING IN PGREG 5

function f_gestisciTabPgreg5(tp) {
    var printContent = '';
    var arTab = new (Array)();
     _proxy_jslib_assign('', arTab, ('counter'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('nojava'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('invisible'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('framec'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('excludeyp'), '=', ( 0));
    for(chiave in arTab){
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_pgr5Codec_content_'+chiave).style.display = 'none';
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('td_tab_'+chiave).className = 'td_tab_Y_150_35';
    }
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('td_tab_'+tp).className = 'td_tab_W_150_35';
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_pgr5Codec_content_'+tp).style.display = 'block';
}


function f_gestisciTabPgreg5TC(tp,tc) {
    var arTab = new (Array)();
     _proxy_jslib_assign('', arTab, ('counter'), '=', ( new (Array)()));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('counter'), 0, 0), ('html'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('counter'), 0, 0), ('js'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('counter'), 0, 0), ('xml'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('counter'), 0, 0), ('xhtml'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('nojava'), '=', ( new (Array)()));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('nojava'), 0, 0), ('html'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('nojava'), 0, 0), ('js'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('nojava'), 0, 0), ('xml'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('nojava'), 0, 0), ('xhtml'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('invisible'), '=', ( new (Array)()));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('invisible'), 0, 0), ('html'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('invisible'), 0, 0), ('js'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('invisible'), 0, 0), ('xml'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('invisible'), 0, 0), ('xhtml'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('framec'), '=', ( new (Array)()));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('framec'), 0, 0), ('html'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('framec'), 0, 0), ('js'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('framec'), 0, 0), ('xml'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('framec'), 0, 0), ('xhtml'), '=', ( 0));
     _proxy_jslib_assign('', arTab, ('excludeyp'), '=', ( new (Array)()));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('excludeyp'), 0, 0), ('html'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('excludeyp'), 0, 0), ('js'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('excludeyp'), 0, 0), ('xml'), '=', ( 0));
     _proxy_jslib_assign('',  _proxy_jslib_handle(arTab, ('excludeyp'), 0, 0), ('xhtml'), '=', ( 0));
    for(chiave in  _proxy_jslib_handle(arTab, (tp), 0, 0)){
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_pgr5Codec_content_'+tp+'_'+chiave).style.display = 'none';
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('td_tab_'+tp+'_'+chiave).className = 'td_bt_Y_125_30';
    }
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('td_tab_'+tp+'_'+tc).className = 'td_bt_W_125_30';
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_pgr5Codec_content_'+tp+'_'+tc).style.display = 'block';
}

//-----------------------------------------------FUNZIONE PER MOSTRARE IL TIP SOPRA UN'IMMAGINE PRENDENDO LA POSIzioNE
function f_ShowTipPosition(oggetto,testo) {
    try{
        var coordinateObj = f_topLeftObj(oggetto);
        var printTip = '';
        printTip = '<table border="0" width="100%" height="100%" id="table1" cellspacing="0" cellpadding="0" bgcolor="#464646"><tr><td>&nbsp;<font class="txt_V_10_w_b">'+testo+'</font></td></tr></table>';
        //prendo dimensioni dell oggetto/div
        var Hobjtxt = oggetto.style.height;
        var Wobjtxt = oggetto.style.width;
        Hobjtxt = Hobjtxt.split('px').join('');
        Wobjtxt = Wobjtxt.split('px').join('');
        var Hobj = parseInt(Hobjtxt);
        var Wobj = parseInt(Wobjtxt);

        var divABS =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_TIPAbs');
         _proxy_jslib_assign('', divABS, 'innerHTML', '=', ( printTip));
         _proxy_jslib_assign('', divABS.style, 'top', '=', ( ((coordinateObj[1]+Hobj)+20)+'px'));
        divABS.style.left = (coordinateObj[0])+'px';
        divABS.style.display = "block";

    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert("alert f_ShowTipPosition: " + e.message + "\n stamparray: \n");
    }
}
function f_topLeftObj(at15h) {
    try{
        var at15G=0,at15g=0;
        do {
            at15G+=at15h.offsetTop || 0;
            at15g+=at15h.offsetLeft || 0;
            at15h=at15h.offsetParent;
        }
        while (at15h);
        return [at15g,at15G];
    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert("alert f_topLeftObj: " + e.message + "\n stamparray: \n");
    }
}

//mostra nascondi div
function f_showHide_divHelp(nome_div) {
    try{
        var statoDiv =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nome_div).style.display;
        if(statoDiv=='block'){
             _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nome_div).style.display='none';
             _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nome_div+'_exp'), 'innerHTML', '=', ('<img border="0" src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/exp.gif" width="11" height="9">'));
        }else{
             _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nome_div).style.display='block';
             _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nome_div+'_exp'), 'innerHTML', '=', ('<img border="0" src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/comp.gif" width="11" height="9">'));
        }

    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert("alert f_showHide_divHelp: " + e.message + "\n stamparray: \n");
    }
}



function f_topLeftObj(at15h) {
    var at15G=0,at15g=0;
    do {
        at15G+=at15h.offsetTop || 0;
        at15g+=at15h.offsetLeft || 0;
        at15h=at15h.offsetParent;
    }
    while (at15h);
    return [at15g,at15G];
}

function f_hideDHTML() {
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_dhtmlContent').style.display="none";
     _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_dhtmlContent'), 'innerHTML', '=', ( ''));
     _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("iframe_divOverSwf").style.display="none";
    f_setIframe('',2);
}

function f_printDHTML(oggetto) {
    var contenuto_menu = '';
    var tmpHdiv = 0;
    var tmp_widthDIV = 0;
    var tmp_setta_opt = 0;
    var tmp_nomeDivDHTML = '';

    if(oggetto=='div_txtCOMPARE'){
        tmp_widthDIV = 240;

        contenuto_menu =  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_dhtml_compare'), 'innerHTML', '', 0, 0);
        tmp_nomeDivDHTML ='div_dhtml_compare';


    }else if(oggetto=='div_txtEXPORT' || oggetto=='div_txtEXPORT60gg' || oggetto=='div_txtEXPORT20k'){
        tmp_widthDIV = 150;

        if(oggetto=='div_txtEXPORT' || oggetto=='div_txtEXPORT20k')contenuto_menu =  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_export_content'), 'innerHTML', '', 0, 0);
        //div doppio dell'export nel summary
        else if(oggetto=='div_txtEXPORT60gg')contenuto_menu =  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_export_content_60'), 'innerHTML', '', 0, 0);
        tmp_nomeDivDHTML ='div_export_content';

    }else if(oggetto=='div_txtSETTINGS'){
        tmp_widthDIV = 300;

        contenuto_menu =  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_setting_content'), 'innerHTML', '', 0, 0);
        tmp_nomeDivDHTML ='div_setting_content';

        /*/contenuto_menu = '<table border="0" width="300" id="table1" cellspacing="0" cellpadding="4"><tr><td>';
        contenuto_menu += '<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">';
        contenuto_menu += '	<tr>';
        contenuto_menu += '		<td width="34%" height="20"><font class="txt_V_11_b_b">'+lang['settings_f1']+'</font></td>';
        contenuto_menu += '		<td width="27" height="20"><input type="radio" value="3" checked name="opt_MANURL_OPEN_METHOD" id="opt_MANURL_OPEN_METHOD_3" onclick="f_manageSETTINGS_link();"></td>';
        contenuto_menu += '		<td width="48%" height="20"><font class="txt_V_10_db">'+lang['settings_f5']+'</font></td>';
        contenuto_menu += '		<td width="9%" height="20"align="center"><a href="javascript:f_hideDHTML();"><img src="'+AR_GLOB['dom_baseIMG']+'/close.png" border="0"></a></td>';
        contenuto_menu += '	</tr>';
        contenuto_menu += '	<tr>';
        contenuto_menu += '		<td width="34%" height="20">&nbsp;</td>';
        contenuto_menu += '		<td width="27" height="20"><input type="radio" value="1"  name="opt_MANURL_OPEN_METHOD" id="opt_MANURL_OPEN_METHOD_1" onclick="f_manageSETTINGS_link();"></td>';
        contenuto_menu += '		<td width="57%" height="20" colspan="2"><font class="txt_V_10_db">'+lang['settings_f2']+'</font></td>';
        contenuto_menu += '	</tr>';
        contenuto_menu += '	<tr>';
        contenuto_menu += '		<td width="34%" height="20">&nbsp;</td>';
        contenuto_menu += '		<td width="27" height="20"><input type="radio" value="2"  name="opt_MANURL_OPEN_METHOD" id="opt_MANURL_OPEN_METHOD_2" onclick="f_manageSETTINGS_link();"></td>';
        contenuto_menu += '		<td width="57%" height="20" colspan="2"><font class="txt_V_10_db">'+lang['settings_f3']+'</font></td>';
        contenuto_menu += '	</tr>';
        contenuto_menu += '</table>';
        contenuto_menu += '<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">';
        contenuto_menu += '	<tr><td><font class="txt_V_10_grey">'+lang['settings_f4']+'</font></td></tr>';
        contenuto_menu += '</table>';
        contenuto_menu += '</td></tr></table>';*/

        tmp_setta_opt= 1;

    }


    var oggetto =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(oggetto);
    var coordinateObj = f_topLeftObj(oggetto);
    //prendo dimensioni dell oggetto/div
    var Hobjtxt = oggetto.style.height;
    var Wobjtxt = oggetto.style.width;
    Hobjtxt = Hobjtxt.split('px').join('');
    Wobjtxt = Wobjtxt.split('px').join('');
    var Hobj = parseInt(Hobjtxt);
    var Wobj = parseInt(Wobjtxt);

    var divABS =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_dhtmlContent');
    divABS.style.width = tmp_widthDIV;
     _proxy_jslib_assign('', divABS, 'innerHTML', '=', ( contenuto_menu));
    if(tmp_nomeDivDHTML!=''){
        divABS.style.height =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(tmp_nomeDivDHTML).style.height;
        divABS.style.width =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(tmp_nomeDivDHTML).style.width;
    }
    if(tmp_setta_opt == 1){
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('opt_MANURL_OPEN_METHOD_'+GLOBAL_MANURL_OPEN_METHOD).checked = true;
    }


     _proxy_jslib_assign('', divABS.style, 'top', '=', ( (coordinateObj[1]+Hobj)+'px'));
    divABS.style.left = (coordinateObj[0])+'px';
    divABS.style.display = "block";

   if(tmp_nomeDivDHTML!=''){

     f_setIframe('div_dhtmlContent',1);
   }

    //-------sposto iframe per bucare il flash
   // document.getElementById("iframe_divOverSwf").style.top = (coordinateObj[1]+Hobj)+'px';
  //  document.getElementById("iframe_divOverSwf").style.left = (coordinateObj[0])+'px';
  //  document.getElementById("iframe_divOverSwf").style.width = tmp_widthDIV;
  //  var tmp_Hdiv = divABS.style.height;
  //  tmp_Hdiv = tmp_Hdiv.split('px').join('');



    //document.getElementById("iframe_divOverSwf").style.height= tmp_Hdiv+'px';
   // document.getElementById("iframe_divOverSwf").style.display="block";


}


var GLOBAL_OPTdatiCompare = '0';

function f_optCompareOtherDay(valoreOPT) {
    var printScrollDay = '';
    printScrollDay += '<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">';
    printScrollDay += '	<tr>';
    printScrollDay += '		<td align="center" height="20"><div id="div_msg_compareDay"><font class="txt_V_10_grey">select day to compare data</font></div></td>';
    printScrollDay += '	</tr>	';
    printScrollDay += '	<tr>';
    printScrollDay += '		<td height="20" align="center">';
    printScrollDay += '			<table border="0" id="table6" cellspacing="0" cellpadding="0">';
    printScrollDay += '				<tr>';
    printScrollDay += '					<td width="20"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/ar_first.png" border="0" align="left" onmouseover="document.getElementById(\'div_scrollDW\').innerHTML=\'1 week\';" onmouseout="document.getElementById(\'div_scrollDW\').innerHTML=\'\';"></td>';
    printScrollDay += '					<td width="20"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/ar_prev.png" border="0" height="20" width="12" align="left" onmouseover="document.getElementById(\'div_scrollDW\').innerHTML=\'1 day\';" onmouseout="document.getElementById(\'div_scrollDW\').innerHTML=\'\';"></td>';
    printScrollDay += '					<td width="120" align="center">';
    printScrollDay += '						<select name="sel_dataCompare" class="select_scrolltime1" size="1" id="sel_dataCompare">';
    printScrollDay += '						<option selected="selected" value="13">NO DAY</option>';
    printScrollDay += '						<option value="12">12 May</option>';
    printScrollDay += '						<option value="11" style="color: rgb(255, 0, 0);">11 May</option>';
    printScrollDay += '						<option value="10" style="color: rgb(255, 0, 0);">10 May</option>';
    printScrollDay += '						<option value="9">9 May</option>';
    printScrollDay += '						<option value="8">8 May</option>';
    printScrollDay += '						<option value="7">7 May</option>';
    printScrollDay += '						<option value="6">6 May</option>';
    printScrollDay += '						<option value="5">5 May</option>				';
    printScrollDay += '						</select>';
    printScrollDay += '					</td>';
    printScrollDay += '					<td width="20"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/ar_next.png" border="0" height="20" width="12" align="right" onmouseover="document.getElementById(\'div_scrollDW\').innerHTML=\'1 day\';" onmouseout="document.getElementById(\'div_scrollDW\').innerHTML=\'\';"></td>';
    printScrollDay += '					<td width="20"><img src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/ar_last.png" border="0" align="right" onmouseover="document.getElementById(\'div_scrollDW\').innerHTML=\'1 week\';" onmouseout="document.getElementById(\'div_scrollDW\').innerHTML=\'\';"></td>';
    printScrollDay += '				</tr>';
    printScrollDay += '			</table>';
    printScrollDay += '		</td>';
    printScrollDay += '	</tr>';
    printScrollDay += '	<tr>';
    printScrollDay += '		<td height="15" align="center"><font class="txt_V_10_db_b"><div id="div_scrollDW"></div></font></td>';
    printScrollDay += '	</tr>';
    printScrollDay += '	<tr>';
    printScrollDay += '		<td height="25" align="center">';
    printScrollDay += '		<table border="0" width="80" id="table207" cellspacing="0" cellpadding="0" height="20" background="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/bg_btView.png">';
    printScrollDay += '			<tr>';
    printScrollDay += '				<td align="center"><a href="javascript:f_CompareData();" class="txt_V_10_db_b">View</a></td>';
    printScrollDay += '			</tr>';
    printScrollDay += '		</table>';
    printScrollDay += '		</td>';
    printScrollDay += '	</tr>';
    printScrollDay += '</table>';

    if(valoreOPT==100){
         _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_compareTIME'), 'innerHTML', '=', (  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div__TMP_compareTIME'), 'innerHTML', '', 0, 0) ));
    }else{
        if(GLOBAL_OPTdatiCompare==valoreOPT){
            GLOBAL_OPTdatiCompare = 0;
             _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('opt_CaltriDati_'+valoreOPT).checked = false;
            valoreOPT = 0;
             _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_compareTIME'), 'innerHTML', '=', ( ''));
        }else{
            GLOBAL_OPTdatiCompare=valoreOPT;
        }


        if(valoreOPT==1){

             _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_compareTIME'), 'innerHTML', '=', (  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div__TMP_compareTIME'), 'innerHTML', '', 0, 0) ));
        }else{
             _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_compareTIME'), 'innerHTML', '=', ( '<a href="javascript:f_optCompareOtherDay(100);" class="txt_V_10_db_b">CLICK HERE TO COMPARE WITH OTHER DAY</font>'));
        }
    }
}

function f_CompareData() {
    try{


        if(GLOBAL_ALERT_DEBUG_TXT==1) alert(GLOBAL_OPTdatiCompare);
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert( _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('sel_dataCompare'), 'value', '', 0, 0));
    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('ERRORE: f_CompareData() - GLOBAL_tipochiamata: '+GLOBAL_tipochiamata +' \n error: ' + e.message);
    }
}


function f_print_divlink(urlCodificato) {
    try{
        var print_ifrm = '';

        print_ifrm = '<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="100%">';
        print_ifrm += '<tr><td height="30" align="right"><img border="0" src="'+ _proxy_jslib_handle(AR_GLOB, ('dom_baseIMG'), 0, 0)+'/delete.gif" width="16" height="16" onclick="document.getElementById(\'div_ifrm_link\').style.display=\'none\';">&nbsp;&nbsp;</td></tr>';
        print_ifrm += '<tr><td><iframe id="iframe_sz1" name="I1" frameBorder="no" width="100%"  height="100%" scrolling="yes" allowTransparency src="http://www.histats.com/opur.php?ifr=1&t='+urlCodificato+'"></iframe></td></tr>';
        print_ifrm += '</table>';

         _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_ifrm_link').style, 'top', '=', (  _proxy_jslib_handle(document, 'body', '', 0, 0).scrollTop + 100));
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_ifrm_link').style.left =  _proxy_jslib_handle(document, 'body', '', 0, 0).clientWidth/2 - 375;
         _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_ifrm_link'), 'innerHTML', '=', ( print_ifrm));
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('div_ifrm_link').style.display="block";

         _proxy_jslib_handle(document, 'body', '', 0, 0).scrollTop





 }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('ERRORE: f_print_divlink() \n error: ' + e.message);
    }
}


function f_manageSETTINGS_link(statsType) {
    try{

        var tmpopt_object = document.getElementsByName('opt_MANURL_OPEN_METHOD');
        if(tmpopt_object.length>0){
            for (var i = 0 ; i < tmpopt_object.length;i++){
                if (  _proxy_jslib_handle(tmpopt_object, (i), 0, 0).checked) tmp_valore=  _proxy_jslib_handle( _proxy_jslib_handle(tmpopt_object, (i), 0, 0), 'value', '', 0, 0);
            }
        }


        GLOBAL_MANURL_OPEN_METHOD = tmp_valore;


    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('ERRORE: f_manageSETTINGS_link() \n error: ' + e.message);
    }
}



// #################################### BASE 64 ENCODING / DECODING

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function encode64(input) {
    var output = "";
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;

    do {
        chr1 = input.charCodeAt(i++);
        chr2 = input.charCodeAt(i++);
        chr3 = input.charCodeAt(i++);

        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;

        if (isNaN(chr2)) {
            enc3 = enc4 = 64;
        } else if (isNaN(chr3)) {
            enc4 = 64;
        }

        output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
        keyStr.charAt(enc3) + keyStr.charAt(enc4);
    } while (i < input.length);

    return output;
}

function decode64(input) {
    var output = "";
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;

    // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
    input =  _proxy_jslib_handle(input, 'replace', '', 1, 0)(/[^A-Za-z0-9\+\/\=]/g, "");

    do {
        enc1 = keyStr.indexOf(input.charAt(i++));
        enc2 = keyStr.indexOf(input.charAt(i++));
        enc3 = keyStr.indexOf(input.charAt(i++));
        enc4 = keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output = output + String.fromCharCode(chr1);

        if (enc3 != 64) {
            output = output + String.fromCharCode(chr2);
        }
        if (enc4 != 64) {
            output = output + String.fromCharCode(chr3);
        }
    } while (i < input.length);

    return output;
}

var GLOBAL_MANURL_LONG_CUT = 1;  // cut long urls
var GLOBAL_MANURL_OPEN_METHOD = 3;  // 1 =javascript (2 = iframed) // 3 = normal link
function _OU(url) {
    var url_encoded = encode64(url);
    if(GLOBAL_MANURL_OPEN_METHOD == 1 ){
         _proxy_jslib_handle(window, 'open', '', 1, 0)('http://www.histats.com/opur.php?t='+url_encoded);
    }else{
        f_print_divlink(url_encoded);
    }
}


function _Pulisci_url(link_url) {
    link_url = link_url.split('\\').join('\\\\');
    link_url = link_url.split('\'').join('\\\'');
    link_url = link_url.split('"').join('&quot;');
    return link_url;
}


function _LTO_OU(link_url) {


    if (link_url.match(/^http|^https|^ftp|^mailto|^file/i)) {
        link_url = link_url;
    } else {
        link_url = 'http://' + link_url;
    }



    if(GLOBAL_MANURL_OPEN_METHOD == 1 || GLOBAL_MANURL_OPEN_METHOD == 2){

        return 'javascript:_OU(\'' + (link_url) + '\');';
    }

    if(GLOBAL_MANURL_OPEN_METHOD == 3){

        return '' + (link_url) + '" target="_blank';
    }
}


function f_identaNumber(numero) {
    temp_numero =  _proxy_jslib_handle(numero, 'toString', '', 1, 0)();
    lunghezza = temp_numero.length ;
    if (lunghezza>6){
        inizio2 = lunghezza -6,
        inizio1 = lunghezza -3,
        //inizio0 = lunghezza -3;
        temp_numero = temp_numero.substr(0,inizio2) + "." +temp_numero.substr(inizio2,3) + "." +temp_numero.substr(inizio1,3);
    //temp_numero = temp_numero.substr(0,inizio0) + "." + temp_numero.substr(inizio1,3)+"."+temp_numero.substr(inizio2,6);
    }else if (lunghezza>3){
        inizio1 = lunghezza -3,
        inizio0 = lunghezza -3;
        temp_numero = temp_numero.substr(0,inizio0) + "." + temp_numero.substr(inizio1,3);
    }
    return temp_numero;
}

function f_setIframe(nomeDiv,visualizza) {
   try{
      if(visualizza==1){
        var tmpH =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nomeDiv).style.height;
        var tmpW =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nomeDiv).style.width;
        var tmpTop =  _proxy_jslib_handle( _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nomeDiv).style, 'top', '', 0, 0);
        var tmpLeft =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)(nomeDiv).style.left;
        /*
        var tmpH = document.getElementById(nomeDiv).offsetHeight;
        var tmpW = document.getElementById(nomeDiv).offsetWidth;
        var tmpTop = document.getElementById(nomeDiv).offsetTop;
        var tmpLeft = document.getElementById(nomeDiv).offsetLeft;
*/

        tmpH = tmpH.split('px').join('');
        tmpW = tmpW.split('px').join('');
        tmpTop = tmpTop.split('px').join('');
        tmpLeft = tmpLeft.split('px').join('');

        //alert(tmpH+' '+tmpW+' '+tmpTop+' '+tmpLeft);

         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style.height = tmpH+'px';
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style.width = tmpW+'px';
         _proxy_jslib_assign('',  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style, 'top', '=', ( tmpTop));
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style.left = tmpLeft;
         _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style.display = 'block';
      }else if(visualizza==2){
               _proxy_jslib_handle(document, 'getElementById', '', 1, 0)('iframe_divOverSwf').style.display = "none";
      }
    }catch(e){
        if(GLOBAL_ALERT_DEBUG_TXT==1) alert('ERRORE: f_setIframe() \n error: ' + e.message);
    }
  }


 ;
_proxy_jslib_flush_write_buffers() ;