$(function() {
    setInterval( "slideSwitch()", 5000 );
});


$(document).ready(function() {


$("#dropmenu ul").css({display: "none"}); // Opera Fix
$("#dropmenu li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(268);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});



			$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
				padding: 40, /* padding for each side of the picture */
				opacity: 0.75, /* Value betwee 0 and 1 */
				showTitle: true, /* true/false */
				allowresize: true, /* true/false */
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'dark_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
				callback: function(){}
			});



});



function deroul(obj,nbr) {  

if (document.getElementById("obj"+ obj).className == 'masquageHide') {
       for (i=1; i<=nbr; i++) {
       document.getElementById("obj" + i).className = "masquageHide";
        }       
	   document.getElementById("obj"+ obj ).className = "masquageShow";
}
else { 
   document.getElementById("obj"+obj).className = 'masquageHide' ; 
}
}



function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 500, function() {
            $active.removeClass('active last-active');
        });
}


