// GENERATE A RANDOM BANNER IMAGE

/*if (eval(unescape(window.location).match(/tsunami/i))) {
  // test if URL contains "tsunami"
  var n = 1; // default image
  var r = 4; // # of images in set
  n = (Math.round(Math.random()*(r - 1)) + 1); // generate random number
  i = "http://www.undp.org/images/intranet/banner/tsunami_" + n + ".jpg";
  credit = "";
}
else if ( eval(unescape(window.location).match(/jobs\.undp\.org/i)) || eval(unescape(window.location).match(/jobs-beta\.undp\.org/i)) )  {
  // test if URL contains "jobs.undp.org"
  var n = 1; // default image
  var r = 15; // # of images in set
  n = (Math.round(Math.random()*(r - 1)) + 1); // generate random number
  i = "http://www.undp.org/images/jobs/jobs_" + n + ".jpg";
  credit = "";
}
else {*/

 // no match, choose from one of the default sets
  var n = 1; // default image

  // pick a number between 1 and 10
  var chance = Math.round(Math.random()*9) + 1;

  // use each set 40/60% of the time
  if (chance > 6) {
    // UNCDF
    var r = 8; // # of images in set
    n = (Math.round(Math.random()*(r - 1)) + 1); // generate random number

    i = "/design/corporate_site/images/bgrotativo/aerial_"+ n+ ".jpg";
  } else {
    // Aerial Images
    var r = 8; // # of images in set
    n = (Math.round(Math.random()*(r - 1)) + 1); // generate random number
     i = "/design/corporate_site/images/bgrotativo/aerial_"+ n+ ".jpg";
    credit = "";
  }





/*}*/

// write image CSS
document.write('<style type="text/css">.header-design1 {background-image: url(' + i + '); background-position:right; background-repeat:no-repeat;}</style>');

