
function getWindowHeight() {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (document.body && document.body.offsetHeight) {
		return document.body.offsetHeight;
	} else {
		return 0;
	}
}

function resizeSwfPreview(elementid, magazine_id, issue_id) {
	var windowHeight = getWindowHeight(); 
	var previewHeight = windowHeight - 300;
	var flashvars = {};
	flashvars.xml_src = "/documents/magazine/" + magazine_id + "/xml/" + issue_id + ".xml";
	flashvars.distribution_id = "2";
	flashvars.user_type = "0";
	flashvars.user_id = "1231";
	var params = {};
	params.scale = "noscale";
	params.bgcolor = "#000000";
	params.allowfullscreen = "true";
	params.allowscriptaccess = "always";
	params.allownetworking = "all";
	params.wmode = "transparent";
	var attributes = {};
	attributes.id = "magmag";
	swfobject.embedSWF("/magazine.swf", "magmag", "100%", previewHeight, "9.0.0", false, flashvars, params, attributes);
	
}

function showInputBox() {
	return true;
	var flashElement = document.getElementById('magmag');
	if(flashElement == "undefined") {
		window.setTimeout("showInputBox()", 100);
		return true;
	}
	
	flashElement.width = 300;
	flashElement.height = 300;
}
