// JavaScript Document
/*

DosFlechasPara¨Scroll
ActivaPrettyPhoto
AlturaImagenes
*/
function DosFlechasParaScroll(divFDer,divFIzq,divTabImg,divContenidoLista,saltoFotos,anchoMax)
		{
			
		  if($('#'+divTabImg).width()>anchoMax) {			
			$('#'+divFDer).show();
			$('#'+divFDer).click (function (){
			  pos=parseFloat ($('#'+divContenidoLista).css('left').split ('p')[0]);
			  ancho=parseFloat($('#'+divContenidoLista).width());
			  if (pos+ancho>saltoFotos)
				{
					if (pos+ancho<2*saltoFotos) $('#'+divFDer).fadeOut();
					miSaltoFotos=saltoFotos;  
					$('#'+divFIzq).fadeIn(); 
				  	$('#'+divContenidoLista).animate({
					  left: '-='+miSaltoFotos,
					  duration: 0,
					  easing:'none'},
					  function(){
							  pos=parseFloat ($(this).css('left').split ('p')[0]);
							  if (pos+ancho<saltoFotos) $(this).css('left',(saltoFotos-ancho)+"px");
					  });
				  }
			  });	
		  
		  	  $('#'+divFIzq).click (function (){
				  pos=parseInt($('#'+divContenidoLista).css('left').split ('p')[0]);
				  if (pos<0)  {
					miSaltoFotos=saltoFotos;
					if (pos>=-1*saltoFotos) $('#'+divFIzq).fadeOut();
					$('#'+divFDer).fadeIn();
					if  (pos>-1*saltoFotos) miSaltoFotos=-1*pos;
					$('#'+divContenidoLista).animate({
						left: '+='+miSaltoFotos,
						duration: 0,
						easing:'none'
					},
					function(){
						pos=parseFloat ($(this).css('left').split ('p')[0]);
						if (pos>0) $(this).css('left',"0px");
					});

			  }
		});				

	} 
}
		
		
function ActivaPrettyPhoto()
{
$("a[rel^='prettyPhoto']").prettyPhoto({
		social_tools:'',
		deeplinking: false
			
		});		
}
	 $(document).ready(function(){
		ActivaPrettyPhoto();
		$('#logoCabecero').click(function(){
		 
			window.location="defaultb.php";
		});
	});
	
function AlturaImagenes(claseoid,maxHeight,reLoaded)
{
	txt="";

	 
	$(claseoid).each (function(){
		if ($(this).attr("height")>maxHeight) {	 
			$(this).attr("width",maxHeight*$(this).attr("width")/$(this).attr("height"));
		 	$(this).attr("height",maxHeight);
		}
	});
	
	 
	var mifuncion=function(){AlturaImagenes(claseoid,maxHeight,true);}
	if (!reLoaded) setTimeout (mifuncion,100);

}

