$(function() {
	$('#nav').superfish({
		autoArrows: false,
		delay: 1000
	});
	
	$('p:visible', $('#accordion')).hide();
	$('#accordion h4').bind('click', function() {
		if (!$(this).next('p').is(':visible')) {
			$('p:visible', $('#accordion')).slideUp();
			$(this).next('p').slideDown();
		}
	});
	
	
	$('.toggler').bind('click', function() {
		$('.openToggle').slideUp();
		$('.openToggle').removeClass('openToggle');
		if (!$(this).next('p').is(':visible')) {
			$(this).next('p').slideDown().addClass('openToggle');
		}
	});

//TOOLTIP FOR EXTERNAL LINK	
	$('.external[title]').qtip({
        position: {
				my: 'bottom left',
				at: 'top right'
		},
   		style: {
   			width:150,
			classes: 'ui-tooltip-brightyellow'
		},
		show: {
			delay: 0,
			effect: {
				length: 0
			}
		}
	});
	
	$('#nav li a').each(function(k,v) {
		$(v).wrapInner("<nobr></nobr>");
	});

//TOOLTIP FOR TWITTER COMPONENT
 	$('#twitter-content img').each(function() {
		$(this).qtip({
			content: '<p class="tooltip">'+$(this).attr('alt')+'</p>',
			position: {
				target:$(this),
				my: 'bottom center',
				at: 'top center',
				adjust: {
         		y:10 
      			} 				
			},
			style:{
				width:170,
				classes: 'ui-tooltip-logica ui-tooltip-rounded',
				tip: {
         			corner: true,
         			height:13,
         			width: 15
      			}
			},
			hide: {
            	fixed: false
         	}
		}).removeAttr('alt');
	});

  
   
   

});
