
/*This will add some nice behavior to form inputs and text fields
  add the class "clear-text" to the input or text-field to include
  this behavior*/
function clearText(field){
  if (field.defaultValue == field.value) field.value = '';
  else if (field.value == '')
    field.value = field.defaultValue;
}
function initFormTextClear(){
  jQuery("input[type=text].clear-text, textarea.clear-text").blur(
    function(event){clearText(event.target);}
  );
  jQuery("input[type=text].clear-text, textarea.clear-text").focus(
    function(event){clearText(event.target);}
  );
}

/*Adds list classes for first and last list elements*/
function initListClasses(){
  jQuery('ul li:first-child').addClass( 'list-first' );
  jQuery('ul li:last-child').addClass( 'list-last' );
  jQuery('ol li:first-child').addClass( 'list-first' );
  jQuery('ol li:last-child').addClass( 'list-last' );
  jQuery('.order-it *:first-child').addClass( 'first-element' );
  jQuery('.order-it *:last-child').addClass( 'last-element' );
}

function initFont(){
  Cufon.replace('h1.slideshow-title', {
				textShadow: '0 -1px 1px rgba(0, 0, 0, 0.9)'
			});
 Cufon.replace('h1.page-title');

}

/*function initSlideshow(){
jQuery('.slideshow').each(function(index){

  jQuery(this).cycle({
  		  fx: index ? 'fade':'scrollLeft'
  		, timeout:  6000  // choose your transition type, ex: fade, scrollUp, shuffle, etc...
  		, next: '#slideshow-next'
  		, prev: '#slideshow-prev'
  	});

});
}*/



function initSlideshow(){
jQuery('.slideshow').each(function(index){

  jQuery(this).cycle({
  		  fx: index ? 'fade':'scrollLeft'
  		, timeout:  8000  // choose your transition type, ex: fade, scrollUp, shuffle, etc...
  		, next: '#slideshow-next'
  		, prev: '#slideshow-prev'
  		, containerResize: 1
  	});

});
}

jQuery(document).ready(function() {



//  initSlideshow();
  initFormTextClear();  
  //initQTip();
  initListClasses();
  initFont();
  //initSuperfish();
  //initInputEffects();
 
});

