$(document).ready(function(){

    // Home page image rotation
	if ($('#feature-img').length)
	{
	    $('#feature-img').cycle({ 
	            fx:'fade',
	            speed: 1000,
	            timeout: 4000
	        });
    }  
  
    // Home page news ticker
	if($('#feature-img').length)
	{    
		
		var total = $('#news-promo div').length;
		var rIndex = Math.floor(Math.random() * total);
		
		$('#news-promo div').each(function(i){
			$(this).hide();
			if (i == rIndex) {
				$(this).show();
			}
			
		});
	
     }
  
    // Toggle text in email field
	$('#signup-email').focus(function() {
		if(this.value == this.defaultValue) {
			this.value = "";
		}
	}).blur(function() {
		if(!this.value.length) {
			this.value = this.defaultValue;
		}
	});
    
});