$(document).ready(function(){
	/*
	* Footer navigation
	*/
	
	$('footer nav ul a').hover(
		function() {
			$(this).stop().animate({ 'padding-left': '10px' }, 100);
		},

		// Hide
		function() {
			$(this).stop().animate({ 'padding-left': '0px' }, 400);
		}
	);
	
	/*
	* Smooth scrolling
	*/

		$('a.smoothScroll').bind('click',function(event){
			var $anchor = $(this);

			$('html, body').stop().animate({
				scrollTop: $($anchor.attr('href')).offset().top
			}, 1000,'easeInOutExpo');

			event.preventDefault();
		});
			
	/*
	* noSpam
	*/

		$.fn.nospam = function(settings) {
			settings = jQuery.extend({
				replaceText: false, 	// optional, accepts true or false
				filterLevel: 'normal' 	// optional, accepts 'low' or 'normal'
			}, settings);

			return this.each(function(){
				e = null;
				if(settings.filterLevel == 'low') { // Can be a switch() if more levels added
					if($(this).is('a[rel]')) {
						e = $(this).attr('rel').replace('//', '@').replace(/\//g, '.');
					} else {
						e = $(this).text().replace('//', '@').replace(/\//g, '.');
					}
				} else { // 'normal'
					if($(this).is('a[rel]')) {
						e = $(this).attr('rel').split('').reverse().join('').replace('//', '@').replace(/\//g, '.');
					} else {
						e = $(this).text().split('').reverse().join('').replace('//', '@').replace(/\//g, '.');
					}
				}
				if(e) {
					if($(this).is('a[rel]')) {
						$(this).attr('href', 'mailto:' + e);
						if(settings.replaceText) {
							$(this).text(e);
						}
					} else {
						$(this).text(e);
					}
				}
			});
		};
			
	/*
	*	Launchers
	*/
		
		// E-mail addresses
		$('a.emailReplaceLow').nospam({
		  replaceText: true,
		  filterLevel: 'low'
		});
		
		// Slideshows
		$('ul.slideshow').cycle({
			fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		});		
	
		// Lightbox
		$('.lightBox').each(function() {
			$(this).find('a').lightBox({fixedNavigation:false});
		});
		
		// Tabs
		$('ul.tabs').tabs(".tabContainer > section", {
			current: 'selected',
			effect: 'fade'
		});
		
		// // Sticky float
		// $('.sticky').stickyfloat({duration: 400});
});
