
regSpon = {
	
	regSpon: function(){
		this.item = '';
		this.price = '';
		this.payment_method = '';
		this.vdate_bool = true;
		this.err_msg = false;
	},
	
	setItem: function(item,price){
		this.item = item;
		$('optionPicked').innerHTML = 'You Picked <b>' + (item+' / '+price) + '</b>';
		$('dataForm').style.display = 'block';
	},
	
	setPrice: function(price){
		if($('amountInputField').value){
			this.price = $('amountInputField').value;
			$('amountField').value = this.price;
			$('amount').innerHTML = this.price;
		}
	},
	
	disableElec: function(){
 		$('elecField').disabled = true;
		$('elecField').checked = false;
	},
	
	enableElec: function(){
 		$('elecField').disabled = false;
	},
	
	setMethod: function(method){
		this.setPrice();
		if(!this.price){
			alert('Please choose your "Sponsorship Amount" above before selecting a payment method.');
		}else{
			
			this.payment_method = method;
			//$('paypal').style.display = 'none';
			$('check').style.display = 'none';
			$('po').style.display = 'none';
			$('default').style.display = 'none';
		
			if(method == 'check' || method == 'po'){
				if(method == 'check'){
					$('amount').innerHTML = this.price;
				}
				$(method).style.display = 'block';
			}else{
				$('default').style.display = 'block';
			}
		}
	},

	vdate: function(obj,msg){
		
		if(!$(obj).value){
			this.vdate_bool = false;
			this.err_msg += msg;
		}
		
	},
	
	validate: function(){

		this.vdate_book = true;
		this.err_msg = '';

		// some fields to validate
		this.vdate('booth_signage_text','Booth Signage Text is Missing<br>');
		this.vdate('company','Company/Org Name is Missing<br>');
		this.vdate('name','Name is Missing<br>');
		this.vdate('mailing_address','Mailing Address is Missing<br>');
		this.vdate('mailing_city','Mailing City is Missing<br>');
		this.vdate('mailing_state','Mailing State is Missing<br>');
		this.vdate('mailing_zip','Mailing Zip is Missing<br>');
		this.vdate('telephone','Telephone is Missing<br>');
		this.vdate('email','Email is Missing<br>');

		if(this.vdate_bool == false){
			$('error_msg').style.display = 'block';
			$('errorMsg').innerHTML = this.err_msg;
			return false;
		}
		
		return true;

	},
	
	getInstance: function(obj){
		if($(obj).value){
			return 'y';
		}
		return 'n';
	}
	
}


regGov = {
	
	regGov: function(){
		this.item = '';
		this.price = '';
		this.payment_method = '';
	},
	
	setItem: function(item,price){
		this.item = item;
		this.price = price;
		$('optionPicked').innerHTML = 'You Picked <b>' + (item+' / $'+price) + '</b>';
		$('dataForm').style.display = 'block';
		$('amountField').value = this.price;
		$('amount').innerHTML = this.price;
	},
	
	setMethod: function(method){
		this.payment_method = method;
		$('paypal').style.display = 'none';
		$('check').style.display = 'none';
		$('po').style.display = 'none';
		$('default').style.display = 'none';
		
		if(method == 'paypal' || method == 'check' || method == 'po'){
			if(method == 'check'){
				$('amount').innerHTML = this.price;
			}
			$(method).style.display = 'block';
		}else{
			$('default').style.display = 'block';
		}
	},
	
	validate: function(){

		// default the validation as true.. if we find an error, then we can drop it
		var valid = true;
		var err_msg = '';
		
		if(this.getInstance('company') == false){
			valid = false;
			err_msg += 'Company/Org Name is Missing<br>';
		}
		
		if(this.getInstance('name_tag') == false){
			valid = false;
			err_msg += 'Print Name for Name Tag is Missing<br>';
		}

		if(this.getInstance('mailing_address') == false){
			valid = false;
			err_msg += 'Mailing Address is Missing<br>';
		}

		if(this.getInstance('mailing_city') == false){
			valid = false;
			err_msg += 'Mailing City is Missing<br>';
		}

		if(this.getInstance('mailing_state') == false){
			valid = false;
			err_msg += 'Mailing State is Missing<br>';
		}

		if(this.getInstance('mailing_zip') == false){
			valid = false;
			err_msg += 'Mailing Zip is Missing<br>';
		}

		if(this.getInstance('telephone') == false){
			valid = false;
			err_msg += 'Telephone is Missing<br>';
		}

		if(this.getInstance('email') == false){
			valid = false;
			err_msg += 'Email is Missing<br>';
		}
		
		if(valid == false){
			$('error_msg').style.display = 'block';
			$('errorMsg').innerHTML = err_msg;
		}
		
		return valid;
		
	},
	
	getInstance: function(obj){
		if($(obj).value){
			return true;
		}
		return false;
	}
	
}


regAnn = {
	
	regAnn: function(){
		this.item = '';
		this.price = '';
		this.payment_method = '';
	},
	
	setItem: function(item,price){
		this.item = item;
		this.price = price;
		$('optionPicked').innerHTML = 'You Picked <b>' + (item+' / $'+price) + '</b>';
		$('dataForm').style.display = 'block';
		$('amountField').value = this.price;
		$('amount').innerHTML = this.price;
	},
	
	setMethod: function(method){
		this.payment_method = method;
		$('paypal').style.display = 'none';
		$('check').style.display = 'none';
		$('po').style.display = 'none';
		$('default').style.display = 'none';
	
		if(method == 'paypal' || method == 'check' || method == 'po'){
			if(method == 'check'){
				$('amount').innerHTML = this.price;
			}
			$(method).style.display = 'block';
		}else{
			$('default').style.display = 'block';
		}
	},
	
	validate: function(){

		// default the validation as true.. if we find an error, then we can drop it
		var valid = true;
		var err_msg = '';
		
		if(this.getInstance('company') == false){
			valid = false;
			err_msg += 'Company/Org Name is Missing<br>';
		}
		
		if(this.getInstance('name') == false){
			valid = false;
			err_msg += 'Name is Missing<br>';
		}

		if(this.getInstance('mailing_address') == false){
			valid = false;
			err_msg += 'Mailing Address is Missing<br>';
		}

		if(this.getInstance('mailing_city') == false){
			valid = false;
			err_msg += 'Mailing City is Missing<br>';
		}

		if(this.getInstance('mailing_state') == false){
			valid = false;
			err_msg += 'Mailing State is Missing<br>';
		}

		if(this.getInstance('mailing_zip') == false){
			valid = false;
			err_msg += 'Mailing Zip is Missing<br>';
		}

		if(this.getInstance('telephone') == false){
			valid = false;
			err_msg += 'Telephone is Missing<br>';
		}

		if(this.getInstance('email') == false){
			valid = false;
			err_msg += 'Email is Missing<br>';
		}
		
		if(valid == false){
			$('error_msg').style.display = 'block';
			$('errorMsg').innerHTML = err_msg;
		}
		
		return valid;
		
	},
	
	getInstance: function(obj){
		if($(obj).value){
			return true;
		}
		return false;
	}
	
}

regMember = {
	
	regGov: function(){
		this.item = '';
		this.price = '';
		this.payment_method = '';
	},
	
	setItem: function(item,price){
		this.item = item;
		this.price = price;
		$('optionPicked').innerHTML = 'You Picked <b>' + (item+' / $'+price) + '</b>';
		$('dataForm').style.display = 'block';
		$('amountField').value = this.price;
		$('amount').innerHTML = this.price;
	},
	
	setMethod: function(method){
		this.payment_method = method;
		$('paypal').style.display = 'none';
		$('check').style.display = 'none';
		$('po').style.display = 'none';
		$('default').style.display = 'none';
		
		if(method == 'paypal' || method == 'check' || method == 'po'){
			if(method == 'check'){
				$('amount').innerHTML = this.price;
			}
			$(method).style.display = 'block';
		}else{
			$('default').style.display = 'block';
		}
	},
	
	validate: function(){

		// default the validation as true.. if we find an error, then we can drop it
		var valid = true;
		var err_msg = '';
		
		if(this.getInstance('company') == false){
			valid = false;
			err_msg += 'Company/Org Name is Missing<br>';
		}
		
		if(this.getInstance('contact_person') == false){
			valid = false;
			err_msg += 'Contact Person is Missing<br>';
		}

		if(this.getInstance('mailing_address') == false){
			valid = false;
			err_msg += 'Mailing Address is Missing<br>';
		}

		if(this.getInstance('mailing_city') == false){
			valid = false;
			err_msg += 'Mailing City is Missing<br>';
		}

		if(this.getInstance('mailing_state') == false){
			valid = false;
			err_msg += 'Mailing State is Missing<br>';
		}

		if(this.getInstance('mailing_zip') == false){
			valid = false;
			err_msg += 'Mailing Zip is Missing<br>';
		}

		if(this.getInstance('telephone') == false){
			valid = false;
			err_msg += 'Telephone is Missing<br>';
		}

		if(this.getInstance('email') == false){
			valid = false;
			err_msg += 'Email is Missing<br>';
		}
		
		if(valid == false){
			$('error_msg').style.display = 'block';
			$('errorMsg').innerHTML = err_msg;
		}
		
		return valid;
		
	},
	
	getInstance: function(obj){
		if($(obj).value){
			return true;
		}
		return false;
	}
	
}
