
function getOffsetHeight() {
    
    var contentHeight = document.getElementById('container').offsetHeight
    document.getElementById('left').style.height = contentHeight+"px";
    
    if(document.getElementById('content')) {
        document.getElementById('content').style.height = contentHeight+"px";
    }
    
    if(document.getElementById('content2cols')) {
        document.getElementById('content2cols').style.height = contentHeight+"px";
    }
    
    document.getElementById('right').style.height = contentHeight+"px";
    
}

function checkform() {
  return true;
}

function changeGallery(path) {
    window.location.assign(path);
}

function addToBasket(url,reload,id) {
    
    /* get quantity */
    for(i=0; i<document.basketoverviewform.elements.length; i++) {
        if(document.basketoverviewform.elements[i].name=="quantity_"+id) {
            var quantity = document.basketoverviewform.elements[i].value;
        }
        if(document.basketoverviewform.elements[i].name=="colors_"+id) {
            var color = document.basketoverviewform.elements[i].value;
        }
        if(document.basketoverviewform.elements[i].name=="manufacture_"+id) {
            var manufacture = document.basketoverviewform.elements[i].value;
        }
    }
    
    new Ajax.Request(url+'?quantity='+quantity+'&color='+color+'&manufacture='+manufacture, {
      onComplete: function(transport) {
          if (200 == transport.status) {
              setTimeout("document.location.reload();",600);
          }
      }
    });
}

function changeBasket(url,reload,id,action, color, manufacture) {
    new Ajax.Request(url+'?id='+id+'&action='+action+'&color='+color+'&manufacture='+manufacture, {
      onComplete: function(transport) {
          if (200 == transport.status) {
              setTimeout("document.location.reload();",600);
          }
      }
    });
}



function changeDisplayColor(articleid, colorid, firstcolor) {
    
    var oDiv = document.getElementById('articleColorId_'+articleid);
    if(oDiv.firstChild) { // check for children
       var oChild = oDiv.firstChild;
       while(oChild) { // run over them
         if(oChild.nodeType==1) { // element
           oChild.setAttribute("className", "articleColorInvisible");
           oChild.setAttribute("class", "articleColorInvisible");
           // oChild is a first level child of oDiv
           // Do what you want with it here
         }
         oChild = oChild.nextSibling;
       }
    }
    
    document.getElementById("articleColorId_"+articleid+"_"+colorid).setAttribute("className", "articleColorVisible");
    document.getElementById("articleColorId_"+articleid+"_"+colorid).setAttribute("class", "articleColorVisible");
    
    /*
    if(activeColor == 0) {
        document.getElementById(firstcolor).style.display = 'none';
    } else {
        document.getElementById(activeColor).style.display = 'none';
    }
    
    activeColor = "articleColorId_"+articleid+"_"+colorid;
    activeArticle = articleid;
    
    document.getElementById("articleColorId_"+articleid+"_"+colorid).style.display = 'inherit';
    */
}
