	$(document).ready(function() {

		$(function () {

			if ($("#artist-list").length) {
				$("#artist-list").selectBox();
			}

			if ($("#tag-list").length) {
				$("#tag-list").selectBox();
			}

			if ($("#artist-alert").length) {

				$("#artist-alert").click(function () { 

					var checked = "false";
					var artists_id = $("#artist-alert").val();
					var customers_id = $("#customers_id").val();
					
					if ($('#artist-alert').is(':checked') ) {
						checked = "true";
					}
					
					// update preview section below
					$("#artist-alert-message").load("/ajax/artist_alert.php", { artists_id: artists_id, customers_id: customers_id, checked: checked}, function(response, status, xhr) {
						if (status == "error") {
							var msg = "There was an error making your selection, please refresh the page and try again.";
							$("#artist-alert-message").html(msg + '<br />' + xhr.status + " " + xhr.statusText);
						}
					});
					
				});
				
			}

			if ($("#js-news").length) {
		        $('#js-news').ticker({
			        speed: 0.20,
			        controls: false,
			        titleText: '',
			        displayType: 'reveal',
			        direction: 'ltr',
			        pauseOnItems: 9000,
			        fadeInSpeed: 500,
			        fadeOutSpeed: 500
		        });
			}

		});			
		
		
		
	});

	function showArtist() {
		var artist_id = $("#artist-list").val();
		if (artist_id) {
			$("#artist-select").submit();
		}
	}

	function showTag() {
		var tag_id = $("#tag-list").val();
		if (tag_id) {
			$("#tag-select").submit();
		}
	}
