/**
 * Index/Index page, will init the slideshow and activate ajax form on the form
 * @author Steven Rosato
 */
 
$(function(){
    $('.jquery-version').html($().jquery);
});

/* add JQuery tools slideshow plugin for tabs */
$(function() {
    $('.slideshow').css('display', 'block');

    $('.slideshow .tabs').tabs('.slideshow .slider', {
        /* enable "cross-fading" effect */
        effect: 'fade',
        fadeInSpeed: 2000,

        /* start from the beginning after the last tab */
        rotate: true

    /* use the slideshow plugin. It accepts its own configuration */
    }).slideshow({
        interval: 10000,
        autoplay: true,
        clickable: false
    });

    /* backward and forward buttons stops the slideshow */
//    $(".slideshow .backward, .slideshow .forward").click(function(){
//        $(".slideshow .tabs").tabs().stop();
//    });
});

/* add tooltips for the form and ajax it too */
$(function(){
    $('#yourProject').ajaxForm({
//       action: 'company/index/index',
       successUrl: majisti.app.baseUrl + '/company/index/project-success'
    });

    $('#yourProject textarea').charCounter(150, {
        container: "<div></div>",
        classname: "counter",
        format: "%1",
        pulse: true,
        delay: 100
    });
});
