var _bajan_lock = true;
var _bajan_timer = null;
var _bajan_actid = '';
$(function(){
	$('.bajan td').addClass('narrow').each(function(){
		var id = 'sl' + Math.round(Math.random() * 10000);
		this.id=id;
		$('#'+id).mousemove(function(){
			act(id)
		});
	});
	$('.bajan td:last').removeClass('narrow').addClass('wide');
	$('.narrow div.ws').hide();
	$('.wide div.ns').hide();
	_bajan_lock = false;
});
function _bajan_doit(aid){
	_bajan_lock = true;
	var wid = '#' + $('.wide').eq(0).attr('id');
	var id = '#' + aid;
	function f1(){
		$(id).animate({width:'500px'},400);
		$(wid+' .ns').fadeIn(600);
		$(id+' .ws').fadeIn(600,function(){_bajan_lock=false;});
	}
	$(wid).css('width',"").addClass('narrow').removeClass('wide');
	$(id).addClass('wide').removeClass('narrow');
	$(wid+' .ws').fadeOut(200);
	$(id+' .ns').fadeOut(200,f1);
}
function act(aid){
	if (_bajan_lock){return false;}
	if($("#"+aid).hasClass('wide')){clearTimeout(_bajan_timer);_bajan_actid='';return false;}
	else
	{
		if (_bajan_actid != aid) {
			_bajan_actid = aid;
			clearTimeout(_bajan_timer);
			_bajan_timer = setTimeout(function(){
				_bajan_doit(aid);
			}, 300);
		}
	}
}