﻿
function load_x_file(fileName, fileType) {
    switch (fileType) {
        case "js":
            var j = document.createElement('script');
            j.type = 'text/javascript';
            j.src = fileName;
            j.async = true;
            if (typeof j != "undefined") {
                var script = document.getElementsByTagName('script')[0];
                script.parentNode.insertBefore(j, script);
            }
            break;
        case "css":
            var c = document.createElement("link");
            c.rel = 'stylesheet';
            c.type = 'text/css';
            c.href = fileName;
            if (typeof c != "undefined") {
                var head = document.getElementsByTagName('head')[0];
                head.parentNode.insertBefore(c, head);
            }
            break;
        default:
    }
}
var msie7 = $.browser.msie && $.browser.version == 7;
if (msie7) {
    load_x_file("/css/publicsite/publicsite_ie7.css", "css");
    load_x_file("/js/publicsite/foodcures/fc_ie7.js", "js");
}
var msie6 = $.browser.msie && $.browser.version == 6;
if (msie6) {
    load_x_file("/js/publicsite/foodcures/fc_ie777.js", "js");
}

jQuery(function($) {
function checkImg() {
    var toggleImg = $("#profileDetailsText img");
    if (toggleImg.attr("src") == "/Images/members/myprogress/myprogress-open.gif") {
        $("#profileDetailsText img").replaceWith('<img width="12" hspace="4" height="12" border="0" align="absmiddle" alt="" src="/Images/members/myprogress/myprogress-close.gif">');
    } else {
    $("#profileDetailsText img").replaceWith('<img width="12" hspace="4" height="12" border="0" align="absmiddle" alt="" src="/Images/members/myprogress/myprogress-open.gif">');
    }
}

$('#profileDetailsWrapperDiv').css({ "height": "198px" }).hide();
$("#progressModuleIcon").click(function() {
    profileWrap = $('#profileDetailsWrapperDiv');
    profileWrap.slideToggle(800, function() {
        checkImg();
    });

});
    //if (checkForDiv("privacy")) { yourFunction(); }  
    if (checkForDiv("privacy")) {

        $("#privacy").click(function() {
            //jQ("#privacyPop").toggle();
            $("#privacyPop").fadeIn("slow");
        }
        )
    };

    $("#privacyPop #close").click(function() {
        $("#privacyPop").fadeOut("slow");
    });

    var nutrition = function() {
        var $source = $("#nutritioninfo_source").html();
        var $sourceChildren = $("#nutritioninfo").children();

        if ($sourceChildren != null) {

            $("#nutritioninfo").html($source);
            $("#nutritioninfo").show();
        }

    } ();
});



	


function yourFunction(){
    alert("test");
}


function checkForDiv(id) {
    var div = document.getElementById(id);
    if (div) {return true } else {return false}
}

var jQ = jQuery.noConflict();
jQ(document).ready(function() {
    jQ(".iab").mouseover(function() {
        jQ(".iabnotice").addClass('iabnoticeshow').fadeIn("slow");

    });
    jQ(".iabnotice .close").click(function() {
        jQ(".iabnotice").fadeOut("slow");
    });
});


