function changeText()
{
	if(document.getElementById("txtKeyword").value == "By Keywords")
	{
		document.getElementById("txtKeyword").value = "";
	}
}

function changeText2()
{
	if(document.getElementById("txtKeyword").value == "")
	{
		document.getElementById("txtKeyword").value = "By Keywords";
	}
}

function checkBlank()
{
	if(document.getElementById("txtKeyword").value == "")
	{
		document.getElementById("txtKeyword").focus();
		return false;
	}
	if(document.getElementById("txtKeyword").value == "By Keywords")
	{
		alert('You have to enter a keyword');
		document.getElementById("txtKeyword").value = "";
		document.getElementById("txtKeyword").focus();
		return false;
	}
	return true;
}

function CheckFunction()
{
	if(document.getElementById('txtUserName').value=="") 
	{
		alert('Please input username properly');
		document.getElementById('txtUserName').focus();
		return false;
	}
	if(document.getElementById('txtPassword').value=="")
	{
		alert('Please input password properly');
		document.getElementById('txtPassword').focus();
		return false;
	}
	return true;
}

function Validate()
{
	if(document.getElementById('txtReceiverName').value=="") 
	{
		alert('Please input receiver name properly');
		document.getElementById('txtReceiverName').focus();
		return false;
	}
	if(document.getElementById('txtEmail').value=="")
	{
		alert('Please input Email properly');
		document.getElementById('txtEmail').focus();
		return false;
	}
	if(document.getElementById('txtSenderName').value=="")
	{
		alert('Please input sender name properly');
		document.getElementById('txtSenderName').focus();
		return false;
	}
	
	return checkemail();
	
	//return true;
}

function checkemail()
{
 var str = document.getElementById("txtEmail").value;
 var filter = /^.+@.+\..{2,3}$/;

 if (filter.test(str))
    return true;
 else 
 {
    alert("Please input a valid email address!");
	//document.getElementById("txtEmail").value = "";
	document.getElementById("txtEmail").focus();
    return false;
 }
}

// This Function Checks the textbox empty or not.
function emptyCheck()
{
	//alert("Pass Word Is Empty." );
	//var valueOfTextBox1 = document.getElementById("password").value;
	//var valueOfTextBox2 = document.getElementById("newPassword").value;
	//var valueOfTextBox3 = document.getElementById("newPassword2").value;
	//alert(valueOfTextBox1)
	//alert(valueOfTextBox2)
	//alert(valueOfTextBox3)
	if(document.getElementById("txtPassword").value == "")
	{
		alert("Fill old password." );
		document.getElementById("txtPassword").focus( );
		return false;
	}
	
	if(document.getElementById("txtNewPassword").value == "")
	{
		alert("Fill new password." );
		document.getElementById("txtNewPassword").focus( );
		return false;
	}
	
	if(document.getElementById("txtConfirmPassword").value == "")
	{
		alert("Fill confirm password." );
		document.getElementById("txtConfirmPassword").focus( );
		return false;
	}
	
	if(document.getElementById("txtNewPassword").value != document.getElementById("txtConfirmPassword").value)
	{
		alert("Confirm password does not match." );
		document.getElementById("txtConfirmPassword").value = "";
		document.getElementById("txtConfirmPassword").focus( );
		
		return false;
	}
	
	else
	{
		return true;
	}
}

function PageSubmit()
{
	
	document.getElementById('txtHidden').value = "Edit Information";
	document.getElementById('frmEdit').submit();
}