// tabs
		$(function () {
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
		});




 // popupwindow

    $(function () {
        $('.bubbleInfo').each(function () {
            var distance = 0;
            var time = 250;
            var hideDelay = 100;

            var hideDelayTimer = null;

            var beingShown = false;
            var shown = false;
            var trigger = $('.trigger', this);
            var info = $('.popup', this).css('opacity', 0);
            var a = info.parent().get(0).id;
            var bubbleTop = 4;
            var bubbleLeft = 0;
            
            //Move bubble left of icon if more then half way
            if(parseFloat($("#"+a).css("left"))>338){
            	 var bubbleLeft = -340;
            }
            //Move bubble left of icon if more then half way
			var topPos = parseFloat($("#"+a).css("top"));
			 if(topPos>183){
            	 var bubbleTop = -290;
            }
			
            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    
                    beingShown = true;
                    $('.trigger').each(function (intIndex) {
                    	 if($( trigger ).get(0).id != $( this ).get(0).id){
                    	 	$( this ).css({visibility:'hidden' })
                    	//filter:alpha(opacity=0)
                    	 	}
                    	 	;}
                    );

                    info.css({
                        top: bubbleTop,
                        left: bubbleLeft,
                        display: 'block'
                    }).animate({
                    	opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }

                return false;
            }).mouseout(function () {
            	 

                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
                     $('.trigger').each(function (intIndex) {
                    	
                    	 	$( this ).css({visibility:'visible' })
           
                    	 	;}
                    );

                    info.animate({
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                                           });

                }, hideDelay);

                return false;
            });
        });
    });
    

