// JavaScript Document
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

// Example:
// simplePreload( '01.gif', '02.gif' ); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function insert_flash(id, swf, width, height, fvars, wmode, scriptaccess) {
		var buff = "";
		if (!scriptaccess)
				scriptaccess = "samedomain";
		if (!wmode)
				wmode = "windowed";
		buff = '<object'
			 + ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' 
			 + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'
			 + ' id="' + id + '"'
			 + ' width="' + width + '"'
			 + ' height="' + height + '">'
			 + '<param name="allowScriptAccess" value="' + scriptaccess + '" />'
			 + '<param name="wmode" value="' + wmode + '" />'			 
			 + '<param name="movie" value="' + swf + '" />'
			 + '<param name="quality" value="high" />'
			 + '<param name="bgcolor" value="#000000" />'
			 + '<param name="FLASHVARS" value="' + fvars + '" />'
			 + '<embed src="' + swf + '"'
			 + ' width="' + width + '"'
			 + ' height="' + height + '"'
			 + ' quality="high"'
			 + ' bgcolor="#000000"'
			 + ' swLiveConnect=true'
			 + ' id="' + id + '"'
			 + ' name="' + id + '"'
			 + ' allowScriptAccess="' + scriptaccess + '"'
			 + ' type="application/x-shockwave-flash"'
			 + ' wmode="' + wmode + '"'
			 + ' pluginspage="http://www.macromedia.com/go/getflashplayer"'
			 + ' flashvars="' + fvars + '" />'
			 + '</object>';
		/* XXX: Might break on Safari or MacIE. */
		buff += '<script type="text/javascript">' 
			 + id + ".wmode = " + '"' + wmode + '";'
			 + '</script>';
		//alert(buff);
		document.write(buff);
}
