peps = {};
peps.rollover = {
   init: function() {
      this.preload();
      jQuery(".roll").hover(
         function () { jQuery(this).attr( 'src', peps.rollover.newimage(jQuery(this).attr('src')) ); },
         function () { jQuery(this).attr( 'src', peps.rollover.oldimage(jQuery(this).attr('src')) ); }
      );
   },
	preload: function(){
      jQuery(window).bind('load', function() {
         jQuery('.roll').each( function( key, elm ) { jQuery('<img>').attr( 'src', peps.rollover.newimage( jQuery(this).attr('src') ) ); });
      });
   },
   newimage: function( src ) {
      return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_hover' + src.match(/(\.[a-z]+)$/)[0];
   },
   oldimage: function( src ){
      return src.replace(/_hover\./, '.');
   }
};


  
function rolloverCajas(){
	jQuery(".caja1").hover(
	 		function () { jQuery(".textos-caja1 a").css("color", "rgb(0, 85, 127)"); jQuery(".titulo-caja1 a").css("color", "rgb(0, 85, 127)"); },
	 		function () { jQuery(".textos-caja1 a").css("color", "rgb(115, 115, 115)"); jQuery(".titulo-caja1 a").css("color", "rgb(38, 109, 155)"); }
  	  );
	jQuery(".caja1").click(function () { window.top.location.href = jQuery("#a0").attr("href");; return false; });
	jQuery(".caja2").hover(
	 		function () { jQuery(".textos-caja2 a").css("color", "rgb(0, 85, 127)"); jQuery(".titulo-caja2 a").css("color", "rgb(0, 85, 127)");  },
	 		function () { jQuery(".textos-caja2 a").css("color", "rgb(115, 115, 115)"); jQuery(".titulo-caja2 a").css("color", "rgb(75, 156, 207)"); }
  	  );
	jQuery(".caja2").click(function () { window.top.location.href = jQuery("#a1").attr("href");; return false; });
	jQuery(".caja3").hover(
	 		function () { jQuery(".textos-caja3 a").css("color", "rgb(0, 85, 127)"); jQuery(".titulo-caja3 a").css("color", "rgb(0, 85, 127)"); },
	 		function () { jQuery(".textos-caja3 a").css("color", "rgb(115, 115, 115)"); jQuery(".titulo-caja3 a").css("color", "rgb(182, 17, 48)");  }
  	  );
	jQuery(".caja3").click(function () { window.top.location.href = jQuery("#a2").attr("href");; return false; });
	jQuery(".caja4").hover(
	 		function () { jQuery(".textos-caja4 a").css("color", "rgb(0, 85, 127)"); jQuery(".titulo-caja4 a").css("color", "rgb(0, 85, 127)");  },
	 		function () { jQuery(".textos-caja4 a").css("color", "rgb(115, 115, 115)"); jQuery(".titulo-caja4 a").css("color", "rgb(3236, 60, 19)");  }
  	  );
	jQuery(".caja4").click(function () { window.top.location.href = jQuery("#a3").attr("href");; return false; });
}


function selectPestanas(){
	/*jQuery(".pestana").hover(
	 		function () { jQuery(this).css("background-position","100% 50%"); jQuery(this).css("color","rgb(0, 85, 127)"); },
	 		function () { jQuery(this).css("background-position","0 50%"); jQuery(this).css("color","rgb(255, 255, 255)"); }
  	  );*/
	/*jQuery(".pestana").click(function () { jQuery(".pestana").css("background-position","0 50%"); jQuery(this).css("background-position","100% 50%");
											 jQuery(".pestana").css("color","rgb(255, 255, 255)"); jQuery(this).css("color","rgb(0, 85, 127)"); });*/
	
	jQuery(".pestana").click(function () { jQuery(".pestana").removeClass("seleccionada"); jQuery(this).addClass("seleccionada"); });
}


function rolloverFlecha(){
	jQuery(".rollover").hover(
	 		function () { jQuery(this).css("background-position","-495px 50%"); },
	 		function () { jQuery(this).css("background-position","0px 50%"); }
  	  );
}
