function checkforcookies()
{
/*This is all very simple, on the page load, we call this function.  Here, we check for a cookie,
 if there is one, go to the else statement where we dont do a thing.  Otherwise, redirect to the 'no cookies'

  check for a cookie */

  var allcookies = document.cookie;
  var mktSegCookie = allcookies.indexOf("MarketSegment");

  if (document.cookie == "" || mktSegCookie == -1)
  {
    /* if a cookie is not found - alert user -*/
    window.location="nocookies.html"
     return false;
  } else {
   /* the user has cookies, so leave them be*/
   return true;
  }
}

function valCookies()
{
 /*This is all very simple, on the page load, we call this function.  Here, we check for a cookie,
 if there is one, go to the else statement where we dont do a thing.  Otherwise, redirect to the 'no cookies'

  check for a cookie */

  var allcookies = document.cookie;
  var mktSegCookie = allcookies.indexOf("MarketSegment");

  if (document.cookie == "" || mktSegCookie == -1)
  {
     return false;
  } else {
   return false;
  }
}
/*
Set a cookie to be sure that one exists.
   Note that this is outside the function*/
//document.cookie = 'tmpcookie' + escape('nothing')
//

function LeftNavSearch_Validator(theForm)
{
  if (theForm.SearchTerm.value.length < 3)
  {
    alert('Please enter at least 3 characters in the Search For field.');
    return false
  }
  else return true
}

function LeftNavKeyPress(e,theForm)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox


     if(key == 13){
        //alert('level1');
                if (theForm.SearchTerm.value.length > 0)
                    {
                    //alert('level2');
                        if (theForm.SearchTerm.value.length < 3)
                            {
                            //alert('level3');
                                alert('Please enter at least 3 characters in the Search For field.');
                                return false;
                            }
                        else
                        //alert('level4');
                           // return true;
                            theForm.submit();
                   }
                   else
                       return false;
          }
     else

          return true;
}