// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {

// choose text for the show/hide link
var showText="Show Tweets!";
var hideText="Hide Tweets!";

// create the toggle link
$("#hide_this").before("<p align='center'><a href='#' id='toggle_link' class='tweet'>"+showText+"</a></p>");

// hide the content
$('#hide_this').hide();

// capture clicks on the newly created link
$('a#toggle_link').click(function() {

// change the link text
if ($('a#toggle_link').text()==showText) {
$('a#toggle_link').text(hideText);
}
else {
$('a#toggle_link').text(showText);
}

// toggle the display
$('#hide_this').toggle('slow');

// return false so any link destination is not followed
return false;
				});





 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)
  $('#slickbox').hide();
 // shows the slickbox on clicking the noted link
  $('a#slick-show').click(function() {
 $('#slickbox').show('slow');
 return false;
  });
 // hides the slickbox on clicking the noted link
  $('a#slick-hide').click(function() {
 $('#slickbox').hide('fast');
 return false;
  });
 // toggles the slickbox on clicking the noted link
  $('a#slick-toggle').click(function() {
 $('#slickbox').toggle(400);
 return false;
  });


  
  $('.share a').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
});
  
  $('.portlinks a').tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    showBody: " - ", 
    fade: 250 
});




				//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
				//Vertical Sliding
				$('.boxgrid.slidedown').hover(function(){
					$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
				});
				//Horizontal Sliding
				$('.boxgrid.slideright').hover(function(){
					$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
				});
				//Diagnal Sliding
				$('.boxgrid.thecombo').hover(function(){
					$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
				}, function() {
					$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
				});
				//Partial Sliding (Only show some of background)
				$('.boxgrid.peek').hover(function(){
					$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
				});
				//Full Caption Sliding (Hidden to Visible)
				$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
				});
				//Caption Sliding (Partially Hidden to Visible)
				$('.boxgrid.caption').hover(function(){
					$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
				}, function() {
					$(".cover", this).stop().animate({top:'220px'},{queue:false,duration:160});
				});




});





var $container;
		
		$(document).ready(	
			function() {
				$container = $("#Scontainer");
				$container.wtRotator({
					width:960,
					height:200,
					background_color:"#fff",
					border:"0px solid #333",
					button_width:24,
					button_height:24,
					button_margin:4,
					auto_start:true,
					delay:3000,
					transition:"fade.left",
					transition_speed:1000,
					block_size:100,
					vert_size:50,
					horz_size:100,
					cpanel_align:"BR",
					display_thumbs:false,
					display_dbuttons:false,
					display_playbutton:false,
					display_tooltip:false,
					display_numbers:false,
					cpanel_mouseover:false,
					text_mouseover:false
				});
		
				$("#transitions").val("random").change(
					function() {
						changeTransition($(this).val());
					}
				);
				
				$("#cpalignments").val("BR").change(
					function() {
						changeCPAlign($(this).val());
					}
				);
				
				$("#thumbs-cb").attr("checked", "checked").change(
					function() {
						displayThumbs($(this).attr("checked"));	
					}
				);
				
				$("#dbuttons-cb").attr("checked", "checked").change(
					function() {
						displayDButtons($(this).attr("checked"));	
					}				
				);
 
				$("#playbutton-cb").attr("checked", "checked").change(
					function() {
						displayPlayButton($(this).attr("checked"));	
					}				
				);
				
				$("#tooltip-cb").attr("checked", "checked").change(
					function() {
						displayTooltip($(this).attr("checked"));	
					}				
				);								
				
				$("#text-cb").attr("checked", "").change(
					function() {
						changeDescMouseover($(this).attr("checked"));	
					}				
				);
				
				$("#cpanel-cb").attr("checked", "").change(
					function() {
						changeCPMouseover($(this).attr("checked"));	
					}				
				);				
			}
		);
		
		function changeTransition(transition) {
			$container.updateTransition(transition);
		}
 
		function changeCPAlign(align) {
			$container.updateCpAlign(align);
		}
		
		function displayThumbs(display) {
			$container.displayThumbs(display);	
		}
	
		function displayDButtons(display) {
			$container.displayDButtons(display);	
		}
		
		function displayPlayButton(display) {
			$container.displayPlayButton(display);	
		}
			
		function displayTooltip(display) {
			$container.displayTooltip(display);	
		}
					
		function changeDescMouseover(mouseover) {
			$container.updateMouseoverDesc(mouseover);			
		}
		
		function changeCPMouseover(mouseover) {
			$container.updateMouseoverCP(mouseover);
		}
