
//############ Fading Slide Show with Random Initial Image ################//
<!-- Begin
var interval = 5; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("pic_pupparo.jpg");
image_list[image_index++] = new imageItem("pic_mitchell.jpg");
image_list[image_index++] = new imageItem("pic_stefanich.jpg");
image_list[image_index++] = new imageItem("pic_colon.jpg");
var number_of_image = image_list.length;

function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}

function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}

function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}

function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}

function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files



// do not edit anything below this line
var image_count = Pic.length;
image_start = generate(0, image_count-1); // load random image 

var t;
var j = image_start;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}

//Slide show has been disabled. Remove the comment code below to activate slideshow. 
function runSlideShow() {
if (document.all) {
//document.images.SlideShow.style.filter="blendTrans(duration=2)";
//document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
//document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
document.getElementById("SlideLink").href = Link[j];

//if (document.all) {
//document.images.SlideShow.filters.blendTrans.Play();
//}
//j = j + 1;
//if (j > (p - 1)) j = 0;
//t = setTimeout('runSlideShow()', slideShowSpeed);
}
//  End -->

	opac = 0;
	function fadeIn() {
		if(opac < 100) {
			opac+=10;
			document.getElementById('video').style.filter = 'alpha(opacity='+opac+')';
			setTimeout('fadeIn()', 50);
    		}
		}

	function PlayVideo(video) {
		var arrayPageSize = getPageSize();
		var windowheight = GetWindowHeight();
		var objOverlay = document.getElementById('video');
		objOverlay.style.height = (arrayPageSize[1] + 'px');
		document.getElementById('videoholder').style.height = windowheight + 'px';
		document.getElementById('video').style.filter = 'alpha(opacity=90)';
		//MM_showHideLayers('video','','show');
		document.getElementById('video').style.visibility = "visible";
		//fadeIn();
		var t=setTimeout("GetVideo('"+ video + "')",50);
		
		
	}
	function GetVideo(video) {
		//alert("get video");
		videopath = "/videos/";
		videofile = videopath + video + ".swf"
		var fo = new FlashObject(videofile, "movie", "296", "275", "9", "#345B87");
		fo.addParam("quality", "high");
		fo.addParam("loop", "true");
		fo.addParam("menu", "false");
		//fo.addParam("wmode", "transparent");
		fo.addParam("bgcolor", "#345B87");
		fo.addParam("base", videopath);
		fo.write("flashcontent");
		
		
		html = document.getElementById('flashcontent').innerHTML;
		html = html.toLowerCase(); 
		if (html == '<img src="images/blank.gif" width="360" height="268">') {
			document.getElementById('flashcontent').innerHTML = "<a href=\"http://www.macromedia.com/go/getflashplayer\" target=\"_blank\"><img src=\"images/downloadplayer.gif\" width=\"420\" height=\"120\"></a>";
		}
	}
	function HideVideo() {
		document.getElementById('flashcontent').innerHTML = "<img src=\"../images_style/blank.gif\" width=\"296\" height=\"275\">";
		MM_showHideLayers('video','','hide');
	}
	
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


function GetWindowHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  return myHeight;
}


