<!--

function sendForm()
	{
		if ((document.donations.gift_donation[10].checked && document.donations.other_amount.value == '') || (document.donations.gift_donation[3].checked && document.donations.other_monthly_amount.value == ''))
		{
			alert('Please enter the amount of your donation');
			return(false);
		}
		return(true);
	}

function checkSSL(url) {

    if (self.location.href.indexOf("https") != -1){

    }

	else {

	self.location.href = url;

	}
}

function checkNoSSL(url) {

    if (self.location.href.indexOf("https") != -1){

	self.location.href = url;

	}
}

function confirmDelete() {

    if (confirm("Are you sure you want to permanently delete this record?")) {
        return(true);
    }
    else {
        return(false);
    }   
}

function confirmUpdate() {

    if (confirm("Are you sure you want to update this record?")) {
        return(true);
    }
    else {
        return(false);
    }   
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function NewWin(url) {

  agent = navigator.userAgent;
  windowName = "NewWin";

  params  = "";
  params += "top=10,";
  params += "left=10,";
  params += "toolbar=0,";
  params += "location=0,";
  params += "directories=0,";
  params += "status=0,";
  params += "menubar=0,";
  params += "scrollbars=1,";
  params += "resizable=1,";
  params += "width=510,";
  params += "height=530";

  win = window.open(url, windowName , params);

  if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
	  win = window.open(url, windowName , params);
  }

  if (!win.opener) {
	  win.opener = window;
  }
};

function confirmSubmit(varMsg) {
    if (confirm(varMsg)) {
        return(true);
    }
    else {
        return(false);
    }   
}

var submitcount=0;

function checkSubmitCount() {
if (submitcount == 0)
  {
  submitcount++;
  return true;
  }
else 
  {
  alert("This form has already been submitted.");
  return false;
  }
}

function toggleDiv(theDiv)
//IN:  the ID of the DIV we're hiding or showing.
{
	if (document.getElementById(theDiv).style.display == "block")
		document.getElementById(theDiv).style.display = "none";
	else
		document.getElementById(theDiv).style.display = "block";
}

function toggleBoxes(theTxt, theTxt2, theTxt3, theTxt4)
//IN:  the ID of a text box that should be enabled.
//	   a second ID of the text box that should be disabled.
//	   a third ID of the text box that should be disabled.
//	   a fourth ID of the text box that should be disabled.
//	   {used in the conference registration form.}
{
	if(theTxt != '')
		document.getElementById(theTxt).readOnly = false;
	if(theTxt2 != '')
	{
		document.getElementById(theTxt2).readOnly = true;
		document.getElementById(theTxt2).value = '';
	}
	
	if(theTxt3 != '')
	{
		document.getElementById(theTxt3).readOnly = true;
		document.getElementById(theTxt3).value = '';
	}
	
	if(theTxt4 != '')
	{
		document.getElementById(theTxt4).readOnly = true;
		document.getElementById(theTxt4).value = '';
	}
		
	if(theTxt == 'Early_Bird_Reg_Amt'){
		document.getElementById(theTxt).value = '65';
	} else if(theTxt == 'Standard_Reg_Amt'){
		document.getElementById(theTxt).value = '85';
	} else if(theTxt == 'Bring_a_Friend_Reg_Amt'){
		document.getElementById(theTxt).value = '150';
	} else if(theTxt == 'Early_Bird_Bring_a_Friend_Reg_Amt'){
		document.getElementById(theTxt).value = '100';
	}
}

function calcRegForm()
//{used in the conference registration form.}
{
	regTotal = 0.00;
	
	if(document.getElementById('Early_Bird_Reg_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('Early_Bird_Reg_Amt').value);
		
	if(document.getElementById('Standard_Reg_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('Standard_Reg_Amt').value);
	
	if(document.getElementById('Bring_a_Friend_Reg_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('Bring_a_Friend_Reg_Amt').value);
		
	if(document.getElementById('Early_Bird_Bring_a_Friend_Reg_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('Early_Bird_Bring_a_Friend_Reg_Amt').value);
	
	if(document.getElementById('CE_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('CE_Amt').value);
		
	if(document.getElementById('Sponsor_Scholarship_Amt').value != '')
		regTotal = regTotal + eval(document.getElementById('Sponsor_Scholarship_Amt').value);
	
	document.getElementById('Total_Amt_Due').value = regTotal;
}

// Added 9/16/09

function totalOrder() {
	var x = document.getElementById("numCopies").value;
		if (x == 1) {
			cost = document.getElementById("cost");
			cost.value = '';
			cost.value = '0.00';
			
			totalCost = document.getElementById("totalCost");
			totalCost.value = '';
			totalCost.value = '0.00';
			
			document.getElementById('CCnum').style.display = "none";
			document.getElementById('CCinfo').style.display = "none";
			}
		else if (x > 1 && x < 11) {
			cost = document.getElementById("cost");
			cost.value = '';
			cost.value = '5.00';
			
			totalCost = document.getElementById("totalCost");
			totalCost.value = '';
			totalCost.value = '5.00';
			
			document.getElementById('CCnum').style.display = "";
			document.getElementById('CCinfo').style.display = "";
			}
		else if (x > 10) {
			cost = document.getElementById("cost");
			cost.value = '';
			cost.value = '10.00';
			
			totalCost = document.getElementById("totalCost");
			totalCost.value = '';
			totalCost.value = '10.00'; 
			
			document.getElementById('CCnum').style.display = "";
			document.getElementById('CCinfo').style.display = "";
			}
}

function toggleOn(i) {
	var ele = document.getElementById(i);
		ele.style.display = "block";
} 

function toggleOff(i) {
	var ele = document.getElementById(i);
		ele.style.display = "none";
}
//-->