//  WIndow open
//----------------------------------------------------------
function windowOpen(_url) {
	var win;
	win = window.open(_url, "sub", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes, width=380, height=500");
	win.focus();
}

//  Embed Flash ver 0.91
//----------------------------------------------------------
var embedFlash = {

	//  Properties
	//-------------------------------------------------------
	pass: "",
	width: "",
	height: "",
	quality: "",
	wmode: "",
	bgcolor: "",
	scale: "",

	//  Constructor
	//-------------------------------------------------------
	setProperties: function(_pass, _width, _height, _quality, _wmode, _bgcolor, _scale) {
		embedFlash.pass = _pass;
		embedFlash.width = _width;
		embedFlash.height = _height;
		embedFlash.quality = _quality;
		embedFlash.wmode = _wmode;
		embedFlash.bgcolor = _bgcolor;
		embedFlash.scase = _scale;
	},

	//  Embed
	//-------------------------------------------------------
	embed: function() {
		if (!document.getElementById("toppage")) { return false;}
		var html = "";
		html += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + embedFlash.width + "' height='" + embedFlash.height + "' align='middle'>";
		html += "<param name='allowScriptAccess' value='sameDomain'>\n";
		html += "<param name='movie' value='" + embedFlash.pass + "'>\n";
		html += "<param name='quality' value='" + embedFlash.quality + "'>\n";
		html += "<param name='wmode' value='" + embedFlash.wmode + "'>\n";
		html += "<param name='bgcolor' value='" + embedFlash.bgcolor + "'>\n";
		html += "<param name='scale' value='" + embedFlash.scale + "'>\n";
		html += "<embed";
		html += " src='" + embedFlash.pass + "' ";
		html += " quality='" + embedFlash.quality + "' ";
		html += " wmode='" + embedFlash.wmode + "' ";
		html += " bgcolor='" + embedFlash.bgcolor + "' ";
		html += " width='" + embedFlash.width + "' height='" + embedFlash.height + "' ";
		html += " scale='" + embedFlash.scale + "' ";
		html += " align='middle' ";
		html += " allowScriptAccess='sameDomain' ";
		html += " type='application/x-shockwave-flash' ";
		html += " pluginspage='http://www.macromedia.com/go/getflashplayer'>\n";
		html += "</embed>\n";
		html += "</object>\n";
		var flash = document.createElement("div");
		flash.style.position = "absolute";
		flash.style.left = "50%";
		flash.style.top = "100px";
		flash.style.width = "900px";
		flash.style.height = "523px";
		flash.style.marginLeft = "-450px";
		flash.innerHTML = html;
		document.body.appendChild(flash);
	},

	//  Add event
	//-------------------------------------------------------
	addEvent: function(elemObj, eventType, funcName, useCapture) {
		if (elemObj.addEventListener){
			elemObj.addEventListener(eventType, funcName, useCapture);
			return true;
		} else if (elemObj.attachEvent){
			var r = elemObj.attachEvent("on"+eventType, funcName);
			return r;
		}
	} 
}
var fileURI = "./flash/afh.swf";
embedFlash.setProperties(fileURI, "900", "523", "high", "transparent", "#FFFFFF", "showall");
embedFlash.addEvent(window, "load", embedFlash.embed);

