//var BrojKutija=1;
var levoVisina;
var sredinaVisina;
var desnoVisina;
			function AkcijaPokazi(vrsta, ID,IDa)
			{
				//alert(vrsta+' - '+ID+'-'+IDa);
				AjaxAkcijePogledane(IDa)
				
				if (vrsta==2) location.href="komentari.php?id="+ID+"&vrs=1";//komentari unosi	
				if (vrsta==0) location.href="komentari.php?id="+ID+"&vrs=2";//komentari profila				
				if (vrsta==1) location.href="komentari.php?id="+ID+"&vrs=3";//komentari video
				if (vrsta==3) location.href="komentari.php?id="+ID+"&vrs=0";//komentari fotogalerije
				if (vrsta==4) location.href="komentari.php?id="+ID+"&vrs=4";//komentari posebnih unosa
				if (vrsta==5) location.href="http://127.0.0.1/porukeFanovaJednog.php?str=1&mod=0";//poslate poruke							
			}
			function AkcijaOK(IDa)
			{				
				AjaxAkcijePogledane(IDa)
			}
			
			function mouseOver(ele)
			{
				ele.style.color="yellow";
				ele.style.cursor="pointer";
			}
			function mouseOut(ele)
			{
				ele.style.color="#ffffff";
				ele.style.cursor="default";
			}
			function changeBGImage() 
			{
        		newImage = "url(../_css/pozadinaBody.jpg)";
        		document.body.style.backgroundImage = newImage;
      		}

			function OdjaviSe()
			{
				location.href="logout.php";	
			}		
			function RegistrujSe()
			{
				location.href="registracijaForm.php";	
			}
			function PrijaviSe()
			{
				location.href="loginForma.php";	
			}
			function ZaboravljenaLozinka()
			{
				location.href="zaboravljenaLozinkaForm.php";	
			}
					
			function IEBrovser()
			{
				//alert(navigator.userAgent);
				if (navigator.userAgent.indexOf("MSIE")!=-1) {rez=true} else {rez=false};
				return rez;
			}
			function FirefoxBrovser()
			{
				//alert(navigator.userAgent);
				if (navigator.userAgent.indexOf("Firefox")!=-1) {rez=true} else {rez=false};
				return rez;
			}
			function OperaBrovser()
			{
				//alert(navigator.userAgent);
				if (navigator.userAgent.indexOf("Opera")!=-1) {rez=true} else {rez=false};
				return rez;
			}
			function VerzijaBrovser()
			{
				if (IEBrovser()) 
				{
					ver=navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+4,100);
					ver=ver.substr(0,ver.indexOf('.'));
				}
				if (FirefoxBrovser()) 
				{
					ver=navigator.userAgent.substr(navigator.userAgent.indexOf('Firefox')+8,100);
					ver=ver.substr(0,ver.indexOf('.'));
				}
				if (OperaBrovser()) 
				{
					ver=navigator.userAgent.substr(navigator.userAgent.indexOf('Opera')+5,100);
					ver=ver.substr(0,ver.indexOf('.'));
				}
				if (!IEBrovser() && !FirefoxBrovser() && !OperaBrovser()) ver="0";
				ver=parseInt(ver);
				return ver;				
			}
			function PNG24()
			{
				if (IEBrovser() &&  VerzijaBrovser()>6) return true;
				if (FirefoxBrovser() &&  VerzijaBrovser()>1) return true;
				if (OperaBrovser() &&  VerzijaBrovser()>8) return true;
				return false;
			}
			
					
			function UbaciKutiju(brID)
			{
				if (document.getElementById('kutija'+brID))
				{
					minus=8;
					if (FirefoxBrovser()) 
					{
						//document.getElementById('kutija'+brID).childNodes[0].style.height=document.getElementById('kutija'+brID).childNodes[2].offsetHeight+22
						document.getElementById('kutija'+brID).childNodes[0].style.height=document.getElementById('kutija'+brID).childNodes[2].offsetHeight+document.getElementById('kutija'+brID).childNodes[1].offsetHeight
						document.getElementById('kutija'+brID).childNodes[0].style.width=document.getElementById('kutija'+brID).offsetWidth-minus;
						
					}
					else
					{
						document.getElementById('kutija'+brID).childNodes[0].style.height=document.getElementById('kutija'+brID).offsetHeight-minus;
						document.getElementById('kutija'+brID).childNodes[0].style.width=document.getElementById('kutija'+brID).offsetWidth-minus;
					}					
					if (IEBrovser()) 
					{
						if (VerzijaBrovser()<7) korekcija=5;else korekcija=0;
						document.getElementById('kutija'+brID).style.width=document.getElementById('kutija'+brID).parentNode.offsetWidth-8-korekcija;
						document.getElementById('kutija'+brID).childNodes[0].style.width=document.getElementById('kutija'+brID).parentNode.offsetWidth-8-korekcija;
					}
				}
			}		
					

			function UbaciKutijuS(brID,floatt)
			{
				if (document.getElementById('kutijaS'+brID))
				{
				
					minus=8;
					if (FirefoxBrovser() || OperaBrovser()) 
					{
						visSlike=document.getElementById('kutijaS'+brID).childNodes[2].offsetHeight+2;
						visSadrzaja=document.getElementById('kutijaS'+brID).childNodes[3].offsetHeight;					
						if (visSlike>visSadrzaja) visMax=visSlike; else visMax=visSadrzaja
						document.getElementById('kutijaS'+brID).childNodes[0].style.height=visMax+22
						document.getElementById('kutijaS'+brID).childNodes[0].style.width=document.getElementById('kutijaS'+brID).offsetWidth-minus;
						document.getElementById('kutijaS'+brID).style.height=visMax+22
						
					}
					else
					{
						document.getElementById('kutijaS'+brID).childNodes[0].style.height=document.getElementById('kutijaS'+brID).offsetHeight-minus;
						document.getElementById('kutijaS'+brID).childNodes[0].style.width=document.getElementById('kutijaS'+brID).offsetWidth-minus;
					}
					if (floatt=true)
					{
						sirSlike=document.getElementById('kutijaS'+brID).childNodes[2].offsetWidth+4;//+4 za pading i margine
						document.getElementById('kutijaS'+brID).childNodes[3].style.margin='0 0 0 '+sirSlike+'px';
					}				
					if (IEBrovser()) 
					{
						document.getElementById('kutijaS'+brID).style.width=document.getElementById('kutijaS'+brID).parentNode.offsetWidth-8;
						document.getElementById('kutijaS'+brID).childNodes[0].style.width=document.getElementById('kutijaS'+brID).parentNode.offsetWidth-8;
					}
				}
				
			}		
			
			//function UbaciKutijuNaslovna(kont,brID,naslov,bulet)
			function UbaciKutijuNaslovna(brID)
			{
				if (document.getElementById('kutijaN'+brID))
				{	
					minus=8;
					document.getElementById('kutijaN'+brID).childNodes[0].style.height=document.getElementById('kutijaN'+brID).childNodes[1].offsetHeight
					document.getElementById('kutijaN'+brID).childNodes[0].style.width=document.getElementById('kutijaN'+brID).offsetWidth-minus;
					document.getElementById('kutijaN'+brID).style.height=document.getElementById('kutijaN'+brID).childNodes[1].offsetHeight					
				}
			}
			
			function VratiVisinu(div)
			{
				
				d=document.getElementById(div);     				
     			max=0;
     			c=0;
				for(var i=0;i<d.childNodes.length;i++)
					if (d.childNodes.item(i).tagName=='DIV')
					{
						if (d.childNodes.item(i).id!='tab33')
						max=max+d.childNodes.item(i).offsetHeight;
						c++;
						//if (div=='side-b') alert(d.childNodes.item(i).id)
					}
				max=max+c*2;
				return max;			
			}

			function PoravnajVisine()
			{					
					
					maxL=VratiVisinu('side-a');
					maxS=VratiVisinu('content');
					maxD=VratiVisinu('side-b');
					
					
					sredinaVisina=maxS;
					desnoVisina=maxD;
					levoVisina=maxL;
								
					max=maxD;
								
					if (max<maxL) max=maxL;
					if (max<maxS) max=maxS;
					
					//alert(maxL+'.'+maxS+'.'+maxD);
					
					mozeLevo=true;
					mozeDesno=true;
					mozeSredina=true;
					if (max==sredinaVisina) mozeSredina=false;
					if (max==desnoVisina) mozeDesno=false;
					if (max==levoVisina) mozeLevo=false;
					
				
					desno=max-desnoVisina;
					levo=max-levoVisina;
					sredina=max-sredinaVisina;	

					
					
					
					if (mozeDesno==true)
					{
						boksPozadine3='<div id="prazno3" class="kutija" style="height:0px;margine:0;padding:0px" ><div class="kutijaPozadina" style="padding:0px;margine:0"></div></div>';
					document.getElementById('side-b').innerHTML=document.getElementById('side-b').innerHTML+boksPozadine3;
					document.getElementById('prazno3').style.height=desno+'px';
					}
					if (mozeSredina==true)
					{
					boksPozadine2='<div id="prazno2" class="kutija" style="height:0px;margine:0;padding:0px" ><div class="kutijaPozadina" style="padding:0px;margine:0"></div></div>';
					document.getElementById('content').innerHTML=document.getElementById('content').innerHTML+boksPozadine2;
					document.getElementById('prazno2').style.height=sredina+'px';
					}
					if (mozeLevo==true)
					{
					boksPozadine1='<div id="prazno1" class="kutija" style="height:0px;margine:0;padding:0px" ><div class="kutijaPozadina" style="padding:0px;margine:0"></div></div>';
					document.getElementById('side-a').innerHTML=document.getElementById('side-a').innerHTML+boksPozadine1;				
					document.getElementById('prazno1').style.height=levo+'px';
					}
					
					max=max+6;			
					document.getElementById('side-a').style.height=max+'px';
					document.getElementById('content').style.height=max+'px';
					document.getElementById('side-b').style.height=max+'px';
					
					if (document.getElementById('txt'))
						new autoComplete(aNames,document.getElementById('txt')  ,document.getElementById('suggest'),10);
			}
			
			function IdiNaStranicu(url)
			{
				location.href=url;
			}
			
			function VratiSe()
			{
				history.back();
				//alert(111111)
			}
			
			function UbaciKutijuPaginacija()
			{	
				if (document.getElementById('kutijaP'))
				{
					document.getElementById('kutijaP').childNodes[0].style.height=25//document.getElementById('kutija'+brID).childNodes[1].offsetHeight
					document.getElementById('kutijaP').childNodes[0].style.width=document.getElementById('kutijaP').offsetWidth;
					document.getElementById('kutijaP').style.height=25//document.getElementById('kutija'+brID).childNodes[1].offsetHeight			
				}
			}
			
			function PrikaziFotku(idF,idG)
			{
				//var newWindow;				
				newWindow = window.open("prikaziSliku.php?idF="+idF+"&idG="+idG,"","height=400,width=450,resizable=yes");				
				newWindow.focus();				
			}
			function PrikaziVideo(putanja)
			{
				var newWindow;
			newWindow = window.open("","","height=277,width=330");
		
			newWindow.document.write('<div id="flashP" class="slikaClass">');
			newWindow.document.write('www.plutoniaband.com');	
			newWindow.document.write('<br/>ucitavanje flash-a');
			newWindow.document.write('<br/>u toku');
			newWindow.document.write('</div>');
			newWindow.document.write('<script src="_scripts/swfobject.js" type="text/javascript"></script>');
			newWindow.document.write('<link href="_css/osnova.css" rel="stylesheet" type="text/css">');

			newWindow.document.close();
			newWindow.focus();
			
			dat=new Date();			
			tmp=dat.toLocaleTimeString();
			
			var so = new SWFObject("_slikee/plejer01.swf?tmp", "mymovie", "320", "267", "8", "#FFFFFF");
			//so.addParam("wmode", "transparent");			
			so.addVariable("url", putanja);
			so.write(newWindow.document.getElementById("flashP"));
			newWindow.document.bgColor="#000000";
			}