
function Pix(){ //constructor

this.items=new Array;
this.add=addPix;
this.get=getPix;
}

function addPix(pixURL,pixCaption){ //method to add record
var rec=new Object;
rec.url=pixURL;
rec.cap=pixCaption;
var itemCount=this.items.length;
this.items[itemCount]=rec;
}

function getPix(){ //method to get record
var itemCount=this.items.length;
var idx=Math.round(Math.random()*(itemCount-1));
var rec=this.items[idx];
var buf='<img src="' + rec.url + '" alt="' + rec.cap + '">';
buf+='<div class="caption">' + rec.cap + '</div>';
return buf;
}

var potd=new Pix; //create your list
potd.add('images/home/potd/h01.jpg','Postgraduate students at work in a computer session.');
potd.add('images/home/potd/h02.jpg','A tempting feast on offer at the bring a dish social event, October 2009.');
potd.add('images/home/potd/h03.jpg','Tolib Mirzoev and Laura Dallolio (UNIBO, Italy) at work in Hanoi,Vietnam, for the HEPVIC research project, 2007.');
potd.add('images/home/potd/h04.jpg','Human resource managers at work on a Nuffield Centre training course, Khartoum, Sudan 2009.');
potd.add('images/home/potd/h06.jpg','Masters students playing in the snow during their study trip to Geneva, Switzerland 2007.');
potd.add('images/home/potd/h07.jpg','Master in Public Health student Christopher Mtamakaya, on his graduation day, 2004.');
potd.add('images/home/potd/h08.jpg','John Walley discussing preparations for the H1N1 flu virus, China 2009.');
potd.add('images/home/potd/h09.jpg','The eyes have it - taken by BSc student Holly Fensom at a Tanzanian school which integrates children with disabilities, 2009.');
potd.add('images/home/potd/h10.jpg','Health education posters in a health centre, Swaziland.');
potd.add('images/home/potd/h11.jpg','After-hours discussion continues at the first HESVIC research meeting, September 2009.');
potd.add('images/home/potd/h12.jpg','Students on a social field trip to Liverpool, 2009.');
potd.add('images/home/potd/h13.jpg','Fudan University researchers at a workshop, HEPVIC project 2007.');
potd.add('images/home/potd/h14.jpg','COMDIS researchers captured this image of hospital patients and their intravenous drips, Guangxi Province China 2007.');
potd.add('images/home/potd/h18.jpg','James Newell focusing on our TB research, Bangladesh 2006.');
potd.add('images/home/potd/h28.jpg','International Event, 3rd October 2008. Dr Manuel Dayrit, Director, Department of Human Resources for Health, WHO.'); 
 potd.add('images/home/potd/h30.jpg','Steel Band entertaining at the International Event, 3rd October 2008'); 
potd.add('images/home/potd/h38.jpg','Breakfast being prepared for Dr Ricky Kalliecharan during a consultancy visit in Khartoum, Sudan, 2009.');





