// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EXPAND TO FULL SCREEN

self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Delayed call plug-in

$.fn.delay = function(time, callback){
    jQuery.fx.step.delay = function(){};
    return this.animate({delay:1}, time, callback);
}




// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CHECK FOR THE USER AGENT

var iPod = navigator.userAgent.match(/iPod/i) != null;
var iPad = navigator.userAgent.match(/iPad/i) != null;
var iPhone = navigator.userAgent.match(/iPhone/i) != null;
var msIE = navigator.userAgent.match(/msie/i) != null;
var FF = navigator.userAgent.match(/firefox/i) != null;

// ---> FOR APPLE MOBILES

var iDevice = false;
if (iPod || iPad || iPhone) {
	iDevice = true;
}





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SET IMAGES TO PRELOAD

var images = [
				'/images/azienda/01.jpg',
				'/images/azienda/film.jpg',
				'/images/common/blank.gif',
				'/images/common/fancybox-loading.gif',
				'/images/common/fancybox-sprite.png',
				'/images/common/logo.jpg',
				'/images/common/next.jpg',
				'/images/common/prev.jpg',
				'/images/contatti/01.jpg',
				'/images/fiere/01.jpg',
				'/images/home/01.jpg',
				'/images/saperfare/cover.jpg',
				'/images/common/spinner.gif'
			 ];

var auto_play = false;
var trans_speed = 1000;





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - START PRELOAD IMAGES

$({}).imageLoader({
    images: images,
    async: true,
    allcomplete: function(e, ui) {
    
		$(document).ready(function() {
		    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FIXES
			
		    // ---> INTERNET EXPLORER
			if (msIE) {
				$('body').addClass('ie');
				$('.press .image').removeClass('nudge');
				//$('body').removeClass('isotope');
				//$('.press .image').css({float:'left'});
			}
			
		    // ---> FIREFOX
		    
			if (FF) {
			
				// fixes here
			}
			
			// ---> APPLE MOBILES
			
			if (iDevice) {
			
				trans_speed = 0;
				
				$('.prev, .next').css({backgroundImage:'none'});

			}
			




			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LAYOUT
			
			if (iDevice && $('body').hasClass('iScroll')) {
				var pageScroll = new iScroll('page-wrapper', {scrollbarClass:'myScrollbar'});
			}
			
			$('span#logo, a#logo').animate({opacity:'0'}, 0);
			
			$('#nav li.seq').css({paddingLeft:'20px'}).animate({opacity:'0'}, 0);
			
			$('#collnav').animate({opacity:'0'}, 0).hide();
			var collnav = false;
			
			if ($('body').hasClass('isotope')) {
				$.Isotope.prototype._layout = $.Isotope.prototype.layout;
				$.extend($.Isotope.prototype, {
					_fitRowsResizeChanged: function() {
						setTimeout(resizePage, 750);
						return true;
					},
					_masonryResizeChanged: function() {
						setTimeout(resizePage, 750);
						return true;
					},
					layout: function($elems, callback) {
						$.Isotope.prototype._layout.call(this, $elems, callback);
						setTimeout(resizePage, 750);
					}
				});
			}
						
			// - - - - - - - - - - - - - - - - - - - - - - - SET UP GALLERIES
			
			function initHomeGallery() {
				$('body').bgStretcher({
					images: 	homeimages,
					slideShowSpeed:		trans_speed
				});
			}
			
			function initAziendaGallery() {
				$('body').bgStretcher({
					images: 			[
											'/images/azienda/01.jpg'
										]
				});
			}
			
			function initFiereGallery() {
				$('body').bgStretcher({
					images: 			[
											'/images/fiere/01.jpg'
										]
				});
			}
			
			function initContattiGallery() {
				$('body').bgStretcher({
					images: 			[
											'/images/contatti/01.jpg'
										]
				});
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - HANDLERS AND EFFETCS
			
			// ---> PAGE CONTENT RESIZE HANDLER
			
			function resizePage() {
				var viewPortHeight = $(window).height()-64;
				
				var pageContentHeight = $('#page #content').height();
				
				if (viewPortHeight>pageContentHeight) {
					$('#page-wrapper').css({height:'inherit'});
					$('#page').css({height:viewPortHeight});
					$('body').css({overflowY:'hidden'});
					if (pageScroll) {
						pageScroll.refresh();
					}
				} else {
					if (!iDevice) {
						$('#page-wrapper').css({height:'inherit'});
					} else {
						$('#page-wrapper').css({height:viewPortHeight});
					}
					$('#page').css({height:pageContentHeight});
					$('body').css({overflowY:'scroll'});
					if (pageScroll) {
						pageScroll.refresh();
					}
				}
				return pageContentHeight;
			}
			
			// ---> COMMON UI EFFECTS
			
			function buildNav() {
			
				var navItems = $('#nav li.seq').length-1;
	
				$('#nav li.seq').each(function(i) {
					if (!iDevice) {
					    $(this).delay(i*125).animate(
					        {opacity:'1', paddingLeft:'0px'},
					        {duration: 250, specialEasing: {opacity:'linear', paddingLeft:'easeInOutQuad'},
					         complete: function() {
					             if (navItems==i) {
					                 buildPage();
					             }
					         }
					    });
					} else {
						$(this).css({opacity:'1', paddingLeft:'0px'});
						if (navItems==i) {
							buildPage();
						}
					}
				});
			}
			
			function buildCommonUI() {
				if (!iDevice) {
					// efx for main layout here (for ex. header, footer...)
				} else {
					// efx for main layout here (for ex. header, footer...)
				}
				buildNav();
			}
			
			function equalizeSize() {
			
				var maxWidth = 0;
				var maxHeight = 0;
				
				$(".sequential li").each(function(){
					if ($(this).width() > maxWidth) { maxWidth = $(this).width(); }
					if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
				});
				$(".sequential li").width(maxWidth);
				//$(".sequential li").height(maxHeight);
				
				if ($('body').hasClass('fiere')) {
					$('#content').width(maxWidth*1,5);
				}
				
				if ($('body').hasClass('contatti')) {
					$('#content').width(maxWidth*1,5);
				}
			}
			
			function showSequential() {
			
				var itemsSequence = $('.sequential li').length-1;
	
				$('.sequential li').each(function(i) {
					if (!iDevice) {
					    $(this).delay(i*100).animate(
					        {opacity:'1', marginLeft:'0'},
					        {duration: 350, specialEasing: {opacity:'easeInOutQuad', marginLeft:'easeInOutQuad'},
					         complete: function() {
					             if (itemsSequence==i) {
					                 // callback here
					             }
					         }
					    });
					} else {
						$(this).css({opacity:'1', marginLeft:'0'});
						if (itemsSequence==i) {
							// callback here
						}
					}
				});
			}
			
			
			
			
			
			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SITE HANDLER
			
			// - - - - - - - - - - - - - - - - - - - - - - - INITIALIZE PAGES
			
			if ($('body').hasClass('index')) {
				// ---> INIT HERE
			}
			
			if ($('body').hasClass('home')) {
				initHomeGallery();
			}
			
			if ($('body').hasClass('collezione-thumbs')) {
				$('#content p').animate({opacity: '0'}, 0);
				$('#wrapper').animate({opacity: '0'}, 0);
			}
			
			if ($('body').hasClass('saperfare')) {
				$('#slide-holder').animate({opacity: '0'}, 0);
			}
			
			if ($('body').hasClass('collezione-slide')) {
				$('#slide-holder').animate({opacity: '0'}, 0);
			}
			
			if ($('body').hasClass('azienda')) {
				initAziendaGallery();
				$('#content p').css({paddingTop:'432px', paddingBottom:'64px', marginLeft:'-416px'});
				$('#content span').animate({opacity: '0'}, 0);
			}
			
			if ($('body').hasClass('saperfare')) {
				// ---> INIT HERE
			}
			
			if ($('body').hasClass('fiere')) {
				initFiereGallery();
				$('#content li').css({marginLeft:'32px'}).animate({opacity: '0'}, 0);
				equalizeSize();
			}
			
			if ($('body').hasClass('contatti')) {
				initContattiGallery();
				$('#content li').css({marginLeft:'32px'}).animate({opacity: '0'}, 0);
				equalizeSize();
			}
			
			if ($('body').hasClass('press')) {
				if (!iDevice) {
					$('#wrapper').animate({opacity: '0'}, 0);
					$(".fancybox").fancybox();
				}
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - ANIMATE PAGES
			
			function buildPage() {
				
				if ($('body').hasClass('index')) {
					// ---> SEQUENCE HERE
				}
				
				if ($('body').hasClass('home')) {
					$('body').delay(3000, function() {
					    $('body').bgStretcher.play();
					});
				}
				
				if ($('body').hasClass('collezione-thumbs')) {
					var imagesel = '';
					for(var j = 0; j < collezionithumbimages.length; j++) {
						var imgel = collezionithumbelement;
						imgel = imgel.replace("<IMAGE>", collezionithumbimages[j].image);
						imgel = imgel.replace("<WIDTH>", collezionithumbimages[j].width);
						imagesel += imgel;
					}
					$('#wrapper').append(imagesel);

					$('#isotope-preload').show();
			
					var $container = $('#wrapper img');						
					$container.imagesLoaded( function(){
						$('#isotope-preload').hide();
						
						if ($('body').hasClass('isotope')) {
							$('#wrapper').isotope({
								layoutMode: 'fitRows',
								itemSelector:'.image'
							}, resizePage);
						}
						$('#isotope-preload').hide();
						$('#content p').animate({opacity: '1'}, 0);
						$('#wrapper').delay(10).animate({opacity: '1'}, 500);
						
						collezioniThumbInit();
						nudge();
						
						setTimeout(resizePage, 750);
					});
				}
				
				if ($('body').hasClass('collezione-slide')) {
					
				}
				
				if ($('body').hasClass('azienda')) {
					if (!iDevice) {
						$('#content p').animate({marginLeft:'32px'}, 500, 'easeInOutQuad').animate({paddingTop:'464px', paddingBottom:'32px'}, 500, 'easeInOutQuad');
						$('#content span').delay(500).animate({opacity:'1'}, 500, 'easeInOutQuad');
					} else {
						$('#content p').css({paddingTop:'464px', marginLeft:'32px'});
						$('#content span').css({opacity:'1'});
					}
				}
				
				if ($('body').hasClass('saperfare')) {
					// ---> SEQUENCE HERE
				}
				
				if ($('body').hasClass('fiere')) {
					showSequential();
				}
				
				if ($('body').hasClass('contatti')) {
					showSequential();
				}
				
				if ($('body').hasClass('press')) {
					if (!iDevice) {
						if ($('body').hasClass('isotope')) {
							$('#isotope-preload').show();
						}
						
						var imagesel = '';
						for(var j = 0; j < pressimages.length; j++) {
							var imgel = presselement;
							imgel = imgel.replace("<THUMB>", pressimages[j].image + 'small.jpg');
							imgel = imgel.replace("<LARGE>", pressimages[j].image + 'large.jpg');
							imgel = imgel.replace("<WIDTH>", pressimages[j].width);
							imgel = imgel.replace("<HEIGHT>", pressimages[j].height);
							imgel = imgel.replace("<TITLE>", pressimages[j].title);
							imagesel += imgel;
						}
						$('#wrapper').html(imagesel);
						
						if (msIE) {
							$('.press .image').removeClass('nudge');
						}
						
						var $container = $('#wrapper img');						
						$container.imagesLoaded( function(){
							if ($('body').hasClass('isotope')) {
								$('#wrapper').isotope({
									masonry: {
										columnWidth: 1
									},
									itemSelector:'.image'
								}, resizePage);
							}
							$('#isotope-preload').hide();
							$('#wrapper').delay(10).animate({opacity: '1'}, 500);
							
							
							
							setTimeout(resizePage, 750);
						});
						
						// - - - - - - - - - - - - - - - - - - - - - - - PRESS
				
					  	if (!iDevice) {
					  		
					  		// ---> MOUSE ROLLOVER/ROLLOUT
			                
			                $('body.press #wrapper .image').hover(function() {
			                    $(this).find('img').stop().animate({opacity:'0.5'}, 50);
			                }, function() {
			                    $(this).find('img').stop().animate({opacity:'1'}, 500);
			                });
						}
						nudge();
					}
				}
				
				
				// - - - - - - - - - - - - - - - - - - - - - - - COLLEZIONI SLIDE
			
				function resizeCollezioni() {
					var collezioniwidth = 0;
		            collezioniindex = 1;
		            collezioniel = [];
		            collezionitotal = 0;
		            var check = true;
		            var indexslide = 0;
		            $('#slide-wrapper .image').each(function(i, e) {
		            	if ($(e).width() == 0){ check = false};
		            	
		            	collezioniwidth += $(e).outerWidth(true);
		            	collezionitotal += 1;
		            	collezioniel.push($(e));
		            	
		            	if (i < slideindex) indexslide += $(e).outerWidth(true);
		            });
		            if (!check) { 
		            	setTimeout(resizeCollezioni, 100);
		            } else {
		            	$('body.collezione-slide #slide-wrapper').width(collezioniwidth);
		            }
		            collezioniindex = slideindex + 1;
		            $('#slide-wrapper').animate({left:'-' + indexslide}, 0);	
				}
				if ($('body').hasClass('collezione-slide')) {
					$('#isotope-preload').show();
					
					var imagesel = '';
					for(var j = 0; j < slideimages.length; j++) {
						var imgel = slideelement;
						
						var nclass = '';
						if (j > 0) {
							nclass += 'nudge ';
							if (slideindex >= j) nclass += 'prev '; else nclass += 'next ';
						}
						
						imgel = imgel.replace("<CLASS>", nclass);
						imgel = imgel.replace("<IMAGE>", slideimages[j].image);
						imgel = imgel.replace("<WIDTH>", slideimages[j].width);
						imgel = imgel.replace("<NAME>", slideimages[j].name);
						imagesel += imgel;
					}
					$('#slide-wrapper').append(imagesel);
					
					initCollezioniSlide();
					nudge();
					
					var $container = $('#slide-wrapper img');						
					$container.imagesLoaded( function(){
						$('#isotope-preload').hide();
						$('#slide-holder').delay(10).animate({opacity: '1'}, 500);
						resizeCollezioni();
					});
				}
				
				function initCollezioniSlide() {
				  	if (!iDevice) {
				  		
				  		// ---> MOUSE ROLLOVER/ROLLOUT
		                
		                $('body.collezione-slide .prev, body.collezione-slide .next').hover(function() {
		                    $(this).find('img').stop().animate({opacity:'0.5'}, 50);
		                }, function() {
		                    $(this).find('img').stop().animate({opacity:'1'}, 500);
		                });
		                
		                // ---> MOUSE UP
		                
		                $('body.collezione-slide .image').mouseup(function() {
		                	if (!$(this).hasClass('next') && !$(this).hasClass('prev')) return;
		                	
		                	var direction = $(this).hasClass('next') ? 'next' : 'prev';
							if (direction == 'prev') collezioniindex -= 1;
		                	var d = collezioniel[collezioniindex];
		                	if (direction == 'next') collezioniindex += 1;
		
					    	if (direction == 'next') {
					    		var q = d.prev().outerWidth(true);
		
					            $('#slide-wrapper').animate({left:'-=' + q}, 500, 'easeOutQuad');
					            d.removeClass('next').addClass('prev');
				            } else {
				            	var q = d.prev().outerWidth(true);
					            
					            $('#slide-wrapper').animate({left:'+=' + q}, 500, 'easeOutQuad');
					            d.removeClass('prev').addClass('next');
				            }
						});
					} else {
						$('body.collezione-slide #slide-wrapper').touchwipe({
							wipeLeft: function() {
					        	var d = collezioniel[collezioniindex];
					        	if (d == null) return;
					        	var q = d.prev().outerWidth(true);
								
					        	$('#slide-wrapper').animate({left:'-=' + q}, 500, 'easeOutQuad');
					        	collezioniindex += 1;
					        },
					        wipeRight: function() {	
					        	if (collezioniel[collezioniindex - 1] == null) return;
					        	collezioniindex -= 1;
					        	var d = collezioniel[collezioniindex];
					        	var q = d.prev().outerWidth(true);
								
					        	$('#slide-wrapper').animate({left:'+=' + q}, 500, 'easeOutQuad');
					        }
					    });
					}
				}
				
				
				// - - - - - - - - - - - - - - - - - - - - - - - SAPERFARE
				function resizeSaperFare() {
					var saperfarewidth = 0;
		            saperfareindex = 1;
		            saperfareel = [];
		            saperfaretotal = 0;
		            var check = true;
		            $('#slide-wrapper .image').each(function(i, e) {	
		            	if ($(e).width() == 0){ check = false};
		            	
		            	saperfarewidth += $(e).outerWidth(true);
		            	saperfaretotal += 1;
		            	saperfareel.push($(e));
		            });
		            
		            if (!check) { 
		            	setTimeout(resizeSaperFare, 100); 
		            } else {
			            $('body.saperfare #slide-wrapper').width(saperfarewidth);
			        }
				}
				if ($('body').hasClass('saperfare')) {
					$('#isotope-preload').show();
				
					var imagesel = '';
					for(var j = 0; j < saperfareimages.length; j++) {
						var imgel = saperfareelement;
						imgel = imgel.replace("<IMAGE>", saperfareimages[j].image);
						imgel = imgel.replace("<WIDTH>", saperfareimages[j].width);
						imagesel += imgel;
					}
					$('#slide-wrapper').append(imagesel);
					
					var $container = $('#slide-wrapper img');						
					$container.imagesLoaded( function(){
						$('#isotope-preload').hide();
						$('#slide-holder').delay(10).animate({opacity: '1'}, 500);
						resizeSaperFare();
					});
				
				}
			  	if (!iDevice) {
			  		// ---> MOUSE ROLLOVER/ROLLOUT
	                
	                $('body.saperfare .prev, body.saperfare .next').hover(function() {
	                    $(this).find('img').stop().animate({opacity:'0.5'}, 50);
	                }, function() {
	                    $(this).find('img').stop().animate({opacity:'1'}, 500);
	                });
	                
	                // ---> MOUSE UP
	                
	                $('body.saperfare .image').mouseup(function() {
	                	if (!$(this).hasClass('next') && !$(this).hasClass('prev')) return;
						
	                	var direction = $(this).hasClass('next') ? 'next' : 'prev';
						if (direction == 'prev') saperfareindex -= 1;
	                	var d = saperfareel[saperfareindex];
	                	if (direction == 'next') saperfareindex += 1;
	
				    	if (direction == 'next') {
				    		var q = d.prev().outerWidth(true);
	
				            $('#slide-wrapper').animate({left:'-=' + q}, 500, 'easeOutQuad');
				            d.removeClass('next').addClass('prev');
			            } else {
			            	var q = d.prev().outerWidth(true);
				            
				            $('#slide-wrapper').animate({left:'+=' + q}, 500, 'easeOutQuad');
				            d.removeClass('prev').addClass('next');
			            }
					});
				} else {
					$('body.saperfare #slide-wrapper').touchwipe({
				        wipeLeft: function() {
				        	var d = saperfareel[saperfareindex];
				        	if (d == null) return;
				        	var q = d.prev().outerWidth(true);
							
				        	$('#slide-wrapper').animate({left:'-=' + q}, 500, 'easeOutQuad');
				        	saperfareindex += 1;
				        },
				        wipeRight: function() {	
				        	if (saperfareel[saperfareindex - 1] == null) return;
				        	saperfareindex -= 1;
				        	var d = saperfareel[saperfareindex];
				        	var q = d.prev().outerWidth(true);
							
				        	$('#slide-wrapper').animate({left:'+=' + q}, 500, 'easeOutQuad');
				        }
				    });
				}
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - SHOW UP SITE
			
			if (iDevice) {
				$('body').removeClass('isotope');
			}
			
			resizePage();
			$(window).resize(function() {
				resizePage();
			});
				
			if (iDevice) {
				window.onorientationchange = resizePage;
			}
			
			$('html').css({visibility:'visible'});
			
			if (!iDevice) {
				$('#overlay').delay(500).css({backgroundImage:'none'}).fadeTo(1000, 0, function() {
					$('#overlay').hide();
					if ($('body').hasClass('index')) {
						buildPage();
					} else {
						buildCommonUI();
					}
				});
			} else {
				$('#overlay').css({backgroundImage:'none'}).hide();
				if ($('body').hasClass('index')) {
					buildPage();
				} else {
					buildCommonUI();
				}
			}
			
			
			
			
			
			// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UI EFFECTS HANDLERS
			
			// - - - - - - - - - - - - - - - - - - - - - - - NUDGE
			
			function nudge() {
			  	if (!iDevice) {
			  		
				  	// ---> MOUSE DOWN
				  	
					$('.nudge').mousedown(function() {
						$(this).css({top:'1px'});
					});
					
					// ---> MOUSE UP
					
					$('.nudge').mouseup(function() {
						$(this).css({top:'0px'});
					});
					
					// ---> MOUSE OUT
					
					$('.nudge').mouseout(function() {
						$(this).css({top:'0px'});
					});
				}
			}
			nudge();
			
			// - - - - - - - - - - - - - - - - - - - - - - - LOGO
	
		  	if (!iDevice) {
		  		
		  		// ---> MOUSE ROLLOVER/ROLLOUT
                
                $('a#logo').hover(function() {
                    $(this).stop().animate({opacity:'1'}, 50);
                }, function() {
                    $(this).stop().animate({opacity:'0'}, 500);
                });
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - NAV
	
		  	if (!iDevice) {
		  		
		  		// ---> MOUSE ROLLOVER/ROLLOUT
                
                $('#nav a, #collnav a').hover(function() {
                    $(this).stop().animate({color:'#dc911b'}, 50);
                }, function() {
                    $(this).stop().animate({color:'#666'}, 500);
                });
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - COLLNAV
	
		  	if (!iDevice) {
		  		
			  	// ---> MOUSE UP
				
				$('#collnavswitch').mouseup(function() {
				
					var winHeight = $(window).height();
					var items = $('#collnav li').length;
					var lineH = Math.round(winHeight/items);
					
					if (!collnav) {
						collnav = true;
						$('#collnav li').css({lineHeight:lineH+'px'});
						$('#collnav li').stop().animate({lineHeight:'14px'}, 500, 'easeInOutQuad');
						$('#collnav').animate({opacity:'0'}, 0).show();
						$('#collnav').stop().animate({opacity:'1'}, 500, 'easeInOutQuad');
					} else {
						collnav = false;
						$('#collnav li').stop().animate({lineHeight:lineH+'px'}, 500, 'easeInOutQuad');
						$('#collnav').stop().animate({opacity:'0'}, 500, 'easeInOutQuad', function() {
							$('#collnav').hide();
						});
					}
				});
					
			} else {
			
				// ---> MOUSE UP
			
				$('#collnavswitch').mouseup(function() {
					$('#collnav').css({opacity:'1'});
					if (!collnav) {
						collnav = true;
						$('#collnav').show();
					} else {
						collnav = false;
						$('#collnav').hide();
					}
				});
			}
			
			// - - - - - - - - - - - - - - - - - - - - - - - COLLEZIONI THUMBS
			
			function collezioniThumbInit() {
			  	if (!iDevice) {
			  		
			  		// ---> MOUSE ROLLOVER/ROLLOUT
	                
	                $('body.collezione-thumbs #wrapper .image img').hover(function() {
	                    $(this).stop().animate({opacity:'0.5'}, 50);
	                }, function() {
	                    $(this).stop().animate({opacity:'1'}, 500);
	                });
				}
					// ---> MOUSE UP
					$('body.collezione-thumbs #wrapper .image img').mouseup(function() {
						var index = 0;
						var t = $(this);
						$('body.collezione-thumbs #wrapper .image img').each(function(i, e) {
							if (e == t.get(0)) index = i;
						});
						
						if (iDevice) {
							$(this).css({opacity:'0.75'});
							$(this).parent().animate({backgroundColor:'#dc911b'}, 0);
							$(this).parent().delay(250).animate({backgroundColor:'#fff'}, 0, function() {
								window.open(slideurl + index,'_self');
							});
						} else {
							window.open(slideurl + index,'_self');
						}
					});
			}
						
			
			// - - - - - - - - - - - - - - - - - - - - - - - CONTATTI
	
		  	if (!iDevice) {
		  		
		  		// ---> MOUSE ROLLOVER/ROLLOUT
                
                $('body.contatti #wrapper a').hover(function() {
                    $(this).stop().animate({color:'#dc911b'}, 50);
                }, function() {
                    $(this).stop().animate({color:'#666'}, 500);
                });
                
                // ---> MOUSE ROLLOVER/ROLLOUT
                
                $('#crediti a').hover(function() {
                    $(this).stop().animate({color:'#dc911b'}, 50);
                }, function() {
                    $(this).stop().animate({color:'#666'}, 500);
                });
			}
			
		});
		
	}
});
