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_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function radio_button_checker(poruka)
{
	var radio_choice = false;

	for (counter = 0; counter < anketa.opcije.length; counter++){
		if (anketa.opcije[counter].checked)
			radio_choice = true; 
	}
	if (!radio_choice){
		// If there were no selections made display an alert box 
		alert(poruka)
		return (false);
	}
	return (true);
}

// centrirani popup
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings);
win.focus();
}

//show hide
var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.display = state;
}
}


function setCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}


function activetab(tabid) {
	setCookie('istratab',tabid,'1');
}

Orig="";
tO=null;
aa=1;

function setBox(content){ 
  if(!Orig) Orig=document.getElementById('topicpage').innerHTML;
  if(aa > 1){
  document.getElementById('topicpage').innerHTML="<span class='tover'>"+content+"</span>";
  }
  if(tO){
  clearTimeout(tO);
  }
  aa++;
}

function setBox2(content){
  document.getElementById('topicpage').innerHTML=content;
  if(tO){
  clearTimeout(tO);
  }
}

function resetBox(){
   tO=setTimeout("setBox2(Orig)", 600);
}
