function xmlhttpPost(str,Url,tipo) {
	var xmlHttpReq = false;
	var self = this;
	//var strUrl = Url;
	var strURL = Url;
	// Mozilla/Safari
	self.opt=tipo;
	if (window.XMLHttpRequest) {
		self.xmlHttpReq = new XMLHttpRequest();
	}
	// IE
	else if (window.ActiveXObject) {
		self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}
	self.xmlHttpReq.open('POST', strURL, true);
	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	self.xmlHttpReq.onreadystatechange = function(tipo) {
		if (self.xmlHttpReq.readyState == 4) {
				updateSuscrito(self.xmlHttpReq.responseText);
		}
	}
	self.xmlHttpReq.send(str);
}

function updateSuscrito(str){
	document.getElementById("DIV-suscribirse").innerHTML = str;
}

function suscribirse(codCategoria, codUsuario){
	qstr = 'codCategoria=' + codCategoria + '&codUsuario=' + codUsuario + '&tipo=1';  // NOTE: no '?' before querystring
	xmlhttpPost(qstr,"/categorias/suscribirse.phtml",3);
}
function quitarSuscrito(codCategoria, codUsuario){
	qstr = 'codCategoria=' + codCategoria + '&codUsuario=' + codUsuario + '&tipo=2';  // NOTE: no '?' before querystring
	xmlhttpPost(qstr,"/categorias/suscribirse.phtml",3);
}

var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = posicRatonXY;
var posicX = 0
var posicY = 0

function posicRatonXY(e) {
	if (IE) { 
		posicX = (event.clientX/2) + document.documentElement.scrollLeft;
		posicY = (event.clientY/2) + document.documentElement.scrollTop;
	}
	else { 
		posicX = (e.pageX / 2);
		posicY = (e.pageY / 2); 
	};
	if (posicX < 0) {posicX = 0};
	if (posicY < 0) {posicY = 0};
	
	return true 
}

function mostrarCapaRegistro(){

	document.getElementById("theLayer").style.top = posicY + 'px';
	document.getElementById("theLayer").style.left = posicX + 'px';
	document.getElementById("theLayer").style.display="block";
}

function mostrarCapaRegistroErotismo(){

	document.getElementById("theLayer").style.display="block";
}

function ocultarCapaRegistro(){
	document.getElementById("theLayer").style.display="none";
}

