﻿/* 
Requires: jQuery v1.3.*, swfobject
*/

<!--//

	var minWidthString = $("body").css("min-width");
	if (minWidthString == null) 
	{	
		minWidthString = "931px"; //default
	}	
	var minContentWidth = parseInt(minWidthString.substring(0,minWidthString.length-2));//remove px;
	var minContentHeight = 500;
	// height calculations
	var headerHeight = 76;
	var footerHeight = 32;

	jQuery(document).ready(function () {
		
			jQuery(window).resize(resizeFlash);
		
        	//embed category banner SWF if one is specified in the catalog
			var flashvars = {
	   		   	param : 'value'
			};
			
			var embedParams = {
				bgcolor: "#FFFFFF",
				quality: "high",
				allowScriptAccess: "always",
				wmode: "transparent",
				allowFullScreen: "false",
                scale: "noorder", 
                loop: "true"
			};
			var attributes = { id: "swfContent"};
			swfobject.embedSWF("/media/home.swf", "swfContent", "100%", "100%", "9.0.115", "", flashvars, embedParams, attributes);

			jQuery(window).trigger("resize");
			resizeFlash();
	});


	function resizeFlash()
	{
		var normalizedWidth = (minContentWidth > jQuery(window).width()) ? minContentWidth : jQuery(window).width();
		var areaWidth = normalizedWidth; // - (leftRightMargin + leftRightPadding);

		// height calculations
		var normalizedWidth = (minContentWidth > jQuery(window).width()) ? minContentWidth : jQuery(window).width();
		var areaWidth = normalizedWidth; // - (leftRightMargin + leftRightPadding);

		var normalizedHeight = $(window).height() - (headerHeight);
		var areaHeight = (minContentHeight > normalizedHeight) ? minContentHeight : normalizedHeight;
		
		jQuery("#contentFlash").css({"width" : areaWidth  + "px", "height" : areaHeight + "px"});        
     }
				
//-->