//************************client side validation file*******************************************
var fName
var lName	
var uName
var eAdd
var lPass
var cPass
var rBool
var year;
var month;
var i;
var j;
var seldate;
var selmonth;
var selyear;
var reg_year;
var str1

//*******************************function to check the confiem password & password equality

function isPassword(str,str2)
{
if(str.toString()==str2.toString())
	{
	return true;
	}
return false;

}

//*******************************function to check the first charcter************************

function first_char(str)
	{
		if(str.charCodeAt(0)<65 || str.charCodeAt(0)>122)
			{
			return false;
			}
		return true;

	}
//**********************************To check the spaces**************************************
function isSpace(str)
	{
	for (i=0;i<str.length ;i++ )
		{
		if (str.charCodeAt(i)==32)
			{
			return true;
			}
		}
	return false;
	}

//*************************************To check the month value*******************************
function isMonth(str)
	{
	str1=eval(str);
	if ((str1<=0 || str1>12))
		{
		return false;
		}
	return true;
	}

function isDay(str)
	{
	str1=eval(str);
	if ((str1<=0 || str1>31))
		{
		return false;
		}
	return true;
	}

//**************************************to chedck the valid dtae*********************************
function checkDate(dd,mm,yy)
	{
	var day;
	if (mm==1 || mm==3 || mm==5 || mm==7 || mm==8 || mm==10 || mm==12)
		{
		day=31;
		if (dd<=day)
			{
			return true;
			}
		}
	if (mm==4 || mm==6 || mm==9 || mm==11)
		{
		day=30;
		if (dd<=day)
			{
			return true;
			}
		}
	
	if(mm==2)
		{
		if(yy%4==0)
			{
			day=29;
			}
		else
			{
			day=28;
			}
		if(dd<=day)
			{
			return true;
			}
		}
	return false;

	}

//*****************************************To check the emptyness for the field*********************
function isBlank(str)
{
	
rBoll=false;
if (str.toString()=="")
	{
	
	rBoll=true;
	}
return rBoll;
}
//*************************************For finding the @ & . in email*********************************
function eMailValidate(str)
{
var at;
at=str.indexOf("@");
if (at==-1)
	{
	return false;
	}
at=str.indexOf(".")
if (at==-1)
	{
	return false;
	}
return true;
}

//*************************************To check the that field can not contain numeric value*********
function isString(str)
{
var i;
for (i=0;i<str.length;i++)
	{
	if(str.charCodeAt(i)<65 || str.charCodeAt(i)>122)
		{
		return false;
		}
	return true;
	}
}	

//***********************************To check that the value is number*****************************
function isNumber(str)
{
if (isNaN(str))
	{
	return false;
	}
return true;
}

//*********************************to check the length of the minute,secong,month,day***********
function isLength1(str)
	{
	if ((str.length<0) || (str.length>2))
		{
		return false;
		}
	return true;
	}

//********************************To check the length of the year********************************


function isLength(str)
	{
	if (str.length<4)
		{
		return false;
		}
	return true;
	}
//*********************************to check the valid hour***************************************
function isHour(str)
	{
	str1=eval(str);
	if ((str1<1 || str1>24))
		{
		return false;
		}
	return true;
	}
//******************************to check the valid hour for editlogininfo************************
function isHour1(str)
	{
	str1=eval(str);
	if ((str1<0 || str1>23))
		{
		return false;
		}
	return true;
	}

//************************function for validating the index value for minutes and second***********
function isIndex(str)
{
str1=eval(str);

if(str1<0 || str1>59)
	{
	
	return false;
	}
return true;
}

function isIndex1(str)
{
str1=eval(str);
if(str1<=0 || str1>60)
	{
	return false;
	}
return true;
}

//****************************To check the range of the year*****************************************
function isRangeYear(str)
	{
	str1=eval(str);
	if (str1<=1899)
		{
		return false;
		}
	return true;
	}
	
//*******************************to check the length of the year*************************************
function isValidYear(str)
	{
		str1=eval(str.length);
		
		if (str1<4)
			{
			return false;
			}
		return true;
	}
//*************************************To check that field contain any special character*********

function isValidChar(str)
	{

	for(i=0;i<str.length;i++)
		{
		str1=str.charAt(i);
		if (str1=="!" || str1=="@" || str1=="#" || str1=="$" || str1=="^" || str1=="&" || str1=="*" || str1=="(" || str1==")" || str1== "-" || str1== "|" || str1=="'" || str1=="<" || str1==">" || str1=="?" || str1=="/" || str1==":" || str1==";" || str1=="}" || str1=="{" || str1=="[" || str1=="]" )
			{
			return false;
			}
		}
	return true;
	}


//*******************This function is for editlogininfo.asp*******************************************

function formValidate()
{

var_fname=document.report.txtName.value;
var_year=document.report.year.value;

var_month=document.report.mon.value;
var_day=document.report.day.value;
var_hour=document.report.hour.value;
var_minute=document.report.minute.value;
var_second=document.report.second.value;
var_city=document.report.City.value;
var_bCity=document.report.BCity.value;



//****************************checks for first name*************************************


if(isBlank(var_fname))
	{
	alert("Name can not be left blank");
	document.report.txtName.focus();
	document.report.txtName.select();
	return false;
	}
/*if(isSpace(var_fname))
	{
	alert("First name can not contain spaces");
	document.report.txtName.focus();
	document.report.txtName.select();
	return false;
	
	}*/
if(!first_char(var_fname))
	{
	alert("name must be start with alphabet");
	document.report.txtName.focus();
	document.report.txtName.select();
	return false;
	
	}

if(!isValidChar(var_fname))
	{
	alert("First name can not contain specail character(!,@,#,$,%,^,&,*,(,),-,=,|,<,>,?,/,.,',;,:)");
	document.report.txtName.focus();
	document.report.txtName.select();
	return false;
	
	}


//************************************************checks for year***************************
if(isBlank(var_year))
	{
	alert("Year can not be left blank");
	document.report.year.focus();
	document.report.year.select();
	return false;
	}

if(!isNumber(var_year))
	{
	alert("Enter year in nubers");
	document.report.year.focus();
	document.report.year.select();
	return false;
	}

//************************************************checks for month***************************


if(isBlank(var_month))
	{
	alert("Month can not be left blank");
	document.report.mon.focus();
	document.report.mon.select();
	return false;
	}

if(!isNumber(var_month))
	{
	alert("Enter month in numbers");
	document.report.mon.focus();
	document.report.mon.select();
	return false;
	}
if(!isMonth(var_month))
	{
	alert("Enter the valid month");
	document.report.mon.focus();
	document.report.mon.select();

	return false;
	}

//************************************************checks for day***************************

if(isBlank(var_day))
	{
	alert("Day can not be left blank");
	document.report.day.focus();
	document.report.day.select();
	return false;
	}

if(!isNumber(var_day))
	{
	alert("Enter day in number");
	document.report.day.focus();
	document.report.day.select();
	return false;
	}
//*************************************checks for year*****************************************
if(!isRangeYear(var_year))
	{
	alert("Enter the year after 1899");
	document.report.year.focus();
	document.report.year.select();

	return false;
	}
if(!isValidYear(var_year))
	{
	alert("Enter only four digit year");
	document.report.year.focus();
	document.report.year.select();

	return false;
	}
//************************************checks for valid date************************************
if (!checkDate(var_day,var_month,var_year))
	{
	alert("Enter the valid date");
	return false;
	}

//********************************checks for hour****************************************************
if(isBlank(var_hour))
	{
	alert("Hour can not be left blank");
	document.report.hour.focus();
	document.report.hour.select();
	return false;
	}

if(!isNumber(var_hour))
	{
	alert("Enter only number in hour");
	document.report.hour.focus();
	document.report.hour.select();
	return false;
	}
if(!isHour1(var_hour))
	{
	alert("Enter hour between 0 to 23");
	return false;
	}


//*******************************checks for minute***************************************************
if(!isNumber(var_minute))
	{
	alert("Enter only number in minute");
	document.report.minute.focus();
	document.report.minute.select();
	return false;
	}
if(isBlank(var_minute))
	{
	alert("Minute can not be left blank");
	document.report.minute.focus();
	document.report.minute.select();
	return false;
	}
if(!isIndex(var_minute))
	{
	alert("Enter minute between 0 to 59");
	
	return false;
	
	}

//**************************checks for second*******************************************************
if(isBlank(var_second))
	{
	alert("Second can not be left blank");
	document.report.second.focus();
	document.report.second.select();
	return false;
	}

if(!isNumber(var_second))
	{
	alert("Enter second in number");
	document.report.second.focus();
	document.report.second.select();
	return false;
	}
if(!isIndex(var_second))
	{
	alert("Enter second between 0 to 59");
	return false;
	}  

if (isBlank(var_city))
{
	alert("City can not be left blank");
	document.report.City.focus();
	document.report.City.select();
	return false;
}
if (isBlank(var_bCity))
{
	alert("Big City can not be left blank");
	document.report.BCity.focus();
	document.report.BCity.select();
	return false;
} 

return true;
}




//*************************************end of edit login****************************************************

function matchValidate()
{
var_fname=document.match.txtName.value;
var_year=document.match.year.value;


var_month=document.match.mon.value;
var_day=document.match.day.value;
var_hour=document.match.hour.value;
var_minute=document.match.minute.value;
var_second=document.match.second.value;
var_city=document.match.City.value;
var_bCity=document.match.BCity.value;

var_gfname=document.match.txtGName.value;
var_gyear=document.match.g_year.value;

var_gmonth=document.match.g_mon.value;
var_gday=document.match.g_day.value;
var_ghour=document.match.g_hour.value;
var_gminute=document.match.g_minute.value;
var_gsecond=document.match.g_second.value;
var_gcity=document.match.g_City.value;
var_gbCity=document.match.g_BCity.value;

//****************************checks for first name*************************************


if(isBlank(var_fname))
	{
	alert("Name can not be left blank");
	document.match.txtName.focus();
	document.match.txtName.select();
	return false;
	}
/*if(isSpace(var_fname))
	{
	alert("First name can not contain spaces");
	document.match.txtName.focus();
	document.match.txtName.select();
	return false;
	
	}*/
if(!first_char(var_fname))
	{
	alert("name must be start with alphabet");
	document.match.txtName.focus();
	document.match.txtName.select();
	return false;
	
	}

if(!isValidChar(var_fname))
	{
	alert("First name can not contain specail character(!,@,#,$,%,^,&,*,(,),-,=,|,<,>,?,/,.,',;,:)");
	document.match.txtName.focus();
	document.match.txtName.select();
	return false;
	
	}


//************************************************checks for year***************************
if(isBlank(var_year))
	{
	alert("Year can not be left blank");
	document.match.year.focus();
	document.match.year.select();
	return false;
	}

if(!isNumber(var_year))
	{
	alert("Enter year in nubers");
	document.match.year.focus();
	document.match.year.select();
	return false;
	}

//************************************************checks for month***************************


if(isBlank(var_month))
	{
	alert("Month can not be left blank");
	document.match.mon.focus();
	document.match.mon.select();
	return false;
	}

if(!isNumber(var_month))
	{
	alert("Enter month in numbers");
	document.match.mon.focus();
	document.match.mon.select();
	return false;
	}
if(!isMonth(var_month))
	{
	alert("Enter the valid month");
	document.match.mon.focus();
	document.match.mon.select();

	return false;
	}

//************************************************checks for day***************************

if(isBlank(var_day))
	{
	alert("Day can not be left blank");
	document.match.day.focus();
	document.match.day.select();
	return false;
	}

if(!isNumber(var_day))
	{
	alert("Enter day in number");
	document.match.day.focus();
	document.match.day.select();
	return false;
	}
//*************************************checks for year*****************************************
if(!isRangeYear(var_year))
	{
	alert("Enter the year after 1899");
	document.match.year.focus();
	document.match.year.select();

	return false;
	}
if(!isValidYear(var_year))
	{
	alert("Enter only four digit year");
	document.match.year.focus();
	document.match.year.select();

	return false;
	}
//************************************checks for valid date************************************
if (!checkDate(var_day,var_month,var_year))
	{
	alert("Enter the valid date");
	return false;
	}

//********************************checks for hour****************************************************
if(isBlank(var_hour))
	{
	alert("Hour can not be left blank");
	document.match.hour.focus();
	document.match.hour.select();
	return false;
	}

if(!isNumber(var_hour))
	{
	alert("Enter only number in hour");
	document.match.hour.focus();
	document.match.hour.select();
	return false;
	}
if(!isHour1(var_hour))
	{
	alert("Enter hour between 0 to 23");
	return false;
	}


//*******************************checks for minute***************************************************
if(!isNumber(var_minute))
	{
	alert("Enter only number in minute");
	document.match.minute.focus();
	document.match.minute.select();
	return false;
	}
if(isBlank(var_minute))
	{
	alert("Minute can not be left blank");
	document.match.minute.focus();
	document.match.minute.select();
	return false;
	}
if(!isIndex(var_minute))
	{
	alert("Enter minute between 0 to 59");
	
	return false;
	
	}

//**************************checks for second*******************************************************
if(isBlank(var_second))
	{
	alert("Second can not be left blank");
	document.match.second.focus();
	document.match.second.select();
	return false;
	}

if(!isNumber(var_second))
	{
	alert("Enter second in number");
	document.match.second.focus();
	document.match.second.select();
	return false;
	}
if(!isIndex(var_second))
	{
	alert("Enter second between 0 to 59");
	return false;
	}  

if (isBlank(var_city))
{
	alert("City can not be left blank");
	document.match.City.focus();
	document.match.City.select();
	return false;
}
if (isBlank(var_bCity))
{
	alert("Birth City can not be left blank");
	document.match.BCity.focus();
	document.match.BCity.select();
	return false;
} 

//******************************Girls Details**************************************************************
if(isBlank(var_gfname))
	{
	alert("Name can not be left blank");
	document.match.txtGName.focus();
	document.match.txtGName.select();
	return false;
	}
if(isSpace(var_gfname))
	{
	alert("First name can not contain spaces");
	document.match.txtGName.focus();
	document.match.txtGName.select();
	return false;
	
	}
if(!first_char(var_gfname))
	{
	alert("name must be start with alphabet");
	document.match.txtGName.focus();
	document.match.txtGName.select();
	return false;
	
	}

if(!isValidChar(var_gfname))
	{
	alert("First name can not contain specail character(!,@,#,$,%,^,&,*,(,),-,=,|,<,>,?,/,.,',;,:)");
	document.match.txtGName.focus();
	document.match.txtGName.select();
	return false;
	
	}


//************************************************checks for year***************************
if(isBlank(var_gyear))
	{
	alert("Year can not be left blank");
	document.match.g_year.focus();
	document.match.g_year.select();
	return false;
	}

if(!isNumber(var_gyear))
	{
	alert("Enter year in nubers");
	document.match.g_year.focus();
	document.match.g_year.select();
	return false;
	}

//************************************************checks for month***************************


if(isBlank(var_gmonth))
	{
	alert("Month can not be left blank");
	document.match.g_mon.focus();
	document.match.g_mon.select();
	return false;
	}

if(!isNumber(var_gmonth))
	{
	alert("Enter month in numbers");
	document.match.g_mon.focus();
	document.match.g_mon.select();
	return false;
	}
if(!isMonth(var_gmonth))
	{
	alert("Enter the valid month");
	document.match.g_mon.focus();
	document.match.g_mon.select();

	return false;
	}

//************************************************checks for day***************************

if(isBlank(var_gday))
	{
	alert("Day can not be left blank");
	document.match.g_day.focus();
	document.match.g_day.select();
	return false;
	}

if(!isNumber(var_gday))
	{
	alert("Enter day in number");
	document.match.g_day.focus();
	document.match.g_day.select();
	return false;
	}
//*************************************checks for year*****************************************
if(!isRangeYear(var_gyear))
	{
	alert("Enter the year after 1899");
	document.match.g_year.focus();
	document.match.g_year.select();

	return false;
	}
if(!isValidYear(var_gyear))
	{
	alert("Enter only four digit year");
	document.match.g_year.focus();
	document.match.g_year.select();

	return false;
	}
//************************************checks for valid date************************************
if (!checkDate(var_day,var_month,var_year))
	{
	alert("Enter the valid date");
	return false;
	}

//********************************checks for hour****************************************************
if(isBlank(var_ghour))
	{
	alert("Hour can not be left blank");
	document.match.g_hour.focus();
	document.match.g_hour.select();
	return false;
	}

if(!isNumber(var_ghour))
	{
	alert("Enter only number in hour");
	document.match.g_hour.focus();
	document.match.g_hour.select();
	return false;
	}
if(!isHour1(var_ghour))
	{
	alert("Enter hour between 0 to 23");
	return false;
	}


//*******************************checks for minute***************************************************
if(!isNumber(var_gminute))
	{
	alert("Enter only number in minute");
	document.match.g_minute.focus();
	document.match.g_minute.select();
	return false;
	}
if(isBlank(var_gminute))
	{
	alert("Minute can not be left blank");
	document.match.g_minute.focus();
	document.match.g_minute.select();
	return false;
	}
if(!isIndex(var_gminute))
	{
	alert("Enter minute between 0 to 59");
	
	return false;
	
	}

//**************************checks for second*******************************************************
if(isBlank(var_gsecond))
	{
	alert("Second can not be left blank");
	document.match.g_second.focus();
	document.match.g_second.select();
	return false;
	}

if(!isNumber(var_gsecond))
	{
	alert("Enter second in number");
	document.match.g_second.focus();
	document.match.g_second.select();
	return false;
	}
if(!isIndex(var_gsecond))
	{
	alert("Enter second between 0 to 59");
	return false;
	}  

if (isBlank(var_gcity))
{
	alert("City can not be left blank");
	document.match.g_City.focus();
	document.match.g_City.select();
	return false;
}
if (isBlank(var_gbCity))
{
	alert("Big City can not be left blank");
	document.match.g_BCity.focus();
	document.match.g_BCity.select();
	return false;
} 

return true;
}



//************************************************AskQuestion************************************************************

function askQuestionValidate()
{

var_fname=document.askQuestion.txtName.value;
var_year=document.askQuestion.year.value;

var_month=document.askQuestion.mon.value;
var_day=document.askQuestion.day.value;
var_hour=document.askQuestion.hour.value;
var_minute=document.askQuestion.minute.value;
var_second=document.askQuestion.second.value;
var_city=document.askQuestion.City.value;
var_country=document.askQuestion.country.value;

var_bCity=document.askQuestion.BCity.value;
var_ccity=document.askQuestion.c_City.value;
var_cbCity=document.askQuestion.c_BCity.value;
var_ccountry=document.askQuestion.c_country.value;
var_email=document.askQuestion.txtEmail.value;
var_question=document.askQuestion.txtQuestion.value;





//****************************checks for first name*************************************


if(isBlank(var_fname))
	{
	alert("Name can not be left blank");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	}
/*if(isSpace(var_fname))
	{
	alert("First name can not contain spaces");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}*/
if(!first_char(var_fname))
	{
	alert("name must be start with alphabet");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}

if(!isValidChar(var_fname))
	{
	alert("First name can not contain specail character(!,@,#,$,%,^,&,*,(,),-,=,|,<,>,?,/,.,',;,:)");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}


//************************************************checks for year***************************
if(isBlank(var_year))
	{
	alert("Year can not be left blank");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();
	return false;
	}

if(!isNumber(var_year))
	{
	alert("Enter year in nubers");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();
	return false;
	}

//************************************************checks for month***************************


if(isBlank(var_month))
	{
	alert("Month can not be left blank");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();
	return false;
	}

if(!isNumber(var_month))
	{
	alert("Enter month in numbers");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();
	return false;
	}
if(!isMonth(var_month))
	{
	alert("Enter the valid month");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();

	return false;
	}

//************************************************checks for day***************************

if(isBlank(var_day))
	{
	alert("Day can not be left blank");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}
if(!isDay(var_day))
	{
	alert("Enter the valid day");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}


if(!isNumber(var_day))
	{
	alert("Enter day in number");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}
//*************************************checks for year*****************************************
if(!isRangeYear(var_year))
	{
	alert("Enter the year after 1899");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();

	return false;
	}
if(!isValidYear(var_year))
	{
	alert("Enter only four digit year");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();

	return false;
	}
//************************************checks for valid date************************************
if (!checkDate(var_day,var_month,var_year))
	{
	alert("Enter the valid date");
	return false;
	}

//********************************checks for hour****************************************************
if(isBlank(var_hour))
	{
	alert("Hour can not be left blank");
	document.askQuestion.hour.focus();
	document.askQuestion.hour.select();
	return false;
	}

if(!isNumber(var_hour))
	{
	alert("Enter only number in hour");
	document.askQuestion.hour.focus();
	document.askQuestion.hour.select();
	return false;
	}
if(!isHour1(var_hour))
	{
	alert("Enter hour between 0 to 23");
	return false;
	}


//*******************************checks for minute***************************************************
if(!isNumber(var_minute))
	{
	alert("Enter only number in minute");
	document.askQuestion.minute.focus();
	document.askQuestion.minute.select();
	return false;
	}
if(isBlank(var_minute))
	{
	alert("Minute can not be left blank");
	document.askQuestion.minute.focus();
	document.askQuestion.minute.select();
	return false;
	}
if(!isIndex(var_minute))
	{
	alert("Enter minute between 0 to 59");
	
	return false;
	
	}

//**************************checks for second*******************************************************
if(isBlank(var_second))
	{
	alert("Second can not be left blank");
	document.askQuestion.second.focus();
	document.askQuestion.second.select();
	return false;
	}

if(!isNumber(var_second))
	{
	alert("Enter second in number");
	document.askQuestion.second.focus();
	document.askQuestion.second.select();
	return false;
	}
if(!isIndex(var_second))
	{
	alert("Enter second between 0 to 59");
	return false;
	}  
if (isBlank(var_country))
{
	alert("Country can not be left blank");
	return false;
}

if (isBlank(var_city))
{
	alert("City can not be left blank");
	document.askQuestion.City.focus();
	document.askQuestion.City.select();
	return false;
}
if (isBlank(var_bCity))
{
	alert("Big City can not be left blank");
	document.askQuestion.BCity.focus();
	document.askQuestion.BCity.select();
	return false;
} 

if (isBlank(var_ccity))
{
	alert("Current City can not be left blank");
	document.askQuestion.c_City.focus();
	document.askQuestion.c_City.select();
	return false;
}
if (isBlank(var_cbCity))
{
	alert("Big City can not be left blank");
	document.askQuestion.c_BCity.focus();
	document.askQuestion.c_BCity.select();
	return false;
} 
if (isBlank(var_ccountry))
{
	alert("Current Country can not be left blank");
	return false;
}

if(isBlank(var_email))
	{
	alert("Email can not be left blank");
	document.askQuestion.txtEmail.focus();
	document.askQuestion.txtEmail.select();
	return false;
	}
if (!eMailValidate(var_email))
	{
	alert("Email is not valid");
	document.askQuestion.txtEmail.focus();
	return false;
	}
if(isBlank(var_question))
{
alert("Question can not be left blank");
document.askQuestion.txtQuestion.focus();
document.askQuestion.txtQuestion.select();
return false;
}



return true;
}

//************************************************AskFromLalKitab************************************************************

function askQuestionValidate1()
{

var_fname=document.askQuestion.txtName.value;
var_year=document.askQuestion.year.value;

var_month=document.askQuestion.mon.value;
var_day=document.askQuestion.day.value;
var_hour=document.askQuestion.hour.value;
var_minute=document.askQuestion.minute.value;
var_second=document.askQuestion.second.value;
var_city=document.askQuestion.City.value;
var_country=document.askQuestion.country.value;

var_bCity=document.askQuestion.BCity.value;
var_email=document.askQuestion.txtEmail.value;
var_question1=document.askQuestion.txtQuestion1.value;
var_question2=document.askQuestion.txtQuestion2.value;
var_question3=document.askQuestion.txtQuestion3.value;





//****************************checks for first name*************************************


if(isBlank(var_fname))
	{
	alert("Name can not be left blank");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	}
/*if(isSpace(var_fname))
	{
	alert("First name can not contain spaces");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}*/
if(!first_char(var_fname))
	{
	alert("name must be start with alphabet");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}

if(!isValidChar(var_fname))
	{
	alert("First name can not contain specail character(!,@,#,$,%,^,&,*,(,),-,=,|,<,>,?,/,.,',;,:)");
	document.askQuestion.txtName.focus();
	document.askQuestion.txtName.select();
	return false;
	
	}


//************************************************checks for year***************************
if(isBlank(var_year))
	{
	alert("Year can not be left blank");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();
	return false;
	}

if(!isNumber(var_year))
	{
	alert("Enter year in nubers");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();
	return false;
	}

//************************************************checks for month***************************


if(isBlank(var_month))
	{
	alert("Month can not be left blank");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();
	return false;
	}

if(!isNumber(var_month))
	{
	alert("Enter month in numbers");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();
	return false;
	}
if(!isMonth(var_month))
	{
	alert("Enter the valid month");
	document.askQuestion.mon.focus();
	document.askQuestion.mon.select();

	return false;
	}

//************************************************checks for day***************************

if(isBlank(var_day))
	{
	alert("Day can not be left blank");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}
if(!isDay(var_day))
	{
	alert("Enter the valid day");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}


if(!isNumber(var_day))
	{
	alert("Enter day in number");
	document.askQuestion.day.focus();
	document.askQuestion.day.select();
	return false;
	}
//*************************************checks for year*****************************************
if(!isRangeYear(var_year))
	{
	alert("Enter the year after 1899");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();

	return false;
	}
if(!isValidYear(var_year))
	{
	alert("Enter only four digit year");
	document.askQuestion.year.focus();
	document.askQuestion.year.select();

	return false;
	}
//************************************checks for valid date************************************
if (!checkDate(var_day,var_month,var_year))
	{
	alert("Enter the valid date");
	return false;
	}

//********************************checks for hour****************************************************
if(isBlank(var_hour))
	{
	alert("Hour can not be left blank");
	document.askQuestion.hour.focus();
	document.askQuestion.hour.select();
	return false;
	}

if(!isNumber(var_hour))
	{
	alert("Enter only number in hour");
	document.askQuestion.hour.focus();
	document.askQuestion.hour.select();
	return false;
	}
if(!isHour1(var_hour))
	{
	alert("Enter hour between 0 to 23");
	return false;
	}


//*******************************checks for minute***************************************************
if(!isNumber(var_minute))
	{
	alert("Enter only number in minute");
	document.askQuestion.minute.focus();
	document.askQuestion.minute.select();
	return false;
	}
if(isBlank(var_minute))
	{
	alert("Minute can not be left blank");
	document.askQuestion.minute.focus();
	document.askQuestion.minute.select();
	return false;
	}
if(!isIndex(var_minute))
	{
	alert("Enter minute between 0 to 59");
	
	return false;
	
	}

//**************************checks for second*******************************************************
if(isBlank(var_second))
	{
	alert("Second can not be left blank");
	document.askQuestion.second.focus();
	document.askQuestion.second.select();
	return false;
	}

if(!isNumber(var_second))
	{
	alert("Enter second in number");
	document.askQuestion.second.focus();
	document.askQuestion.second.select();
	return false;
	}
if(!isIndex(var_second))
	{
	alert("Enter second between 0 to 59");
	return false;
	}  
if (isBlank(var_country))
{
	alert("Country can not be left blank");
	return false;
}

if (isBlank(var_city))
{
	alert("City can not be left blank");
	document.askQuestion.City.focus();
	document.askQuestion.City.select();
	return false;
}
if (isBlank(var_bCity))
{
	alert("Big City can not be left blank");
	document.askQuestion.BCity.focus();
	document.askQuestion.BCity.select();
	return false;
} 

if(isBlank(var_email))
	{
	alert("Email can not be left blank");
	document.askQuestion.txtEmail.focus();
	document.askQuestion.txtEmail.select();
	return false;
	}
if (!eMailValidate(var_email))
	{
	alert("Email is not valid");
	document.askQuestion.txtEmail.focus();
	return false;
	}
if(isBlank(var_question1))
	{
	alert("Question1 can not be left blank");
	document.askQuestion.txtQuestion1.focus();
	document.askQuestion.txtQuestion1.select();
	return false;
	}
if(isBlank(var_question2))
{
alert("Question2 can not be left blank");
document.askQuestion.txtQuestion2.focus();
document.askQuestion.txtQuestion2.select();
return false;
}
if(isBlank(var_question3))
{
alert("Question3 can not be left blank");
document.askQuestion.txtQuestion3.focus();
document.askQuestion.txtQuestion3.select();
return false;
}



return true;
}

