$ = jQuery;
IE6 = /msie|MSIE 6/.test(navigator.userAgent);

$(document).ready(function(){

var body = $('body');
var pop = body.find('.pop');
var list = body.find('.list');

body.click(function(e){
	if($(e.target).hasClass('list')){
		pop.show();
		list.addClass('black');
		return false;
	}
	list.removeClass('black');
	pop.hide();
});



if(body.hasClass('egia')){
var i = 0, t = 2000, op = {opacity: 1, height: "250px"};
	function dd(){
		 
		i++;	
		if(i == 5){
			i = 0;
			$("#a5").animate(op,t,function(){ $("div").removeAttr("style"); dd();	});
			
		} else {
			$("#a"+i).animate(op,t,function(){	dd();	});
		}
	}

	dd();
}


if(body.hasClass('guerbe')){

	var all = $('#all');
	var sc = $('#sc');
	
	all.find('a').click(function(){
	
		var t = $(this);
		
		if(t.hasClass('cur')) return false;
		
		
		
		var n = sc.find('img[rel='+t.attr('rel')+']');
		
		sc.find('img').not(n).fadeOut();
		n.fadeIn();
		
		all.find('.cur').add(t).toggleClass('cur');
		
		
	
		return false;
	
	
	});
}


});



