var imageDetails = new Object();
imageDetails.imageArray = new Array();
imageDetails.imagePhraseArray = new Array();

// The image
imageDetails.imageArray[0] = "TreeGrowing";
imageDetails.imageArray[1] = "HouseConstruction";
imageDetails.imageArray[2] = "BeachStep";

// The phrase assoicated with the image
imageDetails.imagePhraseArray[0] = "growing your business online";
imageDetails.imagePhraseArray[1] = "building your internet presence";
imageDetails.imagePhraseArray[2] = "helping you make your mark";

/**
 * Generate the random index number
 */
index = Math.random();
index = Math.round(index * 10);
arrayLength = imageDetails.imageArray.length;

while(index > arrayLength)
{
	index = Math.random();

	index = Math.round(index * 10);
	
}

if(index <= arrayLength && index !=0) {
	index = index-1;	
} else {
	index = 0;	
}

/***************************************/

// Display the Catch phrase
function randomImageGenerator()
{
   document.getElementById("catchPhrase").innerHTML=imageDetails.imagePhraseArray[index];
   //document.getElementById("homePageImage").innerHTML=getFlashCode(index);
   //alert(imageDetails.imageArray[index]+ " "+imageDetails.imagePhraseArray[index]);	
}

function getPhrase() {
		return imageDetails.imagePhraseArray[index];
}

// Display the flash code
function getFlashCode() {
	flashMovie = imageDetails.imageArray[index];
	document.write("<script type=\"text/javascript\">AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','235','src','layout/flash/" + flashMovie + "','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','layout/flash/" + flashMovie + "' ); //end AC code</script><noscript><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=\"300\" height=\"235\"><param name=\"movie\" value=\"layout/flash/" + flashMovie + ".swf\" /><param name=\"quality\" value=\"high\" /><embed src=\"layout/flash/" + flashMovie + ".swf\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"300\" height=\"235\"></embed></object></noscript>");
}

