var isNav4 = false, isIE4 = false, isOther = false
var insideWindowWidth
var strrange = ""
var strstyle = ""
var swind
getBrowser()

function IEgetElementById(id) {
        return document.all[id]
}
function NNgetElementById(id) {
        return eval("document." + id)
}
function getBrowser() {
if (navigator.appName == "Netscape"  && parseInt(navigator.appVersion) < 5  &&  document.layers != null) {
                isNav4 = true;
                document.getElementById = NNgetElementById
                //insideWindowWidth = window.innerWidth
} else if (document.all != null && navigator.userAgent.indexOf('MSIE')> 0) { //IE
                isIE4 = true
                strrange = "all."
                strstyle = ".style"
                document.getElementById = IEgetElementById
} else if (document.getElementById) { //W3C DOM1 (Netscape6)
                isW3C = true 
                strstyle = ".style"          
} else {
        isOther = true
}
return true;
}
function getObject(obj) {
        var theObj
        
        if (typeof obj == "string") {
                        theObj = eval("document." + "getElementById('" + obj + "')" + strstyle)
                //theObj = eval("document." + strrange + obj + strstyle)
        } else {
                theObj = obj
        }
        return theObj
}
function show(obj) {
if (obj) {
	var theObj = getObject(obj)
	theObj.visibility = "visible"
	}
}
function expand(obj) {
var form = document.ModeControlForm
if (obj) {
	var theObj = getObject(obj);
	if (form.ModeSelect.selectedIndex == 2 || form.ModeSelect.selectedIndex == 3) {
	theObj.visibility = "visible"
	} else {
		submitForm("ModeControlForm");
	}
}	
}
function go(passurl) { 
	  if (passurl != '') {
		location.href=passurl;
	  }
}
function openCmdWindow(qs)	{
	//alert(qs)
   if (!swind || swind.closed) { 
	swind=window.open(qs, "newwindow", "width=500,height=425,resizable,status,toolbar=no");
   	if (swind.opener == null) {
		swind.opener = self;
	}
   }
   else {
    swind.focus();
	}
    swind.moveTo(350,200);
    swind.focus();
}	
function closewind() {
   if (swind && !swind.closed) {
   swind.close()
}
}
function setDate(frm) {
	var selYear  = frm.yearValue.selectedIndex;
	var selMonth = frm.monthValue.selectedIndex;
	var selDay   = frm.dayValue.selectedIndex;
	var year     = frm.yearValue.options[selYear].value;
	var month    = frm.monthValue.options[selMonth].value;
	var day      = frm.dayValue.options[selDay].value;
	var isodate  = ""
	
	if (year != "****") {
		isodate += year;
		if (month != "***") {
			isodate += "-" + month;
			if (day != "**") {
				isodate += "-" + day;
			}
		}
	}
	frm.date.value = isodate;
}

function setLibrary(frm) {
	var selLib  = frm.Lib.selectedIndex;
	var Lib  = "";
	if (selLib != 0) {
		Lib = frm.Lib[selLib].value
	}
	frm.Library.value = Lib;
}
function submitForm(id) {
if(document.getElementById){ 
    frm=document.getElementById(id);
	frm.submit();
}
else {
	eval("document." + id + ".submit()");
}
}
