/*  Homepage swap SWF code  */
<!--
var flash_path = "/flash/";
var portrait_array = ["portrait1.swf","portrait2.swf","portrait3.swf","portrait4.swf"];
var hole_array = ["hole1.swf","hole2.swf","hole3.swf","hole4.swf"];


function get_random_portrait() {
	var rand_portrait_index = get_random_num( portrait_array.length ) - 1;
	return portrait_array[rand_portrait_index];
}

function write_random_portrait() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_fn = flash_path + get_random_portrait();
		writeFlash("homepage_photo", rand_fn, "148", "161", "left", "opaque", "#000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_portrait.jpg' width='148' height='161' />")
	}
}

function write_random_portrait_1() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_fn = flash_path + get_random_portrait();

		writeFlash("homepage_photo", rand_fn, "148", "161", "left", "opaque", "#000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_portrait.jpg' width='148' height='161' />")
	}
}

function write_random_portrait_2() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_fn = flash_path + get_random_portrait();

		writeFlash("homepage_photo", rand_fn, "148", "161", "left", "opaque", "#000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_portrait.jpg' width='148' height='161' />")
	}
}



function get_random_hole() {
	var rand_hole_index = get_random_num( hole_array.length ) - 1;
	return hole_array[rand_hole_index];
}

function write_random_hole() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_ff = flash_path + get_random_hole();
		writeFlash("homepage_photo2", rand_ff, "111", "122", "left", "transparent", "0000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_hole.gif' width='111' height='122' />")
	}
}
function write_random_hole_1() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_ff = flash_path + get_random_hole();
		writeFlash("homepage_photo2", rand_ff, "111", "122", "left", "transparent", "0000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_hole.gif' width='111' height='122' />")
	}
}

function write_random_hole_2() {
	if ( hasRightVersion ) {
		// choose a random flash file from the array
		var rand_ff = flash_path + get_random_hole();
		writeFlash("homepage_photo2", rand_ff, "111", "122", "left", "transparent", "0000000", "6,0,67,0");
	} else {
		//alert( "need flash 6 to view" );
		document.write("<img src='/img/noflash_hole.gif' width='111' height='122' />")
	}
}


function get_random_num( limit ) {
	var num = Math.floor( Math.random() * limit ) + 1;
	return num;
}


function write_random_image(){
	var image_array = [];
	
	image_array[0] = ("<img src='/img/gargoyle1.jpg' width='104' height='90' />");
	image_array[1] = ("<img src='/img/gargoyle2.jpg' width='104' height='90' />");
	image_array[2] = ("<img src='/img/gargoyle3.jpg' width='104' height='90' />");
	image_array[3] = ("<img src='/img/gargoyle4.jpg' width='104' height='90' />");
	
	
	rand_index = randomNumber( image_array.length );
	document.write( image_array[rand_index] );
}

function write_random_image_1(){
	var image_array = [];
	
	image_array[0] = ("<img src='/img/gargoyle1.jpg' width='104' height='90' />");
	image_array[1] = ("<img src='/img/gargoyle2.jpg' width='104' height='90' />");
	image_array[2] = ("<img src='/img/gargoyle3.jpg' width='104' height='90' />");
	image_array[3] = ("<img src='/img/gargoyle4.jpg' width='104' height='90' />");
	
	
	rand_index = randomNumber( image_array.length );
	document.write( image_array[rand_index] );
}

function write_random_image_2(){
	var image_array = [];
	
	image_array[0] = ("<img src='/img/gargoyle1.jpg' width='104' height='90' />");
	image_array[1] = ("<img src='/img/gargoyle2.jpg' width='104' height='90' />");
	image_array[2] = ("<img src='/img/gargoyle3.jpg' width='104' height='90' />");
	image_array[3] = ("<img src='/img/gargoyle4.jpg' width='104' height='90' />");
	
	
	rand_index = randomNumber( image_array.length );
	document.write( image_array[rand_index] );
}

function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}
//-->