/*
 * function added 6-10-08
 * Michael Philippone CorporateZen
 * michael@corporatezen.com
 * The following function returns a 2-element array of 
 * the horizontally and vertically scrolled values 
 * for the page.
 */
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}
/*
 * Function modified 6-10-08
 * Michael Philippone Corporate Zen
 * michael@corporatezen.com
 * The following positions the 
 * div (id given as parameter) on the screen
 * centered horizontally over the window
 * and positioned absolutely 75px from wherever the 
 * user has scrolled down to 
 */
function PositionCentered(i) {
 	var obj = document.getElementById(i);
	obj.style.display = 'block';
	obj.style.position = 'absolute';
	obj.style.top = ((getScrollXY()[1]) + 100) + 'px';
	obj.style.left = ((getScrollXY()[0]) + (((document.body.offsetWidth) - (obj.style.width.replace("px",""))) /2)) + 40 + 'px';
}

function PositionNCentered(i, distFromTop) {
 	var obj = document.getElementById(i);
	obj.style.display = 'block';
	obj.style.position = 'absolute';
	obj.style.top = ((getScrollXY()[1]) + distFromTop) + 'px';
	obj.style.left = ((getScrollXY()[0]) + (((document.body.offsetWidth) - (obj.style.width.replace("px",""))) /2)) + 40 + 'px';
}
