/**
 * Скрипт для управления рекламой на стартовой странице
 * треубется jQuery 1.3+
 */
var startx = {
    timer: null,
    next: 1,
    shortTime: 7000,
    longTime: 14000,
    show: function(num, clicked){
        if (window.location.pathname != '/' && window.location.pathname.indexOf('adv') != 1){
            window.location.href='/adv/' + num + '.html';
            return false;
        }

        if ($.browser.msie) $('.introWrapper').css('width', '688px');
        else $('.introWrapper').css('width', '692px');

        $('.introWrapper').fadeOut(1000);
        var box = $('#intro' + num);
        box.fadeIn(1000);
        if (num >= 5) this.next = 1;
        else this.next = num + 1;

        var pause = 0;
        if (clicked) pause = this.longTime;
        else pause = this.shortTime;
        clearTimeout(this.timer);
        this.timer = setTimeout("startx.show(" + this.next + ", false);", pause);
        return false;
    }
}