


//images mouseover and mouseout
window.addEvent('load',function(){
	//images mouseover
	$$('img.mouseover').each(function(img) {
		var src = img.getProperty('src');
		var extension = src.substring(src.lastIndexOf('.'),src.length)
		img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_over' + extension)); });
		img.addEvent('mouseleave', function() { img.setProperty('src',src); });
	});
	
	$$('a.mouseover').each(function(el) {
		
		//over selected link
		el.addEvent('click',function(e) {
			//clear
			$$('a.mouseover').each(function(ele){
				ele.removeClass('over');
			});
			el.addClass('over');
		});
	});

	//subpages loading
	subpages = new SlidingTabs('buttons', 'pages');
	window.addEvent('resize', subpages.recalcWidths.bind(subpages));
	
	
	
	//tips
	var tips = new Tips($$('.tips'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
	

		


	
});

	
	
	

});




//foreach fo IE
if (!Array.prototype.forEach)
{
    Array.prototype.forEach = function (closure)
    {
        var context = arguments[1] || null;
        for (var i = 0; i < this.length; i ++)
        {
            arguments[0].call(context, this[i], i, this);
        }
    }
}



