// Java Document
function carita(caraemot){
	document.newMsg.msgText.value = document.newMsg.msgText.value + caraemot;
	document.newMsg.msgCL.value = document.newMsg.msgCL.value - caraemot.length;
	document.newMsg.msgText.focus();
}
var supportsKeys = false
function favChange(rnum) {
	f = document.newMsg;
	
	if (f.favs.selectedIndex >=0) {
		f.msgTo.value = f.favs.options[f.favs.selectedIndex].value
	}

	if (f.favs.selectedIndex > 0 && f.favs.selectedIndex <= rnum + 1) {
		f.msgText.focus();
		f.msgDe.focus();
	} else {
		f.msgTo.focus();
	}
}
function calcCharLeft(f) {
		lenUSig = f.lenSSig.value
		maxLength = 110 - f.lenSysSig.value - lenUSig
		total = f.msgText.value.length + f.msgDe.value.length
        if (total > maxLength) {
	        f.msgText.value = f.msgText.value.substring(0,maxLength)
			f.msgDe.value = f.msgDe.value.substring(0,maxLength)
		    charleft = 0
        } else {
			charleft = maxLength - total
		}

        f.msgCL.value = charleft
}
function textKey(f) {
	supportsKeys = true
	calcCharLeft(f)
}
function Contacto(AgeArea, AgeNro, AgeComp) {
	document.newMsg.area.value = document.newMsg.area.value=AgeArea;
	document.newMsg.numero.value = document.newMsg.numero.value=AgeNro;
	document.newMsg.compania.value = document.newMsg.compania.value=AgeComp;
	document.newMsg.msgDe.focus();
}
function AgregaSMS(nombre) {
	var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=300, height=200, top=85, left=140";
	window.open("in.sms_agrega.php",nombre,opciones);
}
function highlight(which,color){
	if (document.all||document.getElementById)
		which.style.backgroundColor=color
}
function elecOn(objeto){
     objeto.style.background="#990000";
     objeto.style.color="#FFFFFF";
     window.status=objeto.innerText;
}
function elecOff(objeto){
     objeto.style.background="#FFFFFF";
     objeto.style.color="#000000";
     window.status="";
}
function FmStylo()
{
	var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=240, height=200, top=85, left=140";
	window.open("http://www.info-crespo.com.ar/modulos/general/fmstylo/Reproductor.php","",opciones);
}
function CVLogos()
{
	var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=250, height=500, top=85, left=140";
	window.open("http://www.info-crespo.com.ar/modulos/general/cablevideo/logos.php","",opciones);
}
function Imprime(lugar)
{
	var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=670, height=300, top=85, left=140";
	window.open("http://"+lugar,"",opciones);
}
function MostrarDiv(NombreDiv) {
	div = document.getElementById(NombreDiv);
	div.style.display = '';
}
function OcultarDiv(NombreDiv) {
	div = document.getElementById(NombreDiv);
	div.style.display = 'none';
}
var ConLeyenda1 = "Recargando en ";
var ConLeyenda2 = " segundo(s)";
function ConFin(donde)	{
	location.href= donde;
}
function ConUnoMenos(donde,ConCuentaInicial)	{
	with	(document.getElementById("contador")) innerHTML = ConLeyenda1+ConCuentaInicial+ConLeyenda2;
	if (ConCuentaInicial-- > 0) setTimeout("ConUnoMenos('"+donde+"','"+ConCuentaInicial+"')", 1000);
	else	ConFin(donde);
}
function ConIni(donde,ConCuentaInicial)	{
	with	(document.getElementById("contador")) innerHTML = ConLeyenda1+ConCuentaInicial+ConLeyenda2;
	setTimeout("ConUnoMenos('"+donde+"','"+ConCuentaInicial+"')", 1000);
}
function PopUp(fuente,ancho,alto)
{
	var opciones="toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, width="+ancho+", height="+alto+", top=85, left=50";
	window.open(fuente,"",opciones);
}
