function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
		    window.onload = func;
	  } else {
		    window.onload = function() {
			      oldonload();
			      func();
		    }
	  }
}
function isDisplayed(obj) {
	return obj.style.display=='';
}

function toggleDisplay(obj) {

	if ( obj.style.display != 'none' ) {
		obj.style.display = 'none';
	} else {
		obj.style.display = '';
	}
}

function displayObject(obj) {
	obj.style.display = '';
}
function undisplayObject(obj) {
	obj.style.display = 'none';
}

function isVisible(obj) {
	if( document.layers) {
		return obj.visibility=="show";
	} else {
		return obj.style.visibility = "visible";
	}
}

function showObject(obj) {
	if (document.layers) {
    	obj.visibility = "show";
    } else {
        obj.style.visibility = "visible";
    }
}



function hideObject(obj) {
    if (document.layers) {
       obj.visibility = "hide";
    } else {
       obj.style.visibility = "hidden";
    }
}

/* this function is slightly bigger than the DreamWeaver
function but is more efficient as it can also find
anchors, frames, variables, functions, and check through
any frame structure

if not working on a layer, document should be set to the
document of the working frame
if the working frame is not set, use the window object
of the current document
WARNING: - cross frame scripting will cause errors if
your page is in a frameset from a different domain */

function findObject( oName, oFrame, oDoc ) {

    if( !oDoc ) { if( oFrame ) { oDoc = oFrame.document; } else {
        oDoc = window.document; } }

    //check for images, forms, layers
    if( oDoc[oName] ) { return oDoc[oName]; }

    //check for pDOM layers
    if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }

    //check for DOM layers
    if( oDoc.getElementById && oDoc.getElementById(oName) ) {
        return oDoc.getElementById(oName); }

    //check for form elements
	var x;
	var theObj;
    for( x = 0; x < oDoc.forms.length; x++ ) {
        if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; } }

    //check for anchor elements
    //NOTE: only anchor properties will be available,
    //NOT link properties!
    for( x = 0; x < oDoc.anchors.length; x++ ) {
        if( oDoc.anchors[x].name == oName ) {
            return oDoc.anchors[x]; } }

    //check for any of the above within a layer in layers browsers
    for( x = 0; document.layers && x < oDoc.layers.length; x++ ) {
        theOb = MWJ_findObj( oName, null, oDoc.layers[x].document );
            if( theOb ) { return theOb; } }

    //check for frames, variables or functions
    if( !oFrame && window[oName] ) { return window[oName]; }
    if( oFrame && oFrame[oName] ) { return oFrame[oName]; }

    //if checking through frames, check for any of the above within
    //each child frame
    for( x = 0; oFrame && oFrame.frames &&
      x < oFrame.frames.length; x++ ) {
        theOb = MWJ_findObj( oName, oFrame.frames[x],
          oFrame.frames[x].document ); if( theOb ) { return theOb; } }

    return null;
}

