
function CheckfieldsOperatorReg() 
{ 
	
	val =Trim(document.frmOperatorRegistration.OtxtLoginName.value);
	if (val == "")
	{
		alert("LoginName field cannot be left blank. Please Enter the Login Name");
		document.frmOperatorRegistration.OtxtLoginName.focus();
		return false;
	}
	document.frmOperatorRegistration.OtxtLoginName.value = val;
	
	val = Trim(document.frmOperatorRegistration.OtxtPassword.value);
	if (val == "")
	{
		alert("Password field cannot be left blank.");
		document.frmOperatorRegistration.OtxtPassword.focus();
		return false;
	}
	
	val =Trim(document.frmOperatorRegistration.OtxtRetypePassword.value);
	if (val == "")
	{
		alert("Retype Password cannot be left blank.");
		document.frmOperatorRegistration.OtxtRetypePassword.focus();
		return false;
	}
	
	val=Trim(document.frmOperatorRegistration.OtxtPassword.value);
	val1 =Trim(document.frmOperatorRegistration.OtxtRetypePassword.value);
	if(val != val1)
	{
			alert("Retype Password not Matching");
			document.frmOperatorRegistration.OtxtRetypePassword.focus();
			document.frmOperatorRegistration.OtxtRetypePassword.select();
			return false;
	}
	return true;
}
 //Function to execute at the time of Page load to keep the focus on the User Id Text Box
 
 
 function fnFocus()
		{	
		//Testing for Working of this functionality..
		alert("dsfdf");
		
		window.document.all("UserLogin1_txtUserId").focus();
		}

//Function to Check for Validation of the Input fields in the Login Control
function ChkFieldsforLogin()
{

	if(IsBlank(window.document.all("UserLogin1_txtUserId").value)) 
			{
			alert("Please enter your Login ID & password");
			window.document.all("UserLogin1_txtUserId").focus();
			window.document.all("UserLogin1_txtUserId").select();
			return false;
			}
	        
	if(IsBlank(window.document.all("UserLogin1_txtPassword").value)) 
			{
			alert("Please enter Password !!");
			window.document.all("UserLogin1_txtPassword").focus(); 
			window.document.all("UserLogin1_txtPassword").select(); 
			return false;
			}
	return true;

}



//Function to Check for the Blanks in the String..

function IsBlank(s)
			{
					var l;
					if(s!="") 
					{	
						l=s.length;
						for(i=0;i<l;i++) 
						{
							if(s.charAt(i)!=" ") 
							{
								return false;
							}
						}
					} 
					return true;
			}


	
			/*function Checkfields() 
			{ 
				if (window.document.all("ddlCountry").value==0)
				{
					alert("Please Choose Country")
					document.forms[0].ddlCountry.focus();
					return false
				}	
			
			
			return true;
			}*/
			
			function fncheck()
			{
				val=Trim(window.document.all("ddlBranchCity").value);
				if (val == 0)
				{
					alert("Please select Branch");
					return false
				}
				else
				{
				return true
				}
			
			}
			
			
		history.forward();
			
		
		
		var statusmsg=""
		function hidestatus()
		{
			window.status=statusmsg;
			return true;
		}
	
			
		
		
		//Validation funtion called for the validation of the input fields in the GuestLogin.aspx
		function CheckfieldsG() 
		{
		
				
					val=Trim(document.frmGuestLogin.txtID.value);
							
					if (val == "")
					{
						alert("Please Enter Your Name.");
						document.frmGuestLogin.txtID.focus();
						return false;
					}
					if (val != "")
					{
						if (!isAlphabetsOnly(val))
							{
								alert("Name can contain only characters and spaces");
								document.frmGuestLogin.txtID.focus();
								document.frmGuestLogin.txtID.select();		
								return false;
							}
					}
					
					var val=Trim(document.frmGuestLogin.TxtAcceptInput.value);
					if (val == "") 
					{
						alert("Enter the code shown");
						document.frmGuestLogin.TxtAcceptInput.value = "";
						document.frmGuestLogin.TxtAcceptInput.focus();
						return false;
					}
				
				return true;
				
		}
		
		function fnLogin()
		{
			window.parent.location.href="./visas.aspx"
		}
		
		
		
//Function to Change the Color of the Link on Mouse Over Event

function  mouseover()
			{
				window.event.srcElement.style.color="blue";
				window.event.srcElement.style.cursor="Hand";
			}
			

//Function to Change the Color back to original of the Link on Mouse Out Event
function  mouseout()
		{
			window.event.srcElement.style.color="#808080";
			window.event.srcElement.style.cursor="Hand";
		}
		
		//Used in Track Document
		
		function isRNumber()
		{

			/*if(window.document.all("ddlCountry").selectedIndex == 0)
			{
				alert("Select a country.");
				return false;
			}
			else */
			if(!isNumber(window.document.all("txtRNo").value))
			{
				alert("Enter a valid receipt number.");
				return false;
			}
		}
		
		function isRNumberAdmin()
		{
			if(!isNumber(window.document.all("txtRNo").value))
			{
				alert("Enter a valid receipt number.");
				return false;
			}
		}
		
		
		//Function to Check the Input for the ChangePassword Page..!
		
		
		function CheckfieldsChangePassword() 
			{ 
			
				val = Trim(document.frmChangePassword.txtLoginName.value);
				if (val == "")
				{
					alert("Please Enter Login name");
					document.frmChangePassword.txtLoginName.focus();
					return false;
				}				
				val = Trim(document.frmChangePassword.txtoldpassword.value);
				if (val == "")
				{
					alert("Please Enter your old Password");
					document.frmChangePassword.txtoldpassword.focus();
					return false;
				}				
				val = Trim(document.frmChangePassword.txtNewPassword.value);
				val1 = Trim(document.frmChangePassword.retypenewpassword.value);
				if (val == "")
				{
					alert("Please Enter Your New Password");
					document.frmChangePassword.txtNewPassword.focus();
					return false;
				}				
							
				if (val1 == "")
				{
					alert("Please Enter Retype Password");
					document.frmChangePassword.retypenewpassword.focus();
					return false;
				}		
			
				
				if(val != val1)
				{
						alert("Passwords not Matching. Please Retry.");
						document.frmChangePassword.retypenewpassword.focus();
						document.frmChangePassword.retypenewpassword.select();
						return false;
				}
			
				val = Trim(document.frmChangePassword.txtoldpassword.value);
				val1 = Trim(document.frmChangePassword.txtNewPassword.value);
				
				if(val == val1)
				{
						alert("Sorry!.. Entered value same as your old password. Please enter your new password");
						document.frmChangePassword.txtNewPassword.focus();
						document.frmChangePassword.txtNewPassword.select();
						return false;
				}
				
				return true;
	
			}
			
			
			
			//Function for Validatioin of the Input fields in Operator Registration Form.
			
			function CheckfieldsOperatorRegistration() 
		{ 
				
				val =Trim(document.frmOperatorRegistration.txtLoginName.value);
				if (val == "")
				{
					alert("LoginName field cannot be left blank. Please Enter the Login Name");
					document.frmOperatorRegistration.txtLoginName.focus();
					return false;
				}
				document.frmOperatorRegistration.txtLoginName.value = val;
				
				val = Trim(document.frmOperatorRegistration.txtPassword.value);
				if (val == "")
				{
					alert("Password field cannot be left blank.");
					document.frmOperatorRegistration.txtPassword.focus();
					return false;
				}
				
				val =Trim(document.frmOperatorRegistration.txtRetypePassword.value);
				if (val == "")
				{
					alert("Retype Password cannot be left blank.");
					document.frmOperatorRegistration.txtRetypePassword.focus();
					return false;
				}
				
				val=Trim(document.frmOperatorRegistration.txtPassword.value);
				val1 =Trim(document.frmOperatorRegistration.txtRetypePassword.value);
				if(val != val1)
				{
						alert("Retype Password not Matching");
						document.frmOperatorRegistration.txtRetypePassword.focus();
						document.frmOperatorRegistration.txtRetypePassword.select();
						return false;
				}
						
				
				
				return true;
			}
