function tooltip() {
	$('.data-list img.ask').hover(function(e) {	
		this.Alt = this.alt;
		this.alt= '';
		$('<div class="tooltip"><p>' + this.Alt + '</p></div>').appendTo('body');
		$('.tooltip').css({left:e.pageX + 10,top:e.pageY + 10})
	},function() {
		this.alt = this.Alt;
		$('.tooltip').remove();
	}).mousemove(function(e) {
		$('.tooltip').css({left:e.pageX + 10,top:e.pageY + 10})
	})
}
//run fun
$(document).ready(function() {
	if ($.browser.msie && (parseInt($.browser.version) <= 7)) {
		try {
			document.execCommand('BackgroundImageCache', false, true);
		} catch(e){}
		$('.clearfix').css('zoom', 1);
	}
	if (window.navigator.userAgent.indexOf("Chrome") !== -1) {
		$('html').css('-webkit-text-size-adjust', 'none');
	}	

	Cufon.replace(".ubuntu", {fontFamily:"Ubuntu"});
	
	/* home slider */
	(function() {
		var len = $('.home-banner .list li').length;
		var step = 960;
		var index = 0;
		if (len <= 1) return false;
		$('.home-banner .next').parent().addClass('active');
		$('.home-banner .btn span').click(function() {
			if (!$(this).parent().hasClass('active')) return false;
			if ($(this).hasClass('prev')) {
				index--;
			} else {
				index++;
			}
			if (index < 0 || index >= len) {
				index = 0;
			}
			$('.home-banner .list').animate({left : index * step * -1}); 
			if (index == 0) {
				$('.home-banner .prev').parent().removeClass('active');
			} else {
				$('.home-banner .prev').parent().addClass('active');
			}
			if (index == len - 1) {
				$('.home-banner .next').parent().removeClass('active');
			} else {
				$('.home-banner .next').parent().addClass('active');
			}
		});
	})();
	
	tooltip()
});
