	if(!puser_code) puser_code = null;
	
	var rsTimer;
	var shownSizeNotice = false;
	
	var flashvars = {
		user_code: puser_code
	};
	var params = {
		base: "/movies/",
		id: 'tshirtMovie',
		scale: "noscale",
		salign: "bc",
		allowScriptAccess: "always",
		allowFullScreen: "true",
		menu: "false" 
		};
	var attributes = {};
	swfobject.embedSWF("movies/growtshirt_main.swf", "flashContent", "100%", "100%", "9", 'movies/expressInstall.swf', flashvars, params, attributes);
	swffit("flashContent", 960, 540, null, null, true);

	var checkSize = function() {
		var minW = 960,
			minH = 540;
		
		var size = window.size();
		
		if(size.width < minW || size.height < minH) {
			document.getElementById('flashContent').showSmallScreen();
			window.scrollTo(0,10000);
		} else {
			document.getElementById('flashContent').clearSmallScreen();
		}
					
	}
	
	var current_w = null,
		current_h = null;
	
	var doResize = function(e) {
		clearTimeout(rsTimer);
		rsTimer = setTimeout('checkSize()',500);
	}	

	var debug = function(msg) {
		if(!document.getElementById('dgbBox')) {
			var box = document.createElement('div');
			box.id = 'dbgBox';
			box.style.zIndex = '2000';
			box.style.position = 'absolute';
			box.style.right = '20px';
			box.style.top = '20px';
			box.style.border = '1px';
			box.style.background = '#ffffff';
			box.style.padding = '10px';
			document.body.appendChild(box);
		} 
		
		document.getElementById('dbgBox').innerHTML += '<p>'+msg+'</p>';
		
	}

	
	window.size = function()
	{
		var w = 0;
		var h = 0;

		//IE
		if(!window.innerWidth)
		{
			//strict mode
			if(!(document.documentElement.clientWidth == 0))
			{
				w = document.documentElement.clientWidth;
				h = document.documentElement.clientHeight;
			}
			//quirks mode
			else
			{
				w = document.body.clientWidth;
				h = document.body.clientHeight;
			}
		}
		//w3c
		else
		{
			w = window.innerWidth;
			h = window.innerHeight;
		}
		return {width:w,height:h};
	}
	
	if(window.innerWidth) {
		window.addEventListener('resize',doResize,false);
	} else {
		window.attachEvent('onresize',doResize);
	}
	