//Global variables
var xmlHttp;
//These are used in the viewGallery function
var iGlobalGalleryCount;
var sElementID;
var iTotalGallery
//These are used in the searchOptions function
var iSportID
var iTypeID
var iOptionID
var iBrandID

function GetXmlHttpObject()
{ 
	var objXMLHttp=null

	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}

	return objXMLHttp
}

//-----------------------------------------------------------------------------------------------------
//These function controll the Password Recovery
function viewRecovery()
{
	sUsername = document.getElementById("retreiveUser").value
	//copy the contents of our local var to our global var for later use
	var url = "ajax-member-password-recovery.asp?sUsername=" + sUsername;

	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}

	document.getElementById("recovery").innerHTML						= ""
	document.getElementById("recovery").style.display					= "none";
	document.getElementById("recoveryLoading").style.display			= "inline";

	xmlHttp.onreadystatechange=stateChanged_viewRecovery
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged_viewRecovery() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("recovery").innerHTML					= xmlHttp.responseText;
		document.getElementById("recovery").style.display				= "inline";
		document.getElementById("recoveryLoading").style.display		= "none";
	} 
} 