// JavaScript Document
function cortarString ( texto, len){

	var lenS = len;

	var numberN = -1;
	var lasS = '';
		if(texto.length < len)
			lenS = texto.length;
		if(texto.length > len)
			numberN = texto.substr(0,lenS+1).lastIndexOf(" ");
		if(numberN == -1)
			numberN = lenS;
		else
			lasS = ' ...'
			texto = texto.substr(0,numberN) + lasS;
		
			var txt = texto
			txt=txt.replace(/nbsp;/g,""); 
			txt=txt.replace(/&/g,""); 
			txt=txt.replace(/amp;/g,""); 
			txt=txt.replace(/aacute;/g,"á");
			txt=txt.replace(/eacute;/g,"é");
			txt=txt.replace(/iacute;/g,"í");
			txt=txt.replace(/oacute;/g,"ó");
			txt=txt.replace(/uacute;/g,"ú");
			txt=txt.replace(/quot;/g,'"');
			txt=txt.replace(/apos;/g,'"');
			
			texto = txt
		return texto;
}	
function cortarString2 ( texto, len, enl){
	var enl2 = enl
	var lenS = len;
	var enlace = ""
	var numberN = -1;
	var lasS = '';
		if(texto.length < len)
			lenS = texto.length;
		if(texto.length > len)
			numberN = texto.substr(0,lenS+1).lastIndexOf(" ");
		if(numberN == -1)
			numberN = lenS;
		else
			enlace = "<a href='comments.asp?id="+enl2+"' class='lnk_sigue' style='color:#e95d0f'>(sigue)</a>"
			lasS = ' ... ' + enlace
			texto = texto.substr(0,numberN) + lasS;
		
			var txt = texto
			txt=txt.replace(/nbsp;/g,""); 
			txt=txt.replace(/&/g,""); 
			txt=txt.replace(/amp;/g,""); 
			txt=txt.replace(/aacute;/g,"á");
			txt=txt.replace(/eacute;/g,"é");
			txt=txt.replace(/iacute;/g,"í");
			txt=txt.replace(/oacute;/g,"ó");
			txt=txt.replace(/uacute;/g,"ú");
			txt=txt.replace(/quot;/g,'"');
			txt=txt.replace(/apos;/g,'"');
			
			texto = txt
		return texto;
}
function abrePop (URL,w,h){
window.open(URL,"ventana1","width="+w+", height="+h+", scrollbars=yes, menubar=no, location=no, resizable=no")
} 
function abrePop2 (URL,w,h){
window.open(URL,"ventana1","width="+w+", height="+h+", scrollbars=no, menubar=no, location=no, resizable=no")
} 
