// JavaScript Document
// Copyright 2011, DEETRA
// Website by Minimal +
$(document).ready(function() {
	// iPhone address bar
	
	// Background image
	jQuery(function($){
		$.supersized({
			slides	:  [ { image : 'images/deetra_main.jpg' } ]					
		});
	});	
	// Link color morph
	jQuery(function ($) {
	    $('a').each(function () {
	        var $el = $(this),
	            orig = $el.css('color');
	        $el.hover(function () {
	            $el.stop().animate({ color: '#8d4e76' }, 400);
	        },function () {
	            $el.stop().animate({ color: orig }, 400);
	        });
	    });
	});
	// Navigation toggle
	$('#brand, #campaigns, #collection, #inquiries').hide();
	$('.home').click(function() {
	    var id = $(this).attr("id").replace("show_","").toLowerCase();
	    var $content = $('#' + id + ':not(:visible)');
	    if ($('.current').length === 0) {
	        showContent($content)
	    }
	    else {
	        $('.current').fadeOut(600, function() {
	            showContent($content)
	        });
	    }
	    $('.home').css('text-decoration', 'none');
	    $(this).css('text-decoration', 'underline');
	});
	function showContent(content) {
	    content.fadeIn(600);
	    $('.current').removeClass('current');
	    content.addClass('current');
	}
	$('.close').click(function() {
	    $('.current').fadeOut(600);
		$('.home').css('text-decoration', 'none');
	});
});
