// ast_xxx_js_1.js
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------

var  g_State_ExpAll  =  false;
var  WDAg_ID_DBug    =  0;

//---------------------------------------------------------------------------

function fnOnWindLoad( szArg )
{
    fnSetCont(szArg);
}

//---------------------------------------------------------------------------

function fnSetCont( szArg )
{
    var szFile  =  szArg  +  "_cont.htm";

    var oCurr   =  parent.BaseCont.location;
    var szCurr  =  oCurr;

//  if (szCurr.indexOf(szFile) == -1)
//     {
       parent.BaseCont.location  =  szFile;
//     }


   //var  oFram;

    //oFram  =  document.getElementById("idBaseCont");

    //alert(oFram.src);
    //alert( document.frames['idBaseCont'].document.documentElement.innerHTML );

    //parent.frames["idBaseCont"].src =  "http://www.microsoft.com/";
//    oFram.src  =  "http://www.microsoft.com/";
//document.all.iframe1.src="http://www.microsoft.com/";

 //parent.frames.BaseCont.src  =  szArg;

//alert (document.all.iframe1.src);
}

//---------------------------------------------------------------------------

function fnNavBLink( szLgnd1, szLgnd2, szFile, szTitl )
{
    document.write( "&nbsp;&nbsp;&nbsp;"        +
                    "<a class=\"link\" href=\"" +
                    szFile                      +
                    ".htm\" "                   +
                    "title=\""                  +
                    szTitl                      +
                    "\">"                       );

    if (szLgnd1 != "")
       {
       document.write( "<span class=\"our\">" + szLgnd1 + "</span>" );
       }

    document.write( szLgnd2                      +
                    "</a>"                      +
                    "&nbsp;&nbsp;&nbsp;"        );
}

//---------------------------------------------------------------------------

function fnWritHead( szImag, szLgnd )
{
    document.write("<div id=\"Div_HlpPop\"  style=\"position:absolute;\"></div>");

    document.write("<table width=100%>");
    document.write("  <tr>");
    document.write("    <td width=110>");
    document.write("      <img width=100 height=100 src=\"images/" + szImag + ".jpg\">");
    document.write("    </td>");
    document.write("    <td class=\"sz18 blu bold vamid\">");
    document.write(szLgnd);
    document.write("    </td>");
    document.write("  </tr>");
    document.write("</table>");

    document.write("<hr size=1 class=\"blu\">");
}

function fnWritHeadDD()
{
    document.write("<div id=\"Div_HlpPop\"  style=\"position:absolute;\"></div>");

    document.write("<table width=100%>");
    document.write("  <tr>");
    document.write("    <td width=100>");
    document.write("      <img src=\"images/prod_dd.gif\">");
    document.write("    </td>");
    document.write("    <td class=\"sz18 blu bold vamid\">");
    document.write("      AstriManager");
    document.write("      <p class=\"sz12 ital\">");
    document.write("        Observe. Analyze. Notify. Act.");
    document.write("      </p>");
    document.write("    </td>");
    document.write("  </tr>");
    document.write("</table>");

    document.write("<hr size=1 class=\"blu\">");
}

//---------------------------------------------------------------------------

function fnSetImage( szArg )
{
    szName  =  window.event.srcElement.name;
    szImag  =  szName  +  ".gif";

    if (szArg == "ovr")
       {
       szImag  =  szName  +  "_ovr.gif";
       }

    window.event.srcElement.src  =  szImag;
}

//---------------------------------------------------------------------------

function fnShowHide( szArg )
{
    fnHideAll();

    fnShowHideTog( szArg );
}

function fnShowHideSho( szArg )
{
    szDivName  =  "SH_"  +  szArg;

    oObj  =  document.all[szDivName];

    oObj.className  =  "DivShow";
}

function fnShowHideHid( szArg )
{
    szDivName  =  "SH_"  +  szArg;

    oObj  =  document.all[szDivName];

    oObj.className  =  "DivHide";
}

function fnShowHideTog( szArg )
{
    szDivName  =  "SH_"  +  szArg;

    oObj  =  document.all[szDivName];

    if (oObj.className == "DivShow")
       {
       oObj.className  =  "DivHide";
       }
    else
       {
       oObj.className  =  "DivShow";
       }
}

function fnShowAll()
{
    for (var i = 0; i < document.all.length; i++)
        {
        oTemp=document.all[i];

        if (oTemp.className == "DivHide")
           {
           oTemp.className  =  "DivShow";
           }
        }

    g_State_ExpAll  =  true;

    fnProcBtnExpColAll();
}

function fnHideAll()
{
    for (var i = 0; i < document.all.length; i++)
        {
        oTemp=document.all[i];

        if (oTemp.className == "DivShow")
           {
           oTemp.className  =  "DivHide";
           }
        }

    g_State_ExpAll  =  false;

    fnProcBtnExpColAll();
}

//---------------------------------------------------------------------------

function fnSHHelpItem( szArg )
{
    saArgS  =  szArg.split(":");
    szTitl  =  saArgS[0];
    szDesc  =  saArgS[1];

//  szCod1  =  "<a class=\"menu\" href=\"javascript:void(0);\" onclick=\"fnShowHideTog('"
    szCod1  =  "<a href=\"javascript:void(0);\" onclick=\"fnShowHideTog('"
            +  szTitl
            +  "')\">"
            +  szTitl
            +  "</a>";

    szCod2  =  "<div id=\"SH_"
            +  szTitl
            +  "\" class=\"DivHide\">";

    document.write("<br>");
    document.write(szCod1);
    document.write(szCod2);
    document.write("<p class=\"ml15\">");
    document.write(szDesc);
    document.write("</p>");
    document.write("</div>");
}

//---------------------------------------------------------------------------

function OpenHelp( szName )
{
    szFile  =  "ast_hlp_"  +  szName  +  ".htm",

    fnWindowPopUp( szFile )
}

//---------------------------------------------------------------------------

function fnWindowPopUp( szURL )
{
    szFeat  =  "directories = no,"
            +  "location    = no,"
            +  "menubar     = no,"
            +  "resizable   = no,"
            +  "scrollbars  = yes,"
            +  "status      = no,"
            +  "toolbar     = no,"
            +  "left        = 50,"
            +  "top         = 50,"
            +  "width       = 600,"
            +  "height      = 500";

    window.open( szURL, '_blank', szFeat );
}

//---------------------------------------------------------------------------

function fnProcBtn( szNam, szArg, szCmd )
{
    code  =  "<img border=0 "
          +  "src=\""   +  szArg  +  ".gif\" "
          +  "name=\""  +  szArg  +  "\" "
          +  "id=\""    +  szNam  +  "\" "
          +  "onmouseover=\"fnSetImage('ovr')\" "
          +  "onmouseout=\"fnSetImage('out')\"  "
          +  "onclick=\""
          +  szCmd
          +  "\">";

    document.write(code);
}

function fnProcBtnApply()
{
    fnProcBtn("BtnApply","apply_24","Form.submit()");
}

function fnProcBtnBrowse()
{
    fnProcBtn("BtnBrowse","browse_18","alert('browse dialog')");
}

function fnProcBtnClose( szCmd )
{
    document.write("<br>");
    fnProcBtnCloseR1(szCmd)
}

function fnProcBtnCloseR1( szCmd )
{
    if (szCmd == "")
       {
       szCmd  =  history.back(1);
       }

    fnProcBtn("BntClose","close_24",szCmd);
}

function fnProcBtnCollapseAll()
{
    fnProcBtn("BtnCollapseAll","collapseall_16","fnHideAll()");
}

function fnProcBtnDelete()
{
    fnProcBtn("BtnDelete","delete_24","alert('delete')");
}

function fnProcBtnExpandAll()
{
    fnProcBtn("BtnExpandAll","expandall_16","fnShowAll()");
}

function fnProcBtnRefresh()
{
    fnProcBtn("BtnRefresh","refresh_24","location.reload(true)");
}

function fnProcBtnReset( bGang )
{
    fnProcBtn("BtnReset","reset_24","Form.reset()");
}

function fnProcBtnARC( szCmd )
{
    document.write("<br>");
    fnProcBtnApply();
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
    fnProcBtnReset();
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
    fnProcBtnCloseR1(szCmd);
}

function fnProcBtnDC( szCmd )
{
    document.write("<br>");
    fnProcBtnDelete();
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
    fnProcBtnCloseR1(szCmd);
}

function fnProcBtnRC( szCmd )
{
    document.write("<br>");
    fnProcBtnRefresh();
    document.write("&nbsp;&nbsp;&nbsp;&nbsp;");
    fnProcBtnCloseR1(szCmd);
}

function fnProcBtnExpColAll()
{
    if (g_State_ExpAll)
       {
       szName  =  "collapseall_16";
       szCmd   =  "fnHideAll()";
       }
    else
       {
       szName  =  "expandall_16";
       szCmd   =  "fnShowAll()";
       }

    szCode  =  "<img border=0 "
            +  "src=\""   +  szName  +  ".gif\" "
            +  "name=\""  +  szName  +  "\" "
            +  "id=\""    +  "BtnExpColAll"  +  "\" "
            +  "onmouseover=\"fnSetImage('ovr')\" "
            +  "onmouseout=\"fnSetImage('out')\"  "
            +  "onclick=\""
            +  szCmd
            +  "\">";

    if (typeof(parent)                              == "undefined")
       return;
    if (typeof(parent.frames)                       == "undefined")
       return;
    if (typeof(parent.frames.MainBody)              == "undefined")
       return;
    if (typeof(parent.frames.MainBody.DivExpColAll) == "undefined")
       return;

    parent.frames.MainBody.DivExpColAll.innerHTML  =  szCode;
}

//---------------------------------------------------------------------------
