function cookieSupport()
{
    var cookieEnabled = (navigator.cookieEnabled) ? true : false;

    if (typeof navigator.cookieEnabled == "undefined" && ! cookieEnabled)
    { 
        document.cookie = "testcookie";
        cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
    }
    
    return cookieEnabled;
}

$(function(){
    if (typeof(cookieErrorText) != 'undefined' &&  ! cookieSupport())
    {
        $('div#cookieError').slideUp('fast', function(){
            $(this).remove();
        });
        
        var parent = $('body').eq(0),
            errorDiv = $(document.createElement('div')).attr('id', 'cookieError').hide();
            
        errorDiv.append($(document.createElement('p')).addClass('explainText').text(cookieErrorText));
        
        if (typeof(cookieExplanationLink) != 'undefined')
        {
            errorDiv.append($(document.createElement('a')).addClass('explainLink').attr('href', cookieExplanationLink).text(cookieExplanationLinkLbl));
        }
        
        parent.prepend(errorDiv.slideDown('fast'));
    }
});
