$.fn._blank = function() {

	function clickHandler(e) {

		if (e.ctrlKey || e.shiftKey || e.metaKey)
			return;

		var w = window.open(this.href, '_blank', 'top=0,left=0,width=230,height=350');
		if (w && !w.closed) {
			w.focus();
			e.preventDefault();
		}
	}

	this
		.filter('a[@href]')
		.bind('click', clickHandler);

	return this;

}

$(document).ready(function(){
  
  if (jQuery.browser.msie && jQuery.browser.version == "8.0") {
  } else {
  
  
	
    	   $('#mapa a').tooltip({
       	
    	             track: true,
    	             delay: 0,
    	             showURL: false,
    	             showBody: " - ",
    	             top: 10,
    	             left: 10,
    	             extraClass: "tooltip",
    	             fade: 250
    	});
  }
  
  $('#news, #cont_noticias').jScrollPane({scrollbarWidth:20, scrollbarMargin:10, showArrows:true});
           
  $("#NewsletterAddForm").validate(); 
  
  
      
   function reset() {
     $('#prod_imagen li').each(function(){
       $(this).css({opacity:0});
     });
   }
   
   $('#prod_imagen').hide();
   reset();
   $('#prod_imagen').show(); 
  
     $('#prod_thumb a').each(function(){
       
       $(this).hover(function(){
     		$(this).find('img').animate({opacity:0.6},{queue:false,duration:500});
     	}, function(){
     		$(this).find('img').animate({opacity:1},{queue:false,duration:500});
     	});
     	
     	
      $(this).click(function(){
        reset();
        $('#prod_imagen li.'+this.className).animate( { opacity:1}, 800 );
        return false;
      });
      
    });
    
    $("a[rel*='nota']")._blank();
    
 
});

