$(document).ready(function() {	

	// Image Slider  	
	$('div.slider-image ul').cycle({ 
		fx:      'fade',
        timeout:  6000,
		pause:    1,
		pager:   'ul.switcher',
        prev:    'a.slider-left',
        next:    'a.slider-right'
	});
	
	
	// Clients Hover
	var vis = 1;
	$("div.client-container ul li").hover(function() { //On hover...												   
		
		$el = $(this);
		$img = $el.find('img:first');		   

		var imgSRC = $img.attr("src");

		//Set a background image(imgSRC) on the <a> tag - Set position to bottom
		$(this).find("a.thumb").css({'background' : 'url(' + imgSRC + ') no-repeat left -106px'});

		vis = vis === 0 ? 1 : 0;
		$img.stop().fadeTo(300, vis);
	});
	
	
	// Gallery
	$("#gallery a").click( function(){		
		$("div.main-image img").show();

		var selct = $(this).attr('href').slice(1);
		
    	$current = $('div.main-image img.'+selct);
		
		$current.css({opacity: 0.0})
    		.addClass('show')
    		.animate({opacity: 1.0}, 1000);
			
		$('div.main-image img').not('div.main-image img.'+selct)
			.removeClass('show')
			.animate({opacity: 0}, 1000);
		
		return false;
	});
	
});



// Text replacement
Cufon.replace('h2,h3,h4,ul.footer-links li, div.services-content h3', { hover: true });

// Lightbox
Shadowbox.init();
