//Adjust Menu tab height through: padding-top & padding-bottom in #MenuItem
//Adjust Sub Menu tab through: var isChild = "display:block;margin-left:15px;";
//Changing the margin to padding sends the left border flush left
//Changing the padding to margin indents the left border

var MenuWidth = 218;
var MenuItemBgColor = "#7D5F29";
var MenuItemBgColorSel = "#7A1E09";
var MenuItemForeColor = "#FEDC82";
var MenuItemForeColorSel = "#FEDC82";

var RedirectIndexPage = ""; // i.e.: about.htm; Leave blank ("") if index.htm is default
var DefaultRedirectErrPage = "index.html"; // i.e.: about.htm;
var CookieExpiryDate = "Monday, 04-Apr-2010 05:00:00 GMT";

/*********************************************************/
// CLIENT DATA

var BookmarkURL = "http://www.CARHOE.com/";
var BookmarkTitle = "The CARHOE";
var SiteName = "The CARHOE";
var TitlBarMain = "The CARHOE";
var LogoAlt = "The CARHOE";
var CopyrightHolder = "Carhoe by Sarka Ltd";
var ArtistName = "";
var WebMailRecipPrefix = "epb"; //trabue
var WebMailRecipDomain = "CARHOE";
var WebMailRecipExt = "com";
var WebMailFromPrefix = "CARHOE";
var WebMailRecipName = "CARHOE eMail Processing Center";
var WebMailRecipSource = "CARHOE Web Mail";
var WebMailBoundryName = "AlbertProducts";
var LogoAlign = "center";
var MsgPageURL = "http://www.CARHOE.com/msg.htm";
var SiteURL = "http://www.CARHOE.com";
var RemoteScriptURL = "http://www.CARHOE.com";

/*********************************************************/
// PAGE CAPTION

// Number pages not to be displayed in the Contents should be > LenMenuItems

//                          NODES:            MENU CAP:  PAGE CAP:   PAGE
// Example aMenuItems[X] = "Main;Parent;Child|MenuCaption|PageCaption|hRefPage";
aMenuItems = new Array (
   "Main||Home|The CARHOE|index.html",
   "Parent|2|Three Generations Of CARHOE|Three Generations Of CARHOE|models.htm",
   "Child|2|The CARHOE I|The CARHOE I|carhoe-I.htm?1",
   "Child|2|The CARHOE II|The CARHOE II|carhoe-II.htm?1",
   "Child|2|The CARHOE MS|The CARHOE MS|carhoe-ms.htm?1",
   //"Parent|1|Typical Customers|Typical Customers|users.htm",//
   "Main||Who Uses CARHOE I|Several CARHOE I Owners|users-carhoe-I.htm",
   "Main||Who Uses CARHOE II|Several CARHOE II Owners|users-carhoe-II.htm",
   "Main||Who Uses CARHOE MS|Several CARHOE MS Owners|users-carhoe-ms.htm",
   "Main||Customer Testimonials|Customer Testimonials|testimonials.htm",
   //"Main||Resales|Resales|resales.htm",//
   "Main||FAQ|Frequently Asked Questions|faq.htm",
   "Main||About Albert Products|About Albert Products|about.htm",
   "Main||Contact Us|Contact Us|contact.htm",
   "Parent|3|Resale|Resale|resale.htm",
   "Child|3|Sellers|Sellers|sellers.htm?1",
   "Child|3|Buyers|Buyers|buyers.htm?1"
   //"Child|4|Web Mail|eMail Us With Our Web Mail|web-mail.htm?1",//
   //"Main||Our Location|Our Location|location.htm",//
   //"Main||Terms Of Use|Terms Of Use|tou.htm",//
   //"Main||About This Web Site|About This Web Site|site.htm"//
);

/*********************************************************/
// PARSE HREF LOCATION STRING

   // Get href Path less page & query string, i.e.: D:\Projects\Clients Potential\artist\about.htm
var Val = document.location.href.split("/");
Val.pop();
Val = Val.join("/")
var hRefPath = Val + "/";

   // Get hRef location page and query string, i.e.: portfolio.htm?1
var hRefPageAndQueryStr = reverse(document.location.href).split("/");
hRefPageAndQueryStr = reverse(hRefPageAndQueryStr[0]);

   // Get hRef query string, i.e.: 1
var hRefQueryStr = document.location.href.split("?");
hRefQueryStr = hRefQueryStr[1];
if (!hRefQueryStr) { hRefQueryStr = ""; }

   // Get href query string elements, i.e.: ../zoom-portfolio.htm?1+1
var hRefQueryStrParts = hRefQueryStr.split("+");

   // Get hRef page less query string, i.e.: portfolio.htm
var hRefPage = hRefPageAndQueryStr.split("?");
hRefPage = hRefPage[0];

   // Get hRef page name only, i.e.: portfolio
var hRefPagePrifix = hRefPageAndQueryStr.split(".");
hRefPagePrifix = hRefPagePrifix[0];

   // Get hRef page name only, i.e.: .htm
var hRefPageSuffix = hRefPage.split(".");
hRefPageSuffix = hRefPageSuffix[1];

if (hRefPageAndQueryStr == "") {
   hRefPageAndQueryStr = "index.html"; }

/*********************************************************/
// REDIRECT PAGES

   // Get current child node count
var NodeID = "";
var ChildLength = 0;

for(x = 1; x < aMenuItems.length; x++) {
   var Val = aMenuItems[x].split("|");
   var Node = Val[0];
   var Link = Val[4];
   var Val = Link.split("?");
   Link = Val[0];
   if (Node == "Child" && hRefPage == Link) {
      NodeID = Val[1]; }
   if (Node == "Child" && NodeID == Val[1]) {
      ChildLength++; } }

var Val = hRefQueryStr.split("+");
var PageNum = Val[0];
var Item = Val[1];

if ((ChildLength > 0  && PageNum > ChildLength) ||
    (NodeID != "" && hRefQueryStr == "")) {
   document.location.href = DefaultRedirectErrPage; }

   // Redirect to default page if a page is not indicated
if (hRefPage == "" && hRefPage == "index.html") {
   document.location.href = RedirectIndexPage; }

/*********************************************************/
// PAGE ELEMENTS

   // Get page caption
for(i = 0; i < aMenuItems.length; i++) {
   var Val = aMenuItems[i].split("|");
   var pgTitle = Val[3];
   var Link = Val[4];
   if (hRefPageAndQueryStr == Link || hRefPageAndQueryStr == Link + "?") {
      var PageTitle = pgTitle; break; } }

   // Get TitleBar caption
if (isNull(PageTitle) == true) { PageTitle = "Entrance"; }
document.title = TitlBarMain + ": " + PageTitle;

function GetSectionHeader() {
   return "<img src='images/logo-hdr.jpg' alt='" + LogoAlt + "' border='0'>"; }

function GetSectionPageHeader() {
   return  "<div id='PageHeader'>" + PageTitle; }

function GetFooter() {

   var EmailLink = GetEmailLink('admin','MultiQuest','us','Trabue Gentry','Inquiry')

   return "All content of this web site Copyright&copy; 2005-" + GetCurrYear() + " " + CopyrightHolder + ". All rights reserved.<br>" +
   "All coding for and design of this web site by " + EmailLink + " &copy; 1992-" + GetCurrYear() + ". All rights reserved.</td>";

}

function GetSectionMenu() {

   var Contents = "";

      // Determine if is child
   for(x = 1; x < aMenuItems.length; x++) {
      var Val = aMenuItems[x].split("|");
      var NodeID = Val[1];
      var Link = Val[4];
      if (hRefPageAndQueryStr == Link && NodeID != "") {
         var ParentID = NodeID; } }

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

      var ForeColor = MenuItemForeColor;
      var BgColor = MenuItemBgColor;
      var MenuItemBgColor = "#7D5F29";
      var isChild = "";

      var Val = aMenuItems[i].split("|");
      var Node = Val[0];
      var NodeID = Val[1];
      var MenuCaption = Val[2];
      var PageCaption = Val[3];
      var Link = Val[4];

         // Hide all child menu items
      if (Node == "Child") { isChild = " display:none;"; }

         // Set all bullets to default
      if (Node == "Parent") {
         Bullet = "images/bullet-menu-drop.gif"; } else {
         Bullet = "images/bullet-menu.gif"; }

         // Set atrributes of selected menu item
      if (hRefPageAndQueryStr == Link || hRefPageAndQueryStr == Link + "?") {
         BgColor = MenuItemBgColorSel;
         ForeColor = MenuItemForeColorSel;
         MenuCaption = "<b>" + MenuCaption + "</b>";
         if (Node == "Parent") {
            Bullet = "images/bullet-menu-drop-sel.gif"; } else {
            Bullet = "images/bullet-menu-sel.gif"; } }

         // Display and indent child menu items
      if (Node == "Child" && NodeID == ParentID) {
         isChild = "display:block;margin-left:27px;"; }

         // Toggle collapse/expand chidren of on selecting parent
         /*********************************************************/
         // COLLAPSE CHILDREN ON SELECTING PARENT AFTER SELECTING CHILD:
         //    (Node == "Parent" && NodeID == ParentID)
         // DO NOT COLLAPSE CHILDREN ON SELECTING PARENT AFTER SELECTING CHILD:
         //    (Node == "Parent" && NodeID == ParentID && hRefQueryStr == "")
         /*********************************************************/
      if (Node == "Parent" && NodeID == ParentID) { Link = Link + "?" }

			// Changes SiteURL to RemoteScriptURL if ext is ".pl"
		var PathExt = (Link.split(".")[1]);
		if (PathExt == "pl") {
			LinkSiteURL = RemoteScriptURL; } else {
			LinkSiteURL = SiteURL; }

      Contents = Contents +
      "<div style='background-color:" + BgColor + ";" + isChild + "'>" +
         "<a id='MenuItem' style='color:" + ForeColor + "'; href=" + Link + ">" +
         "<img id='MenuBullet' src='" + Bullet + "' align='absmiddle' border='0'>" + MenuCaption + "</a></div>";

   }

   return "" +
      //"<div id='MenuHdr'>Contents</div>" +//
      "<div style='width:" + MenuWidth + "px;'>" + Contents + "</div> ";

}

/*********************************************************/

function GetCopyrightHolder() {
   return "<nobr>" + CopyrightHolder + "</nobr>";  }

function GetEmailLink(Prefix,Domain,Ext,Link,Subject) {

   if (Link == "Address") { Link = Prefix + "@" + Domain + "." + Ext; }

   return "<a href=mailto:" + Prefix + "@" + Domain + "." + Ext + "?subject=" + Subject + ">" + Link + "</a>";

   // SAMPLE CALLS:
   // GetEmailLink('admin','MultiQuest','us','Trabue Gentry','Inquiry')
   // <Script Language='JavaScript'>document.write(GetEmailLink('Prefix','Domain','DomainExtension','Link('Name or "Address"','Subject'))</Script>

}

function GetPageWidth() {
   return "<div style='width:600px;'>"; }

/********************************************************
/* Zoom Viewer */

function ZoomGetHeader() {
   return "<img src=images/logo-hdr-zoom.jpg alt='" + LogoAlt + "' border='0'>"; }
   
function ZoomGetHeaderUp1() {
   return "<img src=../images/logo-hdr-zoom.gif alt='" + LogoAlt + "' border='0'>"; }

function ZoomGetImage() {
   return "<img style='border:1px solid #7A1E09;' name='FullSize' src='images/zoom-" + hRefQueryStr + ".jpg' border='0'>"; }

function ZoomPortfolioOnErr() {

   if (isNull(hRefQueryStr) == true ) {
      document.location="index.html"; }

}

/*********************************************************/
// BASIC FUNCTIONS

function AddToFavorites() {

   if ((navigator.platform!="MacPPC") && (navigator.appName=="Microsoft Internet Explorer") && (navigator.appVersion>="4") && (document.all)) {
      window.external.AddFavorite(BookmarkURL,BookmarkTitle)
   } else {
      alert("Sorry. This option is only available for Microsoft Internet Explorer.\n\n" +
      "If you are using Netscape Navigator, click the \'Bookmarks\' menu,\n" +
      "then select \'Add...\' from the menu list to add the \'" + BookmarkTitle + "\' to your Bookmarks.")
   }

}

function MakeHomePage() {

   if ((navigator.platform!="MacPPC") && (navigator.appName=="Microsoft Internet Explorer") && (navigator.appVersion>="4")) {
      document.forms[0].style.behavior='url(#default#homepage)'; document.forms[0].setHomePage(BookmarkURL);
   } else {
      alert("Sorry. This option is only available for Microsoft Internet Explorer.\n\n" +
      "If you are using Netscape Navigator, click the \'Bookmarks\' menu,\n" +
      "then select \'Add...\' from the menu list to add the \'" + BookmarkTitle + "\' to your Bookmarks.")
   }

}

function GetCookie(Val) {
   return document.cookie.match ( Val + '=(.*?)(;|$)'); }

function GetCurrYear(number) {

   var now = new Date();
   return now.getFullYear();

}

function isNum(val) {

   val = val.toString();

   if (val.length == 0) return false;

   for (var n = 0; n < val.length; n++)
   if (val.substring(n, n+1) < "0" || val.substring(n, n+1) > "9")
      return false;

   return true;

}

function isNull(Str) {

   if (!Str) var IsNull = true; return IsNull;

}

function reverse(name) {

   var length = name.length;
   var letters = new Array(length);
   var letters2 = new Array(length);
   var backword = "";

   for (i=0; i<=length-1; i++) {
      letters[i] = name.substring(i, i+1); }

   f = 0

   for (j=i-1; j>=0; j--) {
      letters2[f] = letters[j];
      f++; }

   for (h=0; h<=letters2.length-1; h++) {
      backword +=letters2[h]; }

   return backword;

}

function GetDateStamp() {

   var DayPart = "";
   var Today = new Date();
   var hour = Today.getHours();

   if (hour >= 12) { DayPart = "PM"; } else if (hour < 12) { DayPart = "AM"; }

   if (hour > 12) { hour = hour - 12; } else if (hour <= 12) {
   if (hour == 0) { hour = 12; } else { hour = hour; } }

   var minute = Today.getMinutes();
   if (minute < 10  ) { minute = "0" + minute; } else { minute = minute; }

   var second = Today.getSeconds();
   if (second < 10  ) { second = "0" + second; } else { second = second; }

   var month = Today.getMonth(); month = month + 1;
   var day = Today.getDate();
   var year = Today.getYear(); if(year < 2000) { year = year + 1900; }

   var time = hour + ':' + minute + ':' + second;
   var date = month + '/' + day + '/' + year;

   return date + " " + time + " " + DayPart;

}

function getBrowser() {

 var agent=navigator.appName.toLowerCase();

   if (agent.indexOf("netscape")>-1) {
      return "Netscape";
   } else if (agent.indexOf("microsoft internet explorer")>-1) {
      return "IE";
   } else if (agent.indexOf("opera")>-1) {
      return "Opera";
   } else {
      return "Unknown";
   }

}

function getBrowserVersion(){

   browserName=navigator.appName.toLowerCase();
   browserVersion=parseInt(navigator.appVersion);

   if (browserName=="netscape" && browserVersion==5)
      // Netscape 6 has version number 5
      return "6";
   else if (browserName=="netscape" && browserVersion==4)
      return "4";
   else if (browserName=="netscape" && browserVersion==3)
      return "3";
   else if (browserName=="netscape" && browserVersion==2)
      return "2";
   else if (browserName=="microsoft internet explorer" && browserVersion==4
   && navigator.appVersion.indexOf("MSIE 6.0") != -1)
      // both MSIE 6, 5.5 and 5.0 return browser version of 4
      return "6.0";
   else if (browserName=="microsoft internet explorer" && browserVersion==4
   && navigator.appVersion.indexOf("MSIE 5.5") != -1)
      return "5.5";
   else if (browserName=="microsoft internet explorer" && browserVersion==4
   && navigator.appVersion.indexOf("MSIE 5.0") != -1)
      return "5.0";
   else if (browserName=="microsoft internet explorer" && browserVersion==4)
      return "4.0";
   else if (browserName=="microsoft internet explorer" && browserVersion<4)
      return "3.0";
   else if (browserName=="opera" && browserVersion==2)
      return "2.0";
   else if (browserName=="opera" && browserVersion==3)
      return "3.0";
   else if (browserName=="opera" && browserVersion==4)
      return "4.0";
   else if (browserName=="opera" && browserVersion==5)
      return "5.0";
      // If here then not NN or IE or Opera
   else return "Unknown";

}

function getPlatform(){

   //get the Computer operating system

   var platform=navigator.appVersion.toLowerCase();

   if((platform.indexOf("win16")>-1) || (platform.indexOf("windows 3.1")>-1))
      {return "Windows 3.1";}
   if((platform.indexOf("windows 98")>-1) || (platform.indexOf("win98")>-1))
      {return "Windows 98";}
   if((platform.indexOf("windows 95")>-1) || (platform.indexOf("win95")>-1))
      {return "Windows 95";}
   if((platform.indexOf("windows nt")>-1) || (platform.indexOf("winnt")>-1))
      {return "Windows NT";}
   if(platform.indexOf("win 9x 4.90")>-1)
      {return "Windows ME";}
   if(platform.indexOf("windows nt 5.0")>-1)
      {return "Windows 2000";}
   if(platform.indexOf("windows")>-1)
      {return "Windows";}
   if(platform.indexOf("macintosh")>-1)
      {return "Macintosh";}
   if(platform.indexOf("x11")>-1)
      {return "Unix";}
   if(platform.indexOf("unix")>-1)
      {return "Unix";}
   return "Unknown";

}

function isEmailAddr(email) {

   var result = false;

   if (email.length > 3) {
   var theStr = new String(email);
   var index = theStr.indexOf("@");
   if (index > 0) {
      var pindex = theStr.indexOf(".",index);
      if ((pindex > index+1) && (theStr.length > pindex+1))
         result = true;
      }
   }

   return result;

}

/********************************************************
Messages*/

aMsg = new Array (
   "0|Error|You have indicated that you would like a reply to your\nmessage but you have not entered an eMail Address.",
   "1|Notice|You have indicated that you would like us to send you a copy\nof your message but you have not entered an eMail Address.",
   "2|Error|The eMail address you entered appears to be invalid.\nPlease check your entry and try again.",
   "3|Error|You will need to make an entry in the Subject field in order to continue.",
   "4|Error|You will need to make an entry in the Message field in order to continue.",
   "5|Error|There was an error in processing your eMail request.",
   "6|Notice|Your message has been successfully sent to our eMail processing center."
);