jQuery(document).ready(function($) {   

    $("a img").hover(function(){
        this.src = this.src.replace("_off","_on");
    }, function(){
        this.src = this.src.replace("_on","_off");
    });
	
    if($('.slideshow').length) {
        $('.slideshow').cycle({
            fx: 'fade'
        });
    }
    
    $('h1:contains("Type Rules!")').html('Type<span class="green">Rules!</span>');
	
    // Moves buy form to buy-meta (price) div on single page
    if($('#webinar-single #mgm_buypost_form').length) {
        $('#mgm_buypost_form').appendTo('#buy-meta');
    }
	
    // Remove Carrot from Register Button
    $('.mgm_register_form p input#wp-submit').val('Register');
	
    // Add ellipsis
    $('#past-webinars li .exc p').append('[...]');
    
    $('.events:even').addClass('events-odd');
    $('.events:odd').addClass('events-even');
    $('li.webinar:odd').addClass('odd');
	
    $('body').bind('keypress', function(e) {
        if(e.keyCode==13){
            $('form#mgm_login_form .button, a.enter-click,a[href*="login"]').click();
        }
    });
    
    nextSociable = $('.sociable:first-child').next(".sociable");
    $('.sociable:first-child').appendTo('#contents');
    nextSociable.appendTo('#contents')
        
    
});
