
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// ypSlideOutMenu info -360, -187, -2, 169

        var myOffset1 = -368;
		var myOffset2 = -190;
		var myOffset3 = -2;
		var myOffset4 = 180;
		// ypSlideOutMenus(sIdPrefix, sDir, iInitLeft, iInitTop, iWidth, iHeight)
		// the number you pass to initLeft doesn't matter since it will get changed onactivate
		var myMenu1 = new ypSlideOutMenu("menu1", "down", 100, 130, 175, 200)
		var myMenu2 = new ypSlideOutMenu("menu2", "down", 222, 130, 185, 200)
		var myMenu3 = new ypSlideOutMenu("menu3", "down", 300, 130, 185, 200)
		var myMenu4 = new ypSlideOutMenu("menu4", "down", 400, 130, 169, 200)
		myMenu1.onactivate = repositionMenu1
		myMenu2.onactivate = repositionMenu2
		myMenu3.onactivate = repositionMenu3
		myMenu4.onactivate = repositionMenu4
 
		function repositionMenu1()
		{
			var newLeft1 = getWindowWidth() / 2 + myOffset1;
			myMenu1.container.style ? myMenu1.container.style.left = newLeft1 + "px" : myMenu1.container.left = newLeft1;
		}
		function repositionMenu2()
		{
			var newLeft2 = getWindowWidth() / 2 + myOffset2;
			myMenu2.container.style ? myMenu2.container.style.left = newLeft2 + "px" : myMenu2.container.left = newLeft2;
		}
		function repositionMenu3()
		{
			var newLeft3 = getWindowWidth() / 2 + myOffset3;
			myMenu3.container.style ? myMenu3.container.style.left = newLeft3 + "px" : myMenu3.container.left = newLeft3;
		}
		function repositionMenu4()
		{
			var newLeft4 = getWindowWidth() / 2 + myOffset4;
			myMenu4.container.style ? myMenu4.container.style.left = newLeft4 + "px" : myMenu4.container.left = newLeft4;
		}
		 
		function getWindowWidth()
		{
			return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
		}	

		
		
// Random Top strip and Bottom strip

var TopImages = new Array() 
TopImages[0] = 'images/picturebar1.jpg'
TopImages[1] = 'images/picturebar2.jpg'
TopImages[2] = 'images/picturebar3.jpg'
TopImages[3] = 'images/picturebar4.jpg'

var BotImages = new Array() 
BotImages[0] = 'images/picturebar1_.jpg'
BotImages[1] = 'images/picturebar2_.jpg'
BotImages[2] = 'images/picturebar3_.jpg'

var j = 0
var p = TopImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = TopImages[i]
}
var jj = 0
var pp = BotImages.length;
var ppreBuffer = new Array()
for (ii = 0; ii < p; ii++){
   ppreBuffer[i] = new Image()
   ppreBuffer[i].src = BotImages[i]
}
var whichTopImage = Math.round(Math.random()*(p-1));
var whichBotImage = Math.round(Math.random()*(pp-1));
function showTopImage(){
		 document.write('<img src="'+TopImages[whichTopImage]+'">');
}
function showBotImage(){
		 document.write('<img src="'+BotImages[whichBotImage]+'">');
}


