// Input Forms Adjustments

$(document).ready(function() {
    $('input[type="text"]').addClass("idleField");
	$('input[type="text"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"]').blur(function() {
    	$(this).removeClass("focusField").addClass("idleField");
        if ($.trim(this.value == '')){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}
    });
});

// Home/Index Featured Slideshow

$(function() {
 	$('#home-feature-slideshow').after('<div id="nav-container"><ul id="home-feature-nav">').cycle({ 
	    fx:     'fade', 
	    speed:  3000,
	    pager:  '#home-feature-nav', 
		// callback fn that creates a thumbnail to use as pager anchor 
		pagerAnchorBuilder: function(idx, slide) { 
		   return '<li><a href="#"><img src="/img/header/feature_navigation.png" alt="feature ' + (idx+1) + '"/></a></li>'; 
		}
	
	});
});

// Sponsor Logo Block Rotation

$(function() {
    $('.slideshow').cycle({
		fx: 'fade'
	});
});


// Walkability Slideshow 

$(function() {
    $('.walkability_slideshow').cycle({
		fx: 'scrollHorz',
		pager: '#num',
		timeout: 0,
		next:'#next', prev:'#prev',
	});
});