//定义全局路径
var host_root = 'http://192.168.1.123/tuangou/';
//常用正则规则
var rule_phone = /^[0-9]{11}$/;
var rule_qq = /^[0-9]{6,10}$/;
var rule_email = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[a-z]{2,3}$/;
//全局ajax
function php(url, data, async) {
var ajaxreturn;
if (async == undefined)async = true;
$.ajax({
    type : 'POST',
    url : url,
    //async : async,
    data : data,
    dataType : 'json',    
    success : function(json){
	//alert(json);
 	switch (json.act) {
        case 'global':
			msgshow(json.show, json.jumpurl, json.showtime);
		break;
        case 'comment_addsql':
			msgshow(json.show, json.jumpurl, json.showtime);
			if (json.tf == 1) {
				$(".comment_text").val('');
				$("#comment_list").after(json.comment_html);
				$("#comment_list").next("div").fadeIn("slow");
			}
		break;
	}
	//
	}
})
	return ajaxreturn;
}
// -------------------------------- 操作后的信息提示框 --------------------------------- //
//10月8日修补后的
//信息提示框开启
function msgshow(msg, jumpurl, time){
	if(jumpurl==null || jumpurl=='')jumpurl='';
	if(time==null || time=='')time=2000;
	msg='<div id="msgshow" style="width:100%;height:38px;font-weight:bold;text-align:center;font-size:20px;color:#f00;display:none;background:#C1D655;position:fixed;bottom:0px;_POSITION:absolute;_top: expression(offsetParent.scrollTop+document.documentElement.clientHeight-this.offsetHeight">'+msg+'</div>';	
	$("#msgshow").remove();
	$("body").append(msg);
	//var _top = $(window).height() + $(document).scrollTop();
	//var top = _top - 38;
	//$("#msgshow").css('bottom',0).show();
	$("#msgshow").show();
	setTimeout(function(){msgclose("#msgshow",jumpurl)},time);
}
//信息提示框关闭
function msgclose(obj,jumpurl){
	$(obj).fadeOut(1000);
	if(jumpurl=='self'){
		window.location.href=window.location.href;
	}else if(jumpurl && jumpurl!=1){
		window.location.href=jumpurl;	
	}	
}
//退出函数
function logout(doajaxurl){
	php(doajaxurl,"act=user_logoutsql");
}
// -------------------------------- 单个事务删除确认弹出框 --------------------------------- //	
/* 
 * 功能：单个事务删除确认弹出框
 * 备注：by koyshe
 */
$(function(){
$(".delete_box").click(function(){
	if (confirm('您确认执行删除操作吗?')) {
		return true;
	}
	return false;
});
})


 
