// BrowserCheck Variables
var ie4 = (document.all && !document.getElementById) ? true : false;
var ns4 = (document.layers) ? true : false;
var ie5 = (document.all && document.getElementById) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
var ismac = (navigator.appVersion.indexOf("Mac") != -1)? true:false;
var currentTimeout = 0;
var origWidth = 0;
var origHeight = 0;
var currentId = "";
var divX = new Object();
var divY = new Object();
var divW = new Object();
var divH = new Object();

var Popups= new Array();
Popups[0] = new Array('FeireisenDiv', 515, 394, 200, 380);
Popups[1] = new Array('StevensDiv', 494, 254, 200, 275);
Popups[2] = new Array('MessinaDiv', 388, 227, 200, 300);
Popups[3] = new Array('ReedDiv', 301, 147, 200, 275);
Popups[4] = new Array('BermanDiv', 210, 213, 200, 250);
Popups[5] = new Array('CatlettDiv', 438, 446, 200, 200);
Popups[6] = new Array('SiedelDiv', 140, 389, 200, 200);
Popups[7] = new Array('LivnyDiv', 158, 519, 200, 240);
Popups[8] = new Array('FosterDiv', 239, 447, 200, 200);
Popups[9] = new Array('JohnstonDiv', 276, 578, 200, 180);

function init() {
for (var i=0; i < Popups.length; i++)
		{
		var id = Popups[i][0];
		if (ie4 || ie5) {
			document.all[id].onmouseout = doOut;
			document.all[id].onmouseover = doDisable;
		}
		if (ns4) {
			origWidth = innerWidth;
			origHeight = innerHeight;
			onresize = reDo;
			document.layers[id].onmouseout = doOut;
			document.layers[id].onmouseover = doDisable;
		}
		if (ns6) {
			document.getElementById(id).onmouseout = doOut;
			document.getElementById(id).onmouseover = doDisable;
		}
		divX[id] = Popups[i][1];
		divY[id] = Popups[i][2];
		divW[id] = Popups[i][3];
		divH[id] = Popups[i][4];
	}
}


function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight) 
   location.reload();
}

function doOut(evt) {
	var x = 0;	var left = 0;	var right = 0;
	var y = 0;	var top = 0;	var bottom = 0;
	if (! evt) {evt = window.event};
	if (ns4 || ns6) {
		x = (evt.pageX + window.scrollX);
		y = (evt.pageY + window.scrollY);
	}
	if (ie4 || ie5) {
		x = evt.x+document.body.scrollLeft;
		y = evt.y+document.body.scrollTop; 
	}

	left = divX[currentId];
	right = left + divW[currentId];
	top = divY[currentId];
	bottom = top + divH[currentId];
	if (!((left < x)&&(x<right)&&(top < y)&&( y< bottom))) {
		hide(currentId);
	}
}

function doDisable(evt) {
	window.clearTimeout(currentTimeout);return false;
}

function hideAll(){
for (var i=0; i < Popups.length; i++)
		{
		hide(Popups[i][0]);
		}
}

function show(id){
	hideAll();
	if (ns4) document.layers[id].visibility ="show";
	else if (ie4 || ie5) document.all[id].style.visibility="visible";
	else document.getElementById(id).style.visibility="visible";
	currentId = id;
	currentTimeout = window.setTimeout("hide('" + id + "');", 10000);
}
	
function hide(id){
	if (currentId != "") {
		if (ns4) document.layers[id].visibility ="hide";
		else if (ie4 || ie5) document.all[id].style.visibility="hidden";
		else document.getElementById(id).style.visibility="hidden";
//		currentId = "";
	}
}	
	
	
//New window functions

var imageWindow;

function openVideo(imagetoOpen){
		var height =255;
		//if( (navigator.userAgent.toLowerCase().indexOf("win")) >0 && (ie4 ||ie5)){height = height +20;}
		var wintoOpen ='video_win.html?' + imagetoOpen;
		imageWindow = window.open(wintoOpen, "newVideo", "left=50,top=150,toolbar=no,location=no,directories=no,status=no,menubar=no,screenX=0,width=320,height=" + height + ",screenY=0,scrollbars=no,resizable=no");
        
	imageWindow.focus();
         }
         
    
//Image swap functions

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.01
  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 && d.getElementById) x=d.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];}
}



