$(document).ready(
    function () {
        $('body').bind( 'click', checkClick );
        $('#closeCross').bind('click', function(e) { 
                                        $('#devices_popup').hide('fast'); 
                                        e.preventDefault(); 
                                        e.stopPropagation();
                                        } )
        $('#openDevicePopup').bind('click', function(e) { 
                                             $('#devices_popup').show('fast'); 
                                             e.target.blur();
                                             e.preventDefault();
                                             e.stopPropagation();
                                            } )
    }
);

function checkClick (e) {
    var $target = $(e.target);     
    if ( !$target.parents().is('#devices_popup')) {        
        if ($('#devices_popup').css('display')=='block') {            
            e.preventDefault();
        }
        $('#devices_popup').hide('fast');
    }
    
}

var showedFaqGroup = -1;
function showFaqGroup(id) {
    if (id!=showedFaqGroup) {
        $('.faqGroup').hide();
        showedFaqGroup = id;
        $('#faqGroup_'+id).show();
    }
}
