$(window).load(function(){
	//preload();
	inicio();
})
$(window).resize(function() {
		
});
function preload(){
/*
	$(document).cdzPreloadImages(
		function(total){/*alert("Preloader has started")},
		function(loaded, total){/*$('#loadingstatus').hide();$('#loadingstatus').html("Progreso de precarga : " + loaded + " / " + total)}, 
		function(){/*$('#_loadingstatus').hide(); $('#mainpage').show();inicio();},
		_globalImgsCss
	);
	*/
}
function inicio(){
//	debug($("a[href*=#ancla_]").length,true)
	$("a[id~='menu_"+_globalApartado+"']").each( function() {
		$(this).parent().addClass("actual");						
	})
	
	$("a[href*=#ancla_],a[href=#contingut],a[href=#top]").click(function(e) { 
		e.preventDefault(); 
		goToByScroll($(this).attr("href"));           
	});	

	if( $(".top_up").length > 0 ){
		$.globalIsYouTube = true;
		$.globalYouTubeElem = $("iframe[src*=youtube]");
	}
	$(".top_up").click(function(e) { 
		$.globalYouTubeElem.hide();
	});	
}

function goToByScroll(id){
	id = id.replace("#", "");
//	debug(id,true)
	$('html,body').animate({scrollTop: $('*[id*='+id+']').offset().top},'slow');
}	


