/*
Rollovers for the input type="image".
Thanks to Atlanta Jones:
http://www.atlantajones.com/2008/07/02/even-easier-jquery-rollovers/
*/
$.fn.rollOver = function() {
	// Set the original src
	rollsrc = $(this).attr("src");
	if (rollsrc) {
		rollON = rollsrc.replace('off', 'on');
		newImg = new Image(); // create new image obj
		$(newImg).attr("src", rollON); // set new obj's src
	}
	
	this.mouseover(function() {
		imgsrc = $(this).attr("src");
		if (typeof(imgsrc) != 'undefined') {
		imgsrcON = imgsrc.replace('off', 'on');
		$(this).attr("src", imgsrcON);
		}
	});

	// Handle mouseout
	this.mouseout(function(){
		if (typeof(imgsrc) != 'undefined') {
		$(this).attr("src", imgsrc);
		}
	});
};



/*
Initialize
*/
$(function() {	
	$("#magic_area .hide").hide();
	$("#legal .hide").hide();
	
	$("#magic_area p.arrow").click(function() {
		$(this).parent().parent().find(".hide").slideToggle();
	});
	
	$("#legal h4").click(function(event) {
		$(this).next().slideToggle("slow");
	});
});
