$(document).ready(function () {
        cookFull = getCookie("fullscreen");
        if (cookFull != null && cookFull == "true") {
            $("#chkFullscreen").attr("checked","true");
            ActivateFullScreen();
        }
        cookLiquid = getCookie("liquid");
        if (cookLiquid != null && cookLiquid == "true") {
            $("#chkLiquid").attr("checked","true");
            ActivateLiquid();
        }
    });
	
function changeLayout(src)
{
	checked = $("#chk"+src).attr("checked");
	if (src == 'Fullscreen')
	{
		setCookie("fullscreen", checked);
		if (checked == true)
		{
			ActivateFullScreen();
		}
		else
		{
			DeActivateFullScreen()
		}
	}
	if (src == 'Liquid')
	{
		setCookie("liquid", checked);
		if (checked == true)
		{
			ActivateLiquid();
		}
		else
		{
			DeActivateLiquid()
		}
	}
}
function ActivateFullScreen()
{
	if (BigImg1)
	{
		href1 = BigImg1;
	}
	else
	{
	href1 = $("#battleLink1 img").attr("src");
	}
	$("#battleLink1").removeAttr("onclick").attr("href",href1).lightBox();
	if (BigImg2)
	{
		href2 = BigImg2;
	}
	else
	{
	href2 = $("#battleLink2 img").attr("src");
	}
	$("#battleLink2").removeAttr("onclick").attr("href",href2).lightBox();
}
function DeActivateFullScreen()
{
	href1 = $("#battleLink1 img").attr("src");
	$("#battleTD1").html("<a id=\"battleLink1\" onclick=\"largerView('"+href1+"',1);\"><img class=\"medimg\" src='"+href1+"'/></a><br/>");
	href2 = $("#battleLink2 img").attr("src");
	$("#battleTD2").html("<a id=\"battleLink2\" onclick=\"largerView('"+href2+"',2);\"><img class=\"medimg\" src='"+href2+"'/></a><br/>");
}
function ActivateLiquid()
{
	$("body").addClass("liquid");
	width = $("body").width();
	contentwidth = width - 350;
	tablewidth = (width - 350)/2;
	$("#content").width(contentwidth);
	$("#battleTD1, #battleTD2").attr("width",tablewidth+"px");
	$("#battleTD1 img, #battleTD2 img").css({"max-height":tablewidth+"px","max-width":tablewidth+"px","width":"auto !important","width":tablewidth+"px"})	
}
function DeActivateLiquid()
{
	$("body").removeClass("liquid");
	$("#content").width("650px");
	$("#battleTD1, #battleTD2").attr("width","305px");
	$("#battleTD1 img, #battleTD2 img").css({"max-height":"300px","max-width":"300px","width":"auto !important","width":"300px"})	
}
