// Adds the extra effects to the gallery

$(document).ready(function() {
	if ((jQuery.browser == 'msie')) {
		alert("IE7");	
	}
	$('#gallery').cycle({ 
		fx: 'scrollRight', 
		pause: 1, 
		speed: 500, 
		timeout: 6000,
		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++;
			}
		}
	});
});

$('#container').bind('click', function() {
	//$('.galleryInfoBox').slideUp();
	alert("changed");
});

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; 
        }); 
}); 
