//**************************************************************************************************************************************
// skripta za otvaranje velieke slike - autoresize
//**************************************************************************************************************************************
function popimage(imagesrc,naslov,naziv){
	var look='status=no,scrollbars=no, width=300,height=300';
	popwin=window.open('',naziv,look);
	popwin.document.open();
	popwin.document.write('<head><title>'+naslov+'</title></head><body background="../images/back_preload.gif" onLoad="self.resizeTo(document.imgItemPic.width+10,document.imgItemPic.height+25)" leftmargin="0" topmargin="0">');
	popwin.document.write('<a href="javascript:this.window.close()"><img name="imgItemPic" alt="'+naslov+'" border="0" vspace="0" hspace="0" src="'+imagesrc+'"></a>');
	popwin.document.write('</body>');
	popwin.document.close();
	popwin.focus();
}

//**************************************************************************************************************************************



//**************************************************************************************************************************************
// skripta za "+" i "-"
//**************************************************************************************************************************************
function displayhide00(id)
{
try
{
var spanID=document.all('Text00' + id);
var bulletID=document.all('Bullet00' + id);

if(spanID.style.display=='none') 
{
spanID.style.display = 'inline';
bulletID.src='../images/00_open.gif';
}
else if(spanID.style.display=='inline') 
{	
spanID.style.display = 'none';
bulletID.src='../images/00_closed.gif';
}
return (0);
}
catch (e) {}
}
//**************************************************************************************************************************************


				
//**************************************************************************************************************************************
// skripta za izmjenu slika
//**************************************************************************************************************************************
/*************************************************************************
  This code is from Dynamic Web Coding 
  at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.
*************************************************************************/

// Put your images in these arrays 
var img1_ar = new Array("mala_trcanje.jpg", "mala_jedro.jpg", "mala_kosarka.jpg", "mala_nogomet.jpg", "mala_odbojka.jpg");

// for the second set of rotating images 
var img2_ar = new Array("mala_odbojka.jpg", "mala_regata.jpg", "mala_skijanje.jpg", "mala_staza.jpg");

// If all the images you wish to display are in the same location, you can specify the path here 
rotateImgObj.imagesPath = "images/design/";

Array.prototype.shuffle = function() { 
  var i, temp, i1, i2;
  for (i=0; i<this.length; i++) { 
    i1 = Math.floor( Math.random() * this.length );
    i2 = Math.floor( Math.random() * this.length );
    temp = this[i1];
    this[i1] = this[i2];
    this[i2] = temp;
  }
}

// shuffle arrays set up above 
img1_ar.shuffle();
//img2_ar.shuffle();

function initImgRotation() {
  // create rotating image objects here 
  // arguments: image name, rotation speed
  var rotator1 = new rotateImgObj('img1',3000);
  // add the images to rotate into that image object (point to arrays set up above)
  rotator1.addImages(img1_ar);
  rotator1.rotate();
    
  var rotator2 = new rotateImgObj('img2',5000);
  rotator2.addImages(img2_ar);
  
  rotator2.rotate();
  
  // starts rotation for all defined rotateImgObjs
  for (var i=0; i<rotateImgObjs.length; i++) 
    rotateImgObjs[i].timer = setInterval(rotateImgObjs[i].animString + ".rotate()", rotateImgObjs[i].speed);
}

rotateImgObjs = []; // holds all rotating image objects defined
// constructor 
function rotateImgObj(nm,s) {
  this.speed = s; this.ctr=0; this.timer=0;  
  this.imgObj = document.images[nm]; // get reference to the image object
  this.index = rotateImgObjs.length; rotateImgObjs[this.index] = this;
  this.animString = "rotateImgObjs[" + this.index + "]";
  
  this.addImages = addRotatingImages;
  this.rotate = rotateImg;
}

// preloads images
function addRotatingImages(ar) {
  this.imgObj.imgs = [];
  for (var i=0; i<ar.length; i++) {
    this.imgObj.imgs[i] = new Image();
    this.imgObj.imgs[i].src = rotateImgObj.imagesPath + ar[i];
  }
}

// controls rotation
function rotateImg() {
  var ctr = Math.floor( Math.random() * this.imgObj.imgs.length );
  if (ctr == this.ctr) ctr = (ctr > 0)? --ctr: ++ctr;
  this.ctr = ctr;
  if ( typeof this.imgObj.filters != "undefined" ) {
 		this.imgObj.style.filter = 'blendTrans(duration=1)';
    this.imgObj.filters.blendTrans.Apply();
  }
  this.imgObj.src = this.imgObj.imgs[this.ctr].src;
  if ( typeof this.imgObj.filters != "undefined" ) this.imgObj.filters.blendTrans.Play();    
}
//**************************************************************************************************************************************



//**************************************************************************************************************************************
//otvaranje novog prozora
//**************************************************************************************************************************************

function popVijest(link,w,h)
{
var popVijest=window.open(link,'mapWin','width='+ w +',height='+ h +',toolbar=no,location=no,scrollbars=yes');
popVijest.focus()
}

//**************************************************************************************************************************************



//**************************************************************************************************************************************
//otvaranje linka u odrešenom frejmu
//**************************************************************************************************************************************
function OdiNaURL(link, frejm)
{
//window.navigate(link,'main')
parent.frames[frejm].location.href=link;
}

function newWindow(link,sirina,visina)
{
	var NewWin=window.open(link,'Sezonci','width='+ sirina +',height='+ visina +',toolbar=no,location=no,scrollbars=yes,resizable=yes');
	NewWin.focus()
}
