﻿var Flash_Version = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;


if (plugin) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");

	for (var i = 0; i < words.length; ++i) {
		if (isNaN(parseInt(words[i])))
		continue;
		var Plugin_Version = words[i];
	}

	var Version_Check_ok = Plugin_Version >= Flash_Version;
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<scr' + 'IPT LANGUAGE=VBScript\>\n');
	document.write('on error resume next \n');
	document.write('Version_Check_ok = ( Isobject(Createobject("ShockwaveFlash.ShockwaveFlash." & Flash_Version)))\n');
	document.write('</scr' + 'IPT\>\n');
}



function writeswf() {
	if (location.hash.length > 1) {
		var locationStr = new String(location.hash);
		defHashSt = locationStr.slice(locationStr.indexOf('#')+1);
	} else {
		defHashSt = '';
	}

	if (Version_Check_ok) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="tocco" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain">');
		document.write('<param name="movie" value="root.swf">');
		document.write('<param name="FlashVars" value="defHash=' + defHashSt + '" />');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="#000000">');
		document.write('<embed src="root.swf" quality="high" bgcolor="#000000" width="100%" height="100%" swLiveConnect=true id="root" name="root" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="defHash=' + defHashSt + '">');
		document.write('</object>');
	} else {

		location.href="noplug.html";
	}
}


/* Windo size */
onload = init;
window.onresize = init;

function init(){
	var sizeW = document.body.clientWidth;

	var sizeH = document.body.clientHeight;

	obj = document.getElementById("container").style;

	if (sizeW < 650) {
		with (obj) width = 650;
	} else {
		with (obj) width = sizeW;
	}

	if (sizeH < 576) {
		with (obj) height = 576;
	} else {
		with (obj) height = sizeH;
	}
}
