/*
 * Javascript function runSLShow()
 * 
 * Shifts the 
 *
 */ 

function runSLShow()
{
   objImg = document.getElementById('prod_img');
   objImg.src = preLoad[j].src;
   objRef = document.getElementById('prod_id');
   objRef.href = Pic[j][0];
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSLShow()', speed);
}

function toggleDisplay(objId) {
  obj = document.getElementById(objId);
  if(obj.style.display == 'block') {
    obj.style.display = 'none';
  }
  else {
    obj.style.display = 'block';
  }
}

function popup(popupHTML, popupWidth, popupHeight) {
  popupWindow = window.open('', 'width='+popupWidth+',height='+popupHeight);
  popupWindow.document.write(popupHTML);
  popupWindow.document.close();
}

function productPopup(imgsrc, title, popupWidth, popupHeight) {
  var html;
  html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n'
         + '<html>\n'
         + '<head>\n'
         + '<title>' + title + '</title>\n'
         + '</head>\n'
         + '<body style="margin: 0; width: ' + popupWidth + 'px; height: ' + popupHeight + 'px"><table cellspacing="0" cellpadding="0" style="width: 100%; height: 100%"><tr><td valign="middle" align="center">\n'
         + '<img style="border: 1px solid black" src="' + imgsrc + '" alt="Product Photo" />\n'
         + '</td></tr></table></body>\n'
         + '</html>\n';
  popup(html, popupWidth, popupHeight);
}

function legalPopup(url) {
  popupWindow = window.open(url, '', 'width=400,height=500,resizable,scrollbars');
}

function photoPopup(url, popupWidth, popupHeight) {
  productImage = window.open(url, '', 'width='+popupWidth+',height='+popupHeight);
}