// JavaScript Document

var xmlHttp

// show email options
function showEvent(str)
{

if (str.length==0)
{ 
document.getElementById("roll_div").innerHTML=""
return
}


//checks if browser can support HTTP request
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}        

//Defines the url (filename) to send to the server
var url="/includes/roll.lasso"

url=url+"?rec="+str+"&x="+xMousePos+"&y="+yMousePos+"&xmax="+xMousePosMax+"&ymax="+yMousePosMax
// url=url+"&sid="+Math.random()

//Creates an XMLHTTP object, and tells the object to execute a function called stateChanged when a change is triggered
xmlHttp.onreadystatechange=stateChanged 
//Opens the XMLHTTP object with the given url
xmlHttp.open("GET",url,true)
//Sends an HTTP request to the server
xmlHttp.send(null)

} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   { 
   document.getElementById("roll_div").innerHTML=xmlHttp.responseText 
   } 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
return objXMLHttp
}
