// JavaScript Document
$(document).ready(function() {
	function enableMode(mode, animate) {
		if(mode == "large") {
			if(animate == 'animate') {
				$("body").animate({
					fontSize: '2.4em'
				}, 500);
			} else {
				$("body").css({
					'font-size': '2.4em'
				});
			}
			$.cookie('bond_largetext', 'large', { path: '/' });
			$("#large-text-bar").slideUp("slow");
			$("#large-text-mini").html("Text: <strong>Large</strong> | <span class=\"large-text-deactivate\">Normal</span>").show();
		} else {
			if(animate == 'animate') {
				$("body").animate({
					fontSize: '1.4em'
				}, 500);
			} else {
				$("body").css({
					'font-size': '1.4em'
				});
			}
			$.cookie('bond_largetext', 'normal', { path: '/' });
			$("#large-text-bar").slideUp("slow");
			$("#large-text-mini").html("Text: <span class=\"large-text-activate\">Large</span> | <strong>Normal</strong>").show();
		}
	}
						 
	$(".close").click(function() {
		enableMode('normal', 'noanimate');
	});


	var cookieset = false;
	if($.cookie('bond_largetext') == "large") {
		enableMode('large', 'noanimate');
		cookieset = true;
	}
	if($.cookie('bond_largetext') == "normal") {
		enableMode('normal', 'noanimate');
		cookieset = true;
	}
	if(cookieset == false) {
		$("#large-text-bar").animate({opacity:1}, 1000).slideDown("slow");
	}
	
	$(".large-text-activate").live("click", function() {
		enableMode('large', 'animate');
	});
	$(".large-text-deactivate").live("click", function () {
		enableMode('normal', 'animate');
	});
	
	$("#csd_signup_email").focus(function () {
		if($(this).val() == "email address") {
			this.value='';
			$(this).addClass("focused");
		}
	});
	$("#csd_signup_email").blur(function () {
		if($(this).val() == "") {
			$(this).val("email address");
			$(this).removeClass("focused");
		}
	});
});