if($.browser.version.substr(0,3)=="6.0")
DD_belatedPNG.fix('.logo');
		
$(document).ready(function() {
	
	$(".return")
      .click(function() {
            history.back();
            return false;
      });
	
	$("a[rel='email']").each(function(){
		// Modify the mailto: value
		var mailtoVal = $(this).attr('href');
		mailtoVal = mailtoVal.replace("[email]","mailto:");
		mailtoVal = mailtoVal.replace("[at]","@");
		mailtoVal = mailtoVal.replace("[dot]",".");
		// Auto-generate title tags for users
		var mailtoTitle = mailtoVal.replace("mailto:","Email: ");
		$(this).attr('title',mailtoTitle);
		// onClick Event
		$(this).click(function(){
			window.location.href = mailtoVal;
			return false;
		});
	});
	
	$(".open-claus").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'overlayColor'		: '#000000'
			});

	$(".yd_rp_widget ul").addClass("last-news-list");
	
	$("#tweets").tweet({
        username: "M35oficial",
        count: 1,
        loading_text: "loading tweets...",
		refresh_interval: 60
      });
	
	// Funciones para el manejo del dropdown BEGIN 
	$(".menu-item, .dropdown").hover(function(){
		if($(this).parent().find(".dropdown").hasClass("hidden")){
			$(this).parent().parent().find(".showing").addClass("hidden");
			$(this).parent().parent().find(".showing").removeClass("showing");
			$(this).parent().find(".dropdown").removeClass("hidden");
			$(this).parent().find(".dropdown").addClass("showing");
		}else if($(this).parent().find(".dropdown").hasClass("showing")){
			$(this).parent().find(".dropdown").removeClass("showing");
			$(this).parent().find(".dropdown").addClass("hidden");
			}		
	});
		
	$(".menu-item").click(function(){
		if($(this).next().hasClass("dropdown")){
			return false;
		}
	});
	
	// END
	
	// Función para el carousel de elmentos de multiples filas
	$('#post-carousel').carousel({
		itemsPerPage: 3,
		itemsPerTransition: 3,
		easing: 'linear',
		noOfRows: 2
	});
	
	// Función para el manejo del stage slider
	$('#featured').orbit({
		 animation: 'horizontal-slide',                  // fade, horizontal-slide, vertical-slide, horizontal-push
		 animationSpeed: 800,                // how fast animtions are
		 timer: true, 			 // true or false to have the timer
		 advanceSpeed: 4000, 		 // if timer is enabled, time between transitions 
		 pauseOnHover: true, 		 // if you hover pauses the slider
		 startClockOnMouseOut: true, 	 // if clock should start on MouseOut
		 startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
		 directionalNav: true, 		 // manual advancing directional navs
		 captions: true, 			 // do you want captions?
		 captionAnimation: 'fade', 		 // fade, slideOpen, none
		 captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
		 bullets: true,			 // true or false to activate the bullet navigation
		 bulletThumbs: false,		 // thumbnails for the bullets
		 bulletThumbLocation: '',		 // location from this file where thumbs will be
		 afterSlideChange: function(){} 	 // empty function 
	});
	
	// Funciones que agregar una clase al último nodo de una contenedor
	$(".sponsors-list li:last, .pagination li:last, .th ul li:nth-child(2n)").addClass("last");
	$(".visitas-list li:nth-child(4n)").addClass("last");
	$(".mkt li:nth-child(3n)").addClass("third");
	
	if($(".posts-list ul").parent().hasClass("mask")){
		$(".posts-list ul").css('overflow', 'visible');
	}
	
});


