//CODIGO QUE LANZA EL METODO CONTROLADOR	
Event.observe(window,"load",function(){
	
	Adesis.Controlador.initialize();
});

Adesis.Controlador = {
	hayEnlacesConAccion: false,
	hayEnlacesLightbox: false,
	initialize: function () { with(this){
		//corregirOnKeyPress();
		controlaComportamientoEnlaces();
		asignaRolesEstructuras();
		controlaComportamientoIframes();
		controlaMenuDesplegable();
		controlaComportamientoVentanaModalControlModal();		
	}},
	controlaComportamientoEnlaces: function () { with(this) {
		$$(Selectores.enlaces.enlaceConAccion).each ( function (enlace) {
			hayEnlacesConAccion = true;
		},this);
		if (hayEnlacesConAccion) modificaEnlacesConAccion();
		
	}},
	modificaEnlacesConAccion: function () {
		var modificardorEnlacesConAccion = new Adesis.Utilidades.ModificarEnlacesConAccion(this);
	},	
	asignaRolesEstructuras: function () {
		new Adesis.Utilidades.ARIA.AsignarRolesEstructuras(this);
	},	
	insertaComportamiento: function (controlador) {with(this) {
		return new Adesis.ManipuladorComportamientos(controlador);
	}},
	controlaComportamientoIframes: function () { with(this) {
		$$(Selectores.mapaGoogle).each ( function (contenedor) {
			modificaHTMLIframes(contenedor);
		},this);
		$$(Selectores.iframeLogin).each ( function (contenedor) {
			modificaHTMLIframes(contenedor);
		},this);
		
	}},
	modificaHTMLIframes: function (contenedor) {
		var modificadorHTMLIframes = new Adesis.Utilidades.ModificarHTMLIframes(this, contenedor);
	},
	controlaMenuDesplegable: function () { with(this) {
		if ($(Identificadores.menuDesplegable)) {
			accionaMenuDesplegable(this, $(Identificadores.menuDesplegable));
		}
		
	}},
	accionaMenuDesplegable: function (contenedor) {
		var accionadorMenuDesplegable = new Adesis.Utilidades.menuDesplegable(this, contenedor);
	},
	controlaComportamientoVentanaModalControlModal: function () { with(this) {
		$$(Selectores.enlaces.controlModal).each ( function (enlaceControlModal) {
			var modal = new Control.Modal(enlaceControlModal,{  
				overlayOpacity: 0.75,  
				className: 'modal',  
				fade: true  
			});  
		},this);

	
	}}
	
}

