
// OnLoad
$(window).load(function() {

	$("#fadeBG").fadeTo(500, .8).fadeTo(1000,.98);

    

	$(".fader").fadeTo(1000, 1).fadeTo('slow', 0.6);	
	$(".fader2").fadeTo(1000, 0.6).fadeTo('fast', 1);	
	
	    $("#linkon").fadeTo(500, 0.8);
});







$(document).ready(function() {
	



	
			// Tweet ajax stuff
	
	$(".tweet").tweet({
            join_text: "auto",
            query: "ViewTheStory.com+Story4.us+TheStoryTraining.com+@ViewTheStory.com+@Spread_Truth+SpreadTruth.com",
            avatar_size: 48,
            refresh_interval: 30,
            count: 3,
            loading_text: "<span class=footer><table cellpadding=5><td><img src='images/loadingbig.gif'></td><td class=footer style='color:#ffffff'>Loading Tweets...</td></table></span>"
        });
	
	
	$(".tweetBig").tweet({
            join_text: "auto",
            query: "ViewTheStory.com+Story4.us+TheStoryTraining.com+spreadtruth.com+@Spread_Truth+@ViewTheStory",
            avatar_size: 48,
            refresh_interval: 30,
            count: 30,
            loading_text: "<span class=footer><table cellpadding=5><td><img src='images/loadingbig.gif'></td><td class=footer style='color:#ffffff'>Loading Tweets...</td></table></span>"
        });
	
	
	
	$(".vimeo").click(function() {
			$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'fade',
			'transitionOut'	: 'fade',
			'title'			: this.title,
			'width'			: 739,
			'height'		: 416,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'video/$1') + '?title=0&amp;byline=0&amp;color=e8932b&amp;autoplay=1',
			'type'			: 'iframe',
			 'swf'          : {'allowfullscreen':'true'}
		});

		return false;
	});

	
	
	
		/////////////////////////
 	// Fader Stuff
 	
 
	$('.fader2').hover(
		  function(){
			$(this).fadeTo('fast', 0.8);
			$('#fadeBG').fadeTo('fast', .6).fadeTo('fast',.98);
					  },
		  function(){
			$(this).fadeTo('slow', 1);
		});
		
		$('.fader2').click(
		  function(){
		  	$(".fader").fadeTo(0, 1);	
		  });
		
	
$('.fader').click(
		  function(){
		  	$(".fader").fadeTo(0, 0.6);	
		  	$(this).addClass('#linkon');
		  	$(this).fadeTo(0, 1);	

		});
		
		$('.fader').hover(
		  function(){
		  	
			$(this).fadeTo('fast', 1);
			$('#fadeBG').fadeTo('fast', 0.6).fadeTo('fast',.98);
	     
	        
	        
				  },
				  
		  function(){
		  	
			$(this).fadeTo('slow', 0.6);
			$('#linkon').fadeTo('fast',1);

		});
		
		
		// Fancybox
	
		$(".elastic").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'		:600, 
			'speedOut'		:200, 
			'overlayShow'	:	true,
			'autoscale'	: 	true,
			'type'		: 	'image',
			'padding'		: '5px',
			'overlayColor'	:	'#000000'
		});

		
		
		$("#video").click(function() {
			$.fancybox({
			'padding'		: '5px',
			'autoScale'		: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'title'			: this.title,
			'width'			: 739,
			'height'			: 416,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'video/14569895?title=0&amp;byline=0&amp;color=2d7287&amp;autoplay=1'),
			'type'			: 'iframe'
		});

		return false;
		});
		
		$("#video2").click(function() {
			$.fancybox({
			'padding'		: '5px',
			'autoScale'		: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'title'			: this.title,
			'width'			: 739,
			'height'			: 416,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'video/14569895?title=0&amp;byline=0&amp;color=2d7287&amp;autoplay=1'),
			'type'			: 'iframe'
		});

		return false;
		});
		
		$("#video3").click(function() {
			$.fancybox({
			'padding'		: '5px',
			'autoScale'		: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'title'			: this.title,
			'width'			: 739,
			'height'			: 416,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'video/14569895?title=0&amp;byline=0&amp;color=2d7287&amp;autoplay=1'),
			'type'			: 'iframe'
		});

		return false;
		});
		
		
		$("#video4").click(function() {
			$.fancybox({
			'padding'		: '5px',
			'autoScale'		: false,
			'transitionIn'		: 'fade',
			'transitionOut'		: 'fade',
			'title'			: this.title,
			'width'			: 739,
			'height'			: 416,
			'href'			: this.href.replace(new RegExp("([0-9])","i"),'video/14569895?title=0&amp;byline=0&amp;color=2d7287&amp;autoplay=1'),
			'type'			: 'iframe'
		});

		return false;
		});
	
		
function formatText(index, panel) {
    return index + "";
  }
  $('.anythingSlider').anythingSlider({
      easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
      autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
      delay: 6000,                    // How long between slide transitions in AutoPlay mode
      startStopped: false,            // If autoPlay is on, this can force it to start stopped
      animationTime:750,             // How long the slide transition takes
      hashTags: false,                 // Should links change the hashtag in the URL?
      buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
  pauseOnHover: true,               // If true, and autoPlay is enabled, the show will pause on hover
  startText: "Go",                  // Start text
  stopText: "Stop",                 // Stop text
  navigationFormatter: formatText   // Details at the top of the file on this use (advanced use)
  });	
		
	
	// Submit Buttons
	
	
	
	
	
});

