var headline_count;
 var headline_interval;
 var old_headline = 0;
 var current_headline = 0;
 /* Added By Hrushikesh Vyas*/
 var headlinetopdown_count;
 var current_headlinetopdown = 0;
 var headlinetopdown_interval;
 var old_headlinetopdown = 0;
 /* End*/
 jQuery(document).ready(function($) {

     headline_count = $("div.headline").size();
     
     $("div.headline:eq(" + current_headline + ")").css('left', '5px'); //('top', '5px');
     
     /*    if (headline_count > 1)*/
     headline_interval = setInterval(headline_rotate, 7000); //time in milliseconds
    
     $('#scrollup').hover(function() {
         clearInterval(headline_interval);
     }, function() {
         /*	 if (headline_count > 1)*/
         headline_interval = setInterval(headline_rotate, 7000); //time in milliseconds

     });
     
 });
 
 function headline_rotate() {
	 
   current_headline = (old_headline + 1) % headline_count; 
   
   jQuery("div.headline:eq(" + old_headline + ")").animate({left: -590},"slow", function() { //({top: -210},"slow", function() {
     jQuery(this).css('left','600px'); //('top','220px');
   });
   jQuery("div.headline:eq(" + current_headline + ")").show().animate({left: 5},"slow");  //({top: 5},"slow");  
   old_headline = current_headline;

}
/*Added By Hrushikesh Vyas*/
jQuery(document).ready(function($) {


    headlinetopdown_count = $("div.headlinetopdown").size(); //Added By H N Vyas
   // alert(headlinetopdown_count);
    $("div.headlinetopdown:eq(" + current_headlinetopdown + ")").css('top', '5px'); //Added By H N Vyas
    /*    if (headline_count > 1)*/

    headlinetopdown_interval = setInterval(headline_rotatetopdown, 15000); //time in milliseconds 

    $('#scrolluptop').hover(function() {
        clearInterval(headlinetopdown_interval);
    }, function() {
        /*	 if (headline_count > 1)*/
        headlinetopdown_interval = setInterval(headline_rotatetopdown,20000); //time in milliseconds

    });
});
function headline_rotatetopdown() {

    current_headlinetopdown = (old_headlinetopdown + 1) % headlinetopdown_count;

    jQuery("div.headlinetopdown:eq(" + old_headlinetopdown + ")").animate({ top: -280 }, "slow", function() { //({top: -210},"slow", function() {
        jQuery(this).css('top', '260px'); //('top','220px');
    });
    
    jQuery("div.headlinetopdown:eq(" + current_headlinetopdown + ")").show().animate({ top: 5 }, "slow");  //({top: 5},"slow");  
    old_headlinetopdown = current_headlinetopdown;
}
/*End*/
