﻿function trim(str){return str.replace(/(^\s*)|(\s*$)/g, "");}//删除左右两端的空格
function ltrim(str){return str.replace(/(^\s*)/g,"");}//删除左边的空格
function rtrim(str){return str.replace(/(\s*$)/g,"");}//删除右边的空格
//if(!self.frameElement&&document.URL.toLowerCase().indexOf('index.php')==-1){top.location.href='index.php';}
$(function()
{
//$("input[type='text'],input[type='file'],input[type='password'],select,textarea").hover(function(){$(this).css({border:"1px solid #009900"});},function(){$(this).css({borderTop:"1px #7c7c7c solid",borderRight:"1px #c3c3c3 solid",borderBottom:"1px #c3c3c3 solid",borderLeft:"1px #9a9a9a solid"});})
})
var xy={};
xy.Add=function(url){
	window.location.href=url;
}
xy.Edit=function(url){
	//alert((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(','))); return false;
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择编辑项"); return false;}window.location.href=url+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')));
}
xy.Read=function(url){
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择查看项"); return false;}window.location.href=url+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')));
}
xy.Del=function(url){
	if (GetTrVal()==""){ShowTip("请选择删除项"); return false;}if(confirm('确认删除操作吗?')){window.location.href=url+"/id/"+GetTrVal();}
}
xy.Audit=function(url){
	if (GetTrVal()==""){ShowTip("请选择操作项"); return false;}window.location.href=url+"/id/"+GetTrVal();
}
//使用方法onclick="xy.getone(this,59,,'Sort','inbox30')"
xy.getone=function(o,id,fied,style,url){
   val=$(o).html();
   if($(o).find("input").size()==0){
	  $(o).html("<input type=\"text\" class=\""+style+"\" onblur=\"xy.upone(this,"+id+",'"+fied+"','"+val+"','"+url+"')\" />").find("input").focus().val(val).select();    
   }
}
xy.upone=function(o,id,fied,oval,url){
	$(o).closest("div").html($(o).val());
   if(oval!=$(o).val()){
			   $.post(url, {id: id, field: fied, fieldval: $(o).val() },
				function (data, textStatus) {
					//ShowTip(data.info);
				}, "json");
   }
}

//更新图标状态
xy.togimg=function(o,id,fied,url){
	 $(o).html("<img src=\""+Other+"/images/loading.gif\"/>");
	 $.post(url, {id: id, field: fied },
	 function (data, textStatus) {
		 if(data.data==1){
			    $(o).html("<img src=\""+Other+"/images/yes.gif\"/>");
			 }
			 else
			 {
				 $(o).html("<img src=\""+Other+"/images/no.gif\"/>");
			 }
	 }, "json");
}

//删除文件
xy.ajaxdel=function(o,id,url){
	if(confirm('确认删除操作吗?')){
			 $(o).html("<img src=\""+Other+"/images/loading.gif\"/>");
			 $.post(url, {id: id},
			 function (data, textStatus) {
				 if(data.status!=0){
						 alert("删除成功");
						 window.location.reload();
					 }
					 else
					 {
						 alert("删除失败");
					 }
			 }, "json");
		}
}

//上传文件
xy.upload=function(url,mid){
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择需要上传项"); return false;}
	var str="<iframe id=\"ifr\" frameborder=\"0\" width=\"360px\" src=\""+url+"/mid/"+mid+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')))+"\"></iframe>";
	ShowDiv(str);
	}
	
//管理文件	
xy.flist=function(url,mid){
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择需要管理项"); return false;}
	var str="<iframe id=\"ifr\" frameborder=\"0\" width=\"530px\" src=\""+url+"/mid/"+mid+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')))+"\"></iframe>";
	ShowDiv(str);
	}
	
xy.addUpfile=function() {
	if ($(".areab_add_c_tr").size() > 5) {
		xy.showtip("最多允许同时上传5个文件")
		return false;
	}	
	var str = "<div class=\"areab_add_c_tr\"><div class=\"areab_add_c_tr1\">选择文件：</div><div class=\"areab_add_c_tr2\"><input id=\"file[]\" name=\"file[]\" type=\"file\" /></div><div class=\"areab_add_c_tr3\"><img src=\""+Other+"images/closet.gif\" style=\"cursor:pointer;\" onclick=\"xy.delUpfile(this)\"/></div></div>";
	$(".areab_add_c").append(str);
	$(window.parent.document).find("iframe[id='ifr']").height($("body .area").height());
//$("input[type='text'],input[type='file'],input[type='password'],select,textarea").hover(function(){$(this).css({border:"1px solid #009900"});},function(){$(this).css({borderTop:"1px #7c7c7c solid",borderRight:"1px #c3c3c3 solid",borderBottom:"1px #c3c3c3 solid",borderLeft:"1px #9a9a9a solid"});})
}
xy.delUpfile=function(o) {
	$(o).parent().parent().remove();
	$(window.parent.document).find("iframe[id='ifr']").height($("body .area").height());
}

//权限设置
xy.accredit=function(url){
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择需要管理项"); return false;}
	var str="<iframe id=\"ifr\" frameborder=\"0\" width=\"530px\" src=\""+url+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')))+"\"></iframe>";
	ShowDiv(str);
	}
xy.accreditsave=function(url,roleid){  //保存权限
	window.location.href=url+"/roleid/"+roleid+"/id/"+GetTrVal();
}

//权限用户列表
xy.userlist=function(url){
	if(GetTrVal(GetTrVal().length)==""){ShowTip("请选择需要管理项"); return false;}
	var str="<iframe id=\"ifr\" frameborder=\"0\" width=\"530px\" src=\""+url+"/id/"+((GetTrVal().lastIndexOf(',')==-1)?GetTrVal().substr(0,GetTrVal().length):GetTrVal().substr(0,GetTrVal().indexOf(',')))+"\"></iframe>";
	ShowDiv(str);
	}
xy.usersave=function(url,roleid){  //保存
	window.location.href=url+"/roleid/"+roleid+"/id/"+GetTrVal();
}

//显示弹出层
xy.showdiv=function(str) {
    if (!document.getElementById("loadgif")) {
        var msgtip = new String;
        msgtip = "<iframe id=\"msgiframe\" style=\"position: absolute;width:100%;height:" + $(document).height() + "px;background:#fff;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;opacity:0; z-index:999\"></iframe><div id=\"msgbg\" style=\"position: absolute;width:100%;height:" + $(document).height() + "px;background:#000000;top:0;left:0;filter:alpha(opacity=30);-moz-opacity:0.3;opacity:0.3; z-index:999\"></div><span id=\"loadgif\" style=\"z-index:1000\"></span>";
		//$("html",window.parent.document).append(msgtip);
        $("body").append(msgtip);
    }
    $("#loadgif").html(str);
//$("#loadgif").css({ position: "absolute", top: ($(window).height() - $("#loadgif").height()) / 2 + $(window).scrollTop() - 280 + "px",
$("#msgiframe").show(); $("#msgbg").show(); $("#loadgif").show();
$("#loadgif").css({position:"absolute", top:$(window).scrollTop() + 100 + "px",left:($(window).width() - $("#loadgif").width()) / 2 + $(window).scrollLeft() + "px" });
}

//隐藏弹出层
xy.hidediv=function() {
    $("#msgiframe").remove();
	 $("#msgbg").remove();
	 $("#loadgif").remove();
}

//自动消失提示框
xy.showtip=function(str) {   
	xy.showmsg("<img src='"+Other+"images/gt.gif'>  " + str, "2000");
	$("#loadgif").css({"font-size":"12px","color":"#006600","background":"#ffffff","border":"1px #006600 solid","padding":"5px 10px"});
}

//加载提示框
xy.showloading=function(str) {
    xy.showmsg("<img src='"+Other+"images/loading.gif'> " + str, "");
	 $("#loadgif").css({"font-size":"12px","color":"#006600","background":"#ffffff","border":"1px #006600 solid","padding":"5px 10px"});
}

//提示框
xy.showmsg=function(str, time) {
    if (time == "") {
        xy.showdiv(str);
    }
    else {
        xy.showdiv(str);
        setTimeout("xy.hidediv()", time);
    }
}

//加载下拉菜单 暂时只支持单级
/*
 model 模型名称
 outerid 外层元素id名称
 atturl 其它信息(images,css,js)等所在目录
 url 请求地址
 id 生成菜单
 pid 父id
 defval 显示默认值
 curval 当前默认值
 e 执行事件
 f 事件对应的函数
 css 事件对应的函数
 xy.dropmenu("menuid","../public","class.php","select1",30,"请选择信息","","click","getcity","sel1")
 */
xy.dropmenu=function(model,outerid,atturl,url,id,pid,defval,curval,e,f,css) {
   $("#"+outerid).html("<img src=\""+atturl+"images/loading.gif\" />");
	$.post(url, {m:model, pid: pid, curval: curval },
		function (data, textStatus) {
			if(data.data!=null)
			{
				if(defval=="")
				{
					if(curval=="")
					{
						s = "<select id=\"" + id + "\" name=\"" + id + "\" "+(((e!="") && (f!=""))?(e + "=\"" +f+"\" "):(""))+" class=\"" + css + "\">" + data.data + "</select>";
					}
					else
					{
						s = "<select id=\"" + id + "\" name=\"" + id + "\" "+(((e!="") && (f!=""))?(e + "=\"" +f+"\" "):(""))+" class=\"" + css + "\">" + data.data + "</select>";
					}
				}
				else
				{
					if(curval=="")
					{
						s = "<select id=\"" + id + "\" name=\"" + id + "\" "+(((e!="") && (f!=""))?(e + "=\"" +f+"\" "):(""))+" class=\"" + css + "\"><option value=\"\">"+defval+"</option>" + data.data + "</select>";
					}
					else
					{
						s = "<select id=\"" + id + "\" name=\"" + id + "\" "+(((e!="") && (f!=""))?(e + "=\"" +f+"\" "):(""))+" class=\"" + css + "\"><option value=\"\">"+defval+"</option>" + data.data + "</select>";
					}
					
				}
				$("#"+outerid).html(s);
			   if(curval!=""){$("#" + id).val(curval);}
			}
			else
			{
				$("#"+outerid).html("");
			}
		},"json")
}














//字验证数字格式
function IsInt(s)
{ 
 var myReg=/^[0-9]{1,11}$/;
 if (myReg.test(s)) return true;
 return false;
}

function addUpfile() {
	if ($(".areab_add_c_att .areab_add_c_tr").size() >= 10) {
		alert("最多允许同时上传10个附件");
		return false;
	}	
	var str = "<div class=\"areab_add_c_tr\">";
	str += "<div class=\"areab_add_c_tr1\"></div>";
	str += "<div class=\"areab_add_c_tr2\">名称：</div>";
	str += "<div class=\"areab_add_c_tr2\"><input id=\"FFileName[]\" name=\"FFileName[]\" type=\"text\" class=\"inbox200\" /></div>";
	str += "<div class=\"areab_add_c_tr2\"><input id=\"FFile[]\" name=\"FFile[]\" type=\"file\" size=\"30\" class=\"infile200\"></div>";
	str += "<div class=\"areab_add_c_tr2\">描述：</div>";
	str += "<div class=\"areab_add_c_tr2\"><input id=\"FFileSummary[]\" name=\"FFileSummary[]\" type=\"text\" class=\"inbox300\" /></div>";
	str += "<div class=\"areab_add_c_tr2\"><a href=\"javascript:;\" onclick=\"delUpfile(this)\"><img src=\"images/b_drop.png\"/></a></div>";
	str += "<div class=\"areab_add_c_tr3\"></div>";
	str += "</div>";
	$(".areab_add_c_att").append(str);
//$("input[type='text'],input[type='file'],input[type='password'],select,textarea").hover(function(){$(this).css({border:"1px solid #009900"});},function(){$(this).css({borderTop:"1px #7c7c7c solid",borderRight:"1px #c3c3c3 solid",borderBottom:"1px #c3c3c3 solid",borderLeft:"1px #9a9a9a solid"});})
}
function delUpfile(o) {
	$(o).parent().parent().remove();
}

/*获取操作值*/
function OnClickOnce(strtype) {
	$(".areab_add").eq(0).hide();
    if (get_value_all() == "") { ShowTip("您未选择信息"); return false; }
    if (strtype.indexOf("del") != -1) {
        if (!confirm('确认操作吗?')) { return false; }
    }
    ShowLoading("正在执行，请稍后...");
    $.post("ajaxdata.php", { Type: strtype, Ids: get_value_all() },
		function (data, textStatus) {
		    if (data == 1) {
		        ShowTip("操作成功"); ToPage($("#curpagecode").html());
		    }
		    else {
		        ShowTip(data);
		    }
		}, "text");
}

function JsonToStr(o) {
    var arr = [];
    var fmt = function (s) {
        if (typeof s == 'object' && s != null) return JsonToStr(s);
        return /^(string|number)$/.test(typeof s) ? "'" + s + "'" : s;
    }
    for (var i in o) arr.push("'" + i + "':" + fmt(o[i]));
    return '{' + arr.join(',') + '}';
}

function GetTrVal(){
	var temp = "";
	$(".areab_c_c_tr30 input[type=checkbox]").each(function(){if ($(this).attr("checked")){temp += $(this).val() + ",";}})
    return temp.substring(0, temp.length - 1);
}

$(function(){
	//全选/取消
	$("#All_Checkbox").click(function(){ 
	if($(this).attr("checked")){
		$(".areab_c_c_tr30 input[type=checkbox]").attr("checked",true);
		$(".areab_c_c_tr").css({"background":"#BED393"});
	}
	else{
    	$(".areab_c_c_tr30 input[type=checkbox]").attr("checked",false);
		$(".areab_c_c_tr").css({"background":"#FFFFFF"});
	}
	})
	//鼠标移动行变色
	$(".areab_c_c_tr").mouseover(function(){ 
	   if ($(this).find("input").attr("checked"))
		   return false;
	   else 
		  $(this).css({ background: "#DBE7C2" });
	}) 
	$(".areab_c_c_tr").mouseout(function(){ 
		if ($(this).find("input").attr("checked"))
			return false;
		else
		   $(this).css({ background: "#ffffff" });
	})
	//选中哪行哪行变色
	$(".areab_c_c_tr30 input[type=checkbox]").each(function(){
		 $(this).click(function(){
				 if ($(this).attr("checked")) {
					$(this).closest(".areab_c_c_tr").css({"background":"#BED393"});
				 }
				 else{
					$(this).closest(".areab_c_c_tr").css({"background":"#ffffff"}); 
				 }
			 });
		})
})


/*只争对权限的方法 开始*/
/*获取所有选择的权限*/
function get_pmsvalue_all() {
    var inputs = document.getElementById('pmsDiv').getElementsByTagName('input');
    var temp = "";
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i].getAttribute('type') == 'checkbox') {

            if (inputs[i].checked == true) {
                temp += inputs[i].value + "|";
            }
        }
    }
    return temp.substring(0, temp.length - 1);
}

/*选择所有的权限*/
function select_pmsall() {
    var inputs = document.getElementById('pmsDiv').getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i].getAttribute('type') == 'checkbox') {
            inputs[i].checked = true;
        }
    }
	$("#pmsDiv .areab_c_c_tr").css({"background":"#BED393"});
}

/*取消所有的权限*/
function noselect_pmsall() {
    var inputs = document.getElementById('pmsDiv').getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i].getAttribute('type') == 'checkbox') {
            inputs[i].checked = false;
        }
    }
	$("#pmsDiv .areab_c_c_tr").css({"background":"#FFFFFF"});
}

/*选择或取消权限*/
function All_pmsselected(o) {
    if (o.checked == true) {
        select_pmsall();
    }
    else {
        noselect_pmsall();
    }
}
/*只争对权限的方法 结束*/

/*表单提示*/
function TextBoxDefTxt(o, s) {
    o.value = s;
    o.onfocus = function () { if (o.value == s) { o.value = '' } }
    o.onblur = function () { if (o.value == '') { o.value = s } }
}

//获取格式化的编辑器内容
function getEditorContents(fckid) {
    var oEditor = FCKeditorAPI.GetInstance(fckid);
    return oEditor.GetXHTML(true);
}
//向编辑器插入指定代码
function insertHTMLToEditor(codeStr) {
    var oEditor = FCKeditorAPI.GetInstance("content");
    if (oEditor.EditMode == FCK_EDITMODE_WYSIWYG) {
        oEditor.InsertHtml(codeStr);
    } else {
        return false;
    }
}
//统计编辑器中内容的字数
function getLength() {
    var oEditor = FCKeditorAPI.GetInstance("content");
    var oDOM = oEditor.EditorDocument;
    var iLength;
    if (document.all) {
        iLength = oDOM.body.innerText.length;
    } else {
        var r = oDOM.createRange();
        r.selectNodeContents(oDOM.body);
        iLength = r.toString().length;
    }
    alert(iLength);
}
//执行指定动作
function ExecuteCommand(commandName) {
    var oEditor = FCKeditorAPI.GetInstance("content");
    oEditor.Commands.GetCommand(commandName).Execute();
}
//设置编辑器中内容
function SetContents(fckid, codeStr) {
    var oEditor = FCKeditorAPI.GetInstance(fckid);
    oEditor.SetHTML(codeStr);
}

function InfoClass_Hid() {
	$(".areab_add").eq(0).hide();
}


function ShowDiv(str) {
    if (!document.getElementById("loadgif")) {
        var msgtip = new String;
        msgtip = "<iframe id=\"msgiframe\" style=\"position: absolute;width:100%;height:" + $(document).height() + "px;background:#fff;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;opacity:0; z-index:999\"></iframe><div id=\"msgbg\" style=\"position: absolute;width:100%;height:" + $(document).height() + "px;background:#000000;top:0;left:0;filter:alpha(opacity=30);-moz-opacity:0.3;opacity:0.3; z-index:999\"></div><span id=\"loadgif\" style=\"z-index:1000\"></span>";
		//$("html",window.parent.document).append(msgtip);
        $("body").append(msgtip);
    }
    $("#loadgif").html(str);
//$("#loadgif").css({ position: "absolute", top: ($(window).height() - $("#loadgif").height()) / 2 + $(window).scrollTop() - 280 + "px",
$("#msgiframe").show(); $("#msgbg").show(); $("#loadgif").show();
$("#loadgif").css({position:"absolute", top:$(window).scrollTop() + 100 + "px",left:($(window).width() - $("#loadgif").width()) / 2 + $(window).scrollLeft() + "px" });
}
function HideMsg() {
    $("#msgiframe").remove(); $("#msgbg").remove(); $("#loadgif").remove();
}

function ShowTip(str) {   //自动消失提示框
    ShowMsg(str, "2000");
	$("#loadgif").css({"font-size":"12px","color":"#006600","background":"#ffffff","border":"1px #006600 solid","padding":"5px 10px"});
}

function ShowLoading(str) {   //加载提示框
    ShowMsg("<img src='"+Other+"images/loading.gif'> " + str, "");
		$("#loadgif").css({"font-size":"12px","color":"#006600","background":"#ffffff","border":"1px #006600 solid","padding":"5px 10px"});
}

function ShowMsg(str, time) {
    if (time == "") {
        ShowDiv(str);
    }
    else {
        ShowDiv(str);
        setTimeout("HideMsg()", time);
    }
}

function ShowHtml(stit,shtml,dwidth,dheight,fun,obj) {       //显示html  psm参数只争对权限
str="<div class=\"popdiv\" style=\"width:"+(dwidth+9)+"px; height:"+(dheight+9)+"px;\"><div class=\"popdiv_1\" style=\"width:"+(dwidth)+"px; height:"+(dheight)+"px;\"><div class=\"popdiv_1_t\"><div class=\"popdiv_1_t_1\">"+stit+"</div><div class=\"popdiv_1_t_2\"><img src=\"images/close.gif\" width=\"7\" height=\"8\" style=\"cursor:pointer;\" onclick=\"HideMsg()\"/></div></div><div class=\"popdiv_1_c\" id=\"pmsDiv\" style=\"height:"+(dheight-64)+"px;\">"+shtml+"</div><div class=\"popdiv_1_b\"><div class=\"popdiv_1_b_30\">"+ ((psm!="")?"<input id=\"All_Checkboxpsm\" type=\"checkbox\" onclick=\"All_pmsselected(this)\" title=\"全选/取消\" />":"")+"</div><div class=\"popdiv_1_b_70\"><a href=\"javascript:;\" onfocus=\"this.blur()\" class=\"abt1\" onclick=\""+fun+"\">更 新</a></div><div class=\"popdiv_1_b_70\"><a href=\"javascript:;\" onfocus=\"this.blur()\" class=\"abt1\" onclick=\"HideMsg()\">取 消</a></div></div></div><div class=\"popdiv_bg\" style=\"width:"+(dwidth+2)+"px; height:"+(dheight+2)+"px;\"></div></div>";
ShowMsg(str, "");
$("#loadgif").css({"font-size":"12px","color":"#006600","background":"","border":"none","padding":"0px"});MoveDiv();
}

function MoveDiv() {  //移动层
	var _move=false;//移动标记
	var _x,_y;//鼠标离控件左上角的相对位置
	$(".popdiv_1_t").css('cursor','move');
	$(".popdiv_1_t").mousedown(function(e){
	//$(document).bind("selectstart", function(){return false;});
	_move=true;
	_x=e.clientX-parseInt($("#loadgif").css("left"));
	_y=e.clientY-parseInt($("#loadgif").css("top"));
	//$("#loadgif").fadeTo(20, 0.5);//点击后开始拖动并透明显示
	});
	$(document).mousemove(function(e){
	if(_move){
	var x=e.clientX-_x;//移动时根据鼠标位置计算控件左上角的绝对位置
	var y=e.clientY-_y;
	//$("#stbox").html("("+x+","+y+")");
	//控制在界面以内
	if(x<0)x=0;
	if(y<0)y=0;
	wth=$("#loadgif").outerWidth(true);
	hht=$("#loadgif").outerHeight(true);
	if(wth+x>$(window).width())x=$(window).width()-wth;
	if(hht+y>$(window).height())y=$(window).height()-hht;
	$("#loadgif").css({top:y,left:x});//控件新位置
	}
	}).mouseup(function(){
		_move=false;
	   // $(document).bind("selectstart", function(){return true;});
	    //$("#loadgif").fadeTo("fast", 1);//松开鼠标后停止移动并恢复成不透明
	});
}

//将其封装为一个函数 
function fHideFocus(tName){
aTag=document.getElementsByTagName(tName);
for(i=0;i<aTag.length;i++)aTag[i].hideFocus=true;
//for(i=0;i<aTag.length;i++)aTag[i].onfocus=function(){this.blur();};
}
/*当前是添加一个hidefocus的属性，注释掉的句子是添加onfucus=this.blur();
然后调用fHideFocus(“A”);即可把a的虚线框去掉
通过传递不同的参数 可以去掉更多的虚线框 比如”BUTTON”可以去掉button的
但要记住参数要用大写字母。*/









function Tips(id)//页面小提示
{ 		
	tips="<div class=\""+id+"\" style=\"border:1px #9C0 solid; padding:5px; background:#F4FED3; color:#000000\"></div>";
	$(tips).appendTo("body");
	$("."+id).hide();
	$("#"+id).mouseover(function(e)
	   {
		  $("."+id).css({"position":"absolute","left":$(this).offset().left+15,"top":$(this).offset().top+15}).html("<img src=\"images/loading.gif\">").fadeIn(100);
		  
			 $.post("ajaxdata.php", { Type: "tips", Idd: id },
			 function (data, textStatus) {
				 if (data != "") {
	               $("."+id).html(unescape(data));
				 }
				 else
				 {
					$("."+id).fadeOut(500);
				 }
			 }, "text");
	   })
	   
	$("#"+id).mouseout(function(e)
	   {
		   $("."+id).fadeOut(500);
	   })
}

function Load_PmsBt(CurId)//当前页面权限id号 加载权限按钮
{
	$.post("ajaxdata.php", { Type: "pms_bt", CurPmsId:CurId},
		function (data, textStatus) {
		    $(".areab_p_bt").html(unescape(data));
		}, "text");
}

//兼容ie firefox的 file值清空函数为 resetFileInput($("#Filetu"));
function resetFileInput(file){   
   file.after(file.clone().val(""));   
   file.remove();   
} 


