// JavaScript Document
function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * n ) );
}



// Store some random image URL's
var random_images = new Array ( );
random_images[0] = '<a href="../prStory.php"><img src="../images/home/home_healthcare.jpg" border="0" align="center" alt="Health Care" id="photo" /></a>';
random_images[1] = '<a href="../trafficStory.php"><img src="../images/home/home_pr.jpg" border="0" align="center" alt="Puerto Rico" id="photo" /></a>';
random_images[2] = '<a href="../radioShackStory.php"><img src="../images/home/home_radioShack.jpg" border="0" align="center" alt="Radio Shack" id="photo" /></a>';
random_images[3] = '<a href="../healthcareStory.php"><img src="../images/home/home_traffic.jpg" border="0" align="center" alt="Traffic Story" id="photo" /></a>';

function pick_image ( )
{


var index;
	index = rand(4);
  document.write (random_images[index]);
}



// Store some random image URL's
var random_people = new Array ( );
random_people[0] = '<a href="#"><img src="images/home/bestPlaceHome.jpg" border="0" align="center" alt="Walter P Moore: Best Place to Work" /></a>';
random_people[1] = '<a href="#"><img src="images/home/whyEngHome.jpg" border="0" align="center" alt="Interviews with Five Engineers" /></a>';



function pick_person ( )
{
	
var index;
	index = rand(2);
  document.write (random_people[index]);
}



// Store some random image URL's
var random_story = new Array ( );
random_story[0] = '<a href="#"><img src="images/home/bimHome.jpg" border="0" align="center" alt="Building Information Modeling (BIM)" /></a>';
random_story[1] = '<a href="#"><img src="images/home/airportSD.jpg" border="0" align="center" alt="Airport Secure Design" /></a>';



function pick_story ( )
{
	
var index;
	index = rand(2);
  document.write (random_story[index]);
}

function breadcrumbs(){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a href=../\"/\">Home</a>  >  ";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  for(var i in bits){
    output += "<a href=\"";
    for(y=1;y<x-i;y++){
      output += "../";
    }
    output += bits[i] + "/\">" + bits[i] + "</a>  >  ";
  }
  document.write(output + document.title);
}
