function CheckEmail(email) {
  if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
    return true;
  }
  else {
    return false;
  }
}



// ---------------------------------------------------------------------
// Browser Detection 
// 
// ---------------------------------------------------------------------
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false; 
isDOM=(document.getElementById)?true:false
isOpera=isOpera5=window.opera && isDOM
isOpera6=isOpera && window.print
isOpera7=isOpera && navigator.userAgent.indexOf("Opera 7") > 0 || navigator.userAgent.indexOf("Opera/7") >= 0
isMSIE=isIE=document.all && document.all.item && !isOpera
isMSIE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false; 
isMSIEmac = ((document.all)&&(isMac)) ? true : false; 
isNC=navigator.appName=="Netscape"
isNC4=isNC && !isDOM
isNC6=isNC && isDOM



// ---------------------------------------------------------------------
// Safe loading into window.onload
//
// Body onload utility (supports multiple onload functions) 
// ---------------------------------------------------------------------
var gSafeOnload = new Array(); 
function SafeAddOnload(f) 
{ 
  if (isMSIEmac && isMSIE4)  // IE 4.5 blows out on testing window.onload 
  { 
    window.onload = SafeOnload; 
    gSafeOnload[gSafeOnload.length] = f; 
  } 
  else if  (window.onload) 
  { 
    if (window.onload != SafeOnload) 
    { 
      gSafeOnload[0] = window.onload; 
      window.onload = SafeOnload; 
    } 
    gSafeOnload[gSafeOnload.length] = f; 
  } 
  else 
    window.onload = f; 
} 
function SafeOnload() 
{ 
  for (var i=0;i<gSafeOnload.length;i++) 
    gSafeOnload[i](); 
} 



// ---------------------------------------------------------------------
// Set a layer opacity
// 
// ---------------------------------------------------------------------
function SetLayerOpacity(layername, opacitylevel) {
  if (!isDOM) {
    return false;
  }
  if(isMSIE) {
    document.getElementById(layername).style.filter='alpha(opacity='+opacitylevel+')';
  }
	if(isNC6) {
    document.getElementById(layername).style.MozOpacity = opacitylevel/100;
  }
}



// ---------------------------------------------------------------------
// Set a cookie
// 
// ---------------------------------------------------------------------
function SetCookie(cookieName, cookieValue, nDays) {
  var today = new Date();
  var expire = new Date();
  if (nDays==null || nDays==0) {
    nDays=1;
  }
   expire.setTime(today.getTime() + 3600000*24*nDays);
   document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}



// ---------------------------------------------------------------------
// Cross browser getElementById function
// 
// ---------------------------------------------------------------------
function CrossGetElementById(id) {
  return document.getElementById(id);
}


// ---------------------------------------------------------------------
// Change layer content dynamically
// 
// ---------------------------------------------------------------------
function ChangeLayerContent(id, content) {
  lay = CrossGetElementById(id);
	if (!isOpera6)
	{
    previouscontent = lay.innerHTML;
		//lay.css.height = 'auto';
		lay.innerHTML = content;
	}
  return previouscontent;
}