function externalLinks() {
  if (!document.getElementsByTagName) return;
  	var strumenti = document.getElementById('s');
	var anchors = strumenti.getElementsByTagName('a');
  
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
	var rel = "" + anchor.getAttribute("rel");

    if (anchor.getAttribute("href")  &&  anchor.hostname == document.location.hostname) {
        anchor.onclick = function ()
			{
				  return pop(this.href)
			}
    } 
   }
}
 
 // Popup

var popUp = null;

function pop(url)
{
	if (popUp && !popUp.closed)
		popUp.location.href = url;
	else
		popUp = window.open(url,'detail','height=790,width=640,scrollbars=yes,resizable=yes,toolbar=no,location=no, top=10, left=50');
	popUp.focus();
	return false;
}


 window.onload = externalLinks;
