var imgOn  = new Array();
var imgOff = new Array();

if(typeof imgNum=='undefined'){imgNum=10;} // setuje imgNum
                                           // ako nije definisana



//  ****** 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";

   }
}



// ******** 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");
 }


// *********** pop up - das team ****************

// 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);
}

function openPopup1(index,query,w,h){
   index++;
   if((query=='faqs') || (query=='7besond'))
    {
      var satName = "/pp.wbsp?wb_startRec=" + index + "&wb_query=page='" + query + "'&imgNum="+parseInt(index-1);
     }else{
          var satName = "/pp.wbsp?wb_startRec=" + index + "&wb_query=page='" + query + "'";
        }
 window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);

}


function openPopup(index,query,w,h){
 //  index*=1;
   var satName = "/pp.wbsp?wbf_id=" + index;

   window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);

}


function openPP(index,w,h){

   var satName = "/pprest.wbsp?WBF_id=" + index;
   window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);
}


function openPP1(index,w,h){

   var satName = "/pp1.wbsp?WBF_id=" + index;
   window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);
}


function openPopupNews(index,w,h){
   index*=1;
   var satName = "/ppnews.wbsp?WBF_ID=" + index;
   window.open(satName, "Window", "top=1,left=1,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+w+",height="+h);
 }


//*********************************************************************
//**********************   S C R O L L  *******************************
//*********************************************************************



function up(){
if (document.scroll1.document.scroll2.top<0)
document.scroll1.document.scroll2.top+=10
temp2=setTimeout("up()",50)

}
function down(){
if (!document.layers) return
if (document.scroll1.document.scroll2.top-150>=document.scroll1.document.scroll2.document.height*-1)
document.scroll1.document.scroll2.top-=10
temp=setTimeout("down()",50)
}
 
function clearup(){
if (window.temp2)
clearInterval(temp2)
}
 
function cleardown(){
if (window.temp)
clearInterval(temp)
}
 
