<!-- $Header: FMR_Input_Fields.js 1.00 05-Sep-2008 pavan_kondaveeti@infosys.com $ -->
/**********************************************************************************************
 *  PROPRIETARY/CONFIDENTIAL                                                               
 *  Copyright (c) 2008 IKON OFFICE SOLUTIONS
 *                                                                                          
 *  All rights reserved.
 *                                                                                          
 * Type        : Javascript file                                                                     
 * Name        : FMR_Input_Fields.js
 * Description : To validate the input fields of ASP pages.
 *                
 **********************************************************************************************/
 

//************************************************************************
//** Name            : fnValidateCompany
//** Description     : Calls validation functions for company name
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateCompanyName()
{
	if(document.foRegn.tbCompany.value != "") 
		
	{

		if(!fnValidateCompany(document.foRegn.tbCompany.value))
		{
			foRegn.tbCompany.focus();
			alert("Please enter a valid Company Name.\nPlease avoid special characters like '#','$','%'.");	
			document.foRegn.tbCompany.value = "";
			
		}
	}
	
}

//************************************************************************
//** Name            : fnValidateFirstName
//** Description     : Calls validation functions for firstname
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateFirstName()
{

	if(document.foRegn.tbFirst.value != "") 
		
	{ 
	
		if(!fnValidateName(document.foRegn.tbFirst.value))
		{
			 foRegn.tbFirst.focus();
			 alert("Please enter a valid First Name.\nPlease avoid special characters like '#','$','%'.");
			 document.foRegn.tbFirst.value = "";
			 
		}
	}
	
}

//************************************************************************
//** Name            : fnValidateLastName
//** Description     : Calls validation functions for last name
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateLastName()
{
	if(document.foRegn.tbLast.value != "") 
		
	{

		if(!fnValidateName(document.foRegn.tbLast.value))
		{			
			foRegn.tbLast.focus();
			alert("Please enter a valid Last Name.\nPlease avoid special characters like '#','$','%'.");
			document.foRegn.tbLast.value = "";
			
		}
	}
	

}


//************************************************************************
//** Name            : fnValidateEmail
//** Description     : Calls validation functions for email
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************
function fnValidateEmail()
{

	if(document.foRegn.tbEmail.value != "") 
		
	{
		if(!fnValidateEmailId(document.foRegn.tbEmail.value))
		{

			foRegn.tbEmail.focus();
			document.foRegn.tbEmail.value = "";
			
		}

	}
	
}

//************************************************************************
//** Name            : fnValidatePhone1
//** Description     : Calls validation functions for phone
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidatePhone1()
{

	if(document.foRegn.tbPh1.value != "") 
		
	{
		if(!fnValidatePhone(document.foRegn.tbPh1.value))
		{		
			foRegn.tbPh1.focus();
			document.foRegn.tbPh1.value = "";
			
		}
	}
	

}

//************************************************************************
//** Name            : fnValidatePhone2
//** Description     : Calls validation functions for phone
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidatePhone2()
{

	if(document.foRegn.tbPh2.value != "") 
		
	{
		if(!fnValidatePhone(document.foRegn.tbPh2.value))
		{		
			foRegn.tbPh2.focus();
			document.foRegn.tbPh2.value = "";
			
		}
	}
	

}

//************************************************************************
//** Name            : fnValidatePhone3
//** Description     : Calls validation functions for phone
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidatePhone3()
{

	if(document.foRegn.tbPh3.value != "") 
		
	{
		if(!fnValidatePhone(document.foRegn.tbPh3.value))
		{		
			foRegn.tbPh3.focus();
			document.foRegn.tbPh3.value = "";
			
		}
	}
	

}


//************************************************************************
//** Name            : fnValidateEqPhoneExt
//** Description     : Calls validation functions for areacode
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************
function fnValidateEqPhoneExt()
{
	if(document.foRegn.tbPhExtn.value != "") 
			
	{
		if(!fnValidateIsNum(document.foRegn.tbPhExtn.value))
		{		
			foRegn.tbPhExtn.focus();
			alert("Please enter a valid Ext No.\nPlease avoid special characters and alphabet.");
			document.foRegn.tbPhExtn.value ="";
			
		}
	}

}


//************************************************************************
//** Name            : fnValidateFax1
//** Description     : Calls validation functions for fax
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateFax1()
{

	if(document.foRegn.tbFax1.value != "") 
		
	{
		if(!fnValidateIsNum(document.foRegn.tbFax1.value))
		{		
			foRegn.tbFax1.focus();
			alert("Please enter a valid Fax No.\nPlease avoid special characters and alphabet.");
			document.foRegn.tbFax1.value = "";
			
		}
	}
	

}

//************************************************************************
//** Name            : fnValidateFax2
//** Description     : Calls validation functions for fax
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateFax2()
{

	if(document.foRegn.tbFax2.value != "") 
		
	{
		if(!fnValidateIsNum(document.foRegn.tbFax2.value))
		{		
			foRegn.tbFax2.focus();
			alert("Please enter a valid Fax No.\nPlease avoid special characters and alphabet.");
			document.foRegn.tbFax2.value = "";
			
		}
	}
	

}

//************************************************************************
//** Name            : fnValidateFax3
//** Description     : Calls validation functions for fax
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateFax3()
{

	if(document.foRegn.tbFax3.value != "") 
		
	{
		if(!fnValidateIsNum(document.foRegn.tbFax3.value))
		{		
			foRegn.tbFax3.focus();
			alert("Please enter a valid Fax No.\nPlease avoid special characters and alphabet.");
			document.foRegn.tbFax3.value = "";
			
		}
	}
	

}


//************************************************************************
//** Name            : fnValidatezip
//** Description     : Calls validation functions for zip code
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidatezip()
{	
	if(document.foRegn.tbZip.value != "") 
		
	{
		if(!fnValidateZipCode(document.foRegn.tbZip.value))
		{
			foRegn.tbZip.focus();
			document.foRegn.tbZip.value = "";
			
		}
	}

}

//************************************************************************
//** Name            : fnValidateEquipmentId
//** Description     : Calls validation functions for Eqipment Id
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateEquipmentId()
{
	if(document.foRegn.tbEID.value != "") 
			
	{
		if(!fnValidateEquipmentIdField(document.foRegn.tbEID.value))
		{		
			foRegn.tbEID.focus();
			alert ("Please enter a valid Equipment Id.\nPlease avoid special characters like '#','$','%','*'.");
			document.foRegn.tbEID.value ="";
			
		}
	}

}


//************************************************************************
//** Name            : fnValidateRegCode
//** Description     : Calls validation functions for Registration Code
//**
//** Called Form     : foRegn
//** Pages	     : form_meter_registration.asp
//************************************************************************

function fnValidateRegCode()
{
	if(document.foRegn.tbRegCode.value != "") 
			
	{
		if(!fnValidateIsNum(document.foRegn.tbRegCode.value))
		{
			foRegn.tbRegCode.focus();
			alert ("Please enter a valid Registration Code.\nPlease avoid special characters and alphabet.");
			document.foRegn.tbRegCode.value = "";
			
		}
	}

}




// End Of File