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

	MochaUI.Modal = new MochaUI.Modal();

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


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

});

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
		});
	}
}

function loadModalEvent(uiTitle,uiContent,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;

	new MochaUI.Window({
		title: uiTitle,
		content: uiContent,
		onClose: function(){document.location='http://i.am.puretendance.com'},
		width: uiWidth,
		height: uiHeight,
		x: 0,
		y: uiY
	});

}

function trim(aString) {
	var regExpBeginning = /^\s+/;
	var regExpEnd = /\s+$/;  
    return aString.replace(regExpBeginning, "").replace(regExpEnd, "").replace(/[\s]{2,}/g," ");
}

function clearInput(o,str) {
	if(o.value==str) {
		o.value = "";
	}
}

window.google_analytics_uacct = "UA-2373026-18";

try {
	var pageTracker = _gat._getTracker("UA-2373026-18");
	pageTracker._trackPageview();
} catch(err) {}

