//var sifr_gemma1 = {sFlashSrc: SITE_URL_ROOT+"font/sw.swf", sColor: "#ffffff", sWmode: "transparent"};
//var sifr_ch2 = {sFlashSrc: SITE_URL_ROOT+"font/arial-narrow.swf", sColor: "#4b8ba9", sWmode: "transparent"};

document.observe('dom:loaded', function(e) {

	
	/*if(typeof sIFR == "function"){

	  sIFR.replaceElement("#layout-column-center h1", named(sifr_gemma1));
	  sIFR.replaceElement("#layout-column-center h2", named(sifr_gemma1));
	  sIFR.replaceElement("#layout-column-center h3", named(sifr_gemma1));
	};*/
	
	var docLocation = ""+document.location;

	if(docLocation.substring(docLocation.length-6)=="#print")
	{
		window.print();
	}

	printArray = $$("#layout-column-center-inner a.print");
	var i = printArray.each(function(e){
		e.onclick = function(){return openPrintWindow(""+e.href);};
	});

	var hrs = $$('#layout-column-center-inner hr');
	hrs.each(function(hr){
		hr.replace("<div class=\"hr\"><hr /></div>")
	});

});


/******************************************/

function inputFocusWork(e)
{
	if(e.defaultText!=null && e.defaultText!=undefined) return false;
	e.defaultText = e.value;
	e.value = "";
}

function inputBlurWork(e)
{
	if(e.value!="" || e.defaultText==undefined) return false;
	e.value=e.defaultText;
	e.defaultText=null;
}

/******************************************/

function set_homepage(url)
{
	try
	{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}
	catch(err)
	{
		alert("Vaš browser nažalost ne podržava ovu opciju! Molimo podesite početnu stranicu ručno.");
	}

}

/******************************************/

function openPrintWindow(href)
{
	var width = 480;
	var height = 560;
	
	if(href.indexOf("#")>=0)
	{
		href = href.substr(0,href.indexOf("#"))
	}
	
	if(href.indexOf("?")>=0)
	{
		href = href + "&print=1"
	}
	else
	{
		href = href + "?print=1"
	}
	
	window.open(href,'popup','width=' + width +', height=' + height + ', scrollbars=yes, resizable=yes');
	
	return false;
}
