
$(document).ready(function(){
$('.infodesigner').append("<div id='circle_orange_bottom'></div>")
                  .append("<div id='circles_bottom'></div>");						
if ( $.browser.msie && $.browser.version==7.0) {$('#circles_bottom').remove();$('#circle_orange_bottom').remove();}
$('.logo').append("<div id='circle_orange'></div>")
          .append("<div id='circles'></div>");
 $('#circles_bottom').hide();
$('#circle_orange_bottom').hide();
if($(window).width()>'1250'){
$('body').css('overflow-x','hidden');
$('#circles_bottom').show();
$('#circle_orange_bottom').show();
}
$(window).resize(function(){
if($(window).width()<'1250'){
$('body').css('overflow-x','visible');
$('#circles_bottom').hide();
$('#circle_orange_bottom').hide();
}
else if($(window).width()>='1250'){
$('body').css('overflow-x','hidden');
$('#circles_bottom').show();
$('#circle_orange_bottom').show();
}
});//end resize

/*размер картинок в промо*/
var promo_width=$('.promo').width();
$('.promo li').css('width',promo_width)
$(window).resize(function(){
var promo_width=$('.promo').width();
$('.promo li').css('width',promo_width)
});
/*стрелочки в промо*/
$('.promo').append("<a class='right_arrow' href='#'></a>")
           .append("<a class='left_arrow' href='#'></a>");
var all_width=0;
$('.promo ul li').each(function(){all_width=all_width+$(this).width();});

$('.right_arrow').click(function(){
if(all_width-$('.promo ul li').width()<='0')
{
$('.promo ul').animate({left:'-=10px'},100,function(){$(this).animate({left:'+=10px'});});
return false;
}
else
{all_width=all_width-$('.promo ul li').width();
$('.promo ul').animate({left:'-='+$('.promo li').width()+'px'},1500);
return false;
}
});
$('.left_arrow').click(function(){
if($('.promo ul').css('left')>='0px')
{
$('.promo ul').animate({left:'+=10px'},100,function(){$(this).animate({left:'-=10px'});});
return false;
}
else
{
all_width=all_width+$('.promo ul li').width();
$('.promo ul').animate({left:'+='+$('.promo li').width()+'px'},1500);
return false;
}
});//end click


/*последние новости главная*/
$('.last_news_main .item').hide();

$('.last_news_main .item:first-child').show();

$('.last_news_main').append('<div class="navig"><a class="page active" href="#">1</a><a class="page" href="#">2</a><a class="page" href="#">3</a></div>');

$('.articles_main .item').hide();

$('.articles_main .item:first-child').show();

$('.articles_main').append('<div class="navig"><a class="page active" href="#">1</a><a class="page" href="#">2</a><a class="page" href="#">3</a></div>');
$('.navig a').hover(function(){
							    $(this).parent().find('a').removeClass('active');
							   $(this).addClass('active');
							   var val=$(this).index();
							   $(this).parent().parent().find('.item').hide();
							   $(this).parent().parent().find('.item').eq(val).show();
							});
$('.navig a').click(function(){return false;})
});//end ready	
