// JavaScript Document

// Front page nivo slider activation:
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:4000,
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		pauseOnHover:true, //Stop animation while hovering
		beforeChange: function(){},
		afterChange: function(){}
	});
});



//start by hiding quick contact form in header
$(document).ready(function() {
  $('#quickcontact').hide();
});

//show quick contact form in header
$(document).ready(function() {
    $('a.contact').click(function() {
    	$('li.drop').children('ul').hide();
        $('#quickcontact').toggle('slow', function() {
            $('#fname').focus();
        });
        return false;
    });
});

// showing name of section on front page on mouse over
$(document).ready(function() {
  $('#genres').children('li').children('a').children('span').hide();
  $('#genres').children('li').children('a').hover(function() {
	$(this).children('span').fadeIn('slow') }, function() { $(this).children('span').fadeOut('slow');
  });
});



// clear default input values when the field is active
/*$(document).ready(function() {
    $('input:not(#submit, :checkbox, :radio)').focus(function() {
        $(this).val('');
    });
});*/

//close button
$(document).ready(function() {
    $('a.close').click(function() {
        $('#quickcontact').hide('slow');
        return false;
    });
});

// menu dropdown
$(document).ready(function() {
    if (!$('#quickcontact').is(':visible')) {
        $('li.drop').hover(function() {
            $(this).children('ul').slideDown(75) }, function () { $(this).children('ul').slideUp('slow');
        });
    }
});

// gallery / fancybox
$(document).ready(function() {
	$("a.expand, a.edit").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
});
// progressive enhancement - hide the buy a print link if JS is enabled. It's in the popup window.
/*$(document).ready(function() {
  $(".buy_print").hide();
});*/
