$(document).ready(function() {
	var playerScroller = $("div.scrollable").scrollable({size:4}).navigator().autoscroll({
	interval: 8000,
	autopause:true	
}).circular();
/*				var playerScroller = $("div.scrollable").scrollable({circular: true, speed: 700, next:'.nextPage',prev:'.prevPage'}).navigator().autoscroll({ 
    interval: 8000,
	autopause:false
});*/



/*				$(".items div").click(function(e) {
												var url = $(this).attr("link");//.replace("_t", "");
												window.location=url;

											});
*/
});

$(".divItemHome").live('click',function(){
	$.post("/inc/index/get_embed.php",{'id':$(this).attr("link")},
				function(data)
					{
						if(data)
						{
							$.fancybox(data,{
								'titlePosition'		: 'inside',
								'transitionIn'		: 'none',
								'transitionOut'		: 'none'
							});
						}
					}
		);
})


$(function(){
		//all hover and click logic for buttons
		$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});
