Cufon.replace('h1', {
    fontFamily: 'bentonsans'
});
Cufon.replace('#home-canvas h1 span', {
    fontFamily: 'bentonsans-bold'
});
Cufon.replace('h2', {
    fontFamily: 'bentonsans'
});
Cufon.replace('h3', {
    fontFamily: 'bentonsans'
});
Cufon.replace('h4', {
    fontFamily: 'bentonsans'
});

var mc_custom_error_style = '';
var baseText = null;

$(document).ready(function(){

    $("#get-started-form").validate({
        meta: "validate"
    });

    $('#home-explore .page nav ul li div.tab').click(function(event){
        $(this).closest('ul').find('li div.tab').removeAttr('id');
        $(this).attr('id', 'selected');
        $($(this).attr('rel')).addClass('selected').siblings('.explore-content').removeClass('selected');
        return false;
    });


    $('a#subscribe-link').click(function(event){
        $('#subscribe').show('slow');
        $('#contact').hide();
        return false;
    });


    //hide the all of the element with class msg_body
    $(".msg_body").hide();
    //toggle the componenet with class msg_body
    $(".msg_head").click(function(){
        $(".msg_body").each(function( ){
            $(this).slideUp(600);
        });
        if($(this).next(".msg_body").css("display") == 'block'){
            $(this).next(".msg_body").slideUp(600);
        } else {
            $(this).next(".msg_body").slideDown(600);
        }
    });

});



function showPopup(w,h)
{
    var popUp = document.getElementById("popupcontent");
    var grey = document.getElementById("popup");
    popUp.style.width = w + "px";
    popUp.style.height = h + "px";
    if (baseText == null){
        baseText = popUp.innerHTML;
    }
    popUp.innerHTML = baseText + "<div id='statusbar'></div>";
    var sbar = document.getElementById("statusbar");
    sbar.style.marginTop = (parseInt(h)-40) + "px";
    popUp.style.display = "block";
    grey.style.display = "block";
}
function hidePopup()
{
    var popUp = document.getElementById("popupcontent");
    var grey = document.getElementById("popup");
    popUp.style.display = "none";
    grey.style.display = "none";
}

function toggle(id) {
    var state = document.getElementById(id).style.display;
    if (state == 'block') {
        document.getElementById(id).style.display = 'none';
    } else {
        document.getElementById(id).style.display = 'block';
    }
}
