function checkOut(link,pageid) {
  if(document.shoppingcart.couponWK.value) {
   location.href = link + "?pageID=" + pageid + "&couponWK=" + document.shoppingcart.couponWK.value;
  }
  else {
   location.href = link;
  }
}

function adjust_marginBottom(element, minheight) {
  if ( document.getElementById(element).offsetHeight > minheight ) {
    var margin=15+minheight-document.getElementById(element).offsetHeight;
    while (margin<0) { margin=margin+130; } 
    document.getElementById(element).style.marginBottom=margin+'px';
  }
}

function adjust_paddingBottom(element, minHeight, adjustElement) {
  var elementHeight=document.getElementById(element).offsetHeight;
  if ( elementHeight > minHeight ) {
    var padding=minHeight-elementHeight;
    while(padding<0) { padding=padding+130; } 
    if(elementHeight>220) { padding=padding+15; } 
    //eval(padding);
    if (adjustElement != "") {
      document.getElementById(adjustElement).style.paddingBottom=padding+'px';
    } else {
      document.getElementById(element).style.paddingBottom=padding+'px';
    }
  }
}

function enlarge(url, width, height) {
  options='width='+width+', height='+height;
  options=options+',scrollbars=yes,resizable=yes,toolbar=no';
  win=window.open(url, 'enlarge', options);
  win.focus();
}

function showGift() {
  document.giftAdvisor.action=document.getElementById('chooseGiftCat').options[document.getElementById('chooseGiftCat').selectedIndex].value;
  document.giftAdvisor.submit();
}

function changeOverview(changeURL) {
  var newsAbo = 1;
  if (document.overview.mailingList[0].checked == true) {
      newsAbo = 1;
  } else {
    if (document.overview.mailingList[1].checked == true) { 
      newsAbo = 0;
    }
  }
  window.location.href=changeURL + "&mailingList=" + newsAbo;
}
