function OpenMonitor(name)
{
	nname=navigator.userAgent;
	features = "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,copyhistory=0,width=700,height=500,top=20,left=0,resizable=1";
	nversion=navigator.appVersion.substring(0,1);
	if ((nname.lastIndexOf("MSIE")==-1) || (nversion!=4))
	{
		myWindow = window.open(name,"my_jobsite_sub_window",features);
		myWindow.focus();
	}
	else // IE 4 (but not 3 or 5) throws a security exception
	{    // when focusing on a window on another domain
	     //
		myWindow = window.open(name,"my_jobsite_sub_window",features);
	}
}

function remove_dropdown_focus()
{
   // blur doesn't work properly on "select" objects in IE5
   document.create_form.email.focus();
   document.create_form.email.blur();
}

function change_url(sec_select)
{
   var code = sec_select.options[sec_select.selectedIndex].value;

   remove_dropdown_focus();

   if (code != "NONE")
   {
      var url = '/sectorpages/' + code + '.html';
      document.location = url;
   }
}

function valid_email(address)
{
  if (address.indexOf("@")  == -1 || address.indexOf(".") == -1)
  {
    alert("Email addresses must contain one @ symbol and at least one dot");
    return false;
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'0123456789_-.@";
  var checkStr = address;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);

    if (checkOK.indexOf(ch) == -1)
    {
      alert("Please enter only letter, digit and \"_-'.@\" characters in this email field.");
      return(false);
    }   
  }

  return(true);
}

function create_form_check(theform) {
  if (theform.email.value == "")
  {
    alert("Please enter a value for the Email Address field.");
    theform.email.focus();
    return (false);
  }

  if (!valid_email(theform.email.value))
  {
    theform.email.focus();
    return (false);
  }

 return true;
}           

function login_form_check(theform) {
  if (theform.email.value == "")
  {
    alert("Please enter a value for the Email Address field.");
    theform.email.focus();
    return (false);
  }

  if (!valid_email(theform.email.value))
  {
    theform.email.focus();
    return (false);
  }

  if (theform.password.value == "")
  {
    alert("Please enter a value for the Password field.");
    theform.password.focus();
    return (false);
  }
 return true;
}           

function cl_login_form_check(theform) {
  if (theform.agency_id.value == "")
  {
    alert("Please enter a value for the Client's ID field.");
    theform.agency_id.focus();
    return (false);
  }

  if (theform.agency_pwd.value == "")
  {
    alert("Please enter a value for the Password field.");
    theform.agency_pwd.focus();
    return (false);
  }
 return true;
}   
function formVooDoo(myField){
	if(myField.defaultValue==myField.value)
	myField.value='';
}        
function search_form_check(theForm){	
	if(theForm.fp_skill_include.defaultValue==theForm.fp_skill_include.value || theForm.location_include.defaultValue==theForm.location_include.value){
		alert("Please enter your search criteria to continue");
		return false;
	}
}

function channel() {
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			scrOfY = window.pageYOffset;
			scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			scrOfY = document.body.scrollTop;
			scrOfX = document.body.scrollLeft;
		} else if( document.documentElement &&
		( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			scrOfY = document.documentElement.scrollTop;
			scrOfX = document.documentElement.scrollLeft;
		}
		var myTop = scrOfY += 75;
		var channelPop = document.getElementById("channelPop");
		channelPop.style.top = myTop + "px";
		document.getElementById("daysback").style.left = "-99999px";
}
	
function channelOff() {
		var channelPop = document.getElementById("channelPop");
		channelPop.style.top = '-99999px';
		document.getElementById("daysback").style.left = "0";
}


