$(document).ready(function() { 
	
	//xhtml valid target="_blank"
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() {
	window.open(this.href);
	return false;
	});
	
	// loads uniforms plugin
	$("input, textarea, select, button").uniform();
	
	// Fancy scroll to top
	$('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 400);
        return false;
    });
    
    // Adds .first and .last classes to the first & last main navigation items
	$('#main-nav ul li:first-child').addClass( 'first' );
	$('#main-nav ul li:last-child').addClass( 'last' );
	
	//Top Menu
	$('.menu-top ul li:first-child').addClass( 'first' );
	$('.menu-top ul li:last-child').addClass( 'last' );
	
	//Sidebar
	$('#sidebar ul li:first-child').addClass( 'first' );
	$('#sidebar ul li:last-child').addClass( 'last' );
	
	//Footer
	$('#footer-nav ul li:first-child').addClass( 'first' );
	$('#footer-nav ul li:last-child').addClass( 'last' );
	
	$('#wpng-cal-widget-events ul li:last-child').addClass( 'last' );
	
	
	//Homepage Slider
    $('#slideshow').cycle({
    width: 940,
    height: 300,
    fit: 1,
    fx: 'none',
    timeout: 0,
    pager: '#slide-nav',
    pagerEvent: 'mouseover',
    pauseOnPagerHover: true,
    slideExpr: 'img',
    allowPagerClickBubble: true, 
    manualTrump:     false,
    pagerAnchorBuilder: function(idx, slide) { 
        return '#slide-nav li:eq(' + idx + ') a'; 
    } 
	});
	
	/*
	$('#slideshow').cycle({
    width: 940,
    height: 300,
    fit: 1,
    fx: 'fade',
    speed: 300, 
    timeout: 6000,
    pager: '#slide-nav',
    pagerEvent: 'click.cycle',
    pauseOnPagerHover: true,
    slideExpr: 'img',
    allowPagerClickBubble: true, 
    manualTrump:     false,
    pagerAnchorBuilder: function(idx, slide) { 
        return '#slide-nav li:eq(' + idx + ') a'; 
    } 
	});
	*/
	
});


