var ImgCabLoaded = false;
var first=true;

function PrecargarImagenes(){
	
var myImages = new Asset.images(['images/menu/Alumni-on.gif',	'images/menu/Alumni-off.gif',	'images/menu/Alumni-over.gif','images/menu/SupportIESE-on.gif',	'images/menu/SupportIESE-off.gif',	'images/menu/SupportIESE-over.gif','images/menu/IESEinTheUSA-on.gif',	'images/menu/IESEinTheUSA-off.gif',	'images/menu/IESEinTheUSA-over.gif','images/menu/IME-on.gif',	'images/menu/IME-off.gif',	'images/menu/IME-over.gif','images/menu/Programs-on.gif',	'images/menu/Programs-off.gif',	'images/menu/Programs-over.gif','images/menu/ResearchCenter-on.gif',	'images/menu/ResearchCenter-off.gif',	'images/menu/ResearchCenter-over.gif'], {});
}

function HabilitarLoadImagenes(){
	if($chk($("ImagenCabeceraFondo"))){
	$("ImagenCabeceraFondo").setOpacity(0);
	$("ImagenCabeceraFondo").addEvent("load",function (){
				var myFx = new Fx.Style("ImagenCabeceraFondo", "opacity").start(0,1);
				ImgCabLoaded = true;
			   });
	}
}

function ActivarBuscador(){
	$("q").addEvents({
    'focus': function(){
		if(first){this.value=''; first=false;}
	},
    'blur': function(){
		if(this.value==''){
        this.value='search'; first=true;}
    }
	});

}
/* ************************************************************** */

window.addEvent('domready', function() {
		HabilitarLoadImagenes();
		ActivarBuscador();
});

window.addEvent('load', function() {
		PrecargarImagenes();
		if($chk($("ImagenCabeceraFondo"))){
			if(!ImgCabLoaded){
				var myFx = new Fx.Style('ImagenCabeceraFondo', 'opacity').start(0,1);
				ImgCabLoaded = true;
			}
		}
});

