function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: false,          // 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)
            });                      						
            
        });
		
$(document).ready(function()	{	
	
	// Next Link
	$(".anythingSlider .wrapper a.next")
		.click(function()	{
			$("a.forward").click();
		});
	
	// Sort work drop down
	$('#sort_work li').hover(  
	     function () {  
             //show its submenu  
             $('ul', this).slideDown(200);  
   
         },   
         function () {  
             //hide its submenu  
             $('ul', this).slideUp(200);           
        }  
     );
	
	// Share link
	$("a.share").click(function()	{
		cover();							
	});
	
	function cover()	{
		var docHeight = $(document).height();
		var docWidth = $(document).width();
		var winHeight = $(window).height();
		var winWidth = $(window).width();
		
		$('<div id="cover"></div>').prependTo('body');
		$('<div id="popup"></div>').prependTo('body');
		$('<div id="mar_div"></div>').appendTo('#popup');	
		
		$("#cover").css({
						backgroundColor: '#000',
						position: 'absolute',
						zIndex: 9999,
						width : docWidth,						
						opacity : 0.7,
						display: "block",
						left:0,
						top:0
						});
		
		$("#mar_close").css({
							position : 'absolute',
							top : 0,
							right : 5,							
							fontWeight: 'bold',
							color: '#393939',
							textDecoration: 'none',
							fontSize : '12px'
							});				
		
		$('#popup').css({
						position: 'absolute',
						zIndex: 10000,					
						width: '440px',
						display: 'block',						
						marginTop: '5px'
						});
		
		$("#cover").animate({
							height : docHeight
							}, popUp());
		
		function popUp()	{
			$("#mar_div").html($("#sharebox").html());
			boxWidth = $("#popup").width();
			boxHeight = $("#popup").height();
			
			topPos = (winHeight - boxHeight) / 2;
			leftPos = (winWidth - boxWidth) / 2;			
			
			$("#popup").css({
									   top : topPos,
									   left : leftPos
									   }).fadeIn();			
			
			$("#mar_close").click(function()	{
								$('#cover').remove();
								$('#popup').remove();
								$('#mar_div').remove();								
								return false;
							 });
		}
	}
		
	
});
