////////////////////////////////
//
//  displays random flash movie or random image if flashplayer is
//  outdated or doesn't exist.
//
////////////////////////////////
var flashArray = new Array(
	"/images/swf/96-conHP-1.swf",
	"/images/swf/96-conHP-2.swf",
	"/images/swf/96-conHP-3.swf",
	"/images/swf/96-conHP-4.swf"
);

var imgArray = new Array(
	"/img_common/home_banner_2.jpg",
	"/img_common/home_banner_7.jpg",
	"/img_common/home_banner_12.jpg",
	"/img_common/home_banner_13.jpg"
);

function rand(n) {
seed = (0x015a4e35 * seed) % 0x7fffffff;
return (seed >> 16) % n;
}
        
var now = new Date();
var seed = now.getTime() % 0xffffffff;

// In this section we set up the content to be placed dynamically on the page.
// Customize movie tags and alternate html content below.
function showFlash(flash, img){
	var output = "";
	if (!useRedirect) {    // if dynamic embedding is turned on
	  if(hasRightVersion) {  // if we've detected an acceptable version
    	output = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	    + 'WIDTH="540" HEIGHT="148"'
    	+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
	    + '<PARAM NAME="MOVIE" VALUE="'+flash+'">'
	    + '<PARAM NAME="PLAY" VALUE="true">'
	    + '<PARAM NAME="LOOP" VALUE="false">'
	    + '<PARAM NAME="QUALITY" VALUE="high">'
	    + '<PARAM NAME="MENU" VALUE="false">'
	    + '<EMBED SRC="'+flash+'"'
	    + 'WIDTH="540" HEIGHT="148"'
	    + 'PLAY="true"'
	    + 'LOOP="false"'
	    + 'QUALITY="high"'
	    + 'MENU="false"'
	    + 'TYPE="application/x-shockwave-flash"'
	    + 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
	    + '<\/EMBED>'
	    + '<\/OBJECT>';

	  } else {  // flash is too old or we can't detect the plugin
    	// NOTE: height, width are required!
	    output = '<img src="'+img+'" width=540 height=148 border=0 title="LegalMatch Client and Lawyer" alt="LegalMatch Client and Lawyer">'; 
	  }
	  document.write(output);   // embed the flash movie
	}
}

function getRandomFlash(){
	return flashArray[rand(flashArray.length)];
}

function getRandomImg(){
	return imgArray[rand(imgArray.length)];
}

