var xmlHttp;

//Will attempt to crate XMLHttpRequest object if the browser supports it.
function verifyBrowser()
{  
	try
	{ 
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();    
	}
	catch (e)
	{    
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			}
			catch (e)
			{        
				alert("Your browser does not support AJAX!");        
				return false;        
			}     
		}    
	} 
}

/* adds a function to the onload event handler */
function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}

/*	Detects the browser */
function detectBrowser()
{
	var browser = navigator.appName;
	return browser;
}

//Will adjust the height of an element
function adjustHeightRealTime(element)
{
	if(typeof(element) != "object")
		element = document.getElementById(element);
	
	element.style.height = element.scrollHeight+"px";
}