var agt = navigator.userAgent.toLowerCase();
window.mmIsOpera = agt.indexOf("opera") != -1;
function getobj(item) {
	if (window.mmIsOpera){ return(document.getElementById(item))};
	if (document.all){ return(document.all[item])};
	if (document.getElementById){ return(document.getElementById(item))};
	return (false);
}
function help(tbl,id,fld) {
	q=window.open('help.php?tbl='+tbl+'&id='+id+'&fld='+fld, 'Help', 'scrollbars=1,resizable=1,width=450,height=300,status=0');
}
function viewfile(tbl,id) {
	q=window.open('viewdoc.php?tbl='+tbl+'&id='+id, 'View', 'scrollbars=1,resizable=1,width=450,height=300,status=1');
}
function newwindow(winlink) {
	q=window.open(winlink, 'New', 'scrollbars=1,resizable=1,width=450,height=300,status=1');
}
function showcard(id) {
	q=window.open('doccard.php?id='+id, 'ControlCard', 'scrollbars=1,resizable=1,width=450,height=300,status=1');
}
function confirmDelete(thelink, delText, openf){
    var is_confirmed = confirm(delText);
    if (is_confirmed) {
        thelink.href += '&cnfrmd=1&openf='+openf;
    }
    return is_confirmed;
}
function goToPage(aPage){
	window.location.href = aPage;
}

function dovoid(){return;}

function expand(s, b)
{
	s.getElementsByTagName("div").item(0).className = b?"menuHover":"menuNormal";
}

function setCheckboxes(the_form, do_check)
{
    var elts      = (typeof(document.forms[the_form].elements['schk[]']) != 'undefined')
                  ? document.forms[the_form].elements['schk[]']
                  : (typeof(document.forms[the_form].elements['schk[]']) != 'undefined')
          ? document.forms[the_form].elements['schk[]']
          : document.forms[the_form].elements['schk[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
} // end of the 'setCheckboxes()' function 

function getAbsoluteLeft(objectId) {
        // Get an object left position from the upper left viewport corner
        // Tested with relative and nested objects
        o = getobj(objectId);
        oLeft = o.offsetLeft            // Get left position from the parent object
        while(o.offsetParent!=null) {   // Parse the parent hierarchy up to the document element
                oParent = o.offsetParent    // Get parent object reference
                oLeft += oParent.offsetLeft // Add parent left position
                o = oParent
        }
        // Return left postion
        return oLeft
}

function getAbsoluteTop(objectId) {
        // Get an object top position from the upper left viewport corner
        // Tested with relative and nested objects
        o = getobj(objectId);
        oTop = o.offsetTop            // Get top position from the parent object
        while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element
                oParent = o.offsetParent  // Get parent object reference
                oTop += oParent.offsetTop // Add parent top position
                o = oParent
        }
        // Return top position
        return oTop
}
function marq_stop(){
	getobj('mrq').stop();
}
function marq_start(){
	getobj('mrq').start();
}
