//------------------------------------------
//------------------------------------------
// © Copyright 2003 Theta Interactive Incorporated
// custom prototypes from Theta Interactive
// the following javascript is proprietary
// please do not duplicate, copy or distribute without permission
// questions? info@thetainteractive.com
// visit us online @ www.thetainteractive.com
//------------------------------------------
//------------------------------------------

//------------------------------------------
// begin Swf Object Embed scripts
//------------------------------------------
// set up variables
//------------------------------------------
is_ie_win = false;
if (navigator.userAgent && (navigator.userAgent.indexOf("MSIE")>=0) && (navigator.userAgent.indexOf("Windows")>=0)) is_ie_win = true;
is_minor = false;
is_major = false;
var plugin = 0;
var d = document;
//------------------------------------------
// detect flash version
//------------------------------------------
function detectFlash(major, minor){
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		if (navigator.plugins && navigator.plugins["Shockwave Flash"]) {
			pos = navigator.plugins["Shockwave Flash"].description.indexOf("Shockwave Flash");
			pos += 16;
		}
		minor_pos = navigator.plugins["Shockwave Flash"].description.indexOf(" r") + 2;
		minor_length = navigator.plugins["Shockwave Flash"].description.length - minor_pos;
		var swver = navigator.plugins["Shockwave Flash"].description.substr(pos,1)
		var mver = navigator.plugins["Shockwave Flash"].description.substr(minor_pos,minor_length)
		if (swver > major) {
			is_major = true;
			is_minor = true;
		} else if (swver == major) {
			is_major = true;
			if (mver >= minor) { is_minor = true; }
		}
	} else if (is_ie_win) {
		d.write('<SCRIPT LANGUAGE=VBScript> \n');
		d.write('on error resume next \n');
		if (major == 6) d.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
		else if (major == 5) d.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
		else d.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
		d.write("</SCR"+"IPT> \n");
		if (plugin) is_major = true;
	}
}
//------------------------------------------
// write out the flash
//------------------------------------------
function writeFlash (moviename, x, y, w, h, color, minor, center) {
	var dh = "" + h;
	var dw = "" + w;
	if (dh.indexOf('%') < 0) dh += "px";
	if (dw.indexOf('%') < 0) dw += "px";
	if ((x > 0) || (y > 0)) d.write('<div id="l_Main" style="position:absolute;top:' + y + 'px;left:' + x + 'px;width:' + dw +';height:' + dh +';z-index:1">');
	if (center) d.write('<center>');
	if ((!is_minor) && (!is_ie_win)) d.write('<A HREF="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" TARGET="_blank"><IMG SRC="/scripts/minorversion.gif" WIDTH=753 HEIGHT=9 BORDER=0></A><br>');
	flashObject(moviename, w, h, color, minor);
	if (center) d.write('</center>');
	if ((x > 0) || (y > 0)) d.write('</div>');
	if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) < 5) && ((x > 0) || (y > 0))) window.resizeTo(innerWidth + 5, innerHeight + 5);
}
//--------------------------------------------------
// format the flash object
//--------------------------------------------------
function flashObject (moviename, w, h, color, minor) {
	d.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	d.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,' + minor + ',0"');
 	d.write('WIDTH="' + w + '"');
	d.write('HEIGHT="' + h + '"');
	d.write('ID="' + moviename + '"');
	d.write('onMouseWheel="this.SetVariable(\'scrollerListener.intWheelDelta\',event.wheelDelta);"');
	d.write('ALIGN="">');
	d.write('<PARAM NAME="movie" VALUE="' + moviename + '"> ');
	d.write('<PARAM NAME="loop" VALUE="false"> ');
	d.write('<PARAM NAME="menu" VALUE="false"> ');
	d.write('<PARAM NAME="quality" VALUE="high"> ');
	d.write('<PARAM NAME="bgcolor" VALUE="' + color + '"> ');
	d.write('<param name="wmode" value="transparent">');
	d.write('<EMBED ');
	d.write('src="' + moviename + '"');
	d.write('loop="false"');
	d.write('menu="false"');
	d.write('quality="high"');
	d.write('bgcolor="' + color + '"');
	d.write('WIDTH="' + w + '"');
	d.write('HEIGHT="' + h + '"');
	d.write('NAME="' + moviename + '"');
	d.write('swLiveConnect="true"');
	d.write('wmode="transparent');
	d.write('ALIGN=""');
	d.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">	');
	d.write('</EMBED>');
	d.write('</OBJECT>');
}
//------------------------------------------
// end Swf Object Embed scripts
//------------------------------------------