var delay = 6000;
var timeSlide = 1000;
var new_title = '';

jQuery(document).ready(function(){
	
	new_title = $('#rotator UL.rotate-items LI:first').children('.rotate-text').children('.hidden-title').html();
	jQuery('.rotate-container .navigation TABLE TR TD.title P').html(new_title);
	
	 jQuery('#rotator UL.rotate-items').cycle({
		fx: 'fade',
		next:   '#next', 
		prev:   '#prev',
		before:  onBefore,
		after:   onAfter		
	});
	
	function onBefore() { 
		ww = parseInt(jQuery('.rotate-container .navigation TABLE TR TD.title P').width()) + 40;
		jQuery('.rotate-container .navigation TABLE TR TD.title').css('width', ww+'px');
		jQuery('.rotate-container .navigation TABLE TR TD.title P').fadeOut(200);
	} 
	
	function onAfter() { 
		new_title = jQuery(this).children('.rotate-text').children('.hidden-title').html();
		jQuery('.rotate-container .navigation TABLE TR TD.title').css('width', jQuery(this).children('.rotate-text').children('.hidden-title').width());
		jQuery('.rotate-container .navigation TABLE TR TD.title P').html(new_title).fadeIn(200);
	}
	
	jQuery('INPUT').click(function(){
		if (jQuery(this).attr('value') == jQuery(this).attr('title')) jQuery(this).attr('value', '');
	});
	jQuery('INPUT').blur(function(){
		if (jQuery(this).attr('value') == '') jQuery(this).attr('value', jQuery(this).attr('title'));
	});
	
	if (jQuery('.wpcf7-form').length > 0) {
		jQuery('div.wpcf7-response-output').replaceWith('');
		jQuery('.wpcf7').prepend('<div class="wpcf7-response-output wpcf7-display-none"></div>');
	};
	
	
	

});


