﻿// JScript File
		var aDiv, aDivChild;
		var aSakrijMe;
		var aTimer;

		function showMenu(obj) {
			try{
		        menuSakrij();
				aDiv = document.getElementById(obj.id + "div");
			}
			catch(e) {}
			if (aDiv) {
			    aSakrijMe = false;
		        clearTimeout(aTimer); 
				aWidth = window.document.body.clientWidth - 800;
				if (aWidth < 0) {aWidth = 0} else {aWidth = aWidth / 2};
				if (obj.id == "m3"){
				aDiv.style.left = (aWidth + 460) + 'px';
				} else {
				aDiv.style.left = (aWidth  + 340) + 'px';
				}
				aDiv.style.display = "inline";
			}
		}
		
		function showSubMenu(obj) {
			try{
			    if(aDivChild) aDivChild.style.display = 'none';
				aDivChild = document.getElementById(obj.id + "Child");
			}
			catch(e) {}
			if (aDiv) {
			    if(aDivChild) {
				aWidth = window.document.body.clientWidth;
				aDivChild.style.left = parseInt(aDiv.style.left) + parseInt(aDiv.style.width) + 'px';
				aDivChild.style.top = parseInt(aDiv.style.top) + (parseInt(obj.id.slice(2,4)) * 21) - 21 + 'px';
				aDivChild.style.display = "inline";
				}
			}
		}
		
		function gumbOut() {
		    if ((!aSakrijMe)){
		        aSakrijMe = true;
		        clearTimeout(aTimer); 
		        aTimer = setTimeout('gumbOut()',2000);
		   }  else if (aSakrijMe){
		        menuSakrij();
		   }
		}
		
		function menuIn() {
		    aSakrijMe = false; 
		    clearTimeout(aTimer); 
		}
		
		function menuOut() {
		    if (!aSakrijMe) {
		        aSakrijMe = true;
		        setTimeout('menuSakrij()',2000);
		    }
		}
		
		function menuSakrij() {
		    if(aSakrijMe) {
		        if (aDiv) aDiv.style.display = "none";
		        if(aDivChild) aDivChild.style.display = 'none';
		        clearTimeout(aTimer); 
		   } 
		}
/*		
		function provjeriCursor() {
			if(aDiv) {
			    curX = window.event.clientX;
			    curY = window.event.clientY;
			    divX = parseInt(aDiv.style.left);
			    divY = parseInt(aDiv.style.top);
			    divWidth = parseInt(aDiv.style.width);
			    divHeight = parseInt(aDiv.style.height);
			    if ((curX < divX) || (curY > (divY+divHeight)) || (curX > (divX + divWidth)) || (curY < (divY-35))) {
			        if (aDivChild) {
			            divX = parseInt(aDivChild.style.left);
			            divY = parseInt(aDivChild.style.top);
			            divWidth = parseInt(aDivChild.style.width);
			            divHeight = parseInt(aDivChild.style.height);
			            if ((curX < divX) || (curY > (divY+divHeight)) || (curX > (divX + divWidth)) || (curY < (divY))) {
			                aDivChild.style.display = "none";
			                aDivChild = null;
			            }
			        } else {
			            aDiv.style.display = "none";
			            aDiv = null;
			            aDivChild = null;
			        }
			    }else if (aDivChild) {
		            divY = parseInt(aDivChild.style.top);
		            divHeight = parseInt(aDivChild.style.height);
		            if ((curY < divY) || (curY > (divY + 25))) { 
		                aDivChild.style.display = "none";
		                aDivChild = null;
		            }
	            }
			}
		}
*/
        function __PotvrdiFormu(eventTarget, eventArgument) {
            var theForma = document.forms['aspnetForm'];
            if (!theForma) {
                theForma = document.aspnetForm;
            }
           if (!theForma.onsubmit || (theForma.onsubmit() != false)) {
                theForma.ctl00$__KONTROLA.value = eventTarget;
                theForma.ctl00$__ARGUMENTI.value = eventArgument;
                theForma.submit();
            }
        }

        var win = null;
        function newWindow(mypage,w,h,pID) {
              var winl = (screen.width-w)/2;
              var wint = (screen.height-h)/2;
              if (winl < 0) winl = 0;
              if (wint < 0) wint = 0;
              mypage = mypage + '?pID=' + pID
              var settings = 'height=' + h + ',';
              settings += 'width=' + w + ',';
              settings += 'top=' + wint + ',';
              settings += 'left=' + winl + ',';
              settings += 'resizable=yes, scrollbars =yes';
              win = window.open(mypage,'_blank',settings);
              win.window.focus();
        }
       
       function Opsirnije(pID) {
            newWindow('Opsirnije.aspx',500,500,pID);
       } 
       
        function AddImage(pVal, pID){
	        xpID1 = document.getElementById("Image" + pID);
	        xpID1.src = "file:///" + pVal.value;
        }
