// JavaScript Document
$(document).ready(function()
{
   var _i = setInterval(function()
	{
		var _div = $('#press_release div:visible:first');
		if (_div.length == 1)
		{
		   _div.slideUp('slow',function()
         {
           var _next = $(this).next();
           if(_next.attr('id') == 'press_release_end')
           {
            $('#press_release div:first').slideDown('slow');
           }
           else
           {
             _next.slideDown('slow');
           }
         });
		}
	},9000);
	
	$('#scroll_right').click(function ()
	{
  		var _container = $('#scroll_content');
      	var _items = $('#scroll_items');

	    if (_items.queue('fx').length == 0)
        {
			var _pos = _items.css('marginLeft').split('px');
         	_pos = (_pos[0] == parseInt(_pos[0])) ? _pos[0] : 0;
   	        
			if ((_pos * -1) < (_items.find('td').length-1) * 560)
   	        {
	              _items.animate({marginLeft:'-=560',easing:'swing'}, 1500);
   	        }
        }

		return false;
	});

	$('#scroll_left').click(function ()
	{
   		var _items = $('#scroll_items');
		if (_items.queue('fx').length == 0)
        {
   			var _pos = _items.css('marginLeft').split('px');
			if (_pos[0] < 0)
			{
				$('#scroll_items').animate({marginLeft:'+=560',easing:'swing'}, 1500);
			}
		}
		return false;
	});
});

