//<!--
//
//---------------------------------------------------------------------------------//
// Javascript Library function for chennaiplaza.com
// Dont modify the below codes at any cause. Will give errors
// Last Update	: 23rd April 2000
// Function		:
//				:	(1) getimage()	:	To open a new window with enlarged image
//						* Param		:	Full Big Image Path as string
//									:	Collection name as string
//									:	Item name as string
//---------------------------------------------------------------------------------//
var flag=0
//---------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------//

//-----------------------------------------------------------------------
function isSpecialChr(field)
{
	if(field.value.match(/[\~\!\@\#\$\%\^\&\*\<\>\:\{\}]/) != null)
		{
	
			return true ;
		
		}else
		{
		
			return false ;
		}

}

//-----------------------------------------------------------------------
//New User registration form.
//---------------------------------------------------------------------------------//
function FormValid(year)
{
y2k = year;
//***********FirstName Validation**************
if (document.f1.firstname.value=="")
{
alert("Enter Your First Name")
document.f1.firstname.select();
return false;
}
if (!isNaN(document.f1.firstname.value.substring(0,1)) || document.f1.firstname.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.firstname)==true)
{
		alert("Enter valid characters in First Name");
		document.f1.firstname.focus();
		document.f1.firstname.select();
		return;
		}
//***********LastName Validation**************

if (document.f1.lastname.value != "")
{
if (!isNaN(document.f1.lastname.value.substring(0,1)) || document.f1.lastname.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.lastname)==true)
{
		alert("Enter valid characters in Last Name");
		document.f1.lastname.focus();
		document.f1.lastname.select();
		return;
}
		
}		

//***********Nationality Validation**************


if (document.f1.nationality.value=="")
{
alert("Enter your Nationality.")
document.f1.nationality.select();
return; 
}

if(!isNaN(document.f1.nationality.value.substring(0,1)) || document.f1.nationality.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.nationality)==true)
{
alert("Enter valid characters in Nationality.");
document.f1.nationality.select();
return; 
}
 


//*******Year Validation***********
if (document.f1.yyyy.value=="")
{
alert("Enter the year");
document.f1.yyyy.focus();
return;
}
if (isNaN(document.f1.yyyy.value))
{
alert("Enter a valid Year");
document.f1.yyyy.select();
return;
}


if (document.f1.yyyy.value > y2k )
{
alert("Year greater than current year");
document.f1.yyyy.select();
document.f1.yyyy.focus();
return;
}

if(y2k - document.f1.yyyy.value > 100 )
{
alert("Enter Correct DOB");
document.f1.yyyy.select();
document.f1.yyyy.focus();
return;
}
/*if (datecheck(y2k))
{
alert("enter Correct DOB");
document.f1.yyyy.select();
document.f1.yyyy.focus();
return;
}*/
//******************date&Month Validation*****************
if(document.f1.mm.options[document.f1.mm.selectedIndex].text == "Month") 
{
alert("Select Month In DOB correctly");
document.f1.mm.focus();
return;
}
if (document.f1.dd.options[document.f1.dd.selectedIndex].text == "Date") 
{
alert("Select Date in DOB correctly");
document.f1.dd.focus();
return;
}



//***********Address for Communication Validation**************

if (document.f1.cdoorno.value=="")
{
alert("Please Enter Address");
document.f1.cdoorno.focus();
return; 
}
if(isSpecialChr(document.f1.cdoorno)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.cdoorno.focus();
		document.f1.cdoorno.select();
		return;
		}
		
		if(isSpecialChr(document.f1.cstreet)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.cstreet.focus();
		document.f1.cstreet.select();
		return;
		}
		
		
		if (document.f1.ccity.value=="")
        {
	alert("Incomplete Address,Please Enter City Name");
	document.f1.ccity.focus();
		return;
		}
		if (!isNaN(document.f1.ccity.value.substring(0,1)) || document.f1.ccity.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.ccity)==true)
{
		alert("Please Enter City Name Correctly");
		document.f1.ccity.focus();
		document.f1.ccity.select();
		return;
		}
   if (document.f1.cstate.value=="")
 {
	alert("Incomplete Address, Plese Enter State Name");
	document.f1.cstate.focus();
	return;
	}
	if (!isNaN(document.f1.cstate.value.substring(0,1)) || document.f1.cstate.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.cstate)==true)
{
		alert("Please Enter State Name Correctly");
		document.f1.cstate.focus();
		document.f1.cstate.select();
		return;
		}
		
   if (document.f1.ccontry.value=="")
 {
	alert("Incomplete Address, Please Enter Country Name");
	document.f1.ccontry.focus();
		return;
		}
	if (!isNaN(document.f1.ccontry.value.substring(0,1)) || document.f1.ccontry.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.ccontry)==true)
{
		alert("Please Enter Country Name Correctly");
		document.f1.ccontry.focus();
		document.f1.ccontry.select();
		return;
		}



if (document.f1.cphone.value =="")
{
alert("Enter  PhoneNo");
document.f1.cphone.focus();
return; 
}

if(isSpecialChr(document.f1.cphone)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.cphone.focus();
		document.f1.cphone.select();
		return;
}
if(isSpecialChr(document.f1.cfax)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.cfax.focus();
		document.f1.cfax.select();
		return;
}
if(isSpecialChr(document.f1.ccell)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.ccell.focus();
		document.f1.ccell.select();
		return;
}
//**********E-Mail Validation******************

if (document.f1.email.value=="")
{
alert("Please Enter Your Email id");
document.f1.email.select();
return;	
}

if(document.f1.email.value.indexOf("@") <3 )
{
alert("Please Enter valid email ID");
document.f1.email.select();
return;
}

 if (document.f1.email.value.indexOf(".") == -1)
{
alert("Please Enter Correct Email");
document.f1.email.select();
return;
}


if (!document.f1.aemail.value=="")
{
	if(document.f1.aemail.value.indexOf("@") <3 )
		{
			alert("Please Enter Correct EMail");
			document.f1.aemail.select();
			return;
		}

	if (document.f1.aemail.value.indexOf(".") == -1)
		{
			alert("Please Enter Correct Email");
			document.f1.aemail.select();
			return;
		}
}
//***********Account Info  Validation begins here**************
//*******Name In ChennaiPlaza Validation******

if (document.f1.uname.value=="")
{
alert("Please Enter valid User Name");
document.f1.uname.select();
return; 
} 

if (!isNaN(document.f1.uname.value.substring(0,1)) || document.f1.uname.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.uname)==true)
{
		alert("Enter valid characters in UserName");
		document.f1.uname.focus();
		document.f1.uname.select();
		return;
		}

if (document.f1.uname.value.length >10)
{
alert("Username should not exceed 10 characters");
document.f1.uname.select();
return;
}
//*******Password Validation*************

if (document.f1.password1.value=="")
{
alert("Enter Your PassWord");
document.f1.password1.select();
return;
}

if (!isNaN(document.f1.password1.value.substring(0,1)) || document.f1.password1.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.password1)==true)
{
alert("Enter Valid Charactors(atleast Four) as PassWord");
document.f1.password1.select();
return;
}

if(document.f1.password1.value.length < 4)
{
alert("Minimum Four Characters For Password");
document.f1.password1.select();
return;
}
//*******Password Conformation*************

if (document.f1.conpass.value=="")
{
alert("conform Your Password");
document.f1.conpass.select();
return;
}

if (document.f1.password1.value != document.f1.conpass.value)
{
alert("Mismatch found in your password");
document.f1.conpass.select();
return;
}
//*********AcountInfo validation Ends here*******



if(isSpecialChr(document.f1.answer)==true)
{
		alert("Please Enter Valid Characters");
		document.f1.answer.focus();
		document.f1.answer.select();
		return;
}

document.f1.action="registration1.asp";
document.f1.submit();
}

//---------------------------------------------------------------------------------------



function FormValid1(year)
{
y2k = year;
//***********FirstName Validation**************
if (document.f1.firstname.value=="")
{
alert("Enter Your First Name")
document.f1.firstname.select();
return;
}
if (!isNaN(document.f1.firstname.value.substring(0,1)) || document.f1.firstname.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.firstname)==true)
{
		alert("Enter valid characters in First Name");
		document.f1.firstname.focus();
		document.f1.firstname.select();
		return;
		}
//***********LastName Validation**************

if (!isNaN(document.f1.lastname.value.substring(0,1)) || document.f1.lastname.value.match(/[a-zA-Z0-9]/)==null || isSpecialChr(document.f1.lastname)==true)
{
		alert("Enter valid characters in Last Name");
		document.f1.lastname.focus();
		document.f1.lastname.select();
		return;
		}

if (document.f1.nationality.value=="")
{
alert("Enter your Nationality.");
document.f1.nationality.select();
document.f1.nationality.focus();
return; 
}

if (isSpecialChr(document.f1.nationality)==true)
{
alert("Enter valid Characters.");
document.f1.nationality.select();
document.f1.nationality.focus();
return; 
}

//***********Address for Communication Validation**************

if (document.f1.cdoorno.value=="")
{
alert("Invalid Address. Try again.")
document.f1.cdoorno.select();
document.f1.cdoorno.focus();
return; 
}

if (isSpecialChr(document.f1.cdoorno)==true)
{
alert("Enter valid Characters.");
document.f1.cdoorno.select();
document.f1.cdoorno.focus();
return; 
}

if (isSpecialChr(document.f1.cstreet)==true)
{
alert("Enter valid Characters.");
document.f1.cstreet.select();
document.f1.cstreet.focus();
return; 
}

		
 if (document.f1.ccity.value=="")
        {
	alert("Please Enter City Name")
	document.f1.ccity.focus();
		return;
		}
 if (!isNaN(document.f1.ccity.value.substring(0,1)) || document.f1.ccity.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.ccity)==true)
{
		alert("Please Enter City Name Correctly");
		document.f1.ccity.focus();
		document.f1.ccity.select();
		return;
		}
   if (document.f1.cstate.value=="")
 {
	alert("Incomplete Address, Plese Enter State Name")
	document.f1.cstate.focus();
	return;
	}
	if (!isNaN(document.f1.cstate.value.substring(0,1)) || document.f1.cstate.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.cstate)==true)
{
		alert("Please Enter State Name Correctly");
		document.f1.cstate.focus();
		document.f1.cstate.select();
		return;
		}
		
   if (document.f1.ccontry.value=="")
 {
	alert("Incomplete Address, Please Enter Country Name")
	document.f1.ccontry.focus();
	return;	
		
		}
		if (!isNaN(document.f1.ccontry.value.substring(0,1)) || document.f1.ccontry.value.match(/[a-zA-Z]/)==null || isSpecialChr(document.f1.ccontry)==true)
{
		alert("Please Enter Country Name Correctly");
		document.f1.ccontry.focus();
		document.f1.ccontry.select();
		return;
		}

//***********Communication Address PinCode Validation**************
/*else
if (isNaN(document.f1.cpin.value))
{
alert("Enter a Valid pincode")
document.f1.cpin.focus();
document.f1.cpin.select();
return; 
} */
//***********Communication Address PhoneNo Validation**************

//**********E-Mail Validation******************


if(isSpecialChr(document.f1.cpin)==true)
{
alert("Enter valid characters");
document.f1.cpin.select();
document.f1.cpin.focus();
return;

}
if(isSpecialChr(document.f1.cphone)==true)
{
alert("Enter valid characters");
document.f1.cphone.select();
document.f1.cphone.focus();
return;

}
if(isSpecialChr(document.f1.cfax)==true)
{
alert("Enter valid characters");
document.f1.cfax.select();
document.f1.cfax.focus();
return;

}
if(isSpecialChr(document.f1.ccell)==true)
{
alert("Enter valid characters");
document.f1.ccell.select();
document.f1.ccell.focus();
return;

}

if (document.f1.email.value=="")
{
alert("Enter Your Email id");
document.f1.email.select();
document.f1.email.focus();
return;	
}

if(document.f1.email.value.indexOf("@") <3 )
{
alert("Enter Correct EMail");
document.f1.email.select();
return;
}

 if (document.f1.email.value.indexOf(".") == -1)
{
alert("Enter Correct Email");
document.f1.email.select();
return;
}

if(document.f1.email.value.match(/[\~\!\#\$\%\^\*\<\>]/) != null)
		{
		alert("Please enter Valid characters");
		document.f1.email.focus() ;
		document.f1.email.select() ;
		return ;
		}
		
		if(document.f1.aemail.value.match(/[\~\!\#\$\%\^\*\<\>]/) != null)
		{
		alert("Please enter Valid characters");
		document.f1.aemail.focus() ;
		document.f1.aemail.select() ;
		return ;
		}
//**********Alternate E-Mail Validation******************


//***********Communication Address CellPhoneNo Validation**************

//***********Communication Address Fax Validation**************

//***********Account Info  Validation begins here**************
//*******Password confirmation******

if (document.f1.pword.value.length != ""){

if(document.f1.pword.value.length < 4)
{
alert("Minimum Four Characters For Password");
document.f1.pword.select();
return;
}


if (document.f1.conpass.value=="")
{
alert("Confirm Your New Password");
document.f1.conpass.select();
return;
}


//*******Password Validation*************


//*******Password Conformation*************


if (document.f1.pword.value != document.f1.conpass.value)
{
alert("Mismatch found in your password");
document.f1.conpass.select();
return;
}
}
//*********AcountInfo validation Ends here*******


//*******Year Validation***********
if (document.f1.yyyy.value=="")
{
alert("Enter the year");
document.f1.yyyy.focus();
return;
}
if (isNaN(document.f1.yyyy.value))
{
alert("Enter a valid Year");
document.f1.yyyy.select();
return;
}

if (document.f1.yyyy.value < 1900 )
{
alert("Enter Correct DOB");
document.f1.yyyy.select();
document.f1.yyyy.focus();
return;
}
if (datecheck(y2k)  )
{
alert("enter Correct DOB");
document.f1.yyyy.select();
document.f1.yyyy.focus();
return;
}
//******************date&Month Validation*****************
if (document.f1.mm.value =="") 
{
alert("Select Month In DOB correctly");
document.f1.mm.focus();
document.f1.mm.select();
return;
}
if (document.f1.dd.value =="") 
{
alert("Select Date in DOB correctly");
document.f1.dd.focus();
document.f1.dd.select();
return;
}
//***********Perminnant Address Validation**************


if(isSpecialChr(document.f1.answer)==true)
{
alert("Enter valid characters");
document.f1.answer.select();
document.f1.answer.focus();
return;

}
 
 
document.forms[0].h1.value = 1;
document.forms[0].submit();


}
//--------------------------------------------------------------

//-->