$(document).ready(function(){

if(!Modernizr.input.placeholder){

	$('[placeholder]').focus(function() {
	  var input = $(this);
	  if (input.val() == input.attr('placeholder')) {
		input.val('');
		input.removeClass('placeholder');
	  }
	}).blur(function() {
	  var input = $(this);
	  if (input.val() == '' || input.val() == input.attr('placeholder')) {
		input.addClass('placeholder');
		input.val(input.attr('placeholder'));
	  }
	}).blur();
	$('[placeholder]').parents('form').submit(function() {
	  $(this).find('[placeholder]').each(function() {
		var input = $(this);
		if (input.val() == input.attr('placeholder')) {
		  input.val('');
		}
	  })
	});

}





    var $div = $('#login_form_box');
    var height = $div.height();
    $div.hide().css({ height : 0 });

    $('a#sign_in').click(function () {
        if ($div.is(':visible')) {
            $div.animate({ height: 0 }, { duration: 500, complete: function () {
                $div.hide();
            } });
        } else {
            $div.show().animate({ height : height }, { duration: 500 });
        }
        
        return false;
    });




	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$(".trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});



	
	// Using custom configuration
	$("#foo_ref").carouFredSel({
		items				: 1,
		direction			: "down",
		pagination  : "#foo_pag",
		padding     : [0, 0, 26, 0],
		scroll : {
			items			: 1,
			effect			: "easeOutBounce",
			duration		: 700,							
			pauseOnHover	: true
		}					
	});
	
	$("#foo_news").carouFredSel({
		items				: 1,
		direction			: "down",
		pagination  : "#foo_pag",
		scroll : {
			items			: 1,
			effect			: "easeOutBounce",
			duration		: 500,							
			pauseOnHover	: true
		}					
	});	





});





