$(document).ready(function(){

	if($("#usernameField input").val() != '')
		$("#usernameField").css({"background-image":"url(/images/img-username.jpg)"});
	
	if($("#passwordFeild input").val() != '')
		$("#passwordFeild").css({"background-image":"url(/images/img-password.jpg)"});
	
	//handle login bar stuff
	$("#usernameField").focus(function(){
			$("#usernameField").css({"background-image":""});
	});
	$("#usernameField").blur(function(){
		if($(this).val() == "")
			$("#usernameField").css({"background-image":"url(/images/img-username.jpg)"});
	});
	$("#passwordFeild").focus(function(){
			$("#passwordFeild").css({"background-image":""});
	});
	$("#passwordFeild").blur(function(){
		if($(this).val() == "")
			$("#passwordFeild").css({"background-image":"url(/images/img-password.jpg)"});
	});
	/*$("#fanCentBtn").click(function(){
		$('#logcunt').slideToggle();
		$('#mainLoginBox').css({'width':'450px'});
		$(this).unbind().css({'cursor':''});
	});*/
	
	
	
	$("#newsletterBtn").click(function(){
        $("#newsletterBox").slideToggle();
        $("#newsletterBtn").unbind(function(){
            $("#newsletterBtn").click(function(){
                $("#newsletterBox").slideToggle();
            }); 
        });
    });
    
    $("#emailSignup").focus(function(){
          if($(this).val() == 'Email Address')
                $(this).val("");
     });
     $("#emailSignup").blur(function(){
          if($(this).val() == '')
                $(this).val("Email Address");
     });
    
    $("#newsletterFormSend").click(function(){
        $("#emailForm").submit(sendForm);
    });
    
    function sendForm() {
        $.post("/includes/emailSignup.php",$(this).serialize(),function(data,status){
            $("#result").html(data);
        });
        return false;
    }
///////////////////////////////	
////  Footer Javascript //////	
/////////////////////////////

	$('#footer_service').hide();
	$('#footer_service').css('opacity','0');
//mouse enter for service times
$('#footer_times').stop(false,true).mouseenter(function(){
	$('#footer_service').stop(true,true).animate({
    opacity: 1,
    top: '-250',
    height: 'show'
  }, 600);
$('#footer_times').mouseleave(function(){
	$('#footer_service').animate({
	opacity:'0',
	top: '-28',
	height:'hide'
	}, 300);
  });
});
/// quick links hover
	$('#quick_links').hide();
	$('#quick_links').css('opacity','0');
	$('#quarrow').hide();
$('#quicklinks').stop(false,true).mouseenter(function(){
	$('#quick_links').stop(true,true).animate({
    opacity: 1,
    top: '-200',
    height: 'show'
  }, 300, function(){
  	$('#quarrow').show();
  });
$('#quicklinks').mouseleave(function(){
  	$('#quarrow').hide();
	$('#quick_links').animate({
	opacity:'0',
	top: '-28',
	height:'hide'
	}, 100);
  });
});
//footer_address
	$('#footer_address').hide();
	$('#footer_address').css('opacity','0');
	$('#farrow').hide();
$('#footeraddress').stop(false,true).mouseenter(function(){
	$('#footer_address').stop(true,true).animate({
    opacity: 1,
    top: '-114',
    height: 'show'
  }, 300, function(){
  	$('#farrow').show();
  });
$('#footeraddress').mouseleave(function(){
  	$('#farrow').hide();
	$('#footer_address').animate({
	opacity:'0',
	top: '-28',
	height:'hide'
	}, 100);
  });
$('#footeraddress').click(function(){
	window.location = "http://maps.google.com/maps?hl=en&q=3526+Jefferson+Davis+Highway+Clearwater,+SC&bav=on.2,or.r_gc.r_pw.&biw=1386&bih=952&um=1&ie=UTF-8&hq=&hnear=0x88f9caa17f8e18ff:0x905840efbe18162e,3526+Jefferson+Davis+Hwy,+Graniteville,+SC+29829&gl=us&daddr=3526%20Jefferson%20Davis%20Hwy,%20Graniteville,%20SC%2029829&ei=pWZuTpubIIWu8gPv680d&sa=X&oi=geocode_result&ct=directions-to&resnum=1&ved=0CBsQwwUwAA";
});
});

//Show 'Today!' if the day is Weds or Sunday
	var d = new Date();
		d = d.getDay();
	if(d == 7){
		$('#sunday').css('display','inline');
	} else if (d == 3) {
		$('#weds').css('display','inline');
	} else if (d == 5) {
		$('#friday').css('display','inline');
	} else {
			$('#sunday').css('display','none');
		$('#weds').css('display','none');
		$('#friday').css('display','none');
	}
//end show
///////////////////////////////	
////  End Footer Javascript //	
/////////////////////////////	
});

