﻿var selectionMade = false;

function newWindow(galleryjpg, showPhoto) {
  if (showPhoto) {
    width = "700";
  } else {
    width = "330";
  }
  galleryWindow = window.open(galleryjpg, "galleryWin", "scrollbars=yes,width=" + width + ",height=390");
  galleryWindow.focus();
}

function somethingSelected() {

  bsktCount = document.getElementById('basketCount');
  bsktInfo = document.getElementById('basketInfo');

  if (bsktCount) {
    if (document.all) { // IE and Firefox do this differently!
      i = new Number(bsktCount.innerText);
      bsktCount.innerText = i + 1;
    } else { //for FF
      i = new Number(bsktCount.textContent);
      bsktCount.textContent = i + 1;
    }
  } else if (bsktInfo) {
    bsktInfo.innerHTML = "You have <span id='basketCount'>1<\/span> item in your basket." +
                         " <input type='hidden' name='clear' id='clear'\/><a href='javascript:clearBasket();'>[clear]<\/a>" +
                         " <a href='basket.php'>[checkout]<\/a>";
  }

}

function clearBasket() {
  document.forms[0].clear.value="clear";
  document.forms[0].submit();
}
