// AtmosphereInterfaceAddon v.1.3
// Rolu, www.roce.org, CR 2003-jan-16, LU 2003-june-14
// Additional code by M.Judd
MTSPlugin.prototype.pluginObjects=new Array();
MTSPlugin2=MTSPlugin;
MTSPlugin=function(file,width,height,bkey,alt,parmsc)
{
    this.realMTSPlugin=new MTSPlugin2(file,width,height,bkey,alt,parmsc);
    this.pluginObjects.push(this.realMTSPlugin);
    this.name=this.realMTSPlugin.name;
    this.LN=this.realMTSPlugin.LN;
    this.ImageLink=this.realMTSPlugin.ImageLink;
}
MTSPlugin.prototype=MTSPlugin2.prototype;

function injectPluginIndices()
{
    var i;
    
    for(i=0;i<MTSPlugin.prototype.pluginObjects.length;i++)
    {
        MTSPlugin.prototype.pluginObjects[i].sendJS("pluginIndex="+i);
    }  
}

function getMTSPluginObject(index)
{
    return MTSPlugin.prototype.pluginObjects[index];
}

MTSPlugin.prototype.getPluginObject=function()
{
    var pn=this._mtsPID(), pobj;

    if(VET_Mac&&VET_IE)
    {
        // Sorry, doesn't work here.
    }
    else
    {
        if(VET_Win&&VET_IE)
            pobj=eval('document.all.'+pn);
        else
        {
            if(this.LN==VET_Ln)
                pobj=eval('document.embeds.'+pn)
            else
            {
                if(VET_Gecko)
                    pobj=eval('document.embeds.'+pn)
                else
                    pobj=eval('document.'+this.LN+'.document.embeds.'+pn)
            }
        }
    }
    
    return pobj;
}

// Javascript injector.
MTSPlugin.prototype.sendJS=function(ajs)
{
    var vpc=this.getPluginObject(),
        eajs=ajs;
    eajs="eval(\"" + eajs.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\\'").replace(/\r\n/g, "\\n").replace(/\n/g, "\\n").replace(/\r/g, "\\n") + "\");";

    if(VET_Mac&&VET_IE)
    {
        // Sorry, doesn't work here.
    }
    else
    {
        if(VET_Win&&VET_IE)
            vpc.PluginCommand(eajs, 0, 0);
        else
            vpc.DoCommand(eajs);
    }
}
// ======================================================================================
var vpc
var AtmoLoadDone = false;
var not_done = true;
var flash_set = false;
var active_page = "";

function Do_Shift(screen_num)
{
if (!flash_set)
	{
	flash_set = true;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="middle" width="100% " height="100%" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="atmomars.swf" /><param name="loop" value="false" /><param name="play" value="false" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><embed src="atmomars.swf" loop="false" play="false" quality="high" bgcolor="#FFFFFF" width="100%" height="100%" swLiveConnect=true id="middle" name="middle" align="middle" scale="exactfit" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>	');
	myflash = eval("document.middle");
	vpc = vmp.getPluginObject();
	active_page = vpc;
	}
if (screen_num == 0)
	{
    active_page.style.position="absolute";
    active_page.style.left="-500%";
	myflash.style.position="static";
	myflash.style.left="0%";
	active_page = myflash;
	}
if (screen_num == 1 && not_done)
	{
	not_done = false;
	active_page.style.position="absolute";
	active_page.style.left="-500%";
	vpc.style.position="static";
	vpc.style.left="0%";
	active_page = vpc;
	}
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var targetFrame = 0; 

function middle_DoFSCommand(command, args) {
  var middleObj = InternetExplorer ? middle: document.middle;

}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
    navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub middle_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call middle_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}
