function RandomFrontImage()
{	
	// Ensure that the indexes for each array matches the relevant dog
   	var arrImages = new Array();
 	var arrImageLinks = new Array();
 	var arrDogNames = new Array();
 	var strPath = "ourdogs/images/";

	var gstrDogImage;
	var gstrDogImageLink;
	var gstrDogName;
	var gstrString;
	var i;
	var strTemp;
	
        // **********************************************************************************************************************
	// Array containing the names of the dogs. This is the only part of this file which should be updated or amended. 		
	arrDogNames[2]="Darcy";	
	arrDogNames[3]="Piglet";
	arrDogNames[4]="Sapphire";	
	arrDogNames[1]="Kastro";		
	// **********************************************************************************************************************
	
	//Loop through the Dog Names array construction paths for their photos and file locations
	for (i = 1; i < arrDogNames.length; i++)
	{
		strTemp = arrDogNames[i].toLowerCase();
	
		// Build the Dog's Image array
		arrImages[i]='http://guildfordstaffords.org/ourdogs/images/' + strTemp + '.gif';
		
		// Build the Dog's Links array
		arrImageLinks[i]='http://guildfordstaffords.org/ourdogs/' + strTemp + '/infopage' + strTemp + '.htm';
	}
	
   	var lngRandom = Math.floor(Math.random() * arrImages.length);
   	
	// Change the random number if it is 0 as this index does not exist
	if (lngRandom == 0)
	{
		var lngRandom = Math.floor(Math.random() * arrImages.length);

		if (lngRandom == 0) // oh well, just set it to 1
		{
			lngRandom = 1;
		}	
	} 

	// Use the random number to generate the pictures and set the variables for the HTML
	gstrDogImage = arrImages[lngRandom];
	gstrDogImageLink = arrImageLinks[lngRandom];
	gstrDogName = arrDogNames[lngRandom];  

        var gReturnString = '<a href="' + gstrDogImageLink + '"> <img src="' + gstrDogImage + ' " width="240" height="180" alt="Click for more information about ' + gstrDogName + '"  border="0"></a><h4><center>Could you give ' + gstrDogName  + ' a good home?</center></h4>';
        
        //alert(gReturnString);
        
        document.write(gReturnString);
}

function NewWindow(strPath, strHandle)
{
    window.open(strPath, strHandle);
}

function NewWindowBatterseaMap()
{
     window.open('http://maps.live.com/default.aspx?v=2&FORM=LMLTCP&cp=51.446682~-0.573272&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&phx=0&phy=0&phscl=1&where1=SL4%202JN&encType=1','BatterseaOldWindsorMap');
}

