function insAtCursor(myField,myValue)
	{
	// IE support
	if (document.selection)
		{
		myField.focus() ;
		sel = document.selection.createRange() ;
		sel.text = myValue ;
		}
	// MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == "0")
		{
		var startPos = myField.selectionStart ;
		var endPos = myField.selectionEnd ;
		myField.value = myField.value.substring(0, startPos)
		+ myValue
		+ myField.value.substring(endPos, myField.value.length) ;
		}
	else
		{
		myField.value += myValue;
		}
	}
function open_center_layer(element,x,y,mode){
	/*
	mode : 0; absolut középre, x és y a div fele
	mode : 1; a toppos = y;
	mode : 2; a leftpos = x; toppos = y;
	*/
	document.getElementById(element).style.display = "none";
	leftpos = 0 ;
	toppos = 0 ;

	if(mode==0){
		/* TOP */
		if(self.pageYOffset){
			yScroll = self.pageYOffset;
		}else if(document.documentElement && document.documentElement.scrollTop){
			yScroll = document.documentElement.scrollTop;
		}else if(document.body){
			yScroll = document.body.scrollTop;
		}
		if (self.innerHeight) {
			inheight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			inheight = document.documentElement.clientHeight;
		} else if (document.body) {
			inheight = document.body.clientHeight;
		}
		toppos = (yScroll + (inheight/2)) - y;
	}else{
		toppos = y;
	}

	if(mode==0){
		/* LEFT */
		if (screen){
			leftpos = (document.body.clientWidth/2) - x ;
		}

		if (leftpos<0)
			leftpos = 10 ;
	}else if(mode==2){
		leftpos = x;
	}

	document.getElementById(element).style.left = leftpos+'px';
	document.getElementById(element).style.top = toppos+'px';
}

function fotoalbum(cat,foto)
	{
	var popupwidth = 900, popupheight = 700 ; /*760, 540*/
	width = screen.width ;
	height = screen.height ;
	if (document.all)
		{
		width = document.body.clientWidth ;
		height = document.body.clientHeight ;
		}
	else if (document.layers)
		{
		width = window.innerWidth ;
		height = window.innerHeight ;
		}
	leftpos = (width-popupwidth)/2 ;
	toppos = (height-popupheight)/2 ;
	window.open("http://www.bornivo-miskolc.hu/fotoalbum.php?cat="+cat+"&foto="+foto,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=900,height=700,scrollbars=0,top="+toppos+",left="+leftpos) ;
	}

function showflash(file,width,height,bgcolor)
	{
	document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+width+'\" height=\"'+height+'\">');
	document.write('<param name=\"allowScriptAccess\" value=\"always\" />');
	document.write('<param name=\"movie\" value=\"'+file+'\" />');
	document.write('<param name=\"quality\" value=\"high\" />');
	document.write('<param name=\"wmode\" value=\"transparent\" />');
	document.write('<param name=\"bgcolor\" value=\"'+bgcolor+'\" />');
	document.write('<param name=\"swliveconnect\" value=\"true\" />');
	document.write('<param name=\"menu\" value=\"false\" />');
	document.write('<embed src=\"'+file+'\" quality=\"high\" bgcolor=\"'+bgcolor+'\" width=\"'+width+'\" height=\"'+height+'\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\"  swliveconnect=\"true\" menu=\"false\"/>');
	document.write('</object>');    
	}
function showelement(element)
	{
	document.getElementById(element).style.display = "block" ;
	window.focus() ;
	}
function hideelement(element)
	{
	document.getElementById(element).style.display = "none" ;
	window.focus() ;
	}
function centermessagebox()
	{
	leftpos = 0 ;
	toppos = 0 ;
	if (screen)
		{
		leftpos = (document.body.clientWidth/2) - 164 ;
		toppos = (document.body.scrollTop + document.body.clientHeight/2) - 58 ;
		}
	document.getElementById("messagebox").style.display = "none" ;
	document.getElementById("messagebox").style.left = 360 ;
	document.getElementById("messagebox").style.top = toppos ;
	document.onclick = hidemessagebox ;
	} 	
function hidemessagebox()
	{
	document.getElementById("messagebox").style.display = "none" ;
	window.focus() ;
	document.onclick = empty ;
	}
function elrejt(element){
	document.getElementById(element).style.visibility = "hidden" ;
	window.focus() ;
}
function felfed(element){
	document.getElementById(element).style.visibility = "visible" ;
	window.focus() ;
}
function empty(){
}