$(function(){
	var tool ;
$('#help').hover( function() {
	var contents = $('#content');
	if(!contents.find('.toolTipWrapper').length){
		var wrapper = $('<div class="toolTipWrapper">'
				+ '<div class="toolTipMid">'
				+ '<div class="header">Why Social Sign-On Registration?</div>'
				+ '<div class="content">Based on feedback from our users for shorter registration forms and an easy, "one-click" solution using familiar accounts such as Google, Yahoo and AOL mail services, as well as Facebook. No more lengthy registration forms or additional usernames and passwords to memorize.</div>'
					 
				+ '<div class="header">Why these providers?</div>'
				+ '<div class="content">The authentication providers were selected based on those that are most popular with users, providing the easiest transition for our users.  Providers will be added based on industry trends and user feedback.</div>'
					 
				+ '<div class="header">What if I am not associated with any of these providers?</div>'  
				+ '<div class="content">Every effort has been made to choose providers with a strong presence in the online community, but from time to time this may happen.  A link has been provided on this page that allows you to set up a Google email account. This email account can be set to <a class="googleHelpLink" href="http://mail.google.com/support/bin/answer.py?hl=en&answer=10957" target="_blank">forward any arriving newsletters or alerts to another account</a> if you prefer to organize mail with a different email account.</div>' 
				+ '</div></div>');
	
		$("#content").append(wrapper);
		
		var help_position = $(this).position();
		var contents_position = contents.position();
		var help_width = $(wrapper).width();
		var content_size = contents_position.left + contents.width();
		var pos = help_position.left;
		if(content_size < pos + help_width + 20 ){
			pos -= help_width;
		}
		tool = $('.toolTipWrapper');
		tool.css("top", help_position.top + 28);
		tool.css("left", pos  );
	}
	tool.fadeIn(300);
	if(myTimer) { clearTimeout(myTimer); }
},
function(event) {
	var tool = $('.toolTipWrapper');
	hideTooltip(event.relatedTarget.className);
	
	tool.mouseleave(function () { 
		hideTooltip(event.relatedTarget.className);
	});

	tool.mouseenter(function () {
		if(myTimer) { clearTimeout(myTimer); }
	});
});


var hideTooltip = function(o) {
myTimer = setTimeout(function() { 
	var tool = $('.toolTipWrapper');
	tool.fadeOut(300);
}, 400);
}
});
