﻿function clsAJAX()
{
	var mAJAXRequest = createXMLHttp();
	this.ajaxRequest = mAJAXRequest;
	this.open = open;
	this.send = send;

	function createXMLHttp()
	{
		try
		{
			// Opera 8.0+, Firefox, Safari
			return(new XMLHttpRequest());
		}
		catch (e)
		{
			// Internet Explorer Browsers
			try
			{
				return(new ActiveXObject("Msxml2.XMLHTTP"));
			}
			catch (e)
			{
				try
				{
					return(new ActiveXObject("Microsoft.XMLHTTP"));
				}
				catch (e)
				{
					return false;
				}
			}
		}
	}
	function open(strType, strURL, blnAsynchronous)
	{
		mAJAXRequest.open(strType, strURL, blnAsynchronous);
	}

	function send()
	{
		mAJAXRequest.send(null);
	}
}
function blinkYellow(htmlObj, intNumTimes, intSpeed)
{
	recursiveYellowFade(htmlObj.id, 0, intNumTimes, intSpeed);
}
function recursiveYellowFade(strElementId, intBlue, intNumTimes, intSpeed)
{
	var objElement = document.getElementById(strElementId);

	if(intBlue <= 255)
	{
		intBlue = intBlue + intSpeed;
		objElement.style.background = "rgb(255, 255, " + intBlue + ")";

		var strTimeoutCommand = "recursiveYellowFade('" + strElementId + "', "+intBlue+", "+intNumTimes+", " +intSpeed+ ")";
		setTimeout(strTimeoutCommand, 1);
	}
	else
	{
		if(intNumTimes != 0)
		{
			intNumTimes = intNumTimes - 1;
			var strTimeoutCommand = "recursiveYellowFade('" + strElementId + "', 0, "+intNumTimes+", " +intSpeed+ ")";
			setTimeout(strTimeoutCommand, 1);
		}
	}
}