
// - - - > MAMANURI DESIGN, 2011 < - - - //

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

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





// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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;
	$('body').addClass('iDevice');
}





$(document).ready(function() {
    
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FIXES
	
    // ---> INTERNET EXPLORER
    
	if (msIE) {
	
		// fixes here
	}
	
    // ---> FIREFOX
    
	if (FF) {
	
		// fixes here
	}
	
	
	
	
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LAYOUT INIT
	
	// - - - - - - - - - - - - - - - - - - - - - - - SET EFFECTS ON LINKS
	
	// ---> LINK NUDGE
	
	$('a').addClass('nudge');
	
	// ---> DECORATION BOTTOM
	
	$('#lang-switcher a').addClass('decorationBottom');
	
	// - - - - - - - - - - - - - - - - - - - - - - - SHOW UP SITE
	
	$('#main-wrapper').delay(1000).queue(function() {
		$('#lang-switcher').hide().css({paddingTop:'0px'});
		$(this).css({visibility:'visible'});
		$('#overlay').fadeTo(2000, 0, function() {
			$('#lang-switcher').show().delay(1000).animate({paddingTop:'140px'}, 1000, function() {
				$('#overlay').hide();
			});
		});
	});
	
	
	
	
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UI EFFECTS HANDLERS
	
	// - - - - - - - - - - - - - - - - - - - - - - - LINK 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'});
		});
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - - LINK DECORATION BOTTOM
	
  	if (!iDevice) {
  	
  		var originalPaddingBottom;
  		
	  	// ---> MOUSE OVER
	  	
		$('.decorationBottom').hover(function() {
			originalPaddingBottom = parseInt($(this).css('paddingBottom'));
            $(this).addClass('hover');
        }, function() {
            $(this).removeClass('hover');
        });
        
        // ---> MOUSE DOWN
        
        $('.decorationBottom').mousedown(function() {
        	var padding = originalPaddingBottom - 1 + 'px';
        	$(this).animate({paddingBottom:padding}, 0);
        });
        
        // ---> MOUSE UP
        
         $('.decorationBottom').mouseup(function() {
        	$(this).animate({paddingBottom:originalPaddingBottom}, 0);
        });
        
        // ---> MOUSE OUT
        
         $('.decorationBottom').mouseout(function() {
        	$(this).animate({paddingBottom:originalPaddingBottom}, 0);
        });
	}
});

