/**
 * hellgrau.toolkit v1 | Created by:	hellgrau.com
 * Website: http://www.hellgrau.com
 * Date: 08.03.2007 16:27
 * 
 * $Id: toolkit js,v 1.0.0.0
 * @author	Christopher Peter <christopher.peter@hellgrau.com>
 * @Inspired by	the	lightbox http://www.huddletogether.com/projects/lightbox/
*/

/*
function cool_feedback() {
	
	var OverlayWin = document.getElementById('cool_feedback');
	OverlayWin.className =	'cool_feedback';
	Element.setStyle(OverlayWin, {	visibility:	'show', position:	'absolute',	z-index: 1000; left: '0', top:	'0', display: 'block' });
	
	if (OverlayWin.parentNode != document.body) document.body.appendChild(OverlayWin);
	
	OverlayWin.style.backgroundImage =	'url(static/images/overlay.png)';
	


	OverlayWin.style.height = 200px;
	OverlayWin.style.width = 200px;
}
*/












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")
} 