$(document).ready(function() {
  	$('div.nav2 ul li').click(function(){
		var classe = $(this).attr('class');
		//console.log(classe);
		if($(this).hasClass("blue")){return false;};//prevent whole thing if already active... otherwise all disappear.
		$('div.nav2 ul li').removeClass('blue');
		$(this).addClass('blue');
		//$('.content:visible').fadeOut("slow", function(){
		//	$("." + classe).fadeIn("slow");
		//});
		$('.content:visible').hide();
		$("." + classe).fadeIn("slow");
		
	});
});

$(document).ready(function(){
	$('div.content.one').fadeIn("slow");
	
	$('div.nav2 ul li.one').addClass('blue');
});




$(document).keydown(function (e) {
     if (e.keyCode == 32) { 
       $(this).val($(this).val() + "-"); // append '-' to input
       return false; // return false to prevent space from being added
     }
});



// Create the tooltips only on document load
$(document).ready(function() 
{
   // Notice the use of the each() method to acquire access to each elements attributes
   $('a.dot').each(function()
   {
	var contentLocation = $(this).attr("city");
      $(this).qtip({
         content: $("div#" + contentLocation), // Use the tooltip attribute of the element for the content
         position: { 
	
			adjust: { screen: true },
			corner: { target: 'rightTop',
	        tooltip: 'leftTop' }
		},
		style: {
		
			border: {
			         width: 2,
			         radius: 5
			      },
			
			width:450,
			padding:10,
			name:"light"
			},
		hide: { when: 'mouseout', fixed: true }
      });
   });
});

$(document).ready(function(){
   // Notice the use of the each() method to acquire access to each elements attributes
	$('a.banksim').each(function(){
		$(this).qtip({
        	content: $("div.banksim"), // Use the tooltip attribute of the element for the content
         	position: {
			   target: 'mouse',
			   adjust: { mouse: true, screen: true  }
			},
			style: {
				
				border: {
					width: 2,
					radius: 5
					},
				width:250,
				padding:10,
				name:"dark"
				},
			show: { when: { event: 'click' } },
hide: { when: 'click' }
			
		});
	});
});

$(document).ready(function(){
   // Notice the use of the each() method to acquire access to each elements attributes
	$('a.branchsim').each(function(){
		$(this).qtip({
        	content: $("div.branchsim"), // Use the tooltip attribute of the element for the content
         	position: {
			   target: 'mouse',
			   adjust: { mouse: true, screen: true  }
			},
			style: {
				
				border: {
					width: 2,
					radius: 5
					},
				width:250,
				padding:10,
				name:"dark"
				},
			show: { when: { event: 'click' } },
hide: { when: 'click' }
			
		});
	});
});

$(document).ready(function(){
   // Notice the use of the each() method to acquire access to each elements attributes
	$('a.credsim').each(function(){
		$(this).qtip({
        	content: $("div.credsim"), // Use the tooltip attribute of the element for the content
         	position: {
			   target: 'mouse',
			   adjust: { mouse: true, screen: true  }
			},
			style: {
				
				border: {
					width: 2,
					radius: 5
					},
				width:250,
				padding:10,
				name:"dark"
				},
			show: { when: { event: 'click' } },
hide: { when: 'click' }
			
		});
	});
});


$(document).ready(function(){
   // Notice the use of the each() method to acquire access to each elements attributes
	$('a.credstrat').each(function(){
		$(this).qtip({
        	content: $("div.credstrat"), // Use the tooltip attribute of the element for the content
         	position: {
			   target: 'mouse',
			   adjust: { mouse: true, screen: true  }
			},
			style: {
				
				border: {
					width: 2,
					radius: 5
					},
				width:250,
				padding:10,
				name:"dark"
				},
			show: { when: { event: 'click' } },
hide: { when: 'click' }
			
		});
	});
});

$(document).ready(function(){
   // Notice the use of the each() method to acquire access to each elements attributes
	$('a.comsim').each(function(){
		$(this).qtip({
        	content: $("div.comsim"), // Use the tooltip attribute of the element for the content
         	position: {
			   target: 'mouse',
			   adjust: { mouse: true, screen: true  }
			},
			style: {
				
				border: {
					width: 2,
					radius: 5
					},
				width:250,
				padding:10,
				name:"dark"
				},
			show: { when: { event: 'click' } },
hide: { when: 'click' }
			
		});
	});
});

$(document).ready(function(){
	$('.qtip-light').live("mouseout", function(event) {
	  $('.qtip-active').hide().removeClass('qtip-active');
	});
});

$(document).ready(function(){
	$('.qtip-dark').live("mouseout", function(event) {
	  $('.qtip-dark').hide().removeClass('qtip-active');
	});
});

