

function confirmSubmit(){
	var agree=confirm("Are you sure you wish to continue?");
	if (agree){
		return true ;
	}else{
		return false ;
	}
}


function ToggleList2(a,b){
	document.getElementById(a).style.display = "";
	document.getElementById(b).style.display = 'none';
}

var nocookies="";

//================================= Skriva link u statusnom retku (pozeljno za mailove)

var statusmsg="";
function hidestatus(statusmsg){
	window.status=statusmsg;
return true
}

//================================= funkcija za otvaranje i zatvaranje menija

var b = 0;

var d = 0;

var c = 0;

function ToggleList(a){

  	c = a + "e";	

	if(document.getElementById(a).style.display == 'none'){

			document.getElementById(a).style.display = "";

   			document.getElementById(c).style.display = "";

			document.getElementById(b).style.display = 'none';

			document.getElementById(d).style.display = 'none';

			b = a; d = c;

	} else {

      		document.getElementById(a).style.display = 'none';

			document.getElementById(c).style.display = 'none';

    		b = 0; d = 0; // ============================ resetiranje vrijednosti "b" i "d"

	}

}


//======================================= Fancy, shmancy MM funkcije



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//=============================== Izmjena boje pozadine svakog linka u menu

function mOvr(src,clrOver) {

    if (!src.contains(event.fromElement)) {

		src.style.cursor = 'hand';

		src.bgColor = clrOver;

	}

}

function mOut(src,clrIn) {

	if (!src.contains(event.toElement)) {

		src.style.cursor = 'default';

		src.bgColor = clrIn;

	}

}

function mOvr2(src,clrOver) {

    if (!src.contains(event.fromElement)) {

		src.style.cursor = 'hand';

		src.style.background = clrOver;

	}

}

function mOut2(src,clrIn) {

	if (!src.contains(event.toElement)) {

		src.style.cursor = 'default';

		src.style.background = "url('osnova/podloga/menu_button.jpg') no-repeat";

	}

}



function mClk(src) {

	if(event.srcElement.tagName=='TD') {

		src.children.tags('A')[0].click();

    }

}

//Funkcija koja uita potrebnu stranicu nakon odabira neke od opcija na padajuem meniju

function loadPage(pageURL){

  location.href = pageURL.options[pageURL.selectedIndex].value

  //alert(pageURL.options[pageURL.selectedIndex].value)

}

//Ispisuje poruku u posebnom prozoru

function poruka(id,fold){

	//var details = "alwaysRaised=yes,titlebar=yes,scrollbars=yes,resizable=yes,right=0,top=0,width=550";
	if(!fold){fold='';}

	porukaWin=window.open(fold+'poruka.php?id='+id, 'porukaWin','alwaysRaised=yes,titlebar=yes,scrollbars=yes,resizable=yes,right=0,top=0,width=550,height=480');

}

//================================= Ucitavanje rollover slicica za menu

function preloading_slika(){

	var nothing=nothing;
	
	/*MM_preloadImages(

	'http://www.fsb.hr/osnova/podloga/spacer.gif',

	'http://www.fsb.hr/osnova/menu/hr/home_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/nastava_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/studenti_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/upisi_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/organizacija_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/izdavastvo_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/knjiznica_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/znanost_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/onama_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/pretrazivanje_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/linkovi_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/impressum_over.gif',

	'http://www.fsb.hr/osnova/menu/hr/informatika_over.gif',

	'http://www.fsb.hr/osnova/menu/en/home_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/nastava_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/studenti_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/upisi_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/organizacija_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/izdavastvo_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/knjiznica_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/znanost_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/onama_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/pretrazivanje_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/linkovi_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/impressum_eng_over.gif',

	'http://www.fsb.hr/osnova/menu/en/informatika_eng_over.gif'

	);*/

}

function mouseOver(textString)
{
	var htmlCode = "";

	htmlCode += '<table cellSpacing="0" cellPadding="0" bgcolor="#FFF9CD" class="footer">';
	htmlCode += '	<tr height="1"><td bgcolor="#000000" colSpan="5"></td></tr>';
	htmlCode += '	<tr height="3"><td width="1" bgcolor="#000000" nowrap></td><td colSpan="3"></td><td width="1" bgcolor="#000000" nowrap></td></tr>';
	htmlCode += '	<tr><td width="1" bgcolor="#000000" nowrap></td><td width="6" nowrap></td><td><span>' + textString + '</span></td><td width="6" nowrap></td><td width="1" bgcolor="#000000" nowrap></td></tr>';
	htmlCode += '	<tr height="3"><td width="1" bgcolor="#000000" nowrap></td><td colSpan="3" nowrap></td><td width="1" bgcolor="#000000" nowrap></td></tr>';
	htmlCode += '	<tr height="1"><td bgcolor="#000000" colSpan="5"></td></tr>';
	htmlCode += '</table>';

	popupDiv.innerHTML = htmlCode;

	popupDiv.style.top =  "-1000px";
	popupDiv.style.left = "0px";

	document.onmousemove = mouseMove;

	popupDiv.style.visibility = "visible";
	popupDiv.style.display = "";
}

function mouseOut()
{
	popupDiv.style.visibility = "hidden";
	popupDiv.style.display = "none";
}

function mouseMove(e)
{
	x = event.clientX;
	y = document.body.scrollTop + event.clientY;

	popupDiv.style.top = (y) + "px";
	popupDiv.style.left = (x + 20) + "px";
}


/*****************************************************
* ypSlideOutMenu
* 3/04/2001
* 
* a nice little script to create exclusive, slide-out
* menus for ns4, ns6, mozilla, opera, ie4, ie5 on 
* mac and win32. I've got no linux or unix to test on but 
* it should(?) work... 
*
* --youngpup--
*****************************************************/
ypSlideOutMenu.Registry = []
ypSlideOutMenu.aniLen = 350
ypSlideOutMenu.hideDelay = 100
ypSlideOutMenu.minCPUResolution = 10
function ypSlideOutMenu(id, dir, left, top, width, height)
{
this.ie = document.all ? 1 : 0
this.ns4 = document.layers ? 1 : 0
this.dom = document.getElementById ? 1 : 0
if (this.ie || this.ns4 || this.dom) {
this.id = id
this.dir = dir
this.orientation = dir == "left" || dir == "right" ? "h" : "v"
this.dirType = dir == "right" || dir == "down" ? "-" : "+"
this.dim = this.orientation == "h" ? width : height
this.hideTimer = false
this.aniTimer = false
this.open = false
this.over = false
this.startTime = 0
this.gRef = "ypSlideOutMenu_"+id
eval(this.gRef+"=this")
ypSlideOutMenu.Registry[id] = this
var d = document
d.write('<style type="text/css">')
d.write('#' + this.id + 'Container { visibility:hidden; ')
d.write('left:' + left + 'px; ')
d.write('top:' + top + 'px; ')
d.write('overflow:hidden; }')
d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; ')
d.write('width:' + width + 'px; ')
d.write('height:' + height + 'px; ')
d.write('clip:rect(0 ' + width + ' ' + height + ' 0); ')
d.write('}')
d.write('</style>')
this.load()
}
}
ypSlideOutMenu.prototype.load = function() {
var d = document
var lyrId1 = this.id + "Container"
var lyrId2 = this.id + "Content"
var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
var temp
if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
else {
this.container = obj1
this.menu = obj2
this.style = this.ns4 ? this.menu : this.menu.style
this.homePos = eval("0" + this.dirType + this.dim)
this.outPos = 0
this.accelConst = (this.outPos - this.homePos) / ypSlideOutMenu.aniLen / ypSlideOutMenu.aniLen 
if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
this.menu.onmouseover = new Function("ypSlideOutMenu.showMenu('" + this.id + "')")
this.menu.onmouseout = new Function("ypSlideOutMenu.hideMenu('" + this.id + "')")
this.endSlide()
}
}
ypSlideOutMenu.showMenu = function(id)
{
var reg = ypSlideOutMenu.Registry
var obj = ypSlideOutMenu.Registry[id]
if (obj.container) {
obj.over = true
for (menu in reg) if (id != menu) ypSlideOutMenu.hide(menu)
if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
}
}
ypSlideOutMenu.hideMenu = function(id)
{
var obj = ypSlideOutMenu.Registry[id]
if (obj.container) {
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = window.setTimeout("ypSlideOutMenu.hide('" + id + "')", ypSlideOutMenu.hideDelay);
}
}
ypSlideOutMenu.hide = function(id)
{
var obj = ypSlideOutMenu.Registry[id]
obj.over = false
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = 0
if (obj.open && !obj.aniTimer) obj.startSlide(false)
}
ypSlideOutMenu.prototype.startSlide = function(open) {
this[open ? "onactivate" : "ondeactivate"]()
this.open = open
if (open) this.setVisibility(true)
this.startTime = (new Date()).getTime() 
this.aniTimer = window.setInterval(this.gRef + ".slide()", ypSlideOutMenu.minCPUResolution)
}
ypSlideOutMenu.prototype.slide = function() {
var elapsed = (new Date()).getTime() - this.startTime
if (elapsed > ypSlideOutMenu.aniLen) this.endSlide()
else {
var d = Math.round(Math.pow(ypSlideOutMenu.aniLen-elapsed, 2) * this.accelConst)
if (this.open && this.dirType == "-") d = -d
else if (this.open && this.dirType == "+") d = -d
else if (!this.open && this.dirType == "-") d = -this.dim + d
else d = this.dim + d
this.moveTo(d)
}
}
ypSlideOutMenu.prototype.endSlide = function() {
this.aniTimer = window.clearTimeout(this.aniTimer)
this.moveTo(this.open ? this.outPos : this.homePos)
if (!this.open) this.setVisibility(false)
if ((this.open && !this.over) || (!this.open && this.over)) {
this.startSlide(this.over)
}
}
ypSlideOutMenu.prototype.setVisibility = function(bShow) { 
var s = this.ns4 ? this.container : this.container.style
s.visibility = bShow ? "visible" : "hidden"
}
ypSlideOutMenu.prototype.moveTo = function(p) { 
this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : p + "px"
}
ypSlideOutMenu.prototype.getPos = function(c) {
return parseInt(this.style[c])
}
ypSlideOutMenu.prototype.onactivate = function() { }
ypSlideOutMenu.prototype.ondeactivate = function() { }

/**********************************
End of drop down menus
**********************************/
// the following two functions are the rollover image swaps in the search.inc file
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//end of search.inc rollover functions

/* function or opening a popup window */
function createWindow(cUrl,cName,cFeatures) {
	var xWin = window.open(cUrl,cName,cFeatures);
	xWin.focus();
}
/* cookie functions, used to tell the user to update their browser 
 * modified from public domain functions found at http://www.hidaho.com/cookies/
 */

// 'internal' function used by the other cookie functions
function getCookieVal (offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//
function getCookie (name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) 
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

// sets a cookie. 
function setCookie (name,value,expires,path,domain,secure) 
{
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}
// delete the cookie
function deleteCookie (name,path,domain) 
{
	if (getCookie(name)) 
	{
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

//================================= FUNKCIJE ZA SCROLL TEKSTA

/*var wholemessage='';

for(pp=0;pp<singlemsg.length;pp++){
	wholemessage=wholemessage+singlemsg[pp];
	//wholemessage=wholemessage+singlemsg[0];
}

var swidth=250;var sheight=125;var bheight=20;var sspeed=1;var restart=1; var bspeed=1;var restartb=1;var ttspeed=75;var tj=0;
var scrollerspause=0;var sizeup=125;var sizeleft=0;var ftt=6;var secwin=null;var klk=0;var jjj=0;var ikj=0;var jpj=-1;var ipj=0;var jj=-1;var congrv=0;var congrh=0;
var operbr=navigator.userAgent.toLowerCase().indexOf('opera');
var options = "toolbar=no,menubar=no,scrollbars=yes,status=no,fullscreen=no,resizable=no,top=0,left=0,screenY=0,screenX=0,width=440,height=540";
var fstv=new Array();
var fsth=new Array();
if(document.getElementById||operbr!=-1){
	fsth[0]=250;
}
if(document.layers){
	fstvns=84;
}else if(operbr==-1){
	fstvio=81;
}else{
	fstvio=76;
}*/

function handleUnload(){
	if(secwin!=null&&!secwin.closed){
		secwin.close();
	}
	return;
}

function startscroll(){
	if(document.all&&operbr==-1){
		iemarquee(slider);
	}else if(document.getElementById){
		for(pp=0;pp<singlemsg.length;pp++){
			document.getElementById('hidslider').innerHTML=singlemsg[pp];
			sizeup=document.getElementById('hidslider').offsetHeight;fstv[pp]=sizeup;
		}
		ns6marquee(document.getElementById('slider'));
	}else if(document.layers){
		ns4marquee(document.slider1.document.slider2);
	}
}

function iemarquee(whichdiv){
	iediv=eval(whichdiv);
	iediv.style.pixelTop=0;
	iediv.innerHTML=wholemessage;
	setTimeout("ieslide()",scrollerspause);
}

function ieslide(){
	if(ikj >= fstvio){
	ikj=0;jjj++;setTimeout("ieslide()",scrollerspause);return;
	}else if(jjj<8){
	if(sspeed>0){
		congrv=(fstvio-ikj)%sspeed;
		if(congrv==0){
			iediv.style.pixelTop-=sspeed;ikj+=sspeed;
		}else{
			iediv.style.pixelTop-=congrv;ikj+=congrv;congrv=0;
		}
	}
		setTimeout("ieslide()",20);
	}else if(jjj==8){
		jjj=0;ikj=0;iediv.style.pixelTop=0;ieslide();
	}
}

function ns4marquee(whichlayer){
	ns4layer=eval(whichlayer);
	ns4layer.top=-5;
	ns4layer.document.write(wholemessage);
	ns4layer.document.close();
	setTimeout("ns4slide()",scrollerspause);
}

function ns4slide(){
if(ikj >= fstvns){
ikj=0;jjj++;setTimeout("ns4slide()",scrollerspause);return;}
else if(jjj<6){
if(sspeed>0){
congrv=(fstvns-ikj)%sspeed;if(congrv==0){
ns4layer.top-=sspeed;ikj+=sspeed;}
else {
ns4layer.top-=congrv;ikj+=congrv;congrv=0;}
}
setTimeout("ns4slide()",50);}
else if(jjj==6){
jjj=0;ikj=0;ns4layer.top=-5;ns4slide();}
}

function ns6marquee(whichdiv){
	ns6div=eval(whichdiv);
	ns6div.style.top=0;
	ns6div.innerHTML=wholemessage;
	setTimeout("ns6slide()",scrollerspause);
}

function ns6slide(){
if(ikj >= fstv[jjj]){
ikj=0;jjj++;setTimeout("ns6slide()",scrollerspause);return;}
else if(jjj<6){
if(sspeed>0){
congrv=(fstv[jjj]-ikj)%sspeed;if(congrv==0){
ns6div.style.top=parseInt(ns6div.style.top)-sspeed;ikj+=sspeed;}
else {
ns6div.style.top=parseInt(ns6div.style.top)-congrv;ikj+=congrv;congrv=0;}
}
setTimeout("ns6slide()",20);}
else if(jjj==6){
jjj=0;ikj=0;ns6div.style.top=0;ns6slide();}
}

function goup(){
	if(congrv==0&&sspeed>0&&sspeed<27){
		sspeed*=3;restart=sspeed;
	}
	brzina.value=sspeed;
	return;
	}

function godn(){
	if(congrv==0&&sspeed>1){
		sspeed/=3;restart=sspeed;
	}
	brzina.value=sspeed;
	return;
}

//-->
