//  -- begin NAVIGATION section...

var menuTop = 80;
var mnuCompanyLeft = 4;
var mnuSolutionsLeft = 86;
var mnuServicesLeft = 168;
var mnuProductsLeft = 246;
var mnuPartnersLeft = 325;
var mnuHeroesLeft = 403;
var mnuNewsandEventsLeft = 471;
var mnuCareersLeft = 589;

function placeMenu(menu, left, top) {
  
  if (document.all) {
    if (document.all[menu]) {
      document.all[menu].style.pixelTop = top;
      document.all[menu].style.pixelLeft = left;
    }
  }

    if (document[menu]) {
      document[menu].top = top;
      document[menu].left = left;
    }

    if (document.getElementById){
      document.getElementById(menu).style.top = top;
      document.getElementById(menu).style.left = left;
    }
}

function showMenu(menu) {

  hideMenus();
  
  if (menu == "mnuCompany") {
    placeMenu("mnuCompany", mnuCompanyLeft, menuTop);
  }
  if (menu == "mnuSolutions") {
    placeMenu("mnuSolutions", mnuSolutionsLeft, menuTop);
  }
  if (menu == "mnuPartners") {
    placeMenu("mnuPartners", mnuPartnersLeft, menuTop);
  }
  if (menu == "mnuHeroes") {
    placeMenu("mnuHeroes", mnuHeroesLeft, menuTop);
  }
  if (menu == "mnuNewsandEvents") {
    placeMenu("mnuNewsandEvents", mnuNewsandEventsLeft, menuTop);
  } 
  if (menu == "mnuCareers") {
    placeMenu("mnuCareers", mnuCareersLeft, menuTop);
  }  
  if (menu == "mnuProducts") {
    placeMenu("mnuProducts", mnuProductsLeft, menuTop);
  }  
  if (menu == "mnuServices") {
    placeMenu("mnuServices", mnuServicesLeft, menuTop);
  }      
}

function hideMenus() {

  placeMenu("mnuNewsandEvents", 0, -400);
  placeMenu("mnuCompany", 0, -400);
  placeMenu("mnuSolutions", 0, -400);
  placeMenu("mnuCareers", 0, -400);
  placeMenu("mnuHeroes", 0, -400);
  placeMenu("mnuPartners", 0, -400);
  placeMenu("mnuProducts", 0, -400);
  placeMenu("mnuServices", 0, -400);
}

function doOver(el) {
	with (el.style) {
        background = "#FFFFFF";
		border = "1px solid #660033";
		padding = "2px";
		color = "#000000";
	}
}

function doOut(el) {
	with (el.style) {
		background = "#FFFFFF";
		border = "1px solid #FFFFFF";
		padding = "2px";
		color = "#000000";
	}
}

function doDown(el) {
	with (el.style) {
	    background = "#B17D97";
		border = "1px solid #660033";
		padding = "2px";
		color = "#FFFFFF";
	}
}

function doUp(el) {
	with (el.style) {
        background = "#FFFFFF";
		border = "1px solid #FFFFFF";
		padding = "2px";
		color = "#000000";
	}
}

function doGrayOut(el) {
	with (el.style) {
 		background = "url('/images/bg.jpg')";
		border = "1px solid #CCCCCC";
		padding = "2px";
		color = "#000000";
	}
}

function doGrayOver(el) {
	with (el.style) {
		border = "1px solid #999999";
		padding = "2px";
		color = "#000000";
	}
}

// -- end NAVIGATION section...

// -- begin FORM HANDLING section...

var inquiryType = "";
var NS4 = (document.layers) ? 1 : 0;
var IE4 = (document.all) ? 1 : 0;

function setCookie(name, value, expires, path, domain, secure) {
//  var theCookie = name + "=" + escape(value) +
//    ((expires) ? "; expires=" + expires.toGMTString() : "") +
//    ((path) ? "; path=" + path : "") +
//    ((domain) ? "; domain=" + domain : "") +
//    ((secure) ? "; secure" : "");
//  document.cookie = theCookie;
}

function getCookie(theName) {

//  var theCookie = document.cookie;
//  var theName = theName + "=";
//  var begin = theCookie.indexOf("; " + theName);
//  if (begin == -1) {
//    // first cookie...no ";"...
//    begin = theCookie.indexOf(theName);
//    if (begin != 0) return null;
//  } else {
//    // change to 1...
//    begin += 2;  
//  }
//  var end = document.cookie.indexOf(";", begin);
//  if (end == -1) {
//    // last cookie or only cookie...no ";" on end...
//    end = theCookie.length;
//  }
//  var ckval = unescape(theCookie.substring(begin + theName.length, end));
//  return ckval;
//  return unescape(theCookie.substring(begin + theName.length, end));
}

function getValue(theSpecific, theString, theDelimiter) {
  var begin = theString.indexOf(theDelimiter + theSpecific);
  if (begin == -1) {
    // no starting delimiter...
    begin = theString.indexOf(theSpecific);
    if (begin != 0) {
      return null;
    } else {
      // set to 1...
      begin += 2;
    }
  } else {
    begin = begin + theDelimiter.length + theSpecific.length;
  }
  var end = theString.indexOf(theDelimiter, begin);
  if (end == -1) {
    // last or single cookie has no trailing delimiter...
    end = theString.length;
  }
  return theString.substring(begin, end);
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0) {
    date.setTime(date.getTime() - skew);
  }
}

function writeCookie(f) {

//  var theDate = new Date();
//  var theValue = "NM" + f.CONTACT.value;
//  theValue = theValue + "::CO" + f.COMPANY.value;
//  theValue += "::EM" + f.cs1_ContSupRef.value;
//  fixDate(theDate);
//  theDate.setTime(theDate.getTime() + 1 * 86400000);
//  setCookie("revelwood", theValue, theDate, "/");
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function checkForm(f) {

  var nm = f.CONTACT.value;
  var co = f.COMPANY.value;
  if (f.name == "contact_form") {
    var ph = f.Phone1.value;
  }
  var em = f.cs1_ContSupRef.value;
  
  if (nm == null || nm == "" || nm == "1") {
    alert ("Please enter your name. ");
    return false;
  }

  if (co == null || co == "" || co == "1") {
    alert ("Please enter your company. ");
    return false;
  }
  
  if (f.name == "contact_form") {
    if (ph == null || ph == "" || ph == "1") {
      alert("Please enter your phone number. ");
      return false;
    }
  }

  if (em == null || em == "" || em == "1") {
    alert ("Please enter your Email address. " );
    return false;
  } else {
    if (! validateEMail(f.cs1_ContSupRef)) return false;
  }

  disableSubmitButton(f);
  writeCookie(f);
  return true;

}

function validateEMail(mailField) {
  var sEmail= new Object;
  sEmail= mailField.value;
  if (sEmail=="") {
    alert("You have not entered an email address. \n Please enter it now.")
    mailField.focus();
    mailField.select();
    return false;
  }

  if (sEmail.length > 0) {
    // Return false if e-mail field does not contain a '@' and '.' .
    var atPos = sEmail.indexOf('@', 0);
    if ( (atPos == -1) ||
         (sEmail.indexOf ('@',atPos+1) > 0) ||
         (sEmail.indexOf ('.',0) == -1) ||
         (sEmail.indexOf('@.',0) > 0) ||
         (sEmail.indexOf('.@', 0) > 0) ||
         (sEmail.indexOf('.',0) == sEmail.length - 1)
       ) {
      alert("You have entered an email address that appears to be invalid. \n Please correct the email address now.");
      mailField.focus();
      mailField.select();
      return false;
    }
 }

 return true;

}

function disableSubmitButton(f) {

  if (!IE4) return true;
  if (IE4) {
    f.submit_btn.disabled = true;
  }
  return true;  
}

// -- begin "Form handling" section...

var inquiryType = "";

function openContactForm(inquiryType) {
  if (inquiryType == "dynamo") {
    var wLeft = (screen.width - 400) / 2;
    var wTop = (screen.height - 535) / 2;
    wAttribs="width=400,height=535,toolbar=no,directories=no,top=" + wTop + ",left=" + wLeft + ",scrollbars=no";
    dynamoForm = window.open("/forms/dynamo_request.html","Dynamo",wAttribs);    
  }
  if (inquiryType == "contact") {
    var wLeft = (screen.width - 400) / 2;
    var wTop = (screen.height - 500) / 2;
    wAttribs="width=400,height=500,toolbar=no,directories=no,top=" + wTop + ",left=" + wLeft + ",scrollbars=no";
    contactForm = window.open("/forms/contact_form.html","Contact",wAttribs);
  }
}

function showForm(strRequestTitle, strRequestCode) {

  var wLeft = (screen.width - 400) / 2;
  var wTop = (screen.height - 300) / 2;
  wAttribs="width=400,height=300,toolbar=no,directories=no,top=" + wTop + ",left=" + wLeft + ",scrollbars=no";
  f = window.open("", "Download", wAttribs);  
  f.window.document.write("<html>\n");
  f.window.document.write("<head>\n");
  f.window.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/rw.css\">\n");
  f.window.document.write("<style> TD { font-size : 8pt; }</style>\n");
  f.window.document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"/js/rw2.js\"></script>\n");
  f.window.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n");
  f.window.document.write("<meta http-equiv=\"Content-Language\" content=\"en-us\">\n");
  f.window.document.write("<title>Download Request</title>\n");
  f.window.document.write("</head>\n");
  f.window.document.write("<body marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\">\n");
  f.window.document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n");
  f.window.document.write("  <tr>\n")
  f.window.document.write("    <td class=\"clsFormHeader\">");
  
  if (strRequestTitle != "") {
    f.window.document.write(strRequestTitle + "<br>");
  }

  f.window.document.write("Download Request</td>\n");
  f.window.document.write("  </tr>\n");
  f.window.document.write("  <tr>\n");
  f.window.document.write("    <td>Please provide the following contact information and click the Submit Form button.&nbsp; A confirmation page will then display with a link to your download.<br>\n");
  f.window.document.write("      <form method=\"POST\" onsubmit=\"return checkForm(this)\" action=\"http://www.revelwood.com/cgi-bin/rw.pl\" name=\"download_form\">\n");
  f.window.document.write("        <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\">\n");
  f.window.document.write("          <tr>\n");
  f.window.document.write("            <td align=\"right\"><em>Name<span class=\"clsAsterisk\">*&nbsp;</span></em></td>\n");
  f.window.document.write("            <td><input name=\"CONTACT\" size=\"35\"></td>\n");
  f.window.document.write("          </tr>\n");
  f.window.document.write("          <tr>\n");
  f.window.document.write("            <td align=\"right\"><em>Company<span class=\"clsAsterisk\">*&nbsp;</span></em></td>\n");
  f.window.document.write("            <td><input name=\"COMPANY\" size=\"35\"></td>\n");
  f.window.document.write("          </tr>\n");
  f.window.document.write("          <tr>\n");
  f.window.document.write("            <td align=\"right\"><em>E-mail<span class=\"clsAsterisk\">*&nbsp;</span></em></td>\n");
  f.window.document.write("            <td>\n");
  f.window.document.write("              <input name=\"cs1_Rectype\" type=\"hidden\" value=\"P\">\n");
  f.window.document.write("              <input name=\"cs1_Contact\" type=\"hidden\" value=\"E-mail Address\">\n");
  f.window.document.write("              <input name=\"cs1_ContSupRef\" size=\"35\" maxlength=\"35\">\n");
  f.window.document.write("              <input name=\"NOTES\" type=\"hidden\" value=\"");
  
  if (strRequestTitle != "") {
    f.window.document.write("Downloaded  '" + strRequestTitle + "'  from website.\"");
  }
  
  f.window.document.write("\">\n");
  f.window.document.write("              <input name=\"Source\" type=\"hidden\" value=\"WEB\"></td>\n");  
  f.window.document.write("          </tr>\n");
  f.window.document.write("          <tr>\n");
  f.window.document.write("            <td colspan=\"2\" align=\"right\">\n");
  f.window.document.write("              <input type=\"submit\" value=\"Submit Form\"  name=\"submit_btn\">&nbsp;\n");
  f.window.document.write("              <input type=\"reset\" value=\"Reset Form\"></td>\n");
  f.window.document.write("              <input type=\"hidden\" name=\"doc_title\" value=\"");
  
  if (strRequestTitle != "") {
    f.window.document.write(strRequestTitle);
  }

  f.window.document.write("\">\n");
  f.window.document.write("              <input type=\"hidden\" name=\"doc_link\" value=\"");
  
  if (strRequestCode != "") {
    f.window.document.write(strRequestCode);
  }

  f.window.document.write("\">\n");
  f.window.document.write("            </td>\n");
  f.window.document.write("          </tr>\n");
  f.window.document.write("        </table>\n");
  f.window.document.write("      </form>\n");
  f.window.document.write("      <div class=\"clsVersion\" align=\"left\"><span class=\"clsAsterisk\">*</span> indicates a required field. View our <a target=\"_blank\" href=\"/privacy_statement.html\">Privacy Statement</a>. If you have any questions or difficulties with this form, please <a href=\"mailto:webmaster@revelwood.com?subject=Download Request:");

  if (strRequestCode != "") {
    f.window.document.write(strRequestCode);
  }

  f.window.document.write("\">contact us</a>.</DIV><br>\n");
  f.window.document.write("      <div align=\"right\"><a href=\"javascript:window.close()\">close this window</a>&nbsp;<a href=\"javascript:window.close()\"><img src=\"/images/close.gif\" width=\"17\" height=\"17\" border=\"0\" align=\"absbottom\"></a></div>\n"); 
  f.window.document.write("    </td>\n");
  f.window.document.write("  </tr>\n");
  f.window.document.write("</table>\n");
  f.window.document.write("<script language=\"javascript\">\n");
  f.window.document.write("  var strData = \"\";\n");
  f.window.document.write("  strData = getCookie(\"revelwood\");\n");
  f.window.document.write("  if (strData != null) {\n");
  f.window.document.write("    document.download_form.CONTACT.value = getValue(\"NM\", strData, \"::\");\n");
  f.window.document.write("    document.download_form.COMPANY.value = getValue(\"CO\", strData, \"::\");\n");
  f.window.document.write("    document.download_form.cs1_ContSupRef.value = getValue(\"EM\", strData, \"::\");\n");
  f.window.document.write("  }\n");
  f.window.document.write("</script>\n");
  f.window.document.write("</body>\n");
  f.window.document.write("</html>\n");
}

function showContactForm() {

  var wLeft = (screen.width - 400) / 2;
  var wTop = (screen.height - 450) / 2;
  wAttribs="width=400,height=450,toolbar=no,directories=no,top=" + wTop + ",left=" + wLeft + ",scrollbars=no";
  
  f = window.open("", "Contact", wAttribs);
  f.window.document.write("<html>\n");
  f.window.document.write("<head>\n");
  f.window.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/rw2.css\">\n");
  f.window.document.write("<style> TD { font-size : 8pt; }</style>\n");
  f.window.document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"/js/rw2.js\"></script>\n");
  f.window.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n");
  f.window.document.write("<meta http-equiv=\"Content-Language\" content=\"en-us\">\n");
  f.window.document.write("<title>Contact Revelwood</title>\n");
  f.window.document.write("</head>\n");
  f.window.document.write("<body marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\">\n");
  f.window.document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"8\">\n");
  f.window.document.write("  <tr>\n");
  f.window.document.write("    <td class=\"clsFormHeader\">Contact Revelwood</td>\n");
  f.window.document.write("  </tr>\n<tr><td>Thank you for your interest in Revelwood. Please complete the information below to have someone contact you.\n");
  f.window.document.write("      <form action=\"http://www.revelwood.com/cgi-bin/contact.pl\" name=\"contact_form\" method=\"POST\" onSubmit=\"return checkForm(this)\">\n");
  f.window.document.write("      <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Name</em><span class=\"clsAsterisk\">*&nbsp;</span></td>\n");
  f.window.document.write("          <td>\n");
  f.window.document.write("            <input type=\"text\" name=\"CONTACT\" size=\"35\">\n");
  f.window.document.write("          </td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Company</em><span class=\"clsAsterisk\">*&nbsp;</span></td>\n");
  f.window.document.write("          <td>\n");
  f.window.document.write("            <input type=\"text\" name=\"COMPANY\" size=\"35\">\n");
  f.window.document.write("          </td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Phone</em><span class=\"clsAsterisk\">*&nbsp;</span></td>\n");
  f.window.document.write("          <td>\n");
  f.window.document.write("            <input type=\"text\" name=\"Phone1\" size=\"25\">\n");
  f.window.document.write("          </td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>E-mail</em><span class=\"clsAsterisk\">*&nbsp;</span></td>\n");
  f.window.document.write("          <td>\n");
  f.window.document.write("            <input name=\"cs1_Rectype\" type=\"hidden\" value=\"P\">\n<input name=\"cs1_Contact\" type=\"hidden\" value=\"E-mail Address\">\n<input name=\"cs1_ContSupRef\" size=\"35\" maxlength=\"35\">");
  f.window.document.write("          </td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Address 1&nbsp;</em></td>\n");
  f.window.document.write("          <td><input type=\"text\" name=\"Address1\" size=\"35\"></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Address 2&nbsp;</em></td>\n");
  f.window.document.write("          <td><input type=\"text\" name=\"Address2\" size=\"35\"></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>City&nbsp;</em></td>\n");
  f.window.document.write("          <td><input type=\"text\" name=\"City\" size=\"35\"></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>State&nbsp;</em></td>\n");
  f.window.document.write("          <td><nobr><input type=\"text\" name=\"State\" size=\"15\">");
  f.window.document.write("          <em>Zip Code </em>");
  f.window.document.write("          <input type=\"text\" name=\"Zip\" size=\"10\"></td>\n");
  f.window.document.write("        </tr></nobr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Country&nbsp;</em></td>\n");
  f.window.document.write("          <td><input type=\"text\" name=\"Country\" size=\"25\"></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td align=\"right\"><em>Comments&nbsp;</em></td>\n<td>");
  f.window.document.write("            <textarea name=\"NOTES\" cols=\"28\" rows=\"2\"></textarea></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("        <tr>\n");
  f.window.document.write("          <td colspan=\"2\" align=\"right\">\n");
  f.window.document.write("            <input type=\"submit\" name=\"submit_btn\" value=\"Submit Form\">&nbsp;\n");
  f.window.document.write("            <input type=\"reset\" value=\"Reset Form\">\n");
  f.window.document.write("            <input name=\"Source\" type=\"hidden\" value=\"WEB\"></td>\n");
  f.window.document.write("        </tr>\n");
  f.window.document.write("      </table>\n");
  f.window.document.write("      </form>\n");
  f.window.document.write("      <div class=\"clsVersion\" align=\"left\"><span class=\"clsAsterisk\">*</span> indicates a required field. View our <a target=\"_blank\" href=\"/privacy_statement.html\">Privacy Statement</a>. If you have any questions or difficulties with this form, please <a href=\"mailto:webmaster@revelwood.com?subject=Contact Form\">contact us</a>.</div>\n");
  f.window.document.write("      <div align=\"right\"><a href=\"javascript:window.close()\">close this window</a>&nbsp;<a href=\"javascript:window.close()\"><img src=\"/images/close.gif\" width=\"17\" height=\"17\" border=\"0\" align=\"absbottom\"></a></div>\n");
  f.window.document.write("    </td>\n");
  f.window.document.write("  </tr>\n");
  f.window.document.write("</table>\n");
  f.window.document.write("<script language=\"javascript\">\n");
  f.window.document.write("  var strData = \"\";\n");
  f.window.document.write("  strData = getCookie(\"revelwood\");\n");
  f.window.document.write("  if (strData != null) {\n");
  f.window.document.write("    document.contact_form.CONTACT.value = getValue(\"NM\", strData, \"::\");\n");
  f.window.document.write("    document.contact_form.COMPANY.value = getValue(\"CO\", strData, \"::\");\n");
  f.window.document.write("    document.contact_form.cs1_ContSupRef.value = getValue(\"EM\", strData, \"::\");\n");
  f.window.document.write("  }\n");
  f.window.document.write("</script>\n");  
  f.window.document.write("</body>\n");
  f.window.document.write("</html>\n");
  f.window.document.close();
}



function showDynamoForm() {
  alert("Please notify the web developers that 'javascript:showDynamoForm' is being called.  Thank you.");
}

// -- end "Form handling" section...

// -- start CRUMB TRAIL section...

function getlocation(dpth) {
  var d = "";
  if (dpth > 0) {
    for (k = 0; k < dpth; k++) {
      d += "../";
    }
  }
  return d;
}

function makecaps(strlowercase) {
  // split on space...
  words = strlowercase.split("_");
  for (j = 0; j < words.length; j++) {
    words[j] = words[j].toUpperCase().slice(0, 1) + words[j].slice(1);
    if (words[j] == "And") {
      words[j] = "&amp;";
    } else {
      if (words[j] == "Bpm") {
        words[j] = words[j].toUpperCase();
      } else {
        if (words[j] == "tm1") {
          words[j] = "TM1";
        } else {
          if (words[j] == "Lnl") {
            words[j] = "LnL";
          } else {
            if (words[j] == "Tm1") {
              words[j] = "TM1";
            } else {
              if (words[j] == "Bbrt") {
                words[j] = "BBRT";
              } else {
                if (words[j] == "Pdfs") {
                  words[j] = "PDFs";
                } else {
                  if (words[j] == "Ibm") {
                    words[j] = "IBM";
                  }
                }
              }    
            }
          }
        }
      }
    }
  }
  return words.join(" ");
}


function writeCrumbTrail(strtitle) {
  strloc = "";
  strhost = "";
  strprot = "";
  strpath = "";
  strpage = "";
  strdelim = "&gt;";
  strlinkstyle = "clsHomePageLink";
  strdelimstyle = "clsDelimiter";
  strtextstyle = "clsCrumbTitle";

  strloc = window.location.toString();
  strhost = window.location.hostname.toString();
  strprot = window.location.protocol.toString();

  // 2 '//' after protocol and 1 '/' after hostname...
  strpath = strloc.substr(strloc.indexOf(strprot) + strprot.length + 3 + strhost.length);
  subs = strpath.split("/");
  
  strpage = subs[subs.length - 1];

  // write homelink...
  writelink("/default.htm", "Home");

  a = 1;
  for (i = 0; i < (subs.length - a); i++) {
    subs[i] = makecaps(unescape(subs[i]));
    
    // if this is the last directory...
    if (i == subs.length - 2) {
      
      // then if it is the default page for that directory...
      if (strpage == "default.htm" || strpage == "") {
      
        // then don't write it as a link because it would just reload this page...
        writespan(subs[i]);

        
        // if there is a title specified, write that, too...
        if (strtitle != "") {
          document.write("<span class='" + strdelimstyle + "'>" + strdelim + "</span>  ");
          writetitle(strtitle);
        }
        
      } else {
      
        // write it as a link that will lead to the default page for this directory...
        
        writelink(getlocation(subs.length - i - 2), subs[i]);
        writetitle(strtitle);
      }
    } else {
      if (subs[i] != " Vti Bin") {
      	if (subs[i] != " vti bin") {
		  if (subs[i] != "_Vti_Bin") {
            if (subs[i] != "_vti_bin") {		  
	          if (subs[i] != "Shtml.dll") {
                writelink(getlocation(subs.length - i - 2), subs[i]);
              }
            }
          }
        }
      }
    }
  }
}

function writetitle(stitle) {

  // if no title is specified, then use the document title...
  if (stitle == "" || stitle == "default") {
    document.write("<span class='" + strtextstyle + "'>" + document.title + "</span>");
  // else use whatever special title is passed in...
  } else {
    document.write("<span class='" + strtextstyle + "'>" + stitle + "</span>");
  }      
}

function  writelink(loc, nm) {

  document.write("<a href='" + loc + "'  ");
  document.write("class='" + strlinkstyle + "'>" + nm + "</a>  ");
  document.write("<span class='" + strdelimstyle + "'>" + strdelim + "</span>  ");
}

function  writespan(nm) {

  document.write("<span class='" + strtextstyle + "'>" + subs[i] + "</span>  ");
  document.write("<span class='" + strdelimstyle + "'></span>  ");
}

// -- end CRUMB TRAIL section...

