// JS2Flash library v.1.80

// Random GET-variable generator
function AddVar(Chars) {
    return ("?v=" + String(Math.round(Math.random() * (Math.pow(10, Chars)))));
} // func

// Get variables
function GetQueryVariable(Variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == Variable) return pair[1];
    } // for
} // func

// Fullscreen Flash object
function FSFlashObject(DIV_id, flash_id, URL, DisableCashe, FlashVars) {
    document.getElementById(DIV_id).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='100%' height='100%' fullscreen='yes' id='" + flash_id + "'>" +
        "<param name='movie' value='" + URL + ((DisableCashe) ? AddVar(10) : "") + "'/>" +
        "<param name='flashvars' value='" + FlashVars + "' />" +
        "<embed name='" + flash_id + "' width='100%' height='100%' fullscreen='yes' src='" + URL + ((DisableCashe) ? AddVar(10) : "") + "' flashvars='" + FlashVars + "'/>";
        "</object>";
} // func

// Internet Explorer Activate Object fix
function WriteFlashObject(DIV_id, flash_id, URL, Width, Height, BgColor, Align, DisableCashe, WindowMode, FlashVars) {
    if (!WindowMode) WindowMode = "opaque";
    if (!FlashVars) FlashVars = "";
    document.getElementById(DIV_id).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='" + Width + "' height='" + Height + "' id='" + flash_id + "' align='" + Align + "'>" +
        "<param name='allowScriptAccess' value='sameDomain' />" + 
        "<param name='movie' value='" + URL + ((DisableCashe) ? AddVar(10) : "") + "'/>" +
        "<param name='quality' value='high' />" +
		"<param name='allowFullScreen' value='true' />" +
        "<param name='wmode' value='" + WindowMode + "' />" +
        "<param name='bgcolor' value='" + BgColor + "' />" +
        "<param name='flashvars' value='" + FlashVars + "' />" +
        "<embed src='" + URL + ((DisableCashe) ? AddVar(10) : "") + "' wmode='" + WindowMode + "' quality='high'" +
		" allowFullScreen='true'" +
        " bgcolor='" + BgColor +
        "' width='" + Width +
        "' height='" + Height +
        "' name='" + flash_id +
        "' align='" + Align +
        "' flashvars='" + FlashVars +
        "' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
        "</object>";
} // func

function GetElementById(Window_, Id_) {
	return (Window_.document.getElementById) ? Window_.document.getElementById(Id_) : Window_.document.all[Id_];
} // func

function GetOpenerElementById(Id_) {
	return window.opener.document.getElementById ? window.opener.document.getElementById(Id_) : window.opener.document.all[Id_];
} // func

function GetSWFObject(MovieName) {
    return (ie ? window[MovieName] : document[MovieName]);
} // func

function OpenWindow(URL, Width, Height, FullScreen, Left, Top) {
	FullScreen = (FullScreen) ? "yes" : "no";
	Left = (Left) ? Left : 0;
	Top = (Top) ? Top : 0;
	FullScreen = (FullScreen) ? "yes" : "no";
    if (OpenWindowId) OpenWindowId.close();
	OpenWindowId = open(URL, "_blank", "type=fullWindow,fullscreen=" + FullScreen + ",channelmode=no,scrollbars=no,left=0,top=0,width=" + Width + ",height=" + Height);
	return OpenWindowId;
} // func


var agt = navigator.userAgent.toLowerCase();
var ie = (/msie/.test(agt));
var geco = (/gecko/.test(agt));
var opera = (/opera/.test(agt));
var konq = (/konqueror/.test(agt));
var safari = (/safari/.test(agt));
var mac = (/macintosh/.test(agt));
var OpenWindowId;
