function prikazi_veliku(slika, sirina, visina, tekst)
		{
			document.images['velika_slika'].src=slika;
			document.images['velika_slika'].width=sirina;
			document.images['velika_slika'].heigth=visina;
			//document.getElementById('caption2').innerHTML=tekst;
			slika2 = slika.replace(/_velika/,"_xtra_velika");
			document.getElementById('velika_slika').href = "javascript:popupProzor('"+slika2+"', 400, 600)";
}

function popupProzor(ime,x,y) {
    eval("_popup=window.open('','_blank','toolbar=no,screenX=150,screenY=30,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ x +",height="+ y +"')");
    _popup.document.write("<html><body style='overflow: hidden;' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><a href='javascript:window.close();' title='Click to close'><img src='"+ime+"'  border='0' width='"+ x +"' height='"+ y+"'></a></body></html>");
    _popup.document.close();
}
function popupProzor2(ime,x,y) {
    eval("_popup=window.open('','_blank','toolbar=no,screenX=150,screenY=30,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+ x +",height="+ y +"')");
    _popup.document.write("<html><body style='overflow: hidden;' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><bgsound src="+ime+".wav loop=1><a href='javascript:window.close();' title='Click to close'><img src='"+ime+"'  border='0' width='"+ x +"' height='"+ y+"'></a><EMBED SRC="+ime+".wav loop=1></body></html>");
    _popup.document.close();
}
function popupAnketa(_opcija,_jezik){
    eval("_popup=window.open('../admin/anketa_odgovor.php?o='+_opcija+'&lang='+_jezik,'_blank','toolbar=no,screenX=150,screenY=30,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=150,height=70')");

}

function showHideDiv(id, a){

	var split_id = id.split("_");

	for(i = 1; i <= 4; i++){
		
		if( i != split_id[1] ){
			
			document.getElementById(split_id[0]+"_"+i).style.display='none';
		}
	}

	var div = document.getElementById(id);
	var a = document.getElementById(a);
	
	if( div.style.display == 'none' ) div.style.display='block';
	else if( div.style.display == 'block' ) div.style.display='none';
	
	if( a.className == 'drop' ) a.className = 'drop_akt';
	else if( a.className == 'drop_akt' ) a.className = 'drop';
	
	
}

function showHideDiv2(id, a){

	var div = document.getElementById(id);
	var a = document.getElementById(a);
	
	if( div.style.display == 'none' ) div.style.display='block';
	else if( div.style.display == 'block' ) div.style.display='none';
	
	if( a.className == 'drop' ) a.className = 'drop_akt';
	else if( a.className == 'drop_akt' ) a.className = 'drop';
}

function simplePopup(adresa,w,h){
  window.open(adresa,'_blank','toolbar=no,screenX=150,screenY=30,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h);
}

function canIFlash(ver){
             /*
              u ovoj skripti detektiramo da li postoji flash 5 ili ne, za sve sumnjive browsere bacamo imagemapu

             */
             var i=0;
             bName=navigator.appName;
             bVer=navigator.appVersion;


            // alert(bName);

             //alert(bVer);

             // ako nema pluginova uopce izbacujemo van
             //if (document.plugins.length==0) {return false;}

             // ako je browser IE verzija 4.5 , onda je to sigurno Mac sa 4.5 IE-om koji nije normalan i vraćamo false
             if ((bName.indexOf("Internet Explorer")!=-1)&&(bVer.indexOf("4.5")!=-1)&&(bVer.indexOf("Mac")!=-1)){
             //alert("Explorer 4.5 na Mac-u. NON PASARAN");
              return false;
             }

             // ako je browser IE na mac-u i prosao je detekciju 4.5 browsera vjeroatno je 5 ili veći pa ga puštamo
             //if ((bName.indexOf("Internet Explorer")!=-1)&&(bVer.indexOf("Macintosh")!=-1)){
             //alert("Explorer 5 ili veći  na Mac-u. prolazi");
             //return true;
             //}


             // ako je browser IE verzija 3 ili manja, nemože automatski update-ati Flash i vjerojatno je na jako slaboj mashini i ne puštamo flash u tom slučaju
             if ((bName.indexOf("Internet Explorer")!=-1)&&(parseInt(bVer)<4)){
               //alert("Preslabi explorer. NON PASARAN");
               return false;
             }


             // ako je browser slabi netscape, isto kao i kod slabih explorera
              if ((bName.indexOf("Netscape")!=-1)&&(parseInt(bVer)<4)){
               //alert("Preslabi Netscape. NON PASARAN");
               return false;
              }
              //kad smo eliminirali određene browsere, provjeravamo plugins niz, ako postoji za Flash 5

              // exploreri 4 i viši na windowsima automatski  update-aju flash, pa za njih sljedeće ne vrijedi
              if ((bName.indexOf("Internet Explorer")!=-1)&&(parseInt(bVer)>=4)&&(bVer.indexOf("Win")!=-1)){
               //alert("dovoljno jaka verzije Explorera da skinu plugin same!!")
               return true;
              }
              //ako ne postoji document.plugins vraćamo van
               if (!(navigator.plugins)){
                 //alert("Ovaj browser ne podržava plugin niz NON PASARAN")
                 return false;
               }
               //dalje parsamo kroz plugins niz u potrazi za flashom 5
               //alert(document.plugins.length);
                while (i<navigator.plugins.length){
                       //alert (navigator.plugins[i].description);
                       if ((navigator.plugins[i].description.indexOf("Flash")!=-1)){
                                if (navigator.plugins[i].description.indexOf("4.")!=-1){
                                 //alert("to je flash 4 -> preslabo");
                                 return false;
                                } else {
                                 //alert("nije flash 4 -> pretpostavit ćemo da je 5 ili veći");
                                 return true;
                                }
                       }
                       i++;
                }
                //ako su sve detekcije propale, pretpostavljamo da nema Flasha!!
               // alert("sve detekcije propale, pretpostavljamo da nema Flasha!!")
                return false;
}



function idi(_title,_x,_y) {

    if (document.getElementById("tipDiv").style.visibility!="visible"){
    document.getElementById("tipDiv").innerHTML="<table class='text'><tr><td nowrap>"+_title+"</td></tr></table>"  ;
    document.getElementById("tipDiv").style.visibility="visible";
    }
    document.getElementById("tipDiv").style.left=(_x-15)+'px';
    document.getElementById("tipDiv").style.top=(_y+15)+'px';

}

function sakrij(){
     document.getElementById("tipDiv").style.visibility="hidden";
 }

t=new Array();
t[0]=0;t[1]=1;

function DivExpandTo(divParam,from,to,i){
	if (t[i]) {clearTimeout(t[i]);}
	delta=-1;
	if ((from-to)<0){delta=1;}
	nfrom=from+((to-from)/2);
	document.getElementById(divParam).style.height=nfrom+'px';
	document.getElementById(divParam).style.clip="rect(0px,145px,"+nfrom+"px,0px)";
	
	if (Math.abs(nfrom-to)>2 ){
	  t[i]=setTimeout("DivExpandTo('"+divParam+"',"+nfrom+","+to+","+i+")",100);
	} else {
	document.getElementById(divParam).style.height=to+'px';
	document.getElementById(divParam).style.clip="rect(0px,145px,"+to+"px,0px)";
	}
	
	

}

function toggle(id) {

	id = "A"+id
	if(document.getElementById) {
		
		var el = document.getElementById(id);
		el.style.display = (el.style.display == 'none') ? 'block' : 'none';
	}
}
