/* js.js */

function showDiv(div, title, desc) {
	div = document.getElementById(div);
	div.style.display = 'inline';
	div.style.position = 'absolute';
	div.style.width = '400';
	div.style.backgroundColor = '#fff';
	div.style.border = 'dotted 2px #f60';
	div.style.padding = '3px';
	div.innerHTML = '<strong class="purple">' + title + '</strong><br /><div>' + desc + '</div>';
	}

function showDiv2(div) {
	div = document.getElementById(div);
	div.style.display = 'block';
	}	

function hideDiv(div) {
	div = document.getElementById(div);
	div.style.display = 'none';
	}
	
function validateSignUp() {
	var submitThis = true;
	
	if (document.ctsignup.product[document.ctsignup.product.selectedIndex].value == "#") {
		submitThis = false;
		window.alert('Please select the plan you\'d like to purchase');
		}
	
	if (document.ctsignup.venueBizName.value == "") {
		submitThis = false;
		window.alert('You must enter a name for your church or organization!');
		}
		
	if (document.ctsignup.venueAddress.value == "") {
		submitThis = false;
		window.alert('Please enter the street address listed on your billing statement.');
		}
		
	if (document.ctsignup.venueCity.value == "") {
		submitThis = false;
		window.alert('Please enter the city where your church or organization is located.');
		}
	
	if (document.ctsignup.venueZip.value == "") {
		submitThis = false;
		window.alert('Please enter the zip code on your billing statements.');
		}
		
	if (document.ctsignup.venuePhone.value == "") {
		submitThis = false;
		window.alert('Please enter the phone number of your church or organization.');
		}
		
	if (document.ctsignup.venuePhone.value == "") {
		submitThis = false;
		window.alert('Please enter the email address of your church or organization.');
		}
		
	if (document.ctsignup.venueWeb.value == "") {
		submitThis = false;
		window.alert('Please enter the web site URL of your church or organization.');
		}
		
	if (document.ctsignup.byCreditCard.value != "1") {
		submitThis = false;
		window.alert('At this time only credit card payments are accepted. Please click the Credit Card payment link and enter your card info.');
		}
		
	if (document.ctsignup.byCreditCard.value == "1") {
		if (document.ctsignup.ccnumber.value == "") {
			submitThis = false;
			window.alert('Please enter the credit card number.');
			}
		if (document.ctsignup.ccexp.value == "") {
			submitThis = false;
			window.alert('Please enter the expiration date.');
			}
		if (document.ctsignup.ccnumber.value == "") {
			submitThis = false;
			window.alert('Please enter the card security code. It\'s a 3 digit code located on the back of the card.');
			}
		}
		
	if (document.ctsignup.agreeToTerms.value != "yes") {
		submitThis = false;
		window.alert('You must agree with the terms to continue.');
		}
		
	if (submitThis) {
		document.ctsignup.submitter.value = 'Processing...';
		document.ctsignup.submitter.disabled = true;
		document.ctsignup.submit();
		}
	}
	
function setPaymentAmount(amount) {
	document.getElementById('amount').value = amount;
	}