function bbcode(strFore, strAft)
{
	wrapSelection(document.post.tresc, strFore, strAft);
}

function bbcodel(strFore, strAft)
{
	wrapSelection(document.postl.trescl, strFore, strAft);
}

function bbcode_font(strFore, strAft, font, nawias)
{
	wrapSelection(document.post.tresc, strFore+font+nawias, strAft);
}

function bbcode_fontl(strFore, strAft, font, nawias)
{
	wrapSelection(document.postl.trescl, strFore+font+nawias, strAft);
}

function mail(user, domain){window.location = 'mailto:'+user+'@'+domain;}

function wrapSelection(h, strFore, strAft)
{
	h.focus();
	if (h.setSelectionRange)
	{
		var selStart = h.selectionStart, selEnd = h.selectionEnd;
		h.value = h.value.substring(0, selStart) + strFore + h.value.substring(selStart, selEnd) + strAft + h.value.substring(selEnd);
		h.setSelectionRange(selStart + strFore.length, selEnd + strFore.length);
	}
	else if (document.selection)
	{
		var oRange = document.selection.createRange();
		var numLen = oRange.text.length;
		oRange.text = strFore + oRange.text + strAft;
		//moveSelectionRange(oRange, -numLen, -strAft.length);
	}
	else
	{
		h.value += strFore + strAft;
	}
}


function ColorIn(id) {
    mint.fx.Color(id, "color", "#FFFFFF", "#000000", 10, 500);
}

function ColorOut(id) {
    mint.fx.Color(id, "color", "#000000", "#FFFFFF", 10, 500);
}

function zmien_tlo(id,nr)
{
	if(id){
		document.getElementById(id).style.backgroundImage='url(grafika/menu2.gif)';
		}
	if(nr == 0)
	{
	document.getElementById(id).style.backgroundImage='url(grafika/menu1.gif)';
	}
}

function pokaz(id)
{
	//document.getElementById(id).style.display="none";
	 
	if(id != ''){
		document.getElementById('submenu').style.display='block';
		}
	if(id == ''){
		document.getElementById('submenu').style.display='none';
		}
}