function step1_check()
	{

// This check ensures the title on the form is chosen
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.";
  var checkStr = document.wizard.title.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please Select a Title");
    document.wizard.title.focus();
    return (false);
  }


//Check required fields are not empty
var obj = document.wizard.firstname;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your First Name");
        obj.focus();
        return false;
}

var obj = document.wizard.lastname;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your Last Name");
        obj.focus();
        return false;
}

var obj = document.wizard.address;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your Address");
        obj.focus();
        return false;
}

var obj = document.wizard.city;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your city");
        obj.focus();
        return false;
}

var obj = document.wizard.postcode;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your Postcode");
        obj.focus();
        return false;
}

var obj = document.wizard.daytimeno;

if (obj.value == "" || obj.value == null)
{
        alert("You must enter your Daytime contact number");
        obj.focus();
        return false;
}

if (obj.value.length < 11 || obj.value.length > 11)
{
        alert("Your Daytime contains too many/too few digits");
        obj.focus();
        return false;
}




// This check ensures the first name does not contain invalid characters
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'";
  var checkStr = document.wizard.firstname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the First Name Field");
    document.wizard.firstname.focus();
    return (false);
  }


// This check ensures the last first name does not contain invalid characters
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'";
  var checkStr = document.wizard.lastname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the Last Name Field");
    document.wizard.lastname.focus();
    return (false);
  }



// This check ensures the last middle name does not contain invalid characters
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- '";
  var checkStr = document.wizard.middlename.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the Middle Name Field");
    document.wizard.middlename.focus();
    return (false);
  }


// This check ensures the gender on the form is chosen
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.";
  var checkStr = document.wizard.gender.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please Select a Gender");
    document.wizard.gender.focus();
    return (false);
  }


// This check ensures that the address does not contain invalid characters
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- '1234567890";
  var checkStr = document.wizard.address.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers and letters in  the Address Field");
    document.wizard.address.focus();
    return (false);
  }



// This check ensures that the address does not contain invalid characters
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-";
  var checkStr = document.wizard.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the City Field");
    document.wizard.city.focus();
    return (false);
  }



// This check ensures that the county field has been chosen
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  var checkStr = document.wizard.county.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please select a county from the list");
    document.wizard.county.focus();
    return (false);
  }


// This check ensures that the DOB field has been chosen
var checkOK = "1234567890";
  var checkStr = document.wizard.dob_day.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please select a date (day) for your DOB");
    document.wizard.county.focus();
    return (false);
  }


// This check ensures that the DOB field has been chosen
var checkOK = "1234567890";
  var checkStr = document.wizard.dob_month.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please select a date (month) for your DOB");
    document.wizard.county.focus();
    return (false);
  }



// This check ensures that the DOB field has been chosen
var checkOK = "1234567890";
  var checkStr = document.wizard.dob_year.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please select a date (yyyy) for your DOB");
    document.wizard.county.focus();
    return (false);
  }






// This check ensures that the postcode field has been chosen 
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  var checkStr = document.wizard.postcode.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please do not use spaces or lowercase letters in the postcode field - enter your Postcode as follows: BT379TH");
    document.wizard.postcode.focus();
    return (false);
  }


// This check ensures that the daytime telephone number field has no invalid characters
var checkOK = "1234567890";
  var checkStr = document.wizard.daytimeno.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please do not use spaces or letters in a number field");
    document.wizard.daytimeno.focus();
    return (false);
  }


// This check ensures that the evening telephone number field has no invalid characters
var checkOK = "1234567890";
  var checkStr = document.wizard.eveningtimeno.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please do not use spaces or letters in a number field");
    document.wizard.eveningtimeno.focus();
    return (false);
  }


// This check ensures that the daytime telephone number field has no invalid characters
var checkOK = "1234567890";
  var checkStr = document.wizard.mobiletimeno.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please do not use spaces or letters in a number field");
    document.wizard.mobiletimeno.focus();
    return (false);
  }



// Check if user has chosen driving licence or not
var drivinglicence

        for (var i=0; i<document.wizard.driving_licence.length; i++) {

                if (document.wizard.driving_licence[i].checked) {
                drivinglicence = document.wizard.driving_licence[i].value
                }

        }


        if(!drivinglicence){ //if group1Checked does not equal null
        alert("Please indicate your driving status.");
	document.wizard.driving_licence[0].focus();
	return (false);
        }



// Switch Layers on the webpage
toggleBox('step1',0);
toggleBox('step2',1);

	}

function step2_check()
	{

// This check ensures the category is chosen of interest
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.";
  var checkStr = document.wizard.categories.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please Select a Category");
    document.wizard.categories.focus();
    return (false);
  }


//Check required fields are not empty
var obj = document.wizard.lastjobtitle;
      
if (obj.value == "" || obj.value == null)
{   
        alert("You must enter your last/current  job title");
        obj.focus();
        return false;
}

//Check required fields are not empty
var obj = document.wizard.lastsalary;
var obj2 = document.wizard.lasthourlyrate;
      
if (obj.value == "" || obj.value == null )
{   
	if (obj2.value == "" || obj2.value == null )
	{
        alert("You must enter your either your last salary or your last hourly rate");
        obj.focus();
        return false;
	}
}


//Check required fields are not empty
var obj = document.wizard.minsalary;

if (obj.value == "" || obj.value == null)
{  
        alert("You must enter your minimum salary requirements");
        obj.focus();
        return false;
}


// This check ensures the salary only has numbers
var checkOK = "1234567890,. ";
  var checkStr = document.wizard.lastsalary.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Last Salary contains invalid characters");
    document.wizard.lastsalary.focus();
    return (false);
  }


// This check ensures the salary hourly rate only has numbersr
var checkOK = "1234567890,. ";
  var checkStr = document.wizard.lasthourlyrate.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Last Hourly rate  contains invalid characters");
    document.wizard.lasthourlyrate.focus();
    return (false);
  }


// This check ensures the min salary hourly rate only has numbersr                                           
var checkOK = "1234567890,. ";
  var checkStr = document.wizard.minsalary.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please complete you minimum salary requirements");
    document.wizard.minsalary.focus();
    return (false);
  }


if (document.wizard.categories.value == "Fashion" || document.wizard.categories.value == "Grocery")
{
	//Check required fields are not empty
	var obj = document.wizard.store_turnover;

	if (obj.value == "" || obj.value == null)
	{
        alert("Please complete the store turnover as you are involved with Fashion / Grocery sectors");
        obj.focus();
        return false;
	}



	//Check required fields are not empty
        var obj = document.wizard.noofstaff;

        if (obj.value == "" || obj.value == null)
        {
        alert("Please complete the number of staff members in your previous place of work");
        obj.focus();
        return false;
        }


// This check ensures the min salary hourly rate only has numbersr
var checkOK = "1234567890";
  var checkStr = document.wizard.noofstaff.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numeric values in the no of staff field");
    document.wizard.noofstaff.focus();
    return (false);
  }
}




toggleBox('step2',0);
toggleBox('step3',1);



	}




function step3_check()
	{

//var numbepassedin
//var str1="document.wizard.willingtowork";
//var str2="<number from a for loop>";
//var str3=".checked";
//var finalstring1 = (str1.concat(str2));
//var finalstring = (finalstring1.concat(str3));

if(document.wizard.willingtowork0.checked == false & document.wizard.willingtowork1.checked == false & document.wizard.willingtowork2.checked == false & document.wizard.willingtowork3.checked == false & document.wizard.willingtowork4.checked == false & document.wizard.willingtowork5.checked == false & document.wizard.willingtowork6.checked == false & document.wizard.willingtowork7.checked == false & document.wizard.willingtowork8.checked == false)
{
alert("You have not checked any places of preference to work");
return (false);
}


toggleBox('step3',0);
toggleBox('step4',1);
	}



function step4_check()
        {
        }


function delete_confirm()
        {
	var answer = confirm("Are you sure you wish to delete your account?")

		if (!answer)
		{
		return (false);
		}

        }



