﻿/* News feed animations */
// feedTickerInterval comes from the host page

$(document).ready(function () {
    var maxHeight = 0;
    var current = $("#newsfeed div:first");
    do {
        if (current.height() > maxHeight)
            maxHeight = current.height();
        current = current.next();
    }
    while (current.length > 0)

    $("#newsfeed").css("height", maxHeight);
    //alert(maxHeight);

    $("#newsfeed > div").hide();
    //$("#newsfeed > div:first").slideDown(700);
    $("#newsfeed > div:first").fadeIn(700);
    //$("#newsfeed>div.first").animate({opacity: 0},700);
    setTimeout(newsfeedtick, feedTickerInterval);

    //blog article list bullet item
    $('DIV.eviblog DIV.blog-list DIV.entry DIV.article UL LI').prepend('<img src="/global/mcc/img/bullet_box_black.gif" style="float:left; padding:5px 10px 0px 10px;" />')

	if ($('DIV.loginInnerContainer input.bgcardnumber').val()>0) {

$('DIV.loginInnerContainer input.bgcardnumber,DIV.loginInnerContainer input.bgpassword').css('background-image','none')

}



});

newsfeedtick = function()
{
	var active = $("#newsfeed > div:visible");
	//active.slideUp(700);
	//active.fadeOut(500);
	active.animate({opacity: "hide",height:"0px"},700);
	
	var sibling = active.next();
	if(sibling.length)
		sibling.fadeIn(700);//sibling.slideDown(700);
	else
		$("#newsfeed > div:first").fadeIn(700);
		//$("#newsfeed > div:first").slideDown(700);
			
	setTimeout(newsfeedtick, feedTickerInterval);
}
