// JavaScript Document
if (document.images)
{
  pic1= new Image(153,39); 
  pic1.src="images/toptab.jpg"; 

  pic2= new Image(153,39); 
  pic2.src="images/toptab_on.jpg"; 
}
function menushow(thediv){
document.getElementById(thediv).style.backgroundImage="url("+pic2.src+")";}
function menuhide(thediv){
document.getElementById(thediv).style.backgroundImage="url("+pic1.src+")";}

function slidestory(oldstory,storynum) {
document.getElementById(oldstory).style.display="none";
document.getElementById(storynum).style.display="block";
	}

function checkEmail(email) {

  var str = new String(email);
  var isOK = true;
  rExp = /[!\"£$%\^&*()-+=<>,\'#?\\|¬`\/\[\]]/
  if( rExp.test(str) )
    isOK = false;
  if( str.indexOf('.') == -1 || str.indexOf('@') == -1 )
    isOK = false;
  if( str.slice(str.lastIndexOf('.')+1,str.length).length < 2 )
    isOK = false;
  if( str.slice(0,str.indexOf('@')).length < 1 )
    isOK = false;
  if( str.slice(str.indexOf('@')+1,str.lastIndexOf('.')).length < 1 )
    isOK = false;

  if( !isOK )
    alert( 'Invalid email address' );

  return isOK;
}
