var tweet = "";    
var meta_container = "";

var getStatus = function() {
    $.ajax({url:'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=owaislone&include_rts=1&count=1',dataType:'jsonp',jsonpCallback: 'displayStatus'})
}

var show_meta = function() {
    name = $(this).attr('meta_name') || $(this).text() || '';
    description = $(this).attr('meta_description') || '';
    href = $(this).attr('href') || '';
    if (href != '') { _class = 'meta-href'; }
    else if ($(this).hasClass('terminal')) _class = 'meta-command'; 
    else _class = 'meta-name';
    image = $(this).attr('meta_img') || '';
    if (!image=='') image = "<img class='meta-image' src='"+image+"'/>";
    content = "<h2 class='"+_class+"'>"+name+"</h2>"+image+" <span class='meta-description'>"+description+"</span>";
    meta_container.html(content);
    meta_container.css({'z-index':'100'});
    meta_container.stop().fadeTo('fast',1);
}

var hide_meta = function() {
    meta_container.stop().fadeTo('slow',0,function(){
            meta_container.css({'z-index':'-100'});
    });
}

$(document).ready(function() {
    meta_container = $('div#meta-content');
    $('.meta').hover(show_meta,hide_meta);
    //$('#panel-container').hover(function(){$('#panel').stop().animate({'top':0})},function(){$('#panel').stop().animate({'top':-25})}) 
    //$('#panel').delay(3000).animate({'top':-25});
    $(window).scroll(function(){
        if ($(window).scrollTop()>$('#main').offset().top) {
            $('#back-to-top').stop().animate({bottom:50,opacity:1})
        }
        else {
            $('#back-to-top').stop().animate({bottom:-100,opacity:0})
        }
    })
});


