// JavaScript Document

 $(document).ready(function() {
   // do stuff when DOM is ready



// moves instructions div up and to the right on click.  change to move and flash if no cookie exists.
$(".animateinstructions").click(function(){
	$("#instructions").animate(
		{"top":"-300px","left":"300px"},
		750,
		"swing"
	).animate({"top":"+=30px"},
	30,
	"linear"
	).animate({"left":"+=30px"},
	30,
	"linear"
	).animate({"top":"-=30px"},
	30,
	"linear"
	).animate({"left":"-=30px"},
	30,
	"linear"
	).animate({"left":"-=300px","top":"+=300px"},
	400,
	"linear",
	function() { $(".BlockHeader .t").css({"color":"#ff0000"}); }
);

  });


var nonjesustext = "span.non-jesus.verse-text";

// Obscure all non-jesus verse text
$(".obscureverses").click(function(){	
	$(nonjesustext).removeClass("hiddenverse").removeClass("show-anyways").addClass("obscuredverse");
  });
// Hide all non-jesus verse-text
$(".hideverses").click(function(){
	$(nonjesustext).removeClass("obscuredverse").removeClass("show-anyways").addClass("hiddenverse");
  });
// Reveal all non-jesus verse-text
$(".revealverses").click(function(){
	$(nonjesustext).removeClass("obscuredverse").removeClass("show-anyways").removeClass("hiddenverse");							  
	});





//toggle the span clicked on

/*
$(nonjesustext).click(function(){
	$(this).removeClass("hiddenverse").removeClass("obscuredverse");						   
  });
*/

$(nonjesustext).click(function(){
	$(this).toggleClass("show-anyways");						   
  });

//scroll the control div

$(window).bind("scroll", function() {
if($(window).scrollTop()!="0"){
	$("#controls").fadeIn("slow");
	} else{
		$("#controls").fadeOut("slow");
		}

});

/**/

    $('.headerverses').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:2000,
		timeout:10000,
		cleartypeNoBg: true
	});




//end of main function
});



