// Function for toggling layout grid display

var stateCookie = "showgrid";

var jsToggleGrid = function() {	
	var currentState = jQuery.cookie(stateCookie);
	
	if (currentState == "true") {
		jQuery.cookie(stateCookie, false, {path: '/'});
		gridOff();
	} else {
		jQuery.cookie(stateCookie, true, {path: '/'});
		gridOn();
	};
}

jQuery(document).ready(function() {
	var currentState = jQuery.cookie(stateCookie);
	if (currentState == "true") {
		gridOn();
	}
});

var gridOn = function() {
	jQuery('div.container').css("background","url('/css/blueprint/lib/grid.png')");
	jQuery('h1').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('h2').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('h3').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('h4').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('h5').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('p').css("background-color", "rgba(200,200,160,0.35)");
	jQuery('div').css("outline", "1px dotted red");
	jQuery('ul').css("outline", "1px dotted blue");
	jQuery('li').css("outline", "1px dotted yellow");
	jQuery('#opac').css("opacity", ".85");
	
}
var gridOff = function() {
	jQuery('div.container').css("background","");
	jQuery('h1').css("background-color", "");
	jQuery('h2').css("background-color", "");
	jQuery('h3').css("background-color", "");
	jQuery('h4').css("background-color", "");
	jQuery('h5').css("background-color", "");
	jQuery('p').css("background-color", "");
	jQuery('div').css("outline", "none");
	jQuery('ul').css("outline", "none");
	jQuery('li').css("outline", "none");
	jQuery('#opac').css("opacity", "1");
}

