// JavaScript Document
        var meetingTitle = "Registration for Pau Meeting";
        var isNav = (navigator.appName.indexOf("Netscape") != -1);
        var isIE = (navigator.appName.indexOf("Microsoft") != -1);
        var isOpera = (navigator.userAgent.toLowerCase().indexOf('opera') != -1);

        function trim(s) {
            rtn = "";
            if(s != null && s.length > 0) {
                rtn = s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
            }
            return rtn;
        }


        function checkEmailFormat(emailObj) {
            var EmailValue = emailObj.value;
            if (EmailValue != '') {
                // check email format
                if (EmailValue.indexOf('.') == -1 || EmailValue.indexOf('@') == -1) {
                    alert('"' + EmailValue + '" is not a valid email address.  Please correct.');
                    emailObj.select();
                    emailObj.focus();
                    return false;
                }
            }
        }

        function getRadioValue(radioObject) {   
            var value = null;
            for (var i=0; i<radioObject.length; i++) {
                if (radioObject[i].checked) {
                    value = radioObject[i].value;
                    break;
                }
            }
            return value;
      		}

        function getCheckBoxValue(radioObject) {
            var value = null;
            for (var i=0; i<radioObject.length; i++) {
                if (radioObject[i].checked) {
                    value = radioObject[i].value;
                    break;
                }
            }
            return value;
        }

        function getSelectionValue(selectObject) {
            var list = "";
            for (var i=0; i<selectObject.length; i++) {
                if (selectObject.options[i].selected) {
                    list += "*" + selectObject.options[i].text + "\n\n";
                }
            }
            return list;
        }

        function validateForm(formObj) {
            // perform data validation before submitting
            // check other required fields
            
            var errMsgHeader = 'The following field(s) are required:\n\n';
            var errMsg = '';
            var titleValue = getRadioValue(formObj.title);
            if (titleValue == '' || titleValue == null) errMsg += 'Title\n';
            
            var firstNameValue = formObj.firstName.value;
            if (firstNameValue == '') errMsg += 'First Name\n';   
            
            var lastNameValue = formObj.lastName.value;
            if (lastNameValue == '') errMsg += 'Last Name\n';    

            var jobTitleValue = formObj.jobTitle.value; 
          
            var compOrgValue = formObj.compOrg.value;
            if (compOrgValue == '') errMsg += 'Company/Organization\n';    

            var countryValue = formObj.country.value;
            if (countryValue == '') errMsg += 'Country\n';

            var telephoneValue = formObj.telephone.value;
            if (telephoneValue == '') errMsg += 'Telephone\n';    

            var faxValue = formObj.fax.value;   

            var emailValue = formObj.email.value;
            if (emailValue == '') errMsg += 'E-mail\n';
            
                    
            var statusValue = getRadioValue(formObj.status);
            if (statusValue == '' || statusValue == null) errMsg += 'In what status will you be attending the CSLF meeting?\n';
	                    
            var sundayValue = "No";
            if (formObj.sunday.checked == true) sundayValue = "Yes";
			
			var mondayValue = "No";
            if (formObj.monday.checked == true) mondayValue = "Yes";
			
			var tuesdayValue = "No";
            if (formObj.tuesday.checked == true) tuesdayValue = "Yes";
			
			var lacqValue = "No";
            if (formObj.lacq.checked == true) lacqValue = "Yes";     
			
			var visaValue = "No";
            if (formObj.visa.checked == true) visaValue = "Yes";
                        
           /* */

            if (errMsg != '') {
                alert(errMsgHeader + errMsg);
                return false;
            }    

            var strBody = "";
            strBody += meetingTitle + "\n\n";
            strBody += "Title:\t" + titleValue + "\n";
            strBody += "First Name:\t" + firstNameValue + "\n";
            strBody += "Last Name:\t" + lastNameValue + "\n";
            strBody += "Job Title:\t" + jobTitleValue + "\n";
            strBody += "Company/Organization:\t" + compOrgValue + "\n";
            strBody += "Country:\t" + countryValue + "\n";
            strBody += "Telephone:\t" + telephoneValue + "\n";
            strBody += "Fax:\t" + faxValue + "\n";
            strBody += "E-mail:\t" + emailValue + "\n";
            strBody += "In what status will you be attending the CSLF meeting?\t" + statusValue + "\n";
            strBody += "Will you be attending the Evening Reception on Sunday, March 14?\t" + sundayValue+"\n";
			strBody += "Will you be attending the Evening Event on Monday, March 15th?\t" + mondayValue+"\n";
			strBody += "Will you be attending the Evening Event on Tuesday, March 16th?\t" + tuesdayValue+"\n";
			
            strBody += "Will you be participating in visit to Lacq CO2 Capture and Storage Project on March 17th?\t" + lacqValue+"\n";
            strBody += "Do you need a letter of invitation to obtain your entry visa into France?\t" + visaValue+"\n";
                        
            formObj.bodyText.value = strBody;
            return true;
        }
		
function validateNewsAlertForm() {
  var EmailValue = document.newsalert.email.value;
  var unSubscribe = false;
        
  // Check for email address format
  if (EmailValue == '' || EmailValue.indexOf('.') == -1 || EmailValue.indexOf('@') == -1) {
    if (EmailValue == '') 
      alert("\nE-mail address is a required field.")
    else {
      alert("\n\"" + EmailValue + "\" is not a valid e-mail address.  Please correct it.");
	  document.newsalert.email.select();
      document.newsalert.email.focus();
	}
    return false;
  }
  
  // Check if this request is for unsubscription
  if (document.newsalert.unsubcheck.checked) {
    if (window.confirm("\nAre you sure you wish to cancel your subscription?")) {
      return true;
    }
    else {
      return false;
    }
  }
  else {
    return true;
  }
        
}

function unsubCheck() {
        if (document.newsalert.unsubcheck.checked)
          document.newsalert.submitbutton.value = "Unsubscribe";
        else
          document.newsalert.submitbutton.value = "Subscribe";
}
