
function init() {
    if(document.getElementById) {
        layerRef="document.getElementById";
        styleSwitch=".style";
        what="dom1";
    }
    else if (document.layers) {
        layerRef="document.layers";
        styleSwitch="";
        what ="ns4";
    }
    else if(document.all) {
        layerRef="document.all";
        styleSwitch=".style";
        what ="ie4";
    }
    else {
        what="none";
        newbrowser = false;
    }
    check = true;
}

function isDefined(property) {
  return (typeof property != 'undefined');
}

function showHide(layerName, showHideToggle) {
    if (check) {
        if (what=="none")
            return;

        if (what=="dom1") {
            if (showHideToggle=="show" || (showHideToggle != "hide" && document.getElementById(layerName).style.display != 'block')){
                document.getElementById(layerName).style.display= 'block';
			} else document.getElementById(layerName).style.display= 'none';
        } else {
            if (showHideToggle=="show" || (showHideToggle != "hide" && (eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display')!='block')))
                eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="block"');
            else eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display=""');
        }
    }
}

function showHideTab(layerName, showHideToggle) {
    //smh 9/13/05: Mantis #923:
    return;
    
    if (check) {
        if (!mayHideTab) return;
        if (what=="none") return;
        else if (what=="dom1")
        {
            if (showHideToggle=="hide" || (showHideToggle != "show" &&
                  document.getElementById(layerName).style.display != 'none'))
            {
                document.getElementById(layerName).style.display='none';
                document.tab.src='/common/images/tab-myfolder.gif';
            } else {
                 document.getElementById(layerName).style.display='block';
                 document.tab.src='/common/images/tab-myfolder-active.gif';
            }
        } else {
            if (showHideToggle=="hide" || (showHideToggle != "show"
                && eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display')==''))
                eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');
            else eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display=""');
        }
    }
    return;
}

// Switch out image in imgid for imgsrc.
// In IE, fade from one image to the next (set style on img to "filter:blendTrans(duration=0.5);" )
function changeimage (doc_imgid,imgsrc) {
    if (document.images) {
        if (doc_imgid.filters)
            doc_imgid.filters["blendTrans"].apply();

        doc_imgid.src= imgsrc;

        if (doc_imgid.filters)
            doc_imgid.filters["blendTrans"].play();
    }
}

function openWindow(theURL,windowName,features) {
    window.open(theURL,windowName,features);
}

/*** START WRITE FLASH CODE ***/
function writeFlashMovie(version,url,width,height,bgcolor,wmode)
{
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + ',0,0,0" ');
    document.write('  WIDTH=' + width + ' HEIGHT=' + height + '>');
    document.write(' <PARAM NAME=movie VALUE="' + url + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=' + bgcolor + '>');
    if (wmode.length>0) document.write(' <param name="wmode" value="'+wmode+'" />');
    document.write(' <EMBED src="' + url + '" quality=high bgcolor=' + bgcolor + ' ');
    document.write(' swLiveConnect=FALSE WIDTH=' + width + ' HEIGHT=' + height);
    if (wmode.length>0) document.write(' wmode="'+wmode+'" ');
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write(' </EMBED></OBJECT>');
}
/*** END WRITE FLASH CODE ***/
