var external =
{
  init: function()
  {
    //select change filter
    if($('order_acts_by'))
    {
      $('order_acts_by').observe('change', function()
      {
        window.location = url + 'genre/' + this.value;
      });
    }
  
    //external links redirect
    $$('a[rel=external]').each(function(el)
    {
      if(el.rel=='external')
      {
        el.target = '_blank';
      }
      
      /*
      el.observe('click', function(e)
      {
        e.stop(e);
        var newWindow = window.open(this.href, 'test', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');
        newWindow.focus();
      });
      */
      
    });
   }
}

//on dom loaded
document.observe('dom:loaded', function() { external.init(); }, false);
