<div class="banner">
<div class="content">
<a class="prev" href="#" id="prev_banner"></a>
<a class="next" href="#" id="next_banner"></a>
<div class="image" id="banner_slider">
<a href="/"><img src="" /></a>
</div>
<div class="navi" id="banner_navi">
</div>
</div>
<div class="banner-bottom">
<div class="left"><span></span></div>
<div class="right"><span></span></div>
</div>
</div>
<div class="clear"></div>
<script type="text/javascript">
var settings = [
8,
['design/{$settings->theme|escape}/images/banner1.jpg','/search_tour','#ffffff'],
['design/{$settings->theme|escape}/images/banner2.jpg','/search_tour','#ffffff'],
['design/{$settings->theme|escape}/images/banner3.jpg','/search_tour','#ffffff'],
];
</script>
{include file='sidebar.tpl'}
<div class="rt_main">
<div class="products">
<script src="//offer.newstravel.com.ua/js/widget_partner.js"></script>
<div id="offer_of_the_day" type="tours" partner_id="511"></div>
</div>
</div>
<script type="text/javascript" src="design/{$settings->theme}/js/openapi.js?45"></script>
<script type="text/javascript" src="design/{$settings->theme}/js/jquery.ui.cookie.js"></script>
{literal}
<script type="text/javascript">
var shops = $(".shop_adress");
var list = shops.find('li');
if(list.length>6)
{
shops.find("li:gt(5)").hide();
shops.append('<li><a href="#" class="fullshops">Посмотреть все адресса..</a></li>');
$("a.fullshops").click(function(){
$(this).hide();
list.slideDown();
return false;
});
}
var banner = $('#banner_slider');
var num = settings.length;
var number =0;
var timer = null;
var lastnumber = parseInt($.cookie('slidebanner'));
if (lastnumber){
number=lastnumber-1;
}
for (i=1; i<(num); i++){
$("#banner_navi").append('<a href="#" onclick="return false;" id="b_nav_'+ i +'"></a>');
}
function ChangeBanner(id){
$.cookie('slidebanner',null);
$.cookie('slidebanner', id);
banner.find('a').attr("href",settings[id][1]);
banner.find('a').fadeTo(1, 0.00);
$("#banner_navi a").removeClass("activ");
banner.find('a').empty();
banner.find('a').prepend("<img src='"+settings[id][0]+"' />");
banner.parents("div[class='content']").css('background-color',settings[id][2]);
banner.find('a').fadeTo(800, 1.00);
$("#b_nav_"+id).addClass("activ");
}
function slideShow() {
number=number+1;
if (number==num)
{
number=1;
}
ChangeBanner(number);
timer=setTimeout('slideShow();', settings[0]*1000);
}
$(function() {
slideShow();
$("#banner_navi a").live('click',function(){
$("#banner_navi a").removeClass("activ");
var attr = $(this).attr("id");
var id = parseInt(attr.replace('b_nav_',''));
if(timer)
{
clearTimeout(timer);
}
ChangeBanner(id);
});
$("#prev_banner").live('click',function(){
var curent = $("#banner_navi a[class='activ']");
var attr = curent.attr("id");
var id = parseInt(attr.replace('b_nav_',''));
$("#banner_navi a").removeClass("activ");
if(timer){
clearTimeout(timer);
}
if(id==1){
ChangeBanner(num-1);
}
else {
ChangeBanner(id-1);
}
return false;
});
$("#next_banner").live('click',function(){
var curent = $("#banner_navi a[class='activ']");
var attr = curent.attr("id");
var id = parseInt(attr.replace('b_nav_',''));
$("#banner_navi a").removeClass("activ");
if(timer){
clearTimeout(timer);
}
if(id==(num-1)){
ChangeBanner(1);
}
else {
ChangeBanner(id+1);
}
return false;
});
});
</script>
{/literal}