function SmoothScroll() {
	$('.scroll').click(function() {
	  if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	  && location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target
		|| $('[name=' + this.hash.slice(1) +']');
		if ($target.length) {
		  var targetOffset = $target.offset().top;
		  $('html,body')
		  .animate({scrollTop: targetOffset}, 1000);
		 return false;
		}
	  }
	});
}

$(document).ready(function(){
	
	SmoothScroll();
	$(document).pngFix();
	$('input').customInput();
	$("a[rel*='external']").attr({ target: "_blank" });
	
	Cufon.replace('h1, ul.nav li a', { fontFamily: 'Helvetica Rounded LT Std' });
	
	var volatile = $("input[type=text], textarea")
	volatile.focus(function(event){
        if ($(this).val() == $(this).attr("title") ){        
            $(this).val("");
        }}, volatile.blur(function(event){
            if ($(this).val() == "" ){        
                $(this).val($(this).attr("title"));
            }
        }
    ));
	
	
	$('ul.nav li').each(function(ind){
		if($(this).children('a').hasClass('selected') == false){
			$(this).fadeTo(0, 0.6);
		}
	})
	$('ul.nav li').mouseover(function(){
		$(this).stop().fadeTo("slow", 1);
	});
	$('ul.nav li').mouseout(function(){
		if($(this).children('a').hasClass('selected') == false){
			$(this).stop().fadeTo("slow", 0.6);
		}
	});
	
	$('a.logo').mouseover(function(){
		$(this).stop().fadeTo("slow", 0.6);
	});
	$('a.logo').mouseout(function(){
		$(this).stop().fadeTo("slow", 1);
	});
	
	$('#homeflash').empty();
	$('#homeflash').flash({
		src:"/_images/flash/woodreedlogo.swf",
		width:	600,
		height: 270,
		menu: false,
		quality: 'high'
	});
	
	$("#homenewsticker").empty();
	$("#homenewsticker").flash({
		src:"/_flash/ticker.swf",
		width:	'100%',
		height: 30,
		menu: false,
		quality: 'high',
		flashvars: {ticker_url: "/_flash/ticker.xml"}
	});
	/*if($("homenewsticker")){
		var flash = new FlashObject("/_flash/ticker.swf", "ticker", "100%", "30", "8", "#ffffff");
		flash.addVariable("ticker_url","/_flash/ticker.xml?cache=" + $time());
		flash.addParam("menu","false");
		flash.addParam("quality","high");
		flash.write("homenewsticker");
	}*/

	
	
});

