
  /* ---------------------------------------------------------------------------

    Copyright (C) 2009   Vintage Media Ltd   www.vintagewebworks.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 3 as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    A copy of the GNU General Public License is included in the 'docs' folder
    and online at: http://www.gnu.org/licenses/gpl.txt

  --------------------------------------------------------------------------- */


  /*

    SCRIPT INFO:
    ************

    Description:   General javascripts to be loaded for every website page
    Revision No:   001
    Created:       01 Jan 2009
    Last updated:  01 Jan 2009
    Author:        Vintage Web Works - www.vintagewebworks.com
    Help:          www.typepublish.org/v1/manual

  */


  window.addEvent('domready', function() {

    //
    // Add fade-on-hover effect to all links and buttons
    //

   /* $each($$('a'), function(el) {
      var el_class = el.getProperty('class');
      if (!el_class.match('selected')) { // If class contains 'selected' it should not have the fade-effect applied
        el.setStyle('opacity', '0.7');
        var morph = new Fx.Morph(el,{ 'duration':'300', link:'cancel' });
        el.addEvents({
          'mouseenter' : function() { morph.start({ 'opacity':'1' }) },
          'mouseleave' : function() { morph.start({ 'opacity': '0.8' }) }
        });
      }
      else {
        // For selected elements you can vary the fade:
        el.setStyle('opacity', '0.7');
        var morph = new Fx.Morph(el,{ 'duration':'300', link:'cancel' });
        el.addEvents({
          'mouseenter' : function() { morph.start({ 'opacity':'1' }) },
          'mouseleave' : function() { morph.start({ 'opacity': '0.7' }) }
        });
      }
    });
    */
    $each($$('button'), function(el) {
      el.setStyle('opacity', '0.7');
      var morph = new Fx.Morph(el,{ 'duration':'300', link:'cancel' });
      el.addEvents({
        'mouseenter' : function() { morph.start({ 'opacity':'1' }) },
        'mouseleave' : function() { morph.start({ 'opacity': '0.7' }) }
      });
    });
    // Logo:
    //$each($$('#logo'), function(el) {
    //  el.setStyle('opacity', '0.9');
    //  var morph = new Fx.Morph(el,{ 'duration':'300', link:'cancel' });
    //  el.addEvents({
    //    'mouseenter' : function() { morph.start({ 'opacity':'1' }) },
    //    'mouseleave' : function() { morph.start({ 'opacity': '0.9' }) }
    //  });
    //});

  });
