//	FILE HEADER BLOCK	
/*
	iSMARTS  Version
	Copyright (C) 2003.Comsoft Infotech Pvt. Ltd  All Rights Reserved.
	Module Name    		: eTicketWeb
	File Name      		: eticketweb_user_registration.js
	Created By     	    : Rahul Bhaskarwar
	Created Date   	    : 22/04/2009
	Version			    : 1.1
	Reason	   		    : The Code for Paulo and Prasanna Files are merged into one interface. 
	Assumptions	   		: -
	Links          		: 
	Modified By   	 	: 
	Modified Date  		: 
	Reason	   			: -
	Version				: -
	Functions in File	: - 
						1) onCancel() 
						
					
*/

//	FUNCTION HEADER BLOCK	

/*
	Function Name: onVerifyLoginId()
	Description	 : This function is used to register the user.
	Parameter	 : 
	Author		 : Jay Prakash verma
	Return Type	 : -
*/
function onVerifyLoginId()
{
	var strLoginId = document.forms[0].txtLoginId.value;

	if(document.forms[0].txtLoginId.value == "")
	{
		alert("Please enter Login Id.");
		document.forms[0].txtLoginId.select();
		//document.forms[0].txtLoginId.focus();
		return ;
	}

	if(document.forms[0].txtLoginId.value!="")
	{
		if(!AlphabetsNotAllowed(document.forms[0].txtLoginId.value,document.forms[0].txtLoginId,'Login Id','!@%~`#<^>./|?*"\'$&{}[],()+=\\:;,'))		
		return;
	}
	
	if(OnlyAlpabateVerification(document.forms[0].txtLoginId.value)== 0)
	{
		alert("Please enter the valid Login Id. Login Id should contain atleast one alphabet.");
		document.forms[0].txtLoginId.select();
		return;
	}
	document.forms[0].hidVerifyLoginIdFlag.value = "";	
	var strUrl = "eticketweb_user_verify_loginId_process.jsp?hidLoginId="+strLoginId;
	window.open(strUrl,'iSMARTS1','width=25,height=25,left=0,top=0,scrollbars=yes,resizable=yes,status=yes');	
	
}

//**FUNCTION onSave() STARTS **/
/*
Function Name	 : onCancel()
Description		 : Function calls the validate() function.
Parameter		 : - 
Author			 : Jay Prakash Verma
Return Type		 : -
*/

function onCancel()
{
	//var obj	=	document.frmUserRegistration;
	
	//obj.method = "post";
	//obj.action = "eticketweb_home_page.jsp";
	//obj.submit();

	document.frmUserRegistration.method = "post";
	document.frmUserRegistration.action = "loginController.do";
	document.frmUserRegistration.submit();
}

//**FUNCTION onSave() STARTS **/
/*
Function Name	 : onSaveUserReg()
Description		 : This function is used to register the user.
Parameter		 : - 
Author			 : Jay Prakash Verma
Return Type		 : -
*/

function onSaveUserRegister()
{
	var strLoginTypeFlag = document.frmUserRegistration.hidLoginTypeFlag.value;
	if(!validationUserRegForm())
		return;

	if(strLoginTypeFlag == "Y")
	{
		var intRdoLen = document.forms[0].rdoUserType.length;
		
		for(var i=0;i<intRdoLen;i++)
		{
			if(document.forms[0].rdoUserType[i].checked==true)
			{
				document.frmUserRegistration.hidLoginType.value = "C";
				break;
			}
			else
			{
				document.frmUserRegistration.hidLoginType.value = "A";
				break;
			}
		}
	}
	else
	{
		document.frmUserRegistration.hidLoginType.value = "C";
	}
	
	
	if(document.frmUserRegistration.chkPromotionalEmail.checked){
		document.frmUserRegistration.hidPromotionalEmail.value="Y";

	}else{
		document.frmUserRegistration.hidPromotionalEmail.value="N";
	}
	//if(document.frmUserRegistration.chkRecConfByEmail.checked){
	//	document.frmUserRegistration.hidRecConfByEmail.value="Y";

	//}else{
	//	document.frmUserRegistration.hidRecConfByEmail.value="N";
	//}
	
	document.frmUserRegistration.method = "post";
	document.frmUserRegistration.action = "eticketweb_user_registration_process.jsp";
	document.frmUserRegistration.submit();
	
}

/*
	Function Name: validationNewUserLogin()
	Description	 : This is used for validation on new user login page.
	Parameter	 : String 
	Author		 : 
	Return Type	 : -
*/

function validationUserRegForm()
{
	var strObj				= document.frmUserRegistration; 
	
	var strUserPrefix		= strObj.lstUserPrefix.value;	
	var strUserName			= trim(strObj.txtUserName.value);
	var strAddressFirst		= trim(strObj.txtAddressFirst.value);
	var strAddressSecond	= trim(strObj.txtAddressSecond.value);
	var strCityName			= trim(strObj.txtCityName.value);
	var strPin				= trim(strObj.txtPin.value);
	var strCountryName		= trim(strObj.txtCountryName.value);
	var strPhoneNo			= trim(strObj.txtPhoneNo.value);
	var strMobileNo			= trim(strObj.txtMobileNo.value);
	var strEmailId			= trim(strObj.txtEmailId.value);
	
	//var strRecConfByEmail	= trim(strObj.chkRecConfByEmail.value);
	var strPromotionalEmail	= trim(strObj.chkPromotionalEmail.value);
	var strLoginId			= trim(strObj.txtLoginId.value);
	var strPassword			= trim(strObj.txtPassword.value);
	var strConfPassword		= trim(strObj.txtConfPassword.value);

	
	//User Type Validation
	if(strUserPrefix=="" || strUserPrefix=='undifined' || strUserPrefix == "0" )	
	{
		alert("Please select Prefix.");
		strObj.lstUserPrefix.focus();	
		return;
	}

	//UserName Validation
	if(strUserName == "") {
		alert("Please enter Name.");	
		strObj.txtUserName.select();
		strObj.txtUserName.focus();
		return ;
	}

	if(strObj.txtUserName.value != "")
	{
		if(!AlphabetsNotAllowed(strObj.txtUserName.value,strObj.txtUserName,'Name','!@%()_-+=|\/,.`:;~`#<^>|?*"\'$&\\[]{}'))			
		return;

		if(OnlyAlpabateNotAllowed(strObj.txtUserName.value)) {
			alert("Only alphabets are allowed in Name.");
			strObj.txtUserName.focus();
			strObj.txtUserName.select();
			return;
		}
		if(strObj.txtUserName.value.length > 100) {
			alert("Name cannot be greater than 100 characters.");
			strObj.txtUserName.focus();
			strObj.txtUserName.select();
			return;
		}
	}

	/*if(!OnlyNumricNotAllowed(strObj.txtUserName.value))  {
		alert("Only numeric values are not allowed in Name.");
		strObj.txtUserName.select();
		strObj.txtUserName.focus();
		return;
	}*/

	
	//Address 1 Validation
	if(strAddressFirst == "") {
		alert("Please enter Address 1.");
		strObj.txtAddressFirst.focus();
		strObj.txtAddressFirst.select();
		return false;
	}
	/*if(!OnlyNumricNotAllowed(strObj.txtAddressFirst.value))	{
		alert("Only numeric values are not allowed in Address 1.");
		strObj.txtAddressFirst.select();
		strObj.txtAddressFirst.focus();
		return;
	}*/

	if(!AlphabetsNotAllowed(strObj.txtAddressFirst.value,strObj.txtAddressFirst,'Address 1','!@%~`<^>_|?*$&+="[]{}:;\\'))			
	return;

	//Address 2 Validation.
	if(strAddressSecond!="")
	{		
		/*if(!OnlyNumricNotAllowed(strObj.txtAddressSecond.value))	{
			alert("Only numeric values are not allowed in Address 2.");
			strObj.txtAddressSecond.select();
			strObj.txtAddressSecond.focus();
			return;
		}*/
		if(!AlphabetsNotAllowed(strObj.txtAddressSecond.value,strObj.txtAddressSecond,'Address 2','!@%~`_<^>|?*$&+=[]"{}:;.\\'))			
		return;
	}

	//City Name Validation

	if(strCityName == "") {
		alert("Please enter City.");
		strObj.txtCityName.focus();
		strObj.txtCityName.select();
		return ;	
	}

	if(strCityName!= "")
	{
		if(!AlphabetsNotAllowed(strObj.txtCityName.value,strObj.txtCityName,'City','!\/@%~`#<^>|?*"\'$&;:(-)_+={}[],.'))	
		return;

		if(OnlyAlpabateNotAllowed(strObj.txtCityName.value))
		{
			alert("Only alphabets are allowed in City Name.");
			strObj.txtCityName.focus();
			strObj.txtCityName.select();
			return;
		}
		if(strObj.txtCityName.value.length > 50)
		{
			alert("City Name cannot be greater than 50 characters.");
			strObj.txtCityName.focus();
			strObj.txtCityName.select();
			return;
		}

		/*if(!OnlyNumricNotAllowed(strObj.txtCityName.value))	{
			alert("Only numeric values are not allowed in City.");
			strObj.txtCityName.select();
			strObj.txtCityName.focus();
			return;
		}*/

		
	}

	//Pin Code Validation
	if(strPin != "")
	{
		if(!AlphabetsNotAllowed(strObj.txtPin.value,strObj.txtPin,'Pin','!@%~`#<^>|?*$&_+=\|()\{}[]:;\',"<>.?/\\'))			
		return;

		if(!numericOnly(strObj.txtPin.value,strObj.txtPin, 
					'Pin','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')) {
			   strObj.txtPin.select();
			   strObj.txtPin.focus();
			   return;
		}

		if(strObj.txtPin.value.length>10)
		{
					alert("Pin cannot be greater than 10 characters.");
					strObj.txtPin.select();
					strObj.txtPin.focus();
					return;
		}
		
		
	
		/*if(!OnlyAlpabateNotAllowed(strObj.txtPin.value))	{
			alert("Only alphabets values are not allowed in Pin.");
			strObj.txtPin.select();
			strObj.txtPin.focus();
			return;
		}
	
		if(OnlyNumeric(strObj.txtPin.value))	
		{
			alert("Only numeric values are allowed in Pin.");
			strObj.txtPin.select();
			strObj.txtPin.focus();
			return;

		}*/

	}

	//Country Name Validation
	if(strCountryName!= "") 
	{

		if(!AlphabetsNotAllowed(strObj.txtCountryName.value,strObj.txtCountryName,'Country','!@%~`#;<^>|?*"\'$&()-_=+\{}[]:,/.\\'))			
		return;

		if(OnlyAlpabateNotAllowed(strObj.txtCountryName.value))
		{
			alert("Only alphabets are allowed in Country.");
			strObj.txtCountryName.focus();
			strObj.txtCountryName.select();
			return;
		}
		if(strObj.txtCountryName.value.length > 50)
		{
			alert("Country cannot be greater than 50 characters.");
			strObj.txtCountryName.focus();
			strObj.txtCountryName.select();
			return;
		}
		
	}
	//Phone No. Validation.
	if(strPhoneNo == "")
	{
		alert("Please enter Phone No.");
		strObj.txtPhoneNo.focus();
		strObj.txtPhoneNo.select();
		return false;
	}
	if(strPhoneNo!= "") {

		if(!AlphabetsNotAllowed(strObj.txtPhoneNo.value,strObj.txtPhoneNo,'Phone No','!@%~`#<^>|?*"\'$&_=\{[]}:;.\\'))			
		return;

		if(!numericOnly(strObj.txtPhoneNo.value,strObj.txtPhoneNo, 
						'Phone No','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'))
		{
		   strObj.txtPhoneNo.select();
		   strObj.txtPhoneNo.focus();
		   return;
		}

		if(strObj.txtPhoneNo.value.length>50)
		{
			alert("Phone No cannot be greater than 50 characters.");
			strObj.txtPhoneNo.select();
			strObj.txtPhoneNo.focus();
			return;
		}
	}

	/*if(OnlyNumeric(strObj.txtPhoneNo.value))	
	{
		alert("Only numeric values are allowed in Phone No.");
		strObj.txtPhoneNo.select();
		strObj.txtPhoneNo.focus();
		return;

	}

	if(OnlyNumeric(strObj.txtMobileNo.value))	
	{
		alert("Only numeric values are allowed in Mobile No.");
		strObj.txtMobileNo.select();
		strObj.txtMobileNo.focus();
		return;

	}*/


	/*if(!OnlyAlpabateNotAllowed(strObj.txtPhoneNo.value))	{
		alert("Only alphabets values are not allowed in Phone No.");
		strObj.txtPhoneNo.select();
		strObj.txtPhoneNo.focus();
		return;
	}*/

	//Mobile Number Validation
	if(strMobileNo!= "") {

		if(!AlphabetsNotAllowed(strObj.txtMobileNo.value,strObj.txtMobileNo,'Mobile No','!@%~`#<^>|?*"\'$&_=\{[]}:;.\\'))			
		return;
		
		if(!numericOnly(strObj.txtMobileNo.value,strObj.txtMobileNo, 
						'Mobile No','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'))
		{
		   strObj.txtMobileNo.select();
		   strObj.txtMobileNo.focus();
		   return;
		}

		if(strObj.txtMobileNo.value.length>50)
		{
			alert("Mobile No cannot be greater than 50 characters.");
			strObj.txtMobileNo.select();
			strObj.txtMobileNo.focus();
			return;
		}
		/*if(!OnlyAlpabateNotAllowed(strObj.txtMobileNo.value))	{
			alert("Only alphabets values are not allowed in Mobile No.");
			strObj.txtMobileNo.select();
			strObj.txtMobileNo.focus();
			return;
		}*/
		
	}
	//Compair Phone No & Mobile No. (Both Should Not Same.)

	if(strObj.txtPhoneNo.value == strObj.txtMobileNo.value) {
		alert("Phone No and Mobile No should be different.");
		strObj.txtMobileNo.select();
		strObj.txtMobileNo.focus();
		return;
	}

	//Email ID Validation
	if(strEmailId != "")
	{
		if(!isEmail(strObj.txtEmailId,'Email Id'))	
		return;

		if(!AlphabetsNotAllowed(strObj.txtEmailId.value,strObj.txtEmailId,'Email Id','~`#<^>|[]()?*"\'$&%'))			
		return;

	}
	//Validation if "Receive Confirmations by email" & "Receive promotional emails" are selected then Email Id Schould be enter.
	//if(strObj.chkRecConfByEmail.checked == true || strObj.chkPromotionalEmail.checked == true)
	if(strObj.chkPromotionalEmail.checked == true)
	{
		if(strEmailId == "")
		{		
			alert("Please enter Email Id");
			strObj.txtEmailId.select();
			strObj.txtEmailId.focus();

			return;	
		}
	}

	//Login Id Validation
	if(strLoginId=="")
	{
		alert("Please enter Login Id.");
		strObj.txtLoginId.focus();
		strObj.txtLoginId.select();
		return false;
	}

	if(!AlphabetsNotAllowed(strObj.txtLoginId.value,strObj.txtLoginId,'Login Id','!@%~`#<^>./|?*"\'$&{}[],()+=\\:;,'))			
	return;

	if((strObj.txtLoginId.value).length>100)
	{
		alert("Login Id cannot be greater than 100 characters.");
		strObj.txtLoginId.focus();
		strObj.txtLoginId.select();
		return;
	}

	if(document.forms[0].hidVerifyLoginIdFlag.value=="YES" || document.forms[0].hidVerifyLoginIdFlag.value=="")
	{
		alert("Please verify Login Id by clicking Verify Login Id button.");
		return ;
	}


	//Password Validation
	if(strPassword == "") {
		alert("Please enter Password.");
		strObj.txtPassword.focus();
		strObj.txtPassword.select();
		return false;
	}

	if(!AlphabetsNotAllowed(strObj.txtPassword.value,strObj.txtPassword,'Password','!@%~`#<^>|?*"\'$&'))			
	return;

	if((strObj.txtPassword.value).length>30)
	{
		alert("Password cannot be greater than 30 characters.");
		strObj.txtPassword.focus();
		strObj.txtPassword.select();
		return;
	}	   


	//Confirm Password Validation
	if(strConfPassword == "")
	{
		alert("Please enter Confirm Password.");
		strObj.txtConfPassword.focus();
		strObj.txtConfPassword.select();
		return false;
	}

	if(!AlphabetsNotAllowed(strObj.txtConfPassword.value,strObj.txtConfPassword,'Confirm Password.','!@%~`#<^>|?*"\'$&'))			
	return;

	if((strObj.txtConfPassword.value).length>30) 	{
		alert("Confirm Password cannot be greater than 30 characters.");
		strObj.txtConfPassword.focus();
		strObj.txtConfPassword.select();
		return;
	}


	if(strPassword != strConfPassword)
	{
		alert("Password and Confirm Password should be same.");
		strObj.txtPassword.focus();
		strObj.txtConfPassword.value = "";
		strObj.txtPassword.value	 = "";
		return;	
	}

	if(strObj.lstSecurityQue.value == "0")
	{
		alert("Please select Security Quection.");
		strObj.lstSecurityQue.focus();	
		return;	
	}

	if(strObj.txtSecurityAns.value == "")
	{
		alert("Please enter Security Answer.");
		strObj.txtSecurityAns.focus();	
		return;	
	}

	if(strObj.txtSecurityAns.value != "")
	{
		if(!AlphabetsNotAllowed(strObj.txtSecurityAns.value,strObj.txtSecurityAns,'Security Answer','!@%~`#<^>|?*"\'$&'))			
		return;

		if((strObj.txtSecurityAns.value).length>100)
		{
			alert("Security Answer cannot be greater than 100 characters.");
			strObj.txtSecurityAns.focus();
			strObj.txtSecurityAns.select();
			return;
		}
		if((strObj.txtSecurityAns.value).length<4)
		{
			alert("Security Answer should be greater than 4 characters.");
			strObj.txtSecurityAns.focus();
			strObj.txtSecurityAns.select();
			return;
		}
	}
	//Validation of the Duplicate Login ID
	//if(getValidLoginId());
	if (strObj.chkRegTerms.checked!=true){
		alert("Prior to registration, Please accept the Terms and Conditions.");
		strObj.chkRegTerms.focus();
		//strObj.chkRegTerms.select();
		//strObj.chkRegTerms.tabindex = 18;
		return;
	}

return true;
}//End of the Function.



/*
	Function Name		: numericOnly()
	Description			: Common function which is used to ristrict the alphabets.
	Parameter			: String strString, String strTextBoxName, String strMessage, String strBlockedLetters
	Author				: Jay Prakash Verma
	Return Type			: boolean
*/
function numericOnly(strString, strTextBoxName, strMessage,strBlockedLetters) {
	var strLetters = strBlockedLetters;
	var strTempAlphaNotAllowed; 
	var j=0;
	if(strString != "")  {
		for(var i=0;i<strLetters.length;i++)  {
			strTempAlphaNotAllowed = strLetters.charAt(i);
			if(strString.indexOf(strTempAlphaNotAllowed)!=-1)   {
				alert("Please enter numeric value for "+strMessage+".");
		 		strTextBoxName.select();
				strTextBoxName.focus(); 
				return false;
			}//end of if
		}//end of for
	 }//end of else
 return true;
}//end of

/*
	Function Name	  : OnlyAlpabateNotAllowed()
	Description		  : This function is used restrict the alphabets not allowed.
	Parameter		  : String strQtyVal
	Author			  : Jay Prakash verma
	Return Type		  : boolean
*/
function OnlyAlpabateNotAllowed(strQtyVal) {	
	var strNumbers = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. ";
	var strTemp; 
	if(strQtyVal != "") {
		for(var i=0; i<strQtyVal.length; i++) { 
			strTemp = strQtyVal.substring(i,i+1); 
			if(strNumbers.indexOf(strTemp)==-1) { 				
				return true;
			}
		}
	}	
	return;
}


/*
	Function Name: trim()
	Description	 : This is used for trim the value. 
	Parameter	 : String 
	Author		 : Jay Prakash Verma
	Return Type	 : -
*/

function trim(s) 
{
	while (s.substring(0,1) == ' ') 
	{
    	s = s.substring(1,s.length);
	}
	while (s.substring(s.length-1,s.length) == ' ') 
	{
    	s = s.substring(0,s.length-1);
	}
	return s;
}

/*
Function Name: OnlyNumricNotAllowed()
Description	 : This function is used Only numric are not allowed
Parameter	 : void
Author		 : Jay Prakash Verma
Return Type	 : -
*/
function OnlyNumricNotAllowed(qtyVal)
{	
	var ALLOWEDNUMBERS = "1234567890";
	var strTemp; 

	if(qtyVal != "") 
	{
		for(var i=0; i<qtyVal.length; i++)
		{ 
			strTemp = qtyVal.substring(i,i+1); 
			if(ALLOWEDNUMBERS.indexOf(strTemp)==-1)
			{ 
				return true;
			}
		}
	}
	return;
}

/*
Function Name: OnlyNumeric()
Description	 : Function to allow only numeric data.
Parameter	 : value
Author		 : Jay Prakash Verma
Return Type	 : boolean
*/

function OnlyNumeric(Val)
{	
	var ALLOWEDval = "0123456789";
	var strTemp; 

	if(Val != "") 
	{
		for(var i=0; i<Val.length; i++)
		{ 
			strTemp = Val.substring(i,i+1); 
			if(ALLOWEDval.indexOf(strTemp)==-1)
			{ 
				return true;
			}
		}
	}
	return;
}

/*
	Function Name: AlphabetsNotAllowed()
	Description	 : This is the common function which is used the notallowed alphabets.
	Parameter	 : boolean
	Author		 : Jay Prakash Verma
	Return Type	 : -
*/
function AlphabetsNotAllowed(sString, sTextBoxName, sMessage,sBlockedLetters) //n,n1,n2
{
	var strLetters = sBlockedLetters;
	var strTempAlphaNotAllowed; 
	var j=0;
	if(sString != "") 
	{
		for(var i=0;i<strLetters.length;i++)
		{
			strTempAlphaNotAllowed = strLetters.charAt(i);
			if(sString.indexOf(strTempAlphaNotAllowed)!=-1)
			{
				alert("Please enter a valid "+sMessage+". Special character "+strTempAlphaNotAllowed+" is not allowed.");
		 		sTextBoxName.select();
				sTextBoxName.focus(); 
				return false;
			}//end of if
		}//end of for
	 }//end of else
 return true;
}//end of

/*
Function Name: isEmail()
Description	 : Function to check validation for Email id
Parameter	 : strEmail_name,strLabel is provided which provides email id tht is to be checked along wih the lable
Author		 : jay Prakash Verma
Return Type	 : Boolean
*/
function isEmail(strEmail_name,strLabel) 
{
	var strEmail_value=strEmail_name.value;	
	if (!Validate_Email(strEmail_value))
	{			
		var strMsg="Please enter valid email address.";
   		alert(strMsg);
		strEmail_name.select();
		return false;
  	} 
	else	
	{
		return true;
	}	
}

/*
Function Name: Validate_Email()
Description	 : Function called to check validation for Email id .
Parameter	 : string is passed that is to be validated
Author		 : Jay Prakash Verma
Return Type	 : void
*/
 function Validate_Email(strEmailId) {
  var intPass = 0;
  if (window.RegExp) {
    var strTempStr = "a";
    var strTempReg = new RegExp(strTempStr);
    if (strTempReg.test(strTempStr)) intPass = 1;
  }
  if (!intPass) 
    return (strEmailId.indexOf(".") > 2) && (strEmailId.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new  RegExp("^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]*[a-zA-Z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\}\\~]\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3} )(\\]?)$");

  	return (!r1.test(strEmailId) && r2.test(strEmailId));
}


/*
Function Name: OnlyAlpabateVerification()
Description	 : This function used to check alphabate should be in the text box
Parameter	 : void
Author		 : Jay Prakash Verma
Return Type	 : -
*/
function OnlyAlpabateVerification(qtyVal)
{	
	var ALLOWEDNUMBERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var strTemp; 
	var strTempFlag = 0; 

	if(qtyVal != "") 
	{
		for(var i=0; i<qtyVal.length; i++)
		{ 
			strTemp = qtyVal.substring(i,i+1); 

			if(ALLOWEDNUMBERS.indexOf(strTemp)>=0)
			{ 				
				strTempFlag = 1;
			}
		}
	}	

	return strTempFlag ;
}

/*
Function Name: onCloseWindow()
Description	 : This function used to check the login id.
Parameter	 : void
Author		 : Jay Prakash Verma
Return Type	 : -
*/
function onCloseWindow()
{	
	var strFlag				= document.frmVerifyLoginId.hidFlag.value; 
		
	if(strFlag == "Y")
	{
		alert("Login Id already exist, please enter new Login Id.");
		self.opener.document.forms[0].hidVerifyLoginIdFlag.value = "YES";
		self.opener.document.forms[0].txtLoginId.value = "";

	}
	else
	{
		//alert("Thank You, Your login id has been successfully created.");
		alert("Login Id  you requested  is available. You may proceed further.");
		self.opener.document.forms[0].hidVerifyLoginIdFlag.value = "NO";
		self.opener.document.forms[0].txtLoginId.disabled = true;
		self.opener.document.forms[0].hidLoginId.value = document.frmVerifyLoginId.hidLoginId.value;
		window.close();
	} 
	window.close();
}

/*
Function Name: onYes()
Description	 : This function used to go Home Page.
Parameter	 : void
Author		 : Jay Prakash Verma
Return Type	 : -
*/
function onYes()
{
	//document.forms[0].action	= "eticketweb_home_page.jsp";
	//document.forms[0].method	= "post";
	//document.forms[0].submit();

	document.frmRegConfirmPage.method = "post";
	document.frmRegConfirmPage.action = "loginController.do";
	document.frmRegConfirmPage.submit();
}

/*
Function Name: onNo()
Description	 : This function used to go Home Page.
Parameter	 : void
Author		 : Jay Prakash Verma
Return Type	 : -
*/

function onNo()
{
	//document.forms[0].action	= "eticketweb_home_page.jsp";
	//document.forms[0].method	= "post";
	//document.forms[0].submit();

	document.frmRegConfirmPage.method = "post";
	document.frmRegConfirmPage.action = "loginController.do";
	document.frmRegConfirmPage.submit();

}

function onNewRegTerms()
{
	//var strObj			= document.frmPaymentDetail; 
	//jsp page name changed from eticketweb_Booking_terms_and_conditions_popup.jsp to eticketweb_ebooking_terms_and_conditions_popup.jsp for Code Unification - By Rahul 05/05/2009
	var strType			= "Registration";
	var strUrl = "eticketweb_ebooking_terms_and_conditions_popup.jsp?hidType="+strType;
	window.open(strUrl,'ISMARTS','status=yes,scrollbars=yes,resizable=yes,width=700,height=400,left=0,top=0');
	
}