$(function(){
// спойлер
//
$('#partners .color').mouseenter(function(){
	$(this).animate({opacity:1.0},200);
}).mouseleave(function(){
	$(this).animate({opacity:0.0},200);
});
//
$('.spoilerhead').click(function(){
	var el=$(this);
	var text=$(this).attr('title');
	$('.spoilercontent[name="'+$(this).attr('name')+'"]').slideToggle(function(){
		var state=$('.spoilercontent[name="'+$(el).attr('name')+'"]').css('display');
		var newhtml=state=='none'?text:'Скрыть';
		$(el).html(newhtml);
	
	});
	return false;
});
//
setTimeout(function(){
	$('#sloganecrb').animate({opacity:1.0},700);
},700);
//
SLOGAN=new Array('СРО Строителей нефтяной отрасли Северо-Запада','СРО Проектировщиков нефтяной отрасли Северо-Запада');
function slogan(n){
	$('.slogan').animate({
		opacity:0.0
	},200,function(){
		$('.slogan').text(SLOGAN[n]);
		$('.slogan').animate({
			opacity:1.0
		},400,function(){
			n=(n+1)<SLOGAN.length?n+1:0;
			setTimeout(function(){slogan(n);},6000);
		});
	});
}
setTimeout(function(){slogan(1);},6000);

$('.spoiler').each(function(){
	$($(this).attr('name')).hide();
});
$('.spoiler').click(function(){
	if($($(this).attr('name')).css('display')=='none'){
		$($(this).attr('name')).slideDown(500);
		$(this).css({backgroundImage:"url('images/spoiler_open.gif')"});
	}
	else{
		var el=$(this);
		$($(this).attr('name')).slideUp(400,function(){
			$(el).css({backgroundImage:"url('images/spoiler.gif')"});
		});
	}
	return false;
});

// 
$('#footer_main').find('h2,.yashare-auto-init').hide();
// 
$('#leftcol').find('img[src="http://www.gosro.ru/LOGO_SEPP.JPG"]').css({width:"200px",height:"auto"});
// 
$('#topmenu').find('#site_part').hide();
//
URL=location.href.toString()+"#";
HASH=URL.split('#');
HASH=HASH[0].split('/');
switch(HASH[HASH.length-1]){
	case 'contacts.php':
		$('#v_menu').find('a[title="О нас"]').attr('class','');
		$('#bottommenu').find('a[title="О нас"]').attr('class','');
		break;
}

});













