function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function writeGeneralImgs(){
// Instructions For Adding General Images (These same instructions apply for the other functions - 
// just simply make sure the correct naming convention is used):
// To add an image, simply save the image as a .jpg and name it using the following convention:
// "img_supp_X.jpg" where "X" is the next incremental number minus 1 of the variable "highNum".
// So if highNum = 5 and you want to add two additional images, you would save your .jpg files as
// "img_supp_5.jpg" & "img_supp_6.jpg".  This is done because the first number in the order is 0 as
// opposed to 1. You then will have to increase the variable "highNum" by the number of new images
// you add, so in this example highNum = 7

// Set number of images here

   var highNum=26;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;
   
   // Define arrays
  cDesc = new Array(26)
  cDesc[0] = "Teens with skateboard & basketball, men playing volleyball & senior man with senior woman on swing."
  cDesc[1] = "A woman holding a volleyball, a man wearing a helmet on a bicycle and a man with a bow and arrow."
  cDesc[2] = "A woman doing curl-ups and men playing rugby."
  cDesc[3] = "A woman playing tennis and a woman playing golf."
  cDesc[4] = "A boy and two girls running on a beach and two girls on a beach playing with a pail and shovel."
  cDesc[5] = "Seniors in a pool, a girl on a merry-go-round, a boy with a basketball and men playing basketball."
  cDesc[6] = "A woman playing tennis, an airborne windsurfer and a man rock climbing."
  cDesc[7] = "Men playing basketball, an airborne windsurfer and a man rock climbing."
  cDesc[8] = "A girl holding onto a rope, children playing with a yellow ball and two girls running along a beach."
  cDesc[9] = "A boy riding through the surf on a boogie board, a girl holding onto a rope, a girl and two boys running on a beach & a woman holding a volleyball."
  cDesc[10] = "Boys with a baseball & bat, a frisbee, airborne on a skateboard, and holding a skateboard."
  cDesc[11] = "Two moving bicycles and a man lying on a weight bench lifting two dumbbells."
  cDesc[12] = "Senior man with senior woman on swing, senior couple swimming & senior man golfing."
  cDesc[13] = "A boy riding through the surf on a boogie board and an airborne teen on a skateboard."
  cDesc[14] = "A senior woman riding an exercise bicycle and a senior man and woman walking around a track."
  cDesc[15] = "A young boy jumping into the air and a young girl on a see-saw."
  cDesc[16] = "Teens with skateboard & basketball, men playing volleyball & senior man with senior woman on swing."
  cDesc[17] = "Seniors exercising and a senior man throwing a ball."
  cDesc[18] = "Girl on a merry-go-round, girl in a grass skirt & lei with a hula hoop and girl climbing a tree."
  cDesc[19] = "A girl and two boys running on a beach, a boy with a basketball and a teen with a skateboard."
  cDesc[20] = "A senior man fastening the helmet of a young boy on a scooter and a senior man jogging outside."
  cDesc[21] = "Four girls with Challenge medals, a young man with a baseball and bat and a teen boy with a frisbee."
  cDesc[22] = "A senior couple fishing and children running along a beach."
  cDesc[23] = "Teens with skateboard and four girls with Challenge medals"
  cDesc[24] = "Senior woman with a helmet & bicycle, senior man in rollerblades & senior man with a surfboard."
  cDesc[25] = "Senior couple riding bicycles and a senior man throwing a ball." 

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='http://www.fitness.gov/images/img_supp_" + aRandomNum + ".jpg' alt='" + cDesc[aRandomNum] + "' border='0'>");
}

//**************************************************************************************

function writeKidsImgs(){
// Set number of images here

   var highNum=5;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='/images/img_supp_kids" + aRandomNum + ".jpg' alt='Pictures of active kids' border='0'>");
}

//**************************************************************************************

function writeSeniorsImgs(){
// Set number of images here

   var highNum=4;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='/images/img_supp_seniors" + aRandomNum + ".jpg' alt='Pictures of active seniors' border='0'>");
}

//**************************************************************************************

function writeAdultsImgs(){
// Set number of images here

   var highNum=6;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='/images/img_supp_adults" + aRandomNum + ".jpg' alt='Pictures of active adults' border='0'>");
}

//**************************************************************************************

function writeTeensImgs(){
// Set number of images here

   var highNum=5;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='/images/img_supp_teens" + aRandomNum + ".jpg' alt='Pictures of active teens' border='0'>");
}

//**************************************************************************************

function writeHomeImgs(){
// Set number of images here

   var highNum=3;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;
   // Define arrays
   cDesc = new Array(3)
   cDesc[0] =  "A woman and child running."
   cDesc[1] =  "Young children running."
   cDesc[2] =  "A young boy pushing a senior woman on a skateboard."

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='/images/img_homepage_" + aRandomNum + ".jpg' alt='" + cDesc[aRandomNum]+ "' border='0'>");
}


//External Link Disclaimer
function exitSite(){
	return true;
}
/*
function exitSite(){
  var msg = confirm('You are leaving the President\'s Council on Physical Fitness and Sports\'\nwebsite and entering a non-government website.  The President\'s Council\ncannot attest to the accuracy of information provided by linked sites.\nLinking to a website does not constitute an endorsement by the Council,\nor any of its employees, of the sponsors of the site or the products\npresented on the site.  You will be subject to the destination site\'s privacy\npolicy when you leave our site.');

   if (msg==true) {  
   return true;  
   } 
   else {  
   return false; 
   }
}   
   */

   function writeHomeImgs2(){
// Set number of images here

   var highNum=3;  //1 + highest number of images (if 5 returns 0-4)
   aRandomNum = Math.round(Math.random() * highNum-1);
   if (aRandomNum < 0) aRandomNum = 0;
   // Define arrays
   cDesc = new Array(3)
   cDesc[0] =  "A woman and child running."
   cDesc[1] =  "Young children running."
   cDesc[2] =  "A young boy pushing a senior woman on a skateboard."

// Based on the random number generated, we then dynamically build the image reference and write it out

   document.write("<img src='http://www.fitness.gov/images/img_homepage_" + aRandomNum + ".jpg' alt='" + cDesc[aRandomNum]+ "' border='0' width='180' height='188'>");
}								
