// Copyright Enrique F. Castañón para Utiles.Ltn.Net. Todos los derechos reservados.

if (parent.utiles_ltn_net != "ok") { 
	fijar = new paginas();
	fijar.marcos(); 
	utiles_ltn_net = "ok";
} 
var retorno = ' ';
var canal = ' ';

alert('Utilidad no disponible');

function utilidad(usr,utl,mdo) {
	this.usr = usr;
	this.utl = utl;
	this.mdo = mdo;
	this.resultados = ' ';
	this.query = new String(document.location.search);
	this.query = this.query.substring(1,this.query.length);
	this.opciones = this.query.split("&");
	encontrado = false;
	for (i=0; i<this.opciones.length; i++) {
		if(this.opciones[i] == ('obj='+this.utl)) {
			encontrado = true;
			break;
		}
	}
	if(!encontrado) this.query = "";
	this.query += '&usr='+ this.usr + '&obj=' + this.utl + '&mdo=' + this.mdo;
	this.script = 'http://cgi.ltn.net/utiles/utl-bin/js.cgi?';
	this.imprime = imprime;
	this.cgi = cgi;
	this.resultados = this.cgi(this.script + this.query);
}

function imprime(micanal) {
	canal = micanal;
	if(!micanal) canal = '#amigar';
	document.write(this.resultados);
}

function cgi(script) {
	// document.write ('\<SCRIPT LANGUAGE="JavaScript" SRC="' + script + '">\<\/SCRIPT\>');
	return retorno;
}

// El objeto paginas crea los marcos.
function paginas() {
	this.url = document.location.href;
	this.path = document.location.pathname;
	this.ad_url = 'http://utiles.ltn.net/ad/superior.htm?' + document.location.host + this.path;
	this.marcos = marcos;
}

function marcos() {
	// document.writeln('\<html\>');
	// document.writeln('\<frameset framespacing="0" border="0" rows="32,*" frameborder="0"\>');
	// document.writeln('\<frame name="superior" scrolling="no" noresize src="http://utiles.ltn.net/ad/cargando.htm" marginwidth="0" marginheight="0"\>');
	// document.writeln('\<frame name="principal" src="http://utiles.ltn.net/ad/cargando.htm"\>');
	// document.writeln('\<\/frameset\>');
	// document.writeln('\<\/html\>');
	// no se carga el marco directamente por que da un error.
	// parent.superior.location.href = this.ad_url;
	// parent.principal.location.href = this.url;

}
