function bookmarksite(){
   if (document.all) {
      window.external.AddFavorite(location.href, document.title);
   }
   else if (window.sidebar) {
      window.sidebar.addPanel(document.title, location.href, "");
   }
}

/**
 * Hide the billing details & clear
 * if they are the same as the personal details
 */
function toggleMailingAddress(mailingAddress) {
   var details = document.getElementById("MailingAddress");
   if (mailingAddress.checked == false) {
      details.style.display = 'inline';
   }
   else {
      details.style.display = 'none';
      document.getElementById("mailAddress1").value = '';
      document.getElementById("mailAddress2").value = '';
      document.getElementById("mailPostcode").value = '';
      document.getElementById("mailSuburbTown").value = '';
      document.getElementById("mailState").value = '';
      document.getElementById("mailCountry").value = '';
   }
}

/**
 * Show/hide email recipient options
 */
function toggleEmailRecipientOptions(emailRecipientOptions) {
   if (emailRecipientOptions.value == 'ByLocation') {
      document.getElementById("EmailOptionLocation").style.display = 'block';
      document.getElementById("EmailOptionMemberType").style.display = 'none';
      document.getElementById("EmailOptionOther").style.display = 'none';
   }
   else if (emailRecipientOptions.value == 'ByMemberType') {
      document.getElementById("EmailOptionLocation").style.display = 'none';
      document.getElementById("EmailOptionMemberType").style.display = 'block';
      document.getElementById("EmailOptionOther").style.display = 'none';
   }
   else if (emailRecipientOptions.value == 'ByOther') {
      document.getElementById("EmailOptionLocation").style.display = 'none';
      document.getElementById("EmailOptionMemberType").style.display = 'none';
      document.getElementById("EmailOptionOther").style.display = 'block';
   }
}

/**
 * Remove a default value
 */
function clearLogin(form) {
   if(form.username.defaultValue==form.username.value) {
      form.username.value = "";
   }
   if(form.password.defaultValue==form.password.value) {
      form.password.value = "";
   }
}

/**
 * Sets a field to a date far into the future.
 */
function setFutureDate() {
   document.getElementById("expires").value = '1 January 2038';
}
