$(function () {
        $('.secTooltip').each(function () {
            var distance = 50;
            var time = 300;
            var hideDelay = 500;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.popup', this);
			var infoclose = $('.popclose', this);

			var userAgent = navigator.userAgent.toLowerCase();
			jQuery.browser = {
			  version: (userAgent.match( /.+(?:rv|it|ra|ie|me)[\/: ]([\d.]+)/ ) || [])[1],
			    chrome: /chrome/.test( userAgent ),
			    safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
			    opera: /opera/.test( userAgent ),
			    msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
			    mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
			};


            $([trigger.get(0), info.get(0)]).mousedown(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;
					if (jQuery.browser.chrome || jQuery.browser.safari || jQuery.browser.mozilla) {
						info.css({
	                        top: 160,
	                        left: -10,
	                        display: 'block',
							opacity: 0
	                    }).animate({
	                        top: '-=' + distance + 'px',
	                        opacity: 1
	                    }, time, 'swing', function() {
	                        beingShown = false;
	                        shown = true;
	                    });
					} else {
						info.css({
	                        top: 160,
	                        left: -10,
	                        display: 'block'
	                    }).animate({
	                        top: '-=' + distance + 'px'
	                    }, time, 'swing', function() {
	                        beingShown = false;
	                        shown = true;
	                    });
					}

                }

                return false;
            });
			
			$([infoclose.get(0), info.get(0)]).mousedown(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
					if (jQuery.browser.chrome || jQuery.browser.safari || jQuery.browser.mozilla) {	
                    	info.animate({
	                        top: '+=' + distance + 'px',
							opacity: 0
	                    }, time, 'swing', function () {
	                        shown = false;
	                        info.css('display', 'none');
	                    });
					} else {
						info.animate({
	                        top: '+=' + distance + 'px'
	                    }, time, 'swing', function () {
	                        shown = false;
	                        info.css('display', 'none');
	                    });
					}

                }, hideDelay);

                return false;
            });
        });
    });