
function getStudios(site_url)
{
	$.ajax({
		type: "GET",
		url: "/contact_select_studio.asp",
		data: "StudioState=" + $("#StudioState").val(),
		dataType: "text",
		success: function(html) {
			$("#studiosByState").html(html);
			$("input[name='StudioNumber']").eq(0).focus();
		}
	});
	
}

function getProductCategories(location_type) {
	var option_list;
	
	$.ajax({
		type: "POST",
		url: "/ws/get_customer_service_options.asp",
		data: "location_type=" + location_type,
		dataType: "json",
		success: function(options) {
			$("#product_category").children().remove();
			
			var method = $("#product_category").get(0);

			for (var i=0; i<options.length; i++) {
				var opt = document.createElement("option");
				opt.text = options[i].text;
				opt.value = options[i].value;
				
				method.options[i] = opt;
			}
		}
	});
		
	
}

function show_questions() {
	var questions = document.getElementById('feedback_questions');
	
	if (document.getElementById('feedback_check').checked == true) {
		questions.style.display = 'block';
	} else {
		questions.style.display = 'none';
	}
}

function toggle_feedback(element_id) {
	if (element_id == "division_studio") {
		show_element(element_id);
	} else {
		hide_element(element_id);
	}
}

function hide_element() {
	$("#feedback_form").hide();
}

function show_element() {
	$("#feedback_form").show();
}




$(document).ready(function() {
	$("#division_studio").bind("click", function() { $("#feedback_form").show() });
	$("#division_church").bind("click", function() { $("#feedback_form").hide() });
	$("#division_mobile").bind("click", function() { $("#feedback_form").hide() });
	$("#division_web").bind("click", function() { $("#feedback_form").hide() });
	$("#division_other").bind("click", function() { $("#feedback_form").hide() });
	
	$("#feedback_check").bind("click", function() { 
		if ($("#feedback_check").attr("checked")) {
			$("#feedback_questions").show();
		} else {
			$("#feedback_questions").hide();
		}
	});
});