/*$(document).ready(function()
		{
		
     // $('ul.gallery').galleria();
	  
	  //{options}
	  	$('ul.gallery').addClass('gallery_demo'); // adds new class name to maintain degradability
    	//$('.nav').css('display','none'); // hides the nav initially
   
     	$('ul.gallery_demo').galleria({
    				history : false, // deactivates the history object for bookmarking, back-button etc.
    				clickNext : false, // helper for making the image clickable. Let's not have that in this example.
 		 			insert : undefined, // the containing selector for our main image.
  		// If not found or undefined (like here), galleria will create a container
  		// before the ul with the class .galleria_container (see CSS)
  		//onImage : function() { $('.nav').css('display','block'); } // shows the nav when the image is showing
		}); 

		
});// JavaScript Document*/

$(document).ready(function() {

/*
bg_bind = true;
 do_bg_bind();

$("#block-custom_pagers-3").bind("mouseenter", function(e){
		$("#content").css("visibility", "hidden");
		$(".block:not(#block-custom_pagers-3)").css("visibility", "hidden");
		
	
});

$("#block-custom_pagers-3").bind("mouseleave", function(e){
	$("#content").css("visibility","visible");
	$(".block").css("visibility", "visible");
	
});*/





var temp = $("#thumbs.process");
	//console.log(temp);
	
	if(temp.length != 0 ) {
	
	$('#thumbs').galleriffic({
						
						imageContainerSel:      '#slideshow',
						controlsContainerSel:   '#controls'
						
						
					});
}





var temp = $("#thumbs.page > li");
//console.log(temp);

if(temp.length > 1 ) {
	$('#thumbs').galleriffic({
						
						imageContainerSel:      '#slideshow',
						controlsContainerSel:   '#controls',
						captionContainerSel:    '#caption',
						renderSSControls:        false,
						renderNavControls:       false,

						enableBottomPager:      false,
						delay:                  6000,
						autoStart:              true,
						
						onPageTransitionIn:     function() {
							
							$('#thumbs').show();
						}							
				
						
						
					});

} else {
		$("#slideshow").prepend("<img src='" + temp.find("a").attr("href") + "' />");
				$('#thumbs').hide();

}


var temp = $("#thumbs.process_area > ul > li");
	//console.log(temp);
	
	if(temp.length > 1 ) {
	
	$('#thumbs').galleriffic({
						
						imageContainerSel:      '#slideshow',
						controlsContainerSel:   '#controls',
						captionContainerSel:    '#caption',
						renderNavControls:      false,
						enableBottomPager:      false,
						delay:                  6000,
						autoStart:              true
						
						
					});
} else {		
		$("#slideshow").prepend("<img src='" + temp.find("a").attr("href") + "' />");
		$('#thumbs').hide();
}




/*$("#gallery").easySlider({
			prevId: 		'prevBtn',
			prevText: 		'Previous',
			nextId: 		'nextBtn',	
			nextText: 		'Next',
			controlsShow:	true,
			controlsBefore:	'',
			controlsAfter:	'',	
			controlsFade:	true,
			firstId: 		'firstBtn',
			lastId: 		'lastBtn',	
			lastShow:		false,				
			vertical:		false,
			speed: 			1000,
			auto:			false,
			pause:			2000,
			continuous:		true
			});


*/



/*// Gelleria
jQuery(function($) {
		
		$('ul.gallery').addClass('gallery_demo'); // adds new class name to maintain degradability
		
			
		
		$('ul.gallery_demo').galleria({
			history   : false, // activates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable
			insert    : '#main_image', // the containing selector for our main image
			onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
					//image.css('display','none').fadeIn(500);
				}
				//caption.css('display','none').fadeIn(500);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				// _li.siblings().children('img.selected').fadeTo(500,0.3);
				_li.siblings().children('img.selected').fadeTo(250,0.4);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',1).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next image >>');
				
				
				
				return false;
				
			},
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '1' : '0.4';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(500);
				
				// hover effects
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',0.4); } // don't fade out if the parent is active
				)
			}
		});
	});

*/
	
/*$('.imagecache').qtip({
   content: false,
   show: 'mouseover',
   hide: 'mouseout'
})*/
/*$('a[title] img').qtip({  
	content: {
	text: false // Use each elements title attribute
	},
	style: { 
	name: 'cream', 
	tip: true 
	}
 });
*/

 });

// Lightbox
/*$(function() {
	$('ul.gallery >li > a').lightBox({fixedNavigation:true});
});*/
