﻿//hide content area if the page Flash has loaded successfully
if (flashPresent) {
  var contentArea = document.getElementById('ppcontentAreaTop');
  contentArea.style.display = 'none';
  var flashArea = document.getElementById('ppLargeFlashOuterContainer');
  flashArea.style.display = "block";  
}


//set the color of the active tab: 
//RED: 1, Blue: 2, Grey: 3
function activeTabColor(n) {
  var productNavi = document.getElementById('ppproductNavi');
  productNavi.getElementsByTagName('ul')[0].className = 'ppActiveTabColor'+n;
}

//toggle the display of plain text page items in Specifications page
//flag = true shows HTML tech specs
//flag = false shows Flash
function toggleHTMLSpecs(flag) {
  //show HTML content
  if(flag == true) {
    contentArea.style.display = 'block';
    flashArea.style.display = 'none';  
  //hide HTML content and show flash
  } else {
    contentArea.style.display = 'none';
    flashArea.style.display = 'block';  
  }
}

/********************************
 * set the "Buy now" link color *
 ********************************/

//"Buy now" tab should always be the last visible one before the "Compare" tab
//or else the wrong tab will be "painted". Note that there is one dummy <li></li> element
//between "Buy now" and "Compare" tabs
//change the tab color only if "buyNow" variable exists and is set to "true"
if(typeof buyNow != "undefined" && buyNow != undefined && buyNow) {
  var ppNavi = document.getElementById('ppproductNavi');
  var ppNaviLi = ppNavi.getElementsByTagName('li');
  ppNaviLi[ppNaviLi.length-3].className = 'ppBuyNowLink';
}