if(top.location!=self.document.location) top.location = self.document.location;

window.addEvent('domready',function() {

	MochaUI.Modal = new MochaUI.Modal();

	$(document.body).setStyle('display','block');

	$$('.popThis').addEvent('click', function() { this.setAttribute("target","_blank"); });

	$('myForm').addEvent('submit', function(e) {
		e.stop();
		this.set('send', {
			onComplete: function(response) {
				eval(response);
			}
		});
		this.send();
	});

	var stat = document.createElement("img");
	stat.src = "http://whos.amung.us/widget/ue00g5nl33da.png";
	stat.id = "stat";
	$(document.body).appendChild(stat);

	var hebdotop = document.createElement("img");
	hebdotop.src = "http://www.hebdotop.com/cgi-bin/vote.eur?id=216553";
	hebdotop.id = "hebdotop";
	$(document.body).appendChild(hebdotop);

});

function loadModal(uiTitle,uiContent,uiLoadMethod,uiWidth,uiHeight) {
	var top = self.pageYOffset ? self.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body ? document.body.scrollTop : null;
	var yMax = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
	var uiY = ((yMax/2)-(uiHeight/2))+top;
	if(uiLoadMethod=="html") {
		new MochaUI.Window({
			title: uiTitle,
			content: uiContent,
			width: uiWidth,
			height: uiHeight,
			x: 0,
			y: uiY
		});
	} else {
		new MochaUI.Window({
			title: uiTitle,
			loadMethod: uiLoadMethod,
			contentURL: uiContent,
			width: uiWidth,
			height: uiHeight,
			x: 0,
			y: uiY
		});
	}
}
