//This on page ready
$(document).ready(function() {
	$('.homeLink, .backLink').slideto({
		target : '#home',
		speed  : 'slow'
	});
	
	$('.aboutLink').slideto({
		target : '#about',
		speed  : 'slow'
	});
	
	$('.eventsLink, .scheduleLink').slideto({
		target : '#events',
		speed  : 'slow'
	});
	
	$('.mediaLink').slideto({
		target : '#media',
		speed  : 'slow'
	});
	
	$('.contactLink').slideto({
		target : '#contact',
		speed  : 'slow'
	});
	
	//modal
	$(".privacy").overlay();
	
	$("img[rel]").overlay();
	
	//lightbox
	$(function() {
		$('a.lightbox').lightBox({fixedNavigation:true});
	});
	
	// wait until document is fully scriptable
	$(function() {

		// select #flowplanes and make it scrollable. use circular and navigator plugins
		$("#flowpanes").scrollable({ circular: false, mousewheel: false });
                var gallery = $("#flowpanes").data("scrollable");
                gallery.move(4);
		
		// select #flowplanes and make it scrollable. use circular and navigator plugins
		$("#flowpanes-photos").scrollable({ circular: false, mousewheel: false });
				
		// select #flowplanes and make it scrollable. use circular and navigator plugins
		$("#flowpanes-video").scrollable({ circular: false, mousewheel: false });
	});
	
	
	// Google tracking items
	$('#header a').click(function(){
		_gaq.push(['_trackEvent', 'Foundation Send a Gift', 'Click', $(this).html() ]);
	});
	
	$('a.sendgift').click(function(){
		_gaq.push(['_trackEvent', 'Foundation Send a Gift', 'Click', $(this).html() ]);
	});
	
	$('#flowpanes-photos').click(function(){
		_gaq.push(['_trackEvent', 'Media Photos', 'Click', $(this).html() ]);
	});	
	
	$('#flowpanes-video').click(function(){
		_gaq.push(['_trackEvent', 'Media Photos', 'Click', $(this).html() ]);
	});
	
	$('.desktopsDisplay a').click(function(){
		_gaq.push(['_trackEvent', 'Media Wallpapers', 'Click', $(this).html() ]);
	});
	
	
	$('.formBlock').click(function(){
		_gaq.push(['_trackEvent', 'Contact Links', 'Click', $(this).html() ]);
	});
	$('.footerTop a').click(function(){
		_gaq.push(['_trackEvent', 'Footer Links', 'Click', $(this).html() ]);
	});
	
        var fontSize = 18;
        var lineHeight = 22;

        while($('#twitter_feed').height() > 352) {
            fontSize = fontSize-2;
            lineHeight = lineHeight-2;
            $('#twitter_feed li').css('font-size',fontSize+"px");
            $('#twitter_feed li').css('line-height',lineHeight+"px");
        }
 });

