var reEmail = /^.+\@.+\..+$/
var isOpera = (navigator.userAgent.indexOf("Opera")  > -1);
var isNS4 = (document.layers);
var isNS6 = (!document.all && document.getElementById);
var isMacIE = ( (navigator.userAgent.indexOf("MSIE")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var isMacIE4 = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );

function openPopup(URL, name, width, height ) {
   var oWindow = window.open(URL, name, "resizable=1, scrollbars=1, toolbar=0, location=0, directories=0, status=0, menubar=0, copyhistory=0, width=" + width + ", height=" + height );
   if (window.focus) { oWindow.focus(); }
}

function isEmpty(s) {
   return ((s == null) || (s.length == 0));
}

function isEmail (email) {
   if (!isEmpty(email)) {
      return reEmail.test(email);
   } else {
      return false;
   }
}

function addBookmark(bookmarkurl, bookmarktitle) {
	if (document.all && !isOpera) {
		window.external.AddFavorite(bookmarkurl, bookmarktitle);
	} else if (isNS4 || isNS6) {
		alert("To add this page to your bookmarks, press Ctrl + D");
	} else if (isOpera) {
		alert("To add this page to your bookmarks, press Ctrl + T");
	}
	return;
}
