function sizeL() {
	size = parseInt($("#news-text").css('font-size')) + 2;
	if(size>20) size = 20;
	document.getElementById("news-text").style.fontSize = size+'px';
}
function sizeS() {
	size = parseInt($("#news-text").css('font-size')) - 2;
	if(size<10) size = 10;
	document.getElementById("news-text").style.fontSize = size+'px';
}

function composeTitol() {
	var x = document.getElementById("titol").value;
	document.getElementById("news-title").innerHTML = x;
}
function composeCategoria(object) {
	var x = object.options[object.selectedIndex].innerHTML;
	if (x == '(Esborrany)') {
		document.getElementById("news-data-categoria").innerHTML = '';
	} else {
		document.getElementById("news-data-categoria").innerHTML = '<i class="fa fa-quote-left" title="Categoria"></i><b>'+x+'</b></span>';
	}
}
function composeLocalitzacio() {
	var x = document.getElementById("localitzacio").value;
	document.getElementById("news-data-localitzacio").innerHTML = '<i class="fa fa-map-marker" title="Localització"></i><b>'+x+'</b></span>';
}
function composeContingut() {
	var x = document.getElementById("contingutmanual").value;
	var xeol = x.replace(/\n/g, "<br>");
	document.getElementById("contingut").value = xeol;
	document.getElementById("news-text").innerHTML = xeol;
}
function composeTags() {
	document.getElementById("news-tags").innerHTML = '';
	var x = document.getElementById("tags").value;
	var arr = x.replace(/^\s+/,'').replace(/\s+$/,'').split(/,/);
	for (var i in arr) {
		if (arr[i].replace(/ /g,"")!=''){
			document.getElementById("news-tags").innerHTML += '<a href="/search/?t='+arr[i]+'" class="rnd10TL rnd10BL rnd5TR rnd5BR">'+arr[i]+'</a>';
		}
	}
}
function composeTagsRead() {
	var x = document.getElementById("news-tags").innerHTML;
	document.getElementById("news-tags").innerHTML = '';
	var arr = x.replace(/^\s+/,'').replace(/\s+$/,'').split(/,/);
	for (var i in arr) {
		if (arr[i].replace(/ /g,"")!=''){
			document.getElementById("news-tags").innerHTML += '<a href="/search/?t='+arr[i]+'" class="rnd10TL rnd10BL rnd5TR rnd5BR">'+arr[i]+'</a>';
		}
	}
}