$(document).ready(function() {
        if(document.getElementById('detailbottom')) {
            $.post("designs/feed/related.php", { url:"blog", qty:8, txt:"Also," },function(data) { $("#detailbottom").html(data) });
    }

        try {
            
            if(navigator.platform != "iPad" && navigator.platform != "iPhone") {
                if(document.getElementById('content_container')) $("#content_container img").lazyload({ placeholder : "img/whiterati.gif",  threshold : 250, effect : "fadeIn" });
                else $(".index img").lazyload({ placeholder : "_gfx/whiterati.gif",  threshold : 250, effect : "fadeIn" });
            }
            
        } catch(err) {
            return false;
        }

var loc = window.location.pathname.replace("/","");
if(loc == "") $("#microlink").addClass("selected");
else if(loc == "index" || loc == "index/") $("#macrolink").addClass("selected");
    //shortcut.add("H",function() { if(getScrollHeight() > 50) window.scrollTo(0, 50); doscroll(0,getScrollHeight(),0);},{ 'type':'keydown', 'disable_in_input':true, 'keycode':72 });
    //shortcut.add("J",function() { moveto('next'); },{ 'type':'keydown', 'disable_in_input':true, 'keycode':74 });
    //shortcut.add("K",function() { moveto('prev'); },{ 'type':'keydown', 'disable_in_input':true, 'keycode':75 });
});

function moveto(which) {
    var threshold = 250;
    thisid = 0;
    if(which == "next") {
        $("#maincontainer div[@class='entry']").each(function() {
            if($(this).offset().top > $(window).scrollTop() && $(this).offset().top != $(window).scrollTop()) {
                thisid = this.id;
                $.scrollTo( { top:$('#'+this.id).offset().top, left:0}, 650 ); return false;
            }
        });    
    } else if(which == "prev") {
        $("#maincontainer div[@class='entry']").each(function() {
            if($(this).offset().top < $(window).scrollTop() && $(this).offset().top != $(window).scrollTop()) hit = this;
            else if($(this).offset().top > $(window).scrollTop()) {
                thisid = hit.id;
                $.scrollTo( { top:$('#'+hit.id).offset().top, left:0}, 650 ); return false;
                
            }
        });    
    }
}

