
// =====================================================
// Signum Systems Corp.
// All contents copyright ©. All rights reserved.
// =====================================================
// sup.js


var mark = '';
var accountFront = "http://www.signum.com/cgi-bin/ah/AccountHandler.cgi";

//
// Opens the login page for the account (within the current frame).
//
function LogIn() {
  parent.main.location = accountFront;
  return true;
}

//
// Returns to the account's front page.
//
function LogOut() {
  window.location.href = accountFront;						// go to the page we started with
  return true;  
}

//
// Create the Membership area Logout link. (The goal is to centralize it's behavior, since it's generated in a few different locations.)
// The link should look like this:
// <b><a title="To get the browser to forget your username and password, close out all browser tabs and windows." href="javascript:LogOut()">logout</a></b>
//
function LogOutLink() {
	document.write('<b><a title="To get the browser to forget your member ID and password, close out all its tabs and windows." href="javascript:LogOut()">logout</a></b>');
}

//
// Display the link to the member account login page ("Log in").
//
function FtpLogin () {
  str = '<input onClick="LogIn()" type="submit" value="Log in" class="fmButton">'
  document.write( str );
}
  
//
// Display the name/link of the protected download file.
//
function FtpLoginName ( record ) {
  str = '<b><a href="'
      + record.name + '">'
      + record.name
      + '</a></b>';
  document.write( str );
}

//
// "ff.f_" prefix used to avoid names beginning with a number (illegal in JS).
// "name"  File name with extension (is not, but may be used to display
//         using a JS func if the ff object is placed in a separate file.
//
// Popup requires a string like this:
// <a href="ftp://ftp.signum.com/pub/ch186.zip" onMouseOver="poppass();return true;" onMouseOut="nd();">ch186.zip</a>
//
function FtpName ( record ) {
  if (record.pass == 'REQUEST' || record.pass == 'request' || record.pass == 'Request') {
    popup = ' onMouseOver="poppass();return true;" onMouseOut="nd();"';
  } else {
    popup = '';
  }

  str = mark + '<b>'
      + '<a href="ftp://ftp.signum.com/pub/' + record.name + '"'
      + popup
      + '">'
      + record.name
      + '</a>'
      + '</b>';
  document.write( str );
}

function FtpDescr   ( record ) { document.write( mark + record.descr ); }
function FtpVer     ( record ) { document.write( mark + record.ver );   }

function FtpSize( file ) {	// e.g. "ff.f_186v212"
  function ZeroPad( what ) { if ( what < 10 ) what = '0' + what; return what; }
  modem_speed = 53000;		// in bps (56K w/o FCC restriction)

  sec = Math.round( (file.size * 8) / modem_speed );    // "size" in bytes.
  if ( sec >= 60 ) {		// longer than 1 min.
    min = Math.floor(sec / 60);
    sec = sec - min * 60;
    time = ZeroPad( min ) + ':' + ZeroPad( sec );
  } else {				// shorter than 1 min.
    time = '00:' + ZeroPad( sec );
  }

  string = mark + Math.round( file.size / 1024 )
         + 'KB &#149; '
         + time;
  document.write( string );
}

function FtpDate( record ) { document.write( mark + record.date ); }

// Give 'life after life' the record.* vars to hand them over.
//
function FtpPass( record ) {
  if (record.pass == 'REQUEST' || record.pass == 'request' ||
      record.pass == 'Request') {
  str = '<a href="pass.htm" '
      + 'onClicK='
      + '"'
      + 'parent.pass_descr='     + '\'' + record.descr + '\''
      + '; parent.pass_ver='     + '\'' + record.ver   + '\''
      + '; parent.pass_verdate=' + '\'' + record.date  + '\''
      + '"'
      + ' onMouseOver="document.images[\''
      + record.doci + 'x'
      + '\'].src=\'images/lockopen.gif\'" onMouseOut="document.images[\''
      + record.doci + 'x'
      + '\'].src=\'images/lockshut.gif\'"><img border="0" id="'
      + record.doci + 'x'		
      + '" src="images/lockshut.gif" width="11" height="14"></a>';
  document.write(str);
  } else {
    document.write(record.pass);
  }
}

function FtpFirm( record ) { document.write( mark + record.firm ); }
function FtpFast( record ) { document.write( mark + record.fast ); }

// =====================
// Handle the Documentation column
// Goal: 
//       <a href="tecdoc.htm#8051" onMouseOver="document.images['doc_8051'].src='images/doc.gif'"
//       onMouseOut="document.images['doc_8051'].src='images/docshut.gif'">
//       <img border="0" id="doc_8051" src="images/docshut.gif" width="19" height="14"></a>
// =====================
function FtpDocs(record) {
  if (record.doci == none) {			// no icon->no documentation->make the cell empty.
    document.write(none);
    return;						// we're done
  }
  
  img_path = (record.pass == 'LOGIN' || record.pass == 'login' || record.pass == 'Login') ? '../../images/' : 'images/';
  
  str = '<a href='
      + '"http://signum.com/'
      + record.docl
      + '" '
      + 'onMouseOver="document.images[\''
      + record.doci
      + '\'].src=\'' + img_path + 'docopen.gif\'" onMouseOut="document.images[\''
      + record.doci
      + '\'].src=\'' + img_path + 'docshut.gif\'"><img border="0" id="'
      + record.doci		
      + '" src="' + img_path + 'docshut.gif" width="13" height="10"></a>';
  document.write(str);
}

function FtpStat( record, property ) {        // record - e.g. "ff.f_186v212"
  switch (property) {
    case 'login':
      FtpLogin( );
      break;
    case 'loginname':
      FtpLoginName( record );
      break;  
    case 'descr':
      FtpDescr( record );
      break;
    case 'ver':
      FtpVer( record );
      break;
    case 'name':
      FtpName( record );
      break;
    case 'size':
      FtpSize( record );
      break;
    case 'date':
      FtpDate( record );
      break;
    case 'pass':
      FtpPass( record );
      break;
    case 'firm':
      FtpFirm( record );
      break;
    case 'fast':
      FtpFast( record );
      break;
    case 'docs':
      FtpDocs( record );
      break;
    default:
      alert ('Bad property arg in FtpStat: ' + property);
      break;
  } // switch
}

// =============================

var pp = new Object();
pp.sw16  = { cap: "&nbsp;16-BIT",				tex: "Update your Signum software for MS Windows 3.1 and DOS." };
pp.sw32  = { cap: "&nbsp;32-BIT",				tex: "Update your Signum software for MS Windows 95 and better." };
pp.faqs  = { cap: "&nbsp;FAQ",					tex: "Frequently asked questions, answers and solutions." };
pp.cont  = { cap: "&nbsp;CONTACT INFO",			tex: "Contact info." };
pp.pass  = { cap: "&nbsp;PSWD. REQUIRED",		tex: "To obtain the password, click the padlock icon on the right." };
pp.email = { cap: "&nbsp;EMAIL ADDRESS",		tex: "Due to spam, please contact us initially through one of the forms referred to on this page.\
                                                      Thank you." };
pp.myac  = { cap: "&nbsp;MY ACCOUNT",			tex: "Login to, manage, or create your account. Download licensed software updates." };
                                                      

ol_width = 150;
ol_hpos = 6;		

function pop(rec)			{ return overlib(rec.tex, CAPTION, rec.cap, TIMEOUT, '2000'); }
function pop_2(rec)	        { return overlib(rec.tex, CAPTION, rec.cap, STICKY, TIMEOUT, '2000', DELAY, '0', CENTER) }
function popnocap(rec)		{ return overlib(rec.tex) }
function popnocap_2(rec)	{ return overlib(rec.tex, STICKY, TIMEOUT, '3000', DELAY, '0') }

function popsw32() { pop(pp.sw32) };
function popsw16() { pop(pp.sw16) };
function popfaqs() { popnocap_2(pp.faqs) };
function popcont() { popnocap(pp.cont) };
function popstat() { pop(pp.stat) };
function poppass() { pop(pp.pass) };
function popemail() { popnocap(pp.email) };
function popmyac() { popnocap(pp.myac) };


// eof