function fixIE() {
  if(jQuery.browser.msie){
    var zIndexNumber = 1000;
    jQuery('div, embed, object').each(function() {
      jQuery(this).css('zIndex', zIndexNumber);
      zIndexNumber -= 10;
    });
  }
}

function getTweets() {
  jQuery.getJSON("http://iuwee.com/twip/statuses/user_timeline.json?screen_name=zoufei&count=5&callback=?",
            function(data) {
              if (jQuery(data).length>0) {
                jQuery('div.tweets').each(function(i,val) {
                  jQuery(val).css({backgroundImage: 'none', height: 'auto'});

			      //jQuery(val).append("<h2>Latest tweets</h2>");
			      
			      output='<iframe id="sina_widget_1678571814" style="width:100%; height:500px;" frameborder="0" scrolling="no" src="http://v.t.sina.com.cn/widget/widget_blog.php?uid=1678571814&height=500&skin=wd_01&showpic=1"></iframe>';

				 /*jQuery.each(data, function(j,item){
					 output='<p class="twitter-message">'
					 +'❤ '+ item.text.replace(/((http|https)\:\/\/[\.\/\?\&\=\%\-\_\#\(\)\w]*)/g,"<a href='$1' target='_blank'>$1</a>")
								//+'<a href="http://iuwee.com/twip/ZouFei/status/'+item.id+'">'+item.text+'</a>'
								+'<br /><span class="twitter-time">'+Date.parse(item.created_at).toString('yyyy-M-d HH:mm')+'</span>'
								+'</p>';
					  jQuery(val).append(output);
                  });
                  jQuery(val).append("<a href='http://twitter.com/zoufei' class='follow'>Follow me</a>");
                  jQuery(val).css('paddingBottom', '50px');*/
                  jQuery(val).append(output);
                  
                });
              }
            });
}

function doDrawers() {
  jQuery('.drawer').css('zIndex', '100000');

  jQuery('.drawer').hover(function() {
    jQuery(this).animate({left: '0px'});
  },function() {
    jQuery(this).animate({left: '-270px'});
  });
}

jQuery(document).ready(function() {
  fixIE();
  doDrawers();
  getTweets();
});


