// copyright Rod Morelos http://rod.rant-on.net
// Modified by JanW
var timer = 2000;
var infoTimeout
var janw = {

	// disable annoying opera 7 tooltip (opera 7 uses 'href' as a tooltip if no 'title' attribute present)
	noOpera7Tooltips: function()
	{
		var lnk = document.getElementsByTagName ? document.getElementsByTagName('a') : null;
		if (lnk && bw.op7)
		{
			for (var l = 0; lnk[l]; l++)
			{
				if (!lnk[l].getAttribute('title')) lnk[l].setAttribute('title', ' ');
			}
		}
	},

	// this disables internet exporer 6's image toolbar when you hover your mouse over an image.
	// to permanently disable the image toolbar, go to 'internet options' > 'advanced' > un-click 'enable image toolbar'.
	noImageToolBar: function()
	{
		var img = document.getElementsByTagName ? document.getElementsByTagName('img') : document.images ? document.images : null;
		if (img)
		{
			for (var i = img.length - 1; i > 0; i--)
			{
				img[i].setAttribute('galleryimg', 'no');
			}
		}
	},


	preloadImages: function()
	{
		var img = document.getElementsByTagName ? document.getElementsByTagName('img') : document.images ? document.images : null;
		if (img)
		{
			for (var i = img.length - 1; i > 0; i--)
			{
				naam = 'image' + i
				naam  = new Image;
				naam.src = img[i]
			}
		}
	},


	noFocus: function()
	{
		var lnk = document.getElementsByTagName ? document.getElementsByTagName('a') : document.links ? document.links : null;
		if (lnk)
		{
			for (var l = 0; lnk[l]; l++)
			{
				lnk[l].onfocus = function() { this.blur(); }
			}
		}
	},

	header: function()
	{
		obj1 = document.getElementById("photo");
		obj3 = document.getElementById("photo_info");
		//node = obj3.childNodes[0];
		//node.onclick=function() {
			//alert("Yes");
			//doNextHeader();
		//}
		obj1.onmouseover=function() {
			obj3.style.display = 'block';
			clearTimeout(infoTimeout);
		}
		obj1.onmouseout=function() {
			infoTimeout = setTimeout('obj3.style.display = \'none\'',timer);
		}
		obj1.onclick=function() {
			doNextHeader();
		}
	},

	start: function()
	{
		janw.noFocus();
		janw.noOpera7Tooltips();
		janw.noImageToolBar();
		doNextHeader();
		janw.header();
		//infoTimeout = setTimeout('obj2.style.display = \'none\'',timer);
		if (obj3){infoTimeout = setTimeout('obj3.style.display = \'none\'',timer)}; 
	}
}

onload = janw.start;

