/**
 * Отображение для группы без подгрупп
 */
function  CatalogPreview(){

	var _this  =  this;
	
	$("body").ready(function(){
		$("a.info").mouseenter(function(){
			$("a.info").css('text-decoration', 'none');
			$(this).css('text-decoration', 'underline');
			var span  =  this;
			$('#previewGroups').slideUp(
				'fast',
				function(){
					_this.load(span.id, _this);
				}
			);
		});
		
		$("a.info:first").mouseenter();
	});
}


/**
 * Загружаем данные по группе
 */
CatalogPreview.prototype.load  =  function(id, object){
	$.ajax({
		url:"/group/getInfoGroup/",
		dataType:"html",
		data: {groupId:id},
		success:function(data){
			object.show(data);
		},
		
		error:function(data){
			alert('failed');
		}
	})
	

}


/**
 * Показываем данные
 */
CatalogPreview.prototype.show  =  function(html){
	$("#previewGroups").html(html);
	$("#previewGroups").slideDown('fast');
}


var  catalogPrev  =  new  CatalogPreview();
