/************** global variables ****************/
var miniwindow
var currentwindowurl = "";

/************** window functions ****************/

// this hides the dropdown menu
// used when the mouse is no longer hovering
function hidedropdown(id) {
	var d = document.getElementById(id);
	if (d) {
		d.style.display='none';
	}
}

// this hides all dropdowns
function hidealldropdowns() {
	for (var i = 1; i<=10; i++) {
		var menu = document.getElementById('smenu'+i);
		if(menu) {
			//alert(menu);
			menu.style.display='none';
		}
	}
}

// this shows the dropdown menu
function renderdropdown(id) {
	var d = document.getElementById(id);
	if (d) {
		d.style.display='block';
		// adjust the width (default is 119px)
		if(id=='smenu5') {
			d.style.width='163px';
		} else {
			d.style.width='119px';
		}
		
		// hides the other menus
		for (var i = 1; i<=10; i++) {
			var othername = 'smenu'+i;
			if(othername != id) {
				var other = document.getElementById('smenu'+i);
				if (other) {
					other.style.display='none';
				}
			}
		}
	}
}

// function is used to load up generic popup window
function openwindow(htmlpage,winx,winy) {
  if (!miniwindow || miniwindow.closed || (currentwindowurl != htmlpage)) {
	var wininit = "width=" + winx + ",height=" + winy + ",scrollbars=yes,resizable=yes";
    miniwindow = window.open(htmlpage,'miniwindow',wininit);
  } 
  currentwindowurl = htmlpage;
  miniwindow.focus();
}

// function is used to close down all pop-up windows when exiting page
function closewindow() {
  if (miniwindow) {
    if (!(miniwindow.closed)) miniwindow.close();
  }
}

// function is for rollover images
function setImage(id,image) {
  document.getElementById(id).src = image;
}

function toggleContent(textID,imageID) {
  if (document.getElementById(textID).style.display == "none") {
    document.getElementById(textID).style.display = "block";
	document.getElementById(imageID).src = "images/arrow_open.gif";
  } else {
    document.getElementById(textID).style.display = "none";
	document.getElementById(imageID).src = "images/arrow_close.gif";
  }
}

// image swap functions
/* This code addapted from a beautifully written script by Nick Heinle.
 * In order to receive the right to license this code for use on your
 * site the original code must be copied from the Web site 
 * webreference.com/javascript/. License is granted to user to reuse
 * this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
        if (browserName == "Netscape" && browserVer >= 3) version = "enable";
        else if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) version = "enable";
        else version = "unable";
        
        if (version == "enable") {
        m1on = new Image();
        m1on.src = "images/nav_homeon.gif";
        m2on = new Image();
        m2on.src = "images/nav_abstracton.gif";
        m3on = new Image();
        m3on.src = "images/nav_posteron.gif";
        m4on = new Image();
        m4on.src = "images/nav_kioskon.gif";
        m5on = new Image();
        m5on.src = "images/nav_archiveon.gif";
        m6on = new Image();
        m6on.src = "images/nav_aboutuson.gif";
        
       
        m1off = new Image();
        m1off.src = "images/nav_homeoff.gif";
        m2off = new Image();
        m2off.src = "images/nav_abstractoff.gif";
        m3off = new Image();
        m3off.src = "images/nav_posteroff.gif";
        m4off = new Image();
        m4off.src = "images/nav_kioskoff.gif";
        m5off = new Image();
        m5off.src = "images/nav_archiveoff.gif";
        m6off = new Image();
        m6off.src = "images/nav_aboutusoff.gif";
        }

function img_act(imgName) {
        if (version == "enable") {
        imgOn = eval(imgName + "on.src");
        document [imgName].src = imgOn;
        }
}

function img_inact(imgName) {
        if (version == "enable") {
        imgOff = eval(imgName + "off.src");
        document [imgName].src = imgOff;
        }
}
// Stop hiding from old browsers -->



