	function agregarComentario(nombre, email, comentario, idnoticia, idcliente){
		if(receiveReq.readyState == 4 || receiveReq.readyState == 0){
			var accion = 'agregar_comentario';
			var myRand = parseInt(Math.random()*999999999999999);
			var url = 'ajax/sitio.php';
			comentario = encodeURI(reemplazarCharURL(comentario));
			receiveReq.open("GET", url +"?accion="+accion+"&idnoticia="+ idnoticia +"&idcliente="+ idcliente +"&nombre="+ nombre  +"&email="+ email  +"&comentario="+ comentario  +"&rand="+myRand, true);
			receiveReq.onreadystatechange = function(){
				if (receiveReq.readyState == 4) {//alert(receiveReq.responseText);
					document.getElementById('mensajecomentario').innerHTML = receiveReq.responseText;
				}
			
			};		
			receiveReq.send(null);
		}
	}


	function getComentariosnotas(id,pagina,plantilla)
	{ 
		//alert("asfaf");
		
		if(receiveReq.readyState == 4 || receiveReq.readyState == 0)
		{
			if(parseInt(pagina)>1){
				location.href ='#comentarios';
			}
			var accion = 'ver_comentario';
			var myRand = parseInt(Math.random()*999999999999999);
			var url = 'ajax/sitio.php';
			plantilla = encodeURI(reemplazarCharURL(plantilla));
			urlfinal = url +"?accion="+accion+"&id="+ id +"&plantilla="+ plantilla +"&pagina="+ pagina  +"&rand="+myRand;
			//alert(urlfinal);
			receiveReq.open("GET", urlfinal, true);
			receiveReq.onreadystatechange = function(){
					if (receiveReq.readyState == 4) { 
						// alert(receiveReq.responseText);
						document.getElementById('div_comentario').innerHTML = receiveReq.responseText;
					}
				
				};		
			receiveReq.send(null);
		}
	}

	function handleajaxSeccion(){
		if (receiveReq.readyState == 4) {
			document.getElementById('div_seccionesAgregadas').innerHTML =  receiveReq.responseText;
			document.getElementById('divMsj').innerHTML = '';
		}else{
			document.getElementById('divMsj').innerHTML = '<img src="img/load.gif" align="absmiddle" /> Cargando...';
		}
	}
	

	function votar(id,e, entrar){
		var arropciones =  getElementsByName_iefix('input','pregunta'+id);
		var opcion = '';
		for(var i=0; i< arropciones.length; i++ ){
			if(arropciones[i].checked == true){
				opcion = arropciones[i].value;	
			}	
		}
		
		if(entrar == true) opcion= 0;
		
		if(opcion != '' || entrar == true){
			if(receiveReq.readyState == 4 || receiveReq.readyState == 0){
				
				var accion = 'votar';
				var myRand = parseInt(Math.random()*999999999999999);
				var url = 'ajax/sitio.php';
				
				receiveReq.open("GET", url +"?accion="+accion+"&opcion="+ opcion +"&idencuesta="+ id +"&rand="+myRand, true);
				receiveReq.onreadystatechange = function(){
						if (receiveReq.readyState == 4) {
					//		GB_showCenter('Encuesta','http://www.planetajoy.com/encuesta.php?id='+id, 300, 600);
							//window.open('http://www.planetajoy.com/encuesta.php?id='+id , 'encuesta_'+ id , 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=400');
							
							
							/*if(document.getElementById('resultados_votar'+id)){
								document.getElementById('resultados_votar'+id).innerHTML = receiveReq.responseText;
							}*/
						}
					
					};		
				receiveReq.send(null);
			}
		}else{
				
		}
	}


	function byId(id){
		return document.getElementById(id);
	}
	
	
	function validarcampos(){
		var arrCampo = arrCampoValidar;
		var error = new Array();
		var j = 0
		for(var i=0; i< arrCampo.length; i++){
			byId('error_'+ arrCampo[i]).style.display = 'none';
			if(trim(byId(arrCampo[i]).value) == ''){
				error[j] = arrCampo[i];
				byId('error_'+ arrCampo[i]).style.display = 'block';
				j++;
			}														
		}
		if(error.length > 0){
			byId(error[0]).focus();
			return false;
		}
		return true;
	}
