﻿/**********************************************************************************
TICKER: Used on
#corporate
_________________________________________________________________________________
Created by : Rangaswamy Rangappa / EF-Bangalore-INDIA / 2009, Nov 25 @ Bangalore,INDIA
Modified by: BD / EF-Bangalore-INDIA  / 2009, Dec 03  @ Zurich,SWITZERLAND
---------------------------------------------------------------------------------

*********************************************************************************/
function initVerticalScroller() {
    $j('#intro-right .list .button').hide();
    $j('#intro-right').css('cursor', 'pointer');
    $j('#intro-right').click(function() {
        document.location.href = "/corporate/our-customers/case-studies/";
    });
}

$j(document).ready(function() { initVerticalScroller(); });

$j(function() {
    var clients = $j("#client-list");
    clients.children().filter("li").each(function() {
        var li = $j(this), container = $j("<ul>");
        li.next().appendTo(container);
        li.prependTo(container);
        container.appendTo(clients);
    });
    clients.css("overflow", "hidden");
    function animator(currentItem) {
        var distance = currentItem.height();
        duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.025;
        currentItem.animate({ marginTop: -distance }, duration, "linear", function() {
            currentItem.appendTo(currentItem.parent()).css("marginTop", 0);
            animator(currentItem.parent().children(":first"));
        });
    };
    animator(clients.children(":first"));

    $j('#intro-right .list').mouseover(function() {
        clients.children().stop();
        $j('#intro-right .list .button').show();
    });
    $j('#intro-right .list').mouseout(function() {
        animator(clients.children(":first"));
        $j('#intro-right .list .button').hide();
    });
});

