/*Javascript settings*/
 var isIE4 = (document.all) ? true : false;
 var isNav4 = (document.layers) ? true : false;
 var isNav6 = (document.getElementById) ? true : false;
 if (isNav6 && !isIE4) isNav4=true;

 /*Style Sheet Variables*/
  var d = window.document;
  var left = 200;
 if(window.screen.width == 640){
   left +=  40;
 }else if(window.screen.width == 1024){
   left +=  20;
 }

 d.writeln('<STYLE TYPE="text/css">');
 d.writeln('<!--');
 d.write('#maintabinfo {position:absolute;');
 d.writeln('left:' + left + ';}');
 d.writeln(' // -->');
 d.write('</STYLE>');
 d.close();

m = new Array(
"January",
"Febuary",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
);

var today = new Date();
var day = today.getDate();

function jobadsdate()
{
      document.write(m[today.getMonth()]+" ");
      document.write(day+" "+( 1900 + (today.getYear())));
}

function showinfo(infotext) {
 if(isNav6){
         window.document.getElementById("maintabinfo").innerHTML=('<font face="Arial" size=+1>' + infotext + '</font>'); 
 } else if(isNav4){
         window.document["maintabinfo"].document.writeln('<font face="Arial">' + infotext + '</font>'); 
         window.document["maintabinfo"].document.close();
 }else if(isIE4){
          window.document.all["maintabinfo"].innerHTML = '<font face="Arial" size=+1>' + infotext + '</font>';
 }
}

function openemployersignup(){
var NewWin = window.open("http://www.preferredjobs.com/employerfiles/employerlogins.asp", "DispSmall", "height=200,width=476,innerHeight=200,innerWidth=476,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,screenX=235,screenY=80,left=250,top=90");
}

function openit(sURL,sName,intWidth,intHeight,sStatus){

if(sName == '') sName="popupnav";

if (sStatus == '') sStatus='yes';

if(intWidth == 0) intWidth=740;

if (intHeight == 0) intHeight=300;

var newwindow=window.open(sURL, sName,"width=intWidth,innerWidth=intWidth,height=intHeight,innerHeight=intHeight,scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,status=sStatus");
}

 function TestWin() {
    var NewWin = window.open("http://www.preferredjobs.com/altsearch/weeklysurvey.stm", "DispSmall", "height=450,width=446,innerHeight=450,innerWidth=445,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,screenX=235,screenY=80,left=250,top=90");
  }

 function TestWin2() {
    var NewWin = window.open("http://www.preferredjobs.com/altsearch/60secondrezpost.asp", "DispSmall", "height=410,width=476,innerHeight=405,innerWidth=465,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,screenX=235,screenY=80,left=250,top=90");
  }

//This function is used in the /altsearch/profile.asp page
function PreferWhere(url,sName) {
 if(sName == ""){
    sName = 'remote'
 }
  popupWin = window.open(url, sName, 'resizable,width=533,height=301')
}

//This function is used in the /altsearch/profile.asp page
function newstr(str2)   {
        str = ""
        if(str2 == null)        str2 = "";
        for(j = 0; j < str2.length; j++)        {
                if(str2.charAt(j) == "\"")      str += "&quot;";
                else    {if (str2.charAt(j) == "R")     str += "+";
                else    {if (str2.charAt(j) == "|")     str += "!";
                else    str += str2.charAt(j);}}
        }
        return str;
}

//This function is used in the /altsearch/profile.asp page
function validate(theForm)      {
        
        theForm.dress.value = newstr(theForm.dress.value);
        return (-1);
}

// for /altsearch/contactus.asp
function FrontPage_Form5_Validator(theForm)
{

  if (theForm.req.Comments.value == "")
  {
    alert("Please enter a value for the \"Comment\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.req.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.From.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.From.focus();
    return (false);
  }
  return (true);
}

//employerfiles/employserv.asp
function FrontPage_Form4_Validator(theForm)
{

  if (theForm.number.value == "")
  {
    alert("Please enter a value for the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.number.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.number.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }
  return (true);
}

//employerfiles/employserv.asp
function FrontPage_Form3_Validator(theForm)
{

  if (theForm.number.value == "")
  {
    alert("Please enter a value for the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.number.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.number.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Record Number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.password.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }

  if (theForm.password.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Password\" field.");
    theForm.password.focus();
    return (false);
  }
  return (true);
}

//mainprofile.asp
//employerfiles/employserv.asp
function FrontPage_Form2_Validator(theForm)
{

  if (theForm.reznumber.value == "")
  {
    alert("Please enter a value for the \"Record Number\" field.");
    theForm.reznumber.focus();
    return (false);
  }

  if (theForm.reznumber.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Record Number\" field.");
    theForm.reznumber.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.reznumber.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Record Number\" field.");
    theForm.reznumber.focus();
    return (false);
  }

  if (theForm.rezpassword.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    theForm.rezpassword.focus();
    return (false);
  }

  if (theForm.rezpassword.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Password\" field.");
    theForm.rezpassword.focus();
    return (false);
  }

  if (theForm.rezpassword.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Password\" field.");
    theForm.rezpassword.focus();
    return (false);
  }
  return (true);
}

// for /profiles/profilesubmitrez.asp
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.From.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.From.focus();
    return (false);
  }
  return (true);
}

/*
   This script came from the 24 hour JavaScripts Site
located at http://www.javascripts.com.  It is brought to 
  you by Eric Jarvies, Lewis Sellers, Giuseppe Lombardo, 
          Kurt Anderson, and David Medinets. 
*/
function leapTo (link)
   {
   var new_url=link;
   if (  (new_url != "")  &&  (new_url != null)  )
      window.location=new_url;
   else
      alert("\nYou must make a selection.");
   }
