﻿ window.addEvent('domready', function() {
     //store titles and text  
     $$('a.tips').each(function(element,index) {  
         var content = element.get('title').split('::');  
         element.store('tip:title', content[0]);  
         element.store('tip:text', content[1]);  
     });  
     //create the tooltips    
     var tipz = new Tips('.tips', {  
         className: 'tip',  
         fixed: true,  
         hideDelay: 50,  
         showDelay: 50,
         offsets: {'x': 26, 'y': 26},
         fixed: false
     }); 
    tipz.addEvents({  
        'show': function(tip) {  
            tip.fade('in');  
        },  
        'hide': function(tip) {  
            tip.fade('out');  
        }  
    });  

           SqueezeBox.assign($$('a.boxed'), {
             parse: 'rel'
            });
            thumbs = new thumbsEffect();
        });

        

        var thumbsEffect = new Class({
            td_array: [],
            initialize: function() {
                //get all td inside our table
            this.td_array = $$('#thumbs div');
                this.td_array.each(function(div) {
                div.addEvent('mouseover', this.table_colorize.pass(div, this));
                div.addEvent('mouseout', this.table_normalize.pass(div, this));
                }, this);
            },

            table_colorize: function(td_hover) {
                this.td_array.each(
		function(div) {
                 div == td_hover ? div.setProperty('class', 'thumbNail-hover') : div.setProperty('class', 'thumbNail');
              // div.set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeOut }).tween('height', '150px'); // this works
		}
		);
            },

            table_normalize: function(td) {
                this.td_array.each(
			function(div) {
                div.setProperty('class', 'thumbNail');
               // div.set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeIn }).tween('height', '60px'); // this works
			}
		);
            }

        });

