// JavaScript Document
//---MUSEUM FOTO-----
function popupon(layername,URL)//---foto panorama-----
        {
			var maxwidth = document.body.clientWidth;
			maxwidth = 1000;
        popupimg.name = URL;
        //popupimg.src='images/' + URL +'.jpg';
		  popupimg.src = URL;
        valtop=document.body.scrollTop;
        valwidth=Math.abs(maxwidth/2-1000/2);
        if(valtop<166){valtop=166;}
        document.getElementById(layername).style.visibility = "visible";
       // document.getElementById(layername).style.top=valtop+14+document.body.clientHeight/2+70 + 'px';
        //document.getElementById(layername).style.left=valwidth+"px";
        //document.getElementById(layername).focus();
        }
function popupoff(layername)
        {
        layername.style.height=0;
        layername.style.width=0;
        layername.style.visibility = "hidden";
        }
//----END MUSEUM FOTO------

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
	{
	for(var i=0; i<document.images.length; i++)
		{
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
				{
				var imgID = (img.id) ? "id='" + img.id + "' " : ""
				var imgClass = (img.className) ? "class='" + img.className + "' " : ""
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
				var imgStyle = "display:inline-block;" + img.style.cssText
				if (img.align == "left") imgStyle = "float:left;" + imgStyle
				if (img.align == "right") imgStyle = "float:right;" + imgStyle
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
				img.outerHTML = strNewHTML
				i = i-1
			}
		}
	}
window.attachEvent("onload", correctPNG);

function ShowTree(id){
	var menu = 'TABLE' + id;
	var folder = 'FOLDER' + id;
	var node = 'NODE' + id;
	if(document.all(menu) != null){
		if(document.all(menu).style.display == 'none'){
			for(i=1;i<10;i++){
			if(document.all('TABLE'+i)!= null)
			document.all('TABLE'+i).style.display = 'none';
			}
			document.all(menu).style.display = '';
			//document.images[node].src = '/img/node_minus.gif';
		}
		else{
			document.all(menu).style.display = 'none';
			//document.images[node].src = '/img/node_plus.gif';
		}
	}
}

//----ACTIVATING FLASH-----
function flash(flash_content){
	document.write(flash_content);
	}
//----ACTIVATING FLASH-----

//----BROWSER DETECTION----
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
function getRef(id) {
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}
function getRef(id) {
  return document.getElementById(id);
}
//----BROWSER DETECTION----

//----POINTER ENGINE----
function showClient()
{
	alert('document.body.clientWidth is ' + document.body.clientWidth + '\ndocument.body.clientHeight is ' + document.body.clientHeight);
}
var Ycoord = 0;
function coord (coord,cheight){
if(document.documentElement.scrollTop + coord < cheight-207)
Ycoord = document.documentElement.scrollTop + coord - 5;
else
Ycoord = cheight-207;
}
function pointer() {
var yPointerStart, yPointerEnd, yOffset, timeout;
yPointerStart = parseInt (divPointer.style.top, 10);
yPointerEnd = Ycoord;
timeout = 300;
if (yPointerStart != yPointerEnd){
yOffset = Math.ceil(Math.abs(yPointerEnd - yPointerStart) / 20);
if (yPointerEnd < yPointerStart)
yOffset = -yOffset;
divPointer.style.top = parseInt (divPointer.style.top, 10) + yOffset;
timeout = 10;
}
var set = setTimeout ("pointer()", timeout);
}
//----POINTER ENGINE----

//----ADD FAVORITES, PRINT, MAILTO----
function addfav (fav){
	window.external.addFavorite(location.href, fav);
}
function printp (){
	window.print();
}
//----ADD FAVORITES, PRINT, MAILTO----
