function get_version() {

    bName = navigator.appName;
    bVer = parseInt(navigator.appVersion); 

    if (bName == "Netscape" && bVer <= 4) ver = "n4";    // Netscape 4 or below?
    else ver = "other";    // Other, presumably DOM-compliant browser (e.g. IE4, IE5, Opera)?

}

function attach_styles(subdir_level) {
// Note that subdir_level == -1 is for the Welcome.htm file that is in the top level folder
// above the ViewerAPI folder that contains the rest of the help.
    if (subdir_level == -1) {
        if (ver == "n4") document.write('<LINK rel="stylesheet" href="ViewerAPI/_ns.css">');
        else document.write('<LINK rel="stylesheet" href="ViewerAPI/_dom.css">');
    }
	if (subdir_level == 0) {
        if (ver == "n4") document.write('<LINK rel="stylesheet" href="_ns.css">');
        else document.write('<LINK rel="stylesheet" href="_dom.css">');
    }
    if (subdir_level == 1) {
        if (ver == "n4") document.write('<LINK rel="stylesheet" href="../_ns.css">');
        else document.write('<LINK rel="stylesheet" href="../_dom.css">');
    }
    if (subdir_level == 2) {
        if (ver == "n4") document.write('<LINK rel="stylesheet" href="../../_ns.css">');
        else document.write('<LINK rel="stylesheet" href="../../_dom.css">');
    }
    if (subdir_level == 3) {
        if (ver == "n4") document.write('<LINK rel="stylesheet" href="../../../_ns.css">');
        else document.write('<LINK rel="stylesheet" href="../../../_dom.css">');
    }
}


function GotoBookmark(objref, methodref)
{
    get_version()
    frames[0].location = objref;
    frames[1].location = methodref;
}
var newWin;

function open_window(url) 
{
    newWin = window.open(url,"codeWin","scrollbars,resizable,width=550,height=400"); 
    newWin.focus();
}

function jump_back(url)
{
    // 'baseRef' is a global var in index.htm
    parent.Main.location.href = parent.baseRef + url;
    parent.Main.focus();
}

function detail_changed(contents, listSel)
{
    parent.frames[0].location = file;
    var theList = top.frames[0].document.theForm.theForm;
    for(i=0;i<theList.length;i++) {
        if (theList.options[i].value == listSel) {
            theList.selectedIndex = i;
        } else if (!listSel) {
            theList.selectedIndex = "0";
        }
    }
}

function test() {
	alert('hello there');
}

function jumpToSel() {
    var list = document.theForm.theList;
    var file = list.options[list.selectedIndex].value;
    if (file != "none") {
        parent.frames[1].location = file;
    }
}

