// JavaScript Document

<!--

var swfs = new Array ();
// flash ("topMenu", "file.swf", 100, 100);
// flash ("here", "file.swf", 100, 100);
function flash(target, url, width, height, id, wmode)
{
	if (target == 'here'){
		document.writeln (createFlashObjectString (url, width, height, id, wmode));
	}else{
		swfs.push ([target, url, width, height, id, wmode]);
	}
}

function pushFlash()
{
	var n = swfs.length;
	var tg;
	while (n--){
		if (typeof(swfs[n][0]) == 'string') tg = document.getElementById (swfs[n][0]);
		else tg = swfs[n][0];
		if (tg) tg.innerHTML = createFlashObjectString (swfs[n][1], swfs[n][2], swfs[n][3], swfs[n][4], swfs[n][5]);
	}
}

function pushFlashAfter (target, url, width, height, id, wmode)
{
	var tg = document.getElementById(target);
	if(tg) {
		tg.innerHTML = createFlashObjectString(url, width, height, id, wmode);
	}
}

function createFlashObjectString(url, width, height, id, wmode)
{
	if(url.indexOf('?') > 0)
		url += "&";
	else
		url += "?";

	url += "current_time=" + ((new Date()).getTime()).toString();

	var str = "<object ";
	if (id) str += "id=\"" + id + "\" ";
	str += "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
	str += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" "
	str += "width=\"" + width + "\" height=\"" + height + "\">";
	if (wmode) { str += "<param name=\"wmode\" value=\"transparent\">";}
	str += "<param name=\"movie\" value=\""+url+"\">";
	str += "<param name=\"quality\" value=\"high\" />";
	if (wmode) { str += "<embed src=\""+url+"\" quality=\"high\" wmode='transparent'";}
	else{ str += "<embed src=\""+url+"\" quality=\"high\" "; }
	str += "pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" ";
	str += "width=\""+width+"\"  height=\""+height+"\"></object>";

	return str;
}

if(window.attachEvent){
	//window.attachEvent ("onload", pushFlash);
}else{
	//window.addEventListener ("load", pushFlash, true);
}
var ASsync = new Object ();
ASsync.state = 0;
ASsync.sync = function (key)
{
	var v = 1;
	if (key)
	{
		var re = this.getID (key).sync ("js");
		if (re == "success") v += 1;
	}
	return v;
}

ASsync.msg = function (msg){
	alert ("# "+msg);
}

ASsync.call = function ()
{
	var id = arguments[0];
	var name = arguments[1];
	var arr = new Array ();
	if (arguments.length > 2)
	{
		for (var i=2; i<arguments.length; i++)
		{
			arr.push (arguments[i]);
		}
	}
	this.getID (id)[name].apply (this, arr);
}

ASsync.getID = function (name) {
	return (navigator.appName.indexOf("Microsoft") != -1) ? window[name]:document[name];
}
-->