function displaypanel(dp)
{
	if (dp == 'R')
	{
		document.getElementById('registerfrm').style.display='';
		document.getElementById('loginfrm').style.display='none';
	}
	else if (dp == 'L')
	{
		document.getElementById('registerfrm').style.display='none';
		document.getElementById('loginfrm').style.display='';
	}
}

function logincheck(theform)
{
	theControl="vchEmail,vchPassword,,,";
	theMessage="User ID,Password,,,";
	theNumeric=",,,,,,,,";
	theEmail="Y,,,,,,,,";
	theURL=",,,,,,,,";
	theConfirmPassword=",,,,,,,,";
	thebadstuff=",,,,,,,,";
	theinteger=",,,,,,,,";
	thepercent=",,,,,,,,";
	thesize=",,,,,,,,";
	thedecimal=",,,,,,,,";
	theimage=",,,,,,,,";
	theempty="Y,Y,,,,,,,";
	themin=",,,,,,,,";
	themax=",,,,,,,,";
	thecheckboxlength=",,,,,,,,";
	thephoneno=",,,,,,,,";
	if(!theValidator(theform,theControl,theMessage,theNumeric,theEmail,theURL,theConfirmPassword,thebadstuff,theinteger,thepercent,thesize,thedecimal,theimage,theempty,themin,themax,thecheckboxlength,thephoneno))
	  return false;

	xajax_loginValidate(xajax.getFormValues('frmlogin'));
	return false;
}

function registercheck(theform)
{
	theControl="vchFName,intDay,intMonth,intYear,vchPresentClass,txtAddress,intCountryID,vchCity,intZip,vchPhone,vchEmail,vchConnectionType,vchSecurityCode";
	theMessage="First name,Day,Month,Year,Present Class or Occupation,Address,Country,City,Zip,Phone,Email,Type Of Connection,Verification Code";
	theNumeric=",,,,,,,,,,,,,,";
	theEmail=",,,,,,,,,,Y,,,,";
	theURL=",,,,,,,,,,,,,,";
	theConfirmPassword=",,,,,,,,,,,,,,";
	thebadstuff=",,,,,,,,,,,,,,";
	theinteger=",,,,,,,,,,,,,,";
	thepercent=",,,,,,,,,,,,,,";
	thesize=",,,,,,,,,,,,,,";
	thedecimal=",,,,,,,,,,,,,,";
	theempty="Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,,";
	theimage=",,,,,,,,,,,,,,";
	themin=",,,,,,,,,,,,,,";
	themax=",,,,,,,,,,,,,,";
	thecheckboxlength=",,,,,,,,,,,,,,";
	thephoneno=",,,,,,,,,,,,,,";
	if(!theValidator(theform,theControl,theMessage,theNumeric,theEmail,theURL,theConfirmPassword,thebadstuff,theinteger,thepercent,thesize,thedecimal,theimage,theempty,themin,themax,thecheckboxlength,thephoneno))
	  return false;
	if ((document.getElementById('vchGender1').checked==false) && (document.getElementById('vchGender2').checked==false))
	{
		alert("Please select your gender to continue.");
		return false;
	}
	if ((document.getElementById('vchCoEducation1').checked==false) && (document.getElementById('vchCoEducation2').checked==false))
	{
		alert("Please select your studying/studied in co-education to continue.");
		return false;
	}

	if (theform.terms.checked==false)
	{
		alert("Please accept our terms & conditions to continue.");
		return false;
	}

	xajax_registerMember(xajax.getFormValues('frmregister'));
	return false;
}

function checkanswer(theform)
{
	var chk=false;
	var leng = theform.txtAnswer.length;
	var i;
	for (i=0;i<leng;i++)
	{
		if (theform.txtAnswer[i].checked==true)
		{
			chk=true;
			break
		}
	}
	
	if (chk == false)
	{
		alert("Please select answer option to continue.");
	}
	else {
		theform.nextQuestion.disabled=true;
		theform.skipQuestion.disabled=true;
		xajax_continueNext(xajax.getFormValues('frmsarttest'));
	}
	return false;
}

function skipquestion(theform)
{
	theform.nextQuestion.disabled=true;
	theform.skipQuestion.disabled=true;
	xajax_continueNext(xajax.getFormValues('frmsarttest'));
}

function checkformuestion(theform)
{
	if (theform.query.value=='')
	{
		alert("Please add your query to ask question.");
		return false;
	}
}

function jumptoTestPage()
{
	window.location="begin-test.php";
}
