$("#pullout_demo").click(function () {
    OpenPullout('1');
});
$("#pullout_contact").click(function () {
    OpenPullout('2');
});
$("#pullout_info").click(function () {
    OpenPullout('3');
});
$("#ClosePullout").click(function () {
    ClosePullout();
});

$("#FooterLink_RequestDemo").click(function () {
    OpenPullout('1');
});
$("#FooterLink_ContactUs").click(function () {
    OpenPullout('2');
});
$("#FooterLink_FreeInfoPack").click(function () {
    OpenPullout('3');
});

function OpenPullout(panel)
{
    for(var i = 1; i < 4; ++i)
        $("#pullout_panel" + i).fadeOut();
    $("#pullout_content").animate({height: "370px"}, 500);
    $("#pullout").animate({height: "400px"}, 500);
    $("#pullout_panel" + panel).fadeIn();
}

function ClosePullout()
{
    $("#pullout").fadeOut();
    $("#pullout_content").animate({ height: "0px" }, 500);
    $("#pullout").animate({ height: "0px" }, 500);
}

function SwapImage(id, src) 
{
    var img = document.getElementById(id);
    img.src = "/wp-content/themes/mcs/images/" + src;
}

