// MENU
// =========================
$(function(){$("nav ul li:first").addClass('first');});
$(function(){$("div#breadcrumb div a:last").addClass('current');});
$(function(){$("body#home aside#two section:last").addClass('last');});

// CUFON
// =========================
Cufon.replace('h1, h2, div.cta, div#title, ul#menu, .bulletsubtitlestyle, ul.homemenu, div#contactbtn', { fontFamily: 'RotisSansSerif', hover:true });
Cufon.replace('div#extra h3', { fontFamily: 'RotisSansSerif' });

// SLIDER
// =========================
$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true, 
		pause: 4000,
		ease: 'easeOutExpo',
		continuous: true
	});
});

// SLIDESHOW
// =========================
$(function(){
	$('.slideshow img:gt(0)').hide();
	setInterval(function(){$('.slideshow :first-child').fadeOut(2000).next('img').fadeIn(2000).end().appendTo('.slideshow');}, 5000);
});

// SLIDESHOW
// =========================
$(document).ready(function() {
	$(function() {
		$(".view-content-carousel").jMyCarousel({
			visible: 	'100%',
			auto: 		true,
			circular: 	true,
			speed:		2000
		});
	});
});

// CLEAR INPUT FIELDS SEARCH AND NEWSLETTER

$.fn.clearOnFocus = function(){
	return this.focus(function(){
		var v = $(this).val();
		$(this).val( v === this.defaultValue ? '' : v );
	}).blur(function(){
		var v = $(this).val();
		$(this).val( v.match(/^\s+$|^$/) ? this.defaultValue : v );
	});
};

$(document).ready(function() {
	$('div.newsletter-subscription input#formfield94').clearOnFocus();
	$('div#search input.searchField').clearOnFocus();
});
