/* define image urls */

if (document.images)
 {
     pic1= new Image();
     pic1.src="img/header_photo_1.jpg";  
     pic2= new Image(); 
     pic2.src="img/header_photo_2.jpg"; 
     pic3= new Image();
     pic3.src="img/header_photo_3.jpg";  
     pic4= new Image();
     pic4.src="img/header_photo_4.jpg";  
     pic5= new Image();
     pic5.src="img/header_photo_5.jpg"; 
     pic6= new Image();
     pic6.src="img/header_photo_6.jpg"; 
     pic7= new Image();
     pic7.src="img/header_photo_7.jpg"; 
     pic8= new Image();
     pic8.src="img/header_photo_8.jpg"; 
     pic9= new Image();
     pic9.src="img/header_photo_9.jpg"; 
     pic10= new Image();
     pic10.src="img/header_photo_10.jpg"; 
 }    

/* define captions */

capt1="The <em>Tasman Spirit</em> ran aground and broke in two near the entrance to Karachi port.<br />Source: Studio Mancinelli, Genova.";
capt2="The <em>Selendang Ayu</em> broken in two after a main engine breakdown and a grounding in Alaska.<br />Source: Smit Internationale.";
capt3="The <em>Repubblica di Genova</em> after rightning in Antwerp.<br />Source: unknown.";
capt4="The <em>Hyundai Fortune</em> suffered a severe fire.<br />Source: The International Salvage Union.";
capt5="The bow of a large container vessel after a collision off China.<br />Source: unknown.";
capt6="The <em>Pasha Bulker</em> grounded near Newcastle, Australia.<br />Source: The International Salvage Union";
capt7="Surveying a ro-ro heavily listed after a fire.<br />Source: Studio Vaccari, Genova";
capt8="The ro-ro <em>Camilla</em> abandoned in the North Atlantic following a main engine failure.<br />Source: The International Salvage Union";
capt9="Heavy weather.<br />Source: unknown";
capt10="The <em>MSC Napoli</em>.<br />Source: unknown";

/* no need to edit past this point (unless you want to add more image and url slots) */

function get_random(maxNum)
{
  if (Math.random && Math.round)
  {
    var ranNum= Math.round(Math.random()*(maxNum-1));
    ranNum+=1;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum; 
  }
}

  var choose_one= get_random(10);  
  choose_one--;

function get_Image()
{
 if (document.images)
 {
  var pics= new Array(10) 
   pics[0]=pic1.src;
   pics[1]=pic2.src;
   pics[2]=pic3.src;
   pics[3]=pic4.src;
   pics[4]=pic5.src; 
   pics[5]=pic6.src; 
   pics[6]=pic7.src; 
   pics[7]=pic8.src; 
   pics[8]=pic9.src; 
   pics[9]=pic10.src; 

  document.write("<img src='"+pics[choose_one]+"' width='720' height='320' alt=''>");
 }
}

function get_Caption()
{
 if (document.images)
 {
  var acapt= new Array(10)
  acapt[0]=capt1;
  acapt[1]=capt2;
  acapt[2]=capt3;
  acapt[3]=capt4;
  acapt[4]=capt5;
  acapt[5]=capt6;
  acapt[6]=capt7;
  acapt[7]=capt8;
  acapt[8]=capt9;
  acapt[9]=capt10;

  document.write(acapt[choose_one]);
 }
}
