// ACTDR Image Swap Script 1.0
// Author:  Gerry Brinkman
// Revison Date:  Sept 24, 2004 - updated with new games in planning
// Enquiries:  webmaster@acalltoduty.com
// Copyright 2004 A Call to Duty Roleplaying
// http://www.acalltoduty.com

//constants
var fPath = "http://www.acalltoduty.com/images/games/"

//games
var gameFile = new Array()
var gameAlt = new Array()
var gameLink = new Array()

gameFile[1]="startrek1.jpg"
gameAlt[1]="Star Trek: A Call to Duty"
gameLink[1]="http://startrek.acalltoduty.com"

gameFile[3]="startrek2.jpg"
gameAlt[3]="Star Trek: A Call to Duty"
gameLink[3]="http://startrek.acalltoduty.com"

gameFile[5]="itoh1.jpg"
gameAlt[5]="In the Time of Heroes"
gameLink[5]="http://inthetimeofheroes.acalltoduty.com"

gameFile[6]="itoh2.jpg"
gameAlt[6]="In the Time of Heroes"
gameLink[6]="http://inthetimeofheroes.acalltoduty.com"

gameFile[9]="stargate1.jpg"
gameAlt[9]="7th Chevron:  A Call to Duty"
gameLink[9]="http://7thchevron.acalltoduty.com"

gameFile[10]="stargate2.jpg"
gameAlt[10]="7th Chevron:  A Call to Duty"
gameLink[10]="http://7thchevron.acalltoduty.com"

//begin code

var fIndex

function fRandom(fFile,fAlt,fLink){
	
	if(fFile==gameFile){
		while(!fIndex || !gameFile[fIndex]){
			fIndex = Math.round(Math.random()*(fFile.length-1))
		}
	}
	
	return '<a href="'+fLink[fIndex]+'" alt="'+fAlt[fIndex]+'"><img src="'+fPath+fFile[fIndex]+'" border="0"></a>'

}
