﻿// JavaScript Document

<!-- 
//屏蔽js错误 
function killErrors() 
{ 
return true; 
}   
window.onerror = killErrors; 
// --> 
	// Delay Image
	$(function() {          
    	$(".postWrapper img").lazyload({
        	placeholder : "http://www.wjmai.com/wj/wp-content/themes/thatsimple/images/grey.gif",
            effect : "fadeIn"
          });
    	});

	$(function() {          
    	$(".sideAds img").lazyload({
        	placeholder : "http://www.wjmai.com/wj/wp-content/themes/thatsimple/images/grey.gif",
            effect : "fadeIn"
          });
    	});
	
	//Slide to any anchor
	$(document).ready(function() {
	$("a.anchorLink").anchorAnimate()
	});
	
	jQuery.fn.anchorAnimate = function(settings) {
	
		settings = jQuery.extend({
			speed : 1000
		}, settings);	
		
		return this.each(function(){
			var caller = this
			$(caller).click(function (event) {	
				event.preventDefault()
				var locationHref = window.location.href
				var elementClick = $(caller).attr("href")
				
				var destination = $(elementClick).offset().top;
				$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
					window.location.hash = elementClick
				});
				return false;
			})
		})
	}
//function detectBrowser()
//{
//	if ((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.match(/MSIE \d\.\d/) == "MSIE 6.0"))
//	{
//		alert('很抱歉呢，我的博客不支持IE6，如果想完整浏览，我建议你升级您的浏览器。');
//	}
//}
//detectBrowser();
