
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 noLinksAndForms(){
	$('a').click(function(){
		return false;
	});
	$('form').submit(function(){
		return false;
	});
}


function nav(){
	$('#nav > li > ul').addClass('submenu');
	
	// nav header - menu principal
	$('#nav > li').hover(						 
		function(){
			$('#nav > li > ul').hide();
			$(this).find('> a').addClass('active').next().show();
		},
		function(){
			$(this).find('> a').removeClass('active').next().hide();
			$('#nav > li.on > ul').show();
		}
		
	);
	$('#nav > li.on > ul').show();	
}


function toprint(a) {
	$('a.' + a).click(function(){
		window.print();
		return false;
	});
}






			function openWindowEvent(a) {				
					var href = $(a).attr('href');
					var today = new Date(); var hh = today.getHours(); var mm = today.getMinutes(); var ss = today.getSeconds();
					var currentTime = hh + ':' + mm + ':' + ss;
					
					/*
					// IE sniff
					if($.browser.msie && typeof XMLHttpRequest == 'function') {
						$('#content select').css('visibility','hidden');
					};
					*/
					
					$('#overlay, #event').show();
					$('#event').load(
						href + '&time=' + currentTime,
						function() { tabs4(); }
					);
			}
				
			function closeWindowEvent(){
				$('#overlay, #event').hide();
				$('#event').removeClass('active');
			}
			
			
			function tabs4() {
				$('#tab4-link1, #tab4-link2').click(function(){
					// active tab links
					$('#tab-nav-4 li').removeClass('tabs-selected');
					$(this).parent().addClass('tabs-selected');
					$('#event').addClass('active');
					
					// hide and show tabs
					$('#tab-4 > div').hide();
					var rel = $(this)[0].getAttribute('rel');
					$('#'+rel).show();
					
					return false;
				});
			}
			
			
			
			function dimensiones (a,b,e) {
					var alto= $(a).height();	
					var ancho= $(b).width();
					$(e).height(alto).width(ancho);
				}




			jQuery.fn.popup = function (nombre, dimensiones) {
					return this.click( function(){
						window.open(this.href, nombre, dimensiones);					
							return false;					
					});
				}
				
			jQuery.fn.toggleList = function () {
					var picar = $(this).find('li>h2');
					
					picar.next().hide();
				
					picar.click(function(){											 
						$(this).next().toggle();
						$(this).parent('li').toggleClass('active');
					})
				}



$(document).ready(function(){
	hasJS();
	upbar();
	nav();
	toprint('print');
});

