function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
 
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}

	return xmlhttp;
}


function buscaart(datos){

	divResultado = document.getElementById('resultados');
	ajax=objetoAjax();
	ajax.open("GET", datos);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			divResultado.innerHTML = ajax.responseText
		}
	}

    ajax.send(null)

	divResultado.style.visibility="visible";
}

function esconderes(){
	divResultado.style.visibility="hidden";
}

function validamail(campo) {

	// Note: The next expression must be all on one line...
	//       allow no spaces, linefeeds, or carriage returns!
	var goodEmail = campo.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);

	if (goodEmail){
	   good = true
	} else {
	   alert('El email que introdujiste no es válido')
	   campo.focus()
	   campo.select()
	   good = false
	}
    return good;
}

function openwin(page,ancho,alto){
		opc = "width="+ancho+",height="+alto+",directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no";
		window.open(page, "miniwin",opc);
}

function infogravatar(){
	location.href="http://www.wopvideos.com/microblog/?p=18";
}

num = 0;
var interx;
function rotar(id) {

	eval("imagenes = imagenes"+id+";");
	obj = document.getElementById(id);
	num++;
	if (num == imagenes.length) num = 0
	obj.src = "http://www.wopvideos.com/imgthumbs/" + id + "/mini/" + imagenes[num];
	if(obj.height > 70){
		imgmargin = Math.ceil((obj.height-70)/2);
		//alert("-"+imgmargin);
		obj.style.marginTop = "-" + imgmargin + "px"; 
	}
}