var whereFocus = 0; // Keeps track if user clicked Legal Ease from content or sidebar

function newWindow(url) {
  window.open(url);
}

function popupWindowSmall(url) {
  window.open(url, "", "status=no, toolbar=no, scrollbars=yes, resizable=yes, menubar=yes, width=617px, height=350px");	
}

function popupWindowLarge(url) {
  window.open(url, "", "status=no, toolbar=no, scrollbars=yes, resizable=yes, menubar=yes, width=617px, height=515px");	
}

function showSkipContent() {
  $("#skipNav").css("left", "0px");
}

function hideSkipContent() {
  $("#skipNav").css("left", "-9999px");
}

function sideColor(x) {
  $("#" + x).css("background-color", "#FDEBBA");
}

function sideColorOff(x) {
  $("#" + x).css("background-color", "transparent");
}

function legalEaseContent(y) {
  var widthSizer = $("#legal" + y).css("width");
  var heightSizer = $("#legal" + y).css("height");
  $("#legal" + y).animate(
	{
	  left: "50px"
	}, 350);
  if (heightSizer != "auto") { // Makes IE6 ignore the drop shadow because it cannot read the div height
	$("#blackBox").css("width", widthSizer);
	$("#blackBox").css("height", heightSizer);
	$("#blackBox").css("opacity", ".3");
	$("#blackBox").animate(
	  {
		left: "70px"
	  }, 350);
	}
  $("#shadowContainer").css("opacity", ".2");
  $("#close" + y).focus();
  whereFocus = 1;
}

function legalEase(y) {
  var widthSizer = $("#legal" + y).css("width");
  var heightSizer = $("#legal" + y).css("height");
  $("#legal" + y).animate(
	{
	  left: "50px"
	}, 350);
  if (heightSizer != "auto") { // Makes IE6 ignore the drop shadow because it cannot read the div height
	$("#blackBox").css("width", widthSizer);
	$("#blackBox").css("height", heightSizer);
	$("#blackBox").css("opacity", ".3");
	$("#blackBox").animate(
	  {
		left: "70px"
	  }, 350);
	}
  $("#shadowContainer").css("opacity", ".2");
  $("#close" + y).focus();
  whereFocus = 0;
}

function closeLegal(div) {
  //$("#legal" + div).css("left", "-9999px");
  $("#legal" + div).animate(
	{
	  left: "-9999px"
	}, 500);
  $("#blackBox").css("left", "-9999px");
  $("#blackBox").css("opacity", "1");
  $("#shadowContainer").css("opacity", "1");
  if (whereFocus == 0) { // User clicked from sidebar
    $("#" + div).focus();
  } else { // User clicked from content area
	$("#" + div + "content").focus();
  }
  $("#leftSide").css("background-color", "#F1F2F2"); // Forces IE6 to not double bold headers
  $("#rightSide").css("background-color", "#EBEBEB"); // Forces IE6 to not double bold headers
}

function showPhoto(letter, w, h) {
  $("#photo" + letter).css("top", "160px");
  $("#photo" + letter).css("left", ((516 - (.75 * w)) + "px"));
  $("#photo" + letter).animate(
	{
	  width: (w + 100) + "px",
	  height: (h + 100) + "px"
	}, 500);
  $("#shadowContainer").css("opacity", ".2");
  $("#close" + letter).focus();
}

function closePhoto(letter) {
  $("#photo" + letter).css("top", "-2000px");
  $("#photo" + letter).css("width", "1%");
  $("#photo" + letter).css("height", "1%");
  $("#shadowContainer").css("opacity", "1");
  $("#" + letter).focus();
  $("#leftSide").css("background-color", "#F1F2F2"); // Forces IE6 to not double bold headers
  $("#rightSide").css("background-color", "#EBEBEB"); // Forces IE6 to not double bold headers
}

function blueButtonRollover() {
  $("#blueButtonId").css("background-image", "url(/images/button_right_roll.gif)");
  $("#blueButton").css("background-image", "url(/images/button_left_roll.gif)");
}

function blueButtonRolloff() {
  $("#blueButtonId").css("background-image", "url(/images/button_right.gif)");
  $("#blueButton").css("background-image", "url(/images/button_left.gif)");
}
