///
///

function clearDefaultandCSS(el) {
    if (el.defaultValue == el.value) {
        el.value = "";
    }
    if (el.style) {
//        el.style.cssText = "";
    }
}


///

function bookmarkPage() {
	if ( navigator.appName != 'Microsoft Internet Explorer' ) {
		window.sidebar.addPanel("The Legal Action Center","http://www.lac.org/","");
	}
	else {
		window.external.AddFavorite("http://www.lac.org/","The Legal Action Center");
	}
}

///
///

function checkBenefitForm() {

var theform = document.benefitform;
var radios = document.benefitform.elements['AttributeValue[1]'];
sponsorOption = -1;

for (i=radios.length-1; i > -1; i--) {
	if (radios[i].checked) {
		sponsorOption = i; i = -1;
	}
}

if (sponsorOption == -1) {
	alert("Please make a selection");
	return false;
}

else if (sponsorOption == 8) {
   theform.Quantity.value = theform.TicketQuantity.value;
   return true;
  }

else if (sponsorOption == 9) {


	if (theform.DonationAmount.value.length == 0) {
		alert("Please enter an amount");
		return false;
	}

	theform.Product_Code.value = 'EXTERNAL';

	document.benefitform.elements['AttributeValue[1]'].value = '';

	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "AttributeCode[2]");
	input.setAttribute("value", "PRICE");
	theform.appendChild(input);

	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "AttributeValue[2]");
	input.setAttribute("value", theform.DonationAmount.value);
	theform.appendChild(input);

	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "AttributeCode[3]");
	input.setAttribute("value", "don_design");
	theform.appendChild(input);

	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "AttributeValue[3]");
	input.setAttribute("value", "dn_des_alpi");
	theform.appendChild(input);


	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", "AttributeCount");
	input.setAttribute("value", "3");
	theform.appendChild(input);

/*
for(i=0; i<document.benefitform.elements.length; i++) {
 alert("The field name is: " + document.benefitform.elements[i].name + " and its value is: " + document.benefitform.elements[i].value);
}
*/

   return true;

  }

else {
   theform.Quantity = 1;
   return true;
  }

}

///
///

function checkNacForm() {

var theform = document.nacform;

var radios = document.nacform.elements['AttributeValue[1]'];

amountSelected = -1;

for (i=radios.length-1; i > -1; i--) {
	if (radios[i].checked) {
		amountSelected = i; i = -1;
	}
}

if (amountSelected == -1) {

 if (document.nacform.elements['specifyamt'].checked == false) {
 alert("Please make a selection");
return false;
 }
}


document.nacform.submit();
return true;
}

///
///

function selectSpecifyAmount() {

var radios = document.nacform.elements['AttributeValue[1]'];

for (i=radios.length-1; i > -1; i--) {
	radios[i].checked = false;
	document.nacform.elements['specifyamt'].checked = true;
}


}

///
///

