function createAjax()
{
	var xt;
	xt = window.XMLHttpRequest ? new XMLHttpRequest() : ( window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : null)

	return xt;
}


function changediv(str)
{
	if(str)
	{
		document.getElementById('test_forgot').style.display='block';	
		document.getElementById('test_login').style.display='none';	
	}else
	{
		document.getElementById('test_forgot').style.display='none';	
		document.getElementById('test_login').style.display='block';	
	}
}
function getid(str)
{
	return document.getElementById(str);
}

function clearerror(str)
{
  		document.getElementById('error').innerHTML='';
}
function getselectbox(nami)
{
	var nami = document.getElementsByName(nami)[0];
	if(nami) return nami.options[nami.selectedIndex].value
	else return null
}



function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

