
var agent = window.navigator.userAgent;
var classAttr = agent.indexOf("IE")!=-1?"className":"class";

startList = function() {
if (document.getElementById("leftnav")!=null)
 {
navRoot = document.getElementById("leftnav").getElementsByTagName("UL").item(0);
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover= function() {
 var class_name = this.getAttribute(classAttr);
 this.setAttribute(classAttr, class_name+" over");
  }
  node.onmouseout=function() {
  var class_name = this.getAttribute(classAttr);
  this.setAttribute(classAttr, class_name.replace(" over", "")); 
  //this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
//window.onload=startList;

/*
function MenuOver(obj)
{
var srcstr = obj.src;
srcstr=srcstr.replace(/NO/, "OV");
obj.src = srcstr;
}

function MenuOut(obj)
{
var srcstr = obj.src;
srcstr=srcstr.replace(/OV/, "NO");
obj.src = srcstr;
}
*/

function openPopup(i, x, y) 
{
var w = window.open(i, "_popup_", "width=" + (x + 30) + ",height=" + (y + 30) + ",scrollbars=1,resizable=1");
w.focus();
return false;
}

// generate e m a i l addr from any d o m a i n
function address2(adr, domn1, domn2, nname, subjct) 
    {
    if (subjct === undefined) subjct = "";
    if (nname === undefined) nname = "";
    var str="<a href=";
    var att = "&#";
    str+="'mail";
    att +="064;";
    str=str+"to"+":"+adr+att+domn1+"."+domn2;
    if (subjct != "") str+="?subject="+subjct;
    if (nname) str+="'>"+nname+"</a>"; else str+="'>"+adr+att+domn1+"."+domn2+"</a>";
    document.write(str);
    }

/* -- BEGIN --ALBUM GALLERY FUNCTIONS ---*/
var popWin = null   
var winCount = 0
var winName = "popWin"

function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop)
{
  var d_winLeft = 20
  var d_winTop = 20  
  winName = "popWin" + winCount++
  closePopWin()          
  if (openPopWin.arguments.length >= 4)   
    winFeatures = "," + winFeatures
  else
    winFeatures = ""
  if (openPopWin.arguments.length == 6)  
    winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
  else
    winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
  popWin = window.open(winURL, winName, "width=" + winWidth
           + ",height=" + winHeight + winFeatures)
}

function closePopWin()
{    
  if (navigator.appName != "Microsoft Internet Explor"
      || parseInt(navigator.appVersion) >=4)
    if(popWin != null) if(!popWin.closed) popWin.close()
  }
function getLocation(winWidth, winHeight, winLeft, winTop){
  return ""
  }

function getLocation(winWidth, winHeight, winLeft, winTop){
  var winLocation = ""
  if (winLeft < 0)
    winLeft = screen.width - winWidth + winLeft
  if (winTop < 0)
    winTop = screen.height - winHeight + winTop
  if (winTop == "cen")
    winTop = (screen.height - winHeight)/2 - 20
  if (winLeft == "cen")
    winLeft = (screen.width - winWidth)/2
  if (winLeft>0 & winTop>0)
    winLocation =  ",screenX=" + winLeft + ",left=" + winLeft    
                + ",screenY=" + winTop + ",top=" + winTop
  else
    winLocation = ""
  return winLocation
  }
/* --END -- ALBUM GALLERY FUNCTIONS ---*/

/* -- Functions to randomize the display of small photos on the homepage-- */
function rndImg(N)
{
v = Math.random();
v = Math.round(v*(N-1)+1); // N - number of images 1..N
return v;
}

function showRndImg()
{ 
// Images are named homepage1.jpg, homepage2.jpg, ... homepageN.jpg. Now N=5
str = "<img src='/images/homepage"+rndImg(5)+".jpg' />";
document.write(str);
}
/*-- End -- */

