var imgOn  = new Array();
var imgOff = new Array();
var imgMain = new Array();
pathMain='../images/';
imgMainNum = 4;


if(typeof imgNum=='undefined'){imgNum=5;} // setuje imgNum
                                           // ako nije definisana



// *******                                 AKTIVACIJA FLASHA   -------------



function WriteFlash(f_id, f_movie, f_width, f_height){
  html = '';
  html += '<object id="' + f_id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + f_width + '" height="' + f_height + '" align="middle">';
  html += '<param name="allowScriptAccess" value="sameDomain" />';
  html += '<param name="movie" value="' + f_movie + '" />';
  html += '<param name="quality" value="high" />';
  html += '<param name="bgcolor" value="#ffffff" /><embed id="' + f_id + '" src="' + f_movie + '" quality="high" bgcolor="#ffffff" width="' + f_width + '" height="' + f_height + '" name="' + f_id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
  html += '</object>';
  document.write(html);
  }


function WriteAnketa(){
  var n=navigator.userAgent;
  if(n.indexOf("Firefox")!=-1) return;
  html = '';

  html += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
  html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
  html += ' WIDTH="320" HEIGHT="250" id="anketa" ALIGN="">';
  html += ' <PARAM NAME=movie VALUE="anketa.swf">';
  html += ' <PARAM NAME=wmode VALUE=transparent>';
  html += '  <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#CCCCCC> <EMBED src="anketa.swf" quality=high bgcolor=#CCCCCC  WIDTH="320" HEIGHT="250" NAME="anketa" ALIGN=""';
  html += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
  html += '</OBJECT>';
  document.write(html);
  }


function WriteTV(){
  var n=navigator.userAgent;
  /*
  if(n.indexOf("Firefox")!=-1){
    document.write('<img src="tv.gif" WIDTH="197" HEIGHT="120" border="0">');
    return;
    }
  */
  html = '';
  html += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
  html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
  html += ' WIDTH="197" HEIGHT="120" id="tv" ALIGN="">';
  html += ' <param name="wmode" value="transparent">';
  html += ' <PARAM NAME=movie VALUE="tv.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#ffffff> <EMBED wmode="transparent" src="tv.swf" quality=high bgcolor=#ffffff  WIDTH="197" HEIGHT="120" NAME="tv" ALIGN=""';
  html += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
  html += '</OBJECT>';
  document.write(html);
  }

function WriteVT(){
  html = '';
  html += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
  html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
  html += ' WIDTH="281" HEIGHT="100" id="VirtualNaslovna" ALIGN="">';
  html += ' <PARAM NAME=movie VALUE="VirtualNaslovna.swf">';
  html += '  <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="VirtualNaslovna.swf" quality=high bgcolor=#FFFFFF  WIDTH="281" HEIGHT="100" NAME="VirtualNaslovna" ALIGN=""';
  html += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
  html += '</OBJECT>';
  document.write(html);
  }


function WriteVTBig(){
  html = '';
  html += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
  html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
  html += ' WIDTH="440" HEIGHT="440" id="VirtualBigColourReal" ALIGN="">';
  html += ' <PARAM NAME=movie VALUE="VirtualBigColourReal.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="VirtualBigColourReal.swf" quality=high wmode=transparent bgcolor=#FFFFFF  WIDTH="440" HEIGHT="440" NAME="VirtualBigColourReal" ALIGN=""';
  html += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
  html += '</OBJECT>';
  document.write(html);
  }


//  ****** RND *******************
function RndPic(){
  srcLeftImg=Math.floor(arrLeftPicsSrc.length*Math.random());
  //document.images['leftpic'].src=path + arrLeftPicsSrc[srcLeftImg];
  document.write('<img src="'+path + arrLeftPicsSrc[srcLeftImg]+'" border="0" width="211" height="287">');
}


// ******* Preloading slika ***************

function init(){
   for (i=0;i<imgNum;i++){                 // inicijalizacija slika za meni
         imgOn[i]=new Image();
         imgOn[i].src=path + img[i]+"_on.gif";
         imgOff[i]=new Image();
         imgOff[i].src=path + img[i]+"_off.gif";
   }
   for(i=0;i<imgMainNum;i++){
         imgMain[i]=new Image();
         imgMain[i].src=pathMain + "main"+i+".jpg";
     }

}



// ******** OVER/OUT slika u meniju **************

function imgOver(id){
  if(active[id]!=1){
        eval("document.images['img"+id+"'].src=imgOn["+id+"].src");
    }
 }

function imgOut(id){
  if(active[id]!=1){
        eval("document.images['img"+id+"'].src=imgOff["+id+"].src");
    }
 }




// ******** Setuje link aktivnim **********

function setActive(name){
   active[name]=1;
   eval("document.images['img"+name+"'].src=imgOn["+name+"].src");
 }


// ******* random main photo ***************

function showImage(){
  rndPic = Math.floor(Math.random()*imgMainNum);
  return '<img src="/images/main'+rndPic+'.jpg" width="480" height="222">';
  }

// *****************************************



// ************* popup funkcija **************
// scroll ON
function openWindow(satName,w,h){
   window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);
}


// FLASH opis

function opentext(num){
  window.open("/pan/opis"+num+".htm","flashOpis","toolbar=0 top=1 left=1 width=350 scrollbars=1 height=450");
  }


// ********* ANKETA ********

function setAnketa(){
  var centerX = Math.round(document.body.clientWidth/2);
  document.getElementById("anketa").style.left = centerX - 330;
  document.getElementById("anketa").style.top = 25;

  }
  
function openjplakat(url){
  window.open(url,"jplakati","toolbar=0 top=1 left=1 width=790 scrollbars=1 height=400");
  }

function openplakat(url){
  window.open(url,"plakati","toolbar=0 top=1 left=1 width=790 scrollbars=1 height=620");
  }

  
