var banner = new Array();
banner[0] = "images/daily/laserlab.jpg"
banner[1] = "images/daily/Duck&Swan.jpg"
banner[2] = "images/daily/femtolab.jpg"
banner[3] = "images/daily/femtolab2.jpg"
banner[4] = "images/daily/neilbanjo.jpg"
banner[5] = "images/daily/ablation.jpg";

var caption = new Array();
caption[0] = "New labs under construction."
caption[1] = "Heard of the <a href=http://en.wikipedia.org/wiki/Swan_bands>Swan</a> bands of C<sub>2</sub>? Now there are the <a href=http://scitation.aip.org/getabs/servlet/GetabsServlet?prog=normal&id=JCPSA6000125000023231101000001&idtype=cvips&gifs=yes>duck</a> bands."
caption[2] = "New femtosecond laboratory."
caption[3] = "The femtosecond laboratory up and running."
caption[4] = "Neil Reaily playing the 3-Phenyl-propyne, colloquially referred to as the banjoyne."
caption[5] = "The 532nm ablation laser path etched into a rotating hexa-<i>peri</i>-hexabenzocoronene disc housed in a planetary gearing mechanism.";

var title = new Array();

for (i = 0; i <= caption.length-1; i++)
{
temp = caption[i];
title[i]=temp;
while (temp.match("<") != null)
{
temp=temp.replace(temp.substring(temp.indexOf("<"),temp.indexOf(">")+1),"");
}
title[i]=temp;
}


function randImgCap()
{


random = Math.floor(Math.random() * banner.length);
figure= random + 1;

document.getElementById ('randomImage').src = banner[random];
document.getElementById ('randomImage').alt = title[random];
document.getElementById ('randomImage').title = title[random];
document.getElementById ('caption').innerHTML = "<strong>Figure "+figure+".</strong> "+caption[random];
document.getElementById ('link').href = banner[random];
}

function NextRight()
{

count = random++;
count++;
figure=count+1;

if (count < banner.length)
{
document.getElementById('randomImage').src=banner[count];
document.getElementById ('randomImage').title = title[count];
document.getElementById ('randomImage').alt = title[count];
document.getElementById('caption').innerHTML="<strong>Figure "+figure+".</strong> "+caption[count];
document.getElementById ('link').href = banner[count];
}
else
{
count--;
random = count;
}
}

function NextLeft()
{

count = random--;
count--;
figure=count+1;

if (count > -1)
{
document.getElementById('randomImage').src=banner[count];
document.getElementById ('randomImage').title = title[count];
document.getElementById ('randomImage').alt = title[count];
document.getElementById('caption').innerHTML="<strong>Figure "+figure+".</strong> "+caption[count];
document.getElementById ('link').href = banner[count];
}
else
{
count++;
random=count;
}
}