<!--
var country = "US";
var pic_width=601;
var pic_height=301;
var delay=1000;
var iyr=2000;
var MaxN = (2050-iyr)/5;
var NumYrs = MaxN + 1;
var yr=iyr ;
var pic = new Array(NumYrs) ;

if (document.images) {
for (i=0; i<=MaxN; i++) {
yr = iyr + i * 5 ;
pic[i] = new Image(pic_width,pic_height);
pic[i].src="image_no_boxes.php?country="+country+"&yr="+yr; 
}
}    

var thenum=0;
imgName="img1";
var pictmp ;

function change_it() {
if (document.images)  {
pictmp = pic[thenum] ;
document.getElementById("pyramid_").innerHTML = "<IMG SRC='"+pictmp.src+"' border='0' width='"+pic_width+
              "' height='"+pic_height+
"' name='img1' ALT='Dynamic Population Pyramid for "+country+"'>\n";                       
setTimeout('change_it2()',delay);  

}
}

function change_it2() {
 var x=0;
  thenum+=1;

   if (thenum>NumYrs-1)
     thenum=0;

   document[imgName].src=pic[thenum].src;
   x+=1;
   setTimeout('change_it2()',delay);
}

function change_country()
{
//document.getElementById("pyramid_").innerHTML = "Loading Data..";

country =  document.getElementById("cty").value;
document.getElementById("cty").blur();
pic = new Array(NumYrs);

if (document.images) {
for (i=0; i<=MaxN; i++) {
  yr = iyr + i * 5 ;
  pic[i] = new Image(pic_width,pic_height);
  //pic[i].src="http://www.census.gov/cgi-bin/ipc/idbpyr.pl?cty="+country+"&yr="+yr+"&maxp=194110&maxa=100&ymax=300&color=1"; 
  pic[i].src="image_no_boxes.php?country="+country+"&yr="+yr; 
}
}  

//change_it();   
}

//-->
