<!--
var errWindow = 0;

function isFilled(fe)
{
  if (fe.value == "" || fe.value == null)
  {
    return false;
  }
  else
  {
    return true;
  }
}

function isValidCharacter(fe)
{
  if (fe.value.search(/'/i) >= 0)
  {
    return false;
  }
  else
  {
    return true;
  }
}


function showHelp(strField, strType)
{
  if (errWindow != 0)
  {
    //  If window has already been opened once 
    errWindow.close();
  }

  if (strType == "interests" || strType == "fulljob" || strType == "password")
  {
  	errWindow = window.open("", "basic_err_wind", "toolbar=no,width=475,height=385,status=no,scrollbars=no,resizable=no, menubar=no");
  }
  else
  {
  	errWindow = window.open("", "basic_err_wind", "toolbar=no,width=475,height=350,status=no,scrollbars=no,resizable=no, menubar=no");
  }
  errWindow.document.write('<TITLE>Senior Management Network - Help</TITLE>');
  errWindow.document.write('<BODY bgcolor="#ffffee"><font face="Arial, Helvetica, sans-serif" size="2">');
  errWindow.document.write('<table border="1" bordercolor="#dddddd" cellspacing="0" cellpadding="0" width="100%" bgcolor="#ffffff"><tr><td>');
  errWindow.document.write('<table border="0" cellspacing="0" cellpadding="10" width="100%" bgcolor="#ffffff">');
  errWindow.document.write('<tr><td width="87%" valign="middle" bgcolor="#dddddd">&nbsp;<img src="logos/logo5sm.jpg" width="73" height="40"></td>');
  errWindow.document.write('<td width="13%" bgcolor="#dddddd"><table width="20%" border="0">');
  errWindow.document.write('<tr>');
  errWindow.document.write('<td width="6%"><img src="photos/pic1csm.jpg" width="38" height="25"></td>');
  errWindow.document.write('<td width="6%"><img src="photos/pic2csm.jpg" width="38" height="25"></td>');
  errWindow.document.write('<td width="88%"><img src="photos/pic3csm.jpg" width="38" height="25"></td>');
  errWindow.document.write('</tr></table></td></tr></table>');
  errWindow.document.write('<table border="0" cellspacing="0" cellpadding="10" width="100%" bgcolor="#ffffff"><tr>');
  if (strType == "name")
  {
  	errWindow.document.write('<td>Field : <b>First Name</b> or <b>Surname</b></td>');
  }
  else
  {
  	errWindow.document.write('<td>Field : <b>' + strField + '</b></td>');
  }
  errWindow.document.write('</tr>');
  errWindow.document.write('<tr>');
  switch (strType)
  {
  	case "name":
	  	errWindow.document.write('<td>Enter your First Name and Surname in these fields. Accepted characters are upper and lower case alphabetic characters as well as the space and - (hyphen) characters<BR><BR><BR></td>');
		break;
  	case "companyname":
	  	errWindow.document.write('<td>Enter your Company Name in this field. Accepted characters are upper and lower case alphabetic characters as well as the following characters:<br><br>@\" \'.,;\\ /: \<\>?%!£$\&\^*#~()_-<BR><BR></td>');
		break;
  	case "shortjob":
	  	errWindow.document.write('<td><p>Enter your Short Job Description in this field. Accepted characters are upper and lower case alphabetic characters, numeric characters as well as the space and comma characters.</p><p>This field should comprise key words or phrases that describe your job. Each of the key words or phrases should be seperated by a comma and a space.</p><p>example: project management, defence, helicopters</p></td>');
		break;
  	case "phone":
	  	errWindow.document.write('<td><p>Enter your phone number in this field.</p><p>Example: +44 (0)1234 567890</p><p>Accepted characters are: + as 1st character -() and any decimal numerals</p></td>');
		break;
  	case "email":
	  	errWindow.document.write('<td><p>Enter your email address in this field.</p><p>Example: John.Smith@senior-management-network.co.uk</p><p>Accepted characters are: upper and lowercase alphabetic characters, decimal numbers and  _-.@ characters</p><p>There can only be one @ character and email address must be in the form [name]@[name].[name] (where [name] can be any alphanumeric or - characters).</p></td>');
		break;
  	case "postcode":
	  	errWindow.document.write('<td><p>Enter your postcode in this field.</p><p>Example: AB1 2CD</p><p>Accepted characters are: upper and lowercase alphabetic characters, decimal numbers and the space character</p></td>');
		break;
  	case "address":
	  	errWindow.document.write('<td><p>Enter your ' + strField + ' in this field.</p><p>Examples:<br>"White House"<br>21 High Street<br>St. Andrews</p><p>Accepted characters are: upper and lowercase alphabetic characters, decimal numbers and the \".,\'- and space characters</p></td>');
		break;
  	case "fulljob":
	  	errWindow.document.write('<td><p>Enter your full job description in this field.</p><font size="1"><p>Example:<br>35 years in the IT industry, now working for Admiral, a well known systems company, as a senior business analyst, turning the vision of the business into reality, something which will work and they can afford to pay for.</p><p>Experience from a number of investment banks, working to disciplined methods and approach. Using tack and more blunt approaches when dealing with the difficult users, who do not really know what they want, cannot afford what they are asking for or are just plain bloody minded.</p><p>Contacts at a senior level with a number of senior business operations directors of a number of well known City institutions and HSBC bank.</p></font></td>');
		break;
  	case "interests":
	  	errWindow.document.write('<td><p>Enter your other business interests in this field.</p><p>This field should be used to enter details of any other business interests you have that are not already covered within the short or full job descriptions</p><p>Accepted characters are upper and lower case alphabetic characters, numeric characters as well as the space and comma characters.</p><p>This field should comprise key words or phrases each of which should be seperated by a comma and a space.</p></td>');
		break;
  	case "password":
	  	errWindow.document.write('<td><p>Enter your password in this field.</p><p>You should choose a password that you will find easy to remember but which others will not be able to guess.</p><p>Example: Your mother\'s maiden name followed by the house number of the first house you lived in (eg. Jones37).</p><p>Remember that passwords are case sensitive so if you use a capital letter in your password then you must always enter that letter as a capital.</p></td>');
		break;
  	case "job_search":
	  	errWindow.document.write('<td><p>Enter one or more words or phrases (seperated by a comma), that you would like to search for in members\' full job descriptions.</p><p>Example:<br>food industry, IT, electronic cash</p></td>');
		break;
	default:
	  errWindow.document.write('<td>Unknown Field Type<b>' + strType + '</b><BR><BR><BR></td>');
	  break;
  }
  errWindow.document.write('</tr>');
  errWindow.document.write('</table>');
  errWindow.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="#dddddd">');
  errWindow.document.write('<tr>');
  errWindow.document.write('<td>&nbsp;</td>');
  errWindow.document.write('</tr>');
  errWindow.document.write('</table>');
  errWindow.document.write('</td></tr></table>');
  errWindow.document.write('</font></BODY>');
}

function isFormOk(form)
{
  var err_msg = new Array();
  var arIndex = 0;
  var bReturn = true;
  var missing_field = 0;

  if (isFilled(form.surname) == false)
  {
     err_msg[arIndex++] = "missing surname";
     bReturn = false;
  }

  if (isFilled(form.company) == false)
  {
     err_msg[arIndex++] = "missing company name";
     bReturn = false;
  }
  if (isFilled(form.email) == false)
  {
     err_msg[arIndex++] = "missing email address";
     bReturn = false;
  }
  if (isFilled(form.information) == false)
  {
     err_msg[arIndex++] = "missing details of request";
     bReturn = false;
  }

  if (bReturn == false)
  {
    showErrors(err_msg);
  }
  else
  {
    if (errWindow != 0)
    {
      //  If window has already been opened once 
      errWindow.close();
    }
  }

  return bReturn
}


//-->
