$(document).ready(function(){


						   

$('ul.superfish').superfish({dropShadows: false});
	
	 //set the starting bigestHeight variable  
     var biggestHeight = 0;  
     //check each of them  
     $('.equal_height').each(function(){  
         //if the height of the current element is  
         //bigger then the current biggestHeight value  
         if($(this).height() > biggestHeight){  
             //update the biggestHeight with the  
             //height of the current elements  
             biggestHeight = $(this).height();  
         }  
     });  
     //when checking for biggestHeight is done set that  
     //height to all the elements  
     
	
//When page loads...
//	$(".tab_content").hide(); //Hide all content
	//$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	//$(".tab_content:first").show(); //Show first tab content

	//On Click Event
//	$("ul.tabs li a").hover(function() {
//
//		$("ul.tabs li").removeClass("active"); //Remove any "active" class
//		$(this).addClass("active"); //Add "active" class to selected tab
//		$(".tab_content").slideUp(300); //Hide all tab content
//
//		var activeTab = $(this).attr("rel"); //Find the href attribute value to identify the active tab + content
//		$(activeTab).slideDown(300); //Fade in the active ID content
//		
//		return false;
//		}, function() {	
//		$(this).removeClass("active"); //Remove any "active" class
//		//$(".tab_content").slideUp(300); //Hide all content
//	});
	
	
   	var winHeight = $(window).height();
	//var wrapHeight = $('.homeWrap').height();
	//alert(winHeight);
	
	if (winHeight < 700 ) { // if win height is less than page height resize
		$('.homeWrap').height(winHeight);
		$('.slideshow').height(winHeight - 26);
	};
	if (winHeight < 400 ) { // 500 min height
		$('.homeWrap').height(400);
		$('.slideshow').height(374);
	};
	
	
	 var biggestHeight2 = 0;  
			     //check each of them  
     $('.widget').each(function(){  
         //if the height of the current element is  
         //bigger then the current biggestHeight value  
         if($(this).height() > biggestHeight2){  
             //update the biggestHeight with the  
             //height of the current elements  
             biggestHeight2 = $(this).height();  
         }  
     });  
     //when checking for biggestHeight is done set that  
     //height to all the elements  
     $('.widget').height(biggestHeight2);  

});



function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingFader').anythingFader({
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 5000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 300,             // How long the slide transition takes
                hashTags: true,                 // 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
				stopAtEnd : true,
                stopText: "Stop",               // Stop text
                navigationFormatter: formatText   // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingFader').anythingFader(6);
            });
            
        });


$(window).resize(function(){
						   
		   	var winHeight = $(window).height();
	//var wrapHeight = $('.homeWrap').height();
	//alert(winHeight);
	
	if (winHeight < 700 ) { // if win height is less than page height resize
		$('.homeWrap').height(winHeight);
		$('.slideshow').height(winHeight - 26);
	};
	if (winHeight < 400 ) { // 500 min height
		$('.homeWrap').height(400);
		$('.slideshow').height(374);
	};				   
						   
});						   
