function checkFieldsProgrammeItem()
{
  missinginfo = "";

  if(document.getElementById("txtStartTime").value == '') 
  {
    missinginfo += "\n     -  Start Time";
  }  
  if(document.getElementById("txtName").value == '') 
  {
    missinginfo += "\n     -  Programme Item Title";
  }    

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkProgramme()
{
  missinginfo = "";

  var x;
  var arr;
  if($("#txtAllOptions").val() != "")
  {
	  progoptions = $("#txtAllOptions").val();
	  var arr = progoptions.split(",");
	  for (x = 0; x < arr.length; x++)
	  {
		  rdoname = arr[x];
		  
		  var checkedvalue = $("." + rdoname + ":checked").val();

		  if (checkedvalue == undefined)
		  {
			var thisdate = rdoname.split("_");  
		  	missinginfo += "\n You must select an option for the " + Left(Right(rdoname,4),2) + ":" + Right(rdoname,2) + " session on " + thisdate[0] + '/' + thisdate[1] + '/' + thisdate[2];
		  }
	  }
  
	  if (missinginfo != "") {
	  missinginfo = "You need to correct the following problems before continuing \n" +
						missinginfo + "\n"
	  alert(missinginfo);
	  return false;
	  }
	  else return true;
  }
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function checkEmailContacts()
{
  missinginfo = "";

  if(document.frmsendemails.txtsubject.value == '') 
  {
    missinginfo += "\n     -  Subject";
  }  
  if(document.frmsendemails.txtmessage.value == '') 
  {
    missinginfo += "\n     -  Message";
  }    

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkActivity()
{
  missinginfo = "";

  if(document.frmActivity.lstActivityStatus.options[document.frmActivity.lstActivityStatus.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Status";
  }
  if(document.frmActivity.txtActDesc.value == '') 
  {
    missinginfo += "\n     -  Description";
  }  
  if(document.frmActivity.txtDate.value == '') 
  {
    missinginfo += "\n     -  Date";
  }
  if(document.frmActivity.lstActivityType.options[document.frmActivity.lstActivityType.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Type";
  }
  if(document.frmActivity.lstorg.options[document.frmActivity.lstorg.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Organisation";
  }
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}


function checkVisit()
{
  missinginfo = "";

  if(document.frmvisit.lstVisitStatus.options[document.frmvisit.lstVisitStatus.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Status";
  }
  if(document.frmvisit.txtDate.value == '') 
  {
    missinginfo += "\n     -  Date";
  }
  if(document.frmvisit.lstVisitType.options[document.frmvisit.lstVisitType.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Type";
  }
  if(document.frmvisit.txtPurposeOfVisit.value == '') 
  {
    missinginfo += "\n     -  Purpose";
  }    
  if(document.frmvisit.lstorg.options[document.frmvisit.lstorg.selectedIndex].value == '') 
  {
    missinginfo += "\n     -  Organisation";
  }
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkAddAlert()
{
  missinginfo = "";

  if(document.frmaddalert.chkto.checked == false) 
  {
    missinginfo += "\n     -  Alert Recipiants";
  }
  if(document.frmaddalert.txtdate.value == "") 
  {
    missinginfo += "\n     -  Alert Date";
  }
  if(document.frmaddalert.txtMessage.value == "") 
  {
    missinginfo += "\n     -  Alert Message";
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkFieldsAddEventDate() 
{
  var flag = 1;
  if(document.frmaddstage2.txtDate.value == "" && document.frmaddstage2.txtMultipleDateStart.value == "" && document.frmaddstage2.txtMultipleDateEnd.value == "" && document.frmaddstage2.txtStartEndDateStart.value == "" && document.frmaddstage2.txtStartEndDateEnd.value == "")
  {
	  alert('Please select a date.');
	  flag = 0;
  }
  else if (document.frmaddstage2.txtDate.value == "" && document.frmaddstage2.txtStartEndDateStart.value == "" && document.frmaddstage2.txtStartEndDateEnd.value == "" && ((document.frmaddstage2.txtMultipleDateStart.value != "" && document.frmaddstage2.txtMultipleDateEnd.value == "") || (document.frmaddstage2.txtMultipleDateStart.value == "" && document.frmaddstage2.txtMultipleDateEnd.value != "")))
  {
	  alert('You must choose both a start and and end date.');
	  flag = 0;	  
  }
  else if (document.frmaddstage2.txtDate.value == "" && document.frmaddstage2.txtMultipleDateStart.value == "" && document.frmaddstage2.txtMultipleDateEnd.value == "" && ((document.frmaddstage2.txtStartEndDateStart.value != "" && document.frmaddstage2.txtStartEndDateEnd.value == "") || (document.frmaddstage2.txtStartEndDateStart.value == "" && document.frmaddstage2.txtStartEndDateEnd.value != "")))
  {
	  alert('You must choose both a start and and end date.');
	  flag = 0;	  
  }  
  else if (document.frmaddstage2.txtDate.value != "" && (document.frmaddstage2.txtMultipleDateStart.value != "" || document.frmaddstage2.txtMultipleDateEnd.value != "" || document.frmaddstage2.txtStartEndDateStart.value != "" || document.frmaddstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }  
  else if (document.frmaddstage2.txtDate.value != "" && (document.frmaddstage2.txtMultipleDateStart.value != "" || document.frmaddstage2.txtMultipleDateEnd.value != "" || document.frmaddstage2.txtStartEndDateStart.value != "" || document.frmaddstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }
  else if ((document.frmaddstage2.txtMultipleDateStart.value != "" || document.frmaddstage2.txtMultipleDateEnd.value != "") && (document.frmaddstage2.txtStartEndDateStart.value != "" || document.frmaddstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }  
  else if (document.frmaddstage2.txtMultipleDateStart.value != "" && document.frmaddstage2.txtMultipleDateEnd.value != "" && (document.frmaddstage2.txtStartEndDateStart.value != "" || document.frmaddstage2.txtStartEndDateEnd.value != "" || document.frmaddstage2.txtDate.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }	  
  else if ((document.frmaddstage2.txtMultipleDateStart.value != "" || document.frmaddstage2.txtMultipleDateEnd.value != "" || document.frmaddstage2.txtDate.value != "") && document.frmaddstage2.txtStartEndDateStart.value != "" && document.frmaddstage2.txtStartEndDateEnd.value != "")
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }	  	  
  else
  {
	  if(document.frmaddstage2.txtDate.value != "")
	  {
		  var d = new Date();
		  d.getDate(document.frmaddstage2.txtDate.value);
		  var dnow = new Date();
		  if(d < dnow)
		  {
		  	alert('Event dates must be in the future.');
			flag = 0;			
		  }
	  }
	  if(document.frmaddstage2.txtMultipleDateStart.value != "" && document.frmaddstage2.txtMultipleDateEnd.value)
	  {
		  var d1 = new Date();
		  d1.getDate(document.frmaddstage2.txtStartEndDateStart.value);
		  var d2 = new Date();
		  d2.getDate(document.frmaddstage2.txtStartEndDateEnd.value);		  
		  var dnow = new Date();
		  if(d1 < dnow || d2 < dnow)
		  {
		  	alert('Event dates must be in the future.');
		  	flag = 0;			
		  }
	  }
	  if(document.frmaddstage2.txtMultipleDateStart.value != "" && document.frmaddstage2.txtMultipleDateEnd.value)
	  {
		  var d1 = new Date();
		  d1.getDate(document.frmaddstage2.txtMultipleDateStart.value);
		  var d2 = new Date();
		  d2.getDate(document.frmaddstage2.txtMultipleDateEnd.value);		  
		  var dnow = new Date();
		  if(d1 < dnow || d2 < dnow)
		  {
		  	alert('Event dates must be in the future.');
		    flag = 0;
		  }
	  }	  
  }
  if(flag == 1)
     return true;
  else
  	return false;
}

function checkFieldsEditEventDate() 
{
  var flag = 1;
  if(document.frmeditstage2.txtEventDate.value == "" && document.frmeditstage2.txtMultipleDateStart.value == "" && document.frmeditstage2.txtMultipleDateEnd.value == "" && document.frmeditstage2.txtStartEndDateStart.value == "" && document.frmeditstage2.txtStartEndDateEnd.value == "")
  {
	  alert('Please select a date.');
	  flag = 0;
  }
  else if (document.frmeditstage2.txtEventDate.value == "" && document.frmeditstage2.txtStartEndDateStart.value == "" && document.frmeditstage2.txtStartEndDateEnd.value == "" && ((document.frmeditstage2.txtMultipleDateStart.value != "" && document.frmeditstage2.txtMultipleDateEnd.value == "") || (document.frmeditstage2.txtMultipleDateStart.value == "" && document.frmeditstage2.txtMultipleDateEnd.value != "")))
  {
	  alert('You must choose both a start and and end date.');
	  flag = 0;	  
  }
  else if (document.frmeditstage2.txtEventDate.value == "" && document.frmeditstage2.txtMultipleDateStart.value == "" && document.frmeditstage2.txtMultipleDateEnd.value == "" && ((document.frmeditstage2.txtStartEndDateStart.value != "" && document.frmeditstage2.txtStartEndDateEnd.value == "") || (document.frmeditstage2.txtStartEndDateStart.value == "" && document.frmeditstage2.txtStartEndDateEnd.value != "")))
  {
	  alert('You must choose both a start and and end date.');
	  flag = 0;	  
  }  
  else if (document.frmeditstage2.txtEventDate.value != "" && (document.frmeditstage2.txtMultipleDateStart.value != "" || document.frmeditstage2.txtMultipleDateEnd.value != "" || document.frmeditstage2.txtStartEndDateStart.value != "" || document.frmeditstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }  
  else if (document.frmeditstage2.txtEventDate.value != "" && (document.frmeditstage2.txtMultipleDateStart.value != "" || document.frmeditstage2.txtMultipleDateEnd.value != "" || document.frmeditstage2.txtStartEndDateStart.value != "" || document.frmeditstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }
  else if ((document.frmeditstage2.txtMultipleDateStart.value != "" || document.frmeditstage2.txtMultipleDateEnd.value != "") && (document.frmeditstage2.txtStartEndDateStart.value != "" || document.frmeditstage2.txtStartEndDateEnd.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }  
  else if (document.frmeditstage2.txtMultipleDateStart.value != "" && document.frmeditstage2.txtMultipleDateEnd.value != "" && (document.frmeditstage2.txtStartEndDateStart.value != "" || document.frmeditstage2.txtStartEndDateEnd.value != "" || document.frmeditstage2.txtEventDate.value != ""))
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }	  
  else if ((document.frmeditstage2.txtMultipleDateStart.value != "" || document.frmeditstage2.txtMultipleDateEnd.value != "" || document.frmeditstage2.txtEventDate.value != "") && document.frmeditstage2.txtStartEndDateStart.value != "" && document.frmeditstage2.txtStartEndDateEnd.value != "")
  {
	  alert('You can only set dates in one of the 3 options.');
	  flag = 0;	  
  }	  	  
  else
  {
	  if(document.frmeditstage2.txtEventDate.value != "")
	  {
		  var d = new Date();
		  d.getDate(document.frmeditstage2.txtEventDate.value);
		  var dnow = new Date();
		  if(d < dnow)
		  {
		  	alert('Event dates must be in the future.');
			flag = 0;			
		  }
	  }
	  if(document.frmeditstage2.txtMultipleDateStart.value != "" && document.frmeditstage2.txtMultipleDateEnd.value)
	  {
		  var d1 = new Date();
		  d1.getDate(document.frmeditstage2.txtStartEndDateStart.value);
		  var d2 = new Date();
		  d2.getDate(document.frmeditstage2.txtStartEndDateEnd.value);		  
		  var dnow = new Date();
		  if(d1 < dnow || d2 < dnow)
		  {
		  	alert('Event dates must be in the future.');
		  	flag = 0;			
		  }
	  }
	  if(document.frmeditstage2.txtMultipleDateStart.value != "" && document.frmeditstage2.txtMultipleDateEnd.value)
	  {
		  var d1 = new Date();
		  d1.getDate(document.frmeditstage2.txtMultipleDateStart.value);
		  var d2 = new Date();
		  d2.getDate(document.frmeditstage2.txtMultipleDateEnd.value);		  
		  var dnow = new Date();
		  if(d1 < dnow || d2 < dnow)
		  {
		  	alert('Event dates must be in the future.');
		    flag = 0;
		  }
	  }	  
  }
  if(flag == 1)
     return true;
  else
  	return false;
}


function checkFieldsAddMsg() 
{
  missinginfo = "";

  if(document.frmaddmsg.chkto.checked == false) 
  {
    missinginfo += "\n     -  RSC Message Recipiants";
  }
  if(document.frmaddmsg.txtsubject.value == "") 
  {
    missinginfo += "\n     -  Message Subject";
  }
  if(document.frmaddmsg.txtmessage.value == "") 
  {
    missinginfo += "\n     -  Message";
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkFieldsBook1() 
{
  missinginfo = "";

  if(document.frmaddbooking.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }
  if(document.frmaddbooking.txtEmail2.value == "") 
  {
    missinginfo += "\n     -  Email again";
  }  
  if(document.frmaddbooking.txtEmail.value != document.frmaddbooking.txtEmail2.value) 
  {
    missinginfo += "\n     -  Email addresses don't match";
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkFieldsBook1a() 
{
  missinginfo = "";
  
  if(document.frmaddbooking.lstEventID.selectedIndex == 0) 
  {
    missinginfo += "\n     -  Choose an Event";
  }
  
  if(document.frmaddbooking.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }
  if(document.frmaddbooking.txtEmail2.value == "") 
  {
    missinginfo += "\n     -  Email again";
  }  
  if(document.frmaddbooking.txtEmail.value != document.frmaddbooking.txtEmail2.value) 
  {
    missinginfo += "\n     -  Email addresses don't match";
  }  
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkFieldsBook2() 
{
  missinginfo = "";
  if(document.frmaddbooking.lstTitle.options[document.frmaddbooking.lstTitle.selectedIndex].value == "") 
  {
    missinginfo += "\n     -  Title";
  }  

  if(document.frmaddbooking.txtFname.value == "") 
  {
    missinginfo += "\n     -  Forename";
  }

  if(document.frmaddbooking.txtSname.value == "") 
  {
    missinginfo += "\n     -  Surname";
  }
  
  if(document.frmaddbooking.txtPhoneWork.value == "") 
  {
    missinginfo += "\n     -  Work Phone";
  }  

  if(document.frmaddbooking.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }

  if(document.frmaddbooking.txtJobTitle.value == "") 
  {
    missinginfo += "\n     -  Job Title";
  }

  if(document.frmaddbooking.txtDepartment.value == "") 
  {
    missinginfo += "\n     -  Department";
  }

if(document.frmaddbooking.chknoaddrmatch.checked == false)
  {
	  if((document.frmaddbooking.lstsupportedorg.options[document.frmaddbooking.lstsupportedorg.selectedIndex].value == "" || document.frmaddbooking.lstsupportedorg.options[document.frmaddbooking.lstsupportedorg.selectedIndex].value == "0") && (document.frmaddbooking.lstsite.options[document.frmaddbooking.lstsite.selectedIndex].value == "" || document.frmaddbooking.lstsite.options[document.frmaddbooking.lstsite.selectedIndex].value == "0"))
	  {
		missinginfo += "\n     -  Organisation Details";
	  }
	  else if((document.frmaddbooking.lstorg.options[document.frmaddbooking.lstorg.selectedIndex].value == "" || document.frmaddbooking.lstorg.options[document.frmaddbooking.lstorg.selectedIndex].value == "0") && (document.frmaddbooking.lstsite.options[document.frmaddbooking.lstsite.selectedIndex].value == "" || document.frmaddbooking.lstsite.options[document.frmaddbooking.lstsite.selectedIndex].value == "0"))
	  {
		missinginfo += "\n     -  Organisation Details";
	  }	  
  }
  else
  {
	  if(document.frmaddbooking.txtNewOrgName.value == "") 
	  {
		missinginfo += "\n     -  Organisation Name";
	  }
	  if(document.frmaddbooking.txtNewOrgAddress.value == "") 
	  {
		missinginfo += "\n     -  Organisation Address";
	  }	  	
	  if(document.frmaddbooking.lstNewOrgType.options[document.frmaddbooking.lstNewOrgType.selectedIndex].value == "")
	  {
		missinginfo += "\n     -  Organisation Type";
	  }	 	  
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}


function checkFieldsAddContact1() 
{
  missinginfo = "";
  if(document.frmaddstage1.lstTitle.options[document.frmaddstage1.lstTitle.selectedIndex].value == "") 
  {
    missinginfo += "\n     -  Title";
  }  

  if(document.frmaddstage1.txtForename.value == "") 
  {
    missinginfo += "\n     -  Forename";
  }

  if(document.frmaddstage1.txtSurname.value == "") 
  {
    missinginfo += "\n     -  Surname";
  }
  
  //if(document.frmaddstage1.txtWorkPhone.value == "") 
  //{
  //  missinginfo += "\n     -  Work Phone";
  //}  

  if(document.frmaddstage1.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }
  
  if(document.frmaddstage1.txtEmail.value.indexOf("@") <= 0) 
  {
    missinginfo += "\n     -  Email is in an incorrect format";
  }

  if(document.frmaddstage1.txtJobTitle.value == "") 
  {
    missinginfo += "\n     -  Job Title";
  }

  //if(document.frmaddstage1.txtDepartment.value == "") 
  //{
  //  missinginfo += "\n     -  Department";
  //}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else
	{
		if(document.frmaddstage1.txtWorkPhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}

function checkFieldsAddContact4()
{
	if(document.frmaddstage4.txtcat.value == "")
	{
		if(confirm('You have not selected a contact type.  A default contact type of UNKNOWN will be added to this record.  If you wish to add a specific contact type, please click Cancel and select a contact type from the list.  If you are happy to accept the default, click Ok.'))
		{
			return true;
		} else {
			return false;
		}
	}	
}

function checkFieldsEditContact1() 
{
  missinginfo = "";
  if(document.frmeditstage1.lstTitle.options[document.frmeditstage1.lstTitle.selectedIndex].value == "") 
  {
    missinginfo += "\n     -  Title";
  }  

  if(document.frmeditstage1.txtForename.value == "") 
  {
    missinginfo += "\n     -  Forename";
  }

  if(document.frmeditstage1.txtSurname.value == "") 
  {
    missinginfo += "\n     -  Surname";
  }
  
  //if(document.frmeditstage1.txtWorkPhone.value == "") 
  //{
  //  missinginfo += "\n     -  Work Phone";
  //}  

  if(document.frmeditstage1.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }

  if(document.frmeditstage1.txtEmail.value.indexOf("@") <= 0) 
  {
    missinginfo += "\n     -  Email is in an incorrect format";
  }
  
  if(document.frmeditstage1.txtJobTitle.value == "") 
  {
    missinginfo += "\n     -  Job Title";
  }

  //if(document.frmeditstage1.txtDepartment.value == "") 
  //{
  //  missinginfo += "\n     -  Department";
  //}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else
	{
		if(document.frmeditstage1.txtWorkPhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}

function checkFieldsEditContact4()
{
	if(document.frmeditstage4.txtcat.value == "")
	{
		if(confirm('You have not selected a contact type.  A default contact type of UNKNOWN will be added to this record.  If you wish to add a specific contact type, please click Cancel and select a contact type from the list.  If you are happy to accept the default, click Ok.'))
		{
			return true;
		} else {
			return false;
		}
	}	
}

function checkFieldsAddOrg1() 
{
  missinginfo = "";
  if(document.frmaddstage1.txtOrgName.value == "") 
  {
    missinginfo += "\n     -  Organisation Name";
  }  
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else 
	{
		if(document.frmaddstage1.txtPhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}  

function checkFieldsAddOrg2() 
{
  missinginfo = "";
  if(document.frmaddstage2.txtAddr1.value == "") 
  {
	missinginfo += "\n     -  Address";
  }	  	  
  if(document.frmaddstage2.txtTown.value == "") 
  {
	missinginfo += "\n     -  Town";
  }	  	  
  if(document.frmaddstage2.lstCounty.options[document.frmaddstage2.lstCounty.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  County";
  }	  	  
  if(document.frmaddstage2.txtPostcode.value == "") 
  {
	missinginfo += "\n     -  Postcode";
  }	  	  
  if(document.frmaddstage2.lstCountry.options[document.frmaddstage2.lstCountry.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Country";
  }	  	  	  
  if(document.frmaddstage2.lstAddressType.options[document.frmaddstage2.lstAddressType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Address Type";
  }	  

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else
	{
		if(document.frmaddstage2.txtSitePhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}

function checkFieldsAddOrg3() 
{
  missinginfo = "";
  if(document.frmaddstage3.lstOrgType.options[document.frmaddstage3.lstOrgType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Organisation Type";
  }	  	    	  

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkFieldsEditOrg1() 
{
  missinginfo = "";
  if(document.frmeditstage1.txtOrgName.value == "") 
  {
    missinginfo += "\n     -  Organisation Name";
  }  
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else 
	{
		if(document.frmeditstage1.txtPhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}  

function checkFieldsEditOrg2() 
{
  missinginfo = "";
  if(document.frmeditstage2.txtAddr1.value == "") 
  {
	missinginfo += "\n     -  Address";
  }	  	  
  if(document.frmeditstage2.txtTown.value == "") 
  {
	missinginfo += "\n     -  Town";
  }	  	  
  if(document.frmeditstage2.lstCounty.options[document.frmeditstage2.lstCounty.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  County";
  }	  	  
  if(document.frmeditstage2.txtPostcode.value == "") 
  {
	missinginfo += "\n     -  Postcode";
  }	  	  
  if(document.frmeditstage2.lstCountry.options[document.frmeditstage2.lstCountry.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Country";
  }	  	  	  

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else
	{
		if(document.frmeditstage2.txtSitePhone.value == "")
		{
			if(confirm('You have not entered a phone number.  It is highly recommended that you do.  If you want to enter a phone number now, click Ok, otherwise click Cancel'))
			{
				return false;
			} else {
				return true;
			}
		}
	}
}

function checkFieldsAddEvent1() 
{
  missinginfo = "";
  if(document.frmaddstage1.txtTitle.value == "") 
  {
	missinginfo += "\n     -  Event Title";
  }	  	  
  if(document.frmaddstage1.txtShortDesc.value == "") 
  {
	missinginfo += "\n     -  Short Description";
  }	  	  
  if(document.frmaddstage1.lstEventType.options[document.frmaddstage1.lstEventType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Type";
  }	  	  
  if(document.frmaddstage1.lstRSCEUser.options[document.frmaddstage1.lstRSCEUser.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Lead";
  }	  	  
  if(document.frmaddstage1.lstMaxNum.options[document.frmaddstage1.lstMaxNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Num Places";
  }	  	   
  if(document.frmaddstage1.lstMinNum.options[document.frmaddstage1.lstMinNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Minimum Bookings Required";
  }	  	 
  if(eval(document.frmaddstage1.lstMinNum.options[document.frmaddstage1.lstMinNum.selectedIndex].value) > eval(document.frmaddstage1.lstMaxNum.options[document.frmaddstage1.lstMaxNum.selectedIndex].value))   
  {
	missinginfo += "\n     -  Minimum Bookings Required is Greater Than Num Places";  
  }
  if(document.frmaddstage1.lstFreeNum.options[document.frmaddstage1.lstFreeNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Num Free Places";
  }	    
  if(eval(document.frmaddstage1.lstFreeNum.options[document.frmaddstage1.lstFreeNum.selectedIndex].value) > eval(document.frmaddstage1.lstMaxNum.options[document.frmaddstage1.lstMaxNum.selectedIndex].value))   
  {
	missinginfo += "\n     -  Num Free Places is Greater Than Num Places";  
  }  
  if(document.frmaddstage1.lstEventDuration.options[document.frmaddstage1.lstEventDuration.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Duration";
  }	     	  
  if(document.frmaddstage1.txtClosingDate.value == "") 
  {
	missinginfo += "\n     -  Closing Date";
  }	   

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else 
{
  if(document.frmaddstage1.lstSurveys.options[document.frmaddstage1.lstSurveys.selectedIndex].value == "" || document.frmaddstage1.txtsurvey.value != "1") 
  {
	if(confirm('Are you sure you want to add an event without specifying an evaluation form? It is recommended that you assign an evaluation form to every event.'))
	{
		return true;
	}
	else
	{
		return false;
	}
  }	
}
}


function checkFieldsEditEvent1() 
{
  missinginfo = "";
  if(document.frmeditstage1.txtTitle.value == "") 
  {
	missinginfo += "\n     -  Event Title";
  }	  	  
  if(document.frmeditstage1.txtShortDesc.value == "") 
  {
	missinginfo += "\n     -  Short Description";
  }	  	  
  if(document.frmeditstage1.lstEventType.options[document.frmeditstage1.lstEventType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Type";
  }	  	  
  if(document.frmeditstage1.lstRSCEUser.options[document.frmeditstage1.lstRSCEUser.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Lead";
  }	  	  
  if(document.frmeditstage1.lstMaxNum.options[document.frmeditstage1.lstMaxNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Num Places";
  }	  	   
  if(document.frmeditstage1.lstMinNum.options[document.frmeditstage1.lstMinNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Minimum Bookings Required";
  }	  	 
  if(eval(document.frmeditstage1.lstMinNum.options[document.frmeditstage1.lstMinNum.selectedIndex].value) > eval(document.frmeditstage1.lstMaxNum.options[document.frmeditstage1.lstMaxNum.selectedIndex].value))   
  {
	missinginfo += "\n     -  Minimum Bookings Required is Greater Than Num Places";  
  }
  if(document.frmeditstage1.lstFreeNum.options[document.frmeditstage1.lstFreeNum.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Num Free Places";
  }	    
  //alert(document.frmeditstage1.lstFreeNum.options[document.frmeditstage1.lstFreeNum.selectedIndex].value + ' > ' + document.frmeditstage1.lstMaxNum.options[document.frmeditstage1.lstMaxNum.selectedIndex].value)
  if(eval(document.frmeditstage1.lstFreeNum.options[document.frmeditstage1.lstFreeNum.selectedIndex].value) > eval(document.frmeditstage1.lstMaxNum.options[document.frmeditstage1.lstMaxNum.selectedIndex].value))   
  {
	missinginfo += "\n     -  Num Free Places is Greater Than Num Places";  
  }  
  if(document.frmeditstage1.lstEventDuration.options[document.frmeditstage1.lstEventDuration.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Duration";
  }	     	
  if(document.frmeditstage1.txtClosingDate.value == "") 
  {
	missinginfo += "\n     -  Closing Date";
  }	    
    
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else 
{
  if(document.frmeditstage1.lstSurveys.options[document.frmeditstage1.lstSurveys.selectedIndex].value != document.frmeditstage1.oldlstSurveys.value && document.frmeditstage1.txtfirstdate.value == "true" && document.frmeditstage1.oldlstSurveys.value != "") 
  {
	alert('Selected Evaluation Form has changed, but date of event has passed.  It is not possible to change the evaluation form after the event date has passed.');
	return false;
  }
  else
  {
	  if(document.frmeditstage1.lstSurveys.options[document.frmeditstage1.lstSurveys.selectedIndex].value == "" || document.frmaddstage1.txtsurvey.value != "1") 
	  {
		if(confirm('Are you sure you want to add an event without specifying an evaluation form? It is recommended that you assign an evaluation form to every event.'))
		{
			return true;
		}
		else
		{
			return false;
		}
	  }	
  }
}
}


function checkFieldsAddTest() 
{
  missinginfo = ""; 	  
	  
  if(document.frmaddtest.intEventID.options[document.frmaddtest.intEventID.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event";
  }	
  if(document.frmaddtest.txtComment.value == "") 
  {
	missinginfo += "\n     -  Comment";
  }	  
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}



function checkFieldsAddNonRSCEEvent() 
{
  missinginfo = "";
  if(document.frmaddnonrsceevent.txtTitle.value == "") 
  {
	missinginfo += "\n     -  Event Title";
  }	  	  
  if(document.frmaddnonrsceevent.txtShortDesc.value == "") 
  {
	missinginfo += "\n     -  Short Description";
  }	  	  
  if(document.frmaddnonrsceevent.txtLocation.value == "") 
  {
	missinginfo += "\n     -  Location";
  }	   
  if(document.frmaddnonrsceevent.txtCost.value == "") 
  {
	missinginfo += "\n     -  Cost";
  }	
  if(!IsNumeric(document.frmaddnonrsceevent.txtCost.value))
  {
	missinginfo += "\n     -  Cost must be a numeric value only. If the event is free, enter 0";  
  }  
  if(document.frmaddnonrsceevent.lstEventType.options[document.frmaddnonrsceevent.lstEventType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Type";
  }	  	  
  if(document.frmaddnonrsceevent.txtDate.value == "") 
  {
	missinginfo += "\n     -  Date";
  }	  

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}


function checkFieldsEditNonRSCEEvent() 
{
  missinginfo = "";
  if(document.frmaddnonrsceevent.txtTitle.value == "") 
  {
	missinginfo += "\n     -  Event Title";
  }	  	  
  if(document.frmaddnonrsceevent.txtShortDesc.value == "") 
  {
	missinginfo += "\n     -  Short Description";
  }	  	  
  if(document.frmaddnonrsceevent.txtLocation.value == "") 
  {
	missinginfo += "\n     -  Location";
  }	   
  if(document.frmaddnonrsceevent.txtCost.value == "") 
  {
	missinginfo += "\n     -  Cost";
  }	  
  if(!IsNumeric(document.frmaddnonrsceevent.txtCost.value))
  {
	missinginfo += "\n     -  Cost must be a numeric value only. If the event is free, enter 0";  
  }  
  if(document.frmaddnonrsceevent.lstEventType.options[document.frmaddnonrsceevent.lstEventType.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event Type";
  }	  	  
  if(document.frmaddnonrsceevent.txtDate.value == "") 
  {
	missinginfo += "\n     -  Date";
  }	    

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}


function checkUserFields() 
{
  missinginfo = "";
  if(document.doadduser.username.value == "") 
  {
	missinginfo += "\n     -  Username";
  }	  	  
  if(document.doadduser.title.value == "") 
  {
	missinginfo += "\n     -  Title";
  }	  	  
  if(document.doadduser.forename.value == "") 
  {
	missinginfo += "\n     -  Forename";
  }	   
  if(document.doadduser.surname.value == "") 
  {
	missinginfo += "\n     -  Surname";
  }	   
  if(document.doadduser.password.value == "") 
  {
	missinginfo += "\n     -  Password";
  }	  
  if(document.doadduser.email.value == "") 
  {
	missinginfo += "\n     -  Surname";
  }	    

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkAdminEvalForm() 
{
  missinginfo = "";
  if(document.frmAddEval.intEventID.options[document.frmAddEval.intEventID.selectedIndex].value == "") 
  {
	missinginfo += "\n     -  Event";
  }	   
  if(valButton(document.frmAddEval.rdoQ1) == null) 
  {
	missinginfo += "\n     -  Question 1";
  }	  	  
/*  if(valButton(document.frmAddEval.rdoQ2a) == null) 
  {
	missinginfo += "\n     -  Question 2 (venue)";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ2b) == null) 
  {
	missinginfo += "\n     -  Question 2 (catering)";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ2c) == null) 
  {
	missinginfo += "\n     -  Question 2 (location)";
  }	  	 */
  if(valButton(document.frmAddEval.rdoQ2d) == null) 
  {
	missinginfo += "\n     -  Question 2 (administration)";
  }	  	   
  if(valButton(document.frmAddEval.rdoQ3) == null) 
  {
	missinginfo += "\n     -  Question 3";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ4) == null) 
  {
	missinginfo += "\n     -  Question 4";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ5) == null) 
  {
	missinginfo += "\n     -  Question 5";
  }	  	   
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkEvalForm() 
{
  missinginfo = "";
  if(valButton(document.frmAddEval.rdoQ1) == null) 
  {
	missinginfo += "\n     -  Question 1";
  }	  	  
/*  if(valButton(document.frmAddEval.rdoQ2a) == null) 
  {
	missinginfo += "\n     -  Question 2 (venue)";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ2b) == null) 
  {
	missinginfo += "\n     -  Question 2 (catering)";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ2c) == null) 
  {
	missinginfo += "\n     -  Question 2 (location)";
  }	  	 */
  if(valButton(document.frmAddEval.rdoQ2d) == null) 
  {
	missinginfo += "\n     -  Question 2 (administration)";
  }	  	   
  if(valButton(document.frmAddEval.rdoQ3) == null) 
  {
	missinginfo += "\n     -  Question 3";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ4) == null) 
  {
	missinginfo += "\n     -  Question 4";
  }	  	 
  if(valButton(document.frmAddEval.rdoQ5) == null) 
  {
	missinginfo += "\n     -  Question 5";
  }	  	   
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function valButton(btn) {
var cnt = -1;
for (var i=0; i < btn.length; i++) {
   if (btn[i].checked) {cnt = i; i = btn.length;}
   }
if (cnt > -1) return btn[cnt].value;
else return null;
}

function checkCPDFields()
{
  missinginfo = "";
  if(document.frmAddCPD.lstRSCEStaff.type.toString().charAt(0)=="s"&&document.frmAddCPD.lstRSCEStaff.selectedIndex==0)
  {
    missinginfo += "\n     -  RSCe Staff Member";
  }
  if(document.frmAddCPD.txtTitle.value == "") 
  {
    missinginfo += "\n     -  Title";
  }		

  if(document.frmAddCPD.txtDate.value == "")
  {
    missinginfo += "\n     -  Date";
  }

  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}	

function checkCPDEditFields()
{
  missinginfo = "";
  if(document.frmEditCPD.txtTitle.value == "") 
  {
    missinginfo += "\n     -  Title";
  }		

  if(document.frmEditCPD.txtDate.value == "")
  {
    missinginfo += "\n     -  Date";
  }

  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}	

function checkNewsFields()
{
  missinginfo = "";
  if(document.frmAddNews.txtHeadline.value == "") 
  {
    missinginfo += "\n     -  Headline";
  }		
  if(document.frmAddNews.txtDate.value == "")
  {
    missinginfo += "\n     -  Date";
  }
  if(document.frmAddNews.txtShort.value == "") 
  {
    missinginfo += "\n     -  Short Report / Taster";
  }	  
  if(document.frmAddNews.txtLong.value == "") 
  {
    missinginfo += "\n     -  Full Report";
  }		
  var chkflag = 0;
  for (i = 0; i < document.frmAddNews.chkAudience.length; i++)
    if (document.frmAddNews.chkAudience[i].checked == true)
      chkflag = 1;
  if (chkflag == 0)  
  {
    missinginfo += "\n     -  You must select at least one Audience Type";  
  }
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}	

function checkNewsEditFields()
{
  missinginfo = "";
  if(document.frmEditNews.txtHeadline.value == "") 
  {
    missinginfo += "\n     -  Headline";
  }		
  if(document.frmEditNews.txtDate.value == "")
  {
    missinginfo += "\n     -  Date";
  } 
  if(document.frmEditNews.txtShort.value == "") 
  {
    missinginfo += "\n     -  Short Report / Taster";
  }	    
  if(document.frmEditNews.txtLong.value == "") 
  {
    missinginfo += "\n     -  Full Report";
  }		
  var chkflag = 0;
  for (i = 0; i < document.frmEditNews.chkAudience.length; i++)
    if (document.frmEditNews.chkAudience[i].checked == true)
      chkflag = 1;
  if (chkflag == 0)  
  {
    missinginfo += "\n     -  You must select at least one Audience Type";  
  }  
  
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}	


function checkRegister1() 
{
  missinginfo = "";
  if(document.frmregister.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

function checkRegister2() 
{
  missinginfo = "";
  if(document.frmregister.lstTitle.options[document.frmregister.lstTitle.selectedIndex].value == "") 
  {
    missinginfo += "\n     -  Title";
  }  

  if(document.frmregister.txtFname.value == "") 
  {
    missinginfo += "\n     -  Forename";
  }

  if(document.frmregister.txtSname.value == "") 
  {
    missinginfo += "\n     -  Surname";
  }
  
  if(document.frmregister.txtPhoneWork.value == "") 
  {
    missinginfo += "\n     -  Work Phone";
  }  

  if(document.frmregister.txtEmail.value == "") 
  {
    missinginfo += "\n     -  Email";
  }

  if(document.frmregister.txtJobTitle.value == "") 
  {
    missinginfo += "\n     -  Job Title";
  }

  if(document.frmregister.txtDepartment.value == "") 
  {
    missinginfo += "\n     -  Department";
  }

if(document.frmregister.chknoaddrmatch.checked == false)
  {
	  if((document.frmregister.lstsupportedorg.options[document.frmregister.lstsupportedorg.selectedIndex].value == "" || document.frmregister.lstsupportedorg.options[document.frmregister.lstsupportedorg.selectedIndex].value == "0") && (document.frmregister.lstsite.options[document.frmregister.lstsite.selectedIndex].value == "" || document.frmregister.lstsite.options[document.frmregister.lstsite.selectedIndex].value == "0"))
	  {
		missinginfo += "\n     -  Organisation Details";
	  }
	  else if((document.frmregister.lstorg.options[document.frmregister.lstorg.selectedIndex].value == "" || document.frmregister.lstorg.options[document.frmregister.lstorg.selectedIndex].value == "0") && (document.frmregister.lstsite.options[document.frmregister.lstsite.selectedIndex].value == "" || document.frmregister.lstsite.options[document.frmregister.lstsite.selectedIndex].value == "0"))
	  {
		missinginfo += "\n     -  Organisation Details";
	  }	  
  }
  else
  {
	  if(document.frmregister.txtNewOrgName.value == "") 
	  {
		missinginfo += "\n     -  Organisation Name";
	  }
	  if(document.frmregister.txtNewOrgAddress.value == "") 
	  {
		missinginfo += "\n     -  Organisation Address";
	  }	  	
	  if(document.frmregister.lstNewOrgType.options[document.frmregister.lstNewOrgType.selectedIndex].value == "")
	  {
		missinginfo += "\n     -  Organisation Type";
	  }	 	  
  }

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and try again!";
alert(missinginfo);
return false;
}
else return true;
}

