﻿// JScript File
<!--
function loadHandler()
{
    showFlash();
    preloadImages();
}

window.onload=loadHandler;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_off_over = newImage("images/home_off-over.gif");
		about_off_over = newImage("images/about_off-over.gif");
		market_off_over = newImage("images/market_off-over.gif");
		contact_off_over = newImage("images/contact_off-over.gif");
		preloadFlag = true;
	}
}

function outputFlash(flashFilePath, color, fwidth, fheight, embedFlashVars, noFlashMessage) {
    //alert (flashFilePath);
    //alert (color);
    //alert (fwidth);
    //alert (fheight); 
    //alert (embedFlashVars);
    //alert (noFlashMessage);
    // <!-- begin the OBJECT tag, which will be understood by ActiveX-capable browsers -->
    document.write('<OBJECT id="gld_sw" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
    document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" style="visibility:hidden;"');
    document.write('WIDTH="'+ fwidth + '" HEIGHT="' + fheight + '" NAME="sw" id="mainPage" align="middle" >');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<PARAM NAME="Movie" VALUE="' + flashFilePath + '">');
    document.write('<PARAM NAME="quality" VALUE="high">');
    document.write('<param name="FlashVars" value="' + embedFlashVars + '">');
    document.write('<PARAM NAME="bgcolor" VALUE="' + color + '">');
    // if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("Mac") == -1 &&   navigator.appVersion.indexOf("3.1") == -1) || (navigator.plugins && navigator.plugins["Shockwave Flash"])|| navigator.plugins["Shockwave Flash 2.0"])
    //If this browser understands the mimeTypes property and recognizes the MIME Type //"application/x-shockwave-flash"...
    //alert ('before check mime type');
    if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
    {
        //alert ('inside mime type');
       //...write out the following <EMBED> tag into the document.
       document.write('<EMBED id="gld_sw" name="gld_sw" align="middle" allowScriptAccess="sameDomain" SRC="' + flashFilePath + '" flashvars="' + embedFlashVars + '" WIDTH="'+ fwidth + '" HEIGHT="' + fheight + '" bgcolor="' + color + '" QUALITY="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
    }
    //Otherwise,...
    else {
        //alert ('no flash');
       //...write out the following <IMG> tag into the document. The image need
       //not be the same size as the Flash Player movie, but it may help you lay out the
       //page if you can predict the size of the object reliably.
       document.write(noFlashMessage);
    }
    //<!-- Close the OBJECT tag. --> 
     document.write('</OBJECT>');
} //end outputFlash()

function showFlash()
{
    //shows all object tags
    var oObject = window.document.body.getElementsByTagName("OBJECT");

    for (var i=0;i<oObject.length;i++)
    {
        oObject[i].style.visibility="";
    }
}

// -->
