<!--

// Add an eventListener to browsers that can do it somehow.
// Originally by the amazing Scott Andrew.
function addEvent(obj, evType, fn){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, false);
    return true;
  } else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
	return false;
  }
}
	function changePic(whichPic)
{
	var myPic = eval("document.images.pic");
	if (myPic) { myPic.src =  "slides/"+whichPic+".jpg"; }
	//document.images.pic.src = "slides/"+whichPic;
	var myLink = eval("document.getElementById('popup')");
	if (myLink) { myLink.href = "slides/"+whichPic+"_b.jpg";	}
}

printPDF = function(textID)
{
	return window.location.href = "pdf.out.php?textId="+textID;
}

function OpenBrWindow(theURL,winName, features,myWidth, myHeight, isCenter)
{
  var win = null;
  if(window.screen)
  {
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    var settings = 'height=' + myHeight + ',';
    settings += 'width=' + myWidth;

	if(isCenter) {  settings+=',left='+myLeft+',top='+myTop; }
    if(features) {
        settings+= ','+features;
        }
  	}
  	//alert(settings);
  win = window.open(theURL,winName,settings);
  win.window.focus();
}

   function showDescription(which)
   {
   /*   var tmp = eval("document.getElementById('"+which+"')");
      if (tmp.style.display == 'none') { tmp.style.display = 'block'; }
      else { tmp.style.display = 'none'; }*/
	  //var el = $(obj);
	  var el = document.getElementById(which);
	  el.style.display = (el.style.display != 'none' ? 'none' : 'block' );
    }
	   function showMore(which)
   {
   	  var el = document.getElementById(which);
	  el.style.display = (el.style.display != 'none' ? 'none' : 'block' );
    }

   getURL = function(URL, isNew)
   {
      if(URL)
	  {
		//window.location = URL;
		//return true;
		if(isNew) { window.open(URL,'_blank'); /*return false;*/ }
		else { window.location= URL; }
	  }
    }

 function SWFDelegate(url,width,height,caption)
	{
		var objLink = document.createElement('a');
		objLink.setAttribute('href',url);
		objLink.setAttribute('rel','lightbox');
		objLink.setAttribute('title',caption);
		if(typeof width != 'undefined') { objLink.setAttribute('width',width);  }
		if(typeof height != 'undefined') { objLink.setAttribute('height',height);  }
		Lightbox.prototype.start(objLink);
		}

function highlightOn(image)
{
  var Img = document.getElementById(image);
  Img.style.borderColor = "#FF8A00";
  //return false;
}

function highlightOff(image)
{
  var Img = document.getElementById(image);
  Img.style.borderColor = "#999999";
  //return false;
}

function selectCallback(s, u)
{
 // This function gets called when selection changes
 if( s.selectedIndex == -1 || s.selectedIndex == "" || s.selectedIndex == null) return;
 var v = s.options[s.selectedIndex].value;
  document.location.href= u + v;
}

function attachBehaviors()
{
 // Attach event handler to your select object
 var s = document.getElementById("CenturyBox");
 var f = document.getElementById("FaceBox");
 if( s)
 {
 var u = "./?page=timeline&c="
 s.onchange = function(){selectCallback(s, u);};
 }
 if( f)
 {
 var u = "./?page=persons&f="
 f.onchange = function(){selectCallback(f, u);};
 }
}
//window.onload = attachBehaviors;
addEvent(window, "load", attachBehaviors);
//-->
