// Script For The Member and Employee Registration and Update Member and Employee Pages    /////////////////////////////////////////////
		function fnMemberCheckinsert()
		{
		    if (!ValidateData(document.regForm.txtFirstName,"First Name", "mandalphalength100"))
	        {
		        return false;
	        }	        
	        if (!ValidateData(document.regForm.txtMidName,"Middle Name", "alphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtLastName,"Last Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        if (!ValidateData(document.regForm.txtPreAddress,"Address1", "mandalphsnlength256"))
			{
				return false;
			}
			if (!ValidateData(document.regForm.txtOptionalAddress,"Address2", "alphsnlength256"))
			{
				return false;
			}
			if((document.regForm.txtPhoneCountryCode.value == "" && document.regForm.txtPhoneNumber.value == "") && (document.regForm.txtMobileCountryCode.value == "" && document.regForm.txtMobileNumber.value == "" ))
			{
				alert('Please Enter either telephone or mobile number');
				return false;
			}
			else
			{
				if(	document.regForm.txtPhoneCountryCode.value != "" || document.regForm.txtPhoneNumber.value != "")				
				{
				//alert('Telephone');
					if (!ValidateData(document.regForm.txtPhoneCountryCode,"Country Code","mandlength3"))
					{
					//alert('1');
						return false;
					}
					if (!isInteger(document.regForm.txtPhoneCountryCode.value))
					{
							alert('Telephone country code should be integer only');
							document.regForm.txtPhoneCountryCode.focus();
							document.regForm.txtPhoneCountryCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtPhoneCityCode,"City Code","length5"))
					{
					//alert('2');
						return false;
					}
					if (!isInteger(document.regForm.txtPhoneCityCode.value))
					{
							alert('Telephone city code should be integer only');
							document.regForm.txtPhoneCityCode.focus();
							document.regForm.txtPhoneCityCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtPhoneNumber,"Phone No","mandlength12"))
					{
					//alert('3');
						return false;
					}
					else 
					{
						var intVal = document.regForm.txtPhoneNumber.value.length;
						if(intVal<4)
						{				
							alert("Please Enter atleast 4 digits in phone no.");
							document.regForm.txtPhoneNumber.focus();
							document.regForm.txtPhoneNumber.select();
							return false;
						}
					}
					if (!isInteger(document.regForm.txtPhoneNumber.value))
					{
						alert('Telephone number should be integer only');
						document.regForm.txtPhoneNumber.focus();
						document.regForm.txtPhoneNumber.select();
						return false;
					}
					if(!CheckZero(document.regForm.txtPhoneNumber.value))
					{
						alert("Telepnone number should not be Zero");
						document.regForm.txtPhoneNumber.focus();
						return false;
					}
				}
				
				if(document.regForm.txtMobileCountryCode.value != "" || document.regForm.txtMobileNumber.value != "" )
				{
				//alert('Mobile');
				if (!ValidateData(document.regForm.txtMobileCountryCode,"Country Code","mandlength3"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtMobileCountryCode.value))
					{
							alert('Mobile country code should be integer only');
							document.regForm.txtMobileCountryCode.focus();
							document.regForm.txtMobileCountryCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtMobileCityCode,"City Code","length5"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtMobileCityCode.value))
					{
							alert('Mobile city code should be integer only');
							document.regForm.txtMobileCityCode.focus();
							document.regForm.txtMobileCityCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtMobileNumber,"Mobile No","mandlength12"))
						{
							return false;
						}
						else 
						{
							var intVal = document.regForm.txtMobileNumber.value.length;
							if(intVal<4)
							{								
								alert("Please Enter atleast 4 digits in mobile no.");
								document.regForm.txtMobileNumber.focus();
								document.regForm.txtMobileNumber.select();
								return false;
							}
						}
						if (!isInteger(document.regForm.txtMobileNumber.value))
						{
							alert('Mobile number should be integer only');
							document.regForm.txtMobileNumber.focus();
							document.regForm.txtMobileNumber.select();
							return false;
						}
						if(!CheckZero(document.regForm.txtMobileNumber.value))
						{
							alert("Mobile number should not be Zero");
							document.regForm.txtMobileNumber.focus();
							return false;
						}
				  }
				}
			
			if (!ValidateData(document.regForm.txtEmail,"Email", "emaillength100"))
			{
				return false;
			}
		    //For date comparing
			var currentdate = new Date();
			var _mon = currentdate.getMonth()+1;
			var _day = currentdate.getDate();
			var _year = currentdate.getFullYear();
			var _curdate = _mon+"/"+_day+"/"+_year;
			var val = fnDateCompare(_curdate,document.regForm.txtTimeOfArrival.value);
			if(val == '-1')
			{
				alert('Enter valid date');
				return false;			
			}
			/*if(document.regForm.txtTimeOfArrival.value < _curdate)
			{
			//alert(document.regForm.txtTimeOfArrival.value);
				alert('Entered Date Is Not Valid');
				document.regForm.txtTimeOfArrival.focus();
				return false;
			}	*/
		
			return true;
		}
		/********************************************************/
		function fnDateCompare(strFromDate,strToDate)
		{
			
			var regExp = /\s+|[\s\,\-\.]/g; //Reg Exp Use to identify Date seperator.
			var arrDate  // This variable is used to store Date(dd,mm,yyyy) as an array element
			strFromDate = fnTrim(strFromDate); // Remove Leading and Trailing Spaces
			strToDate = fnTrim(strToDate); // Remove Leading and Trailing Spaces
			strFromDate = strFromDate.replace(regExp,"/"); //Replace Date seperator by "/"
			strToDate = strToDate.replace(regExp,"/"); //Replace Date seperator by "/"
			arrDate = strFromDate.split("/");
			var dtmFromDate = new Date(arrDate[2],eval(arrDate[0])-1,arrDate[1]) //Create Date object with input Date as parameter
			arrDate = strToDate.split("/");
			var dtmToDate = new Date(arrDate[2],eval(arrDate[0])-1,arrDate[1]) //Create Date object with input Date as parameter
			if (dtmFromDate < dtmToDate) 
			{
				return 1
			}
			else if (dtmFromDate > dtmToDate) 
			{
				return -1
			}
			else
			{
				return 0
			}
		}
		function fnTrim(strString)
		{
		// white space consist of (blank,tab,newline)
			var intLeftIndex = 0; //Store position of first non-white space from leftmost side
			var intRightIndex = 0; //Store position of first non-white space from rightmost side
			var blnFound = false; //Check for any non-white space character
			var regExp = /\S+/; 
			var intCount;
			if (strString.search(regExp) == -1) //Check for non-white space character
			{
				strString = ""; //Valid character not found then return empty string
				return(strString);
			}

			//If  atleast one non-white space character found.
			for (intCount=0;intCount < strString.length; intCount++)
			{
				if (strString.charAt(intCount) != " ") // Checking for first non-white spaces 
													// from left side
				{
					intLeftIndex = intCount - 1;
					break;
				}
			}
			for (intCount=strString.length - 1;intCount >= 0; intCount--)
			{
				if (strString.charAt(intCount) != " ") // Checking for first non-white spaces 
													// from Right most side
				{
					intRightIndex = intCount + 1;
					break;
				}
			}

			strString=strString.substring(intLeftIndex+1,intRightIndex); //Remove leading and trailing
																// spaces
			return (strString);
		}
		/************************************************************/
	function fnMemberCheck()
		{
		//alert('kllandnnasnnfsnfk');
		    if (!ValidateData(document.regForm.txtFirstName,"First Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtMidName,"Middle Name", "alphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtLastName,"Last Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        if (!ValidateData(document.regForm.txtPreAddress,"Address1", "mandalphsnlength256"))
			{
				return false;
			}
			if (!ValidateData(document.regForm.txtOptionalAddress,"Address2", "alphsnlength256"))
			{
				return false;
			}
			if((document.regForm.txtPhoneCountryCode.value == "" && document.regForm.txtPhoneNumber.value == "") && (document.regForm.txtMobileCountryCode.value == "" && document.regForm.txtMobileNumber.value == "" ))
			{
				alert('Please Enter either telephone or mobile number');
				return false;
			}
			else
			{
			if(	document.regForm.txtPhoneCountryCode.value != "" || document.regForm.txtPhoneNumber.value != "")				
				{
					if (!ValidateData(document.regForm.txtPhoneCountryCode,"Country Code","mandlength3"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtPhoneCountryCode.value))
					{
							alert('Telephone country code should be integer only');
							document.regForm.txtPhoneCountryCode.focus();
							document.regForm.txtPhoneCountryCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtPhoneCityCode,"City Code","length5"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtPhoneCityCode.value))
					{
							alert('Telephone city code should be integer only');
							document.regForm.txtPhoneCityCode.focus();
							document.regForm.txtPhoneCityCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtPhoneNumber,"Phone No","mandlength12"))
					{
						return false;
					}
					else 
					{
						var intVal = document.regForm.txtPhoneNumber.value.length;
						if(intVal<4)
						{				
							alert("Please Enter atleast 4 digits in phone no.");
							document.regForm.txtPhoneNumber.focus();
							document.regForm.txtPhoneNumber.select();
							return false;
						}
					}
					if (!isInteger(document.regForm.txtPhoneNumber.value))
					{
						alert('Telephone number should be integer only');
						document.regForm.txtPhoneNumber.focus();
						document.regForm.txtPhoneNumber.select();
						return false;
					}
					if(!CheckZero(document.regForm.txtPhoneNumber.value))
					{
						alert("Telepnone number should not be Zero");
						document.regForm.txtPhoneNumber.focus();
						return false;
					}
				}
				if(document.regForm.txtMobileCountryCode.value != "" || document.regForm.txtMobileNumber.value != "" )
					{
					
				
					if (!ValidateData(document.regForm.txtMobileCountryCode,"Country Code","mandlength3"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtMobileCountryCode.value))
					{
							alert('Mobile country code should be integer only');
							document.regForm.txtMobileCountryCode.focus();
							document.regForm.txtMobileCountryCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtMobileCityCode,"City Code","length5"))
					{
						return false;
					}
					if (!isInteger(document.regForm.txtMobileCityCode.value))
					{
							alert('Mobile city code should be integer only');
							document.regForm.txtMobileCityCode.focus();
							document.regForm.txtMobileCityCode.select();
							return false;
					}
					if (!ValidateData(document.regForm.txtMobileNumber,"Mobile No","mandlength12"))
						{
							return false;
						}
						else 
						{
							var intVal = document.regForm.txtMobileNumber.value.length;
							if(intVal<4)
							{				
								alert("Please Enter atleast 4 digits in mobile no.");
								document.regForm.txtMobileNumber.focus();
								document.regForm.txtMobileNumber.select();
								return false;
							}
						}
						if (!isInteger(document.regForm.txtMobileNumber.value))
						{
							alert('Mobile number should be integer only');
							document.regForm.txtMobileNumber.focus();
							document.regForm.txtMobileNumber.select();
							return false;
						}
						if(!CheckZero(document.regForm.txtMobileNumber.value))
						{
							alert("Mobile number should not be Zero");
							document.regForm.txtMobileNumber.focus();
							return false;
						}
				}
				if (!ValidateData(document.regForm.txtEmail,"Email", "emaillength100"))
				{
				return false;
				}
				/***********/
				//For date comparing
				var currentdate = new Date();
				var _mon = currentdate.getMonth()+1;
				var _day = currentdate.getDate();
				var _year = currentdate.getFullYear();
				var _curdate = _mon+"/"+_day+"/"+_year;
				var val = fnDateCompare(_curdate,document.regForm.txtTimeOfArrival.value);
				if(val == '-1')
				{
					alert('Enter valid date');
					return false;			
				}
				/***************/
				
			}
			return true;
		}
	
	  function fnMemberIDCheck()
	  {
	    if(document.regForm.txtMemberID.value == "" && document.regForm.txtSearchEmailId.value == "" && document.regForm.txtMobileSearch.value == "" && document.regForm.txtTelephoneSearch.value == "")
		{
			alert("Please enter atleast one option");
			document.regForm.txtMemberID.focus();
			return false;
		}
		else if(document.regForm.txtMemberID.value !== "")
		{
			if(!isInteger(document.regForm.txtMemberID.value))
			{
				alert("Please Enter Valid Member Id");
				document.regForm.txtMemberID.value = "";
				document.regForm.txtMemberID.focus();
				return false;
			}
		}
	  }	
	  
///////////////////////////   End Of Script ////////////////////////////////////////////////////////////////		
	
// Script For The Report Scheduel   /////////////////////////////////////////////


	
///////////////////////////   End Of Script ////////////////////////////////////////////////////////////////			
/////////////////////////////  Script For Manage Employee//////////////////////////////////////////////////////
		function chkSelectAll()
			{
				var FlagCount = 0;
				var chkCount = 0;
				re = new RegExp('chkRights_')
				for(i = 0; i < 	document.regForm.elements.length; i++) 
				{
					elm = document.regForm.elements[i]
					if (elm.type == 'checkbox') 
					{
						chkCount++;
						if (re.test(elm.id)) 
						{
							if(!elm.checked)
							{
								FlagCount++;
							}
						}
					}
				}
				if (chkCount <= FlagCount)
				{
					alert("Select atleast one right");
					return false;
				}
			}
		
		
		function fnCheckUpdateDetails( )
		{
			if(fnEmployeePrimaryDetailCheckNew() == true)
			{
				if(!isInteger(document.regForm.txtExt.value))
				{
					alert("Extension is numeric only");
					document.regForm.txtExt.value="";
					document.regForm.txtExt.focus();
					return false;
				}
				if(document.regForm.txtOldPwd.value != "")
				{
					if(document.regForm.txtPWD.value == "")
					{
						alert("Please enter new password");
						document.regForm.txtPWD.focus();
						document.regForm.txtPWD.value="";
						return false;
					}
					else if(document.regForm.txtConfirmPWD.value == "")
					{
						alert("Please enter confirm password");
						document.regForm.txtConfirmPWD.focus();
						document.regForm.txtConfirmPWD.value="";
						return false;
					}	
					else if(document.regForm.txtOldPwd.value != "" && document.regForm.txtPWD.value != ""  && document.regForm.txtConfirmPWD.value != "")
					{				
						if(document.regForm.txtPWD.value.length < 6)
						{
							alert("Atleast 6 characters required");
							document.regForm.txtPWD.focus();
							document.regForm.txtPWD.value="";
							document.regForm.txtConfirmPWD.value="";
							return false;
						}
					}
					///////////////// <!-- Checking of Password and ConfirmPassword's Equality -->
					if((document.regForm.txtPWD.length)!=(document.regForm.txtConfirmPWD.length))
					{
						alert("Your Password does not match with Confirm Password");
						document.regForm.txtPWD.value="";
						document.regForm.txtConfirmPWD.value="";
						document.regForm.txtPWD.focus();
						return false;
					}
					if((document.regForm.txtPWD.length)==(document.regForm.txtConfirmPWD.length))
					{
						if((document.regForm.txtPWD.value)!=(document.regForm.txtConfirmPWD.value))
						{
							alert("Your Password does not match with Confirm Password");
							document.regForm.txtPWD.value="";
							document.regForm.txtConfirmPWD.value="";
							document.regForm.txtPWD.focus();
							return false;
						}
					}
				}
			}
			else
			{
				return false;
			}
		}
///////////////////////////   End Of Script ////////////////////////////////////////////////////////////////		

/////////////////////////////  Script For Login Page //////////////////////////////////////////////////////
function validateUser()
{
	var userID = document.LoginForm.txtLoginID;
	var Value = document.LoginForm.txtPassword;
	if(userID.value == "")
	{
		alert('Please enter LoginID');
		userID.focus();
		return false;
	}
	else if(userID.value != "") 
	{
	    if (!ValidateData(userID,"Email", "mandemaillength100"))
		{
			return false;
		}
	}
	if( Value.value == "")
	{
		alert('Please enter password');
		Value.focus();
		return false;
	}
	
}			
///////////// Ends here //////

////////////// Validation for Employee registration /////
function fnEmployeeCheck()
{
	if (fnEmployeePrimaryDetailCheck() == true)
	{
		if(!isInteger(document.regForm.txtExt.value))
		{
			alert("Enter numeric only");
			document.regForm.txtExt.value="";
			document.regForm.txtExt.focus();
			return false;
		}
		if(document.regForm.txtPWD.value=="")
		{
			alert("Please enter password")
			document.regForm.txtPWD.focus();
			return false;
		}
		if(document.regForm.txtPWD.value.length < 6)
		{
			alert("Atleast 6 characters required")
			document.regForm.txtPWD.focus();
			document.regForm.txtPWD.value="";
			document.regForm.txtConfirmPWD.value="";
			return false;
		}
		if(document.regForm.txtConfirmPWD.value=="")
		{
			alert("Please Enter your Confirm Password");
			document.regForm.txtConfirmPWD.focus();
			return(false);
		}
		///////////////// <!-- Checking of Password and ConfirmPassword's Equality -->
		if((document.regForm.txtPWD.length)!=(document.regForm.txtConfirmPWD.length))
		{
			alert("Your Password does not match with Confirm Password");
			document.regForm.txtPWD.value="";
			document.regForm.txtConfirmPWD.value="";
			document.regForm.txtPWD.focus();
			return(false);
		}

		if((document.regForm.txtPWD.length)==(document.regForm.txtConfirmPWD.length))
		{
			if((document.regForm.txtPWD.value)!=(document.regForm.txtConfirmPWD.value))
			{
				alert("Your Password does not match with Confirm Password");
				document.regForm.txtPWD.value="";
				document.regForm.txtConfirmPWD.value="";
				document.regForm.txtPWD.focus();
				return(false);
			}
		}
		if (chkSelectAll() == false)
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}

function fnEmployeePrimaryDetailCheckNew()
{
			if (!ValidateData(document.regForm.txtFirstName,"First Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtMidName,"Middle Name", "alphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtLastName,"Last Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        if (!ValidateData(document.regForm.txtPreAddress,"Address1", "mandalphsnlength256"))
			{
				return false;
			}
			
			if (!ValidateData(document.regForm.txtPhoneCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtPhoneCountryCode.value))
			{
					alert('Telephone country code should be integer only');
					document.regForm.txtPhoneCountryCode.focus();
					document.regForm.txtPhoneCountryCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtPhoneCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtPhoneCityCode.value))
			{
					alert('Telephone city code should be integer only');
					document.regForm.txtPhoneCityCode.focus();
					document.regForm.txtPhoneCityCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtPhoneNumber,"Phone No","mandlength12"))
				{
					return false;
				}
				else 
				{
					var intVal = document.regForm.txtPhoneNumber.value.length;
					if(intVal<4)
					{				
						alert("Please Enter atleast 4 digits in phone no.");
						document.regForm.txtPhoneNumber.focus();
						document.regForm.txtPhoneNumber.select();
						return false;
					}
				}
				if (!isInteger(document.regForm.txtPhoneNumber.value))
				{
					alert('Telephone number should be integer only');
					document.regForm.txtPhoneNumber.focus();
					document.regForm.txtPhoneNumber.select();
					return false;
				}
				if(!CheckZero(document.regForm.txtPhoneNumber.value))
				{
					alert("Telepnone number should not be Zero");
					document.regForm.txtPhoneNumber.focus();
					return false;
				}
		 
		 if (!ValidateData(document.regForm.txtMobileCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtMobileCountryCode.value))
			{
					alert('Mobile country code should be integer only');
					document.regForm.txtMobileCountryCode.focus();
					document.regForm.txtMobileCountryCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtMobileCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtMobileCityCode.value))
			{
					alert('Mobile city code should be integer only');
					document.regForm.txtMobileCityCode.focus();
					document.regForm.txtMobileCityCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtMobileNumber,"Mobile No","mandlength12"))
				{
					return false;
				}
				else 
				{
					var intVal = document.regForm.txtMobileNumber.value.length;
					if(intVal<4)
					{				
						alert("Please Enter atleast 4 digits in mobile no.");
						document.regForm.txtMobileNumber.focus();
						document.regForm.txtMobileNumber.select();
						return false;
					}
				}
				if (!isInteger(document.regForm.txtMobileNumber.value))
				{
					alert('Mobile number should be integer only');
					document.regForm.txtMobileNumber.focus();
					document.regForm.txtMobileNumber.select();
					return false;
				}
				if(!CheckZero(document.regForm.txtMobileNumber.value))
				{
					alert("Mobile number should not be Zero");
					document.regForm.txtMobileNumber.focus();
					return false;
				}
			if (!ValidateData(document.regForm.txtEmail,"Email", "mandemaillength100"))
			{
			   return false;
		    }
			return true;
}

function fnEmployeePrimaryDetailCheck()
{
			if (!ValidateData(document.regForm.txtFirstName,"First Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtMidName,"Middle Name", "alphalength100"))
	        {
		        return false;
	        }
	        
	        if (!ValidateData(document.regForm.txtLastName,"Last Name", "mandalphalength100"))
	        {
		        return false;
	        }
	        if (!ValidateData(document.regForm.txtPreAddress,"Address1", "mandalphsnlength256"))
			{
				return false;
			}
			
			if (!ValidateData(document.regForm.txtPhoneCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtPhoneCountryCode.value))
			{
					alert('Telephone country code should be integer only');
					document.regForm.txtPhoneCountryCode.focus();
					document.regForm.txtPhoneCountryCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtPhoneCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtPhoneCityCode.value))
			{
					alert('Telephone city code should be integer only');
					document.regForm.txtPhoneCityCode.focus();
					document.regForm.txtPhoneCityCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtPhoneNumber,"Phone No","mandlength12"))
				{
					return false;
				}
				else 
				{
					var intVal = document.regForm.txtPhoneNumber.value.length;
					if(intVal<4)
					{				
						alert("Please Enter atleast 4 digits in phone no.");
						document.regForm.txtPhoneNumber.focus();
						document.regForm.txtPhoneNumber.select();
						return false;
					}
				}
				if (!isInteger(document.regForm.txtPhoneNumber.value))
				{
					alert('Telephone number should be integer only');
					document.regForm.txtPhoneNumber.focus();
					document.regForm.txtPhoneNumber.select();
					return false;
				}
				if(!CheckZero(document.regForm.txtPhoneNumber.value))
				{
					alert("Telepnone number should not be Zero");
					document.regForm.txtPhoneNumber.focus();
					return false;
				}
		 
		 if (!ValidateData(document.regForm.txtMobileCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtMobileCountryCode.value))
			{
					alert('Mobile country code should be integer only');
					document.regForm.txtMobileCountryCode.focus();
					document.regForm.txtMobileCountryCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtMobileCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.regForm.txtMobileCityCode.value))
			{
					alert('Mobile city code should be integer only');
					document.regForm.txtMobileCityCode.focus();
					document.regForm.txtMobileCityCode.select();
					return false;
			}
			if (!ValidateData(document.regForm.txtMobileNumber,"Mobile No","mandlength12"))
				{
					return false;
				}
				else 
				{
					var intVal = document.regForm.txtMobileNumber.value.length;
					if(intVal<4)
					{				
						alert("Please Enter atleast 4 digits in mobile no.");
						document.regForm.txtMobileNumber.focus();
						document.regForm.txtMobileNumber.select();
						return false;
					}
				}
				if (!isInteger(document.regForm.txtMobileNumber.value))
				{
					alert('Mobile number should be integer only');
					document.regForm.txtMobileNumber.focus();
					document.regForm.txtMobileNumber.select();
					return false;
				}
				if(!CheckZero(document.regForm.txtMobileNumber.value))
				{
					alert("Mobile number should not be Zero");
					document.regForm.txtMobileNumber.focus();
					return false;
				}
			if (!ValidateData(document.regForm.txtEmail,"Email", "mandemaillength100"))
			{
			   return false;
		    }
		    if(document.regForm.txtPWD.value == "")
			{
				alert("Please enter new password");
				document.regForm.txtPWD.focus();
				document.regForm.txtPWD.value="";
				return false;
			}
			else if(document.regForm.txtConfirmPWD.value == "")
			{
				alert("Please enter confirm password");
				document.regForm.txtConfirmPWD.focus();
				document.regForm.txtConfirmPWD.value="";
				return false;
			}	
			else if(document.regForm.txtPWD.value != ""  && document.regForm.txtConfirmPWD.value != "")
			{				
				if(document.regForm.txtPWD.value.length < 6)
				{
					alert("Atleast 6 characters required");
					document.regForm.txtPWD.focus();
					document.regForm.txtPWD.value="";
					document.regForm.txtConfirmPWD.value="";
					return false;
				}
			}
			///////////////// <!-- Checking of Password and ConfirmPassword's Equality -->
			if((document.regForm.txtPWD.length)!=(document.regForm.txtConfirmPWD.length))
			{
				alert("Your Password does not match with Confirm Password");
				document.regForm.txtPWD.value="";
				document.regForm.txtConfirmPWD.value="";
				document.regForm.txtPWD.focus();
				return false;
			}

			if((document.regForm.txtPWD.length)==(document.regForm.txtConfirmPWD.length))
			{
				if((document.regForm.txtPWD.value)!=(document.regForm.txtConfirmPWD.value))
				{
					alert("Your Password does not match with Confirm Password");
					document.regForm.txtPWD.value="";
					document.regForm.txtConfirmPWD.value="";
					document.regForm.txtPWD.focus();
					return false;
				}
			}
			if(chkSelectAll() == false)
			{
				return false;
			}
			return true;
}

///////////// Ends here //////

/////////////Script For Service Call Ticket////////////


///////////// Ends here //////

/////////////Script for Raise Ticket //////////////////
 

function chkMandatory()
{
	if(document.regForm.txtMemberID.value == "" && document.regForm.txtSearchEmailId.value == "" && document.regForm.txtMobileSearch.value == "" && document.regForm.txtTelephoneSearch.value == "")
	{
		alert("Please enter atleast one option");
		document.regForm.txtMemberID.focus();
		return false;
	}
	else if(document.regForm.txtMemberID.value !== "")
	{
		if(!isInteger(document.regForm.txtMemberID.value))
		{
			alert("Please Enter Valid Member Id");
			document.regForm.txtMemberID.value = "";
			document.regForm.txtMemberID.focus();
			return false;
		}
	}
	if((document.regForm.txtMobileCountryCodeSearch.value!="" || document.regForm.txtMobileCityCodeSearch.value!="") &&  (document.regForm.txtMobileSearch.value==""))
		{
		alert("Mobile number yellow field is mandatory in this case");
		document.regForm.txtMobileSearch.focus();
		return false ;
		}
	if((document.regForm.txtTelephoneCountryCodeSearch.value!="" || document.regForm.txtTelephoneCityCodeSearch.value!="") &&  (document.regForm.txtTelephoneSearch.value==""))
		{
		alert("Telephone number yellow field is mandatory in this case");
		document.regForm.txtTelephoneSearch.focus();
		return false ;
		}
}


//////////// Ends here //////

///////// Script for OnlineSupport.ascx /////////
function fnCheckValidation()
{
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtFirstName,"First Name", "mandalphalength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtMidName,"Middle Name", "alphalength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtLastName,"Last Name", "mandalphalength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtPreAddress,"Address1", "mandalphsnlength256"))
	{
		return false;
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtOptionalAddress,"Address2", "alphsnlength256"))
	{
		return false;
	}
	if((document.frmOnline.OnlineSupport1_txtPhoneCountryCode.value == "" && document.frmOnline.OnlineSupport1_txtPhoneNumber.value == "") && (document.frmOnline.OnlineSupport1_txtMobileCountryCode.value == "" && document.frmOnline.OnlineSupport1_txtMobileNumber.value == "" ))
	{
		alert('Please Enter either telephone or mobile number');
		document.frmOnline.OnlineSupport1_txtMobileCountryCode.focus();
		return false;
	}
	else
	{
		if(	document.frmOnline.OnlineSupport1_txtPhoneCountryCode.value != "" || document.frmOnline.OnlineSupport1_txtPhoneNumber.value != "")				
		{
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtPhoneCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtPhoneCountryCode.value))
			{
				alert('Telephone country code should be integer only');
				document.frmOnline.OnlineSupport1_txtPhoneCountryCode.focus();
				document.frmOnline.OnlineSupport1_txtPhoneCountryCode.select();
				return false;
			}
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtPhoneCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtPhoneCityCode.value))
			{
				alert('Telephone city code should be integer only');
				document.frmOnline.OnlineSupport1_txtPhoneCityCode.focus();
				document.frmOnline.OnlineSupport1_txtPhoneCityCode.select();
				return false;
			}
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtPhoneNumber,"Phone No","mandlength12"))
			{
				return false;
			}
			else 
			{
				var intVal = document.frmOnline.OnlineSupport1_txtPhoneNumber.value.length;
				if(intVal<4)
				{				
					alert("Please Enter atleast 4 digits in phone no.");
					document.frmOnline.OnlineSupport1_txtPhoneNumber.focus();
					document.frmOnline.OnlineSupport1_txtPhoneNumber.select();
					return false;
				}
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtPhoneNumber.value))
			{
				alert('Telephone number should be integer only');
				document.frmOnline.OnlineSupport1_txtPhoneNumber.focus();
				document.frmOnline.OnlineSupport1_txtPhoneNumber.select();
				return false;
			}
			if(!CheckZero(document.frmOnline.OnlineSupport1_txtPhoneNumber.value))
			{
				alert("Telepnone number should not be Zero");
				document.frmOnline.OnlineSupport1_txtPhoneNumber.focus();
				return false;
			}
		}
		////////
		if(	document.frmOnline.OnlineSupport1_txtMobileCountryCode.value != "" || document.frmOnline.OnlineSupport1_txtMobileNumber.value != "")				
		{
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtMobileCountryCode,"Country Code","mandlength3"))
			{
				return false;
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtMobileCountryCode.value))
			{
				alert('Mobile country code should be integer only');
				document.frmOnline.OnlineSupport1_txtMobileCountryCode.focus();
				document.frmOnline.OnlineSupport1_txtMobileCountryCode.select();
				return false;
			}
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtMobileCityCode,"City Code","length5"))
			{
				return false;
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtMobileCityCode.value))
			{
				alert('Mobile city code should be integer only');
				document.frmOnline.OnlineSupport1_txtMobileCityCode.focus();
				document.frmOnline.OnlineSupport1_txtMobileCityCode.select();
				return false;
			}
			if (!ValidateData(document.frmOnline.OnlineSupport1_txtMobileNumber,"Mobile No","mandlength12"))
			{
				return false;
			}
			else 
			{
				var intVal = document.frmOnline.OnlineSupport1_txtMobileNumber.value.length;
				if(intVal<4)
				{				
					alert("Please Enter atleast 4 digits in Mobile no.");
					document.frmOnline.OnlineSupport1_txtMobileNumber.focus();
					document.frmOnline.OnlineSupport1_txtMobileNumber.select();
					return false;
				}
			}
			if (!isInteger(document.frmOnline.OnlineSupport1_txtMobileNumber.value))
			{
				alert('Mobile number should be integer only');
				document.frmOnline.OnlineSupport1_txtMobileNumber.focus();
				document.frmOnline.OnlineSupport1_txtMobileNumber.select();
				return false;
			}
			if(!CheckZero(document.frmOnline.OnlineSupport1_txtMobileNumber.value))
			{
				alert("Telepnone number should not be Zero");
				document.frmOnline.OnlineSupport1_txtMobileNumber.focus();
				return false;
			}
	    }
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtEmail,"Email", "emaillength100"))
	{
		return false;
	}
	if (document.frmOnline.OnlineSupport1_ddlZone.value == '-- Zone --')
	{
		alert('Please specify your city zone');
		document.frmOnline.OnlineSupport1_ddlZone.focus();
		return false;
	}
	if (!ValidateData(document.frmOnline.OnlineSupport1_txtTimeOfArrival,"Expected Date","mand"))
	{
		return false;
	}
	//To validate Entered date validation
	else 
	{
		//For date comparing
		var currentdate = new Date();
		var _mon = currentdate.getMonth()+1;
		var _day = currentdate.getDate();
		var _year = currentdate.getFullYear();
		var _curdate = _mon+"/"+_day+"/"+_year;
		var val = fnDateCompare(_curdate,document.regForm.txtTimeOfArrival.value);
		if(val == '-1')
		{
			alert('Enter valid date');
			return false;
		}
		//alert(document.frmOnline.OnlineSupport1_txtTimeOfArrival.value);
		/*if(document.frmOnline.OnlineSupport1_txtTimeOfArrival.value < _curdate)
		{
			alert('Entered Date Is Not Valid');
			document.frmOnline.OnlineSupport1_txtTimeOfArrival.focus();
			return false;
		}	
		var enteredDate = new Date(document.OnlineForm.OnlineSupport1_txtTimeOfArrival.value);
		var currentDate = new Date();
		if(enteredDate < currentDate )
			{
			alert("Entered Date Is Not Valid.")
			return false;
			}*/
	}
	return true;
}

function fnCheckSearchValidation()
{

	if (!isInteger(document.frmOnline.OnlineSupport1_txtMemberID.value))
	{
		alert('Member ID should be integer only');
		document.frmOnline.OnlineSupport1_txtMemberID.focus();
		document.frmOnline.OnlineSupport1_txtMemberID.select();
		return false;
	}
	if (document.frmOnline.OnlineSupport1_txtPassword.value == '')
	{
		alert("Please enter Password");
		document.frmOnline.OnlineSupport1_txtPassword.focus();
		return false;
	}
	if (document.frmOnline.OnlineSupport1_txtSearchMobileCountryCode.value != '')
	{
		if (!ValidateData(document.frmOnline.OnlineSupport1_txtSearchMobileCountryCode,"Country Code","length3"))
		{
			return false;
		}
		if (!isInteger(document.frmOnline.OnlineSupport1_txtSearchMobileCountryCode.value))
		{
			alert('Mobile country code should be integer only');
			document.frmOnline.OnlineSupport1_txtSearchMobileCountryCode.focus();
			document.frmOnline.OnlineSupport1_txtSearchMobileCountryCode.select();
			return false;
		}
		if (!ValidateData(document.frmOnline.OnlineSupport1_txtSearchMobileCityCode,"City Code","mandlength5"))
		{
			return false;
		}
		if (!isInteger(document.frmOnline.OnlineSupport1_txtSearchMobileCityCode.value))
		{
			alert('Mobile city code should be integer only');
			document.frmOnline.OnlineSupport1_txtSearchMobileCityCode.focus();
			document.frmOnline.OnlineSupport1_txtSearchMobileCityCode.select();
			return false;
		}
	}
	
	if (document.frmOnline.OnlineSupport1_txtMobileSearch.value != '')
	{
		if (!ValidateData(document.frmOnline.OnlineSupport1_txtMobileSearch,"Mobile No","length12"))
		{
			return false;
		}
		else 
		{
			var intVal = document.frmOnline.OnlineSupport1_txtMobileSearch.value.length;
			if(intVal<4)
			{				
				alert("Please Enter atleast 4 digits in Mobile no.");
				document.frmOnline.OnlineSupport1_txtMobileSearch.focus();
				document.frmOnline.OnlineSupport1_txtMobileSearch.select();
				return false;
			}
		}
		if (!isInteger(document.frmOnline.OnlineSupport1_txtMobileSearch.value))
		{
			alert('Mobile number should be integer only');
			document.frmOnline.OnlineSupport1_txtMobileSearch.focus();
			document.frmOnline.OnlineSupport1_txtMobileSearch.select();
			return false;
		}
		if(!CheckZero(document.frmOnline.OnlineSupport1_txtMobileSearch.value))
		{
			alert("Telepnone number should not be Zero");
			document.frmOnline.OnlineSupport1_txtMobileSearch.focus();
			return false;
		}
	}	
}

function fnGetCheckedItemsValues()
{
	var checkBoxArr = getSelectedCheckboxValue(document.forms[1].MyCheckBox);
	if (checkBoxArr.length == 0) 
	{ 
		alert("No check boxes selected"); 
		return false;
	}
	else
	{
		OnlineSupportControl.fnActionIds(checkBoxArr);
	}	
}
/*
function fnGetCheckedItemsValues()
{
	var checkBoxArr = getSelectedCheckboxValue(document.forms[1].MyCheckBox);
	if (checkBoxArr.length == 0) 
	{ 
		alert("No check boxes selected"); 
		return false;
	}
	else
	{
		AnnualMaintenanceControl.fnActionIds(checkBoxArr);
	}	
}*/
function getSelectedCheckboxValue(buttonGroup) 
{
   // return an array of values selected in the check box group. if no boxes
   // were checked, returned array will be empty (length will be zero)
   var retArr = new Array(); // set up empty array for the return values
   var selectedItems = getSelectedCheckbox(buttonGroup);
   if (selectedItems.length != 0) 
   { // if there was something selected
      retArr.length = selectedItems.length;
      for (var i=0; i<selectedItems.length; i++) 
      {
         if (buttonGroup[selectedItems[i]]) 
         { // Make sure it's an array
            retArr[i] = buttonGroup[selectedItems[i]].value;
            //alert(retArr[i]);
         } 
         else 
         { // It's not an array (there's just one check box and it's selected)
            retArr[i] = buttonGroup.value;// return that value
         }
      }
   }
   return retArr;
} // Ends the "getSelectedCheckBoxValue" function

function getSelectedCheckbox(buttonGroup) 
{
   // Go through all the check boxes. return an array of all the ones
   // that are selected (their position numbers). if no boxes were checked,
   // returned array will be empty (length will be zero)
   var retArr = new Array();
   var lastElement = 0;
   if (buttonGroup[0]) { // if the button group is an array (one check box is not an array)
      for (var i=0; i<buttonGroup.length; i++) 
      {
         if (buttonGroup[i].checked) 
         {
            retArr.length = lastElement;
            retArr[lastElement] = i;
            lastElement++;
         }
      }
   } 
   else 
   { // There is only one check box (it's not an array)
      if (buttonGroup.checked) 
      { // if the one check box is checked
         retArr.length = lastElement;
         retArr[lastElement] = 0; // return zero as the only array value
      }
   }
   return retArr;
} // Ends the "getSelectedCheckbox" function

///////// ENDs here Script for OnlineSupport.ascx /////////


/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
///////////////////////Validation spare purchase and sold report pages///////////////////////////////////////
function fnSpareCheck()
{
	if (!ValidateData(document.frmSpare.txtFromDate,"Start date", "mand"))
	{
		return false;
	}
	else
	{
		var enteredDate = new Date(document.frmSpare.txtFromDate.value);
		var currentDate = new Date();
		if(enteredDate > currentDate )
			{
				alert('Start Date should be lower or equal to current date');
				document.frmSpare.txtFromDate.focus();
				document.frmSpare.txtFromDate.value = "";
				return false;
			}
	
	}
	
	if (!ValidateData(document.frmSpare.txtToDate,"End date", "mand"))
	{
		return false;
	}
	else
	{
		var enteredDate = new Date(document.frmSpare.txtToDate.value);
		var currentDate = new Date();
		if(enteredDate > currentDate)
			{
				alert('Start Date should be lower or equal to current date');
				document.frmSpare.txtToDate.focus();
				document.frmSpare.txtToDate.value = "";
				return false;
			}
	}
	if(new Date(document.frmSpare.txtFromDate.value)> new Date(document.frmSpare.txtToDate.value))
		{
			alert('Start Date should be lower or equal to End date');
			document.frmSpare.txtFromDate.focus();
			document.frmSpare.txtFromDate.value = "";
			return false;
		}
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
////////////////////////Validate Spare Purchase Form///////////////////////////
function fnPurchasedSpareCheck()
{
  if(!ValidateData(document.zoneForm.txtDateOfPurchase,"Date Of Purchase" , "mand"))
  {
   return false;
  }
  else
  {
   var enteredDate = new Date(document.zoneForm.txtDateOfPurchase.value);
   var currentDate = new Date();
   if(enteredDate > currentDate)
    {
      alert('Date Of Purchase should be lower or equal to current date');
      document.zoneForm.txtDateOfPurchase.focus();
      document.zoneForm.txtDateOfPurchase.value = "";
      return false;
    } 
  
  }
  if(!ValidateData(document.zoneForm.txtQuantity , "Quantity Purchase" ,"mand"))
  {
   return false;
  }
  if (!isInteger(document.zoneForm.txtQuantity.value))
  {
		alert('Purchase Quantity should be integer only');
		document.zoneForm.txtQuantity.focus();
		document.zoneForm.txtQuantity.select();
		return false;
  }
  else 
	{
		var intQuantity = document.zoneForm.txtQuantity.value.length;
		if(intQuantity > 9)
		{				
			alert("Purchased Quantity is too large");
			document.zoneForm.txtQuantity.focus();
			document.zoneForm.txtQuantity.select();
			return false;
		}
	}
  
  if (!isFloat(document.zoneForm.txtPricePerUnit.value))
  {
		alert('Price should be float only');
		document.zoneForm.txtPricePerUnit.focus();
		document.zoneForm.txtPricePerUnit.select();
		return false;
  }
  else 
	{
		var intPrice = document.zoneForm.txtPricePerUnit.value.length;
		if(intPrice > 10)
		{				
			alert("Price Per Unit is too large");
			document.zoneForm.txtPricePerUnit.focus();
		    document.zoneForm.txtPricePerUnit.select();
			return false;
		}
	}
	
	if (!isFloat(document.zoneForm.txtSellingPrice.value))
	{
		alert('Selling Price should be float only');
		document.zoneForm.txtSellingPrice.focus();
		document.zoneForm.txtSellingPrice.select();
		return false;
	}
}



/////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////// Email Validation For Front Pages /////////////////////////////

function validateEmail()
{
 if (!ValidateData(document.OnlineForm.txtEmail,"Email", "mandemaillength100"))
	{
		return false;
	}

  return true;
}

function validateEmail1()
{
 if (!ValidateData(document.OnlineForm1.txtEmail,"Email", "mandemaillength100"))
	{
		return false;
	}

  return true;
}


/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////// Validation For Engineer Sales Report ////////////////////////

function fnValidateEngineerReports()
{
  if(document.faqform.ddEngineerNo.value == "--Select Engineer--")
  {
   alert('Please specify Engineer');
   document.faqform.ddEngineerNo.focus();
   return false;
  }
  if(!ValidateData(document.faqform.txtFromDate,"Start Date" , "mand"))
  {
   return false;
  }
  else 
  {
    var enteredDate = new Date(document.faqform.txtFromDate.value);
    var currentDate = new Date();
    if(enteredDate > currentDate)
    {
      alert('Start Date should be lower or equal to current date');
      document.faqform.txtFromDate.focus();
      document.faqform.txtFromDate.value = "";
      return false;
    }
  }
  if(!ValidateData(document.faqform.txtToDate,"End Date" , "mand"))
  {
   return false;
  }
  else
  {
    
    var enteredDate = new Date(document.faqform.txtToDate.value);
    var currentDate = new Date();
    if(enteredDate > currentDate)
    {
      alert('End Date should be lower or equal to current date');
      document.faqform.txtToDate.focus();
      document.faqform.txtToDate.value = "";
      return false;
    }
  }
  if(new Date(document.faqform.txtFromDate.value)> new Date(document.faqform.txtToDate.value))
  {
   alert('Start Date should be lower or equal to End date');
   document.faqform.txtFromDate.focus();
   document.faqform.txtFromDate.value = "";
   return false;
  }
}


///////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////  Validation For Admin Section ///////////////////////////////////////
function fnManageZonesCheck()
{
  if(document.forms[0].ddlCity.value == "--Select City--")
  {
   alert('Please specify City');
   document.forms[0].ddlCity.focus();
   return false;
  }
  if (!ValidateData(document.forms[0].txtZone,"Zone Name", "mandtestlength100"))
   {
     return false;
   }
   return true;
}

function fnSymptomDescriptionCheck()
{
  if (!ValidateData(document.forms[0].txtSymptom,"Symptom Description", "mandtestlength100"))
   {
     return false;
   }
   
   return true;
}

function fnCauseDescriptionCheck()
{
  if (!ValidateData(document.forms[0].txtCause,"Cause Description", "mandtestlength100"))
   {
     return false;
   }
   
   return true;
}

function fnSpareDetailsCheck()
{
  if (!ValidateData(document.zoneForm.txtSpareCode,"Spare Code", "mandanwslength100"))
  {
	return false;
  }
  if (!ValidateData(document.zoneForm.txtSpareName,"Spare Name", "mandanwslength100"))
  {
	return false;
  }
  if (!ValidateData(document.zoneForm.txtSellingPrice,"Selling Price", "floatlength6"))
  {
	return false;
  }
  return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////
function fnAddPaymentModeType()
{
	if (!ValidateData(document.membershipTypeForm.txtPaymentModeType, "Payment Mode Type ", "mandtestlength20"))
	{
		return false;
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////
function fnAddMembershipType()
{
	if (!ValidateData(document.membershipTypeForm.txtMembershipType, "Membership Type", "mandlength50"))
	{
		return false;
	}
	if (!ValidateData(document.membershipTypeForm.txtHrWaitingCharge, "Hourly Waiting Charge", "mandlength6"))
	{
		return false;
	}
	if (!isFloat(document.membershipTypeForm.txtHrWaitingCharge.value))
	{
		alert("Only float value allowed");
		document.membershipTypeForm.txtHrWaitingCharge.focus();
		document.membershipTypeForm.txtHrWaitingCharge.select();
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////
////////// JS for BecomeAHero.aspx ///////////////////////////////////////////////////////////
function fnBecomeAHero()
{
	if (!ValidateData(document.frmApplyOnline.txtName,"Name", "mandtestlength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmApplyOnline.txtUploadEmail,"Email", "mandemaillength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmApplyOnline.txtContactNumber,"Phone No","mandlength12"))
	{
		return false;
	}
	else 
	{
		var intVal = document.frmApplyOnline.txtContactNumber.value.length;
		if(intVal<4)
		{				
			alert("Please Enter atleast 4 digits in phone no.");
			document.frmApplyOnline.txtContactNumber.focus();
			document.frmApplyOnline.txtContactNumber.select();
			return false;
		}
	}
	if (!isInteger(document.frmApplyOnline.txtContactNumber.value))
	{
		alert('Telephone number should be integer only');
		document.frmApplyOnline.txtContactNumber.focus();
		document.frmApplyOnline.txtContactNumber.select();
		return false;
	}
	if(!CheckZero(document.frmApplyOnline.txtContactNumber.value))
	{
		alert("Telepnone number should not be Zero");
		document.frmApplyOnline.txtContactNumber.focus();
		return false;
	}
	if (!ValidateData(document.frmApplyOnline.txtApplyedFor,"Applyed for", "mandtestlength100"))
	{
		return false;
	}
	if (document.frmApplyOnline.fileUpload.value == "")
	{
		alert("Please select your word document.");
		document.frmApplyOnline.fileUpload.focus();
		document.frmApplyOnline.fileUpload.select();
		return false;
	}

}
//*********************************************************************************/
function fnForgetPWD()
{
	if(document.frmforgetPWD.txtMemberID.value == "" && document.frmforgetPWD.txtEmailId.value == "" )
	{
		alert("Please enter memberId or Password");
		document.frmforgetPWD.txtMemberID.focus();
		return false;
	}
	if (!isInteger(document.frmforgetPWD.txtMemberID.value))
	{
			alert('Member id should be integer only');
			document.frmforgetPWD.txtMemberID.focus();
			document.frmforgetPWD.txtMemberID.select();
			return false;
	}
}
//**********************************************************************************/
//////////////////////////////////////////////////////////////////////////////////////////////
function fnChangePWD()
{
	if(document.frmChangePWD.txtOldPWD.value != "")
	{
		if(document.frmChangePWD.txtNewPwd.value == "")
		{
			alert("Please enter new password");
			document.frmChangePWD.txtNewPwd.focus();
			document.frmChangePWD.txtNewPwd.value="";
			return false;
		}
		else if(document.frmChangePWD.txtConfirmPWD.value == "")
		{
			alert("Please enter confirm password");
			document.frmChangePWD.txtConfirmPWD.focus();
			document.frmChangePWD.txtConfirmPWD.value="";
			return false;
		}	
		else if(document.frmChangePWD.txtOldPWD.value != "" && document.frmChangePWD.txtNewPwd.value != ""  && document.frmChangePWD.txtConfirmPWD.value != "")
		{				
			if(document.frmChangePWD.txtNewPwd.value.length < 6)
			{
				alert("Atleast 6 characters required");
				document.frmChangePWD.txtNewPwd.focus();
				document.frmChangePWD.txtNewPwd.value="";
				document.frmChangePWD.txtConfirmPWD.value="";
				return false;
			}
		}
		///////////////// <!-- Checking of Password and ConfirmPassword's Equality -->
		if((document.frmChangePWD.txtNewPwd.length)!=(document.frmChangePWD.txtConfirmPWD.length))
		{
			alert("Your Password does not match with Confirm Password");
			document.frmChangePWD.txtNewPwd.value="";
			document.frmChangePWD.txtConfirmPWD.value="";
			document.frmChangePWD.txtNewPwd.focus();
			return false;
		}
		if((document.frmChangePWD.txtNewPwd.length)==(document.frmChangePWD.txtConfirmPWD.length))
		{
			if((document.frmChangePWD.txtNewPwd.value)!=(document.frmChangePWD.txtConfirmPWD.value))
			{
				alert("Your Password does not match with Confirm Password");
				document.frmChangePWD.txtNewPwd.value="";
				document.frmChangePWD.txtConfirmPWD.value="";
				document.frmChangePWD.txtNewPwd.focus();
				return false;
			}
		}
	}
	else
	{
		alert("Please enter Old password");
		document.frmChangePWD.txtOldPWD.focus();
		document.frmChangePWD.txtOldPWD.value="";
		return false;
	}
	return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////
function popup(URL,h,w)
{
	var Feature = 'Width=' + w + ', Height=' + h + ',scrollbars=yes';
	//alert(Feature);
  	//window.open(URL,'','Height=700, width=600,scrollbars=yes')
	window.open(URL,'', Feature);
	//alert(str);
} 
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
// Js For career Page
/////////////////////////////////////////////////////////////////////////////////////////////

function fnCareer()
{
	if (!ValidateData(document.frmApplyOnline.txtName,"Name", "mandtestlength100"))
	{
		return false;
	}
	if (!ValidateData(document.frmApplyOnline.txtEmail,"Email", "mandemaillength100"))
	{
		return false;
	}
	
	else 
	{
		var countryCode = document.frmApplyOnline.txtCountryCode.value.length;
		var cityCode = document.frmApplyOnline.txtCityCode.value.length;
		var number = document.frmApplyOnline.txtNum.value.length;
		if (isNaN(document.frmApplyOnline.txtCountryCode.value))
		{
			alert('Contact number should be integer only');
			document.frmApplyOnline.txtCountryCode.focus();
			document.frmApplyOnline.txtCountryCode.select();
			return false;
		}
		if (isNaN(document.frmApplyOnline.txtCityCode.value))
		{
			alert('Contact number should be integer only');
			document.frmApplyOnline.txtCityCode.focus();
			document.frmApplyOnline.txtCityCode.select();
			return false;
		}
		if (isNaN(document.frmApplyOnline.txtNum.value))
		{
			alert('Contact number should be integer only');
			document.frmApplyOnline.txtNum.focus();
			document.frmApplyOnline.txtNum.select();
			return false;
		}
		if(countryCode<3)
		{				
			alert("Please Enter atleast 3 digits in phone no.");
			document.frmApplyOnline.txtCountryCode.focus();
			document.frmApplyOnline.txtCountryCode.select();
			return false;
		}
		if(cityCode<3)
		{				
			alert("Please Enter atleast 3 digits in phone no.");
			document.frmApplyOnline.txtCityCode.focus();
			document.frmApplyOnline.txtCityCode.select();
			return false;
		}
		if(number<6)
		{				
			alert("Please Enter atleast 6 digits in phone no.");
			document.frmApplyOnline.txtNum.focus();
			document.frmApplyOnline.txtNum.select();
			return false;
		}
		
	}
	
	
	/*
	if(!CheckZero(document.frmApplyOnline.txtContactNumber.value))
	{
		alert("Telepnone number should not be Zero");
		document.frmApplyOnline.txtContactNumber.focus();
		return false;
	}
	*/
	if (!ValidateData(document.frmApplyOnline.txtApplyedFor,"Applyed for", "mandlength500"))
	{
		return false;
	}
	/*if (document.frmApplyOnline.fileUpload.value == "" )
	{
		alert("Please select your word document.");
		document.frmApplyOnline.fileUpload.focus();
		document.frmApplyOnline.fileUpload.select();
		return false;
	}
	*/
	if(document.frmApplyOnline.fileUpload.value !='')
	{
		if (document.frmApplyOnline.fileUpload.value.indexOf('.doc')=='-1' && document.frmApplyOnline.fileUpload.value.indexOf('.pdf')=='-1')
		{
			alert("Please select Word/PDF document.");
			document.frmApplyOnline.fileUpload.focus();
			document.frmApplyOnline.fileUpload.select();
			return false;
		}
	}
	
	if (document.frmApplyOnline.txtVerificationCode.value=='')
	{
		alert("Please Enter Varification Code.");
		document.frmApplyOnline.txtVerificationCode.focus();
		document.frmApplyOnline.txtVerificationCode.select();
		return false;
	}

}
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
// Js For Jobs Page
/////////////////////////////////////////////////////////////////////////////////////////////

function fnJobsValidate()
{
	if (!ValidateData(document.jobsForm.txtJobTitle,"Job Title", "mandlength500"))
	{
		return false;
	}
	if (!ValidateData(document.jobsForm.txtJobDescription,"Job Description", "mandlength2000"))
	{
		return false;
	}
	
	if (!ValidateData(document.jobsForm.txtPublisherDate,"Publish date", "mand"))
	{
		return false;
	}
	else
	{
		if (!ValidateData(document.jobsForm.txtExpiryDate,"Expire Date", "mand"))
		{
			return false;
		}	
		else 
		{
			if((document.jobsForm.txtExpiryDate.value)< (document.jobsForm.txtPublisherDate.value))
			{
			alert('Expire Date should be equal or greater than to Publish date');
			document.jobsForm.txtExpiryDate.focus();
			document.jobsForm.txtExpiryDate.value = "";
			return false;
			}
		}
	}
}
function fnJobsDateValidate()
{
if (!ValidateData(document.jobsForm.txtPublishStartDate,"Publish Start Date", "mand"))
	{
		return false;
	}
	else
	{
		if (!ValidateData(document.jobsForm.txtPublishEndDate,"Publish End Date", "mand"))
		{
			return false;
		}	
		else 
		{
			if((document.jobsForm.txtPublishEndDate.value)< (document.jobsForm.txtPublishStartDate.value))
			{
			alert('Publish end date should be equal or greater than to Publish start date');
			document.jobsForm.txtPublishEndDate.focus();
			document.jobsForm.txtPublishEndDate.value = "";
			return false;
			}
		}
	}


}
function fnCheckPayment()
{
	if (!ValidateData(document.AdminPaymentForm.txtTicketNo,"Ticket No.", "mand"))
	{
		return false;
	}	
	if (!isInteger(document.AdminPaymentForm.txtTicketNo.value))
	{
			alert('Ticket number should be integer only');
			document.AdminPaymentForm.txtTicketNo.focus();
			document.AdminPaymentForm.txtTicketNo.select();
			return false;
	}
}

/****Forum Topic**********************************************************/
function fnCheckForumAddTopic()
{
  if(document.forms[0].ddlForumCategory.value == 0)
	 {
		alert('Please Chosse category.');
		document.forms[0].ddlForumCategory.focus();
		 return false;
	}
	if (!ValidateData(document.searchForumForm.txtTopicTitle,"Topic Title", "mandlength500"))
	{
		return false;
	}
	if(document.searchForumForm.txtTopicTitle != "")
	{
	if (!isInteger(document.searchForumForm.txtTicketNo.value))
	  {
			alert('Ticket number should be integer only');
			document.searchForumForm.txtTicketNo.focus();
			document.searchForumForm.txtTicketNo.select();
			return false;
	  }
	 }
	
	if (!ValidateData(document.searchForumForm.txtComment,"Comment Description", "mandlength8000"))
	{
		return false;
	}
}

