/**
 * Sorry IE6 users, upgrade browser :-(
 *
 * @author		Deniss Rostkovskis <deniss.rostkovskis@gmail.com>
 * @copyright	Copyright (c) IQ-Labs Inc., created on 2009/10/20
 * @version		$Id: script.js 53399 2009-11-04 09:44:55Z rostovskis $
 */

if (!$.browser.msie || ($.browser.msie && parseInt($.browser.version) > 6)) {

	var timerRunning = false;
	var timerId = null;

	$(document).ready(function() {
		$('.addThisCnt').css('display', 'inline');
		$('.addThisCnt').mouseover(showAddThisBox);
		$('.addThisCnt').mouseout(delayHideAddThisBox);
	});

	showAddThisBox = function() {
		if (timerRunning)
			clearTimeout(timerId);

		timerRunning = false;

		$('.addThisHeader').addClass('active');
		$('.addThisBody').slideDown(500);
	}

	delayHideAddThisBox = function() {
		if (timerRunning)
			clearTimeout(timerId);

		timerRunning = true;
		timerId = setTimeout('hideAddThisBox()', 800);
	}

	hideAddThisBox = function() {
		$('.addThisBody').slideUp(500, function(){
			$('.addThisHeader').removeClass('active');
			$('.addThisHeader').addClass('inactive');
		});
	}

}
