/* AJAX and Javascript js file moneydeals - produced by bytepark GmbH - ts */

function mdImageUpload(fi)
{
  if (fi.value != '')
  {
    Element.show('md_indicator');
    Element.hide('md_userphoto');
    fi.form.submit();
  }
}

function mdUpdateNewOfferLink(s)
{
  if (s.value != '' ) $('link').value = suppliers[s.value];
  else $('link').value = 'http://';
}

function mdRateOffer(rating, hash)
{
  if (rating > 0 && rating < 6)
  {
    var rateContainer = $('offer_rate_value_'+hash);
    rateContainer.value = rating;
    var currentLi = $('current-rating_'+hash);
    currentLi.style.width = 20*rating+'%';
  }
}

function mdToggle(id)
{
  elem = $(id);
  if (elem.style.display == 'none')
  {
    Element.show(elem);
  }
  else
  {
    Element.hide(elem);
  }
}
