// Script that loads random flash elements
// Also works for images
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}
function randomImage()
{
  var imgSrc, r;
  // set this next number in parenthesis to be one less than the actual number of random elements
  // 0 is considered an integer, so make sure it's one less than the number of elements to be loaded
  r = randomNumber(5);
  if (r == '0') {
  	imgSrc = "flash/headers/discipleship.swf";
  }
  if (r == '1') {
  	imgSrc = "flash/headers/discipleship1.swf";
  }
  if (r == '2') {
  	imgSrc = "flash/headers/fellowship.swf";
  }
  if (r == '3') {
  	imgSrc = "flash/headers/service.swf";
  }
  if (r == '4') {
  	imgSrc = "flash/headers/youth.swf";
  }
  // This document.write markup only needs to be there if you're loading flash, otherwise just remark it our.
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="756" height="120">');
  document.write('<param name="movie" value="'+imgSrc+'"><param name="wmode" value="transparent"><param name="quality" value="high"><embed src="'+imgSrc+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="756" height="120"></embed></object>');
  }
