$(document).ready(function(){
	$('.scroll-pane').jScrollPane({scrollbarMargin:10});
	HtinyScrolling.init(); //scrollTips.init();


$('#cargando').fadeOut("slow"); 

})
<!-- El script que crea los margenes -->
function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;}
                    
<!-- El script que crea los margenes -->
function margenes(){
	altura=pageHeight()-60-508;
	if (altura>0){
	if(altura>64){
	altura=64;
	}
	document.write('<style>.cabecera{ height:'+altura+'px;}#fixmetoo, #fixme{margin-top:'+altura+'px;top:0px;}</style>');
	}else{
	document.write('<style>.cabecera{ height:0px;}#fixmetoo, #fixme{margin-top:0px;top:0px;}</style>');
	}
		margen=(pageWidth()-944)/2;
	if (margen<0){
		margen=0;
		margenC=0;
	}else{
		margenC=margen-20;
	}

	document.write('<style>.pm{ width:'+margenC+'px;}#fixme{right:'+margen+'px;}#fixmetoo{right:'+margen+'px;}</style>');
}

margenes();
	
function cargarContenido(url,capa){
		$.post(url, function(data){
		eldiv='#'+capa;
		$(eldiv).html(data);
		gotoit('seccion200');
	});
}

		$(function() {

			// setup overlay actions to buttons
			$("a[rel]").overlay({
				// setup exposing (optional operation);
				onBeforeLoad: function() {
					this.expose();
			
				},				
				
				onLoad: function(content, link) {
					var PeliFlash=window.document.galeria;
					var xml=(link.attr("href"));
					PeliFlash.GotoFrame(0);
					PeliFlash.SetVariable("_root.docXml", xml);
				},
				
				onClose: function(content) {
					var PeliFlash=window.document.galeria; <!-- Esta reseteando la galeria Al inicio? -->
					PeliFlash.GotoFrame(0);
					PeliFlash.SetVariable("_root.cargado", '');					
					PeliFlash.SetVariable("_root.docXml", '');
					// cloase exposing
					$.unexpose();
				}
			});				
		});	
function avanzar(mouse){
	mouse.stopPropagation();
	
	}	
function Resize(){
	altura=pageHeight()-60-508;
	if (altura>0){
		if(altura>64){
			altura=64;
		}
	$('.cabecera').css({
		height:altura+'px'
	});	
		$('#fixme').css({
			marginTop:altura+'px',
			top: 0 +'px'
	});	
	$('#fixmetoo').css({
			marginTop:altura+'px',
			top:0 +'px'
	});			
	}else{
	}
	margen=(pageWidth()-944)/2;
	if (margen<0){
		margen=0;
		margenC=0;
	}else{
		margenC=margen-20;
	}
	$('#fixme').css({
		right:margen+'px'
	});	
	$('#fixmetoo').css({
		right:margen+'px'
	});
	$('.pm').css({
	 width: margenC+'px'
	});
}
	
window.onresize=Resize;
