
// invia link
function popup(ind)
{
 window.open(ind,'InviaLink','width=500,height=320,scrollbars=no,menubar=no');
}

// vota cellulare
function vota(id)
{
 window.open('/vota_cellulare.php?id=' + id,'Voto','width=500,height=320,scrollbars=no,menubar=no,status=no');
 return false;
}

// AD BY GOOGLE
// This function displays the ad results.
// It must be defined above the script that calls show_ads.js
// to guarantee that it is defined when show_ads.js makes the call-back.
function google_ad_request_done(google_ads) {
    // Proceed only if we have ads to display!
    if (google_ads.length < 1 )
	return;

    var s = '';

    // Display ads here
 
    // Print "Ads By Google" -- include link to Google feedback page if available
    s += '<div style="text-align:right;">';
    
    if (google_info.feedback_url) {
	s += '<a href="' + google_info.feedback_url + '">Annunci Google</a>';
    } else {
	s += 'Annunci Google';
    }
        
    s += '</div>';

    // For text ads, display each ad in turn.
    // In this example, each ad goes in a new row in the table.
    if (google_ads[0].type == 'text') {
      if (google_ads.length == 1) {
	 s += 
	 '<a style="cursor:pointer;font-size:20pt" onclick="javascript:top.location.href=\'' + google_ads[i].url + '\';" onmouseover="this.style.textDecoration=\'underline\';window.status=\'apri ' + google_ads[i].visible_url + '\';" onmouseout="this.style.textDecoration=\'none\';window.status=\'\';">' +
	 '<strong>' + google_ads[i].line1 + '</strong><br />' +
		google_ads[i].line2 + '&nbsp;' + google_ads[i].line3 + '<br>' +
		'<span style="font-size:16px">' + google_ads[i].visible_url +
		'</span></a><br /><br />';
      } else if (google_ads.lenght >1) {  
	for(i = 0; i < google_ads.length; ++i) {
	    s += 
		'<a style="cursor:pointer" onclick="javascript:top.location.href=\'' + google_ads[i].url + '\';" onmouseover="this.style.textDecoration=\'underline\';window.status=\'apri ' + google_ads[i].visible_url + '\';" onmouseout="this.style.textDecoration=\'none\';window.status=\'\';">' +
         '<strong>' + google_ads[i].line1 + '</strong><br />' +
		google_ads[i].line2 + '&nbsp;' + google_ads[i].line3 + '<br>' +
		'<span style="font-size:10px">' + google_ads[i].visible_url +
		'</span></a><br /><br />';
	}
      }
    }

    // For an image ad, display the image; there will be only one .
    if (google_ads[0].type == 'image') {
	s += 
	    '<a href="' + google_ads[0].url + '" style="text-decoration: none">' +
	    '<img src="' + google_ads[0].image_url + 
	    '" height="' + google_ads[0].height + 
	    '" width="' + google_ads[0].width +
	    '" border="0"></a><br /><br />';
    }

    // Finish up anything that needs finishing up
    
    document.write(s);
    return;
}


// email oclution: chiamare AEHit alla fine del file con mail da
// nascondere
function econvert(str)
{
    str = str.replace(/%7E/g,'~');
    str = str.replace(/%28/g,'(');
    str = str.replace(/%29/g,')');
    str = str.replace(/_dot_|_\._|\(\.\)/gi, '.');
    str = str.replace(/_at_|~at~/gi, '@');
    str = str.replace('sendmail:','mailto:');
    str = str.replace('sendto:','mailto:');
    str = str.replace('send:','mailto:');
    return str;
}

function AEHit()
{
    var spans = document.getElementById("aehsento");
    if (spans != null) {
	var encremail = spans.innerHTML;
	spans.innerHTML = econvert(encremail);
    }
}   


