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*/
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) { 
	window.attachEvent("onload", sfHover);
}

function viewForm(idName)
{    
    document.getElementById(idName).style.display = "block";
}
 function closeWindow(idName){
            this.document.getElementById(idName).style.display = 'none'
        } 		
					
function OtvoriScrollProzor(theURL,winName,x,y)
{
	var features;
	features ="width="+x+",height="+y+",left=50,top=20,scrollbars=yes,resizable=yes,location=no,status=no,menubar=no,toolbar=no,directories=no";
	var NewWin=window.open(theURL,winName,features);
	NewWin.focus();
 }