// -=-=-=-=-=-=-=-=
var homepagefile = "homepage.html";
var aboutpagefile = "about.html";
var collectionpagefile = "collection.html";
var specspagefile = "specs.html";
var finishpagefile = "finishes.html";
var reppagefile = "rep.html";
var newspagefile = "news.html";
var environmentalpagefile = "environmental.html";
var custompagefile = "custom.html";
var catalogpagefile = "catalog.html";
var shoppagefile = "http://shop.yoma.com";

// build a catalog item URL
function catalogURL(prodselix,iscoord) {
  var querytail =
      ((prodselix >= 0) && (prodselix < Product.length)) ?
        (((window.location.protocol == "http:") ? "?" : "#")
         + "p=" + Product[prodselix].pagetag
         + ((iscoord && (prodix >= 0)) ? ("\&c=" + Product[prodix].pagetag) : "")
        ) : "" ;

   return catalogpagefile + querytail ;
}

// go to a specified product page, either main (false) or coordinate (true)
function gotoProduct(prodselix,iscoord) {

   // got to new page and force reload
   var gotoURL = catalogURL(prodselix,iscoord);
   window.location.href = gotoURL;
   if (window.location.protocol != "http:")
     window.location.reload(false);
}

// build a shop / boutique search URL by item
function shopsearchURL(prodselix) {
  var querytail =
      ((prodselix >= 0) && (prodselix < Product.length)) ?
        ("\/search"
         + ((window.location.protocol == "http:") ? "?" : "#")
         + "q=" +  escape(Product[prodselix].name) 
        ) : "" ;

   return shoppagefile + querytail ;
}

// common page navigation menu builder
var strMenuTag2 = "</span>";
function strMenuTag1(thispage, thatpage) {
  tpmenutag1 = "<span class=\"thispage\">";
  tpmenutag2 = "</span>";
  strMenuTag2 = (thispage == thatpage) ? tpmenutag2 : "</a>";
  return (thispage == thatpage) ? tpmenutag1 : ("<a href=\"" + thatpage + "\"" + ((thatpage.substr(0,7) == "http:\/\/") ? " target=\"_blank\">" : ">"));



}
function showMenu(thispage) {
  document.write( strMenuTag1(thispage,homepagefile) + "Home" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,aboutpagefile) + "About" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,collectionpagefile) + "Collection" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,custompagefile) + "Custom" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,specspagefile) + "Specifications" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,reppagefile) + "Sales &amp; Showrooms" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,newspagefile) + "News" + strMenuTag2
                + "&nbsp;|&nbsp;"
                + strMenuTag1(thispage,shoppagefile) + "Online Boutique" + strMenuTag2);

}


