
var bDom = document.getElementById ? true : false;
var bPageLoaded = false;

function init() {
	bPageLoaded = true;
	// setShellProperties();
}

function setShellProperties() {
  
	var contentShell = document.getElementById("contentShell");
	var borderLeft = document.getElementById("borderLeft");
	var borderRight = document.getElementById("borderRight");

	borderLeft.style.height = contentShell.offsetHeight + "px";
	borderRight.style.height = contentShell.offsetHeight + "px";
}

function roll(imgName, imgObj) {
	if (bPageLoaded && bDom)
		if (document.getElementById(imgName).name == imgName || imgObj == "star" || imgObj == "pixel")
			document.getElementById(imgName).src = "../images/index.html" + imgObj + ".gif/.gif";
}

//http://www.oreillynet.com/pub/a/javascript/excerpt/JSDHTMLCkbk_chap13/index6.html
function getElementPosition(elemID) {
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
    //    return {left:offsetLeft, top:offsetTop};
    alert("left: " + offsetLeft + " top: " + offsetTop);
}

function show(subnavID) {
  if (bPageLoaded && bDom) {
    document.getElementById(subnavID).style.visibility = "visible";
  }
  var elem = document.getElementById("nav");
  var ol = elem.offsetLeft;
  //alert(ol);
  //alert(getElementPosition(subnavID);
}

function hide(subnavID) {
         if (bPageLoaded && bDom)
              document.getElementById(subnavID).style.visibility = "hidden";
         //alert(subnavID);
}

function popWin(url, width, height) 
{
	pop = window.open(url,'popWin','toolbar=no, location=no.html, status=no, menubar=no, top=140, left=325, scrollbars=no, width=' + width + ', height=' + height + ', resizable=yes');
	pop.focus();
}

function zoomThumb(img) {

	window.open('../../home/MS_0.html' + img, 'popZoom','screenx=150,screeny=75,left=150,top=75,width=520,height=420,menubar=no,toolbar=no,location=no.html,status=no,directories=no,copyhistory=no,scrollbars=auto,resizable=yes');

}

