﻿

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
        
    }
}


function prepareMenu() {
  	if (!document.getElementsByTagName) return false;
  	if (!document.getElementById) return false;
  	
  	if (!document.getElementById("menu")) return false;
  	var menu = document.getElementById("menu");
  	
  	var root_li = menu.getElementsByTagName("li");
  	
  	for (var i = 0; i < root_li.length; i++) {
  	    var li = root_li[i];
  	    
  	    var child_ul = li.getElementsByTagName("ul");
  	    if (child_ul.length >= 1) {
  	        li.onmouseover = function () {
  	            if (!this.getElementsByTagName("ul")) return false;
  	            var ul = this.getElementsByTagName("ul");
  	            ul[0].style.display = "block";
  	            this.className ="over";
  	            return true;
  	        }
  	        li.onmouseout = function () {
  	            if (!this.getElementsByTagName("ul")) return false;
  	            var ul = this.getElementsByTagName("ul");
  	            ul[0].style.display = "none";
  	            this.className="";
  	            return true;
  	        }
  	    }
  	}

  	return true;
}

function prognoza() {
  	PokaziPrognozu(0);
  	return true;
}

function mouseTracking()
{
    if (document.addEventListener)
    {
        /*document.addEventListener('click',
        function (event) {
            Kvarner.WEB.MouseTracker.klikenzi(event.pageX,event.pageY,location.href,document.referrer,
                function(result) { },
                function(result) { }
                );
            },
            false
        );
        */
    }
}

addLoadEvent(prognoza);
addLoadEvent(mouseTracking);
addLoadEvent(prepareMenu);
var brosureid;

function brosureChange(id)
{
    brosureid=id;
    //var s=document.getElementById(id);
    document.getElementById("brosureLink").style.display='block';
}

function brosureWebLink()
{
    var s=document.getElementById(brosureid);
    window.open(s.options[s.selectedIndex].value,'','');
}


function AnketaRez()
{
 document.getElementByID('AnketaPitanja').style.display='none';
 document.getElementByID('anketaRez').style.display='block';
}

function AnketaPitanje()
{
 document.getElementByID('AnketaPitanja').style.display='block';
 document.getElementByID('anketaRez').style.display='none';
}