function yabao2(){
	alert("running..");
	setTimeout(function() {$('#main').block({ 
				message: $('#div_yabao').load('yabao.html'),
				css: {  
					padding:        0, 
					margin:         0, 
					width:          'auto',  
					top:            '40%',  
					left:           '35%',  
					textAlign:      'center',  
					backgroundColor:'#fff', 
					cursor:         '' 
				}

		}); },500);
}
function myunblock(){
	$('#main').unblock();
}

function yabao(id){
	$.ajax({
	type: "POST",
	url: "ajax.php",
	data:   "action=yabao&id=" + id,
	success: function(text)
	{ 
		if (text == '1'){
			alert('恭喜您，押中了宝贝.如果您没有填写完整个人资料，快快补充完整吧!');
		}else	
			alert(text);
	} 
	});  
}

function updateScore(){
	$.ajax({
	type: "POST",
	url: "ajax.php",
	data:   "action=updatescore",
	success: function(text)
	{ 
		if (text.length > 0){
			var udata=text.split('|');
			$('#span_score').html(udata[0]);
			$('#span_level').html(udata[1]);
			$('#span_compass').html(udata[2]);
		}
	} 
	}); 
}

function get_tool(){
setTimeout(function() {$('#main').block({ 
				message: $('#div_tools').load('tools.html'),
				css: {  
					padding:        0, 
					margin:         0, 
					width:          'auto',  
					top:            '40%',  
					left:           '35%',  
					textAlign:      'center',  
					backgroundColor:'#fff', 
					cursor:         '' 
				}

		}); },500);		
}

function getCompass(line){
	$.ajax({
	type: "POST",
	url: "ajax.php",
	data:   "action=compass",
	success: function(text)
	{ 
		if (text.length > 0 && text != '1')
			alert(text);
		else{
				if (text == '1'){
					alert('恭喜您,成功获取一个指南针!');
				}
		}		
	} 
	}); 	
}