function makemail( a, s, q ) {
  /* Set the default values */
  xa = "jillpal";
  xs = "verizon.net";
  xq = "Urgent Message for Jill from Web Site";
  /* if the user didn't give me data, use the defaults */
  if (a.length == 0) a = xa;
  if (s.length == 0) s = xs;
  if (q.length == 0) q = xq;
  /* construct the address and kick it off */
  x = "mailto:" + a + "@" + s + "?subject=" + q;
  document.location.href = x;
}


function MakeArray(n) {
 this.length = n
 return this
}


function trimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}


function checkMail(addr)
{
    // Tests email address for valid syntax, returns TRUE if not valid //
    var filter  =
/^([a-zA-Z0-9_\.\-])+([a-zA-Z0-9])\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
        if (filter.test(addr)) return false;
        else return true;
}


function getRadioButtonValue (radio)
{  var result = ""; 
   for (var i = 0; i < radio.length; i++) {   
          if (radio[i].checked) {
                        result =  radio[i].value;
                        break 
          }
    }
    return result
}


function clearDefault(el) {

	if (el.defaultValue==el.value) el.value = ""
		
}


function nextPage() {
	var nextpg
	thispage=ipage
	
	nextpg = thispage + 1
	if ( nextpg >= 6 ) { nextpg = 0 }
	
	toggleBox(cLayer[thispage],0)
	toggleBox(cLayer[nextpg],1)

	ipage = nextpg
	return true	

}


function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}



//////////////////////////////////////////////////////////////////
// The preloadImages() function preloads all the "flipped" images
// so that when a user mouses over a navigation button,
// the rollover takes place immediately.  (If you do not
// preload images, the first time a user mouses over each
// navigation button the "mouseover" image must TRavel
// from the Web server, causing an unatTRactive delay.
///////////////////////////////////////////////////////////////////

function preloadImages() {

    // If there are images embedded in the document...

    if (document.images) {

       // Set the imgFiles variable equal to an array of all the
       // image files passed as arguments to the preloadImages() function.

       var imgFiles = preloadImages.arguments;

       // Create a new array called preloadArray

       var preloadArray = new Array();

       // For each image file sent as an argument to preloadImages()
       // (all of them)...

       for (var i=0; i < imgFiles.length; i++) {

            // Create a new Image object in the preloadArray array 
            // and associate it with a source file, thus loading
            // that image into memory.

            preloadArray[i] = new Image;
            preloadArray[i].src = imgFiles[i];
       }
    }
}


function swap(id, newsrc) {
// This function is called to swap out an image being displayed 

  var theImage = locateImage(id);
  if (theImage) { // if an image was found
      theImage.src = newsrc;   //swap it out
      }

}


function locateImage(name) {
// Start with a blank variable called theImage
   var theImage = false;
   
// If there are images defined for this document . . .

   if (document.images) {
// Assign the image we're looking for to theImage
      theImage = document.images[name];
      }

// If theImage exists, return it to the calling function
   if (theImage) {
       return theImage;
       }
// Otherwise, return false(0) to the calling function
   return (false);
}
