﻿//var jQ = jQuery.noConflict(); 
$(document).ready(function() {
   
    //if (checkForDiv("privacy")) { yourFunction(); }  
    if (checkForDiv("privacy")){
    
        $("#privacy").click(function () {
            //$("#privacyPop").toggle();
            $("#privacyPop").fadeIn("slow");
            }
        )};
        
        $("#privacyPop #close").click(function(){
            //$("#privacyPop").toggle();
            $("#privacyPop").fadeOut("slow");
        });


        if ($(".quiz-results-copy li").text() != "") {
            $(".take-away-title").show();
            $(".quiz-results-table-line").show();
            $("#quiz-results-table").show();

        }
        else {
            $(".take-away-title").hide();
            $(".quiz-results-table-line").hide();
            $("#quiz-results-table").hide();
        };

        $('.btn-quiz-shadow').removeAttr("disabled");
    
    
});    

	
	


function yourFunction(){
    alert("test");
}


function checkForDiv(id) {
    var div = document.getElementById(id);
    if (div) {return true } else {return false}
}


var FacebookHelper = {
    //Initialize facebook
    Init: function(app_id) {
        /*** Facebook JS for Like Button ***/
        window.fbAsyncInit = function() {
            FB.init({
                appId: app_id, //Unique by product
                status: true,
                cookie: true,
                xfbml: true,
                channelUrl: "http://jillianmichaels.com/channel.html"

            });
        };
    }
};

//Load facebook all.js only when the like button exists in the page.
jQuery(document).ready(function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
    '//connect.facebook.net/en_US/all.js#xfbml=1';

    if (document.getElementsByTagName('fb:like') != null &&
        document.getElementsByTagName('fb:like').length > 0) {
        document.getElementsByTagName("head")[0].appendChild(e);
    }
});

var fbapp_id = jQuery("meta[property=fb:app_id]");

if (fbapp_id != null)
    FacebookHelper.Init(jQuery(fbapp_id).attr("content"));

/*
//For EH
if (document.domain.indexOf('everydayhealth.com')) {
FacebookHelper.Init('135346036490186');
}

//For WTE
if (document.domain.indexOf('wahttoexpect.com')) 
FacebookHelper.Init('138668756159179');
*/


