// JavaScript Document
function LTrim(value) {
	
	//alert(value);
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	//alert(value);
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) {
	
	return LTrim(RTrim(value));
	
}

function emailvalidation(str)
{
	var emailRegxp = /^[a-zA-Z]*[\w\.-]*[a-zA-Z0-9]@[a-zA-Z]*[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
	//alert(emailRegxp.test(str));
	return emailRegxp.test(str);
}

function namehide(obj)
{
	if(obj.value=='Name') 
	{ 
		obj.value=''; 
	}
	
}

function nameshow(obj)
{
	if(obj.value!='Name' && trim(obj.value)=='') 
	{
		obj.value='Name'
	}
}

function emailaddresshide(obj)
{
	if(obj.value=='Email Address') 
	{ 
		obj.value=''; 
	}
		
}

function emailaddressshow(obj)
{
		
	if(obj.value!='Email Address' && trim(obj.value)=='') 
	{ 
		obj.value='Email Address'
	}
	
}

function phonenohide(obj)
{
	if(obj.value=='Phone No.') 
	{ 
		obj.value=''; 
	}
}

function phonenoshow(obj)
{
	if(obj.value!='Phone No.' && trim(obj.value)=='') 
	{ 
		obj.value='Phone No.'
	}
}

