// business opportunity form validator
function checkForm() {
	varError = '';
	if (document.buss_opp.name.value == '' || document.buss_opp.name.value == null) {
		varError = varError + '* Please enter your full name \n';
	}
	if (document.buss_opp.phone.value == '' || document.buss_opp.phone.value == null) {
		varError = varError + '* Please enter a valid contact number \n';
	}
	if (document.buss_opp.email.value == '' || document.buss_opp.email.value == null) {
		varError = varError + '* Please enter a valid emil address \n';
	}
	if (document.buss_opp.province.value == '0' || document.buss_opp.province.value == null) {
		varError = varError + '* Please select your province \n';
	}
	if (document.buss_opp.town.value == '' || document.buss_opp.town.value == null) {
		varError = varError + '* Please enter the name of your town/city \n';
	}
	if (document.buss_opp.interest.value == '0' || document.buss_opp.interest.value == null) {
		varError = varError + '* Please select your area of interest \n';
	}
		
	if (varError.length > 0) {
		alert("Please fix the following errors: \n\n" + varError);
	} else {
		document.buss_opp.submit();
	}
		
}

function checkForm3() {
	varError = '';
	if (document.buss_opp.name.value == '' || document.buss_opp.name.value == null) {
		varError = varError + '* Please enter your full name \n';
	}
	if (document.buss_opp.phone.value == '' || document.buss_opp.phone.value == null) {
		varError = varError + '* Please enter a valid contact number \n';
	}
	if (document.buss_opp.email.value == '' || document.buss_opp.email.value == null) {
		varError = varError + '* Please enter a valid emil address \n';
	}
	if (document.buss_opp.town.value == '' || document.buss_opp.town.value == null) {
		varError = varError + '* Please enter the name of your town/city \n';
	}
	if (document.buss_opp.interest.value == '0' || document.buss_opp.interest.value == null) {
		varError = varError + '* Please select your area of interest \n';
	}
		
	if (varError.length > 0) {
		alert("Please fix the following errors: \n\n" + varError);
	} else {
		document.buss_opp.submit();
	}
		
}

//get news function
function getNews(id) {
	new Ajax.Updater ('main', 'ajax/news.php', { method: 'get', parameters: 'id='+id });
}


//registration page validation
function validateRegistration() {
	
	varError = '';

    if ( document.register.username.value == "" ) {
		varError = varError + '* Please enter a username \n';
    }
	
	if ( document.register.firstname.value == "" ) {
		varError = varError + '* Please enter your first name \n';
    }
	
	if ( document.register.lastname.value == "" ){
		varError = varError + '* Please enter your surname \n';
    }
	
	if ( document.register.password.value == "" ){
		varError = varError + '* Please enter a password \n';
    }
	
	if ( document.register.email.value == "" ){
		varError = varError + '* Please enter a valid email address\n';
    }
	
	 if ( document.register.school.selectedIndex == 0 ){
		varError = varError + '* Please select your school \n';
    }

    if (varError.length > 0) {
		alert("Please fix the following errors: \n\n" + varError);
	} else {
		
		var pars = $('register').serialize(true);
		new Ajax.Updater('postMsg', 'ajax/register.php', {  method: 'post', parameters: pars  });
	
	}
	
}

//password recovery
function recoverPassword() {
	
		varError = '';
		
		if (document.recover.username.value == "" && document.recover.email.value == "")  {
			varError = varError + '*Please enter a username or email address';
		}
		
		if (varError.length > 0 ) {
			alert ("Please fix the following errors: \n\n" + varError);
		} else {
			var pars = $('recover').serialize(true);
			new Ajax.Updater('postMsg', 'ajax/recover.php', { method: 'post', parameters: pars });
		}
	
}

function checkForm2() {
		
		varError = '';
	
		if (document.contact_us.Name.value == '' || document.contact_us.Name.value == null) {
			varError = varError + '* Please enter a valid first name \n';
		}
		if (document.contact_us.Surname.value == '' || document.contact_us.Surname.value == null) {
			varError = varError + '* Please enter a valid surname \n';
		}
		if (document.contact_us.Emailtxt2.value == '' || document.contact_us.Emailtxt2.value == null) {
			varError = varError + '* Please enter a valid emil address \n';
		}
		if (document.contact_us.IdTxt.value == '' || document.contact_us.IdTxt.value == null) {
			varError = varError + '* Please enter a valid id number \n';
		}
		if (document.contact_us.Postal1.value == '' || document.contact_us.Postal2.value == '' || document.contact_us.Postal4.value == '') {
			varError = varError + '* Please enter a valid postal address \n';
		}
		if (document.contact_us.Address1.value == '' || document.contact_us.Address2.value == '' || document.contact_us.Address4.value == '') {
			varError = varError + '* Please enter a valid business address \n';
		}
		if (document.contact_us.EmailTxt.value == '' || document.contact_us.EmailTxt.value == null) {
			varError = varError + '* Please enter a valid c4k email address \n';
		}
		if (document.contact_us.PasswdTxt.value == '' || document.contact_us.PasswdTxt.value == null) {
			varError = varError + '* Please enter a valid password \n';
		}
		if (document.contact_us.CardName.value == '' || document.contact_us.CardName.value == null) {
			varError = varError + '* Please enter a valid name for your business card \n';
		}
		if (document.contact_us.CellularTxt.value == '' || document.contact_us.CellularTxt.value == null) {
			varError = varError + '* Please enter a valid mobile number \n';
		}
		if (document.contact_us.PhoneTxt.value == '') {
			varError = varError + '* Please enter a valid telephone number \n';
		}
		if (document.contact_us.own_pc.value == '' || document.contact_us.own_pc.value == null) {
			varError = varError + '* Please enter a valid number for your own workstations \n';
		}
		if (document.contact_us.c4k_pc.value == '' || document.contact_us.c4k_pc.value == null) {
			varError = varError + '* Please enter a valid number for c4k workstations \n';
		}
		if (document.contact_us.curriculum.value == '0' || document.contact_us.curriculum.value == null) {
			varError = varError + '* Please select a curriculum \n';
		}
		
		if (varError.length > 0) {
			alert("Please fix the following errors: \n\n" + varError);
		} else {
			document.contact_us.submit();
		}
		
}
	
function addAmount() {
	
	var ownpc = parseFloat(document.contact_us.own_pc.value);
	var c4kpc = parseFloat(document.contact_us.c4k_pc.value);
	var totalpc = parseFloat(document.contact_us.total_pc.value);
	var royalty = parseFloat(document.contact_us.royalty.value);
	var payplan = parseFloat(document.contact_us.payplan.value);
		
	var totalpc = ownpc + c4kpc;
	var totalroyalty = totalpc * royalty;
	var fee = totalroyalty + payplan
		
	document.contact_us.total_pc.value = totalpc;
	document.contact_us.total_royalty.value = totalroyalty;
	document.contact_us.total_fee.value = fee;	
		
}

function getDays(iMonth,iYear,iPeriod) {
	days = 32 - new Date(iYear, iMonth, 32).getDate();
	populateDaysMenu(days,iPeriod);
}
	
function populateDaysMenu(iDays,when) {
	if (when == 'start') {
		document.getElementById("sday").options.length = 0;
		for (var i=1; i<=iDays; i++) {
			document.getElementById("sday").options[i-1] = new Option(i);
		}
	}
	else if (when == 'end') {
		document.getElementById("eday").options.length = 0;
		for (var i=1; i<=iDays; i++) {
			document.getElementById("eday").options[i-1] = new Option(i);
		}
	}
	
}

function addSchool() {
		var varError = '';
		
		if((document.add_school.school_txt.value == "") || (document.add_school.school_txt.value == null)) {
			varError = varError + "  * Please enter school name \n";
		}
		if((document.add_school.phone_txt.value == "") || (document.add_school.phone_txt.value == "000-0000000")) {
			varError = varError + "  * Please enter school contact number \n";
		}
		if((document.add_school.post_address.value) == "" || (document.add_school.post_address.value == null)) {
			varError = varError + "  * Please enter school postal address \n";
		}
		if((document.add_school.regionid.value == "0") || (document.add_school.regionid.value == null)) {
			varError = varError + "  * Please select a region \n";
		}
		if(document.add_school.sday.value == "0") {
			varError = varError + "  * Please enter contract start date \n";
		}
		if(document.add_school.eday.value == "0") {
			varError = varError + "  * Please enter contract end date \n";
		}
		if(document.add_school.emonth.value == "") {
			varError = varError + "  * Please enter contract end month \n";
		}
		if(document.add_school.smonth.value == "") {
			varError = varError + "  * Please enter contract start month \n";
		}
		if((document.add_school.fee_txt.value) == "" || (document.add_school.fee_txt.value == null)) {
			varError = varError + "  * Please enter contract fee \n";
		}
		if((document.add_school.royalty_txt.value) == "" || (document.add_school.royalty_txt.value == null)) {
			varError = varError + "  * Please enter royalty percentage \n";
		}
		
		if(varError == '') {
			document.add_school.submit();
		} else {
			alert("Please correct the following errors: \n\n" + varError);
		}
		
}

function editSchool(how) {
	var id = document.getElementById('schoolid').value;
	if (how == 'delete') {
		var proceed = confirm("Are you sure you want to remove this school?");
		if (proceed) {
			location.href = "deleteschool.php?schoolid="+id;
		}
	}
	if (how == 'edit') {
		location.href = "edit_school.php?schoolid="+id;
	}
}

function updateSchool() {
		var varError = '';
		
		if((document.edit_school.school_txt.value == "") || (document.edit_school.school_txt.value == null)) {
			varError = varError + "  * Please enter school name \n";
		}
		if((document.edit_school.phone_txt.value == "") || (document.edit_school.phone_txt.value == "000-0000000")) {
			varError = varError + "  * Please enter school contact number \n";
		}
		if((document.edit_school.post_address.value) == "" || (document.edit_school.post_address.value == null)) {
			varError = varError + "  * Please enter school postal address \n";
		}
		if((document.edit_school.regionid.value == "0") || (document.edit_school.regionid.value == null)) {
			varError = varError + "  * Please select a region \n";
		}
		if(document.edit_school.sday.value == "0") {
			varError = varError + "  * Please enter contract start date \n";
		}
		if(document.edit_school.eday.value == "0") {
			varError = varError + "  * Please enter contract end date \n";
		}
		if(document.edit_school.emonth.value == "") {
			varError = varError + "  * Please enter contract end month \n";
		}
		if(document.edit_school.smonth.value == "") {
			varError = varError + "  * Please enter contract start month \n";
		}
		if((document.edit_school.fee_txt.value) == "" || (document.edit_school.fee_txt.value == null)) {
			varError = varError + "  * Please enter contract fee \n";
		}
		if((document.edit_school.royalty_txt.value) == "" || (document.edit_school.royalty_txt.value == null)) {
			varError = varError + "  * Please enter royalty percentage \n";
		}
		
		if(varError == '') {
			document.edit_school.submit();
		} else {
			alert("Please correct the following errors: \n\n" + varError);
		}
		
}

function editTeacher(how) {
	var id = document.getElementById('memberid').value;
	if (how == 'delete') {
		var proceed = confirm("Are you sure you want to remove this eduator?");
		if (proceed) {
			location.href = "deleteteacher.php?id="+id;
		}
	}
	if (how == 'edit') {
		location.href = "edit_teacher.php?id="+id;
	}
}
	
	
function getVersion(ver) {
	new Ajax.Updater ('version', 'get_ms_version.php', { method: 'get', parameters: 'os='+ver });
}
	
function updateProfile(id) {
	new Ajax.Updater ('content','ajax/profileview.php', { method: 'get', parameters: 'memberid='+id });
}

function getMegaMiles(user) {
	new Ajax.Updater ('megamiles', 'ajax/getmegamiles.php', { method: 'get', parameters: 'method='+user });
}
	
function admin(user) {
	new Ajax.Updater ('management', 'ajax/admin_options.php', { method: 'get', parameters: 'method='+user });
}

function postForm(type) {
	if (document.getElementById('method').value == 'addstaff') {
		
		var varError = '';
		
		if (document.getElementById('fname_txt').value == '') {
			varError = varError + 'Please enter a first name \n';
		}
		if (document.getElementById('lname_txt').value == '') {
			varError = varError + 'Please enter a last name \n';
		}
		if (document.getElementById('username_txt').value == '') {
			varError = varError + 'Please enter a username \n';
		}
		if (document.getElementById('password_txt').value == '') {
			varError = varError + 'Please enter a password \n';
		}
		if (document.getElementById('phone_txt').value == '') {
			varError = varError + 'Please enter a contact number \n';
		}
		if (document.getElementById('email_txt').value == '') {
			varError = varError + 'Please enter an email address \n';
		}
		if (document.getElementById('region_txt').value == '' && document.getElementById('region').value == '0') {
			varError = varError + 'Please enter/select a region \n';
		}
		if (document.getElementById('postal_txt').value == '') {
			varError = varError + 'Please enter a postal address \n';
		}
		if (document.getElementById('typeid').value == '') {
			varError = varError + 'Please select a type of staff \n';
		}
		
	} else if (document.getElementById('method').value == 'editfranchisee') {
		
		var varError = '';
		
		if (document.getElementById('staffid') == '0') {
			varError = varError + 'Please select a staff member \n';
		}
	
	} else if (document.getElementById('method').value == 'franmegamiles') {
		
		var varError = '';
		
		if (document.getElementById('staffid') == '0') {
			varError = varError + 'Please select a staff member \n';
		}
		
	} else if (document.getElementById('method').value == 'updatefranmegamiles') {
		
		var varError = '';
		
		if (document.getElementById('staffid') == '0') {
			varError = varError + 'Please select a staff member \n';
		}
		
	} else if (document.getElementById('method').value == 'allocatefranmegamiles') {
		
		var varError = '';
		
		if (document.getElementById('staffid').value == '0') {
			varError = varError + 'Please select a staff member \n';
		}
		if (document.getElementById('reason').value == '') {
			varError = varError + 'Reason field is empty \n';
		}
		if (document.getElementById('points').value == '') {
			varError = varError + 'Points field is empty \n';
		}
		
	}
		
	if (varError != '') {
		alert ("Please check the following:\n" + varError);
	}
	else {
		if  (type == '1') {
			var pars = $('form1').serialize(true);
			new Ajax.Updater ('postMsg', 'ajax/post.php', { method: 'post', parameters: pars });	
		} 
		else if (type == '2') {
			var pars = $('form1').serialize(true);
			new Ajax.Updater ('formLayer', 'ajax/form.php', { method: 'post', parameters: pars });
		}
	}
	
}
	
function addUser(type) {
	//fade the screen
	fadeOut(true);
		
	if (navigator.appName != 'Microsoft Internet Explorer') {
		var vscroll = (document.all ? document.scrollTop : window.pageYOffset) + 20;
	} else {
		var vscroll = (document.body.scrollTop) + 20;
	}
		
	//get screensize and offset
	var leftwidth = ((document.body.scrollWidth - 820) / 2)+'px';
	var topwidth = vscroll+'px';
	var maxheight = (document.body.clientHeight - 40) +'px';
		
		
	//get the body tag
	var page = document.getElementsByTagName("body")[0];
	//create a new element to holder the inbox
	var tnode3 = new Element('div');
		
	//name the new element
	tnode3.id='formLayer';
	//append the new element to the body tag
	page.appendChild(tnode3);
		
	new Ajax.Updater('formLayer', 'ajax/form.php', {	 method: 'get', parameters: 'method='+type  });
	
	//set the style of the new element
	tnode3.setStyle({ position: 'absolute', top: topwidth, left: leftwidth, backgroundColor: '#FFFFFF', border: '1px solid #CCCCCC', borderRadius: '10px', zIndex: 3100, width: '820px', maxHeight: maxheight, overflow: 'auto',textAlign:'left',boxShadow: '5px -5px 10px #FFFFFF' });
			
}

function selectUser(type) {
	//fade the screen
	fadeOut(true);
		
	if (navigator.appName != 'Microsoft Internet Explorer') {
		var vscroll = (document.all ? document.scrollTop : window.pageYOffset) + 20;
	} else {
		var vscroll = (document.body.scrollTop) + 20;
	}
		
	//get screensize and offset
	var leftwidth = ((document.body.scrollWidth - 820) / 2)+'px';
	var topwidth = vscroll+'px';
	var maxheight = (document.body.clientHeight - 40) +'px';
		
		
	//get the body tag
	var page = document.getElementsByTagName("body")[0];
	//create a new element to holder the inbox
	var tnode3 = new Element('div');
		
	//name the new element
	tnode3.id='formLayer';
	//append the new element to the body tag
	page.appendChild(tnode3);
		
	new Ajax.Updater('formLayer', 'ajax/form.php', {	 method: 'get', parameters: 'method='+type  });
	
	//set the style of the new element
	tnode3.setStyle({ position: 'absolute', top: topwidth, left: leftwidth, backgroundColor: '#FFFFFF', border: '1px solid #CCCCCC', borderRadius: '10px', zIndex: 3100, width: '820px', maxHeight: maxheight, overflow: 'auto',textAlign:'left',boxShadow: '5px -5px 10px #FFFFFF' });
			
}

function editUser(type) {
	//fade the screen
	fadeOut(true);
		
	if (navigator.appName != 'Microsoft Internet Explorer') {
		var vscroll = (document.all ? document.scrollTop : window.pageYOffset) + 20;
	} else {
		var vscroll = (document.body.scrollTop) + 20;
	}
		
	//get screensize and offset
	var leftwidth = ((document.body.scrollWidth - 820) / 2)+'px';
	var topwidth = vscroll+'px';
	var maxheight = (document.body.clientHeight - 40) +'px';
		
		
	//get the body tag
	var page = document.getElementsByTagName("body")[0];
	//create a new element to holder the inbox
	var tnode3 = new Element('div');
		
	//name the new element
	tnode3.id='formLayer';
	//append the new element to the body tag
	page.appendChild(tnode3);
		
	new Ajax.Updater('formLayer', 'ajax/form.php', {	 method: 'get', parameters: 'method='+type  });
	
	//set the style of the new element
	tnode3.setStyle({ position: 'absolute', top: topwidth, left: leftwidth, backgroundColor: '#FFFFFF', border: '1px solid #CCCCCC', borderRadius: '10px', zIndex: 3100, width: '820px', maxHeight: maxheight, overflow: 'auto',textAlign:'left',boxShadow: '5px -5px 10px #FFFFFF' });
			
}
	
function selectUserMegaMiles(type) {
	//fade the screen
	fadeOut(true);
		
	if (navigator.appName != 'Microsoft Internet Explorer') {
		var vscroll = (document.all ? document.scrollTop : window.pageYOffset) + 20;
	} else {
		var vscroll = (document.body.scrollTop) + 20;
	}
		
	//get screensize and offset
	var leftwidth = ((document.body.scrollWidth - 820) / 2)+'px';
	var topwidth = vscroll+'px';
	var maxheight = (document.body.clientHeight - 40) +'px';
		
		
	//get the body tag
	var page = document.getElementsByTagName("body")[0];
	//create a new element to holder the inbox
	var tnode3 = new Element('div');
		
	//name the new element
	tnode3.id='formLayer';
	//append the new element to the body tag
	page.appendChild(tnode3);
		
	new Ajax.Updater('formLayer', 'ajax/form.php', {	 method: 'get', parameters: 'method='+type  });
	
	//set the style of the new element
	tnode3.setStyle({ position: 'absolute', top: topwidth, left: leftwidth, backgroundColor: '#FFFFFF', border: '1px solid #CCCCCC', borderRadius: '10px', zIndex: 3100, width: '820px', maxHeight: maxheight, overflow: 'auto',textAlign:'left',boxShadow: '5px -5px 10px #FFFFFF' });
			
}

function setMegaMiles(type) {
	//fade the screen
	fadeOut(true);
		
	if (navigator.appName != 'Microsoft Internet Explorer') {
		var vscroll = (document.all ? document.scrollTop : window.pageYOffset) + 20;
	} else {
		var vscroll = (document.body.scrollTop) + 20;
	}
		
	//get screensize and offset
	var leftwidth = ((document.body.scrollWidth - 820) / 2)+'px';
	var topwidth = vscroll+'px';
	var maxheight = (document.body.clientHeight - 40) +'px';
		
		
	//get the body tag
	var page = document.getElementsByTagName("body")[0];
	//create a new element to holder the inbox
	var tnode3 = new Element('div');
		
	//name the new element
	tnode3.id='formLayer';
	//append the new element to the body tag
	page.appendChild(tnode3);
		
	new Ajax.Updater('formLayer', 'ajax/form.php', {	 method: 'get', parameters: 'method='+type  });
	
	//set the style of the new element
	tnode3.setStyle({ position: 'absolute', top: topwidth, left: leftwidth, backgroundColor: '#FFFFFF', border: '1px solid #CCCCCC', borderRadius: '10px', zIndex: 3100, width: '820px', maxHeight: maxheight, overflow: 'auto',textAlign:'left',boxShadow: '5px -5px 10px #FFFFFF' });
			
}	
	
	function fadeOut (option) {
	
	var visible = option;
	var zindex = 3000;
	var dark = $('darken');
	
	 if (!dark) {
		 
		 var tbody = document.getElementsByTagName("body")[0];
		 //create the layer
		 var tnode = new Element('div');
		 //set the style of the new element
		 tnode.setStyle({ position: 'absolute', top: '0px', left: '0px', overflow: 'hidden', display: 'none', height: 'auto', minHeight: '100%'  });
		 //name the new element
		 tnode.id='darken';
		 //append the new element to the body tag
		 tbody.appendChild(tnode);
		 
		 dark = $('darken');
		 
	 }
	 
	 if (visible) {
		 	 
		 //Calculate the page width and height
		if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
			var pageWidth = document.body.scrollWidth+'px';
			var pageHeight = document.body.scrollHeight+'px';
		} 
		else if( document.body.offsetWidth ) {
			 var pageWidth = document.body.offsetWidth+'px';
			 var pageHeight = document.body.scrollHeight+'px';
		}
		else {
			var pageWidth='100%';
			var pageHeight='100%';
		}
		 
		
		if (navigator.appName != 'Microsoft Internet Explorer') {
			dark.setStyle({ opacity: 0.8, zIndex: zindex, backgroundColor: '#000000', width: pageWidth, height: '100%', minHeight: pageHeight, display: 'block'  });
		} else {
			dark.setStyle({ opacity: 0.8, zIndex: zindex, backgroundColor: '#000000', width: pageWidth, height: pageHeight, minHeight: pageHeight, display: 'block'  });
		}	
		 
	 }
	 
	 else {
		 
		 dark.setStyle({ display: 'none'  });
		 
	 }
	 
	 dark.onclick = function() {
		 
		 dark.setStyle({ display: 'none'  });
		 form_obj = $('formLayer');
		 
		 if(form_obj != null) {
			 form_obj.remove();
		 }
		 
		/* inbox_obj = $('inboxLayer');
		 skill_obj = $('skillLayer');
		 video_obj = $('videoLayer');
		 img_obj = $('imgLayer');
		 
		 
		 if (inbox_obj != null) {
			 inbox_obj.remove(); 
		 } 
		 if (skill_obj != null) {
			 skill_obj.remove();
		 }
		 if (video_obj != null) {
			 video_obj.remove();
		 }
		 if (img_obj != null) {
			img_obj.remove();
		 }*/
	 }
	 
}

function checkStationeryForm() {
	
	var Error = '';
	
	if(document.getElementById('Name').value == '') {
		Error = Error + 'Please enter your first name';
	}
	if(document.getElementById('Surname').value == '') {
		Error = Error + 'Please enter your surname';
	}
	if(document.getElementById('type').value == '0') {
		Error = Error + 'Please select a licensee type';
	}
	if(document.getElementById('Address1').value == '' && document.getElementById('Address2').value == '' && document.getElementById('Address3').value == '' ) {
		Error = Error + 'Please enter your address';
	}
	if(document.getElementById('phone').value == '') {
		Error = Error + 'Please enter your telephone number';
	}
	if(document.getElementById('email').value == '') {
		Error = Error + 'Please enter a valid email address';
	}
	
	if (Error != '') {
		alert ("Please attend to the follow:\n" + Error);	
	} 
	else {
		document.stationery.submit();
	}
		
}

function toggleProvinces(country) {
	
	if (country != 'South Africa') {
		$('province').selectedIndex = 10;
	} else {
		$('province').selectedIndex = 0;
	}
	
}

function checkit() {
		
			var error = '';
			if (document.getElementById('name').value == '') {
				error = error + 'Please enter your full name \n';
			}
			if (document.getElementById('email').value == '') {
				error = error + 'Please enter a valid email address \n';
			}
			if (document.getElementById('school').value == '') {
				error = error + 'Please enter the name of your school \n';
			}
			if (document.getElementById('phone').value == '') {
				error = error + 'Please enter a valid contact number \n';
			}
			if ((document.getElementById('verify').value == '') || (document.getElementById('verify').value != document.getElementById('code').value)) {
				error = error + 'Please enter the correct verification code \n';
			}
			
			if (error != '') {
				alert("Please fix the following errors:\n" + error);
			} else {
				document.lessons.submit();
			}
		
	}
