/////////////////////////////////////////////////////////////////////////////////
//
// UDU-MZ Javascript
//
// (c)2007-2009 by Abacus, info ath abacus doth hr
//
// v1.01 19.06.2009. DSalopek
//
/////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------
//
// globalne varijable
//
//-------------------------------------------------------------------------------

var orgX=0,orgY=0;

var xMENU='NAS';
var xWSPCID=580;
var xNS = (navigator.appName.indexOf("Netscape") != -1);
var xDOC = document;
var xAJAXURI;


if (document.body && document.body.clientWidth) { orgX=document.body.clientWidth; orgY=document.body.clientHeight } 
else if (window.outerWidth) { orgX=window.outerWidth; orgY=window.outerHeight; } 

//-------------------------------------------------------------------------------
//
// status
//
//-------------------------------------------------------------------------------

window.defaultStatus='udu-mz.hr';

function S(Msg) {
  if (Msg!='') { Msg='udu-mz.hr: '+Msg }
  window.status=Msg;
  return(true);
}


//-------------------------------------------------------------------------------
//
// AJAX
//
//-------------------------------------------------------------------------------

function ajaxEvaluate (pTXT) {
  var rSCRIPT = new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)', 'img');
  var tSCRIPT = '';
  while (tSCRIPT = rSCRIPT.exec(pTXT)) { eval(tSCRIPT[1]) }
}

function getDataReturnText (pURL, pTAG) { 
  var XMLHttpRequestObject = false; 
  if (window.XMLHttpRequest) {
    XMLHttpRequestObject = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    XMLHttpRequestObject = new 
     ActiveXObject("Microsoft.XMLHTTP");
  }

  if(XMLHttpRequestObject) {
    XMLHttpRequestObject.open('GET', pURL+'&DUMMY='+new Date().getTime()); 

    XMLHttpRequestObject.onreadystatechange = function() 
    { 
      if (XMLHttpRequestObject.readyState == 4 && 
        XMLHttpRequestObject.status == 200) { 
          ajaxCallback(XMLHttpRequestObject.responseText, pTAG);
          delete XMLHttpRequestObject;
          XMLHttpRequestObject = null;
      } 
    } 

    XMLHttpRequestObject.send(null); 
  }
}


function ajaxCallback (pTXT,pTAG) {
  ajaxEvaluate(pTXT);
  if (pTAG==undefined) { 
    pTAG='BODY';
    if (xAJAXURI) { }
  }
  if (xDOC.getElementById('NAVIGATOR')) {
    rNAVIG=/^\<NAVIGATOR\>(.+?)<\/NAVIGATOR>/;
    var NAVIG=rNAVIG.exec(TXT);
    if (NAVIG) {
      TXT=TXT.replace(rNAVIG,'');
      xDOC.getElementById('NAVIGATOR').innerHTML=NAVIG[1];
    }
  }
  if (xDOC.getElementById(pTAG)) { xDOC.getElementById(pTAG).innerHTML=pTXT; DekodirajURI(); initLytebox(); }
  if (xDOC.getElementById('vmarquee')) { initializemarquee() }
  if (cssdropdown != 'undefined' && pTAG=='MENU-TOP') { cssdropdown.startchrome('chromemenu') }
  

}

function Update(pTAG,pURI) {
  xURI=pURI;
  if (pTAG=='BODY') { 
    xSAL.PassAjaxResponseToFunction('?JSRS='+pTAG+'&'+pURI+'&DUMMY='+new Date().getTime(),'ajaxCallback'); 
  }
  else { getDataReturnText('?JSRS='+pTAG+'&'+pURI,pTAG) }
}

//-------------------------------------------------------------------------------
//
// dekodiranja E-mailova
//
//-------------------------------------------------------------------------------


function DekodirajURI() {
  if (!document.getElementsByTagName && !document.createElement && !document.createTextNode) return;
  var cvorovi=document.getElementsByTagName('span');
  for(var i=cvorovi.length-1;i>=0;i--) {
    if (cvorovi[i].className=='DECODE') {
      var na=/ \(na\) /;
      var tocka=/ \(tocka\) /g;
      var cvor=document.createElement('a');
      var URI=cvorovi[i].firstChild.nodeValue;

      URI = URI.replace(na,'@');
      URI = URI.replace(tocka,'.');
      cvor.setAttribute('href','mailto:'+URI);
      cvor.setAttribute('className','LINK');
      cvor.setAttribute('class','LINK');
      cvor.appendChild(document.createTextNode(URI));
      
      var ispis = cvorovi[i].parentNode;
      for(var j=0;j<ispis.childNodes.length;j++)
        if (ispis.childNodes[j] == cvorovi[i]) {
          if (!ispis.replaceChild) return;
          ispis.replaceChild(cvor,ispis.childNodes[j]);
          break;
        }
    }
  }
}

//-------------------------------------------------------------------------------
//
// provjera formi
//
//-------------------------------------------------------------------------------

function CheckForm(form,name) {
    var email=/[\w\-\.]+\@[\-\w\.]+\.[\w\-\.]{2,4}/;
    var ime=/[\w\.]+.*\s+.*[\w\.]+/;
    var prazno=/[\d\w]+/;
    if (name=='LIN') {
      if (!ime.test(form.IME.value)) {
        alert('Niste upisali ime i prezime!');
        form.IME.focus();
        return(false);
      }
      else if (!email.test(form.EPO.value)) {
        alert('Niste upisali ispravni E-mail pošiljatelja!');
        form.EPO.focus();
        return(false);
      }
      else if (!email.test(form.EPR.value)) {
        alert('Niste upisali ispravni E-mail primatelja!');
        form.EPR.focus();
        return(false);
      }
    }
    else if (name=='PPI') {
      if (!ime.test(form.IME.value)) {
        alert('Niste upisali ime i prezime!');
        return(false);
      }
      else if (!email.test(form.EMA.value)) {
        alert('Niste upisali ispravni E-mail!');
        return(false);
      }
      else if (!prazno.test(form.POR.value)) {
        alert('Niste opisali prepoznavanje informacije!');
        return(false);
      }
    }
    else {
      if (!ime.test(form.IME.value)) {
        alert('Niste upisali ime i prezime!');
        return(false);
      }
      else if (!email.test(form.EMA.value)) {
        alert('Niste upisali ispravni E-mail!');
        return(false);
      }
      else if (!prazno.test(form.POR.value)) {
        alert('Niste upisali tekst poruke!');
        return(false);
      }
    }
    return(true);
} 


//-------------------------------------------------------------------------------
//
// print sadrzaja
//
//-------------------------------------------------------------------------------


function PrintBody () {
  window.open('index.cgi?PRINT=Y&'+xURI,'PRINT','width=808,height=600,screenX=20,screenY=20,left=20,top=20')
}


//-------------------------------------------------------------------------------
// MENU
//-------------------------------------------------------------------------------

menu_status = new Array(); 

function showHide(theid){
  if (document.getElementById) {
    var switch_id = document.getElementById(theid);

    if (menu_status[theid] != 'show') {
      switch_id.className = 'show';
      menu_status[theid] = 'show';
    }
    else {
      switch_id.className = 'hide';
      menu_status[theid] = 'hide';
    }
  }
}

var last_expanded = ''; 

function showHide(id) { 
  var obj = document.getElementById(id); 
  var status = obj.className; 

  if (status == 'hide') { 

    if (last_expanded != '') { 
      var last_obj = document.getElementById(last_expanded); 
      last_obj.className = 'hide'; 
    } 

    obj.className = 'show'; 

    last_expanded = id; 
  } 
  else { obj.className = 'hide' } 
} 


//-------------------------------------------------------------------------------
//	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
//	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
//	Web Site: http://txkang.com
//	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
//	
//	Please retain this copyright notice in the script.
//	License is granted to user to reuse this code on 
//	their own website if, and only if, 
//	this entire copyright notice is included.
//-------------------------------------------------------------------------------

// affected tags
var tgs = new Array( 'div','td','tr','body','span','table','a','br','p','font' );

// allowed fonts
var szs = new Array( '7pt','8pt','10pt','11pt','13pt' );
var startSz = 1;

function ChangeFont( trgt,inc ) {
  if (!document.getElementById) return
  var d = document,cEl = null,sz = startSz,i,j,cTags;
	
  sz += inc;
  if ( sz < 0 ) sz = 0;
  if ( sz > 4 ) sz = 4;
  startSz = sz;
		
  if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

  cEl.style.fontSize = szs[ sz ];

  for ( i = 0 ; i < tgs.length ; i++ ) {
    cTags = cEl.getElementsByTagName( tgs[ i ] );
    for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
  }
}


//Chrome Drop Down Menu v2.01- Author: Dynamic Drive (http://www.dynamicdrive.com)
//Last updated: November 14th 06- added iframe shim technique

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
disablemenuclick: false, //when user clicks on a menu item with a drop down menu, disable menu item's link?
enableswipe: 1, //enable swipe effect? 1 for yes, 0 for no
enableiframeshim: 0, //enable "iframe shim" technique to get drop down menus to correctly appear on top of controls such as form objects in IE5.5/IE6? 1 for yes, 0 for no

//No need to edit beyond here////////////////////////
dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all, swipetimer: undefined, bottomclip:0,

getposOffset:function(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
},

swipeeffect:function(){
if (this.bottomclip<parseInt(this.dropmenuobj.offsetHeight)){
this.bottomclip+=10+(this.bottomclip/10) //unclip drop down menu visibility gradually
this.dropmenuobj.style.clip="rect(0 auto "+this.bottomclip+"px 0)"
}
else
return
this.swipetimer=setTimeout("cssdropdown.swipeeffect()", 10)
},

showhide:function(obj, e){
if (this.ie || this.firefox)
this.dropmenuobj.style.left=this.dropmenuobj.style.top="-500px"
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
if (this.enableswipe==1){
if (typeof this.swipetimer!="undefined")
clearTimeout(this.swipetimer)
obj.clip="rect(0 auto 0 0)" //hide menu via clipping
this.bottomclip=0
this.swipeeffect()
}
obj.visibility="visible"
}
else if (e.type=="click")
obj.visibility="hidden"
},

iecompattest:function(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
},

clearbrowseredge:function(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetWidth
if (windowedge-this.dropmenuobj.x < this.dropmenuobj.contentmeasure)  //move menu to the left?
edgeoffset=this.dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset
var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
this.dropmenuobj.contentmeasure=this.dropmenuobj.offsetHeight
if (windowedge-this.dropmenuobj.y < this.dropmenuobj.contentmeasure){ //move up?
edgeoffset=this.dropmenuobj.contentmeasure+obj.offsetHeight
if ((this.dropmenuobj.y-topedge)<this.dropmenuobj.contentmeasure) //up no good either?
edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
},

dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
//this.positionshim() //call iframe shim function
}
},

positionshim:function(){ 
//display iframe shim function
if (this.enableiframeshim && typeof this.shimobject!="undefined"){
if (this.dropmenuobj.style.visibility=="visible"){
this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
this.shimobject.style.height=this.dropmenuobj.offsetHeight+"px"
this.shimobject.style.left=this.dropmenuobj.style.left
this.shimobject.style.top=this.dropmenuobj.style.top
}
this.shimobject.style.display=(this.dropmenuobj.style.visibility=="visible")? "block" : "none"
}
},

hideshim:function(){
if (this.enableiframeshim && typeof this.shimobject!="undefined")
this.shimobject.style.display='none'
},

contains_firefox:function(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
},

dynamichide:function(e){
var evtobj=window.event? window.event : e
if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
this.delayhidemenu()
else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
this.delayhidemenu()
},

delayhidemenu:function(){
this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden'; cssdropdown.hideshim()",this.disappeardelay) //hide menu
},

clearhidemenu:function(){
if (this.delayhide!="undefined")
clearTimeout(this.delayhide)
},

startchrome:function(){
for (var ids=0; ids<arguments.length; ids++){
var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
for (var i=0; i<menuitems.length; i++){
if (menuitems[i].getAttribute("rel")){
var relvalue=menuitems[i].getAttribute("rel")
menuitems[i].onmouseover=function(e){
var event=typeof e!="undefined"? e : window.event
cssdropdown.dropit(this,event,this.getAttribute("rel"))
}
}
}
}
if (window.createPopup && !window.XmlHttpRequest){ //if IE5.5 to IE6, create iframe for iframe shim technique
//document.write('<IFRAME id="iframeshim"  src="" style="display: none; left: 0; top: 0; z-index: 90; position: absolute; frameBorder="0" scrolling="no"></IFRAME>')
//this.shimobject=document.getElementById("iframeshim") //reference iframe object
}
}
}

//-------------------------------------------------------------------------------
//
// zatamnjenje ekrana
//
//-------------------------------------------------------------------------------

function GrayOut(vis, options) {
  // Pass true to gray out screen, false to ungray
  // options are optional.  This is a JSON object with the following (optional) properties
  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 
  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out
  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code
  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
  // in any order.  Pass only the properties you need to set.
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 50;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#336699';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';				 
  } 
  else {
     dark.style.display='none';
  }
}

function ShowData(ID) {
  GrayOut(true);
  var DIV=document.getElementById('DATA'+ID);
  DIV.style.left=10;
  DIV.style.top=10;
  DIV.style.visibility='visible';
}

function HideData (ID) {
  document.getElementById('DATA'+ID).style.visibility='hidden';
  GrayOut(false);
}

//-------------------------------------------------------------------------------
//
// functions by tigra @ softcomplex
//
// http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html
//
//-------------------------------------------------------------------------------

function ClientWidth() {
	return PositionResult (
		window.innerWidth ? window.innerWidth : 0,
		xDOC.documentElement ? xDOC.documentElement.clientWidth : 0,
		xDOC.body ? xDOC.body.clientWidth : 0
	);
}

function ClientHeight() {
	return PositionResult (
		window.innerHeight ? window.innerHeight : 0,
		xDOC.documentElement ? xDOC.documentElement.clientHeight : 0,
		xDOC.body ? xDOC.body.clientHeight : 0
	);
}

function ScrollLeft() {
	return PositionResult (
		window.pageXOffset ? window.pageXOffset : 0,
		xDOC.documentElement ? xDOC.documentElement.scrollLeft : 0,
		xDOC.body ? xDOC.body.scrollLeft : 0
	);
}

function ScrollTop() {
	return PositionResult (
		window.pageYOffset ? window.pageYOffset : 0,
		xDOC.documentElement ? xDOC.documentElement.scrollTop : 0,
		xDOC.body ? xDOC.body.scrollTop : 0
	);
}

function PositionResult(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

//-------------------------------------------------------------------------------
// You may use this code for free on any web page provided that 
// these comment lines and the following credit remain in the code.
// Floating Div from http://www.javascript-fx.com
//-------------------------------------------------------------------------------

function FloatDiv (id, sx, sy) {

  var EL=xDOC.getElementById?xDOC.getElementById(id):xDOC.all?xDOC.all[id]:xDOC.layers[id];
  var PX = xDOC.layers ? "" : "px";
  window[id + "_obj"] = EL;
  if (xDOC.layers) EL.style=EL;
  EL.cx = EL.sx = sx;
  EL.cy = EL.sy = sy;

  EL.sP=function(x,y) { 
    this.style.left=x+PX;this.style.top=y+PX; 
  };

  EL.floatIt=function () {
    var pX, pY;
    pX = (this.sx >= 0) ? 0 : xNS ? innerWidth : 
	xDOC.documentElement && xDOC.documentElement.clientWidth ? 
	xDOC.documentElement.clientWidth : xDOC.body.clientWidth;
    pY = xNS ? pageYOffset : xDOC.documentElement && xDOC.documentElement.scrollTop ? 
	xDOC.documentElement.scrollTop : xDOC.body.scrollTop;
    if (this.sy<0) 
    pY += xNS ? innerHeight : xDOC.documentElement && xDOC.documentElement.clientHeight ? 
	    xDOC.documentElement.clientHeight : xDOC.body.clientHeight;
    this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
    this.sP(this.cx, this.cy);
    setTimeout(this.id + "_obj.floatIt()", 40);
  }
  return EL;
}

//-------------------------------------------------------------------------------
//
// print
//
//-------------------------------------------------------------------------------

function PrintBody () {
  window.open('index.cgi?PRINT=Y&'+xURI,'PRINT','width=770,height=600,screenX=20,screenY=20,left=20,top=20')
}

//-------------------------------------------------------------------------------
//
// slanje linka
//
//-------------------------------------------------------------------------------

function ShowSendLink () {
  GrayOut(true);
  var X=xDOC.getElementById('DIVSENDLINK').offsetWidth;
  var Y=xDOC.getElementById('DIVSENDLINK').offsetHeight;
  FloatDiv('DIVSENDLINK',parseInt((ClientWidth()-X)/2),parseInt((ClientHeight()-Y)/2)).floatIt();
  xDOC.getElementById('DIVSENDLINK').style.visibility='visible';
}

function SendLink (form) {
  var tURI=xURI.replace(/=/g,'%3D');
  Update('SENDLINK','A=LIN&SEND=LIN&URI='+tURI+'&IME='+form.IME.value+'&EPR='+form.EPR.value+'&EPO='+form.EPO.value+
		'&LIN_KEY='+form.LIN_KEY.value+'&LIN_CODE='+form.LIN_CODE.value);
}

function HideSendLink () {
  xDOC.getElementById('DIVSENDLINK').style.visibility='hidden';
  GrayOut(false);
}  


//-------------------------------------------------------------------------------
//
// prikaz i sakrivanje slike
//
//-------------------------------------------------------------------------------

function ShowPicture (BID,X,Y) {
  var I=xDOC.getElementById('IMGSRC');
  GrayOut(true);
  X+=10;
  Y+=10;
  I.src=BID;
  I.width=X;
  I.height=Y;
  var XD=xDOC.getElementById('DIVIMG').offsetWidth;
  var YD=xDOC.getElementById('DIVIMG').offsetHeight;
  FloatDiv('DIVIMG',parseInt((ClientWidth()-XD)/2),parseInt((ClientHeight()-YD)/2)).floatIt();
  xDOC.getElementById('DIVIMG').style.visibility='visible';
}


function HidePicture () {
  var DIV=xDOC.getElementById('DIVIMG');
  DIV.style.visibility='hidden';
  var I=xDOC.getElementById('IMGSRC');
  I.src='_.gif';
  I.width=100;
  I.height=70;
  GrayOut(false);
}



///////////////////////////////////////////////////////////////////////////////////
//
// Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
// This notice MUST stay intact for legal use
// Visit http://www.dynamicdrive.com/ for this script and 100s more.
//
///////////////////////////////////////////////////////////////////////////////////

var xDELAYSCROLLTIMEOUT;
var xSCROLLTIMEOUT;

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
  if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+0))
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
  else
    cross_marquee.style.top=parseInt(marqueeheight)+0+"px"
}

function initializemarquee(){
  if (xDELAYSCROLLTIMEOUT) { clearTimeout(xDELAYSCROLLTIMEOUT) }
  if (xSCROLLTIMEOUT) { clearTimeout(xSCROLLTIMEOUT) }
  cross_marquee=document.getElementById("vmarquee")
  cross_marquee.style.top=0
  marqueeheight=document.getElementById("marqueecontainer").offsetHeight
  actualheight=cross_marquee.offsetHeight
  if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
    cross_marquee.style.height=marqueeheight+"px"
    cross_marquee.style.overflow="scroll"
    return
  }
  xDELAYSCROLLTIMEOUT=setTimeout('xSCROLLTIMEOUT=setInterval("scrollmarquee()",30)', delayb4scroll);
}

/////////////////////////////////////////////////////////////////////////////////// 




//-------------------------------------------------------------------------------------
// Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
// This notice MUST stay intact for legal use
// Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
//-------------------------------------------------------------------------------------

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false

function ietruebody(){
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
  if (ns6||ie){
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
    if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
    if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
    tipobj.innerHTML=thetext
    enabletip=true
    return false
  }
}

function positiontip(e){
  if (enabletip){
    var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
    var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
    var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
    //Find out how close the mouse is to the corner of the window
    var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
    var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

    var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<tipobj.offsetWidth)
      //move the horizontal position of the menu to the left by it's width
      tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
    else if (curX<leftedge)
      tipobj.style.left="5px"
    else
      //position the horizontal position of the menu where the mouse is positioned
      tipobj.style.left=curX+offsetxpoint+"px"

    //same concept with the vertical position
    if (bottomedge<tipobj.offsetHeight)
      tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
    else
      tipobj.style.top=curY+offsetypoint+"px"

    tipobj.style.visibility="visible"
  }
}

function hideddrivetip(){
  var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
  if (ns6||ie){
    enabletip=false
    tipobj.style.visibility="hidden"
    tipobj.style.left="-1000px"
    tipobj.style.backgroundColor=''
    tipobj.style.width=''
  }
}

document.onmousemove=positiontip 

//------------------------------------------------------------------------------------- 

//-------------------------------------------------------------------------------
//
//  WSP Capcha zastita formula
//
//-------------------------------------------------------------------------------

function WSPCaptcha(ID) {
  if (!ID) { ID='WSP' }
  var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
  var wsp_key_length = 32;
  var wsp_key = '';
  for (var i=0; i<wsp_key_length; i++) {
    var rnum = Math.floor(Math.random() * (chars.length-1));
    wsp_key += chars.substring(rnum, rnum+1);
  }
  document.getElementById(ID+'_CAPTCHA').src = 'http://webspamprotect.com/captcha.php?id=' + xWSPCID + '&key=' + wsp_key;
  document.getElementById(ID+'_KEY').value   = wsp_key;
}

//-------------------------------------------------------------------------------

///////////////////////////////////////////////////////////////////////////////////
//
// vracanje vrijednosti polja u dokumentu
//
///////////////////////////////////////////////////////////////////////////////////

function getSelectValue (ID) {
  var SEL=eval('xDOC.FORM_RSU.'+ID);
  if (SEL && SEL.selectedIndex>=0) { return(SEL.options[SEL.selectedIndex].value) }
  return('')
}

///////////////////////////////////////////////////////////////////////////////////
//
// LyteFrame 
//
///////////////////////////////////////////////////////////////////////////////////

var lfINT='';

function startLyteFrame(title,url,width,height) {
  var anchor = this.document.createElement('a');
  if (lfINT) { clearInterval(lfINT) }
  anchor.setAttribute('rev','width: '+width+'px; height: '+height+'px; scrolling: auto;');
  anchor.setAttribute('title',title);
  anchor.setAttribute('href',url);
  anchor.setAttribute('rel','lyteframe');
  if (!myLytebox) { lfINT=setInterval('startLyteFrame("'+title+'","'+url+'",'+width+','+height+')',1000);return false; }
  if (lfINT) { clearInterval(lfINT) }
  myLytebox.start(anchor,false,true);
  return false;
}
