// SiteScape Forum Panels 
//
//   Copyright (c) 2001 / SiteScape, Inc.  All Rights Reserved.
//
//  This information in this document is subject to change without notice 
//  and should not be construed as a commitment by SiteScape, Inc.  
//  SiteScape, Inc. assumes no responsibility for any errors that may appear 
//  in this document.
//
//  Restricted Rights:  Use, duplication, or disclosure by the U.S. Government 
//  is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the
//  Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.
//
//  SiteScape and SiteScape Forum are trademarks of SiteScape, Inc.
//
//
// browser-specific vars

var isNSN = (navigator.appName == "Netscape");
var isNSN6 = ((navigator.userAgent.indexOf("Netscape6") > -1));
var isMacIE = ((navigator.userAgent.indexOf("IE ") > -1) && (navigator.userAgent.indexOf("Mac") > -1));

// general functions

function getAnchorTop(anchorName) {
    var top = 0;
    if (isNSN6) {
        var obj = document.anchors[anchorName]
        while (1) {
            if (!obj || obj.offsetTop == 0) {break}
            top += obj.offsetTop
            obj = obj.offsetParent
        }
    } else if (isNSN) {
        top = document.anchors[anchorName].y
    } else {
        var obj = document.all[anchorName]
        while (1) {
            if (!obj || obj.offsetTop == 0) {break}
            top += obj.offsetTop
            obj = obj.offsetParent
        }
    }
    return parseInt(top);
}

function getAnchorLeft(anchorName) {
    var left = 0;
    if (isNSN6) {
        var obj = document.anchors[anchorName]
        while (1) {
            if (!obj || obj.offsetLeft == 0) {break}
            left += obj.offsetLeft
            obj = obj.offsetParent
        }
    } else if (isNSN) {
        left = document.anchors[anchorName].x
    } else {
        var obj = document.all[anchorName]
        while (1) {
            if (!obj || obj.offsetLeft == 0) {break}
            left += obj.offsetLeft
            obj = obj.offsetParent
        }
    }
    return parseInt(left);
}

function getImageTop(imageName) {
    var top = 0;
    if (isNSN6) {
        var obj = document.images[imageName]
        while (1) {
            if (!obj || obj.offsetTop == 0) {break}
            top += obj.offsetTop
            obj = obj.offsetParent
        }
    } else if (isNSN) {
        top = document.images[imageName].y
    } else {
        var obj = document.all[imageName]
        while (1) {
            if (!obj || obj.offsetTop == 0) {break}
            top += obj.offsetTop
            obj = obj.offsetParent
        }
    }
    return parseInt(top);
}

function getImageLeft(imageName) {
    var left = 0;
    if (isNSN6) {
        var obj = document.images[imageName]
        while (1) {
            if (!obj || obj.offsetLeft == 0) {break}
            left += obj.offsetLeft
            obj = obj.offsetParent
        }
    } else if (isNSN) {
        left = document.images[imageName].x
    } else {
        var obj = document.all[imageName]
        while (1) {
            if (!obj || obj.offsetLeft == 0) {break}
            left += obj.offsetLeft
            obj = obj.offsetParent
        }
    }
    return parseInt(left);
}

function getWindowWidth() {
    if (isNSN) {
        return window.innerWidth
    } else {
        return document.body.clientWidth
    }
}

function getWindowHeight() {
    if (isNSN) {
        return window.innerHeight
    } else {
        return document.body.clientHeight
    }
}

