// Create some function
(function($){
	$.fn.extend({
		functionName: function() {
			// Some function
		}
	});
})(jQuery);

// Execute when document is ready
$(document).ready(function(){
	$("#newsletter-block").validate();
	$("#call-form").validate();
	
	//$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\bLivingprojects\b/gi, '<span style="font-weight:bold;font-style:normal;">living</span><span style="font-weight:normal;font-style:italic;">projects</span>' );
	/*$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\blivingprojects\b/gi, 'Livingprojects' );
	$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\bLivingProjects\b/gi, 'Livingprojects' );
	$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\bliving projects\b/gi, 'Livingprojects' );
	$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\bLiving projects\b/gi, 'Livingprojects' );
	$('#content').find(':not(textarea):not(img):not(a)').replaceText( /\bLiving Projects\b/gi, 'Livingprojects' );*/
	
});

// Ticker function
$(function(){
	var ticker = function(){
		setTimeout(function(){
			$('#ticker-list li:first').animate( {marginTop: '-35px'}, 800, function(){
				$(this).detach().appendTo('ul#ticker-list').removeAttr('style');
			});
			ticker();
		}, 4000);
	};
	ticker();
});

window.onload = function(){
	// Shadowbox for images
	Shadowbox.init({
	    handleOversize: "resize",
	    modal: true,
	    overlayOpacity: 0.9
	});	
}

// Use nivoslider for awesome effects
$(window).load(function() {
    $('#slider').nivoSlider({
    	controlNav: false,
    	pauseTime:8000,
    	directionNav: false
    });
});
