/* Bonogoo Engine by Hanno Stehling
 * --------------------------------
 *
 * create product links in story editor
 *
 */



var rating_openclose_img_path;



function rating_openclose_init(path)
{
  var obj;

  rating_openclose_img_path = path;

  obj = document.getElementById('product_ratings');
  if(obj) obj.style.display = 'none';
  obj = document.getElementById('label_ratings');
  if(obj) obj.style.display = 'none';
  obj = document.getElementById('link_product_ratings');
  if(obj) obj.onclick = function() { rating_openclose('product'); return false };
  obj = document.getElementById('link_label_ratings');
  if(obj) obj.onclick = function() { rating_openclose('label'); return false };
}



function rating_openclose(mode)
{
  var obj;
  var img;

  obj = document.getElementById(mode + '_ratings');
  img = document.getElementById('link_' + mode + '_ratings_img');
  if(obj.style.display == 'none')
  {
    obj.style.display = 'block';
    img.src = rating_openclose_img_path + 'arrow_down.png';
  }
  else
  {
    obj.style.display = 'none';
    img.src = rating_openclose_img_path + 'arrow_right.png';
  }
}
