﻿// JScript File

var isIE = document.all;
var mouseX = 0;
var mouseY = 0;

function getMouseXY(e)
{ 
  if (!e) e = window.event;
  if (e)
  { 
  	mouseX = isIE ? (e.clientX + document.body.scrollLeft) : e.pageX;
  	mouseY = isIE ? (e.clientY + document.body.scrollTop) : e.pageY;
  }
}

function getAJAXProducts(URL, div)
{
    ShowLeft(div);
    document.getElementById(div).innerHTML = "";    

	var xmlObj;
	var xmlhttp;
	
	xmlHttp=GetXmlHttpObject()

	if (xmlHttp == null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	URL = URL + "&random=" + Math.random();
    xmlHttp.open("GET", URL, true);
    xmlHttp.onreadystatechange=function(){
           if (xmlHttp.readyState==4) {  
                 PutInDiv(xmlHttp.responseText, div);
           }
    }

    xmlHttp.send(null)
}           
        
function GetXmlHttpObject()
{ 
	var objXMLHttp=null

	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	
	return objXMLHttp
}          

function PutInDiv(theText, Div)
{     
      document.getElementById(Div).innerHTML = theText;                             
}

function Hide(ToShow)
{
      var O1 = document.getElementById(ToShow);
      O1.style.display = 'none';               
}

function ShowLeft(ToShow)
{      
      var O1 = document.getElementById(ToShow);
      O1.style.display = '';  

      O1.style.left = mouseX - 70 + "px";
      O1.style.top = mouseY;
}

document.onmousemove = getMouseXY;

