$(document).ready(function() {
// LOGIN
	$(".topMenuAction").click( function() {
		if ($("#openCloseIdentifier").is(":hidden")) {
			$("#slider").animate({ 
				marginTop: "-130px"
				}, 500 );
			$("#topMenuImage").html('<img src="_Pics/open.png">');
			$("#openCloseIdentifier").show();
		} else {
			$("#slider").animate({ 
				marginTop: "0px"
				}, 500 );
			$("#topMenuImage").html('<img src="_Pics/close.png">');
			$("#openCloseIdentifier").hide();
		}
	});
	
	// FOOTER LINKS
	$('.listLinks').easyListSplitter({ colNumber: 4 });
});


// Media Slideshow

var fadeDuration=2000;
var slideDuration=4000;

var currentIndex=1;
var nextIndex=1;
	
$(document).ready(function(){
	$('ul.slideshow').css('display','block');
	$('ul.slideshow li').css({opacity: 0.0});
	$("'ul.slideshow li:nth-child("+nextIndex+")'").animate({opacity: 1.0}, fadeDuration);
	var timer = setInterval('nextSlide()', slideDuration);
})
	
function nextSlide(){
	nextIndex =currentIndex+1;
	if(nextIndex > $('ul.slideshow li').length){
		nextIndex =1;
	}
	
	$("'ul.slideshow li:nth-child("+nextIndex+")'").addClass('show').animate({opacity: 1.0}, fadeDuration);
	$("'ul.slideshow li:nth-child("+currentIndex+")'").animate({opacity: 0.0}, fadeDuration);
	currentIndex = nextIndex;
}
