
$(function(){
	//根据url加载html
	Messenger.options = {
		extraClasses: 'messenger-fixed messenger-on-bottom messenger-on-right',
		theme: 'ice'
	}
	$('.loadurl').each(function(){
		$(this).click(function(){
			//加载图标
			$this = $(this);
			var oldclss = $(this).find('i').attr("class");
			$(this).find('i').attr("class","");
			$(this).find('i').attr("class","loadpng");
			
			
			var sorturl = $(this).attr('url');
			//GET加载链接
			var url=web_site + sorturl;
			$.get(url, {},
				function(data){
					//alert("Data Loaded: " + data);
					if(data.msg==-1){
						Messenger().post({
							type: 'error',
							message: data.msg,
							hideAfter: 10,
							hideOnNavigate: true,
							showCloseButton: true
						});
					}else{
						if(data==""){
							Messenger().post({
								type: 'error',
								message: "请求数据超时！",
								hideAfter: 10,
								hideOnNavigate: true,
								showCloseButton: true
							});
						}else{
							$('.wrap').html(data);
							$this.find('i').attr("class",oldclss);			//切换回正常图标
						}
					}
					
			});
			
		});
	});
	
	
	
	
	
});










