$(document).ready(function(){
						   
		$('#images').cycle();					   
	
	var fullheight;
	$('#showhide').click(function(){
		
		var current = $(this).html();

		if (current == "showtext") {
			$('#content').animate({
				height: fullheight,
				paddingTop: 50,
				paddingBottom: 50
			},function(){
			
				if ($('#OT_searchWrapperAll').length > 0) {
					$('#OT_searchWrapperAll').show();
				}

			});
			
			$(this).html("hidetext").css({"background-position" : "left top"});
			
			//opentable
			

			
		} else {
			fullheight = $('#content').height();
			$('#content').animate({
				height: 0,
				paddingTop: 0,
				paddingBottom: 0
			});
			
			$(this).html("showtext").css({"background-position" : "left bottom"});
			
			if ($('#OT_searchWrapperAll').length > 0) {
				$('#OT_searchWrapperAll').hide();
			}
		}
		return false;
	});
	
	
	$('#other ul li a').hover(function(){
		thisheight = $(this).height();
		thisheightover = thisheight + 30;
		$(this).animate({
			height: thisheightover				
		},{queue:false, duration:200});
	}, function () {
		$(this).animate({
			height: thisheight
		},{queue:false, duration:200});
	});
	
	
$('#baf').submit(function(){
	joinemail = $('#email').val();
	if(CheckEmail(joinemail)){
		$.post("media/php/baf.php",{email: joinemail}, function(data){
			$('#bafreturn').text(data);
			$('#email').val("");
		});	
	} else {
			$('#bafreturn').html("Please enter a valid email address.")
	}
	return false;
});

	
});

function CheckEmail(inputemail) {
	AtPos = inputemail.indexOf("@");
	StopPos = inputemail.lastIndexOf(".");

	if (AtPos == -1 || StopPos == -1)
	{
		return false;
	}
	else
	{
		return true;	
	}

}