IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

var newWin=null;

function spawnWin (loc, name, width, height, tag_resize, tag_status, tag_scroll) {
    var _params = "width=" + width + ",height=" + height +
      ",resizable=" + tag_resize + ",status=" + tag_status + ",scrollbars=" + tag_scroll;

    // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
    if (bVer >= 4) {
         _left = ( (screen.width-width) >>1 );
         _top = ( (screen.height-height) >>1 );
    } else {
         _left = ( (800-width) >>1 );
         _top = ( (600-height) >>1 );
    }

    if (IE) _params += ",top=" + _top + ",left=" + _left;
    else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;

    newWin = window.open(loc, name, _params);
    if ( newWin!=null && !(IE && bVer<5) )
        newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}


function popup(loc, name, width, height) {
    spawnWin(loc, name, width, height, 'no', 'no', 'no');
}

function popup_scroll (loc, name, width, height) {
    spawnWin(loc, name, width, height, 'yes', 'no', 'yes');
}

function popPhoto(loc, caption) {
    final_path = "getImage.php?imagePath=photos/" + loc + "&caption=" + caption;
    popup(final_path, "photo", 460, 490);
}

function opensite(dropdown) {
    s = dropdown.options[dropdown.selectedIndex].value;
    if (s != "") window.open(s);
}

function focus_on_jump(language_id, action, page_id) {
    this.location = '/' + language_id + '/focus_on/'+ action + '/' + page_id
}

function random_masthead() {
    i = Math.random(5);
    alert(i);
}