var win=null; 

function NewWindow(mypage,myname,w,h,scroll) {
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings ='height='+h+',';
    settings +='width='+w+',';
    settings +='top='+wint+','; 
    settings +='left='+winl+','; 
    settings +='scrollbars=no'; 
    settings +='resizable=no'; 
    win=window.open(mypage,myname,settings); 
    if(parseInt(navigator.appVersion) >= 4) {
        win.window.focus();
    }
}

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";
    }
}

function popupLinks() {
    if (!document.getElementsByTagName) return;
/*    anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "popup") {
            anchor.onclick = function() { NewWindow(anchor.href, "", "550", "475", "no"); return false; };
        }
    }*/
    portfolio = document.getElementById("portfolio");
    portfolio.onclick = function() { NewWindow("/portfolio/", "", "550", "475", "no"); return false; };
    contact = document.getElementById("contact");
    contact.onclick = function() { NewWindow("/contact/", "", "550", "475", "no"); return false; };
}

