// main.js 04/03/2003 08:30

function DrawMenu(root, fnc, items, wb)
{
    if (wb==0){
        Menu01(root,fnc,items);
    }
    else {
        Menu02(root,fnc,items);
    }
}

function Menu01(root,fnc,items){
 var HTML;
 var r='';
 if(root==0)r='';
 if(root==1)r='../';
 if(root==2)r='../../';

 HTML="";
 if(fnc==1){    // Not Logged In
   var Link="http://www.OpSmart.net/";
   var Support="http://68.15.182.122:6100/OpsSupport/";
   HTML+='<tr><td align="left"><a class="navcell" href="'+Link+'index.html">Home</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+Link+'sales/products.php">Products</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+Link+'sales/pricing.php">Pricing</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+Link+'sales/sales.php">Sales</a></td></tr>';
// HTML+='<tr><td align="left"><a class="navcell" href="'+Support+'sales/Brochure.htm" target="_blank">Brochure</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+Support+'ReadMe/ReadMe.htm" target="_blank">Read Me</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+Link+'sales/links.php">Links</a></td></tr>';
 }else{
  if(fnc==4){   // Adminisrtator
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'default.aspx">Administrator</a></td></tr>';
  }else{
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'sales/Home.aspx">Home</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'sales/Products.aspx">Products</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'sales/Pricing.aspx">Pricing</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'sales/Sales.aspx">Sales</a></td></tr>';
   HTML+='<tr><td align="left"><a class="navcell" href="'+r+'sales/Links.aspx">Links</a></td></tr>';
  }
 }
 if(fnc==3 || fnc==4){  // Customer or Administrator Logged In
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/Sites.aspx">Sites</a></td></tr>';
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/Status.aspx">Status</a></td></tr>';
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/Personal.aspx">Personal</a></td></tr>';
 }
 if(fnc==2){   // Demo
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/Status.aspx">Demo</a></td></tr>';
 }
 if(fnc==1){   // Not Logged In
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/LogIn.aspx">Login</a></td></tr>';
 }else {        // Logged In
  HTML+='<tr><td align="left"><a class="navcell" href="'+r+'aspx/LogIn.aspx?Rq=lo">Logout</a></td></tr>';
 }
 if(items!=""){
  HTML+='<tr><td>&nbsp;</td></tr><tr><td align="left"><a class="navcell" href=';
  HTML+=items;
  HTML+='</a></td></tr>';
 }
 document.write(HTML);
}

// Menu02 gives the same options as Menu01, but is used when whitebox="1"
function Menu02(root,fnc,items)
{
    var HTML;
    var r='';
    if(root==0)r='';
    if(root==1)r='../';
    if(root==2)r='../../';

    if(fnc > 1){
        HTML='<table border="0" cellpadding="3" cellspacing="0"><tr>';
        if(fnc==4){   // Administrator
            HTML+='<td align="left"><a class="navcell" href="'+r+'default.aspx">Administrator</a></td>';
        }

        if(fnc==3 || fnc==4){  // Customer or Administrator Logged In
            HTML+='<td align="left"><a class="navcell" href="'+r+'aspx/Sites.aspx">Sites</a></td>';
            HTML+='<td align="left"><a class="navcell" href="'+r+'aspx/Status.aspx">Status</a></td>';
            HTML+='<td align="left"><a class="navcell" href="'+r+'aspx/Personal.aspx">Personal</a></td>';
        }
        if(fnc==2){   // Demo
            HTML+='<td align="left"><a class="navcell" href="'+r+'aspx/Status.aspx">Demo</a></td>';
        }
        //  HTML+='<td align="left"><a class="navcell" href="'+r+'aspx/LogIn.aspx?Rq=lo">Logout</a></td>';

        if(items!=""){
            HTML+='<td align="left"><a class="navcell" href=';
            HTML+=items;
            HTML+='</a></td>';
        }
        HTML+='</tr><table>';
        document.write(HTML);
    }
}

function Jump(url){
  if(url=="")
  location.href=url;
}

function SwapImgRestore(){ 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function PreloadImages(){ 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=PreloadImages.arguments; for(i=0; i<a.length; i++)
    if(a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function FindObj(n, d){ 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function SwapImage(){ 
  var i,j=0,x,a=SwapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if((x=FindObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function OpenBrWindow(theURL,winName,features){
  window.open(theURL,winName,features);
}

function DrawTop( root, bWhiteBox ) {
    var tmp;
    var Link='/OpsSmart/sales/';
    if ( ! bWhiteBox )
    {
        var r='';
        if(root==0)r='';
        if(root==1)r='../';
        if(root==2)r='../../';
    
       tmp ='<table class="havbkgd" width="100%" border="0" cellspacing="0" cellpadding="0">';
       tmp+='<tr><td rowspan="3" align="center">&nbsp;<img src="'+r+'co/images/logo001.gif" width="40" height="40">&nbsp;</td>';
       tmp+='</tr><tr>';
       tmp+='<td height="44" colspan="3" align="left">&nbsp;&nbsp;&nbsp;<img src="'+r+'co/images/hdr001.gif" border="0"></td>';
       tmp+='<td height="44" width="500">&nbsp;</td>';
       tmp+='</tr><tr>';
       
       tmp+='<td align="left" class="bkgd" height="20" width="300"><a href="'+Link+'Sales.aspx" ';
       tmp+='onmouseout="SwapImgRestore()" onmouseover="SwapImage(\'but1\',\'\',\''+r+'co/buttons/but1o001.gif\',1)"';
       tmp+='><img name="but1" border="0" src="'+r+'co/buttons/but1f001.gif"></a></td>';
     
       tmp+='<td align="left" class="bkgd" height="20" width="300"><a href="'+Link+'Products.aspx" ';
       tmp+='onmouseout="SwapImgRestore()" onmouseover="SwapImage(\'but2\',\'\',\''+r+'co/buttons/but2o001.gif\',1)"';
       tmp+='><img name="but2" border="0" src="'+r+'co/buttons/but2f001.gif"></a></td>';

       tmp+='<td align="left" class="bkgd" height="20" width="300"><a href="mailto:sales@opsmart.net" ';
       tmp+='onmouseout="SwapImgRestore()" onmouseover="SwapImage(\'but3\',\'\',\''+r+'co/buttons/but3o001.gif\',1)"';
       tmp+='><img name="but3" border="0" src="'+r+'co/buttons/but3f001.gif"></a></td>';

       tmp+='<td align="left" class="bkgd" height="20" width="300">&nbsp;</td></tr>';
       tmp+='</table>';
       
       tmp+='<table border="0" width="100%" cellpadding="0" cellspacing="0">';
       tmp+='<tr><td class="havbkgd">&nbsp;</td>';
       tmp += '<td class="havbkgd" align="right"><span class="CpyRhtG" nowrap>2002-2009 Phoenix&nbsp;Technologies&nbsp;(v1.5.4)&nbsp;</span></td>';
       tmp+='</tr></table>';
       
       tmp+='<table class="havbkgd" width="100%" cellpadding="0" cellspacing="0" border="0" height="100%">';
       tmp+='<tr><td align="right" width="80" valign="top" nowrap><br/>';
       tmp+='<table width="90%" align="center">';
       document.write( tmp );
    }
}

function DrawMiddle( bWhiteBox ) {
    if ( ! bWhiteBox )
    {
       var tmp;
       tmp ='</table>';
       tmp+='</td><td class="viewbkgd" valign="top" width="900">';
       document.write( tmp );
    }
}

function DrawBottom( bWhiteBox ) {
    if ( ! bWhiteBox )
    {
       var tmp;
       tmp+='</table>';
       tmp+='</td>';
       tmp+='</tr>';
       tmp+='</table>';
       document.write( tmp );
    }
}
       
