// Kontakt forma - popup DIV
x = 30;
y = 40;
function setVisible(obj)
{
	obj = document.getElementById(obj);
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
function placeIt(obj)
{
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	obj.style.left = theLeft + '%' ;
	obj.style.top = theTop + '%' ;
	setTimeout("placeIt('layer1')",500);
}

// IEUpdate
theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) 
{
	theObjects[i].outerHTML = theObjects[i].outerHTML;
}

function UpozorenjeView()
	{
		alert("UPOZORENJE!!!"+ '\n' + "Ukljucivanjem ove opcije svi posetioci"+ '\n' + "mogu videti sadržaj ovog menija!!")
	}
function UpozorenjeEdit()
	{
		alert("UPOZORENJE!!!"+ '\n' + "Ukljucivanjem ove opcije omogućavate"+ '\n' + "svim posetiocima da menjaju, brišu i dodaju nove sadržaje!!")
	}

function checkedAll (id, checked) 
	{
	var el = document.getElementById(id);
	for (var i = 0; i < el.elements.length; i++) 
		{
	  	el.elements[i].checked = checked;
		}
  }

// show-hideDiv za detaljnu pretragu
function hideDiv(id) {
	//var id="id";
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showDiv(id) {
	//safe function to show an element with a specified id
		  //var id="id";
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

// show-hideDiv za kalendar kod add i edit Article
function hideDivBB(id) {
	//var id="id";
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showDivBB(id) {
	//safe function to show an element with a specified id
		  //var id="id";
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

//otvaranje prozora za mapu
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
// -->

//stampanje stranice
function go()
	{
		var a = window. open('','','scrollbars=yes,width=600,height=500');

//		a.document.open("text/html");
//		a.document.write('<html><head><link rel="stylesheet" href="main.css" /><style type="text/css">#frame{background-image:none;background-color:#FFFFFF;}</style></head><body style="padding-left:20px;background-image:none;background-color:#FFFFFF; font-size:12px; font:times new roman;">');
		a.document.write(document.getElementById('print').innerHTML);
//		a.document.write('</body></html>');
		//a.document.write('<div align-center><input type=button value=Print onclick=window.print();></div></body></html>');
		a.document.close();
		a.print();
	}