<!--

var my_id_is = "";
arrival();

function arrival()
{
  var searchString = "";

  searchString = unescape(location.search.substring(1,location.search.length));
  if (searchString.match(/^([_a-zA-Z0-9]+)$/) != null)
  {
    // Search String is JUST the shop owner's Id
    my_id_is = searchString;
    // alert("in arrival - my_id_is: " + my_id_is);
  }
  else if (searchString.match(/^([_a-zA-Z0-9]+)\&.*$/) != null)
  {
    // Search String is JUST the shop owner's Id
    my_id_is = RegExp.$1;
    // alert("in arrival - my_id_is: " + my_id_is);
  }
  else // Unexpected search string
  {
    my_id_is = "tyh";
  }
}

function idemo(whereto)
{
  location.href = whereto + "?" + my_id_is;
}

function goto(whereto)
{
  location.href = whereto + "?" + my_id_is;
}

//function idemoup1(directory,filename)
//{
//  location.href = "../" + directory + "/" + filename + ".html?" + my_id_is;
//}

function addToBasket(desc,code,price,ship,units)
{
  var resume = window.location.href;
  
  // There were problems calling shopping basket when the basketReturn string contained 
  // a QuestionMark, ie when the value within the query string itself contained
  // a query string. Here we remove it, as the shop Id is already passed to the shopping
  // basket in the "shop" parameter.
  var indexQueryString = resume.indexOf("?");
  if (indexQueryString > -1)
  {
    resume = resume.substring(0,indexQueryString);
  }
  
//  alert(resume);
  
  window.location='http://www.treasureyourhealth.com/cgi-bin/tyhcouk-cart.cgi?actiontype=add&amp;quantity=1&amp;productdesc='+desc+'&amp;productid='+code+'&amp;productprice='+price+'&amp;productship='+ship+'&amp;productunits='+units+'&amp;shop='+my_id_is+'&amp;basketReturn='+resume;
}

function viewBasket()
{
  var resume = window.location.href;
  
  // There were problems calling shopping basket when the basketReturn string contained 
  // a QuestionMark, ie when the value within the query string itself contained
  // a query string. Here we remove it, as the shop Id is already passed to the shopping
  // basket in the "shop" parameter.
  var indexQueryString = resume.indexOf("?");
  if (indexQueryString > -1)
  {
    resume = resume.substring(0,indexQueryString);
  }

  window.location='http://www.treasureyourhealth.com/cgi-bin/tyhcouk-cart.cgi?actiontype=view&amp;shop='+my_id_is+'&amp;basketReturn='+resume;;
}

var prodPrice =0;
var prodDesc = "";
var prodPrice = "";
var prodShip = "";
var prodUnits = 0;

function verifyOrder()
{
  var selectValue = 0;
  
  if (document.buyform.prodCount != null) 
  {
    selectValue = Math.abs(document.buyform.prodCount.value);
  }
  
  if (selectValue == 0)
  {
    alert("I'm sorry, there appears to be a problem. Please call our Helpline - 0115 840 7521 and we will take your order by phone.");
    return false;
  }
  else
  {
    prodPrice = product_price[selectValue];
    prodCode = "" + product_code + selectValue;
    prodDesc = product_description[selectValue];
    prodShip = product_ship_method;
    prodUnits = product_ship_units[selectValue];
  }
 
  return true;
}

function navBar(level,showit)
{
  var category = new Array (
  //"<b>Herbal<br>Supplements: A - G</b>","<b>Herbal<br>Supplements: H - Z</b>","<b>Vitamins &amp;<br>Minerals</b>",
  "<b>Vitamins, Minerals,<br>Herbs, Nutrients</b>","<b>100% Pure<br>Organic Juices</b>","<b>Pure Organic<br>Fruit Concentrates</b>","<b>Blended<br>Fruit Juices</b>","<b>Fruit Extract<br>Capsules</b>","<b>Essential Oils<br>SkinKind Skin Care</b>","<b>Caring for<br>Your Pets</b>","<b>TENS<br>Pain Relief</b>");
  var categoryLink = new Array ("herbal-supplements/index.html","vitamins-supplements/index.html","minerals-supplements/index.html","platinumrangepureorganicjuice/index.html","premiumrangepurefruitconcentrates/index.html","fruitfusionrangejuiceblends/index.html","ultimaterangefruitextractcapsules/index.html","skincarerange/index.html","petsupplements/index.html","medicaldevices/index.html");
  
  var product = new Array (
  //"5-HTP","Advanced Bone Formula","Artichoke","CLA","Collagen","Co-enzyme Q10",
  "Acidophilus, 2 Billion","Acidophilus, 5 Billion","Essiac Tincture",
  //"Evening Primrose Oil","Flaxseed Oil",
  "Flexwize","Gerovital H3",
  //"Ginkgo Biloba","Ginseng (Korean)","Glucosamine HCl<br>(Vegetarian)","Glucosamine +<br>Chondroitin","Green Tea",
  //null,
  //"Hair, Skin<br>&amp; Nails","Kelp","Lecithin","Lutein","Lycopene",
  "MenoGlow",
  "MultiVitamins<br>&amp; Minerals",
  //"Omega 3","Omega 3+6+9","Peppermint","Rosehip","Sage",
  "Saw Palmetto",
  //"Turmeric",
  //null,
  //"Iron","Magnesium",
  //"Selenium","Vitamin B<br>Complex","Vitamin C",
  "Vitamin D3",
  //"Vitamin E","Zinc",
  null,
  "Acai Berry","Goji Berry","Mangosteen","Noni",null,
  "Black Cherry","Black Elderberry","Blueberry","Cranberry","Pomegranate",null,
  "Acai Berry","Aloe Vera","Goji Berry","Mangosteen","Noni","Noni for Men","Noni for Women",null,
  "Acai Berry Extract","Aloe Vera Extract","Cranberry Extract","Goji Berry Extract","Mangosteen Extract","Noni Extract","Pomegranate Extract",null,
  "SkinKind Deep Skin<br>Cleanser","SkinKind Unique Deep<br>Skin Moisturiser","SkinKind Moisturiser<br>for Eczema",null,
  "Flexwize for Pets<br>(Liquid Glucosamine)",null,  
  "Pain Away Pen",null);
  var productLink = new Array (
  //"5-HTP/5-HTP-capsules.html","healthy-bones-supplement/advanced-bone-formula.html","artichoke-supplement/artichoke.html","CLA-supplement/cla-conjugated-linoleic-acid.html","collagen-joint-care/type-2-hydrolysed-marine-collagen.html","co-enzyme-q10/co-enzyme-q10-benefits.html",
  "lactobacillus-acidophilus/acidophilus-probiotic.html","acidophilus-probiotic-prebiotic/acidophilus-probiotic-prebiotic.html","cancer-essiac/essiactincture.html",
  //"evening-primrose-oil/evening-primrose-oil-benefits.html","flaxseed-oil/flaxseed-oil-organic-cold-pressed.html",
  "liquid-glucosamine-complex/flexwize.html","gerovital/gh3-tablets.html",
  //"ginkgo-biloba/ginkgo-biloba-benefits.html","korean-ginseng/korean-ginseng-benefits.html","glucosamine-vegetarian/glucosamine-hcl-vegetarian.html","glucosamine-chondroitin/glucosamine-chondroitin-benefits.html","green-tea/grean-tea-benefits.html",null,
  //"hair-skin-and-nails/hair-skin-and-nails-supplement.html","kelp-iodine/kelp-iodine-benefits.html","lecithin/lecithin-benefits.html","lutein-zeaxanthin/lutein-and-zeaxanthin-for-eyes.html","lycopene/lycopene-supplement.html",
  "herbal-hrt-for-menopause/menoglow.html","multivitamins-and-minerals/multivitamins-and-minerals-benefits.html",
  //"omega-3-fish-oils/omega-3-fish-oils-epa-dha.html","omega-3-6-9/omega-3-6-9-healthy-heart.html","peppermint-oil/pepermint-oil-capsules.html","rosehip-rheumatoid-arthritis/rosehip-joint-care.html","sage-remedy-menopause/sage-rosemarinic-acid.html",
  "sawpalmetto/saw-palmetto.html",
  //"turmeric-curcumin/tumeric-curcumin-benefits.html",null,
  //"iron-tablets/iron-citrate-tablets.html","magnesium-citrate/magnesium-citrate-benefits.html","selenium/selenium-supplement-benefits.html","vitamin-b-complex/vitamin-b-supplements.html","vitamin-c-rosehip-acerola-flavanoids/vitamin-c-orange-chewable-1000mg-tablets.html",
  "sunshine-vitamin/vitamind3.html",
  //"vitamin-e/natural-vitamin-e-d-alpha-tocopherol.html","zinc-gluconate/zinc-tablets.html",
  null,
  "acaiberrypure/pureorganicacaiberryjuice.html","gojiberrypure/pureorganicgojiberryjuice.html","mangosteenpure/pureorganicmangosteenjuice.html","nonipure/pureorganicnonijuice.html",null,
  "blackcherry/pureconcentratedblackcherryjuice.html","blackelderberry/pureconcentratedblackelderberryjuice.html","blueberry/pureconcentratedblueberryjuice.html","cranberry/pureconcentratedcranberryjuice.html","pomegranate/pureconcentratedpomegranatejuice.html",null,
  "acaiberry/acaiberryjuiceblend.html","aloevera/wholeleafaloeverajuice.html","gojiberry/gojiberryjuiceblend.html","mangosteen/mangosteenjuiceblend.html","noni/organicnonijuice.html","nonimen/organicnonijuiceformen.html","noniwomen/organicnonijuiceforwomen.html",null,
  "acaiberrycapsules/acaiberryextract.html","aloeveracapsules/aloeveraextract.html","cranberrycapsules/cranberryextract.html","gojiberrycapsules/gojiberryextract.html","mangosteencapsules/mangosteenextract.html","nonicapsules/noniextract.html","pomegranatecapsules/pomegranateextract.html",null,
  "skinkind-deep-skin-cleanser/index.html","skinkind-unique-deep-skin-moisturiser/index.html","skinkind-eczema-deep-skin-moisturiser/index.html",null,
  "flexwize-for-pets/arthritis-cats-dogs-liquid-glucosamine.html",null,
  "painawaytenspainreliefpen/painaway.html",null);

  var directory = "";
  var cat = 0;
  var prod = 0;
  
  if (level == 2)
  {
    directory = "../";
  }
  
  document.write('<ul class="level1"><li class="submenu dropdown"><a href="' + directory + 'sitemap.html?' + my_id_is + '">Find A Supplement</a>');
  
  if (showit == true)
  {
    document.write('<ul class="level2 showit">');
  }
  else
  {
    document.write('<ul class="level2">');
  }
  
  for (cat=0;cat < category.length;cat++)
  {
    // write the category entry
    document.write('<li class="submenu"><a href="' + directory + categoryLink[cat] + '?' + my_id_is + '">' + category[cat] + '</a><ul class="level3">');
    
    // write the product entries for this category
    while (product[prod] != null)
    {
      document.write('<li><a href="' + directory + productLink[prod] + '?' + my_id_is + '">' + product[prod] + '</a></li>');
      prod++;
    }
    
    document.write('</ul></li>'); // terminate product list and category
    prod++; // Move past null, which marks the end of the products in this category
  }

  document.write('</ul></li>'); // terminate category list
  
  // Complete the menu bar
  // Add: <li><a href="' + directory + 'affiliates/index.html">Affiliates</a></li>
  document.write('<li><a href="' + directory + 'index.html?' + my_id_is + '">Home</a></li><li><a href="' + directory + 'sitemap.html?' + my_id_is + '">Site Map</a></li><li><a href="' + directory + 'contactus.html?' + my_id_is + '">Contact Us</a></li><li><a href="' + directory + 'delivery.html?' + my_id_is + '">Delivery</a></li><li><a href="' + directory + 'affiliates/index.html?' + my_id_is + '">Affiliates</a></li><li id="mybasket"><a href="javascript:viewBasket();"><img src="' + directory + 'pics/basket_view_inv.gif" width="28" height="19" alt="View my Shopping Basket"></a></li></ul>');
}

function tyhfooter ()
{
  document.write('<table class="footer"><tr class="disclaimer"><td colspan="3"><b>The contents of this site are for information purposes only.</b><br>The information presented within this site is not intended to diagnose illness or prescribe treatment.<br>Always consult a medically qualified practitioner before starting a course of<br>supplements and before making any change to prescribed medication.</td></tr><tr class="contactdetails"><td colspan="3">Treasure Your Health Ltd &nbsp; 7 Buckingham Road &nbsp; Woodthorpe &nbsp; Nottingham &nbsp; NG5 4GE &nbsp; United Kingdom<br><b>E:</b> sales @ treasureyourhealth.co.uk &nbsp; <b>W:</b> www.TreasureYourHealth.co.uk &nbsp; <b>T:</b> 0800 051 8388</td></tr><tr class="copyright"><td colspan="3">&copy; Copyright 2012 Treasure Your Health Limited. All Rights Reserved.</td></tr></table>');
}
//-->

