$(document).ready(function() {
	// cycle plugin for header images slideshow
	$('#images').cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		timeout: 3000,
		random: 1,
		pause: 1,
		next:   '#next', 
		prev:   '#prev',
		cleartype:  true,
		cleartypeNoBg:  true
	});
	
	// smooth go to the top
    $('a[href*=#head]').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;                
            }            
        }        
    });	
	
});
