//
//    Copyright 1999 Graffic Pty Ltd
//    www.graffic.com.au
//
function WriteCookie (cookieName, cookieValue, expiry)
{

    document.cookie = cookieName + "=" + cookieValue + "; expires=" + expiry.toGMTString();
    //alert("writing: " + cookieName + "=" + cookieValue + "; expires=" + expiry.toGMTString())
}
function ReadCookie (CookieName) {
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;

    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {
      CookiePieces = CookieSet[x].split ('=');
      if (CookiePieces[0].substring (0,1) == ' ') {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }

      if (CookiePieces[0] == CookieName) {
        ReturnValue = CookiePieces[1];
      }

    }
    return ReturnValue
}

function jumpToWorkspace(sTool) {
    if (parent.main) {
        parent.main.window.location = '../tools/help/jumpttotool.htm'
    } else {
        top.location = '../tools/help/jumptotool.htm'
    }
    
}

function setPageName(sThePage) {
    
    //reload the toc with the current page name
    //alert('loc: ' + '../toc/DynamicTOC.htm?Page=' + sThePage );
    if (parent.frames[2]) {
        //alert('Refreshing: ' + 'toc/dynamictoc.htm?Page=' + sThePage );
        
        // set page name
        parent.TOCPath = 'dynamictoc.htm?Page=' + sThePage
        
        //reload the TOC
        //parent.contents.location.reload() 
        
        //reload the header
        parent.Header.location.reload() 
    }
}


    // Check to see if we should attempt this code
    // Only version 4 browsers or higher supported
    var bIsIE = (navigator.appName.indexOf("Internet Exporer") != -1)
    var iVer = parseInt(navigator.appVersion)
    
    if (iVer >= 4) {
    
        //alert(document.location);
        var thisDoc = document.location + ''
    
        if (thisDoc.indexOf('banner.htm') == -1) {
            //alert('refreshing');
            setPageName(document.location)
        }
    }
    



    
