
$(function() {
	$(swfobject).ready(function(){
		swfobject.switchOffAutoHideShow();
		swfobject.registerObject("headerAlternateContent", "9.0.0", "expressInstall.swf");
		swfobject.registerObject("newsAlternateContent", "9.0.0", "expressInstall.swf");
		constraintPageWidth(); // Benson Fix start up window position problem 20101025
	});
	
	/* Resize the shadow.. */
	resizeShadow();
	
	$(window).resize(constraintPageWidth);
	
	$("a.lang").click(function(e){
		e.preventDefault();
		
		$("body").removeAttr("class").addClass($(this).attr("id"));
		
		if (typeof $.cookie == "function")
		{
			$.cookie("lang", $(this).attr("id"), { path:"/", expire: 30 });
		}
	});
	
	if (typeof $.cookie == "function")
	{
		$("body").removeAttr("class").addClass($.cookie("lang"));
	}
});

function resizeShadow()
{
	$("#shadow_middle").height(0);
	$("#shadow_middle").height(Math.ceil(($("#content_body").height() - 224) / 112) * 112);
}

function constraintPageWidth()
{
	var w = $(this).width() < 920 ? 920 : 'auto';
	
	$("#content_header").width(w);
	$("#content_footer").width(w);
	$(".copyright_text").width(w);
}
