$(document).ready(function(){
    Cufon.replace("#slogan STRONG, #twitter", {textShadow: '#000 0px 1px'});
    Cufon.replace("H1, H2, H3, H4, #content .link-box A, #content #sidebar-nav LI A, #content .red-grad P, #content .generic A, #slider DIV A SPAN:not(.moreinfo)");
    
    $("A.external").click(function(){
        window.open($(this).attr("href"));
        return false;
    });
    
    $("A.top").click(function(){
        $("html, body").animate({ scrollTop: 0 }, 'slow'); 
        return false;
    });
    
    $("#slider").cycle({
        fx: 'fade',
        timeout: 6000,
        speed: 2000,
        pause: true,
        delay: 3000,
        pager:  '#slider-nav'
    });
    
    //$("#content .link-box A").hover(function() {
    //    $(this).children("SPAN").stop(true,true).fadeIn(333);
    //}, function(){
    //    $(this).children("SPAN").stop(true,true).delay(200).fadeOut(333);
    //});    
    
    $("#navigation LI").hover(function() {
        $(this).children("SPAN").stop(true,true).fadeIn(333);    
        $(this).children(".sub-menu").stop(true, true).slideDown('fast');
    }, function(){
        $(this).children("SPAN").stop(true,true).delay(200).fadeOut(333);
        $(this).children(".sub-menu").stop(true, true).fadeOut(333);
    });
    
    $("#cc_annual").hide();
    $("#go_annual").hide();
    $("#cc_lifetime").hide();
    $("#go_lifetime").hide();
    
    $("#cc_annual_button").click(function(){
        $("#go_annual").hide(666);
        $("#cc_lifetime").hide(666);
        $("#go_lifetime").hide(666);
        $("#cc_annual").toggle(666);
        return false;
    }); 
    
    $("#go_annual_button").click(function(){
        $("#cc_annual").hide(666);
        $("#cc_lifetime").hide(666);
        $("#go_lifetime").hide(666);
        $("#go_annual").toggle(666);
        return false;
    });  
    
    $("#cc_lifetime_button").click(function(){
        $("#go_annual").hide(666);
        $("#cc_annual").hide(666);
        $("#go_lifetime").hide(666);
        $("#cc_lifetime").toggle(666);
        return false;
    });    
    
    $("#go_lifetime_button").click(function(){
        $("#go_annual").hide(666);
        $("#cc_lifetime").hide(666);
        $("#cc_annual").hide(666);
        $("#go_lifetime").toggle(666);
        return false;
    });
    
    $('.friends').vTicker({
        animation: 'fade',
        showItems: 3
    });
    
    $('.test').vTicker({
        animation: 'fade',
        showItems: 3
    });
    
    $("#renew-n").click(function(){
        $("#existing_membership_id").val("");
    })
    
    $('a[href*="pdf"], a[href*="doc"], a[href*="docx"], a[href*="xls"], a[href*="xlsx"]').click(function() {
        window.open(this.href);
        return false;
    });

    
})
