var AgntUsr=navigator.userAgent.toLowerCase();
var NavYes=(AgntUsr.indexOf('mozilla')!=-1&&AgntUsr.indexOf('compatible')==-1)?1:0;	// Netscape
var jsstyle = "";
if (document.getElementById)
	{
		jsstyle = "dom";
		if (document.all)
			jsstyle = "ie";
	}
	else if (NavYes)
	{
		jsstyle = "nn4";
	}
	

// functions for error handling	
function writeDiv(div, html) 
{
	var evaldiv;
	if (jsstyle == "nn4") 
	{
		evaldiv = eval('document.'+div+'.document');
		if(evaldiv)
		{
			evaldiv.open();
			evaldiv.write(html);
			evaldiv.close();
		}
	} 
	else if (jsstyle == "ie") 
	{
		evaldiv = eval(div);
		evaldiv.innerHTML = html;
	}
	else if (jsstyle == "dom") 
	{
		(document.getElementById(div)).innerHTML = html;
	}
}

function doPopup(url, name, width, height)
{
	if(name == "") name = "myPopUpWindow";
	if(width == 0 || width == "") width = 200;
	if(height == 0 || width == "") height = 200;
	if(url != "") window.open(url, name,"width="+width+",height="+height+",resizable=no,menubar=no,locationbar=no,scrollbars=none");
}

// function to restrict any non-numeric key pressing
function nn_Key() {		
	if ((event.keyCode<44) || (event.keyCode>57))
		event.keyCode = 0;
	if  (event.keyCode==44)
	 	event.keyCode=46;
}

function popUp(turl, tname, twidth, theight) {
	if(tname == "") tname = "";
	if(twidth == 0 || twidth == "") twidth = 300;
	if(theight == 0 || theight == "") theight = 300;
	//if(turl != "") window.open(turl);
	if(turl != "") window.open(turl, "naslov", "width="+twidth+",height="+theight+",resizable=yes,menubar=no,locationbar=no,scrollbars=yes,status=no");
}

var NS6=navigator.userAgent.indexOf("Netscape6");
/* MouseOver-OutEffects for the Navigation */
function mOver(id,color)
{
	with (document.getElementById(id))
	{		
		bgColor=color;
		(NS6!=-1) ? style.cursor='pointer' : style.cursor='hand';
	}
	var a = document.getElementById(id+'a');
	if (a!=null)
	{
		with (a)
		{
			style.color='#ffffff';
		}	
	}
}
function mOut(id,color)
{
	with (document.getElementById(id))
	{
		bgColor=color;
		style.cursor='default'
	}
	var a = document.getElementById(id+'a');
	if (a!=null)
	{	
		with (a)
		{			
			style.color='#000000';
		}	
	}
}
/* Level Link-Function */
function mClick(id,nav_link)
{
	with (document.getElementById(id))
	{
		location.href=nav_link;
	}
}