﻿
var patrons = new Array();
var currentLogo=0;
var nextLogo=0
   
function patron(index,logo,web) {
    this.logo=logo;
    this.web=web;
    this.index=index;
}


function ChangeLogo() {
try {
currentLogo=currentLogo+1;
nextLogo=nextLogo +1;


if (nextLogo==(patrons.length)) { nextLogo=1;}
if (currentLogo == 6) { currentLogo=1}
AddLogo(currentLogo,nextLogo);
} catch(err) {}
t=setTimeout("ChangeLogo()",1000);
}

function AddLogo(i,j) {
	    var objPatron = document.getElementById('patron' + i);
	    objPatron.innerHTML = "";
	    web=patrons[j].web;
	    logo=patrons[j].logo;
        objPatron.innerHTML = "<a style='text-decoration:none' target='_blank' href='" + web + "' ><img border='0' src='" + logo + "' /></a>";
}

function StartLogos() {

    try {
    nextLogo =parseInt(Math.random()*(patrons.length));

	for (i=1;i<6;i++) {
	    AddLogo(i,nextLogo);
	    nextLogo=nextLogo+1;
	    if (nextLogo==patrons.length) { nextLogo=1;}
	}
	} catch(err) {}
    ChangeLogo(1,nextLogo);
}

