jQuery(function() {

// look for window hash
var hash = window.location.hash;
if (hash) {
    setTimeout(function() {
        jQuery(hash).click();
    }, 200);
    
}

jQuery(".call_to_action a").click(function() {
    var form = jQuery(this).parents("div.call_to_action").prev("form");
    var scrollToAnchor = form.attr("id");

    // Hide other forms, show buttons
    jQuery("form.sforms").hide();
    jQuery("div.call_to_action").show();
    
    jQuery(this).parents("div.call_to_action").hide();
    form.slideDown(800);

    setTimeout(function() {
        form.find("input[type=text]:first").focus();
        window.location.hash = "#" +scrollToAnchor;
    }, 1000);

    return false;
});

});