// Differentiates between IE and Firefox/Netscape to perform a history.go() function
function goBack(amount)
{
	if (amount == undefined)
	{
		amount = -1;
	}
	
	if (navigator.appName != "Microsoft Internet Explorer")
	{
		history.go(amount);
	}
	else
	{
		history.go(amount - 1);
	}
}

// Removes leading whitespaces
function LTrim( value )
{	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");	
}

// Removes ending whitespaces
function RTrim( value )
{	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");	
}

// Removes leading and ending whitespaces
function trim( value )
{	
	return LTrim(RTrim(value));
}

// THESE JAVASCRIPT FUNCTION CONTROL HOW INPUT BOXES BEHAVE
function GotFocus(obj)
{
	obj.style.borderColor="#385E8E";
	obj.style.borderStyle="solid";	
	obj.style.backgroundColor="#F5F5F5";
}

function LostFocus(obj)
{
	obj.style.borderColor="#8F8F92";
	obj.style.borderStyle="solid";
	obj.style.backgroundColor="#FFFFFF";
}

function getPageHeight(windowObj){
	if (windowObj.innerHeight && windowObj.scrollMaxY) {// Firefox
		yWithScroll = windowObj.innerHeight + windowObj.scrollMaxY;
	} else if (windowObj.body.scrollHeight > windowObj.body.offsetHeight) { // all but Explorer Mac
		yWithScroll = windowObj.body.scrollHeight;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = windowObj.body.offsetHeight;
  	}
	
	return yWithScroll;
}