<!-- Begin all scripts

// ===================================
// EZregister.com - Javascript Library
// ===================================


function cornersRound(id,rad_top,rad_bottom){

	settings = 
	{
	tl: { radius: rad_top },
	tr: { radius: rad_top },
	bl: { radius: rad_bottom },
	br: { radius: rad_bottom },
	antiAlias: true,
	autoPad: false
    }

    var cornersRoundObj = new curvyCorners(settings, document.getElementById(id));
    cornersRoundObj.applyCornersToAll();
	
	var cornersRoundObj = null; 

} 


// page loading with round corners
function page_loading_round(){

	// round corners
	cornersRound('curvyDiv','14','14');
	
	// hide page loading message
	document.getElementById('page_loading').style.display = 'none';
	document.getElementById('page_body').style.display = 'block';

}


// page loading with square corners
function page_loading_square(){

	// hide page loading message
	document.getElementById('page_loading').style.display = 'none';
	document.getElementById('page_body').style.display = 'block';

}


// function to reset the hit counter
function ResetHitCounter(){
	cmsg = "Are you sure you want to reset the page views?  This will set the number back to zero.";
	if (confirm(cmsg)) {
	document.getElementById('form1').submit();
	}
}
// end function


// function to clear question selections
function ClearQuestions(){
var re= new RegExp('question_');
var elems = document.getElementsByTagName('*'), i=0, el;
	while(el=elems[i++]){
		
		//var type = form1.elements[i].type;
		
		if(el.id.match(re)){
			
		var type = document.getElementById(el.id).type;
		
		// clear radio buttons
		if(type == "radio"){
		document.getElementById(el.id).checked = false;
		}
		
		// clear check boxes
		if(type == "checkbox"){
		document.getElementById(el.id).checked = false;
		}
		
		// reset drop lists
		if(type == "select-one"){
		document.getElementById(el.id).selectedIndex = 0;
		}
		
		/*
		// clear text fields
		if(type == "text"){
		document.getElementById(el.id).value = '';
		}
		
		// clear text fields
		if(type == "textarea"){
		document.getElementById(el.id).value = '';
		}
		*/
		
			
		// for testing only
		//alert(el.id + " " + type);
		}
	}
}	
// end function


// function to clear purchase selections
function ClearPurchases(){
var re= new RegExp('transaction_');
var elems = document.getElementsByTagName('*'), i=0, el;
	while(el=elems[i++]){
		
		//var type = form1.elements[i].type;
		
		if(el.id.match(re)){
			
		var type = document.getElementById(el.id).type;
		
		// clear radio buttons (multiple choice registrations)
		if(type == "radio"){
		document.getElementById(el.id).checked = false;
		}
		
		// clear check boxes (payments)
		if(type == "checkbox"){
		document.getElementById(el.id).checked = false;
		}
		
		// reset drop lists (tickets)
		if(type == "select-one"){
		document.getElementById(el.id).selectedIndex = 0;
		}
		
		// clear text fields (donations)
		if(type == "text"){
		document.getElementById(el.id).value = '';
		}
			
		// for testing only
		//alert(el.id + " " + type);
		}
	}
}	
// end function


// purchase countdown
function countdown(element,minutes,seconds) {
	var interval = setInterval(function() {
		var el = document.getElementById(element);
		if(seconds == 0) {
			if(minutes == 0) {
				el.innerHTML = "no more time";                    
				clearInterval(interval);
				alert('time is up');
				
				// show time messages
				document.getElementById('time_remaining').style.display = 'none';
				document.getElementById('time_expired').style.display = 'block';
				document.getElementById('submit_form').disabled = true; 
				return;
				
			} else {
				minutes--;
				seconds = 60;
			}
		}
		if(minutes > 0) {
			var minute_text = minutes + (minutes > 1 ? ' minutes' : ' minute');
		} else {
			var minute_text = '';
		}
		var second_text = seconds > 1 ? 'seconds' : 'second';
		el.innerHTML = minute_text + ' ' + seconds + ' ' + second_text;
		seconds--;
	}, 1000);
}
// end function


// preview warning
function PreviewWarning(){
	
	var warning_message = "Your event preview will appear in a seperate window.\n\n If you have a pop up blocker you will need to turn it off to preview your event";
	alert(warning_message);
}
// end function


// invoice warning
function InvoiceWarning(){
	
	var warning_message = "Your invoice will appear in a seperate window.\n\n If you have a pop up blocker you will need to turn it off to view your invoice";
	alert(warning_message);
}
// end function


// preview
function Preview(url){
	
	var warning_message = "Your event preview will appear in a seperate window.\n\n If you have a pop up blocker you will need to turn it off to preview your event";
	alert(warning_message);
	
	window.open(url);		
	
}
// end function


// clear payment method
function ClearPaymentMethod(){
	
	if(document.getElementById('payment_method1')){
	document.getElementById('payment_method1').checked = false;
	}
	
	if(document.getElementById('payment_method2')){
	document.getElementById('payment_method2').checked = false;
	}
	
	if(document.getElementById('payment_method3')){
	document.getElementById('payment_method3').checked = false;
	}
	
	return false;
}
// end function


// cancel warning
function CancelWarning(saved,url){
	
	if(saved != "yes"){
	
		var warning_message = "You have not saved changes on this page.\n\nAre you sure you want to continue?\n\nSelect OK to proceed without saving changes.\n\nSelect Cancel to stay on this page and save changes.";
		
			cmsg = warning_message;
			if(!(confirm(cmsg))) {
			return false;		
			} else {
			window.location.href = url;
			}
		
	} else {
	window.location.href = url;
	}
}
// end function


// nav warning
function NavWarning(event_id,submission_type,saved,url){
	
	if((event_id == '') || (submission_type == 'copy')){
	alert ("\nERROR\n\nAn event ID has not been created.\n\nYou must save the event information page before proceeding.");
	return false;
	}
	
	
	if(saved != "yes"){
	
		var warning_message = "You have not saved changes on this page.\n\nAre you sure you want to continue?\n\nSelect OK to proceed without saving changes.\n\nSelect Cancel to stay on this page and save changes.";
		
			cmsg = warning_message;
			if(!(confirm(cmsg))) {
			return false;		
			} else {
			
				if(submission_type == "invoice"){
				// open in new window for invoices
				window.open(url);		
				} else {
				// open in same window for all others
				window.location.href = url;
				}
			
			}
		
	} else {
	
		if(submission_type == "invoice"){
		// open in new window for invoices
		window.open(url);		
		} else {
		// open in same window for all others
		window.location.href = url;
		}
	
	}
}
// end function


// unpublish
function publish_event(action){
	
	if(action == "unpublish"){
		var warning_message = "Are you sure you want to unpublish this event?\n\nWARNING\n\nThis option will close the event page and associated registration pages\nto all registrants until the event is published again.";
		
		cmsg = warning_message;
		if(!(confirm(cmsg))) {
		return false;		
		} else {
		document.getElementById('published').value = 'no';
		document.getElementById('form1').submit();
		}
	} else {
	document.getElementById('published').value = 'yes';
	document.getElementById('form1').submit();
	}
}
// end function


// switch cover image
function SwitchCoverImage(show_image){
	
	document.getElementById('cover_image_0').style.display = 'none';
	document.getElementById('cover_image_1').style.display = 'none';
	document.getElementById('cover_image_2').style.display = 'none';
	document.getElementById('cover_image_3').style.display = 'none';
	document.getElementById('cover_image_4').style.display = 'none';
	document.getElementById('cover_image_5').style.display = 'none';
	
	document.getElementById(show_image).style.display = 'block';
	
}
// end function


// url form handler
function goto_URL(object) {
window.location.href = object.options[object.selectedIndex].value;
}
// end function


// include event header input
function IncludeCustomHeader(){

	if (document.getElementById('include_custom_header').checked==true) {
	document.getElementById('include_custom_header_table').style.display = 'block';
	} else {
	document.getElementById('include_custom_header_table').style.display = 'none';
	}
}
// end function


// include event header input
function IncludeCustomFooter(){

	if (document.getElementById('include_custom_footer').checked==true) {
	document.getElementById('include_custom_footer_table').style.display = 'block';
	} else {
	document.getElementById('include_custom_footer_table').style.display = 'none';
	}
}
// end function


// calulator currency selection
function CalculatorCurrency(){
	
	var object = document.getElementById('event_currency');
	var event_currency = object.options[object.selectedIndex].value;
	var currency_symbol = '';
		
		if(event_currency == "AUD"){
		document.getElementById('display_fees').innerHTML = '(3.9 percent of the registrant payment amount plus $0.30 AUD per transaction)';
		currency_symbol = '$';
		
		} else if(event_currency == "CAD"){
		document.getElementById('display_fees').innerHTML = '(3.9 percent of the registrant payment amount plus $0.30 CAD per transaction)';
		currency_symbol = '$';
		
		} else if(event_currency == "EUR"){
		document.getElementById('display_fees').innerHTML = '(3.9 percent of the registrant payment amount plus €0.35 EUR per transaction)';
		currency_symbol = '€';
		
		} else if(event_currency == "GBP"){
		document.getElementById('display_fees').innerHTML = '(3.9 percent of the registrant payment amount plus £0.20 GBP per transaction)';
		currency_symbol = '£';
		
		} else if(event_currency == "NZD"){
		document.getElementById('display_fees').innerHTML = '(3.9 percent of the registrant payment amount plus $0.45 NZD per transaction)';
		currency_symbol = '$';
		
		} else if(event_currency == "USD"){
		document.getElementById('display_fees').innerHTML = '(2.9 percent of the registrant payment amount plus $0.30 USD per transaction)';
		currency_symbol = '$';
		}

	document.getElementById('currency_selected1').innerHTML = currency_symbol;
	document.getElementById('currency_selected2').innerHTML = currency_symbol;
	document.getElementById('currency_selected3').innerHTML = currency_symbol;
	document.getElementById('currency_selected4').innerHTML = currency_symbol;
	document.getElementById('currency_selected5').innerHTML = currency_symbol;
	document.getElementById('currency_selected6').innerHTML = currency_symbol;
	document.getElementById('currency_selected7').innerHTML = currency_symbol;
}
// end function


// password protection
function passwordProtect(){
	
	// turn field on
	if(document.getElementById('password_protect').checked==true){
	document.getElementById('event_password').className='loginFormOn';
	document.getElementById('event_password').style.color='#CCCCCC';
	document.getElementById('event_password').value = 'Enter Password';
	document.getElementById('event_password').disabled = false; 
	
	// turn field off
	} else if(document.getElementById('password_protect').checked==false){
	document.getElementById('event_password').value = '';
	document.getElementById('event_password').className='loginFormOff';
	document.getElementById('event_password').disabled = true; 
	}

}
// end function


// promoter information
function PromoterForm(){
	
	document.getElementById('promoter_name').style.background='#FFFFFF';
	document.getElementById('promoter_name').disabled = false;
	document.getElementById('promoter_name').value = '';
	
	document.getElementById('promoter_description').style.background='#FFFFFF';
	document.getElementById('promoter_description').disabled = false;
	document.getElementById('promoter_description').value = '';
	
}
// end function


// promoter information reset
function PromoterFormReset(){
	
	document.getElementById('promoter_name').style.background='#A8C5E6';
	document.getElementById('promoter_name').disabled = true;
	
	document.getElementById('promoter_description').style.background='#A8C5E6';
	document.getElementById('promoter_description').disabled = true;
	
}
// end function


function showFeePercent() {
	var	selection = document.getElementById('ezregister_fee_payer').selectedIndex;
	if (selection == "3"){
	document.getElementById('fee_payer_percent').style.display = 'block';
	document.getElementById('promoter_percent_ez').value = '';
	} else {
	document.getElementById('fee_payer_percent').style.display = 'none';
	document.getElementById('promoter_percent_ez').value = '';
	}
}
// end function


function selectCurrency() {
	
	var	selection = document.getElementById('currency').selectedIndex;
	
	if (selection == "1"){
	document.getElementById('currency_symbol_1').innerHTML = '$';
	document.getElementById('currency_symbol_2').innerHTML = '$';
	document.getElementById('currency_symbol_3').innerHTML = '$';
	document.getElementById('currency_symbol_4').innerHTML = '$';
	document.getElementById('currency_symbol_5').innerHTML = '$';
	document.getElementById('currency_symbol_6').innerHTML = '$';
	} else if(selection == "2"){
	document.getElementById('currency_symbol_1').innerHTML = '$';
	document.getElementById('currency_symbol_2').innerHTML = '$';
	document.getElementById('currency_symbol_3').innerHTML = '$';
	document.getElementById('currency_symbol_4').innerHTML = '$';
	document.getElementById('currency_symbol_5').innerHTML = '$';
	document.getElementById('currency_symbol_6').innerHTML = '$';
	} else if(selection == "3"){
	document.getElementById('currency_symbol_1').innerHTML = '&euro;';
	document.getElementById('currency_symbol_2').innerHTML = '&euro;';
	document.getElementById('currency_symbol_3').innerHTML = '&euro;';
	document.getElementById('currency_symbol_4').innerHTML = '&euro;';
	document.getElementById('currency_symbol_5').innerHTML = '&euro;';
	document.getElementById('currency_symbol_6').innerHTML = '&euro;';
	} else if(selection == "4"){
	document.getElementById('currency_symbol_1').innerHTML = '&pound;';
	document.getElementById('currency_symbol_2').innerHTML = '&pound;';
	document.getElementById('currency_symbol_3').innerHTML = '&pound;';
	document.getElementById('currency_symbol_4').innerHTML = '&pound;';
	document.getElementById('currency_symbol_5').innerHTML = '&pound;';
	document.getElementById('currency_symbol_6').innerHTML = '&pound;';
	} else if(selection == "5"){
	document.getElementById('currency_symbol_1').innerHTML = '$';
	document.getElementById('currency_symbol_2').innerHTML = '$';
	document.getElementById('currency_symbol_3').innerHTML = '$';
	document.getElementById('currency_symbol_4').innerHTML = '$';
	document.getElementById('currency_symbol_5').innerHTML = '$';
	document.getElementById('currency_symbol_6').innerHTML = '$';
	}
}
// end function


function validateFees(){
	
	var	fee_payer_selected = document.getElementById('ezregister_fee_payer').selectedIndex;
	var	currency_selected = document.getElementById('event_currency').selectedIndex;
	
	if (currency_selected == "0"){
	alert("ERROR: Select a currency");
	return false;
	}
	
	if (document.getElementById('payment_amount').value == ''){
	alert("ERROR: Enter a transaction amount");
	return false;
	}
	
	if (isNaN(document.getElementById('payment_amount').value)){
	alert("ERROR: Numbers only in transaction amount");
	return false;
	}
	
	if (document.getElementById('payment_amount').value < 0){
	alert("ERROR: Enter transaction amount must be a positive number");
	return false;
	}
	
	if (fee_payer_selected == "0"){
	alert("ERROR: Select a fee payer");
	return false;
	}
		
	if (fee_payer_selected == "3"){
		if(document.getElementById('promoter_percent_ez').value == ''){
		alert ("ERROR: Enter a percent value");
		return false;
		}
		
		if (isNaN(document.getElementById('promoter_percent_ez').value)){
		alert("ERROR: Numbers only in percent value");
		return false;
		}
		
		if (document.getElementById('promoter_percent_ez').value > 100 || document.getElementById('promoter_fee_percent').value < 0){
		alert ("ERROR: percent value must be between 0 and 100");
		return false;
		}
	}
}
// end function


function AutoFill(login_member_id,first_name,last_name,company,job_title,address,city,state,state_other,zip_code,country,country_other,email_address,phone,gender,age){

	// checked
	if(document.getElementById('autofill').checked==true){
	
		if(document.getElementById('first_name')){
		document.getElementById('first_name').value = first_name;
		}
		
		if(document.getElementById('last_name')){
		document.getElementById('last_name').value = last_name;
		}
		
		if(document.getElementById('company')){
		document.getElementById('company').value = company;
		}
		
		if(document.getElementById('job_title')){
		document.getElementById('job_title').value = job_title;
		}
		
		if(document.getElementById('address')){
		document.getElementById('address').value = address;
		}
		
		if(document.getElementById('city')){
		document.getElementById('city').value = city;
		}
		
		if(document.getElementById('state')){
			var indexVal = document.getElementById('state').length;
			for(x=0; x<indexVal;x++) {
				if (document.getElementById('state').options[x].value == state) {
				document.getElementById('state').selectedIndex = x;
				}
			}
			
			if(state == 'other'){
			document.getElementById('state_other_display').style.display = 'block';
			document.getElementById('state_other').value = state_other;
			}
		}
		
		if(document.getElementById('zip_code')){
		document.getElementById('zip_code').value =  zip_code;
		}
		
		if(document.getElementById('country')){
			var indexVal = document.getElementById('country').length;
			for(x=0; x<indexVal;x++) {
				if (document.getElementById('country').options[x].value == country) {
				document.getElementById('country').selectedIndex = x;
				}
			}
			
			if(country == 'other'){
			document.getElementById('country_other_display').style.display = 'block';
			document.getElementById('country_other').value = country_other;
			}
		}
		
		if(document.getElementById('email_address')){
		document.getElementById('email_address').value = email_address;
		}
		
		if(document.getElementById('phone')){
		document.getElementById('phone').value = phone;
		}
		
		if(document.getElementById('gender_male')){
			if(gender == "male"){
			document.getElementById('gender_male').checked = true;
			}
		}
		
		if(document.getElementById('gender_female')){
			if(gender == "female"){
			document.getElementById('gender_female').checked = true;
			}
		}
		
		if(document.getElementById('age')){
		document.getElementById('age').value = age;
		}
	
	// unchecked
	} else {
		
		if(document.getElementById('first_name')){
		document.getElementById('first_name').value = "";
		}
		
		if(document.getElementById('last_name')){
		document.getElementById('last_name').value = "";
		}
		
		if(document.getElementById('company')){
		document.getElementById('company').value = "";
		}
		
		if(document.getElementById('job_title')){
		document.getElementById('job_title').value = "";
		}
		
		if(document.getElementById('address')){
		document.getElementById('address').value = "";
		}
		
		if(document.getElementById('city')){
		document.getElementById('city').value = "";
		}
		
		if(document.getElementById('state')){
		document.getElementById('state').selectedIndex = 0;
		
		document.getElementById('state_other').value = '';
		document.getElementById('state_other_display').style.display = 'none';
		}
		
		if(document.getElementById('zip_code')){
		document.getElementById('zip_code').value =  "";
		}
		
		if(document.getElementById('country')){
		document.getElementById('country').selectedIndex = 0;
		
		document.getElementById('country_other').value = '';
		document.getElementById('country_other_display').style.display = 'none';
		
		}
		
		if(document.getElementById('email_address')){
		document.getElementById('email_address').value = "";
		document.getElementById('email_address_confirm').value = "";
		}
		
		if(document.getElementById('phone')){
		document.getElementById('phone').value = "";
		}
		
		if(document.getElementById('gender_male')){
		document.getElementById('gender_male').checked = false;
		}
		
		if(document.getElementById('gender_female')){
		document.getElementById('gender_female').checked = false;
		}
		
		if(document.getElementById('age')){
		document.getElementById('age').value = "";
		}
	}

}
// end function



function AutoFillPaymentOptions(first_name,last_name,company,address,city,state,zip_code,country,email_address){
	//document.form1.reset();
	
	// checked state
	
	//if (document.getElementById('same_box').value == '') {
	if (document.getElementById('same_box').checked==true) {
		
		if(document.getElementById('receiver_first_name')){
		document.getElementById('receiver_first_name').value = first_name;
		}
		if(document.getElementById('receiver_last_name')){
		document.getElementById('receiver_last_name').value = last_name;
		}
		if(document.getElementById('receiver_company')){
		document.getElementById('receiver_company').value = company;
		}
		if(document.getElementById('receiver_payable')){
		
			// use company name if available otherwise just use name
			if(company != ''){
			document.getElementById('receiver_payable').value = company;
			} else {
			document.getElementById('receiver_payable').value = first_name + ' ' + last_name;
			}
		
		}
		if(document.getElementById('receiver_address')){
		document.getElementById('receiver_address').value = address;
		}
		if(document.getElementById('receiver_city')){
		document.getElementById('receiver_city').value = city;
		}
		
		//document.getElementById('state').value = "";
		
		if(document.getElementById('receiver_zip_code')){
		document.getElementById('receiver_zip_code').value =  zip_code;
		}
		
		//document.getElementById('country').value = "";
		
		if(document.getElementById('receiver_email')){
		document.getElementById('receiver_email').value = email_address;
		}
		
		// reset box value to no for unchecked state
		document.getElementById('same_box').value = 'yes';
	
	//} else if(document.getElementById('same_box').value == 'yes'){
	} else if(document.getElementById('same_box').checked==false){
		
		if(document.getElementById('receiver_first_name')){
		document.getElementById('receiver_first_name').value = '';
		}
		if(document.getElementById('receiver_last_name')){
		document.getElementById('receiver_last_name').value = '';
		}
		if(document.getElementById('receiver_company')){
		document.getElementById('receiver_company').value = '';
		}
		if(document.getElementById('receiver_payable')){
		document.getElementById('receiver_payable').value = '';
		}
		if(document.getElementById('receiver_address')){
		document.getElementById('receiver_address').value = '';
		}
		if(document.getElementById('receiver_city')){
		document.getElementById('receiver_city').value = '';
		}
		
		//document.getElementById('state').value = "";
		
		if(document.getElementById('receiver_zip_code')){
		document.getElementById('receiver_zip_code').value = '';
		}
		
		//document.getElementById('country').value = "";
		
		if(document.getElementById('receiver_email')){
		document.getElementById('receiver_email').value = '';
		}
		
		// reset box value to no for unchecked state
		document.getElementById('same_box').value = 'no';

	}
	
}
// end function


function AutoFillPromoter(first_name,last_name,company,address,city,state,state_other,zip_code,country,country_other,email_address,phone){
	
	// checked
	if (document.getElementById('same_box').checked==true) {
		
		document.getElementById('promoter_first_name').value = first_name;
		document.getElementById('promoter_last_name').value = last_name;
		document.getElementById('promoter_company').value = company;
		
			// use company name if available otherwise just use name
			if(company != ''){
			document.getElementById('promoter_payable').value = company;
			} else {
			document.getElementById('promoter_payable').value = first_name + " " + " " + last_name;
			}
		
		document.getElementById('promoter_address').value = address;
		document.getElementById('promoter_city').value = city;
		
		var indexVal = document.getElementById('promoter_state').length;
		for(x=0; x<indexVal;x++) {
			if (document.getElementById('promoter_state').options[x].value == state) {
			document.getElementById('promoter_state').selectedIndex = x;
			}
		}
		
		if(state == 'other'){
		document.getElementById('promoter_state_other_display').style.display = 'block';
		document.getElementById('promoter_state_other').value = state_other;
		}
		
		document.getElementById('promoter_zip_code').value =  zip_code;
		
		var indexVal = document.getElementById('promoter_country').length;
		for(x=0; x<indexVal;x++) {
			if (document.getElementById('promoter_country').options[x].value == country) {
			document.getElementById('promoter_country').selectedIndex = x;
			}
		}
		
		if(country == 'other'){
		document.getElementById('promoter_country_other_display').style.display = 'block';
		document.getElementById('promoter_country_other').value = country_other;
		}
		
		document.getElementById('promoter_email').value = email_address;
		document.getElementById('promoter_phone').value = phone;
	
	// unchecked
	} else {
		
		document.getElementById('promoter_first_name').value = '';
		document.getElementById('promoter_last_name').value = '';
		document.getElementById('promoter_company').value = '';
		document.getElementById('promoter_payable').value = '';
		document.getElementById('promoter_address').value = '';
		document.getElementById('promoter_city').value = '';
		document.getElementById('promoter_state').selectedIndex = 0;
		document.getElementById('promoter_state_other').value = '';
		document.getElementById('promoter_state_other_display').style.display = 'none';
		
		document.getElementById('promoter_zip_code').value = '';
		document.getElementById('promoter_country').selectedIndex = 0;
		document.getElementById('promoter_country_other').value = '';
		document.getElementById('promoter_country_other_display').style.display = 'none';
		
		document.getElementById('promoter_email').value = '';
		document.getElementById('promoter_phone').value = '';
	}
	
}
// end function


// navigation links

	function GoTo(page,saved,event_id,submission_type) {
		
		var warning_message = "You have not saved changes on this page.\n\nAre you sure you want to continue?\n\nSelect OK to proceed without saving changes.\n\nSelect Cancel to stay on this page and save changes.";
		
		if((event_id == '') || (submission_type == 'copy')){
		alert ("\nERROR\n\nAn event ID has not been created.\n\nYou must save the form from the information page before proceeding.");
		} else {
			if (page == "event") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/event/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/event/?event_id=" + event_id + "&submission_type=edit";
				}
				
			} else if (page == "promoter") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/promoter/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/promoter/?event_id=" + event_id + "&submission_type=edit";
				}
				
			} else if (page == "registration") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/registration/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/registration/?event_id=" + event_id + "&submission_type=edit";
				}
				
			} else if (page == "payment") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/payment/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/payment/?event_id=" + event_id + "&submission_type=edit";
				}
			
			} else if (page == "transactions") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/transactions/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/transactions/?event_id=" + event_id + "&submission_type=edit";
				}
			
			} else if (page == "questions") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/questions/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/questions/?event_id=" + event_id + "&submission_type=edit";
				}
				
			} else if (page == "styles") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/styles/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/styles/?event_id=" + event_id + "&submission_type=edit";
				}
				
			} else if (page == "preview_temp") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.open('http://ezregister.com/events/?event_id=' + event_id + '&version=temp&preview=yes');		
					}
				} else {
					window.open('http://ezregister.com/events/?event_id=' + event_id + '&version=temp&preview=yes');		
				}
				
			} else if (page == "publish") {
				if (saved != "yes") {
					cmsg = warning_message;
					if (confirm(cmsg)) {
						window.location="http://ezregister.com/event_edit/publish/?event_id=" + event_id + "&submission_type=edit";
					}
				} else {
					window.location="http://ezregister.com/event_edit/publish/?event_id=" + event_id + "&submission_type=edit";
				}
			}
		}
	}
	// end function

// end navigation links



function AddEvent() {
	// go to publish page
	window.location = "http://ezregister.com/event_edit/event/?submission_type=new";
}
// end function


function NoSubmit() {
alert ("The form was not submitted because this event has not been published or this is a preview only version.\nOnly live published versions of the registration form wll be submitted.");
}
// end function


// highlight link
function Highlight(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
// end function


// option handler (for questions)
function do_questions(question_type,object_id) {
	
	var question_type_id = "question_type" + object_id;
	var selection = document.getElementById(question_type_id).selectedIndex;
	var submit_button = "submit_button" + object_id;
		
	if (question_type != "") {
		
		// give warning if question is changed to a single field type
		if ((selection == "0") ||  (selection == "1") || (selection == "2")) {
			
			cmsg = "Are you sure you want to change the question to a single field type?\n\nWARNING: Any previously associated answer choices for this question will be deleted.";
			if (confirm(cmsg)) {
				
				// assign values to the submit button depending on choice selected
				if ((selection == "0") || (selection == "1") || (selection == "2")) {
				document.getElementById(submit_button).value = 'Save';
				} else if ((selection == "3") || (selection == "4") || (selection == "5")) {
				document.getElementById(submit_button).value = 'Next >>';
				}
				
			} else {
				
				// otherwise just keep list selected state from the original value
				if (question_type == 'textfield') {
				document.getElementById(question_type_id).selectedIndex = 1;
				} else if (question_type == 'textarea') {
				document.getElementById(question_type_id).selectedIndex = 2;
				} else if (question_type == 'radio') {
				document.getElementById(question_type_id).selectedIndex = 3;
				} else if (question_type == 'list') {
				document.getElementById(question_type_id).selectedIndex = 4;
				} else if (question_type == 'checkbox') {
				document.getElementById(question_type_id).selectedIndex = 5;
				}				
			}
			
		} else {
			
			if ((selection == "0") || (selection == "1") || (selection == "2")) {
			document.getElementById(submit_button).value = 'Save';
			} else if ((selection == "3") || (selection == "4") || (selection == "5")) {
			alert ("Define multiple choice answers for this question on next page.");
			document.getElementById(submit_button).value = 'Next >>';
			}
		}
		
	} else {
			
		// assign values to the submit button depending on choice selected
		if ((selection == "0") || (selection == "1") || (selection == "2")) {
		document.getElementById(submit_button).value = 'Add';
		} else if ((selection == "3") || (selection == "4") || (selection == "5")) {
		alert ("Define multiple choice answers for this question on next page.");
		document.getElementById(submit_button).value = 'Next >>';
		}
	}
}
// end function


// option handler (for transactions)
function do_transactions(transaction_type,object_id) {
	
	var transaction_type_id = "transaction_type" + object_id;
	var show_payment_options_id = "show_payment_options_" + object_id;
	var show_category_links_id = "show_category_links_" + object_id;
	var show_donation_option_id = "show_donation_option_" + object_id;
	var show_transaction_limit_id = "show_transaction_limit_" + object_id;
	var show_transaction_limit_none_id = "show_transaction_limit_none_" + object_id;
	var show_max_tickets_id = "show_max_tickets_" + object_id;
	

	var selection = document.getElementById(transaction_type_id).selectedIndex;
	var submit_button = "submit_button" + object_id;
		
	if (transaction_type != "") {
		
		// for edit fields
		// give warning if transaction is changed to a single field type
		if (((transaction_type == "registration")) && ((selection == "2") || (selection == "3") || (selection == "4"))) {
			
			cmsg = "NOTICE: Are you sure you want to change the transaction to a single field type?\n\nWARNING: Any previously associated categories for this transaction will be deleted.";
			if (confirm(cmsg)) {
				
				// assign values to the submit button depending on choice selected
				if (selection == "0") {
				document.getElementById(submit_button).value = 'Save';
				document.getElementById(show_payment_options_id).style.display = 'block';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'none';
				document.getElementById(show_transaction_limit_none_id).style.display = 'none';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				
				} else if (selection == "1") {
				alert ("NOTICE: A multiple choice transaction type allows registrants to choose from a list of possible registration categories.  Define categories and limits with each category on next page.");
				document.getElementById(submit_button).value = 'Next >>';
				document.getElementById(show_category_links_id).style.display = 'block';
				document.getElementById(show_payment_options_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'none';
				document.getElementById(show_transaction_limit_none_id).style.display = 'block';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				
				} else if (selection == "2") {
				alert ("NOTICE: A ticket transaction type allows registrants to select multiple tickets from 1 to the maximum ticket order.");
				document.getElementById(submit_button).value = 'Save';
				document.getElementById(show_payment_options_id).style.display = 'block';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'block';
				document.getElementById(show_transaction_limit_none_id).style.display = 'none';
				document.getElementById(show_max_tickets_id).style.display = 'block';
				
				} else if (selection == "3") {
				alert ("NOTICE: Donations are set as an undefined blank amount to be determined by the registrant.\n\nIf you wish to collect a set amount choose the ticket or payment type instead.");
				document.getElementById(submit_button).value = 'Save';
				document.getElementById(show_donation_option_id).style.display = 'block';
				document.getElementById(show_payment_options_id).style.display = 'none';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'none';
				document.getElementById(show_transaction_limit_none_id).style.display = 'block';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				
				} else if (selection == "4") {
				alert ("NOTICE: A payment transaction type allows registrants to pay a set amount for a single purchase only such as selling an item, membership, or subscription.  If you want to collect a user defined amount or for multiple items then choose the donation or ticket type instead.");
				document.getElementById(submit_button).value = 'Save';
				document.getElementById(show_payment_options_id).style.display = 'block';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'block';
				document.getElementById(show_transaction_limit_none_id).style.display = 'none';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				}
				
			} else {
				
				// otherwise just keep list selected state from the original value
				if (transaction_type == 'registration') {
				document.getElementById(transaction_type_id).selectedIndex = 1;
				document.getElementById(show_category_links_id).style.display = 'block';
				document.getElementById(show_payment_options_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'none';
				document.getElementById(show_transaction_limit_none_id).style.display = 'block';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				
				} else if (transaction_type == 'ticket') {
				document.getElementById(transaction_type_id).selectedIndex = 2;
				document.getElementById(show_payment_options_id).style.display = 'block';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'block';
				document.getElementById(show_transaction_limit_none_id).style.display = 'none';
				document.getElementById(show_max_tickets_id).style.display = 'block';
				
				} else if (transaction_type == 'donation') {
				document.getElementById(transaction_type_id).selectedIndex = 3;
				document.getElementById(show_donation_option_id).style.display = 'block';
				document.getElementById(show_payment_options_id).style.display = 'none';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'none';
				document.getElementById(show_transaction_limit_none_id).style.display = 'block';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				
				} else if (transaction_type == 'payment') {
				document.getElementById(transaction_type_id).selectedIndex = 4;
				document.getElementById(show_payment_options_id).style.display = 'block';
				document.getElementById(show_category_links_id).style.display = 'none';
				document.getElementById(show_donation_option_id).style.display = 'none';
				document.getElementById(show_transaction_limit_id).style.display = 'block';
				document.getElementById(show_transaction_limit_none_id).style.display = 'none';
				document.getElementById(show_max_tickets_id).style.display = 'none';
				}
			}
			
		} else {
			
			if (selection == "0") {
			document.getElementById(submit_button).value = 'Save';
			document.getElementById(show_payment_options_id).style.display = 'block';
			document.getElementById(show_category_links_id).style.display = 'none';
			document.getElementById(show_donation_option_id).style.display = 'none';
			document.getElementById(show_transaction_limit_id).style.display = 'none';
			document.getElementById(show_transaction_limit_none_id).style.display = 'none';
			document.getElementById(show_max_tickets_id).style.display = 'none';
			
			} else if ((selection == "1")) {
			alert ("NOTICE: A multiple choice transaction type allows registrants to choose from a list of possible registration categories.  Define categories and limits with each category on next page.");
			document.getElementById(submit_button).value = 'Next >>';
			document.getElementById(show_category_links_id).style.display = 'block';
			document.getElementById(show_payment_options_id).style.display = 'none';
			document.getElementById(show_donation_option_id).style.display = 'none';
			document.getElementById(show_transaction_limit_id).style.display = 'none';
			document.getElementById(show_transaction_limit_none_id).style.display = 'block';
			document.getElementById(show_max_tickets_id).style.display = 'none';
			
			} else if (selection == "2") {
			alert ("NOTICE: A ticket transaction type allows registrants to select multiple tickets from 1 to the maximum ticket order.");
			document.getElementById(submit_button).value = 'Save';
			document.getElementById(show_payment_options_id).style.display = 'block';
			document.getElementById(show_category_links_id).style.display = 'none';
			document.getElementById(show_donation_option_id).style.display = 'none';
			document.getElementById(show_transaction_limit_id).style.display = 'block';
			document.getElementById(show_transaction_limit_none_id).style.display = 'none';
			document.getElementById(show_max_tickets_id).style.display = 'block';
			
			} else if (selection == "3") {
			alert ("NOTICE: Donations are set as an undefined blank amount to be determined by the registrant.\n\nIf you wish to collect a set amount choose the ticket or payment type instead.");
			document.getElementById(submit_button).value = 'Save';
			document.getElementById(show_donation_option_id).style.display = 'block';
			document.getElementById(show_payment_options_id).style.display = 'none';
			document.getElementById(show_category_links_id).style.display = 'none';
			document.getElementById(show_transaction_limit_id).style.display = 'none';
			document.getElementById(show_transaction_limit_none_id).style.display = 'block';
			document.getElementById(show_max_tickets_id).style.display = 'none';
			
			} else if (selection == "4") {
			alert ("NOTICE: A payment transaction type allows registrants to pay a set amount for a single purchase only such as selling an item, membership, or subscription.  If you want to collect a user defined amount or for multiple items then choose the donation or ticket type instead.");
			document.getElementById(submit_button).value = 'Save';
			document.getElementById(show_payment_options_id).style.display = 'block';
			document.getElementById(show_category_links_id).style.display = 'none';
			document.getElementById(show_donation_option_id).style.display = 'none';
			document.getElementById(show_transaction_limit_id).style.display = 'block';
			document.getElementById(show_transaction_limit_none_id).style.display = 'none';
			document.getElementById(show_max_tickets_id).style.display = 'none';
			}
		}
		
	} else {
			
		// for add field
		// assign values to the submit button depending on choice selected
		if (selection == "0") {
		document.getElementById(submit_button).value = 'Add';
		document.getElementById('show_payment_options').style.display = 'block';
		document.getElementById('show_category_links').style.display = 'none';
		document.getElementById('show_donation_option').style.display = 'none';
		document.getElementById('show_transaction_limit_none').style.display = 'none';
		document.getElementById('show_transaction_limit').style.display = 'block';
		document.getElementById('show_max_tickets').style.display = 'none';
		
		} else if (selection == "1") {
		alert ("NOTICE: A multiple choice transaction type allows registrants to choose from a list of possible registration categories.  Define categories and limits with each category on next page.");
		document.getElementById(submit_button).value = 'Next >>';
		document.getElementById('show_category_links').style.display = 'block';
		document.getElementById('show_payment_options').style.display = 'none';
		document.getElementById('show_donation_option').style.display = 'none';
		document.getElementById('show_transaction_limit_none').style.display = 'block';
		document.getElementById('show_transaction_limit').style.display = 'none';
		document.getElementById('show_max_tickets').style.display = 'none';
		
		} else if (selection == "2") {
		alert ("NOTICE: A ticket transaction type allows registrants to select multiple tickets from 1 to the maximum ticket order.");
		document.getElementById(submit_button).value = 'Add';
		document.getElementById('show_payment_options').style.display = 'block';
		document.getElementById('show_category_links').style.display = 'none';
		document.getElementById('show_donation_option').style.display = 'none';
		document.getElementById('show_transaction_limit_none').style.display = 'none';
		document.getElementById('show_transaction_limit').style.display = 'block';
		document.getElementById('show_max_tickets').style.display = 'block';
		
		} else if (selection == "3") {
		alert ("NOTICE: Donations are set as an undefined blank amount to be determined by the registrant.  If you wish to collect a set amount choose the ticket or payment type instead.");
		document.getElementById(submit_button).value = 'Add';
		document.getElementById('show_donation_option').style.display = 'block';
		document.getElementById('show_payment_options').style.display = 'none';
		document.getElementById('show_category_links').style.display = 'none';
		document.getElementById('show_transaction_limit_none').style.display = 'block';
		document.getElementById('show_transaction_limit').style.display = 'none';
		document.getElementById('show_max_tickets').style.display = 'none';
		
		} else if (selection == "4") {
		alert ("NOTICE: A payment transaction type allows registrants to pay a set amount for a single purchase only such as selling an item, membership, or subscription.  If you want to collect a user defined amount or for multiple items then choose the donation or ticket type instead.");
		document.getElementById(submit_button).value = 'Add';
		document.getElementById('show_payment_options').style.display = 'block';
		document.getElementById('show_category_links').style.display = 'none';
		document.getElementById('show_donation_option').style.display = 'none';
		document.getElementById('show_transaction_limit_none').style.display = 'none';
		document.getElementById('show_transaction_limit').style.display = 'block';
		document.getElementById('show_max_tickets').style.display = 'none';
		}
	}
}
// end function


// event delete warning
function DeleteEvent(url){
	
	var warning_message = "Are you sure you want to delete this event?\n\nWARNING\n\nThis event can only be deleted if no paid transactions have been recorded.  Once it has been published and any payments have been collected the event can no longer be deleted.  To hide this event from public viewing, select unpublish instead.\n\nClick OK and continue to attempt deleting this event or click cancel to cancel this deletion attempt.";
	
	cmsg = warning_message;
	if(!(confirm(cmsg))){
	return false;		
	} else {
	window.location.href = url;
	}
}
// end function
	

// option handler (for my events admin droplist)
function do_option(object,i) {
	if (object.options[object.selectedIndex].value != '') {
		
	var location = object.options[object.selectedIndex].value;	
		
		// give warning message if option is delete
		if (object.options[object.selectedIndex].text == 'Delete') {
		
			answer = window.confirm('Are you sure you want to delete this event?\n\nWARNING\n\nThis event can only be deleted if no paid transactions have been recorded.  Once it has been published and any payments have been collected the event can no longer be deleted.  To hide this event from public viewing, select unpublish in the event management options droplist.\n\nClick OK and continue to attempt deleting this event or click cancel to cancel this deletion attempt.');			
		
			if (answer !=0){ 
			location = object.options[object.selectedIndex].value;
			window.location.href = object.options[object.selectedIndex].value;
			} else {
			// reset droplist
			document.getElementById('select_option'+i).selectedIndex = 0;
			}
		}
		
		// give warning message if option is unpublish
		else if (object.options[object.selectedIndex].text == 'Unpublish') {
		
			cmsg = "NOTICE: Are you sure you want to unpublish this event?\n\nWARNING\n\nThis option will remove the event from the publicly viewed list of events on the EZregister website.";
			if (confirm(cmsg)) {
			window.location.href = object.options[object.selectedIndex].value;
			} else {
			// reset droplist
			document.getElementById('select_option'+i).selectedIndex = 0;
			}
		}

		// open a new window if option is preview
		else if (object.options[object.selectedIndex].text == 'Preview'){
		window.open(object.options[object.selectedIndex].value);
		// reset droplist
		document.getElementById('select_option'+i).selectedIndex = 0;
		}
		
		else if (object.options[object.selectedIndex].text == 'Summary') {
		// reset droplist
		document.getElementById('select_option'+i).selectedIndex = 0;
		// open in greybox window
		return GB_showCenter('', location,500, 760);
		}
		
		else if (object.options[object.selectedIndex].text == 'Invoice') {
		// reset droplist
		document.getElementById('select_option'+i).selectedIndex = 0;
		// open in greybox window
		return GB_showCenter('', location,500, 760);
		}

		else {
		window.location.href = object.options[object.selectedIndex].value;
		// reset droplist
		document.getElementById('select_option'+i).selectedIndex = 0;
		}
	}
}
// end function



// popup richtext html editor
var currentTextArea = null
function openEditor(textarea) {

	// location of edit.php file:
	var editFile = 'edit.php';
	
	currentTextArea = textarea;
	
	width = 720;
	height = 450;

	winLeft = (screen.width-width)/2; 
	winTop = (screen.height-(height+110))/2; 

	var edit = window.open(editFile, 'editorWindow', 'width=720, height=450, left = "' + winLeft + '",top = "' + winTop + '"');
	edit.focus();
}
// end function



function SaveForm() {
	// submit the form
	document.getElementById('form1').submit();
	// disable buttons
	document.getElementById('save_form').disabled = true;
}
// end function



function ReportSubmit(report_format) {
	
	if(report_format == "excel"){
	document.getElementById('form1').target = "_self";	
	} else {
	document.getElementById('form1').target = "_blank";	
	}
	
	// assign value to report_format hidden field
	document.getElementById('report_format').value = report_format;
	document.getElementById('form1').submit();

}
// end function



function SortReport(order_selection) {
	// assign value to report_format hidden field
	document.getElementById('order_selection').value = order_selection;
	document.getElementById('report_format').value = 'html';
	document.getElementById('form1').submit();
}
// end function



function PublishSubmit() {
	// disable buttons
	document.getElementById('publish_submit').disabled = true;
	// submit the form
	document.getElementById('form1').submit();
}
// end function



function MoveSubmit(move_type,move_id,form_id) {
	// assign move_type
	document.getElementById(move_id).value = move_type;
	// submit the form
	document.getElementById(form_id).submit();
}
// end function


function RegistrationSelect() {
	
	if (document.getElementById('registration_select').value == 'Check All') {
		
		document.getElementById('company_include').checked = true;
		document.getElementById('company_required').checked = true;
		document.getElementById('job_title_include').checked = true;
		document.getElementById('job_title_required').checked = true;
		document.getElementById('mail_address_include').checked = true;
		document.getElementById('mail_address_required').checked = true;
		document.getElementById('phone_include').checked = true;
		document.getElementById('phone_required').checked = true;
		document.getElementById('gender_include').checked = true;
		document.getElementById('gender_required').checked = true;
		document.getElementById('age_include').checked = true;
		document.getElementById('age_required').checked = true;
		document.getElementById('guest_count_include').checked = true;
		document.getElementById('guest_count_required').checked = true;
		document.getElementById('comment_include').checked = true;
		
		document.getElementById('registration_select').value = 'Uncheck All';	
		
	} else if (document.getElementById('registration_select').value == 'Uncheck All') {
		
		document.getElementById('company_include').checked = false;
		document.getElementById('company_required').checked = false;
		document.getElementById('job_title_include').checked = false;
		document.getElementById('job_title_required').checked = false;
		document.getElementById('mail_address_include').checked = false;
		document.getElementById('mail_address_required').checked = false;
		document.getElementById('phone_include').checked = false;
		document.getElementById('phone_required').checked = false;
		document.getElementById('gender_include').checked = false;
		document.getElementById('gender_required').checked = false;
		document.getElementById('age_include').checked = false;
		document.getElementById('age_required').checked = false;
		document.getElementById('guest_count_include').checked = false;
		document.getElementById('guest_count_required').checked = false;
		document.getElementById('comment_include').checked = false;
		
		document.getElementById('registration_select').value = 'Check All';
	}
}
// end function


function ToggleSelect() {
	var inputs = document.getElementsByTagName('input');
	// check all
	if (document.getElementById('toggle_select').value == 'Check All'){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = true;
				}
			}
		}
	document.getElementById('toggle_select').value = 'Uncheck All';
	}
	
	// uncheck all
	else if (document.getElementById('toggle_select').value == 'Uncheck All'){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = false;
				}
			}
		}
	document.getElementById('toggle_select').value = 'Check All';
	}
	
}
// end function


function ReportCheckAll() {
	var inputs = document.getElementsByTagName('input');
	// check all
	if(document.getElementById('check_all').value == 'Check All'){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = true;
				}
			}
		}
	document.getElementById('check_all').value = 'Uncheck All';
	}
	
	// uncheck all
	else if(document.getElementById('check_all').value == 'Uncheck All'){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = false;
				}
			}
		}
	document.getElementById('check_all').value = 'Check All';
	}
	
}
// end function



function CheckAllReport() {
	var inputs = document.getElementsByTagName('input');
	// check all
	if ((document.getElementById('check_all_1').value == 'Check All') || (document.getElementById('check_all_2').value == 'Check All')){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = true;
				}
			}
		}
	document.getElementById('check_all_1').value = 'Uncheck All';
	document.getElementById('check_all_2').value = 'Uncheck All';
	}
	
	// uncheck all
	else if ((document.getElementById('check_all_1').value == 'Uncheck All') || (document.getElementById('check_all_2').value == 'Uncheck All')){

		for(var i=0; i<inputs.length; i++){
			if(inputs[i].getAttribute('type')=='checkbox'){
			// check all
				if(inputs[i].value != 'save_report'){
					inputs[i].checked = false;
				}
			}
		}
	document.getElementById('check_all_1').value = 'Check All';
	document.getElementById('check_all_2').value = 'Check All';
	}
	
}
// end function



function PopulateFees(processor_fee_percent,per_transaction_fee) {
	document.getElementById('processor_fee_percent').value = processor_fee_percent;
	document.getElementById('per_transaction_fee').value = per_transaction_fee;
}
// end function


function DeletePromoter(event_id,promoter_id) {
	cmsg = "Are you sure you want to delete this promoter?";
	if (confirm(cmsg)) {
	// go to delete page
	window.location="http://ezregister.com/event_edit/promoter/delete.php?promoter_id=" + promoter_id + "&event_id=" + event_id;
}
}
// end function


function DeleteMyPromoter(promoter_id) {
	
	cmsg = "Are you sure you want to delete this promoter?";
	if (confirm(cmsg)) {
	// go to delete page
	window.location="http://ezregister.com/my_promoters/delete/?promoter_id=" + promoter_id;
}
}
// end function



function DeleteRegistration(registration_id,url) {
	
	cmsg = "Are you sure you want to delete your order?\n\nRegistration ID# " + registration_id + "\n\nIf you are having trouble with the registration process please contact EZregister at 1-800-476-4895 for assistance.\n\nSelect OK to delete this order or Cancel to continue with this order.";
	if (confirm(cmsg)) {
	// go to delete page
	window.location.href = url;
	}
}
// end function

/*
function DeleteAdmin(member_id) {
	cmsg = "Are you sure you want to delete this administrator?\n";
	if(!(confirm(cmsg))){
	return false;		
	} else {
	document.getElementById('submission_type').value = 'delete';
	document.getElementById('delete_member_id').value = member_id;
	document.getElementById('form1').submit();
	}
}
// end function
*/

function DeleteAdmin(event_id,member_id) {
	cmsg = "Are you sure you want to delete this administrator?\n";
	if (confirm(cmsg)) {
	// go to delete page
	window.location="http://ezregister.com/event_edit/administrators/delete.php?event_id=" + event_id + "&member_id=" + member_id;
}
}
// end function

function NoDeleteAdmin(message){
	if(message == "self"){	
		alert('You cannot delete yourself from the administrators group, this action requires another administrator\n');
		return false;
	}
	else if(message == "last"){	
		alert('You cannot delete the last administrator, at least one administrator must remain on the account\n');
		return false;
	}
}
// end function


function DeleteQuestion(event_id,question_temp_id) {
	cmsg = "Are you sure you want to delete this question?\n\nWARNING: Any collected registration data for this question will also be deleted.\n\nInstead of deleting the question and losing any registrations you might consider hiding the answer from future registrants by unchecking the display box on the edit page.\n\nSelect OK if you still want to delete this question."
	if (confirm(cmsg)) {
	// go to delete page
	window.location="delete_question.php?event_id=" + event_id + "&question_temp_id=" + question_temp_id;
}
}
// end function



function DeleteChoice(event_id,question_temp_id,choice_temp_id) {
	cmsg = "Are you sure you want to delete this record?\nWARNING"
	if (confirm(cmsg)) {
	// go to delete page
	window.location="delete_choice.php?event_id=" + event_id + "&question_temp_id=" + question_temp_id + "&choice_temp_id=" + choice_temp_id;
}
}
// end function



function DeleteTransaction(event_id,transaction_temp_id) {
	cmsg = "Are you sure you want to delete this record?\nWARNING: All associated transaction categories will also be deleted"
	if (confirm(cmsg)) {
	// go to delete page
	window.location="delete_transaction.php?event_id=" + event_id + "&transaction_temp_id=" + transaction_temp_id;
}
}
// end function



function DeleteCategory(event_id,transaction_temp_id,category_temp_id) {
	cmsg = "Are you sure you want to delete this record?\nWARNING"
	if (confirm(cmsg)) {
	// go to delete page
	window.location="delete_category.php?event_id=" + event_id + "&transaction_temp_id=" + transaction_temp_id + "&category_temp_id=" + category_temp_id;
}
}
// end function



function QuestionSelection(event_id,answer_type,selection) {
	
	if (answer_type != "") {
		
		// respond to changing the answer to a single textfield with a warning
		if (((answer_type == "radio") || (answer_type == "list") || (answer_type == "checkbox")) && ((selection == "textfield") || (selection == "textarea"))) {
		cmsg = "Are you sure you want to change the answer type to a single field?\n\nWARNING: Any associated anwer choices to this question will also be deleted.";
			
			if (confirm(cmsg)) {
				
				// assign values to the submit button depending on choice selected
				if ((selection == "radio") || (selection == "list") || (selection == "checkbox")) {
				document.getElementById('submit_form').value = 'Next >>>';
				} else if ((selection == "textfield") || (selection == "textarea")) {
				document.getElementById('submit_form').value = 'Submit';
				}
				
			} else {
				
				// otherwise just keep button selected state from the original value
				if (answer_type == 'textfield') {
				document.form1.answer_type[0].checked = true;
				} else if (answer_type == 'textarea') {
				document.form1.answer_type[1].checked = true;
				} else if (answer_type == 'radio') {
				document.form1.answer_type[2].checked = true;
				} else if (answer_type == 'list') {
				document.form1.answer_type[3].checked = true;				
				} else if (answer_type == 'checkbox') {
				document.form1.answer_type[4].checked = true;
				}
			}
			
		} else {

			// assign values to the submit button depending on choice selected
			if ((selection == "radio") || (selection == "list") || (selection == "checkbox")) {
			document.getElementById('submit_form').value = 'Next >>>';
			} else if ((selection == "textfield") || (selection == "textarea")) {
			document.getElementById('submit_form').value = 'Submit';
			}
		}
		
	} else {

		// assign values to the submit button depending on choice selected
		if ((selection == "radio") || (selection == "list") || (selection == "checkbox")) {
		document.getElementById('submit_form').value = 'Next >>>';
		} else if ((selection == "textfield") || (selection == "textarea")) {
		document.getElementById('submit_form').value = 'Submit';
		}
	}
}
// end function




function toggle(obj1,obj2,button_value) {
	
	var last_edit = document.getElementById('last_edit').value;
		if (last_edit != "") {
		var last_el = document.getElementById(last_edit);
		last_el.style.display = 'none';
		}
	
	var last_output = document.getElementById('last_output').value;
		if (last_output != "") {
		var last_e2 = document.getElementById(last_output);
		last_e2.style.display = '';
		}
		

	var el = document.getElementById(obj1);
	var e2 = document.getElementById(obj2);

	if ( button_value == 'edit' ) {
		el.style.display = '';
		e2.style.display = 'none';
	}
	
	else if ( button_value == 'cancel' ) {
		el.style.display = 'none';
		e2.style.display = '';
	}
	
	document.getElementById('last_edit').value = obj1;
	document.getElementById('last_output').value = obj2;

}
// end function


function toggleTransactions(obj1,obj2,button_value) {
	
	var last_edit = document.getElementById('last_edit').value;
		if (last_edit != "") {
		var last_el = document.getElementById(last_edit);
		last_el.style.display = 'none';
		}
	
	var last_output = document.getElementById('last_output').value;
		if (last_output != "") {
		var last_e2 = document.getElementById(last_output);
		last_e2.style.display = '';
		}
		

	var el = document.getElementById(obj1);
	var e2 = document.getElementById(obj2);

	if ( button_value == 'edit' ) {
		el.style.display = '';
		e2.style.display = 'none';
	}
	
	else if ( button_value == 'cancel' ) {
		el.style.display = 'none';
		e2.style.display = '';
	}
	
	document.getElementById('last_edit').value = obj1;
	document.getElementById('last_output').value = obj2;

}
// end function




function CheckInclude(box) {
	
	id1 = box.id;
	id2 = id1.replace('_include', '_required');
	
	var box1 = document.getElementById(id1)
	var box2 = document.getElementById(id2)
	
	if (!box1.checked) {
	box2.checked = false;
	}
}
// end function



function CheckRequired(box) {
	
	id1 = box.id;
	id2 = id1.replace('_required', '_include');
	
	var box1 = document.getElementById(id2)
	var box2 = document.getElementById(id1)
	
	if (box2.checked) {
	box1.checked = true;
	}
}
// end function



function popUp(URL) {
day = new Date();
id = day.getTime();

width = 600;
height = 600;

winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+110))/2; 


eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=550,left = " + winLeft + ",top = " + winTop + "');");
}
// end function


function popUpFees(URL) {
day = new Date();
id = day.getTime();

width = 750;
height = 750;

winLeft = (screen.width-width)/2; 
winTop = (screen.height-(height+110))/2; 


eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=750,height=750,left = " + winLeft + ",top = " + winTop + "');");
}
// end function


function DisableUpload() {
	
	if (document.getElementById('delete_image').checked == true) {
		document.getElementById('file_1').disabled = true;
		document.getElementById('file_1').value = "";
	} else if (document.getElementById('delete_image').checked == false) {
		document.getElementById('file_1').disabled = false;
	}
}
// end function


// ============
// style picker
// ============
function selectStyle(style,val) {
	
	// make sure a radio button was selected
	for (var i=0; i < document.form1.select_style.length; i++) {
		if (document.form1.select_style[i].checked) {
		var id = i;
		var checked = "yes";
		} 
	}
   
   	// give error alert if no elements were selected
	if (checked != "yes") {
	alert ("ERROR\n\nPlease select an element from the radio button group.");
	}
	
	// get values from standard colors drop list if selected
	if (val == "standard_colors") {
	
		if (checked == "yes") {
			val = document.getElementById('standard_colors').value;
			
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
		}
	}
	
	// page background		
	if (id == 0) { // row 0
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=val; // sample box background
			document.getElementById("color_" + id).value = val;  // display form color input value
			document.getElementById("image_" + id).value = '';  // clear form image input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("eventPage").style.background=val; // page background
		}
		// image
		else if(style == "image") {
			image_url = "url(../../../images/backgrounds/" + val + ")";
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=image_url; // sample box background
			document.getElementById("image_" + id).value = val;  // display form image input value
			document.getElementById("color_" + id).value = '';  // clear form color input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("eventPage").style.background=image_url; // page background
		}
	}
	
	// page text
	if (id == 1) {
		// text color
		if(style == "color") {
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.color=val;
		}
		// text font
			if(style == "font_family") {
			val = document.getElementById("font_1").value;
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.fontFamily=val;
		}
		// text size
		if(style == "font_size") {
			val = document.getElementById("font_1_size").value;
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.fontSize=val;
		}
	}
	
	// links text
	if (id == 2) {
		var links = window.frames['preview_frame'].document.getElementById("eventPage").getElementsByTagName("a");
		// color
		if(style=="color") {
			for (var x = 0; x < links.length; x++) {
				links[x].style.color = val;
			}
			document.getElementById("sample_" + id).style.background=val; // sample box background
			document.getElementById("color_" + id).value=val;  // form color input value
		}
		// font family
		if(style=="font_family") {
			val = document.getElementById("font_2").value;
			for (var x = 0; x < links.length; x++) {
				links[x].style.fontFamily = val;
			}
		}
		// font size
		if(style=="font_size") {
			val = document.getElementById("font_2_size").value;
			for (var x = 0; x < links.length; x++) {
				links[x].style.fontSize = val;
			}
		}
	}
	
	// table background		
	if (id == 3) { // row 0
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=val; // sample box background
			document.getElementById("color_" + id).value = val;  // display form color input value
			document.getElementById("image_" + id).value = '';  // clear form image input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.background=val; // table background
		}
		// image
		else if(style == "image") {
			image_url = "url(../../../images/backgrounds/" + val + ")";
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=image_url; // sample box background
			document.getElementById("image_" + id).value = val;  // display form image input value
			document.getElementById("color_" + id).value = '';  // clear form color input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.background=image_url; // table background
		}
	}
	
	// table border
	if (id == 4) {
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderColor=val;
		}
		// style
		if(style == "border_style") {
			val = document.getElementById("border_4").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderStyle=val;
		}
		// size
		if(style == "border_size") {
			val = document.getElementById("border_4_size").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderWidth=val;
		}

	}
	
	// titlebar background		
	if (id == 5) { // row 0
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=val; // sample box background
			document.getElementById("color_" + id).value = val;  // display form color input value
			document.getElementById("image_" + id).value = '';  // clear form image input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.background=val; // page background
		}
		// image
		else if(style == "image") {
			image_url = "url(../../../images/backgrounds/" + val + ")";
			// assign the new value to the styles page selections
			document.getElementById("sample_" + id).style.background=image_url; // sample box background
			document.getElementById("image_" + id).value = val;  // display form image input value
			document.getElementById("color_" + id).value = '';  // clear form color input value
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.background=image_url; // page background
		}
	}
	
	// titlebar border
	if (id == 6) {
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderColor=val;
		}
		// style
		if(style == "border_style") {
			val = document.getElementById("border_6").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderStyle=val;
		}
		// size
		if(style == "border_size") {
			val = document.getElementById("border_6_size").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderWidth=val;
		}

	}
	
	// titlebar text
	if (id == 7) {
		// text color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.color=val;
		}
		// text font
			if(style == "font_family") {
			val = document.getElementById("font_7").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.fontFamily=val;
		}
		// text size
		if(style == "font_size") {
			val = document.getElementById("font_7_size").value;
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.fontSize=val;
		}
	}
	
	// divider border
	if (id == 8) {
		// color
		if(style == "color") {
			// assign the new value to the styles page selections
			document.getElementById("color_" + id).value = val;
			document.getElementById("sample_" + id).style.background=val;
			
			// assign the new value to the event preview iframe
			
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightColor=val;
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomColor=val;
			}
		}
		// style
		if(style == "border_style") {
			val = document.getElementById("border_8").value;
			
			// assign the new value to the event preview iframe
			
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightStyle=val;
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomStyle=val;
			}
		}
		// size
		if(style == "border_size") {
		val = document.getElementById("border_8_size").value;
		
			// assign the new value to the event preview iframe
			
			// assign the new value to the event preview iframe
			
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightWidth=val;
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomWidth=val;
			}
		}
	}

	// reset drop list
	document.getElementById('standard_colors').selectedIndex = 0;
}
// ================
// end style picker
// ================


function DefaultStyles() {
	
	// display all elements on the page to default settings
	if(document.getElementById("default_styles").checked == true){
		
		// event page background
		document.getElementById("color_0").value="#32689A";
		document.getElementById("sample_0").style.background="#32689A";
		document.getElementById("image_0").value='';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("eventPage").style.background="#32689A";
		
		// page text color
		document.getElementById("color_1").value='#000000';
		document.getElementById("sample_1").style.background='#000000';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.color="#000000";
		
		// page text font
		document.getElementById("font_1").selectedIndex = 8;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.fontFamily="Verdana, Arial, Helvetica, sans-serif";
		
		// page text size
		document.getElementById("font_1_size").selectedIndex = 4;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.fontSize="10pt";
		
		// links text color, font, size
			document.getElementById("color_2").value='#0000CC';
			document.getElementById("sample_2").style.background='#0000CC';
			document.getElementById("font_2").selectedIndex = 8;
			document.getElementById("font_2_size").selectedIndex = 4;
			
				// assign the new value to the event preview iframe
				var links = window.frames['preview_frame'].document.getElementById("boxTemplate").getElementsByTagName("a");
					for (var x = 0; x < links.length; x++) {
					// color
					links[x].style.color = "blue";
					// font
					links[x].style.fontFamily="Verdana, Arial, Helvetica, sans-serif";
					// size
					links[x].style.fontSize="10pt";
					// background
					links[x].style.background="#FFFFFF";
					}
		
		// table background				
		document.getElementById("color_3").value='#FFFFFF';
		document.getElementById("sample_3").style.background='#FFFFFF';
		document.getElementById("image_3").value='';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.background="#FFFFFF";
		
		// table border color
		document.getElementById("color_4").value='#C0C0C0';
		document.getElementById("sample_4").style.background='#C0C0C0';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderColor="#C0C0C0";
		
		// table border style
		document.getElementById("border_4").selectedIndex = 3;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderStyle="solid";
		
		// table border size
		document.getElementById("border_4_size").selectedIndex = 4;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("boxTemplate").style.borderWidth="1px";
		
		// titlebar background
		document.getElementById("color_5").value='#32689A';
		document.getElementById("sample_5").style.background='#32689A';
		document.getElementById("image_5").value='';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.background="#32689A";
		
		// titlebar border color
		document.getElementById("color_6").value='#FFFFFF';
		document.getElementById("sample_6").style.background='#FFFFFF';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderColor="#FFFFFF";
		
		// titlbar border style
		document.getElementById("border_6").selectedIndex = 3;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderStyle="solid";
		
		// titlebar border size
		document.getElementById("border_6_size").selectedIndex = 3;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.borderWidth="0px";
		
		// titlebar text color
		document.getElementById("color_7").value='#FFFFFF';
		document.getElementById("sample_7").style.background='#FFFFFF';
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.color="#FFFFFF";
		
		// titlebar text font
		document.getElementById("font_7").selectedIndex = 3;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.fontFamily="Arial";
		
		// titlebar text size
		document.getElementById("font_7_size").selectedIndex = 6;
		
			// assign the new value to the event preview iframe
			window.frames['preview_frame'].document.getElementById("titlebar").style.fontSize="14pt";
		
		// divider border color
		document.getElementById("color_8").value='#C0C0C0';
		document.getElementById("sample_8").style.background='#C0C0C0';
		
			// assign the new values to the event preview iframe
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightColor='#C0C0C0';
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomColor='#C0C0C0';
			}
		
		// divider border style
		document.getElementById("border_8").selectedIndex = 3;
			
			// assign the new values to the event preview iframe
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightStyle='solid';
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomStyle='solid';
			}
			
		// divider border size
		document.getElementById("border_8_size").selectedIndex = 4;
			
			// assign the new values to the event preview iframe
			// find and change all tags with class = dividerVertical
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerVertical') allTags[i].style.borderRightWidth='1px';
			}
			 
			// find and change all tags with class = dividerHorizontal
			var allTags = window.frames['preview_frame'].document.getElementsByTagName('*');
			for(i=0; i<allTags.length; i++){
			if(allTags[i].className == 'dividerHorizontal') allTags[i].style.borderBottomWidth='1px';
			}
		
		// table corners
		document.getElementById("corner_radius").disabled=false;
		document.getElementById("corner_radius").style.background='#FFFFFF';
		document.getElementById("corner_radius").value='15';
		document.getElementById("corner_style").selectedIndex = 1;
		
		// info column
		document.getElementById("column_style").selectedIndex = 1;
	
	}
}
// end function


function delrec(member_id, host) {
cmsg = "Are you sure you want to delete this record?\n" + "id# " + member_id
if (confirm(cmsg)) {
window.location= host + "/admin/members_delete.php?member_id=" + member_id;
}
}

// =================================================
// functions to submit forms and display progress bar
// =================================================

function SubmitForm(form_id) {
	// submit the form
	document.getElementById(form_id).submit();
	// show progress bar
	document.getElementById("progress").style.visibility = 'visible';
	// disable submit button
	document.getElementById("submit_form").disabled = true;
	// change text value of button
	document.getElementById("submit_form").value = 'Processing';
}
// end function


function progress(){
	
	// hide button
	document.getElementById("submit_button").style.visibility = "hidden"; 
	document.getElementById("submit_button").style.display= "none";
	
	// show gif
	document.getElementById("progress_bar").style.visibility = "visible"; 
	document.getElementById("progress_bar").style.display= "inline";
	setTimeout('document.getElementById("progress_bar").src = "https://ezregister.com/images/progress.gif"', 50); 
	
	// hide button 2
	if(document.getElementById("submit_button2")){
		document.getElementById("submit_button2").style.visibility = "hidden"; 
		document.getElementById("submit_button2").style.display= "none";
	}
	
	// show gif 2
	if(document.getElementById("submit_button2")){
		document.getElementById("progress_bar2").style.visibility = "visible"; 
		document.getElementById("progress_bar2").style.display= "inline";
		setTimeout('document.getElementById("progress_bar2").src = "https://ezregister.com/images/progress.gif"', 50); 
	}
}
// end function



function PleaseWait(form_id) {
	// submit the form
	document.getElementById(form_id).submit();
	// hide submit button
	document.getElementById("submit_button").style.display = 'none';
	// show progress
	document.getElementById("progress").style.display = 'block';
}
// end function


function PleaseWaitWYSIWYG() {
	// hide submit button
	document.getElementById("submit_button").style.display = 'none';
	// show progress
	document.getElementById("progress").style.display = 'block';
}
// end function


// =====================================
// function to show display progress bar
// =====================================
function ShowProgress() {
	// show progress bar
	document.getElementById("progress").style.visibility = 'visible';
	// change text value of button
	document.getElementById("submit_form").value = 'Processing';
	// disable submit button
	//document.getElementById("submit_form").disabled = true;
}
// end function


function DisableButton(button) {
	// disable submit button
	document.getElementById(button).disabled = true;
}
// end function


function clearAll(){
var texts=document.getElementsByTagName('input')

for (var i_tem = 0; i_tem < texts.length; i_tem++){
if (texts[i_tem].type=='text')
texts[i_tem].value=''
}

// clear member_id info
document.getElementById("member_id").value = '';
}
// end function


//function to toggle element display
function toggleCheckboxElement(check_box,display_box){

	if (document.getElementById(check_box).checked==true) {
	document.getElementById(display_box).style.display = 'inline';
	} else {
	document.getElementById(display_box).style.display = 'none';
	}
}
// end function


///////////////////////
//  End all scripts -->