﻿/*
var popupStatus = 0;

function loadPopup(id, idBack){
   
    if (popupStatus == 0) {
      
		$(id).fadeIn("fast");
		popupStatus = 1;
	}
}


function disablePopup(){
	if(popupStatus==1){
	    $(".popupContact").fadeOut("fast");
		popupStatus = 0;
	}
}

function centerPopup(id, idBack){
   /* var posX = window.event.x;
    var posY = window.event.y;
	var windowWidth =screen.width;
	var windowHeight =screen.height;
	var popupHeight = $(id).height();
	var popupWidth = $(id).width();

	posY = event.y; //event.y; // : (ns6) ? clientY = e.clientY : false; */
/*	$(id).css({
	//	"position": "relative",
/*		"top":  100,//posY, // windowHeight/2-popupHeight/2,
		"left":100// posX - popupWidth / 2// windowWidth/2-popupWidth/2
		
	});
	
	
}

function ShowPop(id, idBack,text) {

   
    $('#content > div').remove();
    $("#content").append('<div>' + text + '</div>');
    centerPopup(id, idBack);
    alert("dd");
	    loadPopup(id, idBack);
	    
		$(".popupContactClose").click(function(){
		disablePopup();
	    });
	
	$(document).keypress(function(e){
		if(e.keyCode==27 && popupStatus==1){
			disablePopup();
		}
	});
}



$(function() {
    $('.bubbleInfo').each(function() {
        var distance = 10;
        var time = 250;
        var hideDelay = 500;

        var hideDelayTimer = null;

        var beingShown = false;
        var shown = false;
        var trigger = $('.trigger', this);
        var info = $('.popup', this).css('opacity', 0);


        $([trigger.get(0), info.get(0)]).mouseover(function() {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            if (beingShown || shown) {
                return;
            } else {
                beingShown = true;

                info.css({
                    top: -40,
                    left: -33,
                    display: 'block'
                }).animate({
                    top: '-=' + distance + 'px',
                    opacity: 1,
                    alpha: 1
                }, time, 'swing', function() {
                    beingShown = false;
                    shown = true;
                });
            }

            return false;
        }).mouseout(function() {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            hideDelayTimer = setTimeout(function() {
                hideDelayTimer = null;
                info.animate({
                    top: '-=' + distance + 'px',
                    opacity: 0,
                    alpha: 0
                }, time, 'swing', function() {
                    shown = false;
                    info.css('display', 'none');
                });

            }, hideDelay);

            return false;
        });
    });
});*/