// <![CDATA[

function eseguiClickGrafico(id) {
	var page;
	if (id.indexOf("http://") == -1)
		page = 'http://83.103.58.21/QuotazioniContentHtml/quotazionicontenthtmlservlet?flagGrafico=true&codiceFondo=' + id;
	else
		page = id;
	//alert ("grafico: "+page);
	var options = 'scrollbars=no,resizable=no,location=no,width=550,height=310';
	window.open(page, '', options).focus();
}

function eseguiClick (tr) {
	switch (tr.className) {
		case "pdf r_odd":
		case "pdf r_pair":
			//alert ("pdf");
			var page = 'http://83.103.58.21/aiponline/filemanager/download/commercio/rendiconti/' + tr.id;
			var options = 'scrollbars=yes,resizable=yes,location=no,width=950,height=710';
			window.open(page, '', options).focus();
			break;
			
		case "famiglia r_odd":
		case "famiglia r_pair":
			//alert ("famiglia");
			//var page = 'http://83.103.58.21/QuotazioniContentHtml/rendiconticontenthtmlservlet?codiceCompagnia=FV&codiceFondi=' + tr.id;
			if (document.location.href.indexOf ('showFamiglia') == -1)
				var page = document.location.href+'&showFamiglia=1&codiceFondi=' + tr.id;
			else
				var page = document.locatio.href;
			//var options = 'scrollbars=no,resizable=no,location=no,width=550,height=310';
			//window.open(page, '', options).focus();
			window.location = page
			break;
		case "grafico r_odd":
		case "grafico r_pair":
			//alert ("grafico");
			eseguiClickGrafico(tr.id);
			break;
		default:
	}
}

function cliccaFondo() {

    var table = document.getElementsByTagName('table');
    
    for (k=0; k<table.length; k++) {
    
        if (table[k].className.match(/int_table/gi)) { 
                
            var tbody = table[k].getElementsByTagName('tbody')[0];
            var rows  = tbody.getElementsByTagName('tr');
            
            for (i=0; i<rows.length; i++) {
                
                if (rows.id != '') {
                    rows[i].onclick = function() {
						eseguiClick (this);
					}
                }
			}
		}
    }
}

WindowOnload(cliccaFondo);

// ]]>
