// JavaScript for Process photo gallery in the Building section

<!--
pathname ='../images/navbuts/'
var imagesExist
var rollSuffix='rol.gif'
var origSuffix='but.gif'
var origTextSuffix='white.gif'
var textSuffix='hi'
var ext ='.gif'
var downSuffix='dwn.gif'
localPathName = 'images/'
var thumbNumber = '0'
var imageSuffix = '.jpg'
var largeImageSuffix = 'big.jpg'
var largeImageName = 'display'
var slideTextSuffix ='hi.gif'
var stageTextName = 'stageText'
var thumbTextName = 'thumbText'
var hideGif = '../images/clear.gif'
var displayTextName ='displayText'

var win
var pluginApp
var flashVersRequired = 4
var flashInstalled = 0
var installedFlashVersion
var isWindowsMSIE = 0
var flash5Installed = 0
var flash4Installed = 0
var noFlashURL = "noFlash.html"
var ie4Mac = "ie4Macgrave.html"
var section = 'War Graves'
var theURL
var theAltURL
var theURLdirectory = '3building/'


window.name="main"
if ((navigator.appVersion.indexOf("MSIE") != -1) && (navigator.appVersion.indexOf("Windows") != -1)){

	 isWindowsMSIE =1

}

	if (navigator.plugins && navigator.plugins.length > 0){								
		if (navigator.plugins["Shockwave Flash"]){		

			
			getFlashInfo = navigator.plugins["Shockwave Flash"].description;
			
			flashInstalled = 1
			installedFlashVersion = parseInt(getFlashInfo.charAt(getFlashInfo.indexOf(".") - 1));



		} else  {

		  flashInstalled = 0


		}

	} else {

			if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Mac")>=0 && navigator.userAgent.indexOf("4.")>=0) {

			flashInstalled = 2

	
		} 
	}



// write vbscript detection.
if(isWindowsMSIE){ 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('</SCR' + 'IPT\> \n'); 

	if(flash5Installed) {
		flashInstalled = 1
		installedFlashVersion = 5
	} else if (flash4Installed) {
		flashInstalled = 1
		installedFlashVersion = 4
	} else {
		flashInstalled = 0
	}
	
}
if (document.images) imagesExist=document.images
	else  imagesExist=null


//CREATE IMAGE ARRAY FOR PRLD
if (imagesExist)  {


arImageSrc = new Array(
	pathname + "white.gif",	
	pathname + "landrol.gif",	
	pathname + "visitrol.gif",	
	pathname + "buildrol.gif",
	pathname + "panelrol.gif",
	pathname + "envirorol.gif",
        pathname + "teachrol.gif",
        pathname + "homerol.gif",
	pathname + "landhi.gif",	
	pathname + "visithi.gif",	
	pathname + "buildhi.gif",
	pathname + "panelhi.gif",
	pathname + "envirohi.gif",
        pathname + "teachhi.gif",
        pathname + "over3hi.gif",
        pathname + "desighi.gif",
        pathname + "conchi.gif",
        pathname + "opt2rol.gif",
        pathname + "opt3rol.gif",
       	pathname + "opt4rol.gif",
	localPathName + "s9rol.gif",
	localPathName + "s8rol.gif",
	localPathName + "s7rol.gif",
	localPathName + "s6rol.gif",
	localPathName + "s5rol.gif",
	localPathName + "s4rol.gif",
	localPathName + "s3rol.gif",
	localPathName + "s2rol.gif",
	localPathName + "s1rol.gif",
	localPathName + "s10rol.gif",

	localPathName + "s1hi.gif",
	localPathName + "s2hi.gif",
	localPathName + "s3hi.gif",
	localPathName + "s4hi.gif",
	localPathName + "s5hi.gif",
	localPathName + "s6hi.gif",
	localPathName + "s7hi.gif",
	localPathName + "s8hi.gif",
	localPathName + "s9hi.gif",
	localPathName + "s10hi.gif")


arImageList = new Array()

for (counter in arImageSrc) {
	arImageList[counter] = new Image()
	//arImageList[counter].src = pathname + arImageSrc[counter]
	arImageList[counter].src = arImageSrc[counter]
	}

}

//--

thumbArray = new Array(
	
	"t1",	
	"t2",	
	"t3",
	"t4",
	"t5")

function showText(name,type,num) {
    if (imagesExist) {
	if (type == 'thumb') {
	//message coming from thumbnail graphic

	imagesExist[thumbTextName].src = localPathName + thumbNumber + name + slideTextSuffix
	} else if(type=='stage'){
	//message coming from stage buttons -- need to display caption for stage and show rollover

	if(num != thumbNumber) {
	imagesExist[stageTextName].src = localPathName + name + slideTextSuffix
	imagesExist[name].src = localPathName + name + rollSuffix }
	} else {
	//need to display caption for main display
	imagesExist[displayTextName].src = localPathName + thumbNumber + name + slideTextSuffix }
    } else {
	alert('To view the slide show you will need a more up to date browser')
            }


}

function hideText(name,type,num){
    if (imagesExist) {
	if (type == 'thumb') {
		imagesExist[thumbTextName].src = hideGif
	} else if(type=='stage'){
		
		if(num != thumbNumber) {
		oldNum = parseInt(thumbNumber) + 1
		newName = 's' + oldNum
	        imagesExist[stageTextName].src = localPathName + newName + slideTextSuffix
                imagesExist[name].src = localPathName + name + origSuffix }}
   } else {
     alert('To view the slide show you will need a more up to date browser')
            }
}



function showLargeImage(imageName){
    if (imagesExist) {
	compName = thumbNumber + imageName + largeImageSuffix
	
	imagesExist[largeImageName].src = localPathName + compName
	showText(imageName)
   } else {
     alert('To view the slide show you will need a more up to date browser')
            }
}


function switchThumbs(num,name) {
    if (imagesExist) {
  	if(thumbNumber!= num) {
	showMouseDown(name)
	oldNum = parseInt(thumbNumber) + 1
	newName = 's' + oldNum
	revertButton(newName)
	thumbNumber= num
        
//use the following two lines if the large image is to change with the thumbnails
	//imageName = thumbArray[0]
	//showLargeImage(imageName)

 	for(var i=0; i<=thumbArray.length-1; i++){
		imageName = thumbArray[i]
           
		imagesExist[imageName].src = localPathName + num + imageName + imageSuffix }
		
	} else {
		//have clicked the current selected stage option

	}

   } else {
     alert('To view the slide show you will need a more up to date browser')
            }
}
function showStatus(message,num) {	
	if(num!=thumbNumber) {
	window.status=message
	return true 
	} else {
	window.status='Already loaded'
	return true}

}

function showMouseDown(name) {
    if (imagesExist) {
	imagesExist[name].src = localPathName + name + downSuffix
   } else {
     alert('To view the slide show you will need a more up to date browser')
            }
}

function revertButton(name) {
    if (imagesExist) {
	imagesExist[name].src = localPathName + name + origSuffix
    } else {
      alert('To view the slide show you will need a more up to date browser')
            }
}

//--

function off(name,option) {

	if (imagesExist) {

		if(option)  {

		   imagesExist[option].src= pathname + option + origSuffix;
		} else {
		   imagesExist[name].src= pathname + name + origSuffix;
		
			}
		   imagesExist[textSuffix].src= pathname + origTextSuffix;

   }		 
}

function on(name,option) {
	if (imagesExist) {
		if(option)  { 
		   imagesExist[option].src= pathname + option + rollSuffix;
		 } else {
                   imagesExist[name].src= pathname + name + rollSuffix; 
                   			}
		   imagesExist[textSuffix].src= pathname + name  + textSuffix + ext;
		
  }	
}


function checkForFlash(aURL,aSection,versRequired,altURL) {
	theURL = theURLdirectory + aURL
	section = aSection
	flashVersRequired = versRequired
	if(altURL) { 
		theAltURL = altURL
	}
	if(flashInstalled == 2)  {

		message = 'You are currently running Internet Explorer 4.5 for the Macintosh.'
		navigateToNoFlashPage(message,'ieMac',aSection,'Flash')	


	} else if (flashInstalled == 1)  {

		if (installedFlashVersion >= flashVersRequired) {

			document.location = aURL
			
		} else {
			
			message = 'This browser has Version ' + installedFlashVersion + '  of the  Flash plugin currently installed.'
			
			navigateToNoFlashPage(message,'other',aSection,'Flash')
			if (altURL)  {

				document.location = altURL

			}		
		
		}
		

		

	} else {
		
		 message = 'There is currently no Flash plug in installed for this browser'

		navigateToNoFlashPage(message,'other',aSection,'Flash')
		if (altURL)  {

		document.location = altURL
		}
		
	}

}

function navigateToNoFlashPage(message,browser,aSection,plug)  {
		theMessage = message
		theBrowser = browser
		section = aSection
		pluginApp = plug
		win = window.open("../noflash.html","pluginWin","toobar=no,status=no,height=260,width=300,scrollbars=no,menubar=no,location=0,resizable=no,directories=no")
		win.section = section
		win.version = flashVersRequired
		win.currentVersion = installedFlashVersion
		win.message = theMessage
       	win.browser = theBrowser
		win.theURL = theURL
		win.pluginApp = pluginApp

}


function closeChildWindow()  {
 if(win && win.open)  {
 // win.close() 
}
}

//-->