$(document).ready(function() {

    $.Juitter.start({


        searchType: "searchWord", // needed, you can use "searchWord", "fromUser", "toUser"

        searchObject: "father's day", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma.


        // The values below will overwrite the ones on the Juitter default configuration. 

        // They are optional here.

        // I'm changing here as a example only

        lang: "en", // restricts the search by the given language

        live: "live-10", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates.

        placeHolder: "ik", // Set a place holder DIV which will receive the list of tweets example <div id="ik"></div>

        loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on 

        imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif"

        total: 20, // number of tweets to be show - max 100

        readMore: "Read it on Twitter", // read more message to be show after the tweet content

        nameUser: "image" // insert "image" to show avatar of "text" to show the name of the user that sent the tweet

    });

    $("#btnSearch").click(function() {
        var searchTerm = $('[name=txtSearch]').val()
        if (searchTerm == "")
            searchTerm = "father's day";
        $.Juitter.start({

            searchType: "searchWord",

            searchObject: searchTerm,

            live: "live-10"  // it will be update every 5 seconds 

        });
    });

    $("#aRodrigo").click(function() {

        $(".jLinks").removeClass("on");

        $(this).addClass("on");

        $.Juitter.start({

            searchType: "fromUser",

            searchObject: "mrjuitter,rodrigofante",

            live: "live-120" // it will be updated every 120 seconds/2 minutes

        });

    });

    $("#aAirplane").click(function() {

        $(".jLinks").removeClass("on");

        $(this).addClass("on");

        $.Juitter.start({

            searchType: "searchWord",

            searchObject: "airplane",

            live: "live-20"  // it will be update every 20 seconds 

        });

    });

    $("#aJuitter").click(function() {

        $(".jLinks").removeClass("on");

        $(this).addClass("on");

        $.Juitter.start({

            searchType: "searchWord",

            searchObject: "Juitter",

            live: "live-180" // it will be updated every 180 seconds/3 minutes

        });

    });

});

