
// ROLLOVERS

var imgz = new Array
var origSrc = ''
var rollSrc = ''

function rollinit() {
  if (document.getElementsByTagName) { var x = document.getElementsByTagName('img'); }
  else if (document.all.tags) { var x = document.all.tags('img'); }
  else { return false; }
  for (var i=0; i<x.length; i++) {
    if (x[i].className.substring(0,5) == 'roll:') {
      rollsrc = x[i].className.substring(5,x[i].className.length);
      if ( rollsrc > '' )  {
        imgz[i]=new Image; imgz[i].src = rollsrc;
        x[i].onmouseover = function () { origSrc=this.src; this.src=this.className.substring(5,this.className.length); }
        x[i].onmouseout  = function () { if(typeof(origSrc)!='undefined' && origSrc > '') {this.src=origSrc; } }
      }
    }
  }
}

function addEvent(obj, evType, fn) {
 if (obj.addEventListener) { obj.addEventListener(evType, fn, false);  return true; }
 else if (obj.attachEvent) { var r = obj.attachEvent("on"+evType, fn); return r;    }
 else                      { return false; }
}

addEvent(window, 'load', rollinit);


function validateSignup() {
  o = document.getElementById('nl_name');      if ( !o || o.value == '' ) { alert('Please enter name.');  return false; }
  o = document.getElementById('nl_email');     if ( !o || o.value == '' ) { alert('Please enter email address.');  return false; }
  if ( !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.((\w{2,3})|(aero|coop|info|museum|name)))+$/.test(o.value)) ) { alert('Invalid email address!');  return false; }
}

// ADD TO FAVOURITES SCRIPT

/*
function AddToFavorites(url,title) {
  if(document.all) { // ie
     window.external.AddFavorite(url,title);
   }
   else { alert('Sorry, your browser doesn\'t support this function.\n\nPlease add the bookmark manually through your browser.');  }
}
*/

function addToFavorites(sHref, sTitle) {
  if (document.all) {
    window.external.AddFavorite(sHref, sTitle);
  }
  else if (window.sidebar) {
    alert("Netscape, Sea Monkey and Firefox users.\nRight-Click this link/page and select \'Bookmark this link...\' from the drop-down menu.");
    //window.sidebar.addPanel(sTitle, sHref,'');
  }
  else if (window.opera) {
    alert("Opera users.\nRight-Click this link/page and select \'Bookmark this link...\' from the drop-down menu.");
  }
}

