// JavaScript Document

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function toggleTypeAndHitEnter(oText, action)	{
	sMessage			=	"Type and hit enter";
	
	oText.value			=	trim(oText.value);
	if(action == "onclick")	{
		if(oText.value == sMessage)
			oText.value	=	"";
	}
	else	{
		if(oText.value == "")
			oText.value	=	sMessage;
	}
}


function toggleTypeAndHitEnter2(oText, action)	{
	sMessage			=	"email@address.com";
	
	oText.value			=	trim(oText.value);
	if(action == "onclick")	{
		if(oText.value == sMessage)
			oText.value	=	"";
	}
	else	{
		if(oText.value == "")
			oText.value	=	sMessage;
	}
}
//readers
function readers() {
	random_num = 119+(Math.round(Math.random()*4))
	document.write("<span class=textBlue>There are <b>"+random_num+" readers</b> online now.</span>");
}


