function startNewsRotate(position)
{
	var newsArray = new Array('<p><strong>02.03.2012</strong><br /> <a href="http://www.courant.com/community/hartford/hc-hartford-education-appointees-0203-20120202,0,7608736.story" target="_blank">Courant: 5 Board Appointees Approved</a></p>','<p><strong>02.02.2012</strong><br /> <a href="http://www.achievehartford.org/upload/files/2-2-12--PublicInsights--Recap.pdf" target="_blank">Quick Recap: Public Interviews</a></p>','<p><strong>01.15.2012</strong><br /> <a href="http://www.achievehartford.org/newsroom.php" target="_blank">Seven Opinions about Reform in the Courant</a></p>','<p><strong>02.02.2012</strong><br /> <a href="http://archive.constantcontact.com/fs031/1102778616856/archive/1109194779666.html" target="_blank">See the Current Edition of Education Matters!</a></p>'); 
	var curr_element = 0;
	var nxt_element;
    try{ 
    	$("#news_area").fadeOut('slow', function(){
        		$("#news_area").html(newsArray[position]);
                $("#news_area").fadeIn('slow');
        	});
    }
    catch(e){}
    position = ++position > (newsArray.length-1) ? 0 : position;
    var r = setTimeout("startNewsRotate(" + position + ")",8000);
}

var status = 0;

function cancel_scroll()
{
	status = 0;
}

function animate_controller(side)
{
	if(status && side == 'left')
    	animate_left();
    if(status && side == 'right')
    	animate_right();
}

function animate_left()
{
		/*if(parseInt($("#scroller").css("marginLeft")) < -1000)
        	$("#scroller").css({"marginLeft" : "1000px"});*/ //marquee style needs work
        if(parseInt($("#scroller").css("marginLeft")) > -200)
        {
			status = 1;
			$("#scroller").animate({ 
        		marginLeft: "-=1.5px"
			},10, function(){animate_controller('left')});
         }
         
        //$("#pos_status").html("Left Margin: " + $("#scroller").css("marginLeft")); 
}

function animate_right()
{
		/*if(parseInt($("#scroller").css("marginLeft")) > 1000)
        	$("#scroller").css({"marginLeft" : "-1700px"});*/ // this marquees needs work
		if(parseInt($("#scroller").css("marginLeft")) < 0)
        {
        	status = 1;
			$("#scroller").animate({ 
        	marginLeft: "+=1.5px"
			},10, function(){animate_controller('right')});
         }
        //$("#pos_status").html("Left Margin: " + $("#scroller").css("marginLeft")); 
}

