
//Funcion Favoritos---------------
function favoritos(pagina,descripcion){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url=pagina;
var titulo=descripcion;
window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape") 
alert ("Presione Crtl+D para añadir esta direccion a Favoritos");
}
}
//---------------------



<!-- REDONDEAR NUMERO CON DECIMALES -->
function decimales(numero,decimales,separador_decimal)
	{
		numero=parseFloat(numero);
		decimales=parseInt(decimales);
		
		var valor=numero;

		for (i=0;i<decimales;i++) //sacamos los decimales que necesitamos a la parte entera multiplicando por 10
			{
				valor=valor*10;
			}//del for

		valor=parseInt(valor); //pasamos a entero y desechamos la parte decimal
		var valorcadena=String(valor); //convertimos a cadena el valor
		
		var parte_decimal=valorcadena.substr(valorcadena.length-decimales); //sacamos la parte decimal de la cadena
		if (parte_decimal=='0')//en el caso de que el numero sea 0 la parte decimal también es 0
			{
			parte_decimal='';
			for (i=0;i<decimales;i++)//creamos las posiciones decimales
				{
				parte_decimal=parte_decimal+'0';
				}//del for
			}//del if

		for (i=0;i<decimales;i++) //hacemos la operacion inversa a la primera para volver a tener el valor entero igual
			{
				valor=valor/10;
			}//del for
			
		valor=parseInt(valor); //deshechamos de nuevo la parte decimal
		valor=String(valor)+separador_decimal+parte_decimal; //reconstruimos el numero
		
		if (isNaN(valor)==true)
			{
				valor='error';
			}//del if
		
		return valor;
		
	}//de function
<!-- -->


<!-- CORTAR TEXTO EN TEXTAREAS -- >
function cortar(id,num)
	{
	if (document.getElementById(id).value.length>num) document.getElementById(id).value=document.getElementById(id).value.substr(0,num);
	}
	
	
	

function aumentar_texto(bloque){
	
	parrafos = document.getElementById(bloque).getElementsByTagName('p');
	for (i=0; i< parrafos.length; i++){
		
		if (parrafos[i].style.fontSize == '10px') { parrafos[i].style.fontSize = '13px'}
		else 									  { parrafos[i].style.fontSize = '15px'};
	} 
}

function reducir_texto(bloque){
	
	parrafos = document.getElementById(bloque).getElementsByTagName('p');
	for (i=0; i< parrafos.length; i++){
		if (parrafos[i].style.fontSize == '15px') { parrafos[i].style.fontSize = '13px'}
		else 									  { parrafos[i].style.fontSize = '10px'};
	} 
}


<!-- AMPLIAR IMAGEN -->
function ampliar(ruta,imagen)
{
	document.getElementById(imagen).src='imagenes_tcs/ico_cargando.gif';
	setTimeout("document.getElementById('"+imagen+"').src='"+ruta+"'",2000);
}
<!-- -->


<!-- NUEVA VENTANA CON ANCHO, ALTO Y SIN BARRAS NI BOTONES -->
function abrir_ventana(theURL,w,h)
	{
	var windowprops ="top=0,left=0,toolbar=no,location=no,status=no, menubar=no,scrollbars=no, resizable=no,width=" + w + ",height=" + h;

	window.open(theURL,'',windowprops);
	}
<!-- -->



function confirmacion(pregunta,URL)
{
confirmar=confirm(pregunta);
	if (confirmar)
	{
    location.href=URL;
  	}
}

function etiqueta(texto)
{
	document.getElementById('etiqueta').value=texto;
}


function flip(rid)
{
	current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
	document.getElementById(rid).style.display = current;
}

function mostrar(rid)
{
	document.getElementById(rid).style.display = 'block';
}

function ocultar(rid)
{
	document.getElementById(rid).style.display = 'none';
}


function resaltar_casilla(objeto)
{
	//document.getElementById(objeto).style.backgroundColor='#ffffff';
	document.getElementById(objeto).style.borderColor='#8a9427';
	//document.getElementById(objeto).style.color='#cccccc';
}