$(document).ready(function() {
	
	//Show/hide footer
	$('#footerbtn a').click(function(){

		class = $('#footer').attr('class');
		if (class == 'open') {
			$('#footer').removeClass().addClass('close');;
			$('#footer .container').animate({ height: "toggle"}, 300);

		}
		else if (class == 'close') {
		
			var height = $('#footer .container').height();
			var docHeight = $(document).height();
			var windowHeight = $(window).height();
			var scrollPos = docHeight - windowHeight + height + 40;
			
			$('#footer').removeClass().addClass('open');;
			$('#footer .container').animate({ height: "toggle"}, 300);
			$('html, body').animate({scrollTop: scrollPos+'px'}, 300);


		}
		
		return false;
	})
	
	$('.reply a').click(function(){
		id = $(this).attr('rel');				
		
		$('#reply_id').val(id);
		
	})
	/*
	$('#ws_submit').click(function(){
		
		num1 = $('#num1').attr('innerHTML')*1;
		num2 = $('#num2').attr('innerHTML')*1;
		num = num1 + num2;
		result = $('#captcha').val()*1;
	
		if (result != num) {
			alert('Incorrect captcha');
			return false;
		}
		
	})
	
	*/	
	/*
	$('.tabs .nav a').click(function(){
		
		href = $(this).attr('href');
		
		if (href == 'fromuser') {
			$('.tabs .nav a').removeClass();
			$(this).addClass('selected');
			$('#userfavorites').hide();
			$('#fromuser').show();
		}
		else if (href == 'userfavorites') {
			$('.tabs .nav a').removeClass();
			$(this).addClass('selected');
			$('#fromuser').hide();
			$('#userfavorites').show();
		}
		
		return false;
	});
	
	*/
	
});
