/* [jQuery] */
$(document).ready(function() {

	/* [menu fisarmonica]*/
	$('#menu_fisarmonica_content .kwicks').kwicks({   
        max : 150,  
        spacing : 0,  
        isVertical : true,
		duration: 300
	});

	/* slideshow */
	$('#sliders').jqFancyTransitions({ width:638, height:294, position:'top', direction: 'left'});

	/* [Wrap TinyMCE with a link taken from the image] */
	$(".colorbox-img").each(function() {
		var src = $(this).attr('src');
		var a = $('<a/>').attr('href', src).attr('rel', 'colorbox-image');
		$(this).wrap(a);
	});
	/* [/End Wrap TinyMCE with a link taken from the image] */
	
	/* [Colorbox] */
	$(".colorbox-popup").colorbox({
		width:"980", 
		height:"500", 
		iframe:true,
		open:true
	}); 	
	$("a[rel='colorbox-image']").colorbox({
		scalePhotos:true,
		current: "Immagine {current} di {total}"		
	});	
	$("a[rel='colorbox-modal-box']").colorbox({
		iframe:true,
		innerWidth:880, 
		innerHeight:440,
		current: "Immagine {current} di {total}"
	});		
	/* [/End Colorbox] */	

	/* [Hide Label Class] */
	$("#form label").addClass("hide-label");
	/* [/End Hide Label Class] */
	
	/* [Fix Placeholder HTML5] */	
	$('input[placeholder], textarea[placeholder]').placeholder();
	/* [/End Fix Placeholder HTML5] */
	
	/* [Image Preloader] */
	$([
		'assets/templates/default/img/general/bg-modal.jpg',
		'assets/templates/default/img/general/bg-modal.png',
		'assets/templates/default/img/general/bg-close.png',
	]).preload();
	/* [/End Image Preloader] */
	
	/* [DropDown Menu] */
	function addMega(){
		$(this).addClass("hovering");
		}
		function removeMega(){
		$(this).removeClass("hovering");
		}
	var megaConfig = {
		interval: 60,
		sensitivity: 4,
		over: addMega,
		timeout: 160,
		out: removeMega
	}
	$("#menu ul li").hoverIntent(megaConfig)
	/* [/End DropDown Menu] */		
	
	/* [Modal] */
	$('.modal').jqm({
		modal: true,
		trigger: '#login-modal',
		overlay: 40, 
		overlayClass: 'modal-overlay'})
	$('input.modal-close');	
	/* [/End Modal] */
	
});	
/* [/End jQuery] */
