﻿function imageswap(id, imagepath) {
    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).src = imagepath;
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.src = imagepath;
        }
        else { // IE 4
            document.all.id.src = imagepath;
        }
    }
}

function linkswap(id, path) {
    if (document.getElementById) { // DOM3 = IE5, NS6
        document.getElementById(id).href = path;
    }
    else {
        if (document.layers) { // Netscape 4
            document.id.href = path;
        }
        else { // IE 4
            document.all.id.href = path;
        }
    }
}

function IncreaseFaqHit(e) {
    $.ajax({
        type: "POST",
        url: "services/faqservice.svc/IncreaseHit",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        data: '{"faqid": "' + e + '"}',
        processdata: true,
        success: function (data, textStatus) {
            //alert("success");
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert(textStatus + ": " + errorThrown);
        }
    });
}

function IncreaseRecipeHit(e) {
    $.ajax({
        type: "POST",
        url: "services/recipeservice.svc/IncreaseHit",
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        data: '{"recipeid": "' + e + '"}',
        processdata: true,
        success: function (data, textStatus) {
            //alert("success");
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert(textStatus + ": " + errorThrown);
        }
    });
}


function InitializeMiniCart() {
    $('#minicart').hide();
    $('#minicart').corner("tl").corner("tr");

    $('#mccloselink').bind("click", function () {
        $('#minicart').slideUp('slow');
    });
}
function toggleminicart() {
    
    $('#minicart').slideToggle('slow', function () { });

}
function delayandanimate() {
    setTimeout('toggleminicart();', 500);
    var timeoutid = setTimeout('toggleminicart();', 5000);
}
