MI.flash = {
	
	f_load: function(src, width, height)
	{
		if (isNaN(width)) MI.flash = false;
		if (isNaN(height)) MI.flash = false;
		
		MI.flash.src = src;
		MI.flash.width = width;
		MI.flash.height = height;
		MI.flash.wrap = false;
		MI.flash.paramName = new Array();
		MI.flash.paramValue = new Array();
		MI.flash.flashVarName = new Array();
		MI.flash.flashVarValue = new Array();
		MI.flash.title = new String();
	},
	
	f_param: function(name, value)
	{
		MI.flash.paramName.push(name);
		MI.flash.paramValue.push(value);
	},
	
	f_var: function(name, value)
	{
		MI.flash.flashVarName.push(name);
		MI.flash.flashVarValue.push(value);
	},
	
	f_title: function(title)
	{
		MI.flash.title = title;
	},
	
	f_wrap: function()
	{
		MI.flash.wrap = true;
	},
	
	f_write: function()
	{
		var flash = new String();
		var flashVars = new String();
		
		for (i = 0; i < MI.flash.flashVarName.length; i += 1)
		{
			flashVars += MI.flash.flashVarName[i] + "=" + MI.flash.flashVarValue[i] + "&";
		}
		
		flashVars = flashVars.substr(0, flashVars.length - 1);
		
		if (MI.flash.wrap)
		{
			flash += '<div class="content_object" style="width:' + MI.flash.width + 'px" >';
		}
		
		/*flash += '<object '
		+ 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" '
		+ 'width="' + MI.flash.width + '"'
		+ 'height="' + MI.flash.height + '"'
		+ 'title="' + MI.flash.title + '">';
		+ '<param name="movie" value="' + this.src + '" />';
		
		for (i = 0; i < MI.flash.paramName.length; i += 1)
		{
			flash += '<param name="' + MI.flash.paramName[i] + '" value="' + MI.flash.paramValue[i] + '" />';	
		}
		
		if (flashVars != "")
		{
			flash += '<param name="FlashVars" value="' + flashVars + '" />';
		}*/
		
		flash += '<embed src="' + MI.flash.src +'" ';
		
		for (i = 0; i < MI.flash.paramName.length; i += 1)
		{
			flash += MI.flash.paramName[i] + '="' + MI.flash.paramValue[i] + '" ';	
		}
		
		if (flashVars != "")
		{
			flash += 'FlashVars="' + flashVars + '" ';
		}
		
		flash += 'width="' + MI.flash.width + '" '
		+ 'height="' + MI.flash.height + '" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer" '
		+ 'type="application/x-shockwave-flash" />';
		//+ '</object>';
		
		if (MI.flash.wrap)
		{
			flash += '</div>';
		}
		
		document.write(flash);
	}
	
};