/*
 * KEYBRDR! AWESOMENESS BY MIKE HARMER
 * Version 1.0
 * Copyright (c) 2011 Mike Harmer - http://www.mikeharmer.co.uk
 *
 * License Agreement: By downloading Keybrdr,
 * you agree to that the copyright information 
 * must remain intact in the product.
 * 
 * You are not free to use, copy or sell any of the 
 * "keybrdr_main.js" (this file) code on your own
 * products without asking for permission.
 * 
 * Questions? mike@mikeharmer.co.uk
 */
 

$(document).ready(function(){var d=document,e=d.documentElement,s=d.createElement('style');if(e.style.MozTransform===''){s.textContent='body{visibility:hidden}';var r=document.getElementsByTagName('script')[0];r.parentNode.insertBefore(s,r);function f(){s.parentNode&&s.parentNode.removeChild(s);}
addEventListener('load',f,false);setTimeout(f,3000);}
var current=0;$('.key_left').fadeTo(0,0.2);$('.key_right').fadeTo(0,0.2).delay(800).fadeTo(600,0.7);$('.key_up').fadeTo(0,0.2).delay(500).fadeTo(600,1);$('.key_down').fadeTo(0,0.2).delay(500).fadeTo(600,1);shortcut.add("down",function(){if($('#main').children(':eq('+(current)+')').attr('ID')!=$('#main').children(':last').attr('ID')){$.scrollTo('#'+$('#main').children(':eq('+(current+1)+')').attr('ID'),300);current++;$('.key_down').fadeTo(100,0.5).delay(100).fadeTo(100,1);}
else if($('#main').children(':eq('+(current)+')').attr('ID')==$('#main').children(':last').attr('ID')){$.scrollTo('+=300px',300,{axis:'y'});}});shortcut.add("up",function(){if(current>0){$.scrollTo('#'+$('#main').children(':eq('+(current-1)+')').attr('ID'),300);current--;$('.key_up').fadeTo(100,0.5).delay(100).fadeTo(100,1);}
else if(current=0){$.scrollTo('#'+$('#main').children(':eq('+(current)+')').attr('ID'),300);}});shortcut.add("right",function(){document.location=$('#main').children(':eq('+(current)+')').children('.post-info').children('h2').children('a').eq(0).attr('href');});shortcut.add("p",function(){if($('.post-navigation').children('.prev').children('a').length){document.location=$('.post-navigation').children('.prev').children('a').eq(0).attr('href');}else{}});shortcut.add("n",function(){if($('.post-navigation').children('.next').children('a').length){document.location=$('.post-navigation').children('.next').children('a').eq(0).attr('href');}else{}});$('.key_down').mouseover(function(){$('.key_down').stop().fadeTo(100,0.5);});$('.key_down').mouseleave(function(){$('.key_down').stop().fadeTo(100,1);});$('.key_up').mouseover(function(){$('.key_up').stop().fadeTo(100,0.5);});$('.key_up').mouseleave(function(){$('.key_up').stop().fadeTo(100,1);});$('.key_right').mouseover(function(){$('.key_right').stop().fadeTo(100,0.3);});$('.key_right').mouseleave(function(){$('.key_right').stop().fadeTo(100,0.7);});$('.key_down').click(function(){if($('#main').children(':eq('+(current)+')').attr('ID')!=$('#main').children(':last').attr('ID')){$.scrollTo('#'+$('#main').children(':eq('+(current+1)+')').attr('ID'),300);current++;}
else if($('#main').children(':eq('+(current)+')').attr('ID')==$('#main').children(':last').attr('ID')){$.scrollTo('#'+$('#main').children(':eq('+(current)+')').attr('ID'),300);}});$('.key_up').click(function(){if(current>0){$.scrollTo('#'+$('#main').children(':eq('+(current-1)+')').attr('ID'),300);current--;}
else if(current=0){$.scrollTo('#'+$('#main').children(':eq('+(current)+')').attr('ID'),300);}});$('.key_right').click(function(){document.location=$('#main').children(':eq('+(current)+')').children('.post-info').children('h2').children('a').eq(0).attr('href');});$('#logo img').mouseover(function(){$('#logo img').stop().fadeTo(100,0.5);});$('#logo img').mouseleave(function(){$('#logo img').stop().fadeTo(100,1);});$('.built-on-keybrdr img').fadeTo(0,0.3);$('.built-on-keybrdr img').mouseover(function(){$('.built-on-keybrdr img').stop().fadeTo(100,1);});$('.built-on-keybrdr img').mouseleave(function(){$('.built-on-keybrdr img').stop().fadeTo(100,0.3);});$('.tweet, .share').fadeTo(0,0.3);$('.tweet, .share').mouseover(function(){$(this).stop().fadeTo(100,1);});$('.tweet, .share').mouseleave(function(){$(this).stop().fadeTo(100,0.3);});$('.post-content a:not(:has(img))').fadeTo(0,0.7);$('.post-content a:not(:has(img))').mouseover(function(){$(this).stop().fadeTo(50,1);});$('.post-content a:not(:has(img))').mouseleave(function(){$(this).stop().fadeTo(50,0.7);});$('.footer_top').mouseover(function(){$('.footer_top').stop().fadeTo(100,0.5);});$('.footer_top').mouseleave(function(){$('.footer_top').stop().fadeTo(100,1);});$('.footer_top').click(function(){$('html, body').animate({scrollTop:0},300);current=0;return false;});$('#main').fadeTo(0,0).delay(100).fadeTo(500,1);});
