function mover(src, type)
{
   src.className = type;
   src.style.cursor = 'hand';
}
function mout(src, type)
{
   src.className = type;
   src.style.cursor = 'default';
}
function gcrShow(imageSrc)
{
   if (document.images)
   {
      document.images['gcrImage'].src = imageSrc;
   }
}

var verticalpos = "frombottom"

function gcrFloatDiv()

{
   var startX = 20,
   startY = 68;
   var ns = (navigator.appName.indexOf("Netscape") != -1);
   var d = document;
   function ml(id)
   {
      var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.layers[id];
      if(d.layers)
      {
         el.style = el;
      }
  

      el.sP = function(x,y)
      {
         this.style.left = x;
         this.style.top = y;
      }

      el.x = startX;

      if (verticalpos == "fromtop")
      {
         el.y = startY;
      }
      else
      {
         el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
         el.y -= startY;
      }
      return el;
   }
   window.stayTopLeft = function()
   {
      if (verticalpos == "fromtop")
      {
         var pY = ns ? pageYOffset : document.body.scrollTop;
         ftlObj.y += (pY + startY - ftlObj.y)/8;
      }
      else
      {
         var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
         ftlObj.y += (pY - startY - ftlObj.y)/8;
      }
      ftlObj.sP(ftlObj.x, ftlObj.y);
      setTimeout("stayTopLeft()", 10);
   }
   ftlObj = ml("gcrFloater");
   stayTopLeft();
}

function grGotoLink(siteNum, w, h)
{   
   ScrW = w;
   ScrH = h;

   if(siteNum == 0001)
   {
      var grWin = window.open("showcal.asp",
                  "A_GR_Win",
                  "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=0,left=0,width="+ScrW+",height="+ScrH+"");
   }
   else if(siteNum == 0002)
   {
      var grWin = window.open("showcal.asp",
                  "A_GR_Win",
                  "toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width="+ScrW+",height="+ScrH+"");
   }
   else
   {
      ScrW = screen.Width - 10;
      ScrH = screen.Height - 170;
      
      var grWin = window.open(site[siteNum],
                  "A_GR_Win",
                  "toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width="+ScrW+",height="+ScrH+"");           
      //grWin.moveTo(0, 0);
      //grWin.resizeTo(screen.availWidth, screen.availHeight);
   }
   SiteNum = 0;
}

// Correctly handle PNG transparency in Win IE 5.5 or higher.
if (navigator.appName == "Microsoft Internet Explorer")
{
	function correctPNG() 
	{
	   for(var i=0; i<document.images.length; i++)
	   {
		   var img = document.images[i]
		   var imgName = img.src.toUpperCase()
		   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	      {
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText 
				
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
				
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
			 	+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
		    	+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 	+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			 	img.outerHTML = strNewHTML
			 	i = i-1
		   }
	   }
	}
	window.attachEvent("onload", correctPNG);
}
//MessageBox.Begin
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e)
{
	if (document.layers)
	{
		xMousePos = e.pageX;
		yMousePos = e.pageY;
		xMousePosMax = window.innerWidth+window.pageXOffset;
		yMousePosMax = window.innerHeight+window.pageYOffset;
	}
	else if (document.all)
	{
		xMousePos = window.event.x+document.body.scrollLeft;
		yMousePos = window.event.y+document.body.scrollTop;
		xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
		yMousePosMax = document.body.clientHeight+document.body.scrollTop;
	}
	else if (document.getElementById)
	{
		xMousePos = e.pageX;
		yMousePos = e.pageY;
		xMousePosMax = window.innerWidth+window.pageXOffset;
		yMousePosMax = window.innerHeight+window.pageYOffset;
	}
}

function showMessageBox(html)
{
	document.getElementById('MessageBoxP').innerHTML = html
	document.getElementById('MessageBox').style.visibility = 'visible';
	moveMessageBox()
}

function moveMessageBox()
{
	if (document.getElementById('MessageBox').style.visibility == 'visible')
	{
		var msg = document.getElementById('MessageBox')
		msg.style.left = xMousePos 
		msg.style.top = yMousePos - 60
		
		while((parseInt(msg.style.left.replace('px','')) + parseInt(msg.offsetWidth)) > xMousePosMax)
		{
			msg.style.left = parseInt(msg.style.left) - 1;
		}
		while((parseInt(msg.style.top.replace('px','')) + parseInt(msg.offsetHeight)) > yMousePosMax)
		{
			msg.style.top = parseInt(msg.style.top) - 1;
		}

		window.setTimeout('moveMessageBox()', 10);
	}
}

function hideMessageBox()
{
	document.getElementById('MessageBox').style.visibility = 'hidden';
}

//MessageBox.End

function view(block)
{
   (block).style.display = ((block).style.display == "block") ? "none":"block";
   //alert((block).style.display)
   //Returns block if open
   //Returns none if closed
   linkstate = (block).style.display
}