var intervalPonuda = 1; // delay between rotating images (in seconds)
var random_display_ponuda = 1; // 0 = no, 1 = yes
intervalPonuda *= 7821; //da se slike ne bi menjale u istom trenutku

var image_index_ponuda = 0;
image_list_ponuda = new Array();
image_list_ponuda[image_index_ponuda++] = new imageItemPonuda("images/ponuda/jointmd_mala.png");
image_list_ponuda[image_index_ponuda++] = new imageItemPonuda("images/ponuda/klompe_mala.png");
image_list_ponuda[image_index_ponuda++] = new imageItemPonuda("images/ponuda/kosmodisk_mala.png");
image_list_ponuda[image_index_ponuda++] = new imageItemPonuda("images/ponuda/papuce_mala.png");
image_list_ponuda[image_index_ponuda++] = new imageItemPonuda("images/ponuda/4321_mala.png");
var number_of_image_ponuda = image_list_ponuda.length;
function imageItemPonuda(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocationPonuda(imageObj) {
return(imageObj.image_item.src)
}
function generatePonuda(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImagePonuda() {
if (random_display_ponuda) {
image_index_ponuda = generatePonuda(0, number_of_image_ponuda-1);
}
else {
image_index_ponuda = (image_index_ponuda+1) % number_of_image_ponuda;
}
var new_image = get_ImageItemLocationPonuda(image_list_ponuda[image_index_ponuda]);
return(new_image);
}
function rotateImagePonuda(place) {
var new_image = getNextImagePonuda();
document[place].src = new_image;
var recur_call = "rotateImagePonuda('"+place+"')";
setTimeout(recur_call, intervalPonuda);
}
