$(document).ready(function() {
	/*** hide and show default input values (search) ***/	
	if ($('#Search').length > 0) {
		$('#Search input[type="text"]').focus(function() {
	        if (this.value == this.defaultValue) {
	        	this.value = '';
	    	}
	        if(this.value != this.defaultValue) {
		    	this.select();
	        }
	    });
	
	    $('#Search input[type="text"]').blur(function() {
	        if (this.value == ''){
	        	this.value = (this.defaultValue ? this.defaultValue : '');
	    	}
	    });
    }
    
	/*** home page ***/
	if ($('#FeatureItems').length > 0) {
		$('#FeatureItems')
		.cycle({
			fx: 'fade',
			speed: 'slow',
			timeout: 8000,
			pager: '#Pager .pages'
		});
		
		// pause cycle
		$('#Pager .pause').live('click', function(){
			$('#FeatureItems').cycle('pause');
			$(this).removeClass('pause').addClass('resume');
			$(this).html('Resume');
		});
		
		// resume cycle
		$('#Pager .resume').live('click', function(){
			$('#FeatureItems').cycle('resume');
			$(this).removeClass('resume').addClass('pause');
			$(this).html('Pause');
		});
	}
});
