BannerArray = new Array(
new Array(
	'ad_1.jpg',
	'/americaschildren/famsoc4.asp',
	'Image of an asian mother and her infant child.  The banner reads \'The percentage of children living with at least one foreign-born parent:   15% in 1994, 22% 2008\' '
	),
new Array(
	'ad_2.jpg',
	'/americaschildren/famsoc6.asp',
	'Image of a young pregnant woman holding a stethoscope to her stomach.  The banner reads \'In 2007, the adolescent birth rate was 22.2 per 1,000 young woman ages 15-17, an increase for the second consecutive year.\' '
	),
	new Array(
	'ad_3.jpg',
	'/americaschildren/eco1.asp',
	'Image of the face of a disheveled young boy. The banner reads \'In 2007:  10% of White, non-Hispanic children lived in poverty, compared with 35% of Black children, and 29% of Hispanic children.\' '
	),
new Array(
	'ad_4.jpg',
	'/americaschildren/care1.asp',
	'Image of a smiling doctor and her young female patient holding her stethoscope.  The banner reads \'In 2007, 89% of children had health insurace coverage at some point during the year, up from 88% in 2006.\' '
	),
new Array(
	'ad_5.jpg',
	'/americaschildren/care3.asp',
	'Image of a young child getting a vaccination.  The banner reads \'In 2007, 77% of children ages 19-35 months had received the recommended six-vaccine series.\' '
	),
new Array(
	'ad_6.jpg',
	'/americaschildren/phenviro1.asp',
	'Image of a broken cigarette and a filled ashtray on a wooden surface. The banner reads \'The percentage of children ages 0-6 living in homes where someone smoked regularly dropped form 27% in 1994 to 8% in 2005\' '
	),
	new Array(
	'ad_7.jpg',
	'/americaschildren/phenviro4.asp',
	'Panoramic image of a typical suburban neighborhood, with a pond and fountain.  The banner reads \'In 2007, 43% of households with children reported one or more housing problems, up from 40% in 2005.\' '
	),

	
	new Array(
	'ad_8.jpg',
	'/americaschildren/phenviro5.asp',
	'Close-up image of yellow crime scene tape.  The banner reads \'Deaths among adolescents ages 15-19 due to homicides increased in 2006 for the second consecutive year.  Firearms account for the majority of homicides.\' '
	),
	
	new Array(
	'ad_9.jpg',
	'/americaschildren/beh2.asp ',
	'Image of 3 glasses of beer.  The banner reads \'The percentage of 10th graders reporting heavy drinking declined from 20% in 2007 to 16% in 2008\' '
	),
	
	new Array(
	'ad_10.jpg',
	'/americaschildren/beh4.asp',
	'Image of 5 teenagers on their elbows smiling.  The banner reads \'48 percent of high school students reported ever having sexual intercourse in 2007.\' '
	),
	
	new Array(
	'ad_11.jpg',
	'/americaschildren/edu5.asp',
	'Image of an empty classroom.  The banner reads \'8% - Percentage of youth ages 16-19 that were neither enrolled in school nor working in an average week in 2008.\' '
	),
	
	new Array(
	'ad_12.jpg',
	'/americaschildren/edu3.asp',
	'Image of a board covered in mathematical diagrams and equations.  The banner reads \'The proportion of high school graduates who had taken an advanced mathematics course increased from 45% in 2000 to 49% in 2005\' '
	),
	
	new Array(
	'ad_13.jpg',
	' /americaschildren/edu6.asp',
	'Image of a diverse class listening to a lecture and taking notes.  The banner reads \'67% of high school completers enrolled immediately in a 2-year or 4-year college in 2007\' '
	),
	
	new Array(
	'ad_14.jpg',
	'/americaschildren/health1.asp',
	'Image of a newborn holding the parents hand.  The banner reads \'The percentage of infants born preterm and the percentage born with low birthweight declined slightly in 2007, for the first time in decades.\' '
	),
	
	new Array(
	'ad_15.jpg',
	'/americaschildren/health4.asp',
	'Image of a depressed looking teenage girl.  The banner reads \'In 2007, 12% of females, and 5% of males aged 12-17 experienced a Major Depressive Episode during the past year.\' '
	),
	
	new Array(
	'ad_16.jpg',
	' /americaschildren/health8.asp',
	'Image of a boy using his inhaler.  The banner reads \'About 9% of children in 2007 currently had asthma.  The percentage was higher among Black, non-Hispanic and Puerto Rican children (15% each).\' '
	),
	
	new Array(
	'ad_17.jpg',
	' /americaschildren/special1.asp',
	'Image of a mother, 2 daughters, and son with a brace going out on a walk during an autumn day.  The banner reads \'14% of children had a special health care need in 2005-2006.\' '
	),
	
	new Array(
	'ad_18.jpg',
	' /americaschildren/health7.asp',
	'Image of an obese kid eating a large sub.  The banner reads \'In 1976–1980, only 6% of children ages 6–17 were overweight. By 2005–2006, 17% of children ages 6–17 were overweight.\' '
	)
	
	
	);

 

 

var g;
var h;
var HPBannerTime = 1000 * 20; //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;
			    break;
			case 4:
			    ii = g - 1;
			    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;
    }        
     
}