function validateForm()
	{
	if(document.form1.Fname.value.length<3 )
	{ 
		alert("Your first name is very short !");
		return false; 
	}
	else if(document.form1.Lname.value.length<3 )
	{ 
		alert("Your last name is short !");
		return false; 
	}
	else if(document.form1.email.value.length<4)
	{ 
		alert("Please give us an email address !");
		return false; 
	}
	else 
	{
		return true;
	}
}

function isAValidEmail(inputValue) {
    var foundAt = false
    var foundDot = false
    var atPosition = -1
    var dotPosition = -1

    for (var i=0; i<=inputValue.length; i++) 
	{
    	if (inputValue.charAt(i) == "@" ) 
		{
        	foundAt = true
        	atPosition = i
    	}
    	else if (inputValue.charAt(i) == ".") 
		{
          foundDot = true
          dotPosition = i
      	}
    }
    if (!((foundAt && foundDot) && (atPosition < dotPosition-1))) 
	{
 		alert("Sorry, you entered a funny e-mail address.  Please try again.");
        return false;
    }
	else
	{
		return true;
	}
}
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  var offset, end;
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}


function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + (hours * 3600000));
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value)+ expire;
}
// * Dependencies * 
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

//  === Highlight row when mouseOver ===================================  //
function rowOverEffect(object) 
{
	if (object.className == 'normal') {object.className = 'highlight';}
}
//  === Return to normal when mouseOut =================================  //
function rowOutEffect(object) 
{
	if (object.className == 'highlight') {object.className = 'normal';}
}

function jump(recno) {
	if (readCookie("ok").length>1) {
		document.cookie = 'selected' + "=" + escape(recno);
		window.location='/private/editArchives.php';
	}
}
