

// ***************
// *** AJAX *** //
// ***************



var AjaxResponseHandler;
function xmlPost(url, toSend, responseHandler) {
   AjaxResponseHandler = responseHandler;
   xmlOpen("POST", url, toSend);
}
function xmlGet(url, responseHandler) {
   AjaxResponseHandler = responseHandler;
   xmlOpen("GET", url, null);
}
function xmlOpen(method, url, toSend) {
    if (window.XMLHttpRequest) {
        // browser has native support for XMLHttpRequest object
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        // try XMLHTTP ActiveX (Internet Explorer) version
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    if(req) {
        req.onreadystatechange = KeepTrying;
        req.open(method, url, true);
        req.setRequestHeader("content-type","application/x-www-form-urlencoded");
        req.send(toSend);
    } else {
        alert('Your browser does not seem to support XMLHttpRequest.');
    }
}
function KeepTrying() {
   //alert('readyState = ' + req.readyState + '\nstatus = ' + req.status);
   if ((req.readyState == 4) && (req.status == 200)) {
      AjaxResponseHandler();
   }
   return;
}
function getNode(parent, tagName) {
    var i;
    var max = parent.childNodes.length;
    
    // Check each child node
    for(i = 0; i < max; i++) {
        if(parent.childNodes[i].tagName) {
            if(parent.childNodes[i].tagName.toUpperCase() == tagName.toUpperCase()) {
                // We found a matching child node; return it.
                return parent.childNodes[i];
            }
        }
    }
    // One was not found; return null
    return null;
}
function getNodesWithKey(parent, tagName, key) {
    var i;
    var cellNodes = parent.getElementsByTagName(tagName);
    var max = cellNodes.length;
    
    // Check each cell node for the specified value for
    // the 'key' attribute
    for(i = 0; i < max; i++) {
        if(cellNodes[i].getAttribute('key') == key) {
            // We found a matching cell node; return it.
            return cellNodes[i];
        }
    }
    // One was not found; return null
    return null;
}


// ********************
// *** ALT LINKS *** //
// ********************



function ShowAltLink22(sText) {
   var sLinks = sText.split(',');
   var pos;
   var letter;
   var linkText;
   var linkID;
   
   document.write('<ul class="AltKeys">');
   // FOR EACH LINK...
   for (var x = 0; x < sLinks.length; x++) {
      // DEFAULT...
      letter = '';
      linkText = sLinks[x];

      // FIND DOT...
      pos = sLinks[x].indexOf('.');

      if (pos > -1) {
         // LINK LETTER...
         letter = sLinks[x].charAt(pos + 1);
         // CLEAN LINK...
         linkText = sLinks[x].substring(0, pos) + '<u>' + letter + '</u>' + sLinks[x].substring(pos + 2, sLinks[x].length);
         linkID = 'href_' + sLinks[x].substring(0, pos) + letter + sLinks[x].substring(pos + 2, sLinks[x].length);
         sLinks[x] = sLinks[x].substring(0, pos) + sLinks[x].substring(pos + 1, sLinks[x].length);
      }

      // SHOW AND TELL...
      letter = letter.toUpperCase();
      document.write('<li><a id=' + linkID + ' accesskey="' + letter + '" tabindex=-1 title="' + sLinks[x] + '." href="javascript:DoSomething(\'' + letter + '\');" >' + linkText + '</a></li>');
   }
   document.write('</ul>');
   return;
}


// ***********************
// *** CLOSE WINDOW *** //
// ***********************



var CloseWindowYesRunTimer = true;
var bRefresh = false;

function CloseWindowRunTimer22(inRefres) {
   if (!CloseWindowYesRunTimer) { return; }
   if (inRefres) {
   	bRefresh = true;
   }

   var x = GetInnerHtml22('spnCloseWindowTimer');
   x = x - 1;
   SetInnerHtml22('spnCloseWindowTimer', x);
   if (x == 0) {
      if (window.MyCloseWindow) {
         MyCloseWindow(bRefresh);
      } else {
         CloseWindowNow22(bRefresh);
      }
      return;
   }
   setTimeout("CloseWindowRunTimer22()", 1000);
   return;
}
function CloseWindowStopTimer22() {
   CloseWindowYesRunTimer = false;
   return;
}
function WriteWindowCloseLine22(inLen) {
   document.write('<p><a accesskey="x" id="aExit" tabindex=-1 title="Exit." href="javascript:DoSomething(\'X\');">E<u>x</u>it</a>: <span id="spnCloseWindowTimer">' + inLen + '</span></p>');
   return;
}
function CloseWindowNow22(bRefresh) {
   // REFRESH CALLER...
   if (window.opener.RefreshMe22) {
      window.opener.RefreshMe22(bRefresh);
   } else if (window.opener.RefreshMe6) {
      window.opener.RefreshMe6(bRefresh);
   }
   window.close();
   return;
}



// **************************
// *** CSS AND COOKIES *** //
// **************************


var defStyle = '45rpm';

// STYLESHEET...
var cssStyle = getCookie('css', defStyle);
if (cssStyle == '') { cssStyle = defStyle; }
document.write('<link rel="stylesheet" type="text/css" href="../../css/' + cssStyle + '/_stylesheet.css" />');
//alert(window.parent.frames.length);
if (window.parent.frames.length > 0) {
	document.write('<link rel="stylesheet" type="text/css" href="../../css/' + cssStyle + '/_stylesheetChat.css" />');
}

// HOME STYLESHEET...
function WriteHomeCSS22() {
	if (cssStyle != '') {
   	document.write('<link rel="stylesheet" type="text/css" href="../../css/' + cssStyle + '/_stylesheetHome.css" />');
   }
	if (window.parent.frames.length > 0) {
		document.write('<link rel="stylesheet" type="text/css" href="../../css/' + cssStyle + '/_stylesheetChat.css" />');
	}
}

// CHARSET...
document.write('<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />');

// COOKIE FUNCTIONS...
function setCookie(NameOfCookie, value, expiredays) {
   var ExpireDate = new Date();
   var NewCookie;
   if (!(expiredays >= -1)) { expiredays = 120; }
   ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 32200 * 1000));
   NewCookie = NameOfCookie + '=' + escape(value);
   NewCookie = NewCookie + '; expires=' + ExpireDate.toGMTString();
   NewCookie = NewCookie + '; domain=.Top40db.net';
   //NewCookie = NewCookie + '; domain=223.99.240.51';
   NewCookie = NewCookie + '; path=/';
   document.cookie = NewCookie;
   return;
}

function getCookie(NameOfCookie, inDefault) {
   var begin;
   var end;

   if (document.cookie.length > 0) {
      begin = document.cookie.indexOf(NameOfCookie+"=");
      if (begin != -1) {
         begin += NameOfCookie.length+1;
         end = document.cookie.indexOf(";", begin);
         if (end == -1) {
            end = document.cookie.length;
         }
         return unescape(document.cookie.substring(begin, end));
      }
   }
   return inDefault;
}

function deleteCookie(NameOfCookie) {
   setCookie(NameOfCookie, 0, -1);
   return;
}

function testCookie() {
   setCookie('Testing', 2, 1);
   var answer = getCookie('Testing', -1);
   deleteCookie('Testing');
   return (answer == 2);
}

function isNetscape() {
   return (navigator.userAgent.indexOf('Netscape') != -1);
}
function isFirefox() {
   return (navigator.userAgent.indexOf('Firefox') != -1);
}
function isMSIE() {
   return (navigator.userAgent.indexOf('MSIE') != -1);
}



// ********************
// *** FOCUS OBJ *** //
// ********************


function ClickOnlyHref22(Clear1, Clear2) {
   // REQUIRES THE DOCUMENT TO HAVE HREF LINKS NUMBERED
   // LIKE href1, href2, href3, etc.

   var h1 = document.getElementById('href1');
   var h2 = document.getElementById('href2');

   // IF HREF1 EXISTS BUT HREF2 DOES NOT, THEN CLICK HREF1...
   if ((h1) && !(h2)) {
      // Check for .Click() function because FireFox doesn't have that(?)
      if (eval(h1.click)) { h1.click(); }
      return;
   }

   // OTHERWISE, CLEAR OUT THE OTHER PAGES...
   // Do this 1st, so that Clear2 is always the Frame3 window, if needed...
   if (!Clear2) {
      Clear2 = Clear1;
      Clear1 = null;
   }

   var wind;
   var loc;
   if (Clear1) {
      wind = eval('parent.' + Clear1);
      loc = new String(wind.location);
      if (loc.indexOf('BlankWithLogo.htm') < 0) {
         wind.location = '../BlankWithLogo.htm';
      }
   }
   if (Clear2) {
      wind = eval('parent.' + Clear2);
      loc = new String(wind.location);
      if (loc.indexOf('Blank.htm') < 0) {
         wind.location = '../Blank.htm';
      }
   }

   return;
}
function FocusFirstHref22() {
   // REQUIRES THE DOCUMENT TO HAVE HREF LINKS NUMBERED
   // LIKE href1, href2, href3, etc.

   var h1 = document.getElementById('href1');
   if (h1) {
      h1.focus();
   }
   return;
}
function FocusObj22(inID) {
   var h1 = document.getElementById(inID);
   if (h1) {
      h1.focus();
      if (h1.select) {
         h1.select();
      }
   }
   return;
}


// *********************
// *** INNER HTML *** //
// *********************


function SetInnerHtml22(inObj, inStr) {
   //alert(inObj);
   if (inObj != '[object]') {
      inObj = document.getElementById(inObj);
   }
   if (!inObj) {
      return false;
   }
   inObj.innerHTML = inStr;
   return true;
}
function GetInnerHtml22(inObj) {
   if ((inObj != '[object]') && (inObj != '[object HTMLDivElement]')) {
      inObj = document.getElementById(inObj);
   }
   if (!inObj) {
      return '[Error]';
   }
   return inObj.innerHTML;
}
function WelcomeMember6(inMemID) {
	WelcomeMember22(inMemID);
}
function WelcomeMember22(inMemID) {
   //IF LOGGED ON...
   if (inMemID == undefined) return;
   if ((0 + inMemID) == 0) return;
   
   var x = getCookie('LogonName', 'Top40db member');
   SetInnerHtml22('divTagLine', '<em>Welcome back <acronym>' + x + '</acronym>.</em>');
   return;
}
function FillTagLine6(inMemID) {
	FillTagLine22(inMemID);
}
function FillTagLine22(inMemID) {
   //IF LOGGED ON...
   if (inMemID == undefined) return;
   if ((0 + inMemID) == 0) return;

   // GET NAME...
   var UserName = getCookie('LogonName', 'Top40db member');

   // GENERIC WELCOME...   
   SetInnerHtml22('divTagLine', 'Hello <acronym>' + UserName + '</acronym>.');

   return;
}

function ReadHtmlTagStr(inTag, inText) {
   var Tag1 = '<'  + inTag + '>';
   var Tag2 = '</' + inTag + '>';
   var xx1 = inText.indexOf(Tag1) + Tag1.length;
   var xx2 = inText.indexOf(Tag2);
   if ((xx1 == 0) || (xx2 == 0) || (xx2 < xx1)) {
      return '';
   }
   return inText.substring(xx1, xx2);
}


// ***********************
// *** PAGE NUMBERS *** //
// ***********************


function GoToPageNow(inNum) {
   var pname = new String(document.location);
   var xx1 = pname.lastIndexOf('PageNum=');
   // IF PAGENUM NOT THERE, JUST ADD IT...
   if (xx1 == -1) {
      xx1 = pname.lastIndexOf('?');
      if (xx1 == -1) {
         pname = pname + '?';
      } else {
         pname = pname + '&';
      }
      document.location = pname + 'PageNum=' + inNum;
      return;
   }
   // CONTINUE REPLACING PAGENUM...
   xx1 = xx1 + 8;
   var xx2 = pname.indexOf('?', xx1);
   var xx3 = pname.indexOf('&', xx1);
   if (((xx3 < xx2) && (xx3 != -1)) || (xx2 == -1)) {
      xx2 = xx3;
   }
   if (xx2 == -1) {
      xx2 = pname.length
   }
   //alert('xx2 = ' + xx2);
   var Half1 = pname.substring(0, xx1);
   //alert(Half1);
   var Half2 = pname.substring(xx2, pname.length)
   //alert(Half2);
   pname = Half1 + inNum + Half2;
   //alert(pname);
   document.location = pname;
   return;
}


// ***********************
// *** POPUP WINDOW *** //
// ***********************


function WriteHelpLink22(inName, inLinkText) {
	var x = '<a title="Help" tabindex=-1 href="javascript:PopUpWindow22(\'../../Help/' + inName + '.shtm\');" onmouseover="window.status=\'Help...\'; return true;" onmouseout="window.status=\'\'; return true;">'
   document.write(x);
   if (!inLinkText) {
   	inLinkText = '';
   }
   if (inLinkText != '') {
   	document.write(inLinkText);
   } else {
   	document.write('<img src="../../img/buttons/Help-Off.gif" onmouseover="SwapImage22(this);" onmouseout="SwapImage22(this);" border=00 />');
   }
   document.write('</a>');
   return;
}

function PopUpWindow6(inFile, bShowStatus, inWindowName, inWidth, inHeight) {
	PopUpWindow22(inFile, bShowStatus, inWindowName, inWidth, inHeight);
}
function PopUpWindow22(inFile, bShowStatus, inWindowName, inWidth, inHeight) {
   // Must -- I mean MUST -- use RELATIVE directory in order for this to work!  Cannot use "http://www..."
   if (!inWidth)  { inWidth  = 0; }
   if (!inHeight) { inHeight = 0; }
   if (inWidth  == 0) { inWidth  = 300; }
   if (inHeight == 0) { inHeight = 300; }

   var settings;
   if (bShowStatus) {
      settings = '';
   } else {
      settings = 'scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=yes,dependent=yes,width=' + inWidth + ',height=' + inHeight;
   }
   if (inWindowName == null) {
      inWindowName = 'Help_Popup';
   }
   self.open(inFile, inWindowName, settings);
   return;
}
function PopDownWindow22(inPage) {
   var callerDoc = window.opener;
   if (!callerDoc) return;

   callerDoc.location = inPage;
   CloseWindowNow22(false);
   return;
}



// ********************
// *** SHOW/HIDE *** //
// ********************


// All the damn options...
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS22 = (!document.all && document.getElementById) ? true : false;
var isNS = (isNS4 || isNS22);
var isIE = (isIE4 || isIE5);

function ShowHide22(object, YesNo) {
   // My code...
   var IsVis = YesNo ? 'visible' : 'hidden';
   if (isNS4) {
      document.layers[object].visibility = IsVis;
   } else if (isIE4) {
      document.all[object].style.visibility = IsVis;
   } else if (isNS22 || isIE5 || isFirefox()) {
      var elm = document.getElementById(object);
      elm.style.visibility = IsVis;
   }
   return;
}

function IsVisible22(object) {
   // Do it...
   if (isNS4) {
      return (document.layers[object].visibility == 'visible');
   } else if (isIE4) {
      return (document.all[object].style.visibility == 'visible');
   } else if (isNS22 || isIE5) {
      var elm = document.getElementById(object);
      return (elm.style.visibility == 'visible');
   }
   return false;
}



// ******************************
// *** SIZE WINDOW TO BODY *** //
// ******************************


function SizeWindowToBody22() {
	// VARS...
   var f, g;

	// SMALLER...
   window.resizeTo(450, 300);
   
   // GET WINDOW SIZE...
	f = document.documentElement.scrollWidth + 40;
	g = document.documentElement.scrollHeight + 80;
	
	// CHECK AGAINST WINDOW SIZE...
	if (f > (window.screen.width - 20)) {
		f = window.screen.width - 20;
	}
	if (g > (window.screen.height - 100)) {
		g = window.screen.height - 100;
	}

   // SIZE IT...
   window.resizeTo(f, g);
   return;
}



// *********************
// *** SWAP IMAGE *** //
// *********************


function SwapImage6(Button) {
	SwapImage22(Button);
}
function SwapImage22(Button) {
	if (Button.src.lastIndexOf('-Off') > 0) {
		Button.src = Button.src.substring(0, Button.src.lastIndexOf('-O')) + '-On.gif';
	} else {
		Button.src = Button.src.substring(0, Button.src.lastIndexOf('-O')) + '-Off.gif';
	}
	return;
}



// ************************
// *** TAP BOX FUNCS *** //
// ************************


// This (these 2) functions are called to determine if the specified
// search really should be performfed.
//
// Parameters: inObj   - the box (named MATCH) that contains the search string
//             inField - MUST be either ARTIST, TITLE, or PHRASE
//             bCalledFromHREF - boolean determines how this is to be submitted
//
// Returns: If bCalledFromHREF,
//             YES: this tells form to submit itself,
//             NO:  this drops it altogether,
//          If NOT bCalledFromHREF,
//             YES: returns true,
//             NO:  returns false
//
// This: * checks for blank box, ensures something was entered
//       * checks minimum length, ensures string is long enough
//       * checks CommonFailures, ensures it is NOT listed there
//       * sets form.nStep to 'S' and submits form

function StartSearch6(bCalledFromHREF) {
	StartSearch22(bCalledFromHREF);
}
function StartSearch22(bCalledFromHREF) {
   // VARIABLES...
   var inObj       = document.getElementById('Match');
   var inMatch     = inObj.value;
   var inField     = document.getElementById('cbxPage').value;
   var RepeatCount = 0;
   var DoSubmit    = true;
   var MinLen;

   // SET VARIABLES...
   inMatch = inMatch.toLowerCase();
   inField = inField.toLowerCase();
   
   //if (inField == 'phrase') {
   //   MinLen = 13;
   //} else {
   //   MinLen = 3;
   //}
   MinLen = 3;

   // MAKE SURE SOMETHING WAS ENTERED...
   if (BoxIsBlank22(inObj, true)) { return false; }

   // MAKE SURE IS NOT TOO SHORT...
   inMatch = inMatch.trim();

   if (inMatch.length < MinLen) {
      DoSubmit = false;
      alert('Too short!\n\nEnter at least ' + MinLen + ' characters!');
   }

   // SUBMIT IT OR NOT...
   if (!DoSubmit) {
      inObj.focus();
      inObj.select();
      if (!bCalledFromHREF) { return false } // needed when calling from FORM
   } else {
      // SUBMIT IT...
      if (bCalledFromHREF) {
      	ChangePage22(document.frmTAP.cbxPage);
      }
      document.frmTAP.submit();
      return true;
   }
   return false;
}
function ChangePage6(inObj) {
	ChangePage22(inObj);
}
function ChangePage22(inObj) {
   var inPage = inObj.value;
   document.frmTAP.action = '../../Find/' + inPage + '.asp';
   document.frmTAP.Match.focus();
   document.frmTAP.Match.select();
   return;
}
String.prototype.trim = function() {
	// Strip leading and trailing white-space
	return this.replace(/^\s*|\s*$/g, "");
}
function TAPBoxOnLoad6(inMatch) {
	TAPBoxOnLoad22(inMatch);
}
function TAPBoxOnLoad22(inMatch) {
   var s = new String(document.location);
   s = s.toLowerCase();

   // SET PAGE BOX TO WHAT PAGE WE'RE ON...
   if (s.indexOf('cross') > 0) {
      document.frmTAP.cbxPage.options[0].selected = true;
   } else if (s.indexOf('artist') > 0) {
      document.frmTAP.cbxPage.options[1].selected = true;
   } else if (s.indexOf('title') > 0) {
      document.frmTAP.cbxPage.options[2].selected = true;
   } else if (s.indexOf('person') > 0) {
      document.frmTAP.cbxPage.options[3].selected = true;
   } else if (s.indexOf('phrase') > 0) {
      document.frmTAP.cbxPage.options[4].selected = true;
   }
   ChangePage22(document.frmTAP.cbxPage);
   document.frmTAP.Match.value = inMatch;
   //FocusObj22('Match');
   return;
}



// ***************
// *** TRIM *** //
// ***************


function trim(s) {
    // STRIP LEADING SPACES...
   while ((s.substring(0, 1) == ' ') || (s.substring(0, 1) == '\n') || (s.substring(0, 1) == '\r')) {
      s = s.substring(1, s.length);
   }

   // STRIP TRAILING SPACES...
  while ((s.substring(s.length - 1, s.length) == ' ') || (s.substring(s.length - 1, s.length) == '\n') || (s.substring(s.length - 1, s.length) == '\r')) {
     s = s.substring(0, s.length - 1);
  }
  return s;
}



// ***********************
// *** BOX IS BLANK *** //
// ***********************



// This (group of) function(s) ensures that something was entered or 
// selected in a textbox, selectbox, or radiogroup.
//
// Params:
//    inBox:      html text, radio, or select-one.
//    isRequired: Boolean determines if this box is required (if error
//                messages should be used).
//
// Returns: Flase, if box has something in it.  Nothing happens.
//          If box is blank...
//             If 'isRequired':
//                 True - error message appears, text (HERE!) appears in
//                 the box, and focus is reset to the box.  User may not
//                 continue (may not submit form while box is blank).
//             Not 'isRequired':
//                 False - nothing happens.
//
// This function is not fooled by [Blank]s.  The text of the passed in
// object is BoxIsBlank_Trim, and if it's blank, it is caught.
//
// When False (the box is not blank and all is successful), the text of
// the box is not changed; it is submitted AS-IS.
//
// If 'isRequired' is true, then ERROR boxes will appear if the box is
// blank.  'isRequired' should be true only in cases where it is truly
// REQUIRED.  If a box SHOULD BE filled, but is not required, then
// 'isRequired' should be set to false, and the 'warning message' (not
// error message) events should be handled by the calling function.
// VARIABLES...
var BoxHasNoText_TEXT       = 'HERE!';
var BoxHasNoText_FlashCount = 0;
var BoxHasNoText_MAX_FLASH  = 6;
var BoxHasNoText_Obj;

var RadioIsSet_FlashCount = -1;
var RadioIsSet_FlashEach = 4;
var RadioIsSet_RadioOb;
var RadioIsSet_Which = -1;

var SelectionIsMade_TEXT = 'HERE!';
var SelectionIsMade_FlashCount   = 0;
var SelectionIsMade_MaxFlash = 10;
var SelectionIsMade_Obj;
var SelectionIsMade_OrigText = '';

//----------------------------------------------------------------------
//MAIN FUNCTION...
//----------------------------------------------------------------------
function BoxIsBlank6(inObj, isRequired) {
	BoxIsBlank22(inObj, isRequired);
}
function BoxIsBlank22(inObj, isRequired) {
   //DETERMINE INPUT TYPE...
   //alert('Is box blank? (' + inObj.type + ' - ' + isRequired + ')');
   switch (inObj.type) {
   case 'text':
   case 'textarea':
   case 'password':
      return BoxHasNoText(inObj, isRequired);
      break;
   case 'select-one':
      return !SelectionIsMade(inObj, isRequired);
      break;
   case 'hidden' :
      return HiddenIsBlank(inObj, isRequired);
   default:
      // FIX ME -- we got problems here, because a TEXT also has a length!
      if (inObj.length > 0) { // is a radio button
         return !RadioIsSet(inObj, isRequired);
      }
      break;
   }
}

//----------------------------------------------------------------------
// HIDDEN INPUT FUNCTIONS...
//----------------------------------------------------------------------
function HiddenIsBlank(inBox, isRequired) {
   str1 = new String;
   str1 = BoxHasNoText_Trim(inBox.value);
   if (str1 == '') {
      if (isRequired) {
         alert('This field (' + inBox.name + ') cannot be blank.\n\nPlease try again...');
      }
      return true;
   }
   return false;
}
//----------------------------------------------------------------------
//TEXTBOX FUNCTIONS...
//----------------------------------------------------------------------
function BoxHasNoText(inBox, isRequired) {
   str1 = new String;
   str1 = BoxHasNoText_Trim(inBox.value);
   BoxHasNoText_FlashCount = 0;
   if (str1 == '') {
      if (isRequired) {
         alert('This field cannot be blank.\n\nPlease try again...');
         BoxHasNoText_Obj = inBox;
         if (BoxHasNoText_Obj.type!="text") { BoxHasNoText_Obj.focus(); 
         } else {
            BoxHasNoText_FlashIt();
         }
      }
      return true;
   } else if (str1.indexOf(BoxHasNoText_TEXT) > -1) {
      alert('Remove that text (' + BoxHasNoText_TEXT + ') from this field.');
      BoxHasNoText_Obj = inBox;
      BoxHasNoText_FlashIt();
      return true;
   }
   return false;
}
function BoxHasNoText_Trim(inStr) {
   while (inStr.substring(0, 1) == ' ') {
      inStr = inStr.substring(1, inStr.length);
   }
   while (inStr.substring(inStr.length - 1, 1) == ' ') {
      inStr = inStr.substring(0, inStr.length - 2);
   }
   return inStr;
}
function BoxHasNoText_FlashIt() {
   var Delayed = 200;
   BoxHasNoText_FlashCount++;
   if (BoxHasNoText_Obj.value == BoxHasNoText_TEXT) {
      BoxHasNoText_Obj.value = '';
   } else {
      BoxHasNoText_Obj.value = BoxHasNoText_TEXT;
   }
   if ((BoxHasNoText_FlashCount <= BoxHasNoText_MAX_FLASH) || (BoxHasNoText_Obj.value == '')) {
      setTimeout("BoxHasNoText_FlashIt()", Delayed);
   } else {
      BoxHasNoText_FlashCount = 0;
      BoxHasNoText_Obj.focus();
      BoxHasNoText_Obj.select();
   }
   return;
}
//----------------------------------------------------------------------
//RADIOGROUP FUNCTIONS...
//----------------------------------------------------------------------
function RadioIsSet_Flash() {
   var Delayed = 80;
   var MaxFlash = RadioIsSet_FlashEach * RadioIsSet_RadioOb.length;
   RadioIsSet_FlashCount++;
   RadioIsSet_Which = RadioIsSet_FlashCount % RadioIsSet_RadioOb.length;
   RadioIsSet_RadioOb[RadioIsSet_Which].checked = true;
   RadioIsSet_RadioOb[RadioIsSet_Which].focus();
   if (RadioIsSet_FlashCount <= MaxFlash - 1) {
      setTimeout("RadioIsSet_Flash()", Delayed);
   } else {
      RadioIsSet_FlashCount = 0;
      for (var xx = 0; xx < RadioIsSet_RadioOb.length; xx++) {
         RadioIsSet_RadioOb[xx].checked = false;
      }
   }
   return;
}
function RadioIsSet(inObj, isRequired) {
   var ErrMsg = ErrIfRadioNotSet(inObj)
   if (ErrMsg) {
      if (isRequired) {
         alert(ErrMsg);
         RadioIsSet_RadioOb = inObj;
         RadioIsSet_Flash();
      }
   }
   return !ErrMsg;
}
function ErrIfRadioNotSet(inObj) {
   var ii = 0;
   while (ii < inObj.length) {
      if (inObj[ii].checked) {
         return false;
      }
      ii++;
   }
   return 'Invalid.\n\nNothing has been selected.';
}
//----------------------------------------------------------------------
//SELECTBOX FUNCTIONS...
//----------------------------------------------------------------------
function SelectionIsMade_Flash() {
   var Delayed = 150;
   //*******************************************
   // WE ARE CURRENTLY NOT USING THIS FEATURE...
   return;
   //*******************************************
   if (SelectionIsMade_FlashCount == 0) {
      SelectionIsMade_OrigText = SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text;
   }
   SelectionIsMade_FlashCount++;
   if (SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text == SelectionIsMade_TEXT) {
      SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text = '';
   } else {
      SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text = SelectionIsMade_TEXT;
   }
   if ((SelectionIsMade_FlashCount <= SelectionIsMade_MaxFlash) || (SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text == SelectionIsMade_TEXT)) {
      setTimeout("SelectionIsMade_Flash()", Delayed);
   } else {
      SelectionIsMade_FlashCount = 0;
      SelectionIsMade_Obj.options[SelectionIsMade_Obj.selectedIndex].text = SelectionIsMade_OrigText;
   }
   return;
}
function SelectionIsMade(inObj, isRequired) {
   var ErrMsg = ErrIfSelectionNotMade(inObj);
   if (ErrMsg) {
      if (isRequired) {
         alert(ErrMsg);
         SelectionIsMade_Obj = inObj;
         SelectionIsMade_Flash();
         inObj.focus();
      }
   }
   return !ErrMsg;
}
function ErrIfSelectionNotMade(inObj) {
   if (inObj.selectedIndex == -1) {
      return 'This field may not be blank.';
   }
   var Value = inObj.options[inObj.selectedIndex].value;
   if ((Value < 0) || (Value == '')) {
      return 'This field requires a selection.';
   }
   return false;
}
