//javascript funkcije koje se koriste u vecini file-ova

function pozovi_top(kuda){
	parent.frames[0].document.top_navig.SetVariable("p_kuda",kuda);
}

function link_rowOver(i,nColor) {
	if (!nColor) nColor = "#E8E8E8";
	var nameObj = (document.getElementById) ? document.getElementById(i) : eval("document.all[i]");
	if (nameObj != null) nameObj.style.background=nColor;
}

function link_rowOut(i,nColor) {
	if (!nColor) nColor = "#F7F7F7";	
	var nameObj = (document.getElementById) ? document.getElementById(i) : eval("document.all[i]");
	if (nameObj != null) nameObj.style.background=nColor;
}
//------------------------------------------(general functions)



//funkcije za otvaranje zatvaranje panela u administraciji
var smooth_timer;
prethodni='';

function otvori_zatvori_panel(href,visina,kuda) {
	if (prethodni=='') {
		prethodni=kuda;
		prethodni_visina=visina;
	}//end if sta
	
	//window.status='kuda:'+kuda+', prethodni:'+prethodni;
	
	var trObj = (document.getElementById) ? document.getElementById('frejm') : eval("document.all['frejm']");
	var ifObj = (document.getElementById) ? document.getElementById('ifrejm') : eval("document.all['ifrejm']");
  
	if (trObj != null) {
		if (trObj.style.display=='none') {
			ifObj.style.height = "0px";
			trObj.style.display="";
			anim_otvaranje('ifrejm', 0, visina, 'o');
		} else {
			if (kuda==prethodni) {
				anim_otvaranje('ifrejm', visina, 0, 'frejm');
			}
			if (kuda!=prethodni) {
				anim_otvaranje('ifrejm', prethodni_visina, visina, 'o');
				prethodni=kuda;
				prethodni_visina = visina;
			}
		}//end style=none
	 	if (ifObj.src!=null) ifObj.src = href; //moje
	}//end trobj!=null
}

function anim_otvaranje(id, curH, targetH, mode) {
	diff = targetH - curH;
	newH = (diff==-1) ? targetH : curH + Math.round(diff/2);
  
	if (diff==0) {
		if (mode != "o") ((document.getElementById) ? document.getElementById(mode) : eval("document.all['" + mode + "']")).style.display="none";
	}
  
	if (diff!=0) {
    	((document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']")).style.height = newH + "px";
    	if (smooth_timer) window.clearTimeout(smooth_timer);
    	smooth_timer = window.setTimeout( "anim_otvaranje('" + id + "'," + newH + "," + targetH + ",'" + mode + "')", 30 );
	}

}
//------------------------------------------(otvaranje zatvaranje)