﻿<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://www.willmaster.com/
// Version: July 28, 2007
var cX = 0; 
var cY = 0; 
var rX = 0; 
var rY = 0;

function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}

function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

function AssignPosition(d) 
{
  if(self.pageYOffset) {
	  rX = self.pageXOffset;
	  rY = self.pageYOffset;
	  }
  else if(document.documentElement && document.documentElement.scrollTop) {
	  rX = document.documentElement.scrollLeft;
	  rY = document.documentElement.scrollTop;
	  }
  else if(document.body) {
	  rX = document.body.scrollLeft;
	  rY = document.body.scrollTop;
	  }
  if(document.all) {
	  cX += rX; 
	  cY += rY;
	  }
  d.style.left = "40px";
  d.style.top = "80px";//(cY+10) + "px";
}

function HideContent(d) 
{
  if(d.length < 1) { return; }
  document.getElementById(d).style.display = "none";
  document.getElementById('backGround').style.display = "none";
}

function ShowContent(d,backGround) 
{
  if(d.length < 1) { return; }
  var dd = document.getElementById(d);
  var bg = document.getElementById('backGround');
  dd.style.display = "block";
  if(backGround){bg.style.display = "block";}
  Layout(d,backGround);
  Layout(d,backGround);
  
}

function Layout(d,backGround)
{
  var bg = document.getElementById('backGround');
  var dd = document.getElementById(d);
  var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
  var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
  var clientWidth;
  var clientHeight;
  if(navigator.userAgent.indexOf(" MSIE ")>-1)
  {
    clientWidth = document.documentElement.clientWidth;
    clientHeight = document.documentElement.clientHeight;
  }
  else if(navigator.userAgent.indexOf(" Safari/")>-1)
  {
    clientWidth = window.innerWidth;
    clientHeight = window.innerHeight;
  }
  else if(navigator.userAgent.indexOf("Opera/")>-1)
  {
    clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
    clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
  }
  else
  {
    clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
    clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
  }
  bg.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth)+'px';
  bg.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight)+'px';

  dd.style.left = scrollLeft+((clientWidth-dd.offsetWidth)/2)+'px';
  dd.style.top = scrollTop+((clientHeight-dd.offsetHeight)/2)+'px';
}
//-->