﻿/* III DOM MODELS -ANDREAS BESTER
1.The World Wide Web Consortium standard model.
Netscape 6 (Mozilla),
Internet Explorer 5  (MAC),
Internet Explorer 5.X(PC),
Opera
All browsers implement or purport to implement WWC DOM. 
2.The Internet Explorer model. 4.X (PC & MAC)
3.The Netscape Navigator model. NS 4.0X (PC), 4.X(PC)
NS 4.X (MAC)	  
0. Others 	
[Andreas Bester 1/5/01]
[Andreas 1/1/06 support for ns 4.x dropped :-)]
*/
function browserdetect() {
    var agt = navigator.userAgent.toLowerCase();
    var ver = navigator.appVersion.toLowerCase();
    this.wwc = (document.getElementById ? 1 : (document.all ? 2 : (document.layers ? 3 : 0)));
    this.ismac = (ver.indexOf("mac") != -1);
    this.ns6 = (document.getElementById && (parseInt(ver) >= 5));
    this.ie = (agt.indexOf("msie") != -1);
}

browser = new browserdetect();

function rollover(imgref, srcref) {
    if (browser.wwc == 2) { if (this.document.images[imgref]) { document.images[imgref].src = srcref; } }
    else if (this.document.getElementById(imgref)) { document.getElementById(imgref).src = srcref; }
}

function openwin(url, winname, width, height, scroll) {
    var top = (screen.height - height) / 2;
    var left = (screen.width - width) / 2;
    var winprop = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=no,copyhistory=yes,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
    var awindow;
    awindow = window.open(url, winname, winprop);
    awindow.focus();
    if (!awindow.opener) awindow.opener = self;
}





function popup(url) {
    var top = 100;
    var left = 100;
    var scroll = "yes"
    var width = "790";
    var height = "500";

    var winprop = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",resizable=no,copyhistory=yes,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
    var awindow;
    awindow = window.open(url, "popup", winprop);
    awindow.focus();
    if (!awindow.opener) awindow.opener = self;

    return false;
}


function printpage() {
    var printurl = location.href;

    // Check that there is a querystring
    printurl = printurl.indexOf("?") > 0 ? printurl + "&" : printurl + "?";
    printurl = printurl + "print=yes";
    printwindow(printurl, "popuppage", "460", "400", "yes");
    return false;
}