function showComments(id){
	var col1 = document.getElementById('Columna1Nota');
	if (col1 == null) return true;
	col1.parentNode.parentNode.style.position ='relative';
	//col1.parentNode.style.height = col1.offsetHeight +'px';
	col1.style.position = 'absolute';
	col1.style.overflow = 'hidden';
	col1.style.backgroundColor = 'white';
	col1.style.zIndex = 11; 
	var voxpopuli = document.getElementById('voxpopuli');
	for(h=0;voxpopuli.childNodes[h].className != "headerimage";h++);
	voxpopuli.childNodes[h].style.display ='none';
	for(i=0;col1.parentNode.parentNode.childNodes[i].className != 'lineasuperior';i++);
	col1.parentNode.parentNode.removeChild(col1.parentNode.parentNode.childNodes[i]);
	walk('Columna1Nota',col1.offsetLeft,col1.offsetTop,col1.offsetWidth,col1.offsetHeight,597,0,386,300,10,10,'showVoxPopuliHeader()');
	col1.parentNode.innerHTML += '<div id=Columna1Cargando class=cargando style="height:'+document.documentElement.clientHeight+'px">Cargando..</div>';
	vsmHttpRequest('/0/vnc/tools/getvoxPopuli.vnc?id='+id+'&adarea='+adareaVox, 'okgetVoxPopuli', 'errgetVoxPopuli', false); 
	return false;

}
function showContent(){
/*	var col1 = document.getElementById('Columna1ContenedorVox');
	var col2 = document.getElementById('Columna2ContenedorVox');*/
	var voxheader = document.getElementById('voxpopuliheader');
	voxheader.style.display = 'none';
	var voxheader = document.getElementById('voxpopuli');
	for(h=0;voxheader.childNodes[h].className != "headerimage";h++);
	voxheader.childNodes[h].style.display =''
/*	col1.style.display = 'none';
	col2.style.display = 'none';
;*/
	return false;
}

function okgetVoxPopuli(txt){
	var col2 = document.getElementById('Columna2Contenedor');
	for(i=0;i<col2.childNodes.length;i++){
		id =col2.childNodes[i].id;
		if (id !="voxpopuliheader" && id != "voxpopulicontainer"){
			col2.childNodes[i].style.display = 'none';
		}	
	}
	var p = eval("(" + txt + ")");
	col2.innerHTML += p.rel;
	var col1 = document.getElementById('Columna1Contenedor');
	var load = document.getElementById('Columna1Cargando');
	col1.removeChild(load);
	col1.innerHTML += p.vox;
	col1.style.height ='auto';
	var colform1 = document.getElementById('bannervoxform');
	colform1.innerHTML = p.banner;
}

function showVoxPopuliHeader(){
	var voxheader = document.getElementById('voxpopuliheader');
	voxheader.style.display = '';
	for(i=0;voxheader.childNodes[i].className != "voxpopuli";i++);
	for(j=0;voxheader.childNodes[i].childNodes[j].className!= "comentario_nota";j++);
	voxheader = voxheader.childNodes[i].childNodes[j];
	var col1 = document.getElementById('Columna1Nota');
	voxheader.childNodes[2].innerHTML =unescape(imageVox).replace('+',' ');;
	for(i=0;i<col1.childNodes.length;i++){
		if (col1.childNodes[i].className == "fecha")voxheader.childNodes[1].innerHTML = col1.childNodes[i].innerHTML;
		if (col1.childNodes[i].className == "Titulo")voxheader.childNodes[4].innerHTML = col1.childNodes[i].innerHTML;
		if (col1.childNodes[i].className == "Copete")voxheader.childNodes[5].innerHTML = col1.childNodes[i].innerHTML;
	
	}
	voxheader.childNodes[6].childNodes[1].href = window.location.pathname+window.location.search;
	voxheader.childNodes[6].childNodes[1].onclick = function (){ 
							return showContent();
						}
	col1.parentNode.removeChild(col1);

}

function errgetVoxPopuli(txt){
	alert(txt);
}

var emailClonedDialogId = ''
function openEmail(idx){
	if (document.getElementById('boxedDialogClon'+idx) == undefined){
		var dialog = document.getElementById('boxedDialog');
		var sendEmail = document.getElementById('sendEmail'+idx);
		var boxCont = document.getElementById('boxContainer');
		for(h=0;sendEmail.childNodes[h].className != "container";h++);
		boxCont.innerHTML = sendEmail.childNodes[h].innerHTML;
		var clonedDiag = dialog.cloneNode(true);
		clonedDiag.id = 'boxedDialogClon'+idx;
		sendEmail.parentNode.parentNode.style.zIndex = 21;
		sendEmail.appendChild(clonedDiag)
		clonedDiag.style.top='-256px';
		clonedDiag.style.left='25px';
		clonedDiag.style.display = '';
		if(navigator.userAgent.indexOf("MSIE 6")>= 0){
			PNG_loader('boxedDialogClon'+idx);
		}
	}
	return false;
}
function okSendEmailFake(){
}

function okSendEmail(){
	var ok = document.getElementById('sendEmailOk');
	var boxedDialog = document.getElementById(emailClonedDialogId);
	var divs = boxedDialog.getElementsByTagName("DIV");
	for(h=0;h< divs.length;h++){
		if (divs[h].id=="boxContainer")
			var boxCont = divs[h];
	}
	boxCont.innerHTML = ok.innerHTML;
}
function sendEmail(idx){
	frm = document.getElementById('frmsendemail'+idx);
	clearCssFrmError("INPUT","frmsendemail"+idx);
	var stat = vsmSubmit(frm, 'es');
	if(stat){
		urlAction = frm.action;
		emailClonedDialogId = 'boxedDialogClon' + idx;
		vsmHttpRequest(urlAction, 'okSendEmailFake', 'alert', false, 'frmsendemail'+idx); 
		clearCssFrmError("INPUT","frmsendemail"+idx);
		okSendEmail();
	}
	return false;
}
function closeSendEmail(idx){
	var boxedDialog = document.getElementById('boxedDialogClon'+idx);
	var sendEmail = document.getElementById('sendEmail'+idx);
	sendEmail.parentNode.parentNode.style.zIndex = 0;
	sendEmail.removeChild(boxedDialog);
	clearCssFrmError("INPUT","frmsendemail"+idx);
}

