// java per CREATIVART
// ver. 1.0
// Daniele Mantovani


// Dropdown menu
    $(document).ready(function(){
								   
		$('.nav ul ul').css({display: 'none'});
	
		$('.nav ul li').hover(function(){
			$(this).find('ul:first').css({
				visibility: 'visible',
				display: 'none'
			}).fadeIn('1000');
		},
		function(){
			$(this).find('ul:first').css({
				visibility: 'hidden'
			});
		});
     });
	
// TOOLTIP
$(document).ready(function() {
	$('.ttip').tipsy({delayIn: 0, delayOut: 0});
});

// Hover moving effect
	$(document).ready(function() {
			$("#sidebar li a").hover(function() {	//On hover...
				$(this).find("span").stop().animate({ 
					marginLeft: "10" //Find the span tag and move it up 40 pixels
				}, 250);
			} , function() { //On hover out...
				$(this).find("span").stop().animate({
					marginLeft: "0" //Move the span back to its original state (0px)
				}, 250);
			});
			
			$(".nav ul li ul li a").hover(function() {	//On hover...
				$(this).find("span").stop().animate({ 
					marginLeft: "10" //Find the span tag and move it up 40 pixels
				}, 250);
			} , function() { //On hover out...
				$(this).find("span").stop().animate({
					marginLeft: "0" //Move the span back to its original state (0px)
				}, 250);
			});
	});
	
	

	// Viewer Portfolio
	// This code allow to show the image in full size
	$(document).ready(function(){
		$(".viewer").click(function() {
			$('.image').toggleClass('imageshow');
			$('.viewer span').toggleClass("close");
			return false;
		});
	});
	
	// Skin the select form
	$(document).ready(
	  function() {
		$('.my-skinnable-select').each(
		  function(i) {
			selectContainer = $(this);
			// Remove the class for non JS browsers
			selectContainer.removeClass('my-skinnable-select');
			// Add the class for JS Browers
			selectContainer.addClass('skinned-select');
			// Find the select box
			selectContainer.children().before('<div class="select-text">a</div>').each(
			  function() {
				$(this).prev().text(this.options[0].innerHTML)
			  }
			);
			// Store the parent object
			var parentTextObj = selectContainer.children().prev();
			// As we click on the options
			selectContainer.children().click(function() {
			  // Set the value of the html
			  parentTextObj.text(this.options[this.selectedIndex].innerHTML);
			})        
		  }
		);
	  }
	);
	
//Portfolio thumbnail
$(document).ready(function(){

	$('#portfolio-list a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});
//catalogo thumbnail
$(document).ready(function(){

	$('#catalogo a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});
//catalogo thumbnail
$(document).ready(function(){

	$('#foto-list a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});
//catalogo thumbnail
$(document).ready(function(){

	$('#foto-list2 a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});
//accessori 
$(document).ready(function(){

	$('#portfolio-filter li a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});

/*************************fancybox config****************************/
		$(document).ready(function() {


			$("a#example1").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});
			$("a.grouped_elements").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});
				
			$("a.various1").fancybox({
				'width'				: '90%',
				'height'			: '90%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
});

			/*
			*   Examples - images			
			
			$("a#example1").fancybox({
				'titleShow'		: false
			});

			$("a#example2").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});
			$("a#example4").fancybox();

			$("a#example5").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example6").fancybox({
				'titlePosition'	: 'over'
			});

			*/
			
			/*
			*   Examples - various
			

		$("a[rel=example_group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
			
			

			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#various2").fancybox();

			$("#various3").fancybox({
				'width'				: '90%',
				'height'			: '90%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#various4").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
		});*/

		/*
		*   Examples - images
		
	$(document).ready(function() {
		$("a#example2").fancybox({
			'titlePosition'	: 'inside',
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic'
		});
			$("a[rel=example_group]").fancybox({
			'titlePosition'	: 'inside',
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic'
			});
	});*/
		/*
		*   Examples - images
		*/



