function buyTickets() {
	
	var paypal_form = document.createElement("form");
  paypal_form.method="post" ;
  paypal_form.action = "https://www.paypal.com/cgi-bin/webscr";
  paypal_form.target = "_blank";
  
  var input_form = document.createElement("input");
  
  input_form.setAttribute("name", "add");
  input_form.setAttribute("value", "1");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "cmd");
  input_form.setAttribute("value", "_cart");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "business");
  input_form.setAttribute("value", "chs@packageofprevention.com");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "item_name");
  input_form.setAttribute("value", "3rd Annual Take Charge Luncheon");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "item_number");
  input_form.setAttribute("value", "#RSVP");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "amount");
  input_form.setAttribute("value", "40.00");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "no_shipping");
  input_form.setAttribute("value", "0");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "no_note");
  input_form.setAttribute("value", "1");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "currency_code");
  input_form.setAttribute("value", "USD");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "lc");
  input_form.setAttribute("value", "US");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "bn");
  input_form.setAttribute("value", "PP-ShopCartBF");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  document.body.appendChild(paypal_form) ;
  paypal_form.submit() ;
  document.body.removeChild(paypal_form) ;
	
}

function donateNow() {
	
	var paypal_form = document.createElement("form");
  paypal_form.method="post" ;
  paypal_form.action = "https://www.paypal.com/cgi-bin/webscr";
  paypal_form.target = "_blank";
  
  var input_form = document.createElement("input");
  
  input_form.setAttribute("name", "add");
  input_form.setAttribute("value", "1");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "cmd");
  input_form.setAttribute("value", "_donations");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "business");
  input_form.setAttribute("value", "chs@packageofprevention.com");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "item_name");
  input_form.setAttribute("value", "Package of Prevention Donation");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "item_number");
  input_form.setAttribute("value", "chs@packageofprevention.com");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "currency_code");
  input_form.setAttribute("value", "USD");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "lc");
  input_form.setAttribute("value", "US");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  var input_form = document.createElement("input");
  input_form.setAttribute("name", "bn");
  input_form.setAttribute("value", "PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest");
  input_form.setAttribute("type", "hidden");
  paypal_form.appendChild(input_form) ;
  
  document.body.appendChild(paypal_form) ;
  paypal_form.submit() ;
  document.body.removeChild(paypal_form) ;
	
}

function validateAdd2Count() {
	
	$("#error_first_name").empty().hide();
	$("#error_last_name").empty().hide(); 
	$("#error_city").empty().hide(); 
	$("#error_state").empty().hide();
	$("#error_email_address").empty().hide();
	$("#error_age").empty().hide(); 
	$("#error_screen_type").empty().hide(); 
	$("#error_validate").empty().hide();  
  
	var addcount_first_name	= $("#addcount_first_name").val();
	var addcount_last_name	= $("#addcount_last_name").val();
	var addcount_city				= $("#addcount_city").val();
	var addcount_state			= $("#addcount_state").val();
	var addcount_email			= $("#addcount_email_address").val();
	var addcount_age				= $("#addcount_age").val();
	var addcount_screen			= $("#addcount_screen_type").val();
	var addcount_validate		= $("#addcount_validate_captcha").val();
	
	var errors = 0;
	
	if (addcount_first_name == null || addcount_first_name == '') {
		$("#error_first_name").show()
		.append("First Name is required");
		errors++; 
	}
	if (addcount_last_name == null || addcount_last_name == '') {
		$("#error_last_name").show()
		.append("Last Name is required");
		errors++; 
	}
	if (addcount_city == null || addcount_city == '') {
		$("#error_city").show()
		.append("City is required");
		errors++; 
	}
	if (addcount_state == null || addcount_state == '') {
		$("#error_state").show()
		.append("State is required");
		errors++; 
	}
	if (addcount_email == null || addcount_email == '') {
		$("#error_email_address").show()
		.append("Email is required");
		errors++; 
	}
	if (addcount_age == null || addcount_age == '') {
		$("#error_age").show()
		.append("Age is required");
		errors++; 
	} else if (!isNumeric(addcount_age)) {
		$("#error_age").show()
		.append("Age should be numeric");
		errors++; 
	}
	if (addcount_screen == null || addcount_screen == '') {
		$("#error_screen_type").show()
		.append("Select Screen Type");
		errors++; 
	}
	if (addcount_validate == null || addcount_validate == '') {
		$("#error_validate").show()
		.append("Validate your submission");
		errors++; 
	}	
	
	if (errors > 0) {
		//alert (errors+" Errors were found on the form");
		return false;
	} 
}   

function validateContact() {

	$("#error_first_name").empty().hide();
	$("#error_email_address").empty().hide(); 
	$("#error_city").empty().hide(); 
	$("#error_state").empty().hide();
	$("#error_screen_type").empty().hide(); 
	$("#error_validate").empty().hide();  
	
	var contact_first_name= $("#contact_first_name").val();
	var contact_city			= $("#contact_city").val();
	var contact_state			= $("#contact_state").val();
	var contact_email			= $("#contact_email_address").val();
	var contact_validate	= $("#contact_validate_captcha").val();
	
	var errors = 0;
	
	if (contact_first_name == null || contact_first_name == '') {
		$("#error_first_name").show()
		.append("First Name is required");
		errors++; 
	}
	if (contact_city == null || contact_city == '') {
		$("#error_city").show()
		.append("City is required");
		errors++; 
	}
	if (contact_state == null || contact_state == '') {
		$("#error_state").show()
		.append("State is required");
		errors++; 
	}
	if (contact_email == null || contact_email == '') {
		$("#error_email_address").show()
		.append("Email is required");
		errors++; 
	}
	if (contact_validate == null || contact_validate == '') {
		$("#error_validate").show()
		.append("Validate your submission");
		errors++; 
	}	
	
	if (errors > 0) {
		//alert (errors+" Errors were found on the form");
		return false;
	} 
}      
 
function isNumeric(form_value) {
	if (form_value.match(/^\d+$/) == null)
		return false;
	else 
		return true; 
} 