
function hasJS(){
	$('body').addClass('hasJS');
}


function upbar(){
	$('#up-bar-9 a').click(function(){
		//$('#up-bar-buscar').SlideToggleUp(180, null, null).toggleClass('active');
		$('#up-bar-buscar').toggle();
		return false;
	});
}




function toprint(a) {
	$('a.' + a).click(function(){
		window.print();
		return false;
	});
}


/* go_beyond */
/*optener alto y ancho*/
function dimensiones (a,b,e) {
		
		var alto= $(a).height()+ 100;	
		var ancho= $(b).width();
		
		
   		$(e).height(alto).width(ancho);		
	}


/* como usar este plugin 
	llamando la funcion:
	
	$('elemento al que debemos clickar')
	.picaryMostrar('lo que queremos mostrar como principal',
    'lo que queremos mostrar como secundario, al cual se le aplicara una clase, opcional');

*/	
	jQuery.fn.picaryMostrar = function (a,b) {
		if(!b){ b = 'none';}

		
		$(this).click(function(){
			$(b).addClass('active');
			/*$('html').addClass('over');*/
			$(a).show();
			$(a).focus();
			return false;
		})
		$('#close').click(function(){
			$(b).removeClass('active');
			/*$('html').removeClass('over');*/
			$(a).hide();	
			return false;
		})
	}

jQuery.fn.alerts = function()
{
	obj = jQuery(this);
	jQuery(obj).fadeIn('slow');					
	setTimeout("jQuery(obj).fadeOut('slow');", 5000);
}


jQuery.fn.popup = function (nombre, dimensiones) {
					return this.click( function(){
						window.open(this.href, nombre, dimensiones);					
							return false;					
					});
				}

$(document).ready(function(){
	hasJS();
	upbar();
	//nav();
	toprint('print');
	
	$('.resalt h3 a').picaryMostrar('#go_beyond','#capa');
	$('.show_layer a').picaryMostrar('#go_beyond','#capa');
	$('.resalt h3 a').picaryMostrar('#h_f','#capa');
	$('.show_layer a').picaryMostrar('#h_f','#capa');
});

