// JavaScript Document
function footprint_valid()
{

uname = document.getElementById('username').value;
user_email = document.getElementById('useremail').value;
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
var numExp = /^[0-9\,]+$/;



if (uname != "")
	  {
		   var temp = uname;
		   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
		   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
		   var obj = / +/g;
		   temp = temp.replace(obj, " ");
		   if (temp == " ") { temp = ""; }
		   uname=temp;	
		   var alphanumExp=/^[a-zA-Z0-9\s,.]+$/
		   if(!uname.match(alphanumExp))
		   {
			   alert("Please donot use special charactres in names.");
			  document.getElementById('username').focus();
			   return false;
		   }
	  }

if (uname != "")
	 {
		 var str=uname;
		
		 if(str.charAt(0)=='.' || str.charAt(0).match(numExp))
		 {
		 alert("Invalid username");
		
		  document.getElementById('username').focus();
		  return false;
		 }
		 
	 }

if(uname == "")
{
	alert("Name is Required");
	document.getElementById('username').focus();
	return false;
}






if(user_email == "")
{
	alert("Email is Required");
	document.getElementById('useremail').focus();
	return false;
}

 if(!user_email.match(emailExp))
	{		
		alert("Invalid email format");
		document.getElementById('useremail').focus();
		return false;
	}
return true;
}


function invitation()
{

fname = document.getElementById('friend_name').value;
femail = document.getElementById('friend_email').value;
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;

if(fname == "")
{
	alert("Name is Required");
	document.getElementById('friend_name').focus();
	return false;
}

if(femail == "")
{
	alert("Email is Required");
	document.getElementById('friend_email').focus();
	return false;
}

 if(!femail.match(emailExp))
	{		
		alert("Invalid email format");
		document.getElementById('friend_email').focus();
		return false;
	}
return true;
}

function withdrawal()
{

amount = document.getElementById('amount').value;
var numExp = /^[0-9]+$/;

if(amount == "")
{
	alert("Amount is Required");
	document.getElementById('amount').focus();
	return false;
}
return true;
}
