﻿$(document).ready(function() {
    hookEvents()     
});
 
function hookEvents() {
    // If less than IE7, add class to the body so we can style accordingly
    if ($.browser.msie && $.browser.version < 7) { $("body").addClass("ltie7"); }
     
    // Stripe our styled lists
    $("ul.styled li:even").addClass("striped");
     
    // Make a bigger hit area for our stories list
    $("ul#storieslist li").hover(function() {$(this).addClass("active")}, function() {$(this).removeClass("active")}).click(function() { window.location=$(this).find("a.core").attr("href"); } );
     
    // Confirm story/feature/comment deletions
    $("ul#admincontentlist li div a.deletelink").click(function() { return confirm("Are you sure you want to delete this content?"); } );
    $("ul#comments li div a.deletelink").click(function() { return confirm("Are you sure you want to delete this comment?"); } );
     
    // If logged out, notify user upon hover of the contact link
    $(".authorloggedout").hover(function() {
       var pos = $(this).position();
       var elm = $("#authorloggedout")
       elm.stop().css({"left":(pos.left+$(this).width()+6), "top":(pos.top-22)});
       if ($.support.opacity) { elm.stop().css({"opacity":1}).fadeIn(); } else { elm.show(); }        
    }, function() {
       var elm = $("#authorloggedout")
       if ($.support.opacity) { elm.stop().fadeOut(); } else { elm.hide(); }                
    }); 
}
