window.addEventListener('load',appSetup,false);

function appSetup (){
	mobilityLocation();
	setTimeout(navBarHidden,100);
	navMenu = new ListEffects ('menu');
}
function mobilityLocation(){
	if (window.location.host!='www.mobility-br.com'){window.location.hostname='www.mobility-br.com';}
}
function navBarHidden(){
	window.scrollTo(0,1);
}
function ListEffects (id){
	this.y=document.getElementById(id).children;
	if('createTouch' in document){
		for (i=0;i<this.y.length; i++){
			this.y[i].addEventListener('touchstart',this,false);
			this.y[i].addEventListener('touchend',this,false);
			this.y[i].addEventListener('touchcancel',this,false);
		}
	}
	else {
		for (i=0;i<this.y.length; i++){
			this.y[i].addEventListener('mouseover',this,false);
			this.y[i].addEventListener('mouseout',this,false);		
		}
	}
	ListEffects.prototype.handleEvent = function(event) {
		if (typeof(this[event.type]) === "function")
		return this[event.type](event);
	}
	ListEffects.prototype.touchstart = function (event){
		event.currentTarget.setAttribute('class','hover');
	}

	ListEffects.prototype.touchend = function (event){
		event.currentTarget.removeAttribute('class');
	}

	ListEffects.prototype.touchcancel = function (event){
		event.currentTarget.removeAttribute('class');
	}
	ListEffects.prototype.mouseover = function (event){
		event.currentTarget.setAttribute('class','hover');
	}

	ListEffects.prototype.mouseout = function (event){
		event.currentTarget.removeAttribute('class');
	}
}
