/* Simple script to show and hide the grid */

var switcher;
var baseline;
var dropshadow;

$switcher = 1;
$baseline = 1;
$dropshadow = 0;

$(function() {
	
  $(document).bind('keydown', 'g', grid_switch);
  $(document).bind('keydown', 'b', baseline_switch);
  $(document).bind('keydown', 'd', dropshadowhell);
  if(jQuery.browser.version == '1.9.1') {
    $("#not_firefox").css("display", "none");
  }

});

function grid_switch() {

  if($switcher == 0) {
    $("body").css("background-image", "none");
    $switcher = 1;
    $baseline = 1;
    }
  else {
    $("body").css("background-image", "url(/images/bg_grid-45.png)");
    $switcher = 0;
    $baseline = 1;
    }

 }

function baseline_switch() {
  
  if($baseline == 0) {
    $("body").css("background-image", "none");
    $switcher = 1;
    $baseline = 1;
    }
  else {
    $("body").css("background-image", "url(/images/21px_baseline.png)");
    $switcher = 1;
    $baseline = 0;
    }

 }

function dropshadowhell() {

  if(!$dropshadow) {
    $("body").addClass("dropshadowhell");
    $dropshadow = 1;
  }
  else {
    $("body").removeClass("dropshadowhell");
    $dropshadow = 0;
  }
 }
