/**
 * plugins
 * -------------------------------------------------------------- */
(function($) {

	/**
	 * exists
	 * -------------------------------------------------------------- */
	$.fn.exists = function() {
		if ($(this).length > 0) return true;
	}
	
})(jQuery);

/**
 * on dom ready
 * -------------------------------------------------------------- */
$.noConflict();
jQuery(document).ready(function($) {
	$(".gallery").colorbox({rel:'img-gallery'});
	$(".campioni").colorbox({rel:'img-campioni'});
	$(".zoom").colorbox();
	$(".video").colorbox({iframe:true, innerWidth:644, innerHeight:383});
	$('.slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	$(".privacy").colorbox({inline:true, width:"50%", height:"90%"});
	$(".inchiostri").colorbox({iframe:true, width:"90%", height:"90%"});
	
	$('#searchform input.testo').addClass("idleField");
	$('#searchform input.testo').focus( function() {
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ this.value = ''; }
		if(this.value != this.defaultValue){ this.select(); }
	});
	$('#searchform input.testo').blur( function() {
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == ''){ this.value = (this.defaultValue ? this.defaultValue : ''); }
	});
	
	
});
