var count=0;
var a;
var b;
var c;
var d;
var e;
var f;
var g;
var h;
var i;
var j;
var k;
var l;
var m;
var n;
var o;
var p;
var q;
var r;
var s;
var t;


function loadUp()
{
calcA();
calcB();
calcC();
calcD();
calcE();
calcF();
calcG();
calcH();
calcI();
calcJ();
calcK();
calcL();
calcM();
calcN();
calcO();
calcP();
calcQ();
calcR();
calcS();
calcT();
placePics();
}

function calcA() {
count++;
a = Math.round(Math.random() * (photoArrayR.length - 1));
}

function calcB() {
count++;
if (count <= photoArrayR.length)
{ do { b = Math.round(Math.random() * (photoArrayR.length - 1)); } while (b==a); }
}

function calcC() {
count++;
if (count <= photoArrayR.length)
{ do { c = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((c==a) || (c==b)); }
}

function calcD() {
count++;
if (count <= photoArrayR.length)
{ do { d = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((d==a) || (d==b) || (d==c)); }
}

function calcE() {
count++;
if (count <= photoArrayR.length)
{ do { e = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((e==a) || (e==b) || (e==c) || (e==d)); }
}

function calcF() {
count++;
if (count <= photoArrayR.length)
{ do { f = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((f==a) || (f==b) || (f==c) || (f==d) || (f==e)); }
}

function calcG() {
count++;
if (count <= photoArrayR.length)
{ do { g = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((g==a) || (g==b) || (g==c) || (g==d) || (g==e) || (g==f)); }
}

function calcH() {
count++;
if (count <= photoArrayR.length)
{ do { h = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((h==a) || (h==b) || (h==c) || (h==d) || (h==e) || (h==f) || (h==g)); }
}

function calcI() {
count++;
if (count <= photoArrayR.length)
{ do { i = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((i==a) || (i==b) || (i==c) || (i==d) || (i==e) || (i==f) || (i==g) || (i==h)); }
}

function calcJ() {
count++;
if (count <= photoArrayR.length)
{ do { j = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((j==a) || (j==b) || (j==c) || (j==d) || (j==e) || (j==f) || (j==g) || (j==h) || (j==i)); }
}

function calcK() {
count++;
if (count <= photoArrayR.length)
{ do { k = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((k==a) || (k==b) || (k==c) || (k==d) || (k==e) || (k==f) || (k==g) || (k==h) || (k==i) || (k==j)); }
}

function calcL() {
count++;
if (count <= photoArrayR.length)
{ do { l = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((l==a) || (l==b) || (l==c) || (l==d) || (l==e) || (l==f) || (l==g) || (l==h) || (l==i) || (l==j) || (l==k)); }
}

function calcM() {
count++;
if (count <= photoArrayR.length)
{ do { m = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((m==a) || (m==b) || (m==c) || (m==d) || (m==e) || (m==f) || (m==g) || (m==h) || (m==i) || (m==j) || (m==k) || (m==l)); }
}

function calcN() {
count++;
if (count <= photoArrayR.length)
{ do { n = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((n==a) || (n==b) || (n==c) || (n==d) || (n==e) || (n==f) || (n==g) || (n==h) || (n==i) || (n==j) || (n==k) || (n==l) || (n==m)); }
}

function calcO() {
count++;
if (count <= photoArrayR.length)
{ do { o = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((o==a) || (o==b) || (o==c) || (o==d) || (o==e) || (o==f) || (o==g) || (o==h) || (o==i) || (o==j) || (o==k) || (o==l) || (o==m) || (o==n)); }
}

function calcP() {
count++;
if (count <= photoArrayR.length)
{ do { p = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((p==a) || (p==b) || (p==c) || (p==d) || (p==e) || (p==f) || (p==g) || (p==h) || (p==i) || (p==j) || (p==k) || (p==l) || (p==m) || (p==n) || (p==o)); }
}

function calcQ() {
count++;
if (count <= photoArrayR.length)
{ do { q = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((q==a) || (q==b) || (q==c) || (q==d) || (q==e) || (q==f) || (q==g) || (q==h) || (q==i) || (q==j) || (q==k) || (q==l) || (q==m) || (q==n) || (q==o) || (q==p)); }
}

function calcR() {
count++;
if (count <= photoArrayR.length)
{ do { r = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((r==a) || (r==b) || (r==c) || (r==d) || (r==e) || (r==f) || (r==g) || (r==h) || (r==i) || (r==j) || (r==k) || (r==l) || (r==m) || (r==n) || (r==o) || (r==p) || (r==q)); }
}

function calcS() {
count++;
if (count <= photoArrayR.length)
{ do { s = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((s==a) || (s==b) || (s==c) || (s==d) || (s==e) || (s==f) || (s==g) || (s==h) || (s==i) || (s==j) || (s==k) || (s==l) || (s==m) || (s==n) || (s==o) || (s==p) || (s==q) || (s==r)); }
}

function calcT() {
count++;
if (count <= photoArrayR.length)
{ do { t = Math.round(Math.random() * (photoArrayR.length - 1)); } while ((t==a) || (t==b) || (t==c) || (t==d) || (t==e) || (t==f) || (t==g) || (t==h) || (t==i) || (t==j) || (t==k) || (t==l) || (t==m) || (t==n) || (t==o) || (t==p) || (t==q) || (t==r) || (t==s)); }
}

function placePics()
{
document.getElementById('Pic0').src=photoArrayR[a].src;
setStuff('Cap0',capArray[a]);
document.getElementById('Pic1').src=photoArrayR[b].src;
setStuff('Cap1',capArray[b]);
document.getElementById('Pic2').src=photoArrayR[c].src;
setStuff('Cap2',capArray[c]);
document.getElementById('Pic3').src=photoArrayR[d].src;
setStuff('Cap3',capArray[d]);
document.getElementById('Pic4').src=photoArrayR[e].src;
setStuff('Cap4',capArray[e]);
document.getElementById('Pic5').src=photoArrayR[f].src;
setStuff('Cap5',capArray[f]);
document.getElementById('Pic6').src=photoArrayR[g].src;
setStuff('Cap6',capArray[g]);
document.getElementById('Pic7').src=photoArrayR[h].src;
setStuff('Cap7',capArray[h]);
document.getElementById('Pic8').src=photoArrayR[i].src;
setStuff('Cap8',capArray[i]);
document.getElementById('Pic9').src=photoArrayR[j].src;
setStuff('Cap9',capArray[j]);
document.getElementById('Pic10').src=photoArrayR[k].src;
setStuff('Cap10',capArray[k]);
document.getElementById('Pic11').src=photoArrayR[l].src;
setStuff('Cap11',capArray[l]);
document.getElementById('Pic12').src=photoArrayR[m].src;
setStuff('Cap12',capArray[m]);
document.getElementById('Pic13').src=photoArrayR[n].src;
setStuff('Cap13',capArray[n]);
document.getElementById('Pic14').src=photoArrayR[o].src;
setStuff('Cap14',capArray[o]);
document.getElementById('Pic15').src=photoArrayR[p].src;
setStuff('Cap15',capArray[p]);
document.getElementById('Pic16').src=photoArrayR[q].src;
setStuff('Cap16',capArray[q]);
document.getElementById('Pic17').src=photoArrayR[r].src;
setStuff('Cap17',capArray[r]);
document.getElementById('Pic18').src=photoArrayR[s].src;
setStuff('Cap18',capArray[s]);
document.getElementById('Pic19').src=photoArrayR[t].src;
setStuff('Cap19',capArray[t]);
}
