﻿// JScript File

function GetVScroll()
{
	var VScroll = 0;
	if ( navigator.appName.substring(0,3) == "Net" )
		VScroll = document.documentElement.scrollTop;
	else
	{
		if ( document.documentElement )
		{
			// IE DocType >= 4.01
			VScroll = document.documentElement.scrollTop;
		}
		else
		{
			// IE DocType < 4.01
			VScroll = document.body.scrollTop;
		}
	}
	return VScroll;
}


function SetVScroll( VScroll )
{
	if ( navigator.appName.substring(0,3) == "Net" )
		document.documentElement.scrollTop = VScroll;
	else
	{
		if ( document.documentElement )
			// IE DocType >= 4.01
			document.documentElement.scrollTop = VScroll;
		else
			// IE DocType < 4.01
			document.body.scrollTop = VScroll;
	}
}



/*document.onmousemove = MouseMoveHandler;

var PosX=0, PosY=0;

var ZoomDivStyle = null;
ZoomDivStyle = document.getElementById("ZoomDiv").style;
if ( navigator.appName.substring(0,3) == "Net" )
{
	document.captureEvents( Event.MOUSEMOVE );
}

function MouseMoveHandler(e)
{
	if ( navigator.appName.substring(0,3) == "Net" )
	{
		// Netscape, Firefox
		PosX = e.pageX;
		PosY = e.pageY;
	}
	else if ( document.documentElement )
	{
		// IE DocType >= 4.01
		PosX = event.x + document.documentElement.scrollLeft;
		PosY = event.y + document.documentElement.scrollTop;
	}
	else
	{
		// IE DocType < 4.01
		PosX = event.x + document.body.scrollLeft;
		PosY = event.y + document.body.scrollTop;
	}
	ZoomDivStyle.left = PosX + 10;
	ZoomDivStyle.top = PosY + 5;
	window.status = PosX +"-"+ PosY;
}



/*var ZoomDivStyle = null;
if ( document.getElementById )
{
	ZoomDivStyle = document.getElementById("ZoomDiv").style;
	/*if ( navigator.appName.substring(0,3) == "Net" )
		document.captureEvents( Event.MOUSEMOVE );
}* /


function ZoomImage( img_url )
{
	var content = "<img alt=\"\" src=\"" + img_url + "\" />";
	if ( document.getElementById )
	{
  	document.getElementById("ZoomDiv").innerHTML = content;
  	ZoomDivStyle.visibility = "visible";
	}
}


function CloseZoom()
{
	if ( document.getElementById )
	{
  	document.getElementById("ZoomDiv").innerHTML = "";
		ZoomDivStyle.visibility = "hidden";
	}
}*/



var req = null;
//var XMLResult = null;

function CPCall(url)
{
  if (window.XMLHttpRequest)
  {
		// branch for native XMLHttpRequest object
    req = new XMLHttpRequest();
    req.onreadystatechange = PRC;
    req.open("GET", url, true);
    req.send(null);
    //alert( "sent" );
  } 
  // branch for IE/Windows ActiveX version
  else if (window.ActiveXObject)
  {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    if (req)
    {
      req.onreadystatechange = PRC;
      req.open("GET", url, true);
      req.send();
    }
  }
}


function isAjaxEnabled()
{
  if (window.XMLHttpRequest)
  {
		return true;
  }
  else
  {
		try
		{
			var test = new XMLHttpRequest();
			return true;
		}
		catch (ex)
		{
			return false;
		}
	}
} 
/*function PRC() 
{
  // only if req shows "complete"
  if (req.readyState == 4)
  {
      // only if "OK"
      if (req.status == 200)
      {
          XMLResult = req.responseText;
      }
      else
      {
          //alert("There was a problem retrieving the XML data:\n" + req.statusText);
      }
  }
}*/


function KeyPressSubmit( e, SubmitBtnID )
{
	if ( !e )
		e = window.event;
	if ( e.keyCode == 13 )
	{
		document.getElementById(SubmitBtnID).focus();
		document.getElementById(SubmitBtnID).click();
	}
}