function chkform(theForm) {
	if (theForm.txtemail.value == "") {
		alert("You must enter your email address.");
		theForm.txtemail.focus();
		return (false);
	}
	return (true);
}

function chkloginform(theForm) {
	if (theForm.txtmbrid.value == "") {
		alert("You must enter your user ID");
		theForm.txtmbrid.focus();
		return (false);
	}
	if (theForm.txtmbrid.value.length > 64)	{
		alert("User ID cannot be more than 64 characters.");
		theForm.txtmbrid.focus();
		return (false);
	}
	if (theForm.txtmbrpassword.value == "") {
		alert("You must enter your password");
		theForm.txtmbrpassword.focus();
		return (false);
	}
	if (theForm.txtmbrpassword.value.length > 64) {
		alert("Password cannot be more than 64 characters.");
		theForm.txtmbrpassword.focus();
		return (false);
	}
	return (true);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function WA_setCookie(cookieobj, cookiename, cookievalue, cookiecheck, settype)  {
  var theValue = "";
  if (settype == 1)     {
    for (var n=0; n<cookievalue.length; n++)    {
      if (cookievalue[n].checked)     {
        theValue = cookievalue[n].value;
      }
    }
  }
  else if (settype == 2)     {
    for (var n=0; n<cookievalue.options.length; n++)    {
      if (cookievalue.options[n].selected)     {
        if (theValue != "")
          theValue += ", ";
        theValue += cookievalue.options[n].value;
      }
    }
  }
  else      {
    theValue = cookievalue
  }

  if (cookiecheck)     {
    cookieobj.setValue(cookiename, theValue);
  }
}


function CookieDef(expires,path,domain,secure)
{
  this.secure = secure;
  this.path = path;
  this.domain = domain;
  this.getValue = getCookie;
  this.setValue = setCookie;
  this.expire = deleteCookie;
  if (expires == 0) {
    this.expires = "";
  } else {
    var today_date = new Date();
	 var expire_seconds = today_date.getTime() + (expires * 24 * 60 * 60  * 1000);
    today_date.setTime(expire_seconds);
    this.expires = today_date.toGMTString();
  }
}

function getCV(offset) {
  var endstr = document.cookie.indexOf(";", offset);
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function getCookie(name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCV(j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return "";
}

function setCookie(name,value)
{
  document.cookie = name + "=" + escape(value) +
    ((this.expires == "") ? "" : ("; expires=" + this.expires)) +
    ((this.path == "") ? "" : ("; path=" + this.path)) +
    ((this.domain == "") ? "" : ("; domain=" + this.domain)) +
    ((this.secure == true) ? "; secure" : "");
}

function deleteCookie(name) {
  document.cookie = name + "=" + "" + "; expires=Thu,01-Jan-70 00:00:01 GMT";
}

function WA_decodeCookieSelectVal(theVal)     {
  theVal = theVal.replace(/\|WACS\|/g, ", ");
  return theVal;
}

function WA_checkCookieSelectOption(theList, theOption, theVal)     {
  var testVal = "";
  if (theList.options[theOption].value)     {
    testVal = theList.options[theOption].value;
  }
  else      {
    testVal = theList.options[theOption].text;
  }
  if (testVal == WA_decodeCookieSelectVal(theVal))     {
    theList.options[theOption].selected = true;
    return true;
  }
  return false;
}

function WA_getCookie(cookieobj, cookiename, cookieset, settype)     {
  var theValue = cookieobj.getValue(cookiename);

  if (settype == 1)     {
    cookieset.value = theValue;
  }
  else if (settype == 2)     {
    cookieset.checked = (String(theValue)!="" && String(theValue).toUpperCase() !="FALSE");
  }
  else if (settype == 3)     {
    for (var n=0; n< cookieset.length; n++)     {
      if (cookieset[n].value == theValue)     {
        cookieset[n].checked = true;
        break;
      }
    }
  }
  else if (settype == 4)     {
    var setArr = theValue.split(", ");
    for (var m=0; m<setArr.length; m++)     {
      for (var n=0; n<cookieset.options.length; n++)     {
        if (n+m < cookieset.options.length && cookieset.options[n+m])     {
          if (WA_checkCookieSelectOption(cookieset, n+m, setArr[m]))     {
            break;
          }
        }
        if (n!=0 && n-m >= 0 && cookieset.options[n-m])     {
          if (WA_checkCookieSelectOption(cookieset, n-m, setArr[m]))     {
            break;
          }
        }
        if (n-m < 0 && n+m >= cookieset.options.length)     {
          break;
        }
      }
    }
  }
}

function WA_deleteCookie(cookieobj, cookiename, cookiecheck)     {
  if (cookiecheck)     {
    cookieobj.setValue(cookiename, "");
    cookieobj.expire(cookiename);
  }
}