var functions = {	
	showMap:function(image){
		$("#" + image + "a").fadeOut(800);
		$("#" + image + "b").fadeIn(800);
	},
	hideMap:function(image){
		$("#" + image + "b").fadeOut(800)
		$("#" + image + "a").fadeIn(800);
	},
	showMapByCategory:function(image)
	{
		var maps = ['image1','image2','image3'];
		jQuery.each(maps, function(){ 
			if (this==image) {
				$("#" + this + "b").fadeOut(800)
				$("#" + this + "a").fadeIn(800);				
			}
			else {
				$("#" + this + "a").css("display", "none");
				$("#" + this + "b").css("display", "none");
			}
		});
		
		if (typeof this.t == "number") {
			clearTimeout(this.t);
		}
		
		showmap = this.showMap;
		this.t = setTimeout("showmap('"+ image + "')", 2750);

		
		return false;
	}
};

$(function(){
	var url = window.location.href;
	url = url.match(/#map(.*)/);
	url = (url) ? url[1] : 1;
	url = (url>0 && url<4) ? url : 1;
	
	functions.showMapByCategory('image' + url);
	
	
	$("a.activo").removeClass("activo"); 
	$("a[href='#map"+url+"']").addClass('activo');
});