function popimage(imagesrc,naslov,naziv){
	var look='status=no,scrollbars=no, width=300,height=300';
	popwin=window.open('',naziv,look);
	popwin.document.open();
	popwin.document.write('<head><title>'+naslov+'</title></head><body onLoad="self.resizeTo(document.imgItemPic.width+10,document.imgItemPic.height+50)" leftmargin="0" topmargin="0">');
	popwin.document.write('<a href="javascript:this.window.close()"><img name="imgItemPic" alt="'+naslov+'" border="0" vspace="0" hspace="0" src="'+imagesrc+'"></a>');
	popwin.document.write('</body>');
	popwin.document.close();
	popwin.focus();
}	

function newWindow(link,sirina,visina)
{
    var NewWin=window.open(link,'Rezultati','width='+ sirina +',height='+ visina +',toolbar=no,location=no,scrollbars=yes,resizable=yes');
    NewWin.focus()
}

//postavlja Html kao InnerHTML elementa ako postoji element s tim ID-om
function PostaviInnerHTMLElementa(Id, Html)
{
    var elem = this.document.getElementById(Id);
    
    if(elem!=null)
        elem.InnerHTML = Html;
}

function PrikaziStranicu(pStranica,pJezik)
{
    
    var Stranica = AjaxUtils.DajStranicu(pStranica,pJezik).value;
    
    PostaviInnerHTMLElementa('naslovstranice',Stranica.Naslov);
    PostaviInnerHTMLElementa('tekststranice',Stranica.Sadrzaj);   
}

function AjaxTest()
{
    alert( AjaxUtils.eho('hello ajax').value);
}


/*slide show*/
function runSlideShow(KlijentID)
{
   var mSlideShowImage = this.document.getElementById(KlijentID); 
   if (mSlideShowImage !=null)
   {
       if (mSlideShowImage.src !=null)
       {       
           mSlideShowImage.style.filter="blendTrans(duration=2)";
           mSlideShowImage.style.filter="blendTrans(duration=crossFadeDuration)";             
         
           if(navigator.appName=="Microsoft Internet Explorer")         
             mSlideShowImage.filters.blendTrans.Apply();          
             
             if(preLoad[j] !=null)
             {
                mSlideShowImage.src = preLoad[j].src;                                       
             }
                                  
           if(navigator.appName=="Microsoft Internet Explorer")                
             mSlideShowImage.filters.blendTrans.Play();

           j = j + 1;
           if (j > (p-1)) j=0;
           t = setTimeout('runSlideShow(' + KlijentID + ')', slideShowSpeed);
       }
       else
       {
        alert("Ne postoji HTML:  " + KlijentID);
       }
   }
}
/*menu*/

function viewForm(idName)
{    
    document.getElementById(idName).style.display = "block";
}
 function closeWindow(idName){
            this.document.getElementById(idName).style.display = 'none'
        } 		
					
function ShowNextChild(CurrentChildNumber)
	{
	    if (CurrentChildNumber==0)
	    {	        
	        var checkbox = this.document.getElementById('_ctl0_ContentPlaceHolder1_UC_upit1_CBdolozitesdjecom');
	        
	        if (checkbox!=null)
	        {
	            
	            if(checkbox.checked)
	            {
	                PrikaziDijete( CurrentChildNumber+1 );
	            }
	            else
	            {
	                var i;
	                for(i=1; i<6; i++)
	                   SakrijDijete(i);
	            }
	        }
	    }
	    else 
	    {
	        PrikaziDijete( CurrentChildNumber+1 );
	    }
	}
	
	function PrikaziDijete(ChildNumber)
	{
	     var nextTR = this.document.getElementById('dijete'+ChildNumber);
                          
	      if( nextTR != null )
	      {	
	            if(navigator.appName=="Microsoft Internet Explorer")
	             {
	                nextTR.style.display = "block";
	             }
	      else
	            nextTR.style.display = "table-row";
	      }
	}
		
	function SakrijDijete(ChildNumber)
	{
	     var nextTR = this.document.getElementById('dijete'+ChildNumber);
    	    
	      if( nextTR != null )
	      {	
	            nextTR.style.display = "none";
	      }
	}