<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
  
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
  
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
  
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->

// images to be preloaded to prevent flicker
var tab_images = new Array("productdetail_accessories_on.gif","productdetail_specs_on.gif","productdetail_images_on.gif","productdetail_articles_on.gif");

// preloader loads images into a dummy array so they are cached
for(var i=0; i < tab_images.length; i++ )  {
 var dummy = new Image();
 dummy.src=(tab_images[i]);
 }
 
function show(tab,btn) {
 for(var i=1; i <= 4; i++) { // first hide everything
  document.getElementById("tab" + i).style.display="none"; // set this layer to "none" or off
  document.getElementById("btn" + i).src=document.getElementById("btn" + i).src.replace("_on","_off"); // set this image to off
  }
 document.getElementById(tab).style.display="block"; // set the layer visible
 btn.src=btn.src.replace("_off","_on");    // change the image from off to on
 }



// New product detail template. 
 var cur_lyr;

// images to be preloaded to prevent flicker
var tab_images = new Array("/hostedstore/templates/backscatter/images/tabs_accessories_new.gif","/hostedstore/templates/backscatter/images/tabs_features_new_on.gif","/hostedstore/templates/backscatter/images/tabs_specs_new_on.gif","/hostedstore/templates/backscatter/images/tabs_iteminc_new_on.gif");

// preloader loads images into a dummy array so they are cached
for(var i=0; i < tab_images.length; i++ )  {
 var dummy = new Image();
 dummy.src=(tab_images[i]);
 }

function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "block";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
}

function getElemRefs(id) {
 var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
 if (el) el.css = (el.style)? el.style: el;
 return el;
}

function setSrc(g) {
 var x=document.images
 if (g==0)
  x["acc"].src="/hostedstore/templates/backscatter/images/tab_options_up.gif";
  else
   x["acc"].src="/hostedstore/templates/backscatter/images/tab_options_dwn.gif";
 if (g==1)
  x["fea"].src="/hostedstore/templates/backscatter/images/tab_specs_up.gif";
  else 
   x["fea"].src="/hostedstore/templates/backscatter/images/tab_specs_dwn.gif";
 if (g==2)
  x["spe"].src="/hostedstore/templates/backscatter/images/tab_photos_up.gif";
  else
   x["spe"].src="/hostedstore/templates/backscatter/images/tab_photos_dwn.gif";
 if (g==3)
  x["ite"].src="/hostedstore/templates/backscatter/images/tab_articles_up.gif";
  else 
   x["ite"].src="/hostedstore/templates/backscatter/images/tab_articles_dwn.gif";
 }

