// Required prototype.js
linkHoverTimeout=null;
function linkHover(id) {
  if ($(id+'-hover')) {
    $(id).observe('mouseover', function(e) { $(Event.element(e).id+'-hover').style.display='block'; clearTimeout(linkHoverTimeout) });
    $(id+'-hover').observe('mouseover', function(e) { clearTimeout(linkHoverTimeout) });
    $(id).observe('mouseout', function(e) { linkHoverTimeout=setTimeout(function(){$(Event.element(e).id+'-hover').style.display='none';},600); });
    $(id+'-hover').observe('mouseout', function(e) { linkHoverTimeout=setTimeout(function(){ $('addtocart-hover').style.display='none';},600); });
  }
}

function fetchSelectedDimension(name)
{
  return $$('input:checked[type="radio"][name="'+name+'"]').pluck('value');
}

function cartAddFromProductPage(name,code,sizeoption,qtyEl,thumb)
{
  sizeString = new String(sizeoption);
  var size = sizeString.match(/^(.+)\~(.+)$/)[1];
  var price = sizeString.match(/^(.+)\~(.+)$/)[2];
  var qty = qtyEl.value;

  return cartAddItem(name,price,code,size,qty,thumb);
}



