﻿/* Queue the Site Load Events
===================================================================================== */
//addLoadEvent(initClearInputs);
addLoadEvent(initProductThumbs);
addLoadEvent(initFlashBorders) ;

document.oncontextmenu = function(){return false;};

/* Product Image Functions
===================================================================================== */
var ProductImage;

function initProductThumbs(){
    if (getElementsByClass('ProductImage', null, 'img')[0]) {
        ProductImage = getElementsByClass('ProductImage', null, 'img') ;
        if (ProductImage == '') return ;
        ProductImage = ProductImage[0] ;
          	
        extraThumbs = getElementsByClass('extraThumbs', null, 'div') ;
        if (extraThumbs == '') return ;
        extraThumbs = extraThumbs[0] ;
        
        extraThumbLnk = extraThumbs.getElementsByTagName('a') ;
        for (var i=0; i < extraThumbLnk.length; i++) {
          extraThumbLnk[i].onmouseover = toggle ;
          extraThumbLnk[i].onclick = open ;
        }
      }
}
function toggle() {
  smlImg = getChild(this) ;
  smlSrc = smlImg.src ;
  lrgSrc = smlSrc.substring(0,smlSrc.lastIndexOf('.')) + ".thumb?w=215&h=215";
  ProductImage.src = lrgSrc
}
function open() {
  smlImg = getChild(this) ;
  smlSrc = smlImg.src ;
  lrgSrc = smlSrc.substring(0,smlSrc.lastIndexOf('.')) + ".thumb?w=370&h=500";
  ShowPopup(lrgSrc,lrgSrc,520,400,true);
  return false;
}
function toggleDesc(){
    if (document.getElementById('LongDesc').style.display == 'block'){
        document.getElementById('LongDesc').style.display = 'none';
    }
    else{
        document.getElementById('LongDesc').style.display = 'block';
    }
}
