var urlArray = new Array(4); //for URL's, increase size as necessary
var banArray = new Array(4); //for banners, increase size as necessary
var counter = 1;
var url = ""; //initial URL

//add your necessary URL's
urlArray[0] = "";
urlArray[1] = "";
urlArray[2] = "";

if(document.images) //pre-load all banner images
{
  for(i = 0; i < 4; i++)
  {
    banArray[i] = new Image(768, 90);
    banArray[i].src = "banners/banner" + (i+1) + ".jpg";
  }
}

function changeBanner() //banner changer function
{
  if(counter > 3)
   counter = 0;

  document.banner.src = banArray[counter].src; //sets a new banner

  url = urlArray[counter]; //sets a new URL to the banner
  counter++; //increase the counter for the next banner
}

//calls the changeBanner() function every 3 seconds
//change the timer as necessary (minutes * 60000) or (seconds * 1000)
var timer = window.setInterval("changeBanner()", 3000);

/* function openImg(img)
{
	var title = 'Biciklistički centar Ksyrium';
	var newImage = window.open('','','width=800,height=600,scrollbars=no,resizable=no,location=no,menubar=no,toolbar=no,top=0,left=0');
	newImage.document.writeln('<html><head><title>' +  title + '</title><style type="text/css"><!--body {margin-top: 0px; margin-left: 0px;}--></style>');
	newImage.document.writeln('</head><body>');
	newImage.document.writeln('<img src="' + img + '" border=0 />');
	newImage.document.writeln("</body></html>");
} */

function openImg(myimage) {
 html = "<HTML><HEAD><TITLE>Biciklistički centar Ksyrium</TITLE>" +
  "</HEAD><BODY LEFTMARGIN=0 " 
  + "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" 
  + "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " 
  + "onload='window.resizeTo(document.image.width,(document.image.height + 100))'>"
  + "</CENTER>" 
  + "</BODY></HTML>";
 popup=
 window.open
  ('','image',
  'width=800,height=600,scrollbars=no,resizable=no,location=no,menubar=no,toolbar=no,top=0,left=0');
 popup.document.open();
 popup.document.write(html);
 popup.document.close()
}

function DisplayMail(Server, Login, Display){
	if ((Display.length == 0) || (Display.indexOf('@')+1)) {
	document.write('<a href=' + '"mai' + 'lto:' + Login + '@' + Server + '">' + Login + '@' + Server + '<\/a>'); }
	else  {
	document.write('<a href=' + '"mai' + 'lto:' + Login + '@' + Server + '">' + Display + '<\/a>'); }
}