function url()
{
	link_name = prompt('Wpisz nazwe dla odnośnika',"");
	link_url = prompt('Podaj adres odnośnika',"http://");
	if ((link_url != null) && (link_url != ""))
	{
		if ((link_name != null) && (link_name != "")) addText('message', "[URL="+link_url+"]"+link_name+"[/URL]","");
		else addText('message', "[URL]"+link_url+"[/URL]","");
	}
}

function resizeImages(){
	var content=document.getElementById('content');
	var images=content.getElementsByTagName('img');
	var maxImageWidth=550; //1024: 960 - 2x180 (sides) - 150 (author)
	var node=document.createElement('p');
	node.setAttribute('style','font-size:smaller;');
	node.innerHTML='Obrazek został zmniejszony. Kliknij w obrazek aby zobaczyć go w pełnych rozmiarach.';
	for(var i=0;i<images.length;i++){
		if(images[i].width>maxImageWidth){
			var a=document.createElement('a');
			a.href="javascript:showAttachImg('"+images[i].src+"',"+(images[i].width+20)+","+(images[i].height+20)+")";
			images[i].parentNode.insertBefore(node.cloneNode(1),images[i]);
			images[i].parentNode.insertBefore(a,images[i]);
			a.appendChild(images[i]);
			images[i].width=maxImageWidth;
		}
	}
}

function showAttachImg(source,width,height){
	op=window.open('','okienko','menubar=no,toolbar=no,location=no,scrollbars=no,resizable=no,status=no,width='+width+',height='+height);
	op.document.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	op.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">')
	op.document.writeln('<head>');
	op.document.writeln('<title>Załącznik</title>');
	op.document.writeln('<style type="text/css">body{background: #F9F9F9; font: 10pt Verdana, Arial, Helvetica, sans-serif;} </style>');
	op.document.writeln('</head><body>');	
	op.document.writeln('<img src="'+source+'" alt="obrazek z załącznika" onclick="window.close();" />');
	op.document.writeln('</body>');
	op.document.writeln('</html>');
	op.document.close();
	op.focus();
}