// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = '/images/headerimg1.jpg'
theImages[1] = '/images/headerimg2.jpg'
theImages[2] = '/images/headerimg3.jpg'
theImages[3] = '/images/headerimg4.jpg'
theImages[4] = '/images/headerimg5.jpg'
theImages[5] = '/images/headerimg6.jpg'
theImages[6] = '/images/headerimg7.jpg'
theImages[7] = '/images/headerimg8.jpg'
theImages[8] = '/images/headerimg9.jpg'
theImages[9] = '/images/headerimg10.jpg'
theImages[10] = '/images/headerimg11.jpg'
theImages[11] = '/images/headerimg12.jpg'
theImages[12] = '/images/headerimg13.jpg'
theImages[13] = '/images/headerimg14.jpg'
theImages[14] = '/images/headerimg15.jpg'
theImages[15] = '/images/headerimg16.jpg'
theImages[16] = '/images/headerimg17.jpg'
theImages[17] = '/images/headerimg18.jpg'
theImages[18] = '/images/headerimg19.jpg'
theImages[19] = '/images/headerimg20.jpg'
theImages[20] = '/images/headerimg21.jpg'
theImages[21] = '/images/headerimg22.jpg'
theImages[22] = '/images/headerimg23.jpg'
theImages[23] = '/images/headerimg24.jpg'
theImages[24] = '/images/headerimg25.jpg'
theImages[25] = '/images/headerimg26.jpg'
theImages[26] = '/images/headerimg27.jpg'
theImages[27] = '/images/headerimg28.jpg'
theImages[28] = '/images/headerimg29.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));


function showImage(){
document.write('<img src="'+theImages[whichImage]+'" class="headerimg" />');
}

var videoImages = new Array() // do not change this
videoImages[0] = '/images/safetyvideo1.jpg'
videoImages[1] = '/images/safetyvideo2.jpg'
videoImages[2] = '/images/safetyvideo3.jpg'
videoImages[3] = '/images/safetyvideo4.jpg'
videoImages[4] = '/images/safetyvideo5.jpg'

var videoLinks = new Array()
videoLinks[0] = '/safeschools/index.cfm#ssvideos'
videoLinks[1] = '/safeschools/index.cfm#insideschoolbldg'
videoLinks[2] = '/safeschools/index.cfm#specializedlearning'
videoLinks[3] = '/safeschools/index.cfm#outsideschoolbldg'
videoLinks[4] = '/safeschools/index.cfm#emergencyprep'

/*var videoLinks = new Array()
videoLinks[0] = 'image=/images/videos/ncef-checklist.jpg&file=/images/videos/ncef-checklist.flv'
videoLinks[1] = 'image=/images/videos/inside-school-buildings.jpg&file=/images/videos/inside-school-buildings.flv'
videoLinks[2] = 'image=/images/videos/specialized-learning-environments.jpg&file=/images/videos/specialized-learning-environments.flv'
videoLinks[3] = 'image=/images/videos/outside-school-buildings.jpg&file=/images/videos/outside-school-buildings.flv'
videoLinks[4] = 'image=/images/videos/emergency-preparedness.jpg&file=/images/videos/emergency-preparedness.flv'

var videoHeader = new Array()
videoHeader[0] = 'NCEF Checklist'
videoHeader[1] = 'Inside School Buildings'
videoHeader[2] = 'Specialized Learning Environments'
videoHeader[3] = 'Outside School Buildings'
videoHeader[4] = 'Emergency Preparedness'

var videoDesc = new Array()
videoDesc[0] = 'This video discusses what the NCEF Safety and Security Checklist is, and how to use it.'
videoDesc[1] = 'This video discusses safety issues and low-cost safety solutions for school interiors.'
videoDesc[2] = 'This video discusses safety issues and low-cost safety solutions for laboratories, shops, and auditoriums.'
videoDesc[3] = 'This video discusses safety issues and low-cost safety solutions for school grounds.'
videoDesc[4] = 'This video discusses emergency preparedness for school facilities.'*/

var l = 0
var z = videoImages.length;
var preVideoBuffer = new Array()
for (x = 0; x < z; x++){
   preVideoBuffer[x] = new Image()
   preVideoBuffer[x].src = videoImages[x]
}
var whichVideoImage = Math.round(Math.random()*(z-1));

/*function showVideoImage(){
document.write('<a href="#videobox" height="115px" width="115px"><img src="'+videoImages[whichVideoImage]+'" alt="Safety Video Image" width="115px" height="115px" class="fade" title="Click to watch this video"/></a>');
}*/

function showVideoImage(){
document.write('<a href="'+videoLinks[whichVideoImage]+'" height="115px" width="115px"><img src="'+videoImages[whichVideoImage]+'" alt="Safety Video Image" width="115px" height="115px" class="fade" title="Click to watch this video"/></a>');
}


function showVideoLightbox(){
document.write('<div id="hiddenvideobox"><a name="videobox"></a><div id="closevideotext" style="float:right;padding-right:10px;    padding-top:5px; padding-bottom:10px;"><span id="closevideo" style="text-decoration:underline; cursor:pointer; color:#B91E21;" title="Click to close video">close (x)</span></div><div class="videoPlayer" id="ncef-checklist" style="padding:10px;"><object width="480" height="360" id="flash_558320651" type="application/x-shockwave-flash" data="/images/videos/video-player.swf"><param value="high" name="quality"><param value="true" name="allowfullscreen"><param value="transparent" name="wmode"><param value="'+videoLinks[whichVideoImage]+'" name="flashvars"><param value="/images/videos/video-player.swf" name="movie"></object></div><p style="font-size: 12px; padding-top:5px;margin:0;padding-left:10px;"><strong>'+videoHeader[whichVideoImage]+'</strong></p><p style="font-size: 12px; padding-left:10px; padding-right:10px;">'+videoDesc[whichVideoImage]+'</p></div>');
}
