var ImpactBoxes = new Class({
    Implements: [Events, Options],
    options: {
	onComplete: $empty,
	timer:0
    },
    initialize: function(boxes, options) {
	this.setOptions(options);
	this.boxes = $$(boxes);
	this.showboxes();
    },
    showboxes: function() {
	var thisc = this;
	timer = this.options.timer;
	this.boxes.each(function(box, i) {
	    box.setStyles({'opacity':0, 'display':'block'});
	    if(box.getElement('img')) {
		box.addEvents({
		    'mouseover':function() {
			this.set('tween', {
			    duration: 200,
			    fps: 25
			}).tween('opacity', 1, 0.5);
		    },
		    'mouseout':function() {
			this.set('tween', {
			    duration: 200,
			    fps: 25
			}).tween('opacity', 0.5, 1);
		    }
		});
	    }
	    (function() {
		box.set('tween', {
		    duration: 200,
		    fps: 25
		}).tween('opacity', 0, 1);
	    }).delay(timer);
	    timer += 35;
	});
	$$('div.smbox img').each(function(box, i) {
	    box.setStyle('opacity', 0);
	    (function() {
		box.set('tween', {
		    duration: 800,
		    fps: 25
		}).tween('opacity', 0, 1);
	    }).delay(timer);
	    timer += 70;
	});
	var myTips = new Tips('.mytip');
	$('workcont').setStyle('background', 'none');
	//(function() { this.fireEvent('onComplete');}).bind(this).delay(timer);
    }
});
