// tooptip
$(document).ready(function() {
	// ein- und ausblenden der Subnavigation
	
	$(".nav > li").hover(function() { //Hover over event on list item

		if (!$(this).hasClass('current-menu-parent')){
			$('.current-menu-parent').find("ul").hide(); //Hide the subnav
		}
		$(this).find("ul").show(); //Show the subnav
		
	} , function() { //on hover out...
		if (!$(this).hasClass('current-menu-parent')){
			$(this).find("ul").hide(); //Hide the subnav
			$('.current-menu-parent').find("ul").show(); //Hide the subnav
		}
		
		
	});	
	

	$(".showtip1").each(function(){
		
		$(this).qtip({	
			show: {
				solo:true,
				
				when:{
					event: 'click'
				}
			},
		
			hide: {
				when:{
					event: 'unfocus'
				}
			},
			
			content: $(this).attr('tooltip'),
			
			position : {
				corner : {
					target : 'topMiddle',
					tooltip : 'bottomMiddle'
				},
			adjust: { 
		        x: 0, 
		        y: -30 
		     }	
		
			},
	
			style : {
				width : 140,
				padding : 10,
				background : 'url(/wp-content/themes/npgas/images/bg/tooltip-1.gif)',
				color : 'white',
				textAlign : 'left',
				border : {
					width : 0
				},
	
				tip : {
					corner : 'bottomMiddle', 
					color : '#8ac1e5',
					size : {
						x : 10, 
						y : 8
					}
				}
			}
		});
	});

	
	$(".showtip2").each(function(){
	
		$(this).qtip({
			show: {
				solo:true,
				when:{
					event: 'click'
				}
			},
			
			content: $(this).attr('tooltip'),
		
			hide: {
				when:{
					event: 'unfocus'
				}
			},
			
			position : {
				corner : {
					target : 'topMiddle',
					tooltip : 'bottomMiddle'
				},
				adjust: { 
			        x: 0, 
			        y: -30 
			     }	
			},
	
			style : {
				width : 140,
				padding : 10,
				background : 'url(/wp-content/themes/npgas/images/bg/tooltip-2.gif)',
				color : 'white',
				textAlign : 'left',
				border : {
					width : 0
				},
	
				tip : {
					corner : 'bottomMiddle', 
					color : '#682f73',
					size : {
						x : 10, 
						y : 8
					}
				}
			}
	
		});
	});
})

