// Adds the extra effects to the gallery

$(document).ready(function() {

	$('#featured').cycle({ 
		fx: 'cover', 
		pause: 1, 
		speed: 0, 
		timeout: 0,
		cleartype:  1,
		after: function(curr, next, opts) {
			var $kids = $('#galleryNav').children();
			var counter = 0;
			while (counter < ($kids.length)) {
				if (counter == (opts.currSlide)) {
					$("#" + counter + "_link").addClass("selected");
				} else {
					$("#" + counter + "_link").removeClass("selected");	
				}
				counter++;
			}
		}
	});
	$('#featured').fadeIn('fast');
});

$('#featured').mouseover(function() {
	$('.textover').slideUp();
});

var bc = $('#galleryNav'); // navigation links for the gallerys

$('#container').children().each(function(i) { 
    // create input 
    $('<input type="button" value="'+(i+1)+'" />') 
        // append it to button container 
        .appendTo(bc) 
        // bind click handler 
        .click(function() { 
            // cycle to the corresponding slide 
            $('#container').cycle(i); 
            return false; 
        }); 
}); 
