// JavaScript Document

// ==============================================
// Copyright 2003 by jsCode.com
// Source: jsCode.com
// Author: etLux
// Free for all; but please leave in the header.
// ==============================================

// Set up the image files to be used.
/* var theImages1 = new Array(); */
var theImages2 = new Array();
/* var theImages3 = new Array(); */

// do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!

//will be WH_Polaroid_1countryClub.gif
//**randomize each array so that no two subarray elements contain
//the same sponsor**

/*
theImages1[0] = 'WH_Bristol_1.gif';
theImages1[1] = 'WH_CountryClub_1.gif';
theImages1[2] = 'WH_Hilton_1.gif';
theImages1[3] = 'WH_Spa_1.gif'; */

theImages2[0] = 'sub_middle_1.jpg';
theImages2[1] = 'sub_middle_2.jpg';
theImages2[2] = 'sub_middle_3.jpg';

/*
theImages3[0] = 'WH_Hilton_3.gif';
theImages3[1] = 'WH_Spa_3.gif';
theImages3[2] = 'WH_Bristol_3.gif';
theImages3[3] = 'WH_CountryClub_3.gif'; */


// ======================================
// 
// ======================================

var image_dir = 'images/';
var sub_image_dir = '../images/';

var whichImage = Math.round(Math.random()*(theImages2.length-1));
/*
preBuffer1 = new Image();
preBuffer1.src = image_dir+theImages1[whichImage];
*/
preBuffer2 = new Image();
preBuffer2.src = image_dir+theImages2[whichImage];
/*
preBuffer3 = new Image();
preBuffer3.src = image_dir+theImages3[whichImage];

preBuffer_sub1 = new Image();
preBuffer_sub1.src = sub_image_dir+theImages1[whichImage];

preBuffer_sub2 = new Image();
preBuffer_sub2.src = sub_image_dir+theImages2[whichImage];
*/
//showing images in first level pages
function showImage1()
{
	document.write('<img alt="Washington University Ophthalmology" src="images/'+theImages1[whichImage]+'"/>');
}

function showImage2()
{
	document.write('<a href="patient_care.html"><img alt="Washington University Ophthalmology" src="images/'+theImages2[whichImage]+'"/></a>');
}

function showImage3()
{
	document.write('<img alt="Washington University Ophthalmology" src="images/'+theImages3[whichImage]+'"/>');
}

//showing images in sub (2nd level) pages
function showImageSub1()
{
	document.write('<img alt="Washington University Ophthalmology" src="../images/'+theImages1[whichImage]+'"/>');
}

function showImageSub2()
{
	document.write('<img alt="Washington University Ophthalmology" src="../images/'+theImages2[whichImage]+'"/>');
}