/* Author: 

*/

// ROSTER GRAYSCALE
// On window load. This waits until images have loaded which is essential
	$(window).load(function(){
		if($('#flyer').length>0) {
			$("#flyer").jqFancyTransitions({ width: 322, height: 400, effect: 'wave', direction: 'right', titleOpacity: 0, navigation: false, links: true });
		}
		
		// Fade in images so there isn't a color "pop" document load and then on window load
		$("#roster img").fadeIn(500);
		
		// clone image
		
		/*if($.browser.msie){
		userAgent = $.browser.version;
		userAgent = userAgent.substring(0,userAgent.indexOf('.'));	
		version = userAgent;
		}*/
		
		if (($.browser.msie  && parseInt($.browser.version) > 7)  || !$.browser.msie) {
		//grayscale solo su versioni di iE > 7 o non iE
			$('#roster img').each(function(){
				var el = $(this);
				el.css({"position":"absolute"}).wrap("<div class='img_wrapper' style='display: inline-block'>").clone().addClass('img_grayscale').css({"position":"absolute","z-index":"998","opacity":"0"}).insertBefore(el).queue(function(){
					var el = $(this);
					el.parent().css({"width":this.width,"height":this.height});
					el.dequeue();
				});
			});
		
		
		// Fade image 
			$('#roster img').mouseover(function(){
				this.src = grayscale(this.src);
				$(this).parent().find('img:first').stop().animate({opacity:1}, 300);
			})
			$('.img_grayscale').mouseout(function(){
				$(this).stop().animate({opacity:0}, 300);
			});	
			
		}
		
		// form
		$('#form_contatti').html5form({
        	allBrowsers : true,
            responseDiv : '#risposta',
            method : 'GET',
            colorOn :'#6b6764',
			colorOff :'#cccccc'
			//labels: 'hide'
		});
});
	
	





















