BannerArray = new Array(
new Array(
	'ad_1.jpg',
	'/americaschildren/demo.asp#figure1',
	'Image of two happy children smiling at each other.  The banner reads \'Projection of US Children by 2050: 39% Hispanic, 38% White, non-Hispanic\' '
	),
new Array(
	'ad_2.jpg',
	'/americaschildren/famsoc.asp#figure3',
	'Image of a pregnant woman\'s hands holding her stomach.  The banner reads \'In 2008, the adolescent birth rate was 21.7 per 1,000  young women ages 15-17, a decrease from 22.2 in 2007.\' '
	),
	new Array(
	'ad_3.jpg',
	'/americaschildren/care.asp#figure6',
	'Image of a doctor pointing at a bar graph, with a group of children jumping in the background. The banner reads \'Children that had health insurance at some time during 2008: 93% White, non-Hispanic, 89% Black, 83% Hispanic\' '
	),
new Array(
	'ad_4.jpg',
	'/americaschildren/edu.asp#figure13',
	'Image of a young man sitting on a merry-go-round alone in a park. The banner reads \'9% of youth ages 16-19 were neither enrolled in school nor working in an average week in 2009, up from 8% in 2008.\' '
	),
new Array(
	'ad_5.jpg',
	'/americaschildren/health.asp#figure14',
	'Close-up image of an infant\'s foot.  The banner reads \'The percentage of infants born preterm declined for the second straight year: 2006: 12.8%, 2007: 12.7%, 2008: 12.3%\' '
	),
new Array(
	'ad_6.jpg',
	'/americaschildren/health.asp#figure15',
	'Image of a slouching female teenager with a hoodie draped over her face. The banner reads \'In 2008, 12% of adolescent females and 4% of adolescent males experienced a Major Depressive Episode during the past year\' '
	),
new Array(
	'ad_7.jpg',
	'/americaschildren/health.asp#ad_7',
	'Image of the hand of a young girl holding a pile of four cookies.  The banner reads \'19% of chlidren ages 6-17 were obese in 2007-2008, compared to 6% in 1976-1980, but unchanged from 2005-2006.\' '
	),

	
	new Array(
	'ad_8.jpg',
	'/americaschildren/famsoc.asp#figure2',
	'Image of a happy asian family including a father, mother, son, and daughter.  The banner reads \'In 2009: 70% of children under age 18 lived with two parents, 26% lived with one parent, 4% lived with neither parent\' '
	),
	
	new Array(
	'ad_9.jpg',
	'/americaschildren/eco.asp#figure5',
	'Image of an open, empty refridgerator.  The banner reads \'About 22% of children lived in food-insecure households in 2008, up from 17% in 2007 and the highest recorded percentage.\' '
	),
	
	new Array(
	'ad_10.jpg',
	'/americaschildren/famsoc.asp#ad_10',
	'Image of a somber infant looking off camera.  The banner reads \'In 2008, there were 22 substantiated child maltreatment reports per 1,000 children under age 1.\' '
	),
	
	new Array(
	'ad_11.jpg',
	'/americaschildren/edu.asp#figure12',
	'Image of a young male student in front of a chalkboard with long division problems written on it.  The banner reads \'In 2009, the average 8th grade mathematics achievement score was higher than the score in all previous assessment years.\' '
	),
	
	new Array(
	'ad_12.jpg',
	'/americaschildren/beh.asp#figure11',
	'Image of a darkened piece of cracked glass.  The banner reads \'14 crimes per 1000: The serious violent crime offending rate in 2008 for juveniles ages 12-17, unchanged from 2007.\' '
	),
	
	new Array(
	'ad_13.jpg',
	' /americaschildren/eco.asp#figure4',
	'Image of a sad looking girl on a sheet-less bed, holding a pink stuffed animal.  The banner reads \'8% of related children lived in extreme poverty (less than one half of the poverty threshold) in 2008, the highest percentage since 1998.\' '
	),
	
	new Array(
	'ad_14.jpg',
	'/americaschildren/care.asp#figure7',
	'Image of a female patient having her teeth examined by a dentist.  The banner reads \'The percentage of children ages 5-11 with untreated dental cavities declined from 27% in 1999-2004 to 20% in 2005-2008.\' '
	),
	
	new Array(
	'ad_15.jpg',
	'/americaschildren/eco.asp#ad_15',
	'Image of a young girl hugging her father as he leaves for work.  The banner reads \'75% of children had at least one parent working year round, full time, in 2008, a decrease from 77% in 2007 and the lowest since 1996.\' '
	),
	
	new Array(
	'ad_16.jpg',
	' /americaschildren/beh.asp#figure10',
	'Image of a girl looking away as she holds up a cigarette.  The banner reads \'3% of 8th graders, 6% of 10th graders and 11% of 12th graders reported smoking cigarettes daily in 2009, the lowest levels recorded.\' '
	),
	
	new Array(
	'ad_17.jpg',
	'/americaschildren/phenviro.asp#ad_17',
	'Close-up image of the face of a young african-american child.  The banner reads \'7% of Black, non-Hispanic children ages 1-5 had blood lead levels at or above 5 ug/dL in 2005-2008, the highest levels among racial and ethnic groups.\' '
	),
	
	new Array(
	'ad_18.jpg',
	'/americaschildren/phenviro.asp#figure8',
	'Image of an ashtray overflowing with cigarette butts.  The banner reads \'Percentage of children ages 4-11 with evidence of exposure to secondhand smoke (cotinine) in their blood: 1988-1994: 88%, 2007-2008: 53%\' '
	)
	
	
	);

 

 

var g;
var h;
var HPBannerTime = 1000 * 5; //seconds
var ImageNum;
var timerID;
var FIRST_TIME = true;

function AddHPBanner(ii,x)
{
//	alert(FIRST_TIME);

    if (!x) var x = 0;
    
    h = x;
    
	if (x != 0)
	{
	    h = x;
		switch(x)
		{
			case 1:
				ImageNum = ii;
				clearTimeout(timerID);
				document.getElementById('controller').src='images/play.gif';
				document.getElementById('controller').title='start banners';			
				break;
			case 2:
				ii = ImageNum;
				document.getElementById('controller').src='images/stop.gif';
				document.getElementById('controller').title='stop banners';			
				break;
			case 3:
			    ii = g + 1;		
				var t = (ii)+1;
				clearTimeout(timerID);
				timerID = setTimeout("AddHPBanner(" + t + ")",HPBannerTime);
			    break;
			case 4:
			    ii = g - 1;	
				var t = (ii)+1;
				clearTimeout(timerID);
				timerID = setTimeout("AddHPBanner(" + t + ")",HPBannerTime);
			    break;
            default:
                break;			    
		}
    }
	
	 if (x!=1)
	 {
		if (ii==null && FIRST_TIME)
		{
			var d = new Date();
		    var ii = d.getSeconds();
			g = Mod(ii, BannerArray.length)
			document.write('<A href="' + BannerArray[g][1] + '" id="HomepageBannerLINK">');
			document.write('<IMG src="/images/' + BannerArray[g][0] + '" alt="' + BannerArray[g][2] + '" id="HomepageBannerIMG" width="282" height="120" border="0">');
			document.write('</A>');
			FIRST_TIME = false;
		}
		else
		{
		    if (ii==null)
		    {
			    var d = new Date();
		        var ii = d.getSeconds();
		    }
			g = Mod(ii, BannerArray.length)
			document.getElementById('HomepageBannerIMG').src='/images/' + BannerArray[g][0];
			document.getElementById('HomepageBannerLINK').href=BannerArray[g][1];
			document.getElementById('HomepageBannerIMG').alt=BannerArray[g][2];
		}
		
		var t = (ii)+1;
		
		if (x <= 2 ) 
		{
            clearTimeout(timerID);	            
	        timerID = setTimeout("AddHPBanner(" + t + ")",HPBannerTime);
        }	        
	}
}	
	
function Mod(X, Y)
{
	return X - Math.floor(X/Y)*Y
}


function start_stop()
{
    if (h == 0) 
    {   
        AddHPBanner(g, 1);
    } else
    {
        AddHPBanner(g, 2);
        h = 0;
    }        
     
}