var ID  = (!document.all && document.getElementById);
var ALL = (document.all);
var BOTH = (document.all && document.getElementById);
//function to update div contents
function update_contents(item,content) {
	if (ID) {
		if (document.getElementById(item).innerHTML != content) document.getElementById(item).innerHTML = content;
	} else if (ALL) {
		if (document.all[item].innerHTML != content) document.all[item].innerHTML = content;
	}
}

//function to allow MS IE to simulate :hover pseudo-class

function startList(el_id, tag_name) {
  if (BOTH) {
    navRoot = document.getElementById(el_id);
		if(navRoot !== null) {
			if(tag_name == '') {
				navRoot.onmouseover=function() {
					this.className+=" over";
				} // End function literal
				navRoot.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				} // End function literal
			} else {
				for (i=0; i<navRoot.childNodes.length; i++) {
					node = navRoot.childNodes[i];
					if (node.nodeName==tag_name) {
						node.onmouseover=function() {
							this.className+=" over";
						} // End function literal
						node.onmouseout=function() {
							this.className=this.className.replace(" over", "");
						} // End function literal
					} // End if child is right tag
				} // End for each child
			} // End if tag_name = '' else
		} // End if navRoot not null
  } // End if BOTH
} // End function

function open_window(target,win_name,win_width,win_height) {
if (window.name == win_name) {
	window.location = target;
	return;
}
if (win_width > screen.width)   win_width = screen.width;
if (win_height > screen.height) win_height = screen.height;
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
if (win_height > 100) {
win_height      = win_height - 100;
}
var win_cfg     = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
openwin         = window.open(target,win_name,win_cfg);
openwin.opener  = self; 
openwin.focus(win_name);
}

