var resizeDelay = 20;			// how many milliseconds we should wait between resizing events

var resizeIncrement = 5;		// how many pixels we should grow or shrink by each time we resize

var pocetniTekst, textMiki, textGoran, textMija, textZoki, textSrdjan;



var imgCache = new Object();	// this will hold information about the images we're dealing with



/* The getCacheTag function just creates a unique identifier for each <img> that we resize. */

function getCacheTag (imgElement)

{

	return imgElement.src + "~" + imgElement.offsetLeft + "~" + imgElement.offsetTop;

}



/* We're using this as a class to hold information about the <img> elements that we're manipulating. */

function cachedImg (imgElement, increment)

{

	this.img = imgElement;

	this.cacheTag = getCacheTag(imgElement);

	this.originalSrc = imgElement.src;

	

	var h = imgElement.height;

	var w = imgElement.width;

	this.originalHeight = h;

	this.originalWidth = w;

	

	increment = (!increment) ? resizeIncrement : increment;

	this.heightIncrement = Math.ceil(Math.min(1, (h / w)) * increment);

	this.widthIncrement = Math.ceil(Math.min(1, (w / h)) * increment);

}



/*

This is the function that should be called in the onMouseOver and onMouseOut

events of an <img> element. For example:



<img src='onesmaller.gif' onMouseOver='resizeImg(this, 150, "onebigger.gif")' onMouseOut='resizeImg(this)'>



The only required parameter is the first one (imgElement), which is a

reference to the <img> element itself. If you're calling from onMousexxx, 

you can just use "this" as the value.



The second parameter specifies how much larger or smaller we should resize

the image to, as a percentage of the original size. In the example above,

we want to resize it to be 150% larger. If this parameter is omitted, we'll

assume you want to resize the image to its original size (100%).



The third parameter can specify another image that should be used as the

image is being resized (it's common for "rollover images" to be similar but

slightly different or more colorful than the base images). If this parameter

is omitted, we'll just resize the existing image.

*/

function resizeImg (imgElement, percentChange, text, newImageURL)

{

	switch( text )

	{

		case 'miki' :

			document.getElementById('tekst').innerHTML = textMiki;

			break;

		case 'goran' :

			document.getElementById('tekst').innerHTML = textGoran;

			break;

		case 'mija' :

			document.getElementById('tekst').innerHTML = textMija;

			break;

		case 'zoki' :

			document.getElementById('tekst').innerHTML = textZoki;

			break;

		case 'srdjan' :

			document.getElementById('tekst').innerHTML = textSrdjan;

			break;

		default :

			document.getElementById('tekst').innerHTML = pocetniTekst;

	}

	// convert the percentage (like 150) to an percentage value we can use for calculations (like 1.5)

	var pct = (percentChange) ? percentChange / 100 : 1;

	

	// if we've already resized this image, it will have a "cacheTag" attribute

	// that should uniquely identify it. If the attribute is missing, create a

	// cacheTag and add the attribute

	var cacheTag = imgElement.getAttribute("cacheTag");

	if (!cacheTag)

	{

		cacheTag = getCacheTag(imgElement);

		imgElement.setAttribute("cacheTag", cacheTag);

	}

	

	// look for this image in our image cache. If it's not there, create it.

	// If it is there, update the percentage value.

	var cacheVal = imgCache[cacheTag];

	if (!cacheVal)

	{

		imgCache[cacheTag] = new Array(new cachedImg(imgElement), pct);

	} 

	else

	{

		cacheVal[1] = pct;

	}

	

	// if we're supposed to be using a rollover image, use it

	if (newImageURL) imgElement.src = newImageURL;

	

	// start the resizing loop. It will continue to call itself over and over

	// until the image has been resized to the proper value.

	resizeImgLoop(cacheTag);

	return true;

}



/* This is the function that actually does all the resizing. It calls itself repeatedly with setTimeout until the image is the right size. */

function resizeImgLoop (cacheTag)

{

	// get information about the image element from the image cache

	var cacheVal = imgCache[cacheTag];

	if (!cacheVal) return false;

	

	var cachedImageObj = cacheVal[0];

	var imgElement = cachedImageObj.img;

	var pct = cacheVal[1];

	var plusMinus = (pct > 1) ? 1 : -1;

	var hinc = plusMinus * cachedImageObj.heightIncrement;

	var vinc = plusMinus * cachedImageObj.widthIncrement;

	var startHeight = cachedImageObj.originalHeight;

	var startWidth = cachedImageObj.originalWidth;

	

	var currentHeight = imgElement.height;

	var currentWidth = imgElement.width;

	var endHeight = Math.round(startHeight * pct);

	var endWidth = Math.round(startWidth * pct);

	

	// if the image is already the right size, we can exit

	if ( (currentHeight == endHeight) || (currentWidth == endWidth) )

		return true;

	

	// increase or decrease the height and width, making sure we don't get

	// larger or smaller than the final size we're supposed to be

	var newHeight = currentHeight + hinc;

	var newWidth = currentWidth + vinc;

	if (pct > 1) {

		if ((newHeight >= endHeight) || (newWidth >= endWidth)) {

			newHeight = endHeight;

			newWidth = endWidth;

		}

	} else {

		if ((newHeight <= endHeight) || (newWidth <= endWidth)) {

			newHeight = endHeight;

			newWidth = endWidth;

		}

	}

	

	// set the image element to the new height and width

	imgElement.height = newHeight;

	imgElement.width = newWidth;

	

	// if we've returned to the original image size, we can restore the

	// original image as well (because we may have been using a rollover

	// image in the original call to resizeImg)

	if ((newHeight == cachedImageObj.originalHeight) || (newWidth == cachedImageObj.originalwidth)) {

		imgElement.src = cachedImageObj.originalSrc;

	}

	

	// shrink or grow again in a few milliseconds

	setTimeout("resizeImgLoop('" + cacheTag + "')", resizeDelay);

}



function Popuni()

{

	pocetniTekst = 

"Slatki Greh - bend za svadbe, ven&#269;anja i proslave, je od svog nastanka pa do danas pretrpeo mnoge izmene,"+"<br />"+

"kroz bend je pro&#353;lo mnogo vrhunskih muzi&#269;ara, ali do danas je zadr&#382;ao visok nivo muziciranja, repertoara"+"<br />"+

"i vrhunskih glasovnih mogu&#263;nosti, te s pravom nosi epitet:"+"<br />"+ "Vrhunski bend za svadbe, zabave i razne proslave." ;

	

	textMiki = "Miki - Jedan od najboljih peva&#269;a i zabavlja&#269;a u zemlji. "+ "<br />" + "Nije hteo medijsku karijeru, njegov &#382;ivot je svirka i "+ "<br />" + "pevanje u&#382;ivo na svadbama, zabavama i proslavama";

	textGoran = "Goran - ve&#263; pet godina u bendu, odli&#269;an muzi&#269;ar i peva&#269;. "+ "<br />" + "Stekao je veliko iskustvo dugo godina sviraju&#263;i u raznim "+ "<br />" + "bandovima &#353;irom ex Jugoslavije.";

	textMija = "Mija - originalni &#269;lan starog Slatkog Greha i jedan od idejnih tvoraca Brene i Greha. "+ "<br />" + "Sada &#353;ef podmladjene ekipe, vrhunski bubnjar i peva&#263;.";

	textZoki = "Zoki - Stari &#269;lan starog Slatkog greha. Obi&#353;ao svet nekoliko puta sa Brenom i ostalima. "+ "<br />" + "Multi-instrumentalista i izvrstan peva&#269; i zabavlja&#269;."+"<br/>"+"Jedan od najboljih klarinetista u zemlji.";

	textSrdjan = "Vladimir - Vrhunski klavijaturista i harmonika&#353;, predstavnik"+"<br />"+" mladje generacije, prva harmonika Vojvodine. "+ "<br />"+ "Uvek raspolo&#382;en, nasmejan i spreman za akciju.";

	

	

	

	document.getElementById('tekst').innerHTML = pocetniTekst;

	

	document.getElementById('slika1').src = "slike/mikismall.jpg";

	document.getElementById('slika2').src = "slike/goransmall.jpg";

	document.getElementById('slika3').src = "slike/mijasmall.jpg";

	document.getElementById('slika4').src = "slike/zokismall.jpg";

	document.getElementById('slika5').src = "slike/srdjansmall.jpg";

}
