﻿function clickable(clickableElement) {
    clickableElement = $(clickableElement);
    clickableElement.click(function() {
        var href = $(this).find('a').attr('href');
        window.location.href = href;
    });
}

$(function() {

    clickable('div.scrollable ul.items li');

    $('#welcome form fieldset.bool input').attr({ value: 'Enter a topic or keyword' }).focus(function() {
        if ($(this).val() == 'Enter a topic or keyword') {
            $(this).val("");
        }
    }).blur(function() {
        if ($(this).val() == "") {
            $(this).val('Enter a topic or keyword');
        }
    });

    $('div.scrollable')
            .scrollable({
                size: 1,
                items: ".items",
                loop: true,
                easing: 'swing'
            })
            .circular()
            .navigator()
            .autoscroll({
                autoplay: true,
                autopause: true,
                interval: 5000
            });
});