/* $Id: index.js,v 1.3 2010/10/16 16:29:16 sap Exp $ */


$(document).ready(function () {

    
    /* loop banners */
    function next_b2_cycle() {
        $('div#banner_wrap').cycle({ 
            fx: 'fade', // scrollLeft
            speed: 800,
            //timeout: 5500,
            timeout: rotate_interval,
            pager: '#banner_controller'
        });
    }
        
    /* loop client logos */
    function client_cycle() {
        $('div#logo_group_outer').cycle({ 
            fx: 'scrollHorz', // scrollLeft scrollHorz
            timeout: 6000,
            next: '#right_control',
            prev: '#left_control',
            pause: 1
        });
    }
        
    next_b2_cycle();
    client_cycle();

    
    $('#submit_vote').click(function () {
        if (! $('input[name=f-choice]:checked').val()) {
            alert('nothing selected');
        }
        else {
            document.poll.submit();
        }
        return false;
    });

    $('.show_nl').click(function () {
        $('#newsletter_signup_block').show();
        return false;
    });

    $('div#pms_wrapper #photo #btn').click(function () {
        var current = $('div#pms_wrapper div.active');
        current.removeClass('active');
        var next = current.next('div');
        if (next.html() == null) next = $('div#pms_wrapper div:first-child');
        next.addClass('active');
        return false;
    });

    
    
});

