//replaces target="_blank"
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


// SMALL POPUP WINDOW
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function switchImage(filename) {
    var imageList = document.getElementById("imageList").getElementsByTagName("IMG");
    for(x = 0; x <= imageList.length-1; ++x) {
        imageList[x].className = "";
    }
    document.getElementById(filename).className = "imageSelected";
    document.getElementById("mainImage").src = "/data/img/projects/"+filename+".jpg";
}  