Cufon.set('fontFamily', 'sabon').replace('h1')('p.strapline')('h2:not(.noreplace)')('.subNav li a')('.homerowcontainer p em')('.homerowcontainer p .author')('.article p.quote');
Cufon.set('fontFamily', 'sabon-roman').replace('#nav li.nav a')('.first .drop')('.prize h3')('.prize p.prizedetail')('.comp1form_JoinInfoInner p')('.comp1form_JoinInfoInner li')('.homerowcontainer h3')('.learnBox h3')('.learnBox p')('.article p.intro')('p.author span')('.button', {forceHitArea: true})('.showAll', {forceHitArea: true})('.minimise', {forceHitArea: true});

$(document).ready(function() {
    minimise();
    $(".form fieldset.friends:last").after('<a href="#" class="addMore">Add more friends</a>');

    $(".addMore").live("click", function(event) {
        $(".form fieldset.friends:hidden:first").show();
        if ($(".form fieldset.friends:hidden").length == 0) {
            $(".compForm .addMore").remove();
        }
        return false;
    })

    $(".showAll").live("click", function(event) {
        showAll();
        return false;
    });

    $(".minimise").live("click", function() {
        minimise();
        return false;
    });
    $("a[href='#comments']").live("click", function(event) {
        showAll();
        return true;
    })
});

/* Functions */
var minimise = function() {
    $(".comments .form-wrapper").addClass("hide");
    if ($(".minimise")) {
        $(".comments .minimise").remove();
    }
    $(".comments .form-wrapper").after('<a href="#" title="show all comment results" class="showAll"><span class="bg"></span>Add a comment</a>')
	Cufon.replace('.showAll', {forceHitArea: true})('.minimise', {forceHitArea: true});
}
var showAll = function() {
    $(".comments .form-wrapper").removeClass("hide");
    $(".comments .showAll").remove();
    $(".comments .minimise").remove();
    $(".comments .form-wrapper").after('<a href="#" title="minimise comment results" class="minimise"><span class="bg"></span>Hide comment form</a>')
	Cufon.replace('.showAll', {forceHitArea: true})('.minimise', {forceHitArea: true});
}
var registerClick = function(buttonClicked) {
    // do something that registers the button click
    if (pageTracker) {
        pageTracker._trackEvent('External', 'Click', buttonClicked);
    }
}


