/*
3 por linha com tempo, texto e imagem
*/
function makePar(jsonTree)
{
	var newP = document.createElement('div');
				
	newP.setAttribute('id', jsonTree["data"]);				
	newP.setAttribute('class', "Objects Par links");
	newP.setAttribute('onMouseOver', 'objBgOver(this)');
	newP.setAttribute('onMouseOut', 'objBgOut(this)');
	newP.setAttribute('onClick', 'article('+jsonTree["data"]+')');
	
	var bgNews = document.createElement('div');
	bgNews.setAttribute('class', "objBg");
	newP.appendChild(bgNews);
	
	if(jsonTree["img"]!= "" )
	{
		contImgP = document.createElement('div');
		contImgP.setAttribute('class', "StructL");
		
		imgP = document.createElement('img');
		imgP.setAttribute('src', jsonTree["img"]);
		imgP.setAttribute('alt', "logotipo - "+jsonTree["tituloPt"]);
		imgP.setAttribute('class', "imgObj");

		contImgP.appendChild(imgP);
		newP.appendChild(contImgP);
	}
	
	var headP = document.createElement('header');
	
	var titP = document.createElement('h2');
	titP.setAttribute('class', "subTit");
	titP.innerHTML=jsonTree["tituloPt"];
	
	contP = document.createElement('div');
	contP.setAttribute('class', "StructR");
	
	headP.appendChild(titP);
	contP.appendChild(headP);
	
	txtP = document.createElement('p');
	txtP.setAttribute('class', "textos");
	
	
	switch(lang)
	{
		case "pt":
			$(txtP).html( checkTxtL(jsonTree["textoPt"], 100));
		break;
		case "sp":
			$(txtP).html( checkTxtL(jsonTree["textoSp"], 100));
		break;
		case "en":
			$(txtP).html( checkTxtL(jsonTree["textoEn"], 100));
		break;
	}

	contP.appendChild(txtP);
	newP.appendChild(contP);	
	
	return newP;
}

function switchParLang(jsonTree)
{
	for(i=0;i<jsonTree.length;i++)
	{
		switch(lang)
		{
			case "pt":
				$("#"+jsonTree[i]["data"]+" .textos").html( checkTxtL(jsonTree[i]["textoPt"], 100));
			break;
			case "en":
				$("#"+jsonTree[i]["data"]+" .textos").html( checkTxtL(jsonTree[i]["textoEn"], 100));						
			break;
			case "sp":
				$("#"+jsonTree[i]["data"]+" .textos").html( checkTxtL(jsonTree[i]["textoSp"], 100));
			break;
		}
	}
}
