// Determining Browser (dont need them all but its always usable) //
var isFlashNS=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)?true:false;
var isMoz2=(navigator.userAgent.indexOf("Mozilla/2") != -1)?true:false;
var isIE=(navigator.appName == "Microsoft Internet Explorer")?true:false;
var isNetscape6 = (!document.all && !document.layers && navigator.appName == "Netscape" && parseInt(navigator.appVersion) >=5)?true:false;
var isDOM = (document.getElementById) ? true : false;
var isIE4 = (navigator.userAgent.indexOf("MSIE 4.0") != -1)?true:false;
var isIE45 = (navigator.userAgent.indexOf("MSIE 4.5") != -1)?true:false;
var isIE5 = (navigator.userAgent.indexOf("MSIE 5.0") != -1)?true:false;
var isIE6 = (navigator.userAgent.indexOf("MSIE 6.0") != -1)?true:false;
var isMac = (navigator.userAgent.indexOf("Mac") != -1)?true:false;
var isMacIE4 = (isMac && isIE4) ? true : false;
var isMacIE45 = (isMac && isIE45) ? true : false;
var isMacIE5 = (isMac && isIE5) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1)?true:false;
var isOpera3 = (navigator.userAgent.indexOf("Opera 3.")!= -1)?true:false;
var isOpera4 = (navigator.userAgent.indexOf("Opera 4.")!= -1)?true:false;
var isNetscape = (!isOpera && (navigator.appName.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("4.") != -1))?true:false;
var isNS3 = (!isOpera && (navigator.userAgent.indexOf("Netscape") != -1 && navigator.userAgent.indexOf("3.") != -1)) ? true : false;
var isNSDIV = (!isOpera && (isNetscape && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("4.")+2)) > 5)) ? true : false;
var FlashLayers = new Array();
var flashlayers=0;
var CurrentFlashFiles = new Array();


// start flash layer
function start_layer(layername,top,left,width,height,wmodeEnabled)
{
	if(wmodeEnabled)
	{
		layername = "HomeSWF"+layername;
	}else
	{
		layername="Flash"+layername;
	}
	{
		if(!left) { left = 0; }
		document.write('<DIV ID="'+layername+'" STYLE="z-index:0; position:relative; top:'+top+'; left:'+left+'; width:100%; height:100%;">');
	}
}

// end flash layer
function end_layer()
{
	{
		document.write('</DIV>');
	}
}

// start writing flash dHTML layer with fixed sized flash
function startFlashFixed(top,left,flashfile,flashwidth,flashheight,wmodeEnabled)
{
		if(isMac || !isIE || (typeof wmodeEnabled == "undefined"))
	{
		wmodeEnabled = false;
	}
	left = (left=="none") ? left="" : left;
	top = (isMac) ? top+1 : top;
	start_layer(flashlayers,top,left,flashwidth,flashheight,wmodeEnabled);
	ID=flashfile;
	for(i=0; i<ID.length; i++)
	{
		if(ID.substring(i,i+1) == "/") ID=ID.substring(0,i) + ID.substring(i+1);
		if(ID.substring(i,i+1) == ".") ID=ID.substring(0,i) + ID.substring(i+1);
	}
	
	
	if(isIE || isFlashNS || isDOM)
	{
		document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=4,0,0,0" WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'">');
		document.write('<PARAM NAME="MOVIE" VALUE="'+flashfile+'">');
		document.write('<PARAM NAME="PLAY" VALUE="true">');
		document.write('<PARAM NAME="LOOP" VALUE="true">');
		document.write('<PARAM NAME="QUALITY" VALUE="best">');
		document.write('<PARAM NAME="WMODE" VALUE="transparent">');
		document.write('<EMBED NAME="'+ID+'" ID="'+ID+'" SRC="'+flashfile+'" WIDTH="'+flashwidth+'" HEIGHT="'+flashheight+'" MENU="false" loop="true" QUALITY="BEST" BORDER="0" ALIGN="TOP" swliveConnect=true wmode="transparent" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
		document.write('</OBJECT>');
	}
	end_layer();
}

// start writing flash dHTML layer with percente sized flash
function startFlashRelative(top,left,flashfile,flashwidth,flashheight)
{


	if(isIE || isFlashNS || isDOM)
	{
	width = flashwidth + "%" ;
	height = flashheight + "%" ;
	
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash5/cabs/swflash.cab#version=4,0,0,0" STYLE="POSITION: absolute; HEIGHT:'+height+';WIDTH:'+width+';TOP:'+top+';LEFT:'+left+'; z-index: 0; overflow: auto" width="'+width+'" height="'+height+'">');
		document.write('<PARAM NAME="MOVIE" VALUE="'+flashfile+'">');
		document.write('<PARAM NAME="PLAY" VALUE="true">');
		document.write('<PARAM NAME="LOOP" VALUE="true">');
		document.write('<PARAM NAME="QUALITY" VALUE="best">');
		document.write('<PARAM NAME="WMODE" VALUE="transparent">');
		document.write('</OBJECT>');
		
	}
}
