function positionSideLinks() {
		var windowWidth = $(window).width();
		var quickLinks = $('#side-quick-link').width();
		var wrapperWidth = $('#wrapper').width();
		var quickLinksPosition = ((windowWidth - wrapperWidth) / 2) - quickLinks - 3;
		$('#side-quick-link').css('right', quickLinksPosition);
}

$(document).ready(function(){
	$("ul.sf-menu").superfish({autoArrows: false,dropShadows: false});
	$('#wrapper').css('height', $(document).height());
	$('#header-pics') 
	.before('<div id="pager_nav">') 
	.cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		timeout: 12000, 
		pager:  '#pager_nav' 
	});
	positionSideLinks();
	$(window).resize(function() {
	   positionSideLinks();
	});	

	var x = 0;
	var colorSchemes = Array('pink', 'blue', 'orange', 'green', 'purple', 'dark-blue');
	var maxLength = 10;
   
	$('ul#top-nav-buttons li>a').not('ul#top-nav-buttons li li>a').each(function(i){
		var innerSize = $(this).html().length;
		if(x > (colorSchemes.length - 1)) {
			x = 0;
		}
		
		$(this).parent('li').mouseover(function(i){
			$(this).addClass('hover');
		}).mouseout(function(i){
			$(this).removeClass('hover');
		});

		if(innerSize > maxLength) {
			$(this).addClass('top-nav-button-wrap');
		}
		$(this).css('background', 'url(img/topnav-buttons/' + colorSchemes[x] + '.gif) center 3px no-repeat');
		x++;
      });

});

