function cytuj(tresc,textarea) {

 										start = $(textarea).attr('selectionStart');
 										koniec = $(textarea).attr('selectionEnd');
 										val = $(textarea).val();
 										dlugosc = koniec - start;

 										stringStart = val.substr(0,start);

 										stringCenter = val.substr(start,dlugosc);

 										stringKoniec = val.substr(koniec,val.length);

 										if(tresc == undefined)
 										{
 											stringCenter = zamien(stringCenter);
 											newVal = stringStart +"[quote]"+stringCenter+'[/quote]'+ stringKoniec;
 										}
 										else
 										{
											tresc = zamien(tresc);

											newVal = stringStart +"[quote]"+tresc+'[/quote]'+ stringKoniec;
 										}

 										return newVal;

									}

									function zamien(tresc)
									{

										tresc = tresc.replace(/<div class="cytat">/, '[quote]');

										tresc = tresc.replace(/<\/div>/,'[/quote]');

										return tresc;
									}


