// Basic Javascript function for general operations

function getInternetExplorerVersion()
// code from MicroSoft.com
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function validateEmail(email) {
	// use REG EXP for validating an email
	var filter = /^([a-zA-Z0-9_\.-])+@(([a-zA-Z0-9_\.-])+)+(\.{1}[a-zA-Z0-9]{2,4})$/;
	if (!filter.test(email) || email.indexOf("..") > -1 || email.indexOf("@.") > -1 || email.indexOf(".@") > -1) {
		return false;
	} else {
		return true;
	}
}
