function insertFlash( strSrc, intWidth, intHeight, strWMode, strScale, strPlayMode, strCLSID, strCODEBASE, strBGcolor, strPosition, strFlashVars )
{
	if(strWMode == null || strWMode == "") strWMode = "Opaque";
	if(strScale == null || strScale == "") strScale = "noscale";
	if(strPlayMode == null || strPlayMode == "") strPlayMode = "true";
	
	var strFlash	=  '<object classid="' + strCLSID + '" codebase="' + strCODEBASE + '" ';
	strFlash += ' width="' + intWidth + '" height="' + intHeight + '">';

	strFlash += '<param name="movie" value="' + strSrc + '" />';
	strFlash += '<param name="quality" value="high" />';
	strFlash += '<param name="play" value="' + strPlayMode + '" />';
	strFlash += '<param name="wmode" value="' + strWMode + '" />';
	strFlash +='<param name="allowScriptAccess" value="always" />'
//	strFlash += '<param name="scale" value="' + strScale + '" />';
	strFlash += '<param name="menu" value="false" />';
	if(strFlashVars != null && strFlashVars != "") strFlash += '<param name="FlashVars" value="' + strFlashVars + '" />';
	if(strPosition != null && strPosition != "") strFlash += '<param name="align" value="' + strPosition + '" />';
  	if(strBGcolor != null && strBGcolor != "") strFlash	+= '<param name="bgcolor" value="' + strBGcolor + '" />';

	strFlash += '<embed src="' + strSrc + '" width="' + intWidth + '" height="' + intHeight + '" wmode="' + strWMode + '" play="' + strPlayMode + '" scale="' + strScale  + '" menu="false"';
	if(strBGcolor != null && strBGcolor != "") strFlash	+= ' bgcolor="' + strBGcolor + '"';
	if(strFlashVars != null && strFlashVars != "") strFlash	+= ' FlashVars="' + strFlashVars + '"';
	if(strPosition != null && strPosition != "") strFlash	+= ' align="' + strPosition + '"';
	strFlash += ' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">';
	strFlash += '</embed>';
	strFlash += '</object>';

	document.write( strFlash );
	document.close( );	
}




function insertQuickTime( strSrc, strID, intWidth, intHeight, strScale, strPlayMode, strController, strCLSID, strCODEBASE )
{
	if(strScale == null || strScale == "") strScale = "TOFIT";
	if(strPlayMode == null || strPlayMode == "") strPlayMode = "true";
	if(strController == null || strController == "") strController = "true";
	
  	var strQuickTime = '<object classid="' + strCLSID + '" codebase="' + strCODEBASE + '" ';
  	strQuickTime += 'width="' + intWidth + '" height="' + intHeight + '" ';
  	strQuickTime += 'id="' + strID + '">';
  	strQuickTime += '<param name="src" value="' + strSrc + '"/>';
  	strQuickTime += '<param name="AUTOPLAY" value="' + strPlayMode + '" />';
  	strQuickTime += '<param name="CONTROLLER" value="' + strController + '" />';
  	strQuickTime += '<param name="SCALE" value="' + strScale + '" />';
  	
	strQuickTime += '<embed src="' + strSrc + '" type="video/quicktime" pluginspace="http://www.apple.com/quicktime/download/" width="' + intWidth + '" height="' + intHeight + '" ';
  	strQuickTime += 'scale="' + strScale + '" autoplay="' + strPlayMode + '" controller="' + strController + '" name="' + strID + '" >';
  	strQuickTime += '</embed></object>';

	document.write( strQuickTime );
	document.close( );	
}


function insertRealVideo( strSrc, strID, intWidth, intHeight, strPosition, strPlayMode, strController, strCLSID, strCODEBASE )
{
  	if(strID == null || strID == "") strID = "realmovie";
  	if(strPosition == null || strPosition == "") strPosition = "true";
  	if(strPlayMode == null || strPlayMode == "") strPlayMode = "false";
  	if(strController == null || strController == "") strController = "ImageWindow";
  
  	var strRealVideo = '<object classid="' + strCLSID + '" codebase="' + strCODEBASE + '" ';
  	strRealVideo += 'width="' + intWidth + '" height="' + intHeight + '">';
  	strRealVideo += '<param name="src" value="' + strSrc + '"/>';
  	strRealVideo += '<param name="console" value="' + strID + '"/>';
  	strRealVideo += '<param name="controls" value="' + strController + '" />';
  	strRealVideo += '<param name="center" value="' + strPosition + '" />';
  	strRealVideo += '<param name="autostart" value="' + strPlayMode + '" />';
  	strRealVideo += '</object>';

	document.write( strRealVideo );
	document.close( );	
}


function insertApplet( strSrc, strCode, intWidth, intHeight, strPosition, strCLSID, strCODEBASE )
{
	if(strPosition == null || strPosition == "") strPosition = "baseline";
  
  	var strApplet = '<object classid="' + strCLSID + '" codebase="' + strCODEBASE + '" ';
  	strApplet += 'width="' + intWidth + '" height="' + intHeight + '" align="' + strPosition + '" code="' + strSrc + '">';
  	strApplet += '<param name="code" value="' + strSrc + '"/>';
  	strApplet += '<param name="type" value="application/x-java-applet"/>';
  	strApplet += '</object>';

	document.write( strApplet );
	document.close( );
}


function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changePropRestore() {//v1.0
 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
 if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}