// var myLinks = document.getElementsByTagName('span'); 
// for(var i = 0; i < myLinks.length; i++){
	// if(myLinks[i].className.match('dir')){
	// alert("entro");
   // myLinks[i].addEventListener('touchstart', function(){this.className += " hover";}, true);
	 // myLinks[i].addEventListener('touchend', function(){this.className += " hover";}, true);
	// }
	// else{
	// alert("no entro");
	// }
// }

function setHover(spanTag){
	if(spanTag.className.match("hover") == ""){
		spanTag.className += " hover"; 
	}
}
	 
addEventListener(
	'load',
	function() {
		resetPage();
		androidSS();
	},
	false
);

addEventListener(
	'orientationchange',
	function() {
		resetPage();
	},
	false
);

function resetPage() {
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))){
		var classVal = (Math.abs(window.window.orientation)==90) ? "landscape" : "portrait";
		document.getElementById("page").setAttribute("class", classVal);
	}
	setTimeout(scrollTo, 0, 0, 1);
}

function androidSS() {
	if (navigator.userAgent.match(/Android/i)) {
		var fileref = document.createElement("link");
		fileref.setAttribute("rel","stylesheet");
		fileref.setAttribute("type","text/css");
		fileref.setAttribute("href","mobile3.css");
		document.getElementsByTagName("head")[0].appendChild(fileref);
	}
}

