/**
 * @author batman
 */
$(document).ready(

	function () {

		// mouseover sul menu
		$("#menu a:not('.menu_sel')").mouseover(
			function() {
				$(this).animate(
					{
						backgroundColor:"#b00000",
						height:"36px"
					},
					150
				);
			}
			
			
		);

		// mouseout sul menu
		$("#menu a:not('.menu_sel')").mouseout(
			function() {
				$(this).animate(
					{
						backgroundColor:"black",
						height:"32px"
					},
					150
				);
			}
		)
		
		// ricerca ajax nei concerti
		$('#concerti_keyword').keyup (
			function()  {
				$.ajax(
					{
						type: "GET",
						url: "ajax_concerti.php",
						data: "fromajax=1&keyword=" + $(this).val(),
						success: function(html){
							$('#wrapper_concerti_table').html(html);
						}
					}
				);
			}
		);
		
		// ricerca ajax nei concerti
		$('#setlist_keyword').keyup (
			function()  {
				$.ajax(
					{
						type: "GET",
						url: "ajax_setlist.php",
						data: "fromajax=1&keyword=" + $(this).val(),
						success: function(html){
							$('#wrapper_setlist_table').html(html);
						}
					}
				);
			}
		);


		$('#home_fade').cycle({
			timeout: 4000, 
			speed: 1000,
			pager: '#gallery_mini_container',
			pagerAnchorBuilder: function(idx, slide) { 
	        // return selector string for existing anchor 
	        return '#gallery_mini_container .gallery_mini:eq(' + idx + ')'; 
	    } 		
		});
		
		/*
		$('#pause_id').click(function() { 
		    $('#home_fade').cycle('pause'); 
		});

		$('#play_id').click(function() { 
		    $('#home_fade').cycle('resume'); 
		});

		$('#pause_id img').hover(
			function() { $(this).attr("src", "img/puls_pause_hover.jpg"); },
			function() { $(this).attr("src", "img/puls_pause.jpg"); }
		);

		$('#play_id img').hover(
			function() { $(this).attr("src", "img/puls_play_hover.jpg"); },
			function() { $(this).attr("src", "img/puls_play.jpg"); }
		);

		$('#prev img').hover(
			function() { $(this).attr("src", "img/puls_prev_hover.jpg"); },
			function() { $(this).attr("src", "img/puls_prev.jpg"); }
		);

		$('#next img').hover(
			function() { $(this).attr("src", "img/puls_next_hover.jpg"); },
			function() { $(this).attr("src", "img/puls_next.jpg"); }
		);
		*/

	}

);


// completa nome disco e anno
function suggestDisco(titolo,anno) {
	$('#disco').val(titolo);
	$('#anno').val(anno);
}
