$(document).ready(function(){

//home page cycle without flash
$('.tracks').cycle({
speed:   1000, 
timeout: 5000,
next: '.next',
prev: '.prev'
});

//add class to Parent nav items on click
$('#nav>li>a').each(function(){
$(this).parent().addClass($(this).text().replace(/\s/,''))
});

//dropdown nav
$('ul#nav').superfish();


//request search show hide
$('.rs-content').hide();
$('a.rs-toggle').click(function() {
$('.rs-content').toggle();
$(this).toggleClass('selected');
return false;
});


//footer slider
$(function() {
$('#footerSlideButton a').click(function () {
$('#footerSlideContent').slideToggle();
$(this).toggleClass("close"); return false;
});
});

//remove default input text and add class
$('input[type="text"],textarea').addClass("idleField");
$('input[type="text"],textarea').focus(function() {
$(this).removeClass("idleField").addClass("focusField");
if (this.value == this.defaultValue){ 
this.value = '';
}
if(this.value != this.defaultValue){
this.select();
}
});
$('input[type="text"],textarea').blur(function() {
$(this).removeClass("focusField").addClass("idleField");
if ($.trim(this.value) == ''){
this.value = (this.defaultValue ? this.defaultValue : '');
}
});
});
