// JavaScript Document

var Site = 
{
	init: function() {
		if ( $('ana') )    Ana.parseCerceve();
	}
};

var Ana = 
{

	parseCerceve: function(){
		var cerceve = $$('#ana .kare');
		var fx = new Fx.Elements(cerceve, {wait: false, duration: 600, transition: Fx.Transitions.elasticOut});
		cerceve.each(function(ana, i)
		{
			ana.addEvent('mouseover', function(e)
			{
				e = new Event(e).stop();
				var obj = {};
				obj[i] = { 'width': [ana.getStyle('width').toInt(), 350] };

				cerceve.each(function(other, j)
				{
					if (other != ana)
					{
						var w = other.getStyle('width').toInt();
						if (w != 165) obj[j] = {'width': [w, 165]};
					}
				});
				fx.start(obj);
			});
		});

		document.addEvent('mouseover', function(e){
			e = new Event(e);
			var rel = e.relatedTarget;
			if (!rel) return;
			if (rel.hasClass && (rel.hasClass('cerceve') || rel.hasClass('kare') || rel.id == 'ana')){
				var obj = {};
				cerceve.each(function(other, j){
					obj[j] = {'width': [other.getStyle('width').toInt(), 210]};
				});
				fx.start(obj);
			};
		});
	}
};

window.onDomReady(Site.init);