//deadcrow.com flash-noflash engine . top - 20010316

function flashObject(foURL)
{
	var arglistvalue = flashObject.arguments;
	var arglistcount = flashObject.arguments.length;
	var defaultWidth = "100";
	var defaultHeight = "100";
	var defaultName = "noName";
	var foWidth = (arglistcount > 1) ? arglistvalue[1] : defaultWidth;
	var foHeight = (arglistcount > 2) ? arglistvalue[2] : defaultHeight;
	var foName = (arglistcount > 3) ? arglistvalue[3] : defaultName;

	var fobjx = '<object classid='+'"'+'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'+'"';
	fobjx = fobjx + ' codebase='+'"'+'http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0'+'"';
	fobjx = fobjx + ' id='+'"'+foName+'"'+' width='+'"'+foWidth+'"'+' height='+'"'+foHeight+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'_cx'+'"'+' value='+'"'+'3175'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'_cy'+'"'+' value='+'"'+'3175'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Movie'+'"'+' value='+'"'+foURL+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Src'+'"'+' value='+'"'+foURL+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'WMode'+'"'+' value='+'"'+'Transparent'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Play'+'"'+' value='+'"'+'-1'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Loop'+'"'+' value='+'"'+'-1'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Quality'+'"'+' value='+'"'+'High'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'SAlign'+'"'+' value>';
	fobjx = fobjx + '<param name='+'"'+'Menu'+'"'+' value='+'"'+'-1'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'Base'+'"'+' value>';
	fobjx = fobjx + '<param name='+'"'+'Scale'+'"'+' value='+'"'+'ShowAll'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'DeviceFont'+'"'+' value='+'"'+'0'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'EmbedMovie'+'"'+' value='+'"'+'0'+'"'+'>';
	fobjx = fobjx + '<param name='+'"'+'BGColor'+'"'+' value>';
	fobjx = fobjx + '<param name='+'"'+'SWRemote'+'"'+' value>';
	fobjx = fobjx + '<embed src='+'"'+foURL+'"'+' quality='+'"'+'high'+'"'+' wmode='+'"'+'transparent'+'"';
	fobjx = fobjx + ' bgcolor='+'"'+'#FFFFEE'+'"'+' width='+'"'+foWidth+'"'+' height='+'"'+foHeight+'"'
	fobjx = fobjx + ' type='+'"'+'application/x-shockwave-flash'+'"';
	fobjx = fobjx + ' pluginspage='+'"'+'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'+'"'+'>';
	fobjx = fobjx + '</object>';
	return fobjx;
}

function getParm(urlParm, findParm)
{
	var beginParm = urlParm.indexOf(findParm+"=");
	if (beginParm != -1){ 
		var endParm = urlParm.indexOf("&",beginParm+findParm.length+1);
		endParm = (endParm==-1?urlParm.length:endParm);
		var sendBack = urlParm.substring(beginParm+findParm.length+1,endParm);
	}
	else
		var sendBack = -1;
	return sendBack
}

function useFlash()
{
	var urlParms = window.location.search;
	var topChoice = getParm(urlParms,"speed");
	switch (topChoice){
		case -1 :
			var cookievalue = GetCookie("speed");
			var sendback = ((cookievalue == "NoFlash")?false:true);
		break;
		case "flash" :
			var sendback = true;
		break;
		case "noflash" :
			var sendback = false;
		break;
		default :
			var sendback = false;
		break;
		}
		
	return sendback 	
}

function isOpera()
{
	var uAgent = navigator.userAgent;
	var foundOpera = uAgent.indexOf("Opera");
	var sendback = (foundOpera!=-1?true:false);
	return sendback;
}

function isNetscape()
{
	if ((navigator.appName == "Netscape") || isOpera()) 
		return true;
	else
		return false;
}

function writeHeader(fullFlash, inFlashUrl, inFlashWidth, inFlashHeight)
{
	var netscapeSWF = "flash/deadbuttons1n.swf";
	var otherSWF = "flash/deadbuttons1.swf";
	var defaultSWF = (isNetscape()?netscapeSWF:otherSWF);
	var noFlashText = document.title;
	var flashName = "deadstuff";
	var flashURL = (fullFlash?inFlashUrl:defaultSWF);
	var flashWidth = (fullFlash?inFlashWidth:"120");
	var flashHeight = (fullFlash?inFlashHeight:"70");
	var useFlashWrite = flashObject(flashURL, flashWidth, flashHeight, flashName);
	var lUseFlash = useFlash();
	var outWrite = "";
	outWrite += '<table border="0" width="100%" cellspacing="0" cellpadding="0" background="images/dibak5s.jpg">';
	outWrite += '<tr>';
	outWrite += '<td width="120" height="70">&nbsp;</td>';
	outWrite += '<td>';
	outWrite += '<div align="CENTER" class="deadccs1">';
	outWrite += (lUseFlash&&fullFlash?useFlashWrite:noFlashText)+'</div></td>';
	outWrite += '<td width="120" height="70">'+(lUseFlash&&!fullFlash?useFlashWrite:'&nbsp;');
	outWrite += '</td>';
	outWrite += '</tr>';
	outWrite += '</table>';

	document.write(outWrite);
}

function outFlashOrAlt(altObj, flashURL, flashWidth, flashHeight, flashName)
{
	var lUseFlash = useFlash();
	var outWrite = "";
	if (lUseFlash) 
		outWrite = flashObject(flashURL, flashWidth, flashHeight, flashName);
	else 
		outWrite = altObj;
	
	document.write(outWrite);
}
function htmlOut(htmlLink)
{
	var outLink = htmlLink + "?speed=" + (useFlash()?"flash":"noflash")
	return outLink;
}
function htmlOut2(htmlLink)
{
	var outLink = htmlLink + "?speed=" + (useFlash()?"flash":"noflash");
window.alert("outLink= "+outLink);
	return outLink;
}

//deadcrow.com flash-noflash engine . bottom - 20010316

