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

	/* fade-in the thumbs on load */
	thumbs = $$('.thumb img');
	thumbs.each(function(element) {
	
		var loadfx = new Fx.Styles(element, {duration:400, wait:false});

		// loadfx.set({
		// 	opacity:0,
		// });
		
		
		element.addEvent('load', function(){
			loadfx.start({
				opacity:[0.5, 1.0],
			}).chain(function() {
				this.start({
					opacity:[1.0, 0.7]
				})
			});
		});

		// mouseover fade of opacity
		element.addEvent('mouseenter', function(){
			loadfx.start({
				opacity:1,
			});
		});
		element.addEvent('mouseleave', function(){
			loadfx.start({
				opacity:0.7,
			});
		});
	
		// element.addEvent('mouseleave', function(){
		// 	fx.start({
		// 		'margin-top': 0,
		// 		'background-color': '#333',
		// 		'color': '#888'
		// 	});
		// });
	
	});


	links = $$('#sidebar div.item a.title, #sidebar a[title]');
	links.each(function(element) {
		var hoverfx = new Fx.Styles(element, {duration:300, wait:false});
		
		element.addEvent('mouseenter', function(){
			hoverfx.start({
				'color': '#CCCC99',
			});
		});

		element.addEvent('mouseleave', function(){
			hoverfx.start({
				'color': '#CC9999',
			});
		});
	});
	

	
	items = $$('#sidebar #siteswelove li, #sidebar div.item');
	items.each(function(el) {
		var hoverfx = new Fx.Styles(el, {duration:200, wait:false});
		
		el.addEvent('mouseenter', function(){
			hoverfx.start({
				'margin-left': '5px',
				// 'font-size':'24px'
			});
		});

		el.addEvent('mouseleave', function(){
			hoverfx.start({
				'margin-left': '0px',
			});
		});
	});
	
	
	/* Tips 1 */
	thumblinks = $$('.thumb a, #sidebar a.title, #sidebar a[title]');
	Tips2 = new Tips(thumblinks, {
		maxTitleChars:50,
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 400, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});
});

//window.onError = function() {alert('error')};


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



	thumbs = $$('.thumb img');
	thumbs.each(function(element) {
	
		var loadfx = new Fx.Styles(element, {duration:400, wait:false});
		loadfx.set({ opacity:0.8 });
	
		// element.addEvent('mouseleave', function(){
		// 	fx.start({
		// 		'margin-top': 0,
		// 		'background-color': '#333',
		// 		'color': '#888'
		// 	});
		// });
		
	});


});