$(document).ready(function() {
	$(".btn a, .btn span").hover(
      function () { $(this).stop().fadeTo("fast", 0.2);   }, 
      function () { $(this).stop().fadeTo("fast", 0); }
    );
	$("#nav a").hover(
      function () { $(this).stop().fadeTo("fast", 0.5);   }, 
      function () { $(this).stop().fadeTo("fast", 1); }
    );
    
	$('div.login .btn').toggle(function(){ 
			$(this).parent().stop().animate( { 'top': '0px' }, 200).find('form').fadeIn('fast');
		}, function() {
			$(this).parent().stop().animate({ 'top': '-97px' }, 100).find('form').fadeOut('fast');
	});
	if ($('div.loginMessage p.error').length>0) {
		$('div.login').stop().animate( { 'top': '0px' }, 200).find('form').fadeIn('fast');
	};

	swapValue = [];
	$("input[type=text], input[type=password]").each(function(i){
 		swapValue[i] = $(this).val();
   		$(this).focus(function(){
      		if ($(this).val() == swapValue[i]) { 
	  	  		$(this).val(""); }
	      		$(this).addClass("focus");
   		}).blur(function(){
      		if ($.trim($(this).val()) == "") { 
	  	  		$(this).val(swapValue[i]);  
	  	  		$(this).removeClass("focus"); }
   		});
	});
	$('ul.slideshow > li:gt(0)').hide();
	setInterval(function(){
		$('ul.slideshow li:first-child').fadeOut().next('li').fadeIn().end().appendTo('ul.slideshow');
	}, 5000);

    	// $("div#sidenav h4").click(function(){
    	// 			$(this).next("ul").slideToggle("slow").siblings("ul:visible").slideUp("slow");
    	// 			$(this).toggleClass("expand");
    	// 			$(this).siblings("h4").removeClass("expand");
    	//     	});		    
});

	// $('div.login .btn').click(function(){
	// 			$('form').stop().animate( { 'bottom': '0px' }, 200);
	// 		}, function() {
	// 			$('form').stop().animate({ 'bottom': '-120px' }, 100);
	// 		});
	// 	
