// ****************************************************************************
// *                                                                          *
// *                          Copyright 2000                                  *
// *                       CHECCO COMPUTER SERVICES                           *
// *                        All Rights Reserved.                              *
// *                                                                          *
// *     This software contains proprietary and confidential information      *
// *     belonging to CHECCO COMPUTER SERVICES, and may not be decompiled,    *
// *     disassembled, disclosed, reproduced or copied without the prior      *
// *     written consent of CHECCO COMPUTER SERVICES.                         *
// *                                                                          *
// ****************************************************************************
var NS4 = new Number();
var IE4 = new Number();
var hasRightGutter = new Number();
var mouseX = 0;
var mouseY = 0;

// -------------------------------------------
// advanced dialog support
// -------------------------------------------
var dlgBASE = "/images/dlg-blue/dlg-";
var dlgBorderHtT = 11;
var dlgBorderHtB = 8;
var dlgBorderWdL = 10;
var dlgBorderWdR = 10;
function dlgStartBox(wd,ht,align,innerAH,innerAV)
{
	if ( is_nav4 )
	{
	   wd = "";
	   ht = "";
	}
	document.writeln("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width="+wd+" height="+ht+" align="+align+">" +
			"<TR VALIGN=top height="+dlgBorderHtT+">" +
			"<TD width="+dlgBorderWdL+"><IMG SRC=\""+dlgBASE+"ctl.gif\" BORDER=0></TD>" +
			"<TD BACKGROUND=\""+dlgBASE+"bt.gif\"><IMG SRC=\""+dlgBASE+"blank.gif\" BORDER=0></TD>" +
			"<TD width="+dlgBorderWdR+"><IMG SRC=\""+dlgBASE+"ctr.gif\" BORDER=0></TD>" +
			"</TR>" +
			"<TR VALIGN=top>" +
			"<TD width="+dlgBorderWdL+" BACKGROUND=\""+dlgBASE+"bl.gif\"><IMG SRC=\""+dlgBASE+"blank.gif\" BORDER=0></TD>" +
			"<TD align="+innerAH+" valign="+innerAV+" BGCOLOR=\"white\">");
	document.writeln("<TABLE border=0 width=\"100%\" height=\"100%\"><tr><td>" );
}
function dlgEndBox()
{
	document.writeln("</TD></TR></TABLE>");
	document.writeln("</TD>" +
			"<TD width="+dlgBorderWdR+" BACKGROUND=\""+dlgBASE+"br.gif\"><IMG SRC=\""+dlgBASE+"blank.gif\" BORDER=0></TD>" +
			"</TR>" +
			"<TR VALIGN=top height="+dlgBorderHtB+">" +
			"<TD width="+dlgBorderWdL+"><IMG SRC=\""+dlgBASE+"cbl.gif\" BORDER=0></TD>" +
			"<TD BACKGROUND=\""+dlgBASE+"bb.gif\"><IMG SRC=\""+dlgBASE+"blank.gif\" BORDER=0></TD>" +
			"<TD width="+dlgBorderWdR+"><IMG SRC=\""+dlgBASE+"cbr.gif\" BORDER=0></TD>" +
			"</TR>" +
			"</TABLE>");
}


// ----------------------------------------------------------------------------------------------
function noop()
{
}

function HtmlArg(line)
{
   var tmp = new String();
   tmp = line;
   // tmp.replace(/?/g,"%3F");
   tmp.replace(/%/g,"%25");
   tmp.replace(/&/g,"%26");
   tmp.replace(/ /g,"%20");
   tmp.replace(/"/g,"%22");
   tmp.replace(/;/g,"%3B");
   return tmp;
}
// -----------------------------
function findDOM(baseDOM,ename,byname)
{
   if ( !baseDOM ) {
      baseDOM = document;
   }
   var formlist = baseDOM.getElementsByTagName(ename);
   if ( formlist ) {
      for ( var i = 0; i < formlist.length; i ++ )
      {
         var tf = formlist.item(i);
         if ( tf )
         {
            if ( tf.getAttribute('name') == byname )
            {
               return tf;
            }
         }
      }
   }
   return null;
}

function nextDOM(fromfld)
{
   if ( fromfld )
   {
      var byname = fromfld.getAttribute('name');
      for ( var tf = fromfld.nextSibling; tf; tf = tf.nextSibling )
      {
         if ( tf.getAttribute('name') == byname )
         {
            return tf;
         }
      }
   }
   return null;
}

// -----------------------------
function findform(byname)
{  
   if ( is_gecko ) { return findDOM(document,"form",byname); }
   for ( i = 0; i < document.forms.length; i ++ )
   {  
      if ( document.forms[i].name == byname )
      {  
         return document.forms[i];
      }
   }
   return null;
}

function findimage(byname)
{  
   if ( is_gecko ) { return findDOM(document,"img",byname); }
   if (is_nav) {
      for ( var i = 0; i < document.images.length; i ++ )
      {  
         if ( document.images[i].name == byname )
         {  
            return document.images[i];
         }
      }
   }
   else { 
      for ( var i = 0; i < document.all.length; i ++ )
      {  
         if ( document.all[i].name == byname )
         {  
            return document.all[i];
         }
      }
   }
   return null;
}

function findelement(byform,byname)
{  
   if ( is_gecko ) { return findDOM(byform,"input",byname); }
   for ( var i = 0; i < byform.elements.length; i ++ )
   {  
      if ( byform.elements[i].name == byname )
      {  
         return byform.elements[i];
      }
   }
   return null;
}

function nextelement(byform,fromfld)
{
   if ( is_gecko ) { return nextDOM(byname); }
   var found = 0;
   for ( var i = 0; i < byform.elements.length; i ++ )
   {
      if ( found == 0 && byform.elements[i] == fromfld )
      {
         found = 1;
      }
      else if ( found == 1 && byform.elements[i].name == fromfld.name )
      {  
         return byform.elements[i];
      }
   }
   return null;
}

// -------------------------------------------
function setCookie(name, value, expire) 
{   
   document.cookie = name + "=" + escape(value) + ";path=/" + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
   return 0;
}

function getCookie(Name) 
{   
   var search = Name + "="   
   if (document.cookie.length > 0)
   { 
      // if there are any cookies      
      offset = document.cookie.indexOf(search)       
      if (offset != -1) 
      { 
         // if cookie exists          
         offset += search.length          
         // set index of beginning of value         
         end = document.cookie.indexOf(";", offset)          
         // set index of end of cookie value         
         if (end == -1)             
         {
            end = document.cookie.length         
         }
         return unescape(document.cookie.substring(offset, end))      
      }    
   }
   return "";
}

// ----------------------------------------------------------------------------------------------
// POPUP WINDOW SUPPORT
// ----------------------------------------------------------------------------------------------
// -------------------------------------------
// preprocessing goes here
// -------------------------------------------
var menuCloseDelay = 500;
var visibleLayerName = new String();
var focusedLayerName = new String();
var shownArray = new Array();
var master_Alignment = new String();
var bgimg = new Image(10,10);
// -------------------------------------------
// functions go here
// -------------------------------------------
function init_popup_support()
{
   shownArray = new Array();

   NS4 = (document.layers) ? 1 : 0;
   IE4 = (document.all) ? 1 : 0;
   ver4 = (NS4 || IE4) ? 1 : 0;

   focusedLayerName = "";
   pendingLayerName = "";
}

function existLayer(layerName)
{
	rc = false;
        if (is_gecko) {
                if ( document.getElementById(layerName) ) {
                        rc = true;
                }
        }
        else if (is_nav4) {
                if ( document.layers[layerName] ) {
                        rc = true;
                }
        }
        else {
                if ( document.all[layerName] ) {
                        rc = true;
                }
        }
	return rc;
}

function visibleLayer(layerName)
{
	rc = false;
        if (is_gecko) {
                var tl = document.getElementById(layerName);
                rc = tl.style.visibility;
        }
        else if (is_nav4) {
                if ( document.layers[layerName] ) {
                        rc = document.layers[layerName].visibility;
                }
        } else {
                if ( document.all[layerName] ) {
                        rc = document.all[layerName].style.visibility;
                }
        }
	return rc;
}

function moveLayer(layerName,leftPos,topPos,force) 
{
        if (is_gecko) {
                var tl = document.getElementById(layerName);
		//alert('moveLayer: ' + layerName + ': ' + tl + ': to (x=' + leftPos + ',y=' + topPos + ')');
                if ( tl.style.left == 0 || force ) {
                   tl.style.left = leftPos + "px";
                   tl.style.top = topPos + "px";
                }
        }       
        else if (is_nav4) {
                screenWidth = window.innerWidth;
                if ( document.layers[layerName].left == 0 || force ) {
                        document.layers[layerName].left = leftPos;
                        document.layers[layerName].top = topPos;
                }
        } else {
                screenWidth = document.body.clientWidth + 18;
                if ( document.all[layerName].style.pixelLeft == 0 || force ) {
                        document.all[layerName].style.pixelLeft = leftPos;
                        document.all[layerName].style.pixelTop = topPos;
                }
        }
}

function showLayer(layerName,on,remember) 
{
        if (on)
        {
                if (is_gecko) {
                        var tl = document.getElementById(layerName);
                        tl.style.visibility = "visible";
                }
                else if (is_nav4)
                {
                        document.layers[layerName].visibility = "SHOW";
                } else
                {
                        document.all[layerName].style.visibility = "visible";
                }
                // update globals
                visibleLayerName = layerName;
                //focusedLayerName = layerName;
        }
        else
        {
                if (is_gecko) {
                        var tl = document.getElementById(layerName);
                        tl.style.visibility = "hidden";
                }
                else if (is_nav4)
                {
                        document.layers[layerName].visibility = "hide"
                }
                else
                {
                        document.all[layerName].style.visibility = "hidden";
                }
                // update globals
                if ( layerName == visibleLayerName)
                {
                        visibleLayerName = "";
                }
                if ( layerName == focusedLayerName )
                {
                        focusedLayerName = "";
                }
        }
}

function popBoxOnce(layerName,posX,posY,force)
{
   if ( !shownArray[layerName] || force )
   { 
      shownArray[layerName] = true;
      moveLayer(layerName,posX,posY,true);
      showLayer(layerName,true,true);
   }
   return false;
}

function startLayer(layerName,leftPos,topPos,imageURL,exitCall,usefocus)
{
  var bgOpt = "";
  var jsEventStr = "onMouseout=\"" + exitCall + "\"";
  if ( usefocus )
  {
    jsEventStr += " onMouseover=\"focusedLayerName=this.id\"";
  }
  // alert ( "startLayer(" + layerName + "," + leftPos + "," + topPos + ")");
  if (NS4) {
      if ( imageURL ) { bgOpt = " BACKGROUND=\"" + imageURL + "\""; }
      document.write("<LAYER ID=\"" + layerName + "\" Z-INDEX=10 VISIBILITY=\"HIDE\" TOP=" + topPos + " LEFT=" + leftPos + " " + jsEventStr + " " + bgOpt + ">");
  }
  else {
      if ( imageURL ) { bgOpt = " background-image:url(" + imageURL + ");"; }
      document.write("<DIV ID=\"" + layerName + "\" STYLE=\"POSITION: absolute; Z-INDEX: 10; VISIBILITY: hidden; TOP: " + topPos + "px; LEFT: " + leftPos + "px; " + bgOpt + "\" " + jsEventStr + ">");
  }
  document.write("<TABLE border=0 cellspacing=0 cellpadding=0>");
  // begin client area
  document.write("<TR><TD valign=top>");
}

function endLayer()
{
  document.write("</TD></TR></TABLE>");
   if (NS4) {
      document.write("</LAYER>");
   }
   else {
      document.write("</DIV>");
   }
}

function startWindow(layerName,leftPos,topPos,title,imageURL,exitCall)
{
  // remove header
  title = "";

  startLayer(layerName,leftPos,topPos,imageURL,exitCall,true);

  // standard window frame
  var bgOpt = " BGCOLOR=\"#ffffff\"";
  if ( imageURL ) { bgOpt = ""; }
  var borderWidth = 1;

  if ( title ) { borderWidth=5; }

  document.write("<TABLE border=" + borderWidth + " cellspacing=0 cellpadding=2 " + bgOpt + ">");
  // write titlebar
  if ( title ) {
     bgOpt = " BGCOLOR=\"#08089C\"";
     if ( imageURL ) { bgOpt = ""; }

     document.write("<TR><TD valign=top>");
     document.write("<TABLE border=0 cellspacing=0 cellpadding=0 width=\"100%\"" + bgOpt + "><TR>");
     if ( title ) {
        document.write("<TD ALIGN=LEFT VALIGN=TOP>&nbsp;<FONT SIZE=3 COLOR=\"#fffff\"><STRONG>");
        document.write(title);
        document.write("</STRONG></FONT></TD>");
     }
     document.write("<TD width=10>&nbsp;</TD>");
     document.write("</TR></TABLE>");
     document.write("</TD></TR>");
  }
  // begin client area
  var bgOpt = " BGCOLOR=\"#ffffff\"";
  if ( imageURL ) { bgOpt = ""; }
  document.write("<TR><TD><TABLE border=0 cellspacing=0 cellpadding=0 width=\"100%\"" + bgOpt + "><TR>");
  document.write("<TD valign=top><FONT SIZE=1 COLOR=\"#000000\">");
}

function endWindow()
{
  document.write("</FONT></TD>");
  document.write("</TR></TABLE>");
  document.write("</TD></TR></TABLE>");
  endLayer();
}

function popupPage(url,name,width,height)
{
   window.open(url,'_new','resizable=yes,status=no,scrollbars=no,menubar=no,width=' + width + ',height=' + height + ',title=' + name );
}

function insertLayer(url,name,width,height)
{
  document.write("<H3 class=noprint><A href=\"javascript: noop()\" onClick=\"popupPage('" + url + "'," + width + "," + height + ")\">" + name + "</A></H3><br>");
  if (NS4) {
      //document.write("<ILAYER WIDTH=" + width + " HEIGHT=" + height + " SRC=\"" + url + "\">&nbsp;");
      //document.write("&nbsp;</ILAYER>");
  }
  else {
      document.write("<IFRAME class=noprint FRAMEBORDER=0 SCROLLING=AUTO WIDTH=" + width + " HEIGHT=" + height + " SRC=\"" + url + "\">");
	document.write("</IFRAME>");
  }
  document.write("<br>");
}


// ----------------------------------------------------------------------------------------------
// POPUP MENU SUPPORT
// ----------------------------------------------------------------------------------------------
// -------------------------------------------
// preprocessing goes here
// -------------------------------------------
document.write("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso8859-1\">");
document.write("<meta http-equiv=\"Pragma\" content=\"no-cache\">");
document.write("<meta http-equiv=\"expires\" content=\"now\">");
document.write("<meta http-equiv=\"Cache-Control\" content=\"no-cache\">");
document.write("<META NAME=\"description\" CONTENT=\"\">");

// -------- STYLES --------
if (navigator.appName.indexOf('Netscape') != -1) 
 document.writeln( '<link rel="stylesheet"  type="text/css" href="/common_netscape.css">' );
else
 document.writeln( '<link rel="stylesheet" type="text/css"  href="/common.css">' );
document.writeln( '<link rel="stylesheet" type="text/css" href="/print.css" media="print">' );

//document.write("<BASE HREF=\"http://"+location.host+"\">");

function changeClass(element,newClass)
{
   element.className = newClass;
}

// -------------------------------------------
// functions go here
// -------------------------------------------
//Capturing mousemove
function popmousemove(e) {
      mouseX=e?e.pageX:(window.event.clientX+document.body.scrollLeft);
      mouseY=e?e.pageY:(window.event.clientY+document.body.scrollTop);
}

function init_menu_support()
{
   init_popup_support();
   id_timeOut = 0;
   menuLevel = new Array();
   shownMenuLevel = new Array();
   document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove=popmousemove;
}

function startPopupMenu(level,baseName,title,imageURL)
{
  var layerName = baseName + "_layer";

  menuLevel[layerName] = level;

  mpos = getMenuPos(baseName);
  startWindow ( layerName,		 // layer object name
			mpos.x,mpos.y,	 // initial position
			title,		 // titlebar
			imageURL,          // background image
			"popMenu('',0,0)"  // exit processing
			); 
}

function endPopupMenu()
{
  endWindow();
}

function startCustomMenu(baseName,title,imageURL)
{
  var layerName = baseName + "_layer";
  var jsEventStr = "onMouseover=\"focusedLayerName=this.id\" onMouseout=\"popMenu('',0,0)\"";

  mpos = getMenuPos(baseName);
  startLayer ( layerName,		 // layer object name
			mpos.x,mpos.y,	 // initial position
			imageURL,          // background image
			"popMenu('',0,0)", // exit processing
			true ); 		 // do focus processing
}

function endCustomMenu()
{
  endLayer();
}

function getMenuPos(menuBase)
{
   var pos = new Object;
   pos.x = 0;
   pos.y = 0;
   var ancName = menuBase + "_anc";
   var imgName = menuBase + "_img";
   if ( is_gecko )
   {   
   }
   else if ( NS4 ) 
   {
      var layerObj = document.layers["menu_layer"];
      var ancObj = layerObj.document.anchors[ancName];
      var imgObj = layerObj.document.images[imgName];
      if ( imgObj && ancObj )
      {
         // pos.x = (ancObj.x + imgObj.width - 10);
         pos.x = (layerObj.pageX + ancObj.x + imgObj.width);
         pos.y = (layerObj.pageY + ancObj.y + 0);
      }
      /* some debug
      if ( ancObj )
      {
         alert ( "Anchor: " + ancObj.name + "\n" + "...ANCHOR Pos: " + ancObj.x + "," + ancObj.y + "\n" );
      }
      if ( imgObj )
      {
         alert ( "Image: " + imgObj.name + "\n" +  "...IMAGE Size: " + imgObj.width + "," + imgObj.height + "\n" );
      }
	*/
   }
   else
   {
      var ancObj = document.all[ancName];
      var imgObj = document.all[imgName];
      if ( imgObj && ancObj )
      {
         // does not work under IE
         //pos.x = imgObj.style.pixelLeft + imgObj.width;
         //pos.y = imgObj.style.pixelTop  + 0;
      }
   }
   //alert ( "Menu: " + menuBase + "\n" + "...Pos: " + pos.x + "," + pos.y + "\n" );
   return pos;
}

function popSafeClose()
{
   if ( pendingLayerName && pendingLayerName != focusedLayerName )
   {
	//window.defaultStatus = "Menu = " + focusedLayerName + " (hiding layer: " + pendingLayerName+ ")";
      showLayer(pendingLayerName,false,true);
      var level = menuLevel[pendingLayerName];
      shownMenuLevel[level] = "";
   }
   pendingLayerName = "";
}

function closeMenuLayer(level)
{
   //alert("closeMenuLayer(" + level + ")");
   if ( level == -1 )
   {
      if ( focusedLayerName )
      {
         level = menuLevel[focusedLayerName];
      }
      if ( !level )
      {
         level = 0;
      }
      //alert("closeMenuLayer(FROM: " + focusedLayerName + ":" + level + ")");
	level ++;
   }
   while ( level > 0 && shownMenuLevel[level] )
   {
      showLayer(shownMenuLevel[level],false,true);
      //alert("closeMenuLayer(HIDING: " + shownMenuLevel[level] + ":" + level + ")");
      shownMenuLevel[level] = "";
      level ++;
   }
}

function popMenu(menuName,posX,posY)
{
   var layerName = menuName + "_layer";
   var imgName = menuName + "_img";
   var levelMenu = 0;
   var levelFocus = 0;
   var msg = "Requested Menu: " + menuName + " (Last Menu: " + focusedLayerName + ")";
   //alert("popMenu(" + menuName + ", X=" + posX + ", Y=" + posY + ")");
   if ( menuName )
   {
      levelMenu = menuLevel[layerName];
      //alert("menuLevel(" + layerName + ")=" + levelMenu);
	   if ( pendingLayerName && pendingLayerName != focusedLayerName )
	   {
	        clearTimeout(id_timeOut);
              levelPending = menuLevel[pendingLayerName];
      		//alert("PendingLevel(" + pendingLayerName + ")=" + levelPending  + "\n" +
      		//	"FocusLevel(" + focusedLayerName + ")=" + levelFocus + "\n" +
      		//	"menuLevel(" + layerName + ")=" + levelMenu);
		if ( levelPending >= levelFocus )
		{
		   closeMenuLayer(levelPending);
		}
	   }
   }
   if ( focusedLayerName )
   { 
      levelFocus = menuLevel[focusedLayerName];
      //alert("FocusLevel(" + focusedLayerName + ")=" + levelFocus);
	if ( !menuName )
	{
	   clearTimeout(id_timeOut);
	   pendingLayerName = focusedLayerName;
           focusedLayerName = "";
           if ( menuCloseDelay )
           {
		   id_timeOut = setTimeout("popSafeClose()", menuCloseDelay);
		   msg += " DELAYED";
           }
           else
           {
               popSafeClose(); 
           }
	}
	else if ( levelFocus == levelMenu && layerName != focusedLayerName )
	{
         showLayer(focusedLayerName,false,true);
    	   shownMenuLevel[levelFocus] = "";
         focusedLayerName = ""
	}
   }
   if ( menuName && existLayer(layerName) )
   {
	closeMenuLayer(levelMenu);
      if ( is_gecko )
      {
	posX = mouseX;
        posY = mouseY;
      }
      else if ( document.images[imgName] ) 
      {
         //alert( "document.images[" + imgName + "].height = " + document.images[imgName].height + ")" );
         posX += (document.images[imgName].width);
         //posY -= (document.images[imgName].height/2);
      }
      if ( posX && posY ) 
      {
	   moveLayer(layerName,posX,posY,true);
      }
      showLayer(layerName,true,true);
	shownMenuLevel[levelMenu] = layerName;
//	pendingLayerName = layerName;
//	clearTimeout(id_timeOut);
//	id_timeOut = setTimeout("popSafeClose()", menuCloseDelay);
   }
   // debug
   //alert(msg);
   //window.defaultStatus = msg;
   return false;
}

// ----------------------------------------------------------------------------------------------
// MAIN NAVIGATION
// ----------------------------------------------------------------------------------------------

// -------------------------------------------
// preprocessing goes here
// -------------------------------------------
var init_done = false;

init_main();
// -------------------------------------------
// functions go here
// -------------------------------------------
function init_main()
{
   if ( init_done ) {
      return true;
   }
   init_done = true;
   // -------- STYLES --------
   document.write("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso8859-1\">");
   document.write("<meta http-equiv=\"Pragma\" content=\"no-cache\">");
   document.write("<meta http-equiv=\"expires\" content=\"now\">");
   document.write("<meta http-equiv=\"Cache-Control\" content=\"no-cache\">");
   document.write( '<link rel="stylesheet" type="text/css" href="/print.css" media="print">' );

   args_pairs = new Object();	// Array()
   args = new Object();	// Array()
   section_filename = "";
   section_page = "";
   section_directory = "";
   browsertype = 0;
   browser = navigator.appName;
   version = navigator.appVersion;
   display_navbar = true;
   page_title = "";

   // Determine browser type
   if (browser.indexOf("Netscape") > -1) {
      if (parseInt(version) >= 3) {
         browsertype = 1;
      }
   }
   else if (browser.indexOf("Explorer") > -1) {
      if (parseInt(version) >= 4) {
         browsertype = 1;
      }
   }

   Parse_Args();
   Parse_Section_Pathname(top.location.pathname);

   // preload images
   var img3 = new Image(10,10);
   img3.src = "/graphics/marble1.jpg";
   var img4 = new Image(10,10);
   img4.src = "/graphics/c8jcc_trans.gif";

   var bgi  = Math.round(Math.random() * 1000) % 5;
   //alert("BGI=" + bgi );
/*
   switch ( bgi )
   {
      case 4:
         bgimg.src = "/graphics/notepad.jpg";
         break;
      case 3:
         bgimg.src = "/graphics/paper.jpg";
         break;
      case 2:
         bgimg.src = "/graphics/marble2c.jpg";
         break;
      case 1:
         bgimg.src = "/graphics/marble1.jpg";
         break;
      default:
         bgimg.src = "/graphics/marble1.jpg";
         break;
   }
*/

   init_menu_support();
   return true;
}

function getBodyAttributes()
{
	return " BACKGROUND=\"" + bgimg.src + "\" BGCOLOR=\"#ffffff\" onClick=\"popMenu('',0,0); return true;\" onLoad=\"return OnDocLoad();\" ";
}

function isNumber(str)
{
	var validNumbers="0123456789";
	var num = "";
	str = str + "";
	if (str.length < 1)
		return(false);
	for ( var x = 0 ; x < str.length ; x++ ) {
		num = str.substring(x,x+1);
		if (validNumbers.indexOf(num) == -1) {
			return(false);
		}
	}
	return(true);
}

function String_Split(delim, str)
{
	var values = new Object();
	var i;
	var count = 0;
// when str is not defined or empty, account for NS2.0 not handling: "while ((i = str.indexOf(delim)) >= 0)"
// NS2.0 can't do a comparison against "str.indexOf(delim)" when str is empty or not defined
	if (str.length <= 0) {
		values.length = 0;
		return(values);
	}

	while ((i = str.indexOf(delim)) >= 0) {
		values[count++] = str.substring(0, i);
		str = str.substring(i+1);		// truncate end of str
	}
	values[count] = str;
	values.length = count + 1;
	return(values);
}

function Parse_Args()
{
	var search_str = top.location.search.substring(1, top.location.search.length);
	args_pairs = String_Split('\&', search_str);
	for (var i=0; i<args_pairs.length; ++i) {
		var args_pair = args_pairs[i];
		var name_val = String_Split('=', args_pair);
		args[name_val[0]] = name_val[1];
	}
	return(args);
}

function Parse_Section_Pathname()
{
	var pathname = arguments[0];
	directorys = String_Split('\/', pathname);	// e.g.: "/version1/admissions/applying.html"
      var use_idx = directorys.length - 1;
	// e.g.: "applying.html"
	section_filename = directorys[use_idx - 1];	// the actual filename is in the last element
      use_idx --;
	// e.g.: "applying"
	var section_pages = String_Split('\.', section_filename);	// let's assume we always only have one . in a filename
	section_page = section_pages[0];
	// e.g.: "admissions"
	section_directory = directorys[use_idx];	// the bottom directory is now in the last element
      while ( use_idx > 0 )
      {
         if ( section_directory == "" ) 
         {
            use_idx --;
            section_directory = directorys[use_idx];	// the bottom directory is now in the last element
            continue;
         }
         else if ( section_directory == "cgi-bin" ) 
         {
            use_idx --;
            section_directory = directorys[use_idx];	// the bottom directory is now in the last element
            continue;
         }
         else if ( section_directory == "files" ) 
         {
            use_idx --;
            section_directory = directorys[use_idx];	// the bottom directory is now in the last element
            continue;
         }
         else
         {
            break;
         }
     }
}

function Parse_Root_Pathname()
{
	var pathname = arguments[0];
	directorys = String_Split('\/', pathname);	// e.g.: "/version1/applying.html"
	// e.g.: "applying.html"
	root_filename = directorys[directorys.length - 1];	// the actual filename is in the last element
	--directorys.length;	// get rid of it from the array
	// e.g.: "applying"
	var root_pages = String_Split('\.', root_filename);	// let's assume we always only have one . in a filename
	root_page = root_pages[0];
}

function createSideBarArea()
{
	// creating menu area
	document.write("<TABLE class=noprint border=0 valign=bottom cellspacing=5 cellpadding=0 height=\"100%\">")
	document.write("  <tr><td colspan=2 align=right valign=top>");
	createSideBar();
	document.write("  </td></tr>");
	// other
	document.write("<tr><td valign=bottom align=center colspan=2>");
	document.write('<form method="get" action="http://search.atomz.com/search/">');
	document.write('<input size=15 name="sp-q"><br>');
	document.write('<input type=submit value="Quick Search">');
	document.write('<input type=hidden name="sp-a" value="sp10017cd7">');
	document.write('</form>');
	document.write("</td></tr>");
/*
	document.write("<tr><td valign=bottom align=right colspan=2>");
	document.write("<A href=\"http://sourceforge.net\"><IMG src=\"http://sourceforge.net/sflogo.php?group_id=42510\" width=88 height=31 border=0 alt=\"SourceForge Logo\"></A>");
	document.write("</td></tr>");
*/
	//document.write("<tr><td valign=bottom align=right colspan=2 height=100>");
	//document.write("</td></tr>");

	//document.write("<tr><td valign=bottom align=right colspan=2>");
	//document.write("<img src=\"/graphics/uswave.gif\" border=0>");
	//document.write("</td></tr>");

	// copyright
	document.write("  <tr><td colspan=2 align=right valign=bottom>");
	document.write("    <FONT SIZE=1 COLOR=\"#08089C\">");
	document.write("    Copyright &copy;<br>1993-2009,<br>All rights reserved.<BR>");
	document.write("    <b>Checco Services, Inc.</b><br> ");
	document.write("    Stony Point, NY 10980<br> ");
	document.write("    1.845.942.4246<br>");
	document.write("    <br>");
        if ( location.protocol == "https:" )
        {
document.write('<script src="https://seal.thawte.com/getthawteseal?host_name=www.checco.com&size=L&use_flash=NO&use_transparent=NO&lang=en"></script>');
        }
	document.write("    <br>");
	document.write("  </td></tr>");
	// done
	document.write("</TABLE>");
}

function showMainNavigation(title)
{
	init_main();

	page_title = title;

	// Logo
	document.write("<TABLE border=0 cellPadding=0 cellSpacing=0 width=\"100%\">");

	document.write("<tr><td colspan=2 valign=center align=left>");
	document.write("<A HREF=\"/\"><img src=\"/graphics/c8jcc.gif\" alt=\"Checco Services\" border=0></A>");
	document.write("</td>");
	document.write("<td>");
	document.write("    <TABLE class=noprint border=0 cellPadding=0 cellSpacing=0 width=\"100%\"><tr>");
      createTitleBar();
	document.write("    </TABLE>");
	document.write("  </td></tr>");
	document.write("</TABLE>");

	document.write("<TABLE border=0 cellPadding=0 cellSpacing=0 width=\"100%\">");
	document.write("  <tr><td valign=top height=40>&nbsp;</td>");
	document.write("  <td valign=center align=left height=40 colspan=2>");
	document.write("    <TABLE class=noprint border=0 cellPadding=0 cellSpacing=0 width=\"100%\" bgcolor=#c9c9c9><tr>");
      createMenuBar();
	document.write("    </TABLE>");
	document.write("  </td></tr>");
	//document.write("</TABLE>");

	// start
	//document.write("<TABLE border=0 cellPadding=0 cellSpacing=0 width=\"100%\">");

	// Sidebar
	document.write("  <tr><td valign=top>");
	master_Alignment = "right";
      createSideBarArea();
	document.write("  &nbsp;</td>");

	// Content
	document.write("  <td valign=top width=\"100%\">");
	document.write("    <TABLE border=0 align=center cellPadding=0 cellSpacing=0 width=\"90%\" height=\"100%\">");
	//document.write("      <tr><td valign=top height=10></td></tr>");
	document.write("      <tr><td width=20></td><td valign=top width=\"100%\" height=\"100%\">");
	
	if (hasRightGutter)
	   document.write("<table border=0 cellspacing=2 cellpadding=2><tr><td valign=top>");

	if ( NS4 )
	   document.write("<table border=0 cellspacing=5 cellpadding=5 bgcolor=\"#dddddd\" width=\"100%\" height=\"100%\"><tr><td valign=top width=\"100%\" height=\"100%\">");
	else
		document.write("<table border=0 cellspacing=5 cellpadding=5 width=\"100%\" height=\"100%\"><tr><td valign=top width=\"100%\" height=\"100%\">");
}

function endMainNavigation()
{
	document.write("</td></tr></table>");
	document.write("  </TD></TR>")	// end showStartContent()
	document.write("  </TABLE>")		// end showStartPage()
	document.write("</TD></TR>")		// end showStartPage()
	document.write("</TABLE>")		// end showStartDoc()

	// creating menu area
	startLayer("menu_layer",10,150,"","return true;",true);
	menuLevel["menu_layer"] = 0;
	master_Alignment = "right";
	//createSideBarArea();
	endLayer();

	// create any popup menus here
	master_Alignment = "left";
	createPopupMenus();

	document.write('<script language=javascript src="/js/awstats_misc_tracker.js"></script>');
}

// -------------------------------------------
function OnDocLoad()
{
   showLayer('menu_layer',true,false) 
   // showLayer('title_layer',true,false) 
   return true
}

// -------------------------------------------
function entryPrefix(alignment)
{
	document.write('<TR height=1><TD><IMG height=1 alt="" src="/images/blank.gif" width=1></TD></TR>' +
        '<TR><TD valign=top align=' + alignment + '><FONT face="Verdana,Arial,Helvetica" size=2>&nbsp;&nbsp;');
}

function entrySuffix()
{
	document.write("</font></TD></TR>")
}

// -------------------------------------------
function createBaseAnchor(desc,link)
{
   size = 2;
   document.write("<FONT COLOR=#000000 SIZE=\"" + size + "\"><strong><strong>")
   if ( link ) {
	document.write("<A class=normal HREF='" + link + "'");
      document.write(" onMouseover=\"changeClass(this,'highlight');closeMenuLayer(-1)\"")
      document.write(" onMouseout=\"changeClass(this,'normal');closeMenuLayer(-1)\">")
   }
   document.write(desc);
   if ( link ) {
      document.write("</A>");
   }
   document.write("</strong></strong></FONT>")
}

function createBaseEntry(desc,link)
{
   alignment = master_Alignment;
   entryPrefix(alignment);
   createBaseAnchor(desc,link);
   document.write("</td><td valign=top align=right>&nbsp;")
}

function createLinkEntry(desc,link)
{
   createBaseEntry(desc,link);
   entrySuffix();
}

function createPopupEntry(desc,link)
{
   var jStr = new String();
   if ( NS4 ) {
      jStr = "popMenu('" + desc + "',event.pageX,event.pageY)"
   }
   else {
      jStr = "popMenu('" + desc + "',event.x,event.y)"
   }
   createBaseEntry(desc,link);
   document.write("<A class=normal NAME=\"" + desc + "_anc\" HREF=\"javascript: \" onClick=\"" + jStr + "\" onMouseover=\"" + jStr + "\" onMouseout=\"popMenu('',0,0)\">");
   document.write("<IMG NAME=\"" + desc + "_img\" SRC=\"/graphics/pick_1.gif\" BORDER=0>")
   document.write("</A>")
   entrySuffix();
}

// -------------------------------------------
// MUST DEFINE:
//	 createTitleBar		// Title area
//	 createMenuBar		// horizontal area
//	 createSideBar		// sidebar
//	 createPopupMenus	// various popup menus
// -------------------------------------------


//<!--
// Ultimate client-side JavaScript client sniff. Version 3.01
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below).
// Revised 20 Dec 00 to add is_gecko and change is_nav5up to is_nav6up
//                      also added support for IE5.5 Opera4&5 HotJava3 AOLTV
// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4, 
//                      correct Opera 5 detection
//                      add support for winME and win2k
//                      synch with browser-type-oo.js
// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera, is_hotjava, is_webtv, is_TVNavigator, is_AOLTV
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav6, is_nav6up, is_gecko, is_ie3,
//     is_ie4, is_ie4up, is_ie5, is_ie5up, is_ie5_5, is_ie5_5up, is_hotjava3, is_hotjava3up,
//     is_opera4, is_opera5, is_opera5up
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98, is_winme, is_win2k
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//     is_sun, is_sun4, is_sun5, is_suni86
//     is_irix, is_irix5, is_irix6
//     is_hpux, is_hpux9, is_hpux10
//     is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//     is_linux, is_sco, is_unixware, is_mpras, is_reliant
//     is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
// for detailed lists of userAgent strings.
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when new versions of browsers are released, so
// in conditional code forks, use is_ie5up ("IE 5.0 or greater") 
// is_opera5up ("Opera 5.0 or greater") instead of is_ie5 or is_opera5
// to check version in code which you want to work on future
// versions.
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();
    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);
    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);
    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_dom     = (is_gecko || is_ie5up);
    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);
    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1);
    var is_opera5 = (is_opera5 && (is_major == 5));
    var is_opera5up = (is_opera5 && (is_major >=5));
    var is_webtv = (agt.indexOf("webtv") != -1); 
    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;
    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));
    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3
    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;
    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  
    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));
    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));
    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 || 
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
    var is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));
    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));
    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);    
    var is_aix2  = (agt.indexOf("aix 2") !=-1);    
    var is_aix3  = (agt.indexOf("aix 3") !=-1);    
    var is_aix4  = (agt.indexOf("aix 4") !=-1);    
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    var is_mpras    = (agt.indexOf("ncr")!=-1); 
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
                 is_sco ||is_unixware || is_mpras || is_reliant || 
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);
    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
//--> end hide JavaScript

function queryVersion()
{
  alert("Navigator.appCodeName= [" + navigator.appCodeName + "]\n" +
 	"Navigator.appName= [" + navigator.appName + "]\n" +
 	"Navigator.userAgent= [" + navigator.userAgent + "]\n" );
}

