
/**************************************************************  SCRIPTS PROPIOS ******************************************************/
//  hay que utilizar la variable "jquery" en vez "$"
// jQuery("p.neat").addClass("ohmy").show("slow");
// pasa a
// jQuery("p.neat").addClass("ohmy").show("slow");




jQuery(document).ready(function() {	
	
/************** IE6 ****************/	
if (jQuery.browser.msie && jQuery.browser.version <= 6 ) { 
jQuery(function(jQuery) {DD_belatedPNG.fix('#claim')})
jQuery('#cuerpo #banderola span').prepend('&nbsp;');
jQuery('#plantilla.nivel1_2, #plantilla.listado, #plantilla.detalle, #plantilla.mapa, #plantilla.columnaUnica').css({'width':'976px', 'padding-bottom':'100px'})
;}



/***********TIPOGRAFIAS CUFON*************/
	if (jQuery("#cabecera #navPpal li .env").length > 0) {
		Cufon.replace('#cabecera #navPpal li .env', {fontFamily:'stagbook'});
	}	
	if (jQuery("#cuerpo #banderola #claim span").length > 0) {
		Cufon.replace('#cuerpo #banderola #claim span', {fontFamily:'stagbook'});
	}
	if (jQuery("#cuerpo #plantilla.detalle #banderola #claim h3").length > 0) {
		Cufon.replace('#cuerpo #plantilla.detalle #banderola #claim h3', {fontFamily:'stagbook'});
	}	
	if (jQuery("#cuerpo #plantilla.detalle #colIzda .colArticulo blockquote.cita").length > 0) {
		Cufon.replace('#cuerpo #plantilla.detalle #colIzda .colArticulo blockquote.cita', {fontFamily:'stagbook'});
	}
	if (jQuery("#listadoSedes h3").length > 0) {
		Cufon.replace('#listadoSedes h3', {fontFamily:'stagbook'});
	}
	if (jQuery("#mapaWeb h3").length > 0) {
		Cufon.replace('#mapaWeb h3', {fontFamily:'stagbook'});
	}
	if (jQuery("#cuerpo #banderola h2 span").length > 0) {
		Cufon.replace('#cuerpo #banderola h2 span', {fontFamily:'stagbold'});
	}
		if (jQuery("#cuerpo #capa_fondo h2").length > 0) {
		Cufon.replace('#cuerpo #capa_fondo h2', {fontFamily:'stagbold'});
	}
		if (jQuery("#cuerpo #capa_fondo p.pais").length > 0) {
		Cufon.replace("#cuerpo #capa_fondo p.pais", {fontFamily:'stagbook'});
	}
	if (jQuery("#cuerpo #capa_fondo p.firma").length > 0) {
		Cufon.replace("#cuerpo #capa_fondo p.firma", {fontFamily:'stagbook'});
	}
	if (jQuery("#cuerpo #capa_fondo p.titazul").length > 0) {
		Cufon.replace("#cuerpo #capa_fondo p.titazul", {fontFamily:'stagbook'});
	}
	if (jQuery("#cuerpo #capa_fondo p.seccion").length > 0) {
		Cufon.replace("#cuerpo #capa_fondo p.seccion", {fontFamily:'stagbook'});
	}
/*	if (jQuery("#cuerpo #capa_fondo h3").length > 0) {
		Cufon.replace('#cuerpo #capa_fondo h3', {fontFamily:'stagbook'});
	}*/






/***********SUBMENU DESPLEGABLE************************/
/*********** Mostrar/ocultar el desplegable *************/
jQuery("#navPpal").children("ul").children("li").hover(function () {														 
	jQuery(this).addClass('hovered');
	jQuery(this).children('div.contenDespl').show().css('z-index','3000');
},function () {
	jQuery(this).children('div.contenDespl').hide();
	jQuery(this).removeClass('hovered');
}); 
/*hover de los items*/
jQuery("#navPpal div.contenDespl div.desplGrupo .item").hover(function () {														 
	jQuery(this).addClass('itemOver');
},function () {
	jQuery(this).removeClass('itemOver');
}); 
/*Items se hacen clicables*/
jQuery("#navPpal div.contenDespl div.desplGrupo .item").click(function(){
	  window.location=jQuery(this).find("a").attr("href"); return false;
});



/***********IGUALAR ALTOS************************/
/*BASE*/
(function(jQuery){
    jQuery.fn.igualaAltura = function() {
        masalto = 0;
        this.each(function(){
            esteAlto = jQuery(this).height();
            if( esteAlto > masalto)
                masalto = esteAlto;
        });
        this.each(function(){
           jQuery(this).height(masalto);
        });
    }
})(jQuery);
/* en módulos1 */
jQuery(function(){	  
		if (jQuery('.divMosaico .fila').children('.modulo1').length > 0) {
			jQuery('.divMosaico .fila').children('.modulo1').igualaAltura();	
		}
		if (jQuery('#listadoSedes li').length > 0) {
			jQuery('#listadoSedes li').igualaAltura();	
		}
});






//*****************LIMPIAR INPUTS DE TEXTO********************/
/** jQuery-Plugin "clearField" * @author: Stijn Van Minnebruggen * stijn@donotfold.be * http://www.donotfold.be  * @example: jQuery('selector').clearField({ blurClass: 'myBlurredClass', activeClass: 'myActiveClass' });  */
(function(a){jQuery.fn.clearField=function(b){b=jQuery.extend({blurClass:"clearFieldBlurred",activeClass:"clearFieldActive"},b);jQuery(this).each(function(){var c=jQuery(this);if(c.attr("rel")==undefined){c.attr("rel",c.val()).addClass(b.blurClass)}c.focus(function(){if(c.val()==c.attr("rel")){c.val("").removeClass(b.blurClass).addClass(b.activeClass)}});c.blur(function(){if(c.val()==""){c.val(c.attr("rel")).removeClass(b.activeClass).addClass(b.blurClass)}})});return jQuery}})(jQuery);
jQuery('#cabecera #busqGrnal input[type="text"]').clearField();
if (jQuery("#pagina #cuerpo #plantilla #formContacto textarea").length > 0) {
	jQuery('#pagina #cuerpo #plantilla #formContacto textarea').clearField();	
};


/*jQuery("a").attr('href', function(i, h) {
     return h + (h.indexOf('?') != -1 ? "?KeepThis=true&TB_iframe=true&height=400&width=600" : "?ajax=1");
   });*/




if (jQuery("#pagina #cuerpo #plantilla.home").length > 0) {
	jQuery("#pagina #cabecera").css({'z-index':'9999999', 'position':'relative'});
};



/*MAPAS*/
if (jQuery("#pagina #cuerpo #plantilla.mapa").length > 0) {
	jQuery(function() {
		/*Disparar el truco*/
		/*rollovers de los li*/
		jQuery("#listadoSedes li").each(function(i){
			i++;
			var numero = jQuery(this).attr("class");	
			jQuery(this).find('a').mouseover(function(i) {
				jQuery('#mapaPresencia area.'+numero).mouseover();
	/*			jQuery(this).find('a').addClass('on');*/
				
				}).mouseout(function(i) {
				jQuery('#mapaPresencia area.'+numero).mouseout();
/*				jQuery(this).find('a').removeClass('on');*/
				})
		});
		/*rollovers de las areas
		jQuery("#mapaPresencia area").each(function(f){
		f++;
		var numero = jQuery(this).attr("class");	
		jQuery('area.'+numero).mouseover(function() {jQuery('#listadoSedes li.'+numero).addClass('on')}).mouseout(function() {jQuery('#listadoSedes li.'+numero).removeClass('on')});	
		});*/

	});
};



/*Puntos mapas*/
if (jQuery("#pagina #cuerpo #plantilla.mapa #banderola #listaPuntos ").length > 0) {
		jQuery('#listaPuntos li a').cluetip({local:true, cursor: 'pointer', dropShadow:false, width:146, showTitle:false,arrows:true, closeText:'',sticky: true, topOffset:10,leftOffset:10}); 
};

/*,,topOffset:5 */





/*Cierre document ready*/
});
