// JavaScript Document
//******************************************************* Menu1 Control 
// Menu1 Control 
var myOffset = -396;
		
		var myMenu = new ypSlideOutMenu("menu1", "down", 0, 386, 500, 150)
 
		myMenu.onactivate = repositionMenu
 
		function repositionMenu()
		{
			var newLeft = getWindowWidth() / 2 + myOffset;
			myMenu.container.style ? myMenu.container.style.left = newLeft + "px" : myMenu.container.left = newLeft;
		}
		 
		function getWindowWidth()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}	

// Menu2 Control 
var myOffset2 = -316;

		var myMenu2 = new ypSlideOutMenu("menu2", "down", 0, 386, 500, 150)
 
		myMenu2.onactivate = repositionMenu2
 
		function repositionMenu2()
		{
			var newLeft = getWindowWidth() / 2 + myOffset2;
			myMenu2.container.style ? myMenu2.container.style.left = newLeft + "px" : myMenu2.container.left = newLeft;
		}
		 
		function getWindowWidth2()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}

// Menu3 Control 
var myOffset3 = -152;

		var myMenu3 = new ypSlideOutMenu("menu3", "down", 0, 386, 500, 150)
 
		myMenu3.onactivate = repositionMenu3
 
		function repositionMenu3()
		{
			var newLeft = getWindowWidth() / 2 + myOffset3;
			myMenu3.container.style ? myMenu3.container.style.left = newLeft + "px" : myMenu3.container.left = newLeft;
		}
		 
		function getWindowWidth3()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}

// Menu4 Control 
var myOffset4= -40;

		var myMenu4 = new ypSlideOutMenu("menu4", "down", 0, 386, 500, 150)
 
		myMenu4.onactivate = repositionMenu4
 
		function repositionMenu4()
		{
			var newLeft = getWindowWidth() / 2 + myOffset4;
			myMenu4.container.style ? myMenu4.container.style.left = newLeft + "px" : myMenu4.container.left = newLeft;
		}
		 
		function getWindowWidth4()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}
		

// Menu5 Control 
var myOffset5 = 63;
		
		var myMenu5 = new ypSlideOutMenu("menu5", "down", 0, 386, 500, 150)
 
		myMenu5.onactivate = repositionMenu5
 
		function repositionMenu5()
		{
			var newLeft = getWindowWidth() / 2 + myOffset5;
			myMenu5.container.style ? myMenu5.container.style.left = newLeft + "px" : myMenu5.container.left = newLeft;
		}
		 
		function getWindowWidth5()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}	
				

// Menu6 Control 
var myOffset6 = 237;
		
		var myMenu6 = new ypSlideOutMenu("menu6", "down", 0, 386, 500, 150)
 
		myMenu6.onactivate = repositionMenu6
 
		function repositionMenu6()
		{
			var newLeft = getWindowWidth() / 2 + myOffset6;
			myMenu6.container.style ? myMenu6.container.style.left = newLeft + "px" : myMenu6.container.left = newLeft;
		}
		 
		function getWindowWidth()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}	



//******************************************************* End Menu1 Control 





//This is the function for the slide show.
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 3000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 4;

var Picture = new Array(); // don't change this

Picture[1]  = 'graphics/FP_MasterHead_01.jpg';
Picture[2]  = 'graphics/FP_MasterHead_02.jpg';
Picture[3]  = 'graphics/FP_MasterHead_03.jpg';
Picture[4]  = 'graphics/FP_MasterHead_03.jpg';

var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

