// JavaScript Document

//被关注的用户ID
var onFoucsUid = 0;

//确定是否提示
var winIfClose = new String();

//初始化监听事件
var readyTips = null;

//绑定页面监听事件
$(function(){
	try
	{
		$(window).blur( function()
		{
			winIfClose = document.title;
		});
		$(window).focus( function()
		{
			if (winIfClose != "")
			{
				document.title = winIfClose;
				winIfClose = "";
			}
			clearInterval(readyTips);
			winIfClose = "";
		});
	}
	catch(e){};

});

//取得窗口高度
function winHeight() {
	var winHeight=0;
	//获取窗口高度
	if (window.innerHeight)
	winHeight = window.innerHeight;
	else if ((document.body) && (document.body.clientHeight))
	winHeight = document.body.clientHeight;
	//通过深入Document内部对body进行检测，获取窗口大小
	if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)
	{
		winHeight = document.documentElement.clientHeight;
	}
	return winHeight-32;
}

function winWidth() {
	var winWidth=0;
	//获取窗口宽
	if (window.innerWidth)
	winWidth = window.innerWidth;
	else if ((document.body) && (document.body.clientWidth))
	winWidth = document.body.clientWidth;
	//通过深入Document内部对body进行检测，获取窗口大小
	if (document.documentElement  && document.documentElement.clientWidth && document.documentElement.clientWidth)
	{
		winWidth = document.documentElement.clientWidth;
	}
	return winWidth;
}

//检验是否是针对自己
function checkSelf(id, content)
{
	if (id == curUserId)
	{
		Alert(content);
		return ;
	}
	else
	{
		return true;
	}
}

//窗口
function dialog(title, width, model, url, data) {
	$("#dialog").remove();

	$.ajax({
		url : getRandom(url),
		type : "POST",
		data : data,
		dataType : "html",
		success : function(html)
		{
			if (!/<script(.*)>Alert\(/.exec(html))
			{
				$(html).appendTo("body");
				floatBox("dialog");
				$("#dialog").draggable();
			}
			else
			{
				$(html).appendTo("body");
			}
		}
	});
}

/**
* ajax函数
* @param url 请求地址
* @param data 请求数据
* @param success 返回处理函数
* @param dataType 返回数据类型
*
* @return void
*/
function RequestAjax(url, data, success, dataType, beforeSend) {
	$.ajax({
		type: "POST",
		dataType: dataType,
		url: getRandom(url),
		data: data,
		beforeSend:function(){
			$("#"+beforeSend).html("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据加载中......</span></div></div>");
		},
		timeout: 1000,
		success: success
	});
}

function Alert(data) {
	$("#alert_all").remove();

	var argumentHref = (arguments.length == 2) ? arguments[1] : false;
	$("body").append('<div class="sys_alert" id="alert_all">' +
	'<div class="sys_alert_top">' +
	'<div class="sys_alert_ico"></div>' +
	'<span>系统提示</span>' +
	'<div class="sys_alert_close"><img src="'+webimage+'images/sys_alert_close.gif" title="关闭"  onclick="$(\'#alert_all\').remove();"/></div>' +
	'</div>' +
	'<div class="sys_alert_mid" >' +
	'<div class="sys_alert_ly">' +
	'<div class="sys_alert_txt">' + data + '</div>' +
	'<div class="sys_alert_bt2">' +
	'<ul>' +
	'<li onclick="' + (argumentHref ? ('document.location.href = \'' + argumentHref + '\';') : '$(\'#alert_all\').remove();') + '" >确定</li>' +
	'</ul>' +
	'</div>' +
	'</div>' +
	'</div>' +
	'</div>');
	$("#alert_all").draggable({cancel : ".alert_ct"});
	floatBox("alert_all", 4444);
}

//询问框
function Confirm(data, sName, sOp, fName, fOp)
{
	$("#confirm_all").remove();
	$("body").append('<div class="sys_alert" id="confirm_all">' +
	'<div class="sys_alert_top">' +
	'<div class="sys_alert_ico"></div>' +
	'<span>系统提示</span>' +
	'<div class="sys_alert_close"><img src="'+webimage+'images/sys_alert_close.gif" title="关闭" onclick="$(\'#confirm_all\').remove();"/></div>' +
	'</div>' +
	'<div class="sys_alert_mid" >' +
	'<div class="sys_alert_ly">' +
	'<div class="sys_alert_txt">' + data + '</div>' +
	'<div class="sys_alert_bt" style="width:auto">' +
	'<div style="width:auto;margin-left:10px;margin-right:10px;float:right;"><img src="' + webimage + 'images/notice_11_left.gif" style="float:left;"/><div style="line-height:20px;color:white;cursor:pointer;float:left;background:url(\'' + webimage + 'images/notice_11_middle.gif\') repeat-x;width:auto;height:20px;" onclick="' + (fOp ? fOp : "") + '$(\'#confirm_all\').remove();">' + (fName ? fName : "取消") + '</div><img src="' + webimage + 'images/notice_11_right.gif" style="float:left;"/></div>'+
	'<div style="width:auto;float:right;"><img src="' + webimage + 'images/notice_11_left.gif" style="float:left;"/><div style="line-height:20px;color:white;cursor:pointer;float:left;background:url(\'' + webimage + 'images/notice_11_middle.gif\') repeat-x;width:auto;height:20px;" onclick="' + (sOp ? sOp : "") + '$(\'#confirm_all\').remove();">' + (sName ? sName : "确定") + '</div><img src="' + webimage + 'images/notice_11_right.gif" style="float:left;"/></div>'+
	'</div>' +
	'</div>' +
	'</div>' +
	'</div>');
	$("#confirm_all").draggable();
	floatBox("confirm_all");
}

/**
* 读取消息中心数据
*
*/
function ReadMessage()
{
	$.ajax({
		url : getRandom(webfloor + "msg/message_center.php?s=msg"),
		type : "GET",
		data : {uid:curUserId},
		dataType : "json",
		error : function(msg, error)
		{

		},
		success : function(json)
		{
			Message_Center(json);
		}
	});
}

/**
* 消息处理中心
*
* @param object json ajax 返回数据
*/
function Message_Center(json) {
	//消息处理
	if (json.message.length)
	{
		//获得当前窗口的左侧距离
		for (var i=0; i < json.message.length; i++)
		{
			var ii = parseInt(json.message[i]['class']);

			if (ii == 0 || ii == 1 || ii==2 || ii == 9 || ii == 11)
			{
				if ($("#msg_" + json.message[i].id).length)continue;


				//添加一个
				$("#ajaxNewMsgTips ul").html("<li><input type='hidden' name='msgid' value='"+ json.message[i].id +"' id='ajaxNewMsgTipsMsdID'>" + json.message[i].content + "</li>");
				$("#ajaxNewMsgTips").animate({top : -296, height: 295}, 1000);
			}
			else if(ii == 44)
			{
				var ajaxNewMsgTips = $("#ajaxNewMsgTips ul");
				if (ajaxNewMsgTips.find("li").length >= 6)
				{
					//超长了， 去掉一个
					ajaxNewMsgTips.find("li").eq(5).remove();
				}
				//删除原来的提示
				if ($("#ajaxNewMsgTips").attr("attr") == "none")
				{
					ajaxNewMsgTips.find("li").remove();
					$("#ajaxNewMsgTips").attr("attr", "ok");
				}
				//添加一个
				$("#ajaxNewMsgTips ul").html("<li>您有新的挑战，点击<a href='#buttom_window' onclick='dialog(\"挑战处理\", 400, true, \""+json.message[i].content + "&mid=" + json.message[i].id + "\",{});' style='color:red'>这里</a>查看。请在" + json.message[i].clearTime/ 1000 + "秒应答</li>");
				$("#ajaxNewMsgTips").animate({top : -296, height: 295}, 1000);


			}
		}
		clearInterval(readyTips);

		//如果当前页面获得焦点 不做任何操作
		if (winIfClose != "")
		{
			readyTips = setInterval(function()
			{
				if(document.title == winIfClose)
				{
					document.title = "您有新消息";
				}
				else
				{
					document.title =  winIfClose;
				}
			}, 2000);
			//设置新标题
			document.title = "您有新消息";
		}

	}
	if (parseInt(json.messageTips)>0)
	{
		$("#topMessageTips").html("<img style='float:left;' src='"+webimage+"images/NewMessage.gif' /><span style='color:red;'>("+ parseInt(json.messageTips) +")</span>");
	}
	else
	{
		$("#topMessageTips").html("消息");
	}

}

/**
* Ajax装载模块
*
* @param string id 模块显示区域ID
* @param string url 请求模块
* @param json   data 向模块传送数据
*/
function ReadModule(id, url, data)
{
	RequestAjax(url, data, function (html){
		if ( html!="" ) {
			$("#"+id).html( html );
		}
		else
		{
			Alert("网站繁忙，请稍后再试");
		}
	}, 'html');
}

//发送纸条
function sendMsg(id)
{
	onFoucsUid = id;
	if (!checkSelf(id, "不可以给自己发送纸条！"))return ;
	$("#myBagOrStorage").html('');
	$.ajax({
		url : getRandom(webfloor+"msg/msgaction.php?a=mailajax"),
		type : "POST",
		data : {id : id},
		dataType : "html",
		beforeSend: function()
		{
			$("#myBagOrStorage").html("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据发送中......</span></div></div>");
		},
		success : function(html)
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html(html);
			$("#myBagOrStorage").show();
		}});
}

function sendMsgSubmit()
{
	if (!checkSelf(onFoucsUid, "不可以给自己发送纸条！"))return ;

	var content = $.trim($("#sendMsgContent").val());
	message_vali('msgreg');
}
function msgreg(vali)
{
	if(vali.error){
		Alert(msg);
	}
	else{
		var content = $.trim($("#sendMsgContent").val());
		$.ajax({
			url : getRandom(webfloor+"msg/message.php?a=Send&data=true"),
			type : "POST",
			data : {content : content, 'uid[]' : onFoucsUid},
			dataType : "json",
			beforeSend: function()
			{
				$("#myBagOrStorage").html("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据发送中......</span></div></div>");
			},
			success : function(json)
			{
				Alert(json.msg);
				$("#myBagOrStorage").hide();
				$("#myFace").show();
				$("#myBagOrStorage").html('');
			}});
	}
}

//打招呼
function sayHello(id)
{
	if (!checkSelf(id, "怎么可以向自己打招呼呢！"))return ;
	onFoucsUid = id;
	$("#myBagOrStorage").html('');
	$.ajax({
		url : getRandom(webfloor+"msg/msgaction.php?a=ajax"),
		type : "POST",
		data : {id : id},
		dataType : "html",
		beforeSend: function()
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据加载中......</span></div></div>").appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		},
		success : function(html)
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$(html).appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		}
	});
}

//仓库
function myStorage()
{
	//不存在仓库
	$.ajax({
		url : getRandom(webfloor+"member/storage.php?i=1"),
		type : "GET",
		dataType : "html",
		beforeSend: function()
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据加载中......</span></div></div>").appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		},
		success : function(html)
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$(html).appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		}
	});
}

//背包
function myBag()
{
	var curUserStorage = $("#bag");

	//存在仓库
	if (curUserStorage.length)curUserStorage.remove();

	$.ajax({
		url : getRandom(webfloor+"member/bag.php?a=bag"),
		type : "GET",
		dataType : "html",
		beforeSend: function()
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据加载中......</span></div></div>").appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		},
		success : function(html)
		{
			$("#myFace").hide();
			$("#myBagOrStorage").html("");
			$(html).appendTo("#myBagOrStorage");
			$("#myBagOrStorage").show();
		}
	});
}
/**
*  播放魔法表情
*/
function previewPresent(o)
{
	if ($("#previewPresent"))$("#previewPresent").remove();

	$("body").append("<div id='previewPresent'><table style='border:0;'><tr><td><div class='arm_all_top_close' ><img src='"+webimage+"images/pay_alert_close.gif' onclick='$(\"#previewPresent\").remove();'/></div></td</tr><tr><td><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,19,0'><param name='movie' value='"+o.attr("attr")+"' /><param name='quality' value='high' /><embed src='"+o.attr("attr")+"' width='200' height='200'></embed></object></td></tr></table></div>");
	floatBox("previewPresent");
}

//轮循环效果
manyShow = function()
{
	this.showNum = 0;
	this.id = "";
	this.childName = "";

	this.initial = function(num, aboutid, childTag){
		this.showNum = num;
		this.id = aboutid;
		this.childName = childTag;
	};

	this.turnLeft = function()
	{
		//可见的节点
		var visibleChild = $("#" + this.id + " > " + this.childName + ":visible");
		if (visibleChild.length < this.showNum || !visibleChild.eq(0).prev().length)return ;
		visibleChild.eq(0).prev().show();
		visibleChild.eq(this.showNum - 1).hide();
	};
	this.turnRight = function()
	{
		//可见的节点
		var visibleChild = $("#" + this.id + " > " + this.childName + ":visible");
		if (visibleChild.length < this.showNum || !visibleChild.eq(this.showNum - 1).next().length)return ;
		visibleChild.eq(this.showNum - 1).next().show();
		visibleChild.eq(0).hide();
	}
};

//点击轮训
oneShow = function()
{
	this.parentid = "";
	this.childLength = 0;
	this.childName = "";
	this.activeClass = "";

	this.initial = function(id, childTag, onFoucsClass){
		this.parentid = id;
		this.childLength = $("#" + id + " > " + childTag).length;
		this.childName = childTag;
		this.activeClass = onFoucsClass;
	};

	this.showOne = function(nth, e)
	{
		if (nth > this.childLength || nth < 1)return ;
		$("#" + this.parentid + " > " + this.childName).hide().eq(nth - 1).show();
		$(e).parent().find(e.tagName).removeClass(this.activeClass);
		$(e).addClass(this.activeClass);
	};
}


//修改数字后，失去焦点
function numberKeydown(e)
{
	var key = window.event ? window.event.keyCode:e.which;

	if ((key < 45 || (key > 45 && key < 48) || (key > 57 && key < 95) || (key > 105)) && key!=8)
	{
		//IE
		if (window.event)
		{
			window.event.returnValue = false;
		}
		//FF
		else
		{
			e.preventDefault();
			return false;
		}
	}
}
function ajaxPage(id, href, e)
{
	var p = (typeof(e) == "number" ? e : $(e).attr("attr"));
	if(!$("#" + id + "_page_1").length){
		$("#" + id).html("<div id='" + id + "_page_1'>" + $("#" + id).html() + "</div>");
	}
	if(!$("#" + id + "_page_loading").length){
		$("#" + id).append("<div style='width:100%;height:40px;margin:10 auto; padding-top:10px;display:none;' id='" + id + "_page_loading'><div style='width:140px; margin:0 auto;'><img src='"+webimage+"images/loading_button.gif' style='float:left;'><span style='float:left;margin-top:12px; margin-left:5px;'>数据加载中......</span></div></div>");
	}
	if($("#" + id + "_page_" + p).length){
		$("div[id^='" + id + "_page_']").hide().end().find("#" + id + "_page_" + p ).show();
	}
	else{
		$.ajax({
			url :getRandom( href + "&p=" + p),
			type : "GET",
			dataType : "html",
			beforeSend : function()
			{
				$("div[id^='" + id + "_page_']").hide().end().find("#" + id + "_page_loading").show();
			},
			success : function(html)
			{
				$("div [id^=" + id + "_page_]").hide().end().find("#" + id ).append("<div id='" + id + "_page_" + p + "'>" + html + "</div>");
			}
		});
	}
}
function pageJump(e, href)
{
	//获得当前输入值
	var thisPage = $(e).parent().parent().find("input[name='pageJump']");

	if (thisPage.val() == "" || isNaN(thisPage.val()))return ;
	thisPageNum = parseInt(thisPage.val());

	//获得分页相关信息
	var pageInfo = thisPage.attr("attr").split("|");
	if (pageInfo[0] == thisPageNum || thisPageNum <= 0 || thisPageNum > pageInfo[1])return ;

	//处理跳转
	if (isNaN(pageInfo[2]))
	{
		ajaxPage(pageInfo[2], href, thisPageNum);
	}
	else
	{
		document.location.href= href + "&p=" + thisPageNum;
	}
}
//结婚相应
function wedRespond(id)
{

	$.ajax({
		url:getRandom('/wed/?a=getWed'),
		data:{"id":id},
		type:"POST",
		dataType:"json",
		success:function(json){
			if(json.length>0){
				Confirm(json[0].content,"同意","acceptedWed('"+json[0].id+"');","拒绝","refuesWed('"+json[0].id+"');");
			}
			else{
				Alert("求婚信息已过期！");
			}
		}
	});
}

//同意结婚
function acceptedWed(id)
{
	$.ajax({
		url:getRandom('/wed/?a=aboutWed'),
		data:{"id":id,"method":"agree"},
		type:"POST",
		dataType:"json",
		success:function(json){
			Alert(json.msg);
		}
	});
}

//拒绝结婚
function refuesWed(id)
{
	$.ajax({
		url:getRandom('/wed/?a=aboutWed'),
		data:{"id":id,"method":"refuse"},
		type:"POST",
		dataType:"json",
		success:function(json){
			Alert(json.msg);
		}
	});
}

function autoTurn(id, childTag)
{
	var childrens = $("#" + id);

	var findTheShow = childrens.find(childTag + ":visible");

	var index = parseInt(childrens.find(childTag).index(findTheShow));

	var childLength = parseInt(childrens.find(childTag).length);

	//最后一个
	if (index == (childLength - 1))
	{
		childrens.find(childTag).hide().end().find(childTag + ":first-child").show();
	}
	else
	{
		childrens.find(childTag).hide().end().find(childTag).eq(index + 1).show();
	}
}

function autoTurnLength(id, childTag, _length)
{
	var childrens = $("#" + id);

	var findTheShow = childrens.find(childTag + ":visible");

	var index = parseInt(childrens.find(childTag).index(findTheShow)+_length);

	var childLength = parseInt(childrens.find(childTag).length);

	//最后一个
	if (index >= childLength)
	{
		childrens.find(childTag).hide().end();
		for(var i=0;i<_length;i++){
			childrens.find(childTag).eq(i).show();
		}
	}
	else
	{
		childrens.find(childTag).hide().end();
		for(var i=0;i<_length;i++){
			childrens.find(childTag).eq(index + i).show();
		}
	}
}

worldTalkUp = function(childTag, id, showNum, perHeight)
{
	this.childTag = childTag;
	this.id = id;

	this.showNum = showNum;
	this.perHeight = perHeight;

	this.go = function()
	{
		//判断是否达到轮训的条数
		var childsNum = $("#" + this.id);
		if (childsNum.find(this.childTag).length <= this.showNum)return ;

		var curTop = parseInt(childsNum.css("top"));
		//把第一条换到后面去
		if (Math.abs(curTop) >= perHeight - 1)
		{
			$(childsNum.find(this.childTag).eq(0)).appendTo($("#" + this.id));
			$("#" + this.id).css("top", 0);
		}
		else
		{
			childsNum.css("top", curTop - 1);
		}
	}
}

function getRandom(string)
{
	var newRandom = parseInt(Math.random() * 100000);
	return string + "&random=" + newRandom;
}

function check_vali(success,key)
{
	var argumentKey = (arguments.length == 3) ? arguments[2] : false;
	var code = "";
	if(argumentKey){
		code = $('#vali_code_'+argumentKey).val();
	}
	else{
		code = $('#vali_code').val();
	}
	RequestAjax(getRandom(webfloor+'vali.php?a=valimessage'), {code:code,key:key}, success, 'json');
}

function submitOrder(order,sid)
{
	var mid = $("#ajaxNewMsgTipsMsdID").val();
	$.ajax({
		url : getRandom(webfloor+"/trade/?a=submitOrder&step=one"),
		type : "POST",
		dataType : "json",
		data : {order : order, sid :sid, mid : mid},
		success:function(json){
			if(json.error){
				Alert(json.message);
			}
			else{
				var html = '<div class="sys_alert" id="order_form_div">'+
				'<div class="sys_alert_top">'+
				'<div class="sys_shop_ico"></div>'+
				'<span>交易订单</span>'+
				'<div class="sys_alert_close"><img src="'+webimage+'images/sys_alert_close.gif" title="关闭" style="cursor:pointer;" onclick="$(\'#order_form_div\').hide();"/></div>'+
				'</div><div class="sys_alert_mid">'+
				'<div class="sys_alert_ly3">'+
				'<ul><li id="sale_detail"><span>商品信息：</span><input type="hidden" name="mid" value="'+ json.mid +'" id="order_form_mid"><input type="hidden" name="order" value="'+ json.data.id +'" id="order_form_order"><input type="hidden" name="sid" value="'+ json.data.sid +'" id="order_form_sid"><input type="hidden" name="name" value="'+ json.data.goodsname +'" id="order_form_name"></li>'+
				'<li>商品名称：<span>'+ json.data.goodsname +'</span></li>'+
				'<li>商品数量：<span>'+ parseInt(json.data.num) +'</span></li>'+
				'<li>商品价格：<span>'+ parseInt(json.data.total) +'</span></li>';
				html += json.data.gtype == 'g' ? (json.data.timeliness==1 ? '<li>商品次数：'+ json.data.degree +'次</li>' : (json.data.timeliness==2 ? '<li>商品时效：'+ parseInt(json.data.vanish/60) +'分钟</li>' : '')) : '';
				html += '<li style="text-align:center;"><input type="button" value="" style="background:url('+webimage+'images/sale_07.gif) no-repeat; border:none; width:54px; height:20px; float:inherit; cursor:pointer;" onclick="orderSubmit(\'accept\');"/>&nbsp;&nbsp;&nbsp;&nbsp;';
				html += '<input type="button" value="" style="background:url('+webimage+'images/sale_12.gif) no-repeat; border:none; width:54px; height:20px; float:inherit; cursor:pointer;" onclick="orderSubmit(\'refuse\');"/>';
				html += '</li></ul></div></div></div>';
				$(html).appendTo('body');
				floatBox("order_form_div",24232);
			}
		}
	});
}

function orderSubmit(re)
{
	$("#ajaxNewMsgTips").hide();
	$.ajax({
		url : getRandom(webfloor+"/trade/?a=submitOrder&step=two"),
		type : "POST",
		dataType : "json",
		data : {reply : re, order : $("#order_form_order").val(), sid : $("#order_form_sid").val(), mid : $("#order_form_mid").val(), name : $("#order_form_name").val()},
		success:function(json){
			$("#order_form_div").remove();
			if(!json.error && json.yellowboy){
				$("#user_detail_userAllgold").text(parseInt(json.yellowboy));
			}
			Alert(json.message);
		}
	});
}

function openChat()
{
	window.open(web_domain + 'chat/','聊天室','width=665,height=532');
}


function redbag(id)
{
	$.ajax({
		url : getRandom(web_domain + "active/redbag.php?id=" + id),
		type : "GET",
		dataType : "json",
		success:function(json){
			Alert(json.msg);
		}
	});
}

function mini_reload()
{
	location.reload();
}

function deal_chat_yaoqing(status, aboutuid, e)
{
	if (!aboutuid)return false;
	$.ajax({
		url : webfloor + "chat/?a=dealyaoqing",
		type : "POST",
		data : {status : status, aboutuid : aboutuid, id : $(e).parents("li").find("input[type='hidden']").val()},
		dataType : "json",
		success : function(json)
		{
			Alert(json.msg);
			if (status)
			{
				openChat();
			}
		}
	});
}

function jumpUrl()
{
	document.location.href=web_domain + 'login.php';
}
