var Loadimg1="..";
var Loadimg2="<img src=\"/Lib/Images/loading/Loading2.gif\" align=\"absmiddle\" />";
var Loadimg3="<img src=\"/Lib/Images/loading/Loading3.gif\" align=\"absmiddle\" />";
var failpic="<img src=\"/Lib/Images/loading/fail.gif\" align=\"absmiddle\" />";
var truepic="<img src=\"/Lib/Images/loading/true.gif\" align=\"absmiddle\" />";
var uLoginOutMsg="对不起，您未登录会员平台，或登录超时退出，系统在5秒内转入登录页面.......!</br>你也可以手动点击<a href=\"/login.shtml\" title=\"会员登录\">直接进入</a>登录页面！";
var vote_tt;
var num_ListTime=10;//页面载入廷时时间设置
var num_MsgTime=3000;//错误信息提示页面跳转信息等
var num_OtherTime=10;//其它小功能。。。
var numTime1=1;var numTime2=0.1;var numTime3=5;

function getFckVal(objName)
{
//var oEditor=FCKeditorAPI.GetInstance(objName) ;
//return oEditor.GetXHTML( true ); // "true" means you want it formatted.获取fck编辑器的值的方法
if($('#'+objName).is(":hidden")){
	return GetContents(objName);
}else{return $('#'+objName).val();}
}
function worktime(tagobj){
	var nyear=parseInt(new Date().format("yyyy"));
	for(var i = -2; i < 40; i++){
		var temp=(nyear)-i;
		$("<option value=\""+temp+"\">"+temp+"年</option>").appendTo(tagobj)//添加下拉框的option
	}
}

function FomatTrade(str,outID){
	var arrData=str.split(",");	var aa=new Array('','','','');
	if($.trim(str)!=''&&str!=undefined){
		if (outID==1){for(var i = 0; i < arrData.length; i++){var arrPdata = arrData[i ].split("|");aa[i]=arrPdata[1]}}
		else{for(var i = 0; i < arrData.length; i++){var arrPdata = arrData[i ].split("|");aa[i]=arrPdata[0]}
		}
	}
return aa;

}
function getCollegeInfo(mParentID,getType,tagobj){//获取院系
	$.ajax({
		type: "POST",
		url: "/Param/?subaction=getCollegeInfo",
		data: "mParentID="+ encodeURIComponent(mParentID)+"&getType="+encodeURIComponent(getType),
		cache:false,//设置同步
		async:false,
		timeout: 5000,
        error: function(msg){
			alert("数据提取出错");
			return false;
			},
		error: function(msg){
			alert("数据提取超时");
			return false;
			},
		success: function(msg){
			$(tagobj).empty();
			if(msg != '0'){
				var arrMaMsg=unescape(msg);
				var arrMa=arrMaMsg.split(",");

				for(var i = 0; i < arrMa.length; i++)
				{
					var arrMavt = arrMa[i ].split("&");

					$("<option value=\""+arrMavt[0]+"\">"+arrMavt[1]+"</option>").appendTo(tagobj)//添加下拉框的option
				}
			}
			return true;
		}
	});
}
function getBPartInfoSelect(tagobj){
	$.ajax({
		type: "POST",
		url: "/Lib/Buser/common/?action=partInfoSelect",
		data: "ReadGO=1",
		cache:false,//设置同步
		async:false,
		timeout: 5000,
        error: function(msg){
			alert("数据提取出错");
			return false;
			},
		timeout: function(msg){
			alert("数据提取超时");
			//alert("服务器超时");
			return false;
			},
		success: function(msg){
			$(tagobj).empty();
			if(msg != '0'){
				var arrMajor=unescape(msg);
				var arrMa=arrMajor.split(",");

				for(var i = 0; i < arrMa.length; i++)
				{
					var arrMavt = arrMa[i ].split("&");

					$("<option value=\""+arrMavt[0]+"\">"+arrMavt[1]+"</option>").appendTo(tagobj)
				}
			}
			return true;
		}
	});
}

//mParentName职位名称，getType级别类型[getRoot,getChild],tagobj菜单对像，msgobj提示语信息对像（转圈圈的）
//mProvinceName职位类型
function getJobTypeInfo(mParentName,mJobTypeName,getType,tagobj,nParamTxt){//获取地区
	$.ajax({
		type: "POST",
		url: "/Param/?subaction=getJobTypeInfo",
		data: "mParentName="+ escape(mParentName)+"&getType="+escape(getType)+"&mJobTypeName="+escape(mJobTypeName)+"&nParamTxt="+escape(nParamTxt),
		cache:false,//设置同步
		async:false,
		timeout: 3000,
		success: function(msg){
			$(tagobj).empty();
			if(msg != '0'&&jQuery.trim(msg)!=''){
				var JobData=unescape(msg);
				var arrJobT=JobData.split(",");

				for(var i = 0; i < arrJobT.length; i++)
				{
					var arrJobPc = arrJobT[i ].split("&");

					$("<option value=\""+arrJobPc[0]+"\">"+arrJobPc[1]+"</option>").appendTo(tagobj)//添加下拉框的option
				}
			}
			return true;
		}
	});
}

function GetTrainCourseClass(tagobj){//获取地区
	$.ajax({
		type: "POST",
		url: "/Param/?subaction=GetTrainCourseClass",
		data: "ReadGO=ok",
		timeout: 5000,
		async:false,
		cache:true,
		success: function(msg){
			$(tagobj).empty();
			if(msg != '0'){
				var arrTra=unescape(msg);
				var arrMa=arrTra.split(",");
				for(var i = 0; i < arrMa.length; i++)
				{
					var arrMavt = arrMa[i ].split("&");
					$("<option value=\""+arrMavt[0]+"\">"+arrMavt[1]+"</option>").appendTo(tagobj)//添加下拉框的option
				}
			}
			return true;
		}
	});
}


function isChinese(str){
	var badChar ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	badChar += "abcdefghijklmnopqrstuvwxyz";
	badChar += "0123456789";
	badChar += " "+"　";//半角与全角空格
	badChar += "`~!@#$%^&()-_=+]\\|:;\"\\'<,>?/";//不包含*或.的英文符号
	if(""==str){
		return false;
	}
	for(var i=0;i<badChar.length;i++)//字符串str中的字符
	{
		var c = str.charAt(badChar[i]);
		if(badChar.indexOf(c) > -1){
			return false;
		}
	}
	return true;
}

function getObjValue(elementId){	//获取指定id的form组件的值
	if($(elementId).val()!=undefined)

		return jQuery.trim($(elementId).val());
	else
		return "";

}
function checkIdcard(idcard){
var Errors=new Array(
        "验证通过!",
        "身份证号码位数不对!",
        "身份证号码出生日期超出范围或含有非法字符!",
        "身份证号码校验错误!",
        "身份证地区非法!"
    );
    var area={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"}
    var idcard,Y,JYM;
    var S,M;
    var idcard_array = new Array();
    idcard_array = idcard.split("");
    //地区检验
    if(area[parseInt(idcard.substr(0,2))]==null) return Errors[4];
    //身份号码位数及格式检验
    switch(idcard.length){
        case 15:
        if ( (parseInt(idcard.substr(6,2))+1900) % 4 == 0 || ((parseInt(idcard.substr(6,2))+1900) % 100 == 0 && (parseInt(idcard.substr(6,2))+1900) % 4 == 0 )){
            ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/;//测试出生日期的合法性
        } else {
            ereg=/^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/;//测试出生日期的合法性
        }
        if(ereg.test(idcard)){
            return Errors[0];
        }else{
            return Errors[2];
        }
        break;
        case 18:
        //18位身份号码检测
        //出生日期的合法性检查
        //闰年月日:((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))
        //平年月日:((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))
        if ( parseInt(idcard.substr(6,4)) % 4 == 0 || (parseInt(idcard.substr(6,4)) % 100 == 0 && parseInt(idcard.substr(6,4))%4 == 0 )){
            ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/;//闰年出生日期的合法性正则表达式
        } else {
            ereg=/^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/;//平年出生日期的合法性正则表达式
        }
        if(ereg.test(idcard)){//测试出生日期的合法性
            //计算校验位
            S = (parseInt(idcard_array[0]) + parseInt(idcard_array[10])) * 7
            + (parseInt(idcard_array[1]) + parseInt(idcard_array[11])) * 9
            + (parseInt(idcard_array[2]) + parseInt(idcard_array[12])) * 10
            + (parseInt(idcard_array[3]) + parseInt(idcard_array[13])) * 5
            + (parseInt(idcard_array[4]) + parseInt(idcard_array[14])) * 8
            + (parseInt(idcard_array[5]) + parseInt(idcard_array[15])) * 4
            + (parseInt(idcard_array[6]) + parseInt(idcard_array[16])) * 2
            + parseInt(idcard_array[7]) * 1
            + parseInt(idcard_array[8]) * 6
            + parseInt(idcard_array[9]) * 3 ;
            Y = S % 11;
            M = "F";
            JYM = "10X98765432";
            M = JYM.substr(Y,1);//判断校验位
            if(M == idcard_array[17]){
                return Errors[0]; //检测ID的校验位
            }else{
                return Errors[3];
            }
        }else{
            return Errors[2];
        }
        break;
        default:
        return Errors[1];
        break;
    }

}

function clearForm()
{
	var coll = document.getElementsByTagName('input')
	if(!coll) return;
	if(coll.length){
		for(var i = 0;i < coll.length;i++){
			if (coll.item(i).type == 'text'||coll.item(i).type == 'password') coll.item(i).value = '';
			if (coll.item(i).type == 'checkbox') coll.item(i).checked='';
		}
	}
	var coll = document.getElementsByTagName('select')
	if(!coll) return;
	if(coll.length){
		for(var i = 0;i < coll.length;i++){
			if (coll.item(i).value != '') coll.item(i).value = '';
		}
	}
	var coll = document.getElementsByTagName('textarea')
	if(!coll) return;
	if(coll.length){
		for(var i = 0;i < coll.length;i++){
			if (coll.item(i).value != '') coll.item(i).value = '';
		}
	}
}
//单选取值
function getRadioVal(name){
	if(!document.getElementsByTagName(name)) return;
	return $('input:radio[name='+name+'][checked]').val();
	}
//给单选框赋值
function selectRadio(name,value) {
    var radioObject = document.getElementsByName(name);
    if(value == ""){radioObject[0].checked = true;  return;  }
    for (var i = 0; i < radioObject.length; i++){
        if(radioObject[i].value == value) {  radioObject[i].checked = true;  break;   }
    }
}


function checkIsNull(obj,obj2){
	var inputval = $(obj).val();
	if(jQuery.trim(inputval)==""){
		$(obj2).attr("class","hint warning");
		$(obj2).html(failpic+"&nbsp;&nbsp;此项不能为空");
		return false;
	}else{
		$(obj2).attr("class","hint ok");
		$(obj2).html(truepic+"&nbsp;&nbsp;正确");
		return true;
		}
}
function openFloat(actionval,id,tagobj,paramurl) {
if (paramurl!=''){paramurl="&"+paramurl;}
		createFullDiv("FullScreenContDiv");
		juecomajax(Loadimg3,"/Param/?subaction="+actionval,"POST","ReadGO=ok&floatid="+id+"&tagobj="+tagobj+paramurl,false,false,"#"+id);
		document.getElementById("outboxlist").style.width = '80%';
		document.getElementById("outboxlist").style.margin = '0px auto 0px auto';
		document.getElementById('outboxlist').style.top = document.documentElement.scrollTop +'px'; //add by 阿聪 2009-4-19
		var trueHeight = document.documentElement.scrollTop + document.getElementById('outboxlist').scrollHeight; //add by 阿聪 2009-4-19
		document.getElementById('FullScreenDiv').style.backgroundColor ='#eee';
		document.getElementById('FullScreenDiv').style.opacity = 0.80;
		document.getElementById('FullScreenDiv').style.filter = 'Alpha(opacity=80)';
		if (trueHeight > document.body.scrollHeight) document.getElementById('FullScreenDiv').style.height = (trueHeight + 40) +'px';
}
//edit by :danny 09-4-23修改适用于有权限目录
function openFloat2(actionval,id,tagobj,paramData,Isasync) {
if (paramData!=''){paramData="&"+paramData;}
		createFullDiv(id);
		juecomajax(Loadimg3,actionval,"POST","ReadGO=ok&floatid="+id+"&tagobj="+tagobj+paramData,Isasync,false,"#"+id);
		document.getElementById("outboxlist").style.width = '80%';
		document.getElementById("outboxlist").style.margin = '0px auto 0px auto';
		document.getElementById('outboxlist').style.top = document.documentElement.scrollTop +'px'; //add by 阿聪 2009-4-19
		var trueHeight = document.documentElement.scrollTop + document.getElementById('outboxlist').scrollHeight; //add by 阿聪 2009-4-19
		if (trueHeight > document.body.scrollHeight) document.getElementById('FullScreenDiv').style.height = (trueHeight + 40) +'px'; //add by 阿聪 2009-4-19
}
function closeOpenFloat(tag) {
	if (document.getElementById(tag)) document.getElementById(tag).style.display = 'none';
}
function juecomajax(statePic,postUrl,postType,dataStr,asyncTF,cacheTF,tagObj){
	$.ajax({
		type: postType,
		url: postUrl+"&r="+Math.random(),
		data: dataStr,
		cache:cacheTF,
		async:asyncTF,
		timeout: 5000,
		beforeSend: function(XMLHttpRequest){
			$(tagObj).html(statePic+"&nbsp;&nbsp;数据加载中..");
		},
        error: function(msg){
			alert("公共数据调取超时，请与客服联系");
			return false;
			},
		error: function(msg){
			alert("公共数据调取超时,请与客服联系");
			return false;
			},
		success: function(msg){
				if(unescape(msg)=='False'){LoginForm();return false;}
				//最好加上过滤SQL执行错显示
				$(tagObj).html(unescape(msg));
			return true;
		}
	});
	}
	//TotalNum总条数：PageSize分页条数：CurrentPage当前页数：LinkURL页面地址除页数外：listNumStyle显示页面的个数：tagobj显示的DIV
function getPageList(TotalNum,PageSize,CurrentPage,LinkURL,listNumStyle,tagobj){
	if(parseInt(CurrentPage)==0)CurrentPage=1;
	var CountPageNum=0;
	var PageNum=0;
	var j=0;
	var TempStr="";
	if (listNumStyle==""||parseInt(listNumStyle)>10) listNumStyle=10;
	if (listNumStyle%2!=0){
		listNumStyle+=1;
	}
	if(TotalNum=="") {return false;	}
	if ((TotalNum%PageSize)==0 ){PageNum=TotalNum/PageSize;	}
	else{PageNum=parseInt(TotalNum/PageSize)+1;}
	if(CurrentPage>PageNum){CurrentPage=PageNum}
	TempStr="<div class=\"pageList_nav\"> <div class=\"pageList_l\">第 <b class=\"ho12\">"+CurrentPage+"</b> / <span class=\"hei12\">"+PageNum+"</span> 页  每页 <b class=\"hei12\">"+PageSize+"</b> 条  共 <b class=\"hei12\">"+TotalNum+"</b> 条</div><div class=\"pageList_r\">";

	if (CurrentPage==1) {
		TempStr+= "<a class=\"nor\">首页</a> ";
		TempStr+= "<a class=\"nor\">上页</a>";
	}else if (CurrentPage ==2) {
		TempStr+= "<a href=\""+LinkURL+"\" class=\"nor\" title=\"首页\">首页</a> ";
		TempStr+= "<a href=\""+LinkURL+"\" class=\"nor\" title=\"上一页\">上页</a>";
	}else{
		TempStr+= "<a href=\""+LinkURL+"\" class=\"nor\" title=\"首页\">首页</a> ";
		TempStr+= "<a href=\"" + LinkURL +"&page="+ parseInt(CurrentPage-1) + "\" class=\"nor\" title=\"上一页\">上页</a> ";
	}
	var g=0;
	//PageNum 页面数 CurrentPage 当前页码
	if (PageNum > listNumStyle) {
		if (CurrentPage > parseInt(listNumStyle/2)) {
			if (parseInt(PageNum - CurrentPage) < parseInt(listNumStyle/2)) {CountPageNum = parseInt(PageNum - parseInt(listNumStyle-1));}else{CountPageNum = parseInt(CurrentPage - parseInt(listNumStyle/2));}
		}else{CountPageNum = 1;	}
	}else{CountPageNum = 1;}
	for(j=CountPageNum;j<=PageNum;j++){
		if (j==CurrentPage) {TempStr+= "<a class=\"act\" >"+ j +"</a>";}
		else{TempStr+= "<a href=\"" + LinkURL +"&page="+ j  + "\" class=\"nor\">" + j + "</a> ";}
		g+=1;
		if ((g%listNumStyle)== 0 ){ break;}
	}
	if (CurrentPage==PageNum) {
		TempStr+= "<a class=\"nor\">下页</a>";
		TempStr+= "<a class=\"nor\">末页</a>";
	}else{
		TempStr+= "<a href=\"" + LinkURL +"&page="+ parseInt(CurrentPage+1) + "\" class=\"nor\" title=\"下一页\">下页</a> ";
		TempStr+= "<a href=\"" + LinkURL +"&page="+PageNum + "\" class=\"nor\" title=\"最后一页\">末页</a> ";
	}
	TempStr=TempStr+"</div></div>";
	$(tagobj).html(TempStr);
}

function getTopPageList(TotalNum,PageSize,CurrentPage,LinkURL,listNumStyle,tagobj){
	if(parseInt(CurrentPage)==0)CurrentPage=1;
	var CountPageNum=0;
	var PageNum=0;
	var j=0;
	var TempStr="";
	if (listNumStyle==""||parseInt(listNumStyle)>10) listNumStyle=10;
	if (listNumStyle%2!=0){
		listNumStyle+=1;
	}
	if(TotalNum=="") {return false;	}
	if ((TotalNum%PageSize)==0 ){PageNum=TotalNum/PageSize;	}
	else{PageNum=parseInt(TotalNum/PageSize)+1;}
	if(CurrentPage>PageNum){CurrentPage=PageNum}

	TempStr='<div class="pageList">';
	TempStr+='<a href="' + LinkURL +'" class="page_nor" title="最后一页">首页</a>';
	var g=0;
	//PageNum 页面数 CurrentPage 当前页码
	if (PageNum > listNumStyle) {
		if (CurrentPage > parseInt(listNumStyle/2)) {
			if (parseInt(PageNum - CurrentPage) < parseInt(listNumStyle/2)) {CountPageNum = parseInt(PageNum - parseInt(listNumStyle-1));}else{CountPageNum = parseInt(CurrentPage - parseInt(listNumStyle/2));}
		}else{CountPageNum = 1;	}
	}else{CountPageNum = 1;}
	for(j=CountPageNum;j<=PageNum;j++){
		if (j==CurrentPage) {TempStr+='<a class="page_sor" >['+ j +']</a>';}
		else{TempStr+= '<a href="' + LinkURL +'&page='+ j  + '" class="page_nor">['+ j + ']</a>';}
		g+=1;
		if ((g%listNumStyle)== 0 ){ break;}
	}
	TempStr+= '<a href="' + LinkURL +'&page='+PageNum + '" class="page_nor" title="最后一页">末页</a>';
	TempStr+='</div>';
	$(tagobj).html(TempStr);
}



function getallboxval(objname){
	var str="";
	$("input:checkbox[name='"+objname+"'][checked]").each(function(){
    str+=$(this).val()+",";
	 });
	if (str!=""){return str.substr(0,str.length-1);}else{return ""}
	}
	
function boxcheckall(obj){
if ($(obj).attr('checked')==true){$(":checkbox").attr("checked", true);}else{$(":checkbox").attr("checked", false);}
}
function SelectBoxAll(obj,areatag,tagRow){
	if ($(obj).attr('checked')==true){$(areatag+" input:checkbox").attr("checked", true);
	$(areatag+" "+tagRow).css({"background":"#ffffcc"});
	}else{$(areatag+" input:checkbox").attr("checked", false);$(areatag+" "+tagRow).css({"background":""});}
	}

function dateDiff(startTime,endTime){
//默认格式为"2003-03-03",根据自己需要改格式和方法
	startTime=startTime.replace(/-/g,""); //g代表gobal，全局替换。
	startTime=startTime.replace(/\\/g,"");
	startTime=startTime.replace(/\./g,"");
	endTime=endTime.replace(/-/g,""); //g代表gobal，全局替换。
	endTime=endTime.replace(/\\/g,"");
	endTime=endTime.replace(/\./g,"");
	var year1 =  startTime.substr(0,4);
	var year2 =  endTime.substr(0,4);
	var month1 = startTime.substr(4,2);
	var month2 = endTime.substr(4,2);
	var day1 = startTime.substr(6,2);
	var day2 = endTime.substr(6,2);
	temp1 = year1+"/"+month1+"/"+day1;
	temp2 = year2+"/"+month2+"/"+day2;
	var dateaa= new Date(temp1);
	var datebb = new Date(temp2);
	var date = datebb.getTime() - dateaa.getTime();
	var time = Math.floor(date / (1000 * 60 * 60 * 24));
	return time;

}
//计算两个时间差并返回提示
function IsValidTwoDate(startTime,endTime,obj){
	var time1=jQuery.trim($(startTime).val());
	var time2=jQuery.trim($(endTime).val());
	if (dateDiff(time1,time2)>0){$(obj).html("");$(obj).attr("class","hint ok");return true;}
	else{$(obj).html("结束时间必须大于开始时间，请您正确选择！");	$(obj).attr("class","hint warning");return false;}
	}
//获取指定的COOKIE值
function getCookieName(tagName){
	$.ajax({
		type: "POST",
		url: "/Param/?subaction=getCookieName",
		data: "ReadGO=1&tagName="+escape(tagName),
		cache:false,//设置同步
		async:false,
		timeout: 5000,
        error: function(msg){
			//alert("数据提取出错");
			return "";
			},
		timeout: function(msg){
			//alert("数据提取超时");
			//alert("服务器超时");
			return "";
			},
		success: function(msg){
			if(unescape(msg) != '0'){
				return unescape(msg);

			}
			else
			{
				return "";
				}

		}
	});
}
//用于onmouseout时触发
function tagout_checkbv(obj,checkobj){
	//alert($("#"+checkobj).attr('checked'));
	if($("#"+checkobj).attr('checked')==false||$("#"+checkobj).attr('checked')==undefined){$(obj).css({"background":""});}

}
//用于onmouseover时触发
function tagoverColor(obj){
	$(obj).css({"background":"#ffffcc"});

	}
function tagoutColor(obj){
	$(obj).css({"background":""});

	}
	//点击复选框时
function changecolor(tagbr,obj){
//$("#"+tagbr).attr("checked",false);
	tagbr.checked=!tagbr.checked;
	//if($(tagbr).attr('checked')==false){$("#"+tagbr).attr("checked",true);}else{$("#"+tagbr).attr("checked",false);}
	if($(tagbr).attr('checked')==false){$(obj).css({"background":""}); }else{$(obj).css({"background":"#ffffcc"});}

	}
	//整行单击时
function tagclick_changeboxv(obj){

	if($("#"+obj).attr('checked')==false){$("#"+obj).attr("checked",true);}else{$("#"+obj).attr("checked",false);}

	}

	//获取会员留言最新
	//1表个人会员2表企业
function getMsgCount(getType,tagobj){

	if (getType==1){sendurl="/Lib/user/?subaction=getMsgCount";}else{sendurl="/Lib/buser/?subaction=getMsgCount"}
	$.ajax({
		type: "POST",
		url: sendurl,
		data: "getType=getpagecount",
		timeout: 5000,
		async:false,
		beforeSend: function(XMLHttpRequest){
			$(tagobj).html(Loadimg1);
		},
		success: function(msg){
			if(unescape(msg)=='False'){LoginForm();return false;}

			$(tagobj).html(unescape(msg));

			return true;

		},
		cache:false,
		error:function(msg){

			$(tagobj).html("");
			return false;
		},
		timeout:function(msg){

			$(tagobj).html("");
			return false;
		}
	});
}
//获取单位左边菜单
function getUserMenu(tagobj){
	$(tagobj).html("<div align=\"center\" style=\"margin-top:150px;\">"+Loadimg1+"菜单加载中</div>");
	$(tagobj).show();
	//$("#b_Menu").hide();$("#s_Menu").hide();$("#p_Menu").hide();

	$.ajax({
		type: "POST",
		url: "/Lib/buser/?subaction=getUserMenu",
		data: "getType=ok",
		timeout: 5000,
		async:false,
		beforeSend: function(XMLHttpRequest){
			$(tagobj).html("<div align=\"center\" style=\"margin-top:150px;\">"+Loadimg1+"菜单加载中</div>");
		},
		success: function(msg){
			if(unescape(msg)=='False'){LoginForm();return false;}
			if(unescape(msg)=='nullusertype'){LoginForm();return false;}
			//switch (unescape(msg)){
//				case "commonUser":
//					//$("#b_Menu").show();
//					$(tagobj).load("/Html/Flag/5QSDKA058I17F5XK4COV.shtml","POST","");
//					//$(tagobj).load("/Html/Flag/5QSDKA058I17F5XK4COV.shtml",false);
//					break;
//				case "trainUser":
//					$(tagobj).load("/Html/Flag/2XX5D006089C6XI06173.shtml","POST","");
//					break;
//				case "schoolUser":
//					$(tagobj).load("/Html/Flag/560O3SR485TS567MGA36.shtml","POST","");
//					break;
//				  default:
//				  $("#msg_text").html(uLoginOutMsg);setTimeout("location.href='/login.shtml'",num_MsgTime);
//				  //不存在的会员类型直接踢出
//				  break;
//
//			}

			$(tagobj).html(unescape(msg));
			//$(tagobj).hide();
//			$(tagobj).html("");

			return true;

		},
		cache:true,
		error:function(msg){
			$(tagobj).html("");
			return false;
		},
		timeout:function(msg){

			$(tagobj).html("");
			return false;
		}
	});
}

function getnLearnTime(obj){
	var myDate=new Date()
	var myDateStr=myDate.getFullYear();
	var startyear=myDateStr-30;
	//var endyear=myDateStr+5
	for(var i=myDateStr;i>startyear;i--)
		{
			$("<option value=\""+i+"\">--"+i+" 届--</option>").appendTo(obj)//添加下拉框的option
//$("#select").empty();//清空下拉框//$("#select").html('');
		}
	}
function showRandCode(Codew,Codeh,Tag) {
	$.ajax({
		type: "POST",
		url: "/Param/?subaction=showRandCode&r="+Math.random(),
		data: "Codew="+encodeURIComponent(Codew)+"&Codeh="+encodeURIComponent(Codeh),
		beforeSend: function(XMLHttpRequest){
			$(Tag).html(Loadimg2+"&nbsp;&nbsp;loading..");
		},
		timeout: 50000,
        error: function(msg){
			$(Tag).html(failpic+"&nbsp;&nbsp;读取失败");
			return false;
			},
		success: function(msg){
			$(Tag).html("<img src=\""+unescape(msg)+"\" onclick=\"showRandCode('"+Codew+"','"+Codeh+"','"+Tag+"');\" alt=\"看不清楚？点击一下换一个\" style=\"cursor:pointer;\" class=\"picMiddle\" />");
			return true;
		}
	});
}
function checkRandCode(obj,obj2){
	var inputval = $(obj).val();
	if(jQuery.trim(inputval).length <1){
		$(obj2).attr("class","hint warning");
		$(obj2).html(failpic+"&nbsp;&nbsp;验证码不能空");
		return false;
		}
	else{
		$(obj2).attr("class","hint ok");
		$(obj2).html(truepic+"&nbsp;&nbsp;正确");
		return true;
		}
}
function getOperaPath(){
	var arrpath="";var opera_path
	var domainurl = document.location.href.match(/^http:\/\/(.+?)\//i)[0].toLowerCase();
	var file_path = document.location.href.substring(0,document.location.href.lastIndexOf("/")+1).toLowerCase();
	if(domainurl!=''&&file_path!=''){opera_path=file_path.replace(domainurl,'');arrpath=opera_path.split("/");}
	return arrpath[0];



}
function validatorUser(getType,obj){
	var p=getOperaPath();
	var postUrl;var dataStr;
	switch(getType){
		case "s":
			postUrl="/lib/buser/?subaction=validatoruser";
			dataStr="getType=s&p="+p;
			break;
		case "b":
			postUrl="/lib/buser/?subaction=validatoruser";
			dataStr="getType=b&p="+p;
			break;
		case "p":
			postUrl="/lib/buser/?subaction=validatoruser";
			dataStr="getType=p&p="+p;
			break;
		case "u":
			postUrl="/lib/user/common/?subaction=validatoruser";
			dataStr="getType=u&p="+p;
			break;
		}
	GetvalidatorUser(postUrl,dataStr,false,false,"#user_status")
	return true;
	}
function GetvalidatorUser(postUrl,dataStr,asyncTF,cacheTF,tagObj){
	//postUrl="/lib/buser/?subaction=validatoruser";
	$.ajax({
		type: "POST",
		url: postUrl+"&r="+Math.random(),
		data: dataStr,
		cache:false,
		async:false,
		timeout: 5000,
		success: function(msg){
			//alert(msg);
			if(unescape(msg)=='False'){location.href='/login.shtml';return false;}else if(unescape(msg)=='isb'){location.href='/buser';return false;}
			else if(unescape(msg)=='iss'){location.href='/school';return false;}
			else if(unescape(msg)=='ist'){location.href='/train';return false;}
			else if(unescape(msg)=='isp'){location.href='/partuser';return false;}
			else if(unescape(msg)=='isu'){location.href='/user';return false;}
			else if(unescape(msg)=='1'){$(tagObj).html('');return true;}
			else{$(tagObj).html('');return true;}
			},
        error: function(msg){//alert(msg);
		$(tagObj).html('');return false;}

	});
}
function ajxcomon(statePic,postUrl,postType,dataStr,asyncTF,tagObj,UserTF){
	$.ajax({
		type: postType,
		url: postUrl+"&r="+Math.random(),
		data: dataStr,
		cache:false,
		async:asyncTF,
		timeout: 5000,
		beforeSend: function(XMLHttpRequest){
			$(tagObj).html(statePic);
		},
        error: function(msg){$(tagObj).html('');return false;},
		success: function(msg){
			if(UserTF==1&&unescape(msg)=='False'){alert("请登录您的会员帐号");LoginForm();return false;}
			if(tagObj!='undefinded'&&tagObj!=''){$(tagObj).html(unescape(msg));return true;}else{return(unescape(msg));}
			}
	});
}
function ajaxcomon(statePic,postUrl,postType,dataStr,asyncTF,tagObj,tagType){
	$.ajax({
		type: postType,
		url: postUrl+"&r="+Math.random(),
		data: dataStr,
		cache:false,
		async:asyncTF,
		timeout: 5000,
        error: function(msg){return false;},
		success: function(msg){
			if(unescape(msg)=='False'){LoginForm();return false;}
			if($(tagObj).length>0){
				switch(tagType){
					case 0:
					$(tagObj).html(unescape(msg));break;
					case 1:
					$(tagObj).attr('value',unescape(msg));break;
					default:
					$(tagObj).html(unescape(msg));break;
				}
				return true;
			}
		}
	});
}
function userUpfile(usertype,filetype,ty,NewsID,tagname,tagtype){

	if(tagname==''||filetype==''){return false;}
	var posturl='user';
	if (usertype=='3'){posturl='buser';}
	$.ajax({
			type: "POST",
			url: "/Lib/"+posturl+"/common/?action=upfile&r="+Math.random(),
			data: "tagname="+escape(tagname)+"&filetype="+escape(filetype)+"&ty="+escape(ty)+"&NewsID="+escape(NewsID)+"&tagtype="+escape(tagtype),
			cache:false,
			async:false,
			timeout: 5000,
			error: function(msg){return false;},
			success: function(msg){
				if(unescape(msg)=='False'){LoginForm();return false;}
				if(unescape(msg)!=''){

					createlayer('',450,80);
					$('#out_Title').html('图片上传');
					$('#out_Main').html(unescape(msg));
					$('#out_Foot').html('文件类型：jpg|gif|jpeg为提高浏览速度,上传的图片请不要超过500K ');
					return true;
					}else{return false;}
			}
		});

}
function returnUpFilePath(errorNumber,val,ty,NewsID,tag,tagtype){

	var tmp = '';
	var tmp2 = '';
	switch ( errorNumber ) {
		case 0 :
			if(ty==''&&NewsID==''){
				$('#'+unescape(tag)).attr('value',unescape(val));
				if($('#Picview').length>0){$('#Picview').html('<img src="/Lib/?action=outputsmallpic&width=120&height=90&url='+val+'"/>');}

			}else{
				switch(ty){
					case 'course':case 'voucher':
						$('#trid_'+NewsID+' .viewpic').html('<div class="picbox"><img src="/Lib/?action=outputsmallpic&width=50&height=50&url='+unescape(val)+'"  style="display:block" /></div>\
	<div class="picbtn"><input name="bntok1" type="button"  value="删除图片" class="btn69" title="删除后可以重传" onclick="DelPic(\''+NewsID+'\',this)"/></div>');
						break;
					}
				}
			SysUI.AlertMsg(350,'<img src="/Images/Titpic/success.gif"/>上传成功!');
			break ;
		case 1 :
			alert('系统暂于未开放上传功能');closeActMsg();
			break ;
		case 10 :
			alert('不支持的文件格式');closeActMsg();
			break ;
		case 200 :
			alert('超出文件大小限制');closeActMsg();
			break ;
		case 202 :
			alert('不支持的文件格式！或者超出文件大小限制');closeActMsg();
			break ;
		case 321 :
			alert('请选择文件后再上传');closeActMsg();
			break ;
		case 203 :
			alert('您没有足够的权限上传文件，请检查服务器权限设置');closeActMsg();
			break ;
		default :
			alert('无法完成上传，错误代码: ' + errorNumber);closeActMsg();
			break ;
	}
}

function showRightMenu(e,uid,getType) {
	var posturl="";var t;
	if (getType=="1"){posturl="/lib/user/?subaction=GetBUserCallingCard";}else{posturl="/lib/buser/?subaction=GetUserCallingCard";}
	if($('#showRightMenuDiv').length==0){createDiv(e,'showRightMenuDiv','');}
	else {
		$("#showRightMenuDiv").show();
		if ((returnXY(e,'x') + document.getElementById('showRightMenuDiv').scrollWidth) > document.documentElement.scrollWidth)							 			{document.getElementById('showRightMenuDiv').style.left = (document.documentElement.scrollWidth - document.getElementById('showRightMenuDiv').scrollWidth) - 20 +'px';
		}
		else {document.getElementById('showRightMenuDiv').style.left = returnXY(e,'x') +'px';}
		if ((returnXY(e,'y') + document.getElementById('showRightMenuDiv').scrollHeight) > document.documentElement.scrollHeight) {document.getElementById('showRightMenuDiv').style.top = (document.documentElement.scrollHeight - document.getElementById('showRightMenuDiv').scrollHeight) - 20 +'px';}
		else {document.getElementById('showRightMenuDiv').style.top = (returnXY(e,'y') + 6) +'px';}
	}
	document.getElementById('showRightMenuDiv').style.opacity = 0.95;
	document.getElementById('showRightMenuDiv').style.filter = 'Alpha(opacity=95)';
	ajxcomon(Loadimg2+'正在获取名片信息，请稍后……',posturl,"POST","uid="+ uid,false,"#showRightMenuDiv",0);

	if($('#showRightMenuDiv').length>0){
		$("#showRightMenuDiv").hover(
		function(){clearTimeout(t);$("#showRightMenuDiv").show();	},
		function(){t=setTimeout(function(){closehelp('showRightMenuDiv');},1000);}
		);
	}
}
//获取四级联动下拉菜单的值
function getTradeVal(){
	var temp='';
	temp=$(arguments[3]).val();
	if(temp=='')temp=$(arguments[2]).val();
	if(temp=='')temp=$(arguments[1]).val();
	if(temp=='')temp=$(arguments[0]).val();
	return temp;
}
//获取行业选中的文本项
function getTradeTxt(){
	var temp='';
	temp=getTradeObjTxt(arguments[3]);
	if(temp=='')temp=getTradeObjTxt(arguments[2]);
	if(temp=='')temp=getTradeObjTxt(arguments[1]);
	if(temp=='')temp=getTradeObjTxt(arguments[0]);
	return temp;
}
//获取下拉框选中广本值，并去除开头字母+：号
function getTradeObjTxt(obj){
	var val='';
	if($(obj).length>0){val=$(obj+' option:selected').text();}
	if (val != null && val.length > 2 && val.match(/^(([A-Z.0-9]){1})+\:/)){var arrVal=val.split(":");return arrVal[1].split('(')[0];}else{return '';}
}

//获取四级联动下拉菜单的值
function getTagLastVal(){
	var temp='';
	temp=$(arguments[3]).val();
	if(temp==''||temp==undefined)temp=$(arguments[2]).val();
	if(temp==''||temp==undefined)temp=$(arguments[1]).val();
	if(temp==''||temp==undefined)temp=$(arguments[0]).val();
	return temp;
}
//获取行业选中的文本项
function getTagLastTxt(){
	var temp='';
	temp=FilterLetter(arguments[3]);
	if(temp==''||temp==undefined)temp=FilterLetter(arguments[2]);
	if(temp==''||temp==undefined)temp=FilterLetter(arguments[1]);
	if(temp==''||temp==undefined)temp=FilterLetter(arguments[0]);
	return temp;
}
//获取下拉框选中广本值，并去除开头字母+：号
function FilterLetter(obj){
	var val='';
	if($(obj).length>0){val=$(obj+' option:selected').text();}
	if (val != null && val.length > 2 && val.match(/^(([A-Z.0-9]){1})+\:/)){var arrVal=val.split(":");return arrVal[1].split('(')[0];}else{return '';}
}
function showHoverObj(nTag,nShowTag,n){
	var i=0;
	$('#'+nTag+' li').each(function(){
		var classname=n==i?"cur":"nor";
		$(this).attr('class',classname);
		i==n?$('#'+nShowTag+i).show():$('#'+nShowTag+i).hide();
		i++;
	});
}
//浮动层/////////////////////////////
function closeActMsg(lockID,newsID){
	if (typeof(lockID) == "undefined") lockID='FullScreenDiv';
	if (typeof(newsID) == "undefined") newsID='Msg_Info';
//	$('#'+ newsID).hide();
//	$('#'+ lockID).hide();
	if (document.getElementById(newsID)) document.body.removeChild(document.getElementById(newsID)); //edit by kcliao del div
	if (document.getElementById(lockID)) document.body.removeChild(document.getElementById(lockID));
	hiddenSelect('show');
	return true;
}

function createLockDiv(id){//edit by kcliao 2010/11/1 修正各个浏览器的兼容性
	hiddenSelect('hidden');
	if (!document.getElementById(id)) {
		var cDiv = document.createElement("div");
		cDiv.id = id;
		if (getOs() == 'IE 6') {
			cDiv.style.position = 'absolute';
			cDiv.style.width = '100%';
			var trueHeight = document.documentElement.scrollHeight;
			var cH = document.documentElement.clientHeight;
			if (trueHeight < cH) trueHeight = cH;
			cDiv.style.height = trueHeight +'px';
		}
		else {
			cDiv.style.position = 'fixed';
			cDiv.style.right = '0px';
			cDiv.style.bottom = '0px';
		}
		cDiv.style.left = '0px';
		cDiv.style.top = '0px';
		cDiv.style.zIndex = 8888;
		cDiv.style.backgroundColor = '#000000';
//		cDiv.style.opacity = 0.90;
//		cDiv.style.filter = 'Alpha(opacity=90)';
		
		document.body.appendChild(cDiv);
	}else {
		$('#'+id).show();
		if (getOs() == 'IE 6') {
			document.getElementById(id).style.width = '100%';
			document.getElementById(id).style.height = document.documentElement.scrollHeight +'px';
		}
	}
}

function createlayer(newsID,formWidth,AlphaNum,height){// edit by kcliao add height
	createLockDiv('FullScreenDiv');
	if(newsID==''||newsID==undefined)newsID="Msg_Info";
	if (AlphaNum==""){AlphaNum=80;}
	if (formWidth==""){formWidth=452;}
	if (!document.getElementById(newsID)){
		var cDiv = document.createElement("div");
		document.body.appendChild(cDiv);
		cDiv.id = newsID;
		cDiv.className = newsID;
		cDiv.style.position = 'absolute';
		cDiv.style.zIndex = 8888;
		cDiv.style.left = (document.documentElement.scrollWidth / 2 - 190) +'px';
		cDiv.style.backgroundColor = '#000';
	}else{$('#FullScreenDiv').show();document.getElementById(newsID).style.display = '';	}


	var tempTop='<div class="out_Top" id="out_Top" title="单击鼠标移动">\
				<div class="out_Title" id="out_Title">提示：</div>\
				<div class="out_Close" id="out_Close" onclick="javascript: closeActMsg(\'FullScreenDiv\',\''+newsID+'\');"></div>\
			  </div>';
	var tempMain=' <div class="out_Main" id="out_Main"></div>';
	var tempFoot='<div class="out_Foot" id="out_Foot">\
					<input name="bntok" type="button" id="bntok" value="确定" class="btn45"/>\
				  </div>';
	var tempAll='<div class="out_Div" id="out_Div">\
				<div class="out_Box">\
				'+tempTop+'\
				'+tempMain+'\
				'+tempFoot+'\
				 </div>\
			  </div>';
	document.getElementById(newsID).innerHTML = tempAll;
	document.getElementById('FullScreenDiv').style.opacity = AlphaNum/100;
	document.getElementById('FullScreenDiv').style.filter = 'Alpha(opacity='+AlphaNum+')';
	document.getElementById(newsID).style.position = 'absolute';
	document.getElementById(newsID).style.width=formWidth+'px';
	var floatdiv=document.getElementById(newsID);
	var range=getRange();
	floatdiv.ox=(range.width-formWidth)/2;
	floatdiv.oy=(range.height-200)/2;
	if (typeof(height) != "undefined") {
		document.getElementById('out_Main').style.height = height +"px";
		document.getElementById('out_Main').style.overflow = 'auto';
	}
	floatdiv.style.top=(range.top+floatdiv.oy) - 150 +"px";
	floatdiv.style.left=(range.left+floatdiv.ox) +"px";
	//托动

	//clearInterval(prox);
	var o = document.getElementById(newsID);
	o.style.display = "block";
//	o.style.opacity = 1;
//	o.style.filter = 'Alpha(opacity=100)';
//	prox = setInterval(function(){showlayer(newsID)},10);
	moveactive(newsID,formWidth,'out_Top','out_Foot');
	//end
	}

function createFormlayer(lockID,newsID,formWidth,AlphaNum,height){// edit by kcliao add height
	if(lockID==''||lockID==undefined)lockID="FullScreenDiv";
	if(newsID==''||newsID==undefined)newsID="Msg_Info";
	createLockDiv(lockID);
	if (AlphaNum==""){AlphaNum=80;}
	if (formWidth==""){formWidth=452;}
	if (!document.getElementById(newsID)){
		var cDiv = document.createElement("div");
		document.body.appendChild(cDiv);
		cDiv.id = newsID;
		cDiv.className = newsID;
		cDiv.style.position = 'absolute';
		cDiv.style.zIndex = 8888;
		cDiv.style.left = (document.documentElement.scrollWidth / 2 - 190) +'px';
		cDiv.style.backgroundColor = '#000';
	}else{$('#'+lockID).show();document.getElementById(newsID).style.display = '';	}


	var tempTop='<div class="out_Top" id="out_FormTop" title="单击鼠标移动">\
				<div class="out_Title" id="out_FormTitle">提示：</div>\
				<div class="out_Close" id="out_FormClose" onclick="javascript: closeActMsg(\''+lockID+'\',\''+newsID+'\');"></div>\
			  </div>';
	var tempMain=' <div class="out_Main" id="out_FormMain"></div>';
	var tempFoot='<div class="out_Foot" id="out_FormFoot">\
					<input name="bntok" type="button" id="bntok" value="确定" class="btn45"/>\
				  </div>';
	var tempAll='<div class="out_Div" id="out_FormDiv">\
				<div class="out_Box">\
				'+tempTop+'\
				'+tempMain+'\
				'+tempFoot+'\
				 </div>\
			  </div>';
	document.getElementById(newsID).innerHTML = tempAll;
	document.getElementById(lockID).style.opacity = AlphaNum/100;
	document.getElementById(lockID).style.filter = 'Alpha(opacity='+AlphaNum+')';
	document.getElementById(newsID).style.position = 'absolute';
	document.getElementById(newsID).style.width=formWidth+'px';
	var floatdiv=document.getElementById(newsID);
	var range=getRange();
	floatdiv.ox=(range.width-formWidth)/2;
	floatdiv.oy=(range.height-200)/2;
	if (typeof(height) != "undefined") {
		document.getElementById('out_FormMain').style.height = height +"px";
		document.getElementById('out_FormMain').style.overflow = 'auto';
	}
	floatdiv.style.top=(range.top+floatdiv.oy) - 150 +"px";
	floatdiv.style.left=(range.left+floatdiv.ox) +"px";
//	托动

//	clearInterval(prox);
	var o = document.getElementById(newsID);
	o.style.display = "block";
//	o.style.opacity = 1;
//	o.style.filter = 'Alpha(opacity=100)';
//	prox = setInterval(function(){showlayer(newsID)},10);
//	moveactive(newsID,formWidth,'out_FormTop','out_FormFoot');
	}
function showlayer(tagobj){
	var o= document.getElementById(tagobj);
	var opacityNum=parseInt($("#"+tagobj).css("opacity")*100);
	if(opacityNum<100){
		o.style.opacity =(opacityNum+25)/100;
		o.style.filter = 'Alpha(opacity='+(opacityNum+25)+')';

	}else{clearInterval(prox)}
}
/*-------------------------鼠标拖动---------------------*/
function moveactive(boxobj,formWidth,moveobj1,moveobj2){
	if($('#'+moveobj1).length>0)$('#'+moveobj1).css({"cursor":"move"});
	var od = document.getElementById(boxobj);
	var tod = document.getElementById(moveobj1);
	var bod = document.getElementById(moveobj2);
	var dx,dy,mx,my,mouseD;
	var odrag;
	var marclientW;
	var marclientH;
	var isIE = document.all ? true : false;
	document.onmousedown = function(e){
		var e = e ? e : event;
		if(e.button == (document.all ? 1 : 0)){mouseD = true; }
	}
	document.onmouseup = function(){
		mouseD = false;
		odrag = "";
		if(isIE){
			od.releaseCapture();
		}else{
		window.releaseEvents(od.MOUSEMOVE);
		}
	}
	//function readyMove(e){
	// 顶层托
	tod.onmousedown = function(e){
		odrag = this;
		var e = e ? e : event;
		if(e.button == (document.all ? 1 : 0)){
			mx = e.clientX;
			my = e.clientY;
			od.style.left = od.offsetLeft + "px";
			od.style.top = od.offsetTop + "px";
			if(isIE){
				od.setCapture();
			}else{
				window.captureEvents(Event.MOUSEMOVE);
			}
		}
	}
	//底层托
	bod.onmousedown = function(e){

		odrag = this;
		var e = e ? e : event;
		if(e.button == (document.all ? 1 : 0)){
			mx = e.clientX;
			my = e.clientY;
			od.style.left = od.offsetLeft + "px";
			od.style.top = od.offsetTop + "px";
			if(isIE){
				od.setCapture();
			}else{
				window.captureEvents(Event.MOUSEMOVE);
			}
		}
	}
	document.onmousemove = function(e){
		var marclientW= parseInt(document.documentElement.clientWidth-formWidth-20);
		var sh=document.documentElement.scrollHeight;
		var ch=document.documentElement.clientHeight
		var pageHeight=(sh-ch)>0?sh:ch;
		var marclientH=pageHeight-200;
		var e = e ? e : event;
		if(mouseD==true && odrag){
		var mrx = e.clientX - mx;
		var mry = e.clientY - my;
		var odw= parseInt(od.style.left) +mrx;
		var odh= parseInt(od.style.top) + mry
		odw=odw>marclientW?marclientW:odw;
		odw=odw<0?0:odw;
		odh=odh>marclientH?marclientH:odh;
		odh=odh<0?0:odh;
		od.style.left = odw + "px";
		od.style.top = odh + "px";
		mx = e.clientX;
		my = e.clientY;
		}
	}
}

function getRange() {
		var top     = document.documentElement.scrollTop;
		var left    = document.documentElement.scrollLeft;
		var height  = document.documentElement.clientHeight;
		var width   = document.documentElement.clientWidth;
      	if (top==0 && left==0 && height==0 && width==0) {
			top     = document.body.scrollTop;
			left    = document.body.scrollLeft;
			height  = document.body.clientHeight;
			width   = document.body.clientWidth;
     	 }
      return  {top:top  ,left:left ,height:height ,width:width };
}
function LoginForm(){
	createlayer('',500,80);
	$('#out_Main').html('');
	$(document).ready(function(){if($('#UserName').length>0||$('#UserPwd').length>0){location.href='/login.shtml';}});
	$('#out_Title').html('<span class="fontLarge">快捷登录窗口</span>');
	$('#out_Main').html('<div class="LockDiv" id="LockDiv" style="display:none;"></div><div id="FloatLogin" class="FloatLogin">\
	  <p>\
		<label for="UserName">账号：</label>\
		<input type="text" id="UserName" size="20" onblur="checkUserName();" onkeydown="javascript: if(event.keyCode == 13) document.getElementById(\'loginButton\').click();" class="logininput" /><span class="hint" id="UserName_info">企业账号 / 个人会员E-Mail / 会员卡卡号</span> </p>\
	  <p>\
		<label for="UserPwd">密码：</label>\
		<input type="password" id="UserPwd" size="20" onblur="checkPasswords();" onkeydown="javascript: if(event.keyCode == 13) document.getElementById(\'loginButton\').click();" class="logininput"/><span class="hint" id="password_info">请输入您的密码</span> </p>\
	  <p style="text-align:left; padding-left:35px;" class="displayNone" id="showcooksave">\
		<input type="checkbox" id="save" value="1" class="picMiddle" />\
	    <label for="save">保存登录状态，下次直接登录。</label>\
		<span class="hint"></span>\
	  </p>\
	  <p style="text-align:left; padding-left:30px;">\
		<input name="bntok" type="button" id="loginButton" value="登录" class="btn69" onclick="javascript: login(\'LockDiv\');$(this).blur();"/>\
		<input type="button" value="补发激活码" class="btn69" onclick="javascript: location.href = \'/login.shtml?act=getvcod\';$(this).blur();"/>\
		<input type="button"  value="找回密码" class="btn69" onclick="javascript: location.href = \'/login.shtml?act=findpwd\';$(this).blur();"/>\
	  </p>\
	  <p class="splitDiv"></p>\
	  <p class="textAlignCenter"> <a href="javascript:void(0)" onclick="FloatUserReg();"><img src="http://file.zgz93.com/Images/usereg.gif" /></a> <a href="javascript:void(0);" onclick="FloatBuserReg()"><img src="http://file.zgz93.com/Images/buserreg.gif" /></a> </p>\
	</div>');
	$('#out_Foot').hide();
	$('#UserName').focus();
	//FloatUserReg()
	}
//登录页面特订//
function checkUserName() {var input=$("#UserName").val();if(input==null||jQuery.trim(input)=="") {$("#UserName_info").attr("class","hint warning");	$("#UserName_info").html(failpic+"&nbsp;&nbsp;用户名不能为空");return false;}if(input.indexOf("@")!=-1) {$("#showcooksave").show();if(input.length>4&&input.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)) {$("#UserName_info").attr("class","hint ok");$("#UserName_info").html(truepic);	return true;}else {$("#showcooksave").hide();$("#UserName_info").attr("class","hint warning");$("#UserName_info").html(failpic+"&nbsp;&nbsp;您输入的用户名格式不符号！如果您是个人会员请输入您的E-MAIL；企业会员请输正常用户名（非邮箱）。");}	}else if(input.length>=8&&input.match(/^(913)|(2010)|(2012)|(2011)+([0-9]{4,7})+$/)) {$("#UserName_info").attr("class","hint ok");$("#UserName_info").html(truepic);return true;}else {$("#showcooksave").hide();	if(jQuery.trim(input).length<4||jQuery.trim(input).length>20) {$("#UserName_info").attr("class","hint warning");$("#UserName_info").html(failpic+"&nbsp;&nbsp;对不起,您的企业会员号格式不正确");	return false;}else {$("#UserName_info").attr("class","hint ok");$("#UserName_info").html(truepic);return true;}}}
function getUserType(){var tempstr="0";var input = $("#UserName").val();if (input==null || jQuery.trim(input)==""){$("#UserName_info").attr("class","hint warning");$("#UserName_info").html(failpic+"&nbsp;&nbsp;用户名不能为空");return false;}if (input.length > 4 && input.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){$("#showcooksave").show();tempstr="2";$("#UserName_info").html(truepic +" 正确");}else if(input.length >=8&& input.match(/^((913)|(2010)|(2011)|(2012))+([0-9]{1,7})+$/)){tempstr="4";$("#UserName_info").html(truepic +" 正确");}else{$("#save").hide();tempstr="3";}return tempstr;}

function checkPasswords() {	var input1=$('#UserPwd');if(input1.val().length<6||input1.val().length>16) {$("#password_info").attr("class","hint warning");$("#password_info").html(failpic+"&nbsp;&nbsp;密码请使用6-16个字符");return false;}else{$("#password_info").attr("class","hint ok");$("#password_info").html(truepic);}return true;}
//end//




//浮动层结束

// 获取积分提示文字
// 8.27 lanlan
// score:积分,type:1[增加] 0[减少] 默认为1
function getScoreTip(score, type){
	if(score == "0" || isNaN(score)) return "";
	var scoreTip = "";
	type = type == null && 1;

	if(type) scoreTip = '获得<span style="color:green;font-weight:bold;"> '+score +' </span>积分';
	else scoreTip = '失去<span style="color:red;font-weight:bold;"> '+/\d+/.exec(score)+' </span>积分';
	return scoreTip;
}

//$(function () {
//    createlayer('', 400, 85);
//    $('#out_Main').html('<div>海都招聘网于5:30至6:30维护数据库，期间可能无法正常访问站点，对此给您带来的不便深感歉意。</div>');
//    $("#bntok").click(closeActMsg);
//});

//eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) { d[e(c)] = k[c] || e(c) } k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) { if (k[c]) { p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]) } } return p } ('D J(7){3 5="f";3 e="((.|"+(I H=="G"?"\\\\r":"")+"\\\\n)*?)";3 8=y v("<!--"+5+"\\\\w-->"+e+"<!--"+5+"\\\\q-->").h(p.u.z);9(8){3 4=8[1];5="a";3 m=y v("<!--"+5+"\\\\w-->"+e+"<!--"+5+"\\\\q-->").h(4);9(m){3 o=/({|%B)\\s*f\\..*?\\s*(}|%A)/g;3 C=/({|%B)\\s*f\\.(.*?)\\s*(}|%A)/;3 a=m[1];3 6;3 x=D(b){F(3 i=0;i<6.d;i++){3 k=6[i];3 E=C.h(k)[2];3 j=l[E];9(j!=K)b=b.c(k,N(j))}M b};4=4.c(m[1],"");6=4.8(o);9(6){3 l=7.d?7[0]:7;4=x(4)}6=a.8(o);9(6){3 t="";3 L=[];F(3 i=0;i<7.d;i++){l=7[i];t+=x(a)};4=4.c(y v("<!--"+5+"\\\\w--><!--"+5+"\\\\q-->"),t)}p.u.z=p.u.z.c(8[0],4)}}}', 50, 50, '|||var|module|comment|jsonExpArrs|json|match|if|loop|str|replace|length|next|template||exec||data|jsonExp|jsonObj|||jsonReg|document|send|||loopHTML|body|RegExp|sstart|replaceFn|new|innerHTML|7D|7B|jsonAttrReg|function|attr|for|object|opera|typeof|fillData|null|attrArrs|return|unescape'.split('|'), 0, {}));
//eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('D I(7,c){3 5="y";3 h="((.|"+(H K=="F"?"\\\\r":"")+"\\\\n)*?)";3 8=x v("<!--"+5+"\\\\u-->"+h+"<!--"+5+"\\\\p-->").f($(c).q());9(8){3 4=8[1];5="a";3 m=x v("<!--"+5+"\\\\u-->"+h+"<!--"+5+"\\\\p-->").f(4);9(m){3 l=/({|%A)\\s*y\\..*?\\s*(}|%C)/g;3 B=/({|%A)\\s*y\\.(.*?)\\s*(}|%C)/;3 a=m[1];3 6;3 w=D(d){E(3 i=0;i<6.k;i++){3 e=6[i];3 z=B.f(e)[2];3 j=o[z];9(j!=J)d=d.b(e,L(j))}M d};4=4.b(m[1],"");6=4.8(l);9(6){3 o=7.k?7[0]:7;4=w(4)}6=a.8(l);9(6){3 t="";3 G=[];E(3 i=0;i<7.k;i++){o=7[i];t+=w(a)};4=4.b(x v("<!--"+5+"\\\\u--><!--"+5+"\\\\p-->"),t)}$(c).q($(c).q().b(8[0],4))}}}',49,49,'|||var|module|comment|jsonExpArrs|json|match|if|loop|replace|tag|str|jsonExp|exec||next||data|length|jsonReg|||jsonObj|send|html|||loopHTML|sstart|RegExp|replaceFn|new|template|attr|7B|jsonAttrReg|7D|function|for|object|attrArrs|typeof|replaceTemp|null|opera|unescape|return'.split('|'),0,{}))

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('D K(5,b){6(5==\'\'&&5==\'0\')F H;3 7="k";3 q="((.|"+(J G=="I"?"\\\\r":"")+"\\\\n)*?)";3 9=x l("<!--"+7+"\\\\u-->"+q+"<!--"+7+"\\\\j-->").p($(b).w());6(9){3 4=9[1];7="f";3 a=x l("<!--"+7+"\\\\u-->"+q+"<!--"+7+"\\\\j-->").p(4);6(4){3 t=/({|%B)\\s*k\\..*?\\s*(}|%A)/g;3 z=/({|%B)\\s*k\\.(.*?)\\s*(}|%A)/;3 8;3 v=D(e,d){E(3 i=0;i<8.y;i++){3 m=8[i];3 C=z.p(m)[2];3 h=d[C];6(h==L)h=\'\';e=e.c(m,M(h))}F e};6(a)4=4.c(a[1],"");8=4.9(t);6(8){3 d=5.y?5[0]:5;4=v(4,d)}6(a){3 f=a[1];8=f.9(t);6(8){3 o="";3 N=[];E(3 i=0;i<5.y;i++){o+=v(f,5[i])}4=4.c(x l("<!--"+7+"\\\\u--><!--"+7+"\\\\j-->"),o)}}$(b).w($(b).w().c(9[0],4))}}}',50,50,'|||var|tempMatch|json|if|comment|jsonExpArrs|match|loopMatch|tag|replace|jsonObj|str|loop||data||send|template|RegExp|jsonExp||loopHTML|exec|next|||jsonReg|sstart|replaceFn|html|new|length|jsonAttrReg|7D|7B|attr|function|for|return|opera|false|object|typeof|replaceTemp|null|unescape|attrArrs'.split('|'),0,{}))
//企业快捷注册
function FloatBuserReg(){
	showframebox('aaaa','bbbb',990,80,400,'/Recruitment/Form/BuserReg.shtml','企业会员快捷注册');
}
function FloatUserReg(){

	showframebox('aaaa','bbbb',990,80,400,'/Recruitment/Form/userReg.shtml','个人会员快捷注册');
}
//电子地图调用函数
/*address:地图地址，tips：建筑代表名称或公司名称,option:可缺省*/
function showMap(address,tips,option){
	var op={
		width:990,
		height:400,
		Alpha:80,
		title:unescape(tips)+'所在地图位置'
	}
	$.extend(op,option);
	showframebox('gMapLock','gMapMain',op.width,op.Alpha,op.height,'/Recruitment/Form/Map_View.shtml?adr='+address+'&tit='+tips,op.title)
}

function FloatLoading(lockobj,tagobj,statePic,txtcont){
	createFormlayer(lockobj,tagobj,350,80)
	$('#out_FormMain').html('<div align=center>'+statePic+'&nbsp;&nbsp;&nbsp;'+txtcont+'</div>');
	$('#out_FormFoot').hide();
	$('#out_FormTop').hide();
	}
	
function showframebox(lockid,newsid,width,AlphaNum,height,page,title){

	createFormlayer(lockid,newsid,width,AlphaNum);
	$('#out_FormTitle').html(title);
	$('#out_FormMain').html('');
	$('#out_FormFoot').hide();
	var cElement
	try{
		 cElement = document.createElement('<iframe name="passportFrame1" width="100%" frameborder="0" class="framePage" id="passportFrame1" style="width:98%; height:'+height+'px; border:0px;"></iframe>');
		 document.getElementById("out_FormMain").appendChild(cElement)
	}
	catch(e){
		cElement = document.createElement('iframe');
		cElement.name = 'abc';
		cElement.id = 'abc';
		cElement.className = "framePage";
		cElement.style.width='100%';
		cElement.style.height=height+'px';
		cElement.style.border='0px';
		 document.getElementById("out_FormMain").appendChild(cElement)
	 }
	 cElement.src = page;

	}
	
//HR投票
function get_vote(uid,tag){
	if ($('#'+tag).length>0){xmlHttpPost(true,'','/Lib/special/?subaction=hrvote_1207','uid='+ uid,0,0,tag);}
}
function user_vote(uid,tag){
	ui.NewLayer('',400,80);
	var temp='<p style="padding-left:30px 0px 30px 50px;"><input name="RandCode" type="text" class="input" id="RandCode" style="width:50px" onblur="checkRandCode(this,\'#RandCode_Tip\');"/>\
			 <span class="hint" id="RandCode_info" title="看不清换一张">*</span><br><span class="hint" id="RandCode_Tip">*如无法看清，请点击图片重新获取</span></p>'
	$('#out_Main').html(temp);
	$('#out_Title').html('请输入验证码');
	$('#out_Foot').html('<input name="bntok" type="button" id="bntok" value="点击投票" class="btn69" onclick="save_vote(\''+uid+'\',\''+tag+'\');"/>');
	$("#RandCode_info").html(Loadimg2);setTimeout(function(){ showRandCode(100,30,"#RandCode_info"); },50);
}
function save_vote(uid,tag){
	//
	clearTimeout(vote_tt);
	if(checkRandCode('#RandCode','#RandCode_Tip')&&uid!=''){
		//提交开始
		var	dataStr='RandCode='+escape(getObjValue("#RandCode"))+'&up=1&uid='+uid;
		vote_tt=setTimeout(function(){$.ajax({
			type: "POST",
			url: "/Lib/special/?subaction=hrvote_1207&r="+Math.random(),
			data: dataStr,
			success: function(msg){
				switch(unescape(msg)){
					case "code_past":
						alert("验证码过期请刷新重试");
						$("#RandCode_info").html(Loadimg2);setTimeout(function(){ showRandCode(100,30,"#RandCode_info"); },50);
						break;
					case "code_err":
						alert("验证码错误");
						$("#RandCode_info").html(Loadimg2);setTimeout(function(){ showRandCode(100,30,"#RandCode_info"); },50);
						break;
					case "nostart":
						ui.ErrMsg("投票尚未开始，敬请期待！");
						break;
					case "voteend":
						ui.ErrMsg("投票已截止！");
						break;
					default:
						$('#'+tag).html(unescape(msg));closeActMsg();
						break;
				}
			},
			error:function(msg){
				closeActMsg();
			},
			timeout:function(msg){
				closeActMsg();
			}
		})},1000);
		//end
	}else{
	//code err
		alert("验证码错误");
		$("#RandCode_info").html(Loadimg2);setTimeout(function(){showRandCode(100,30,"#RandCode_info"); },50);
	//end
	}
}
//HR投票END

Date.prototype.format = function(style) {
	var o = {
		"M+" : this.getMonth() + 1, //month
		"d+" : this.getDate(),      //day
		"h+" : this.getHours(),     //hour
		"m+" : this.getMinutes(),   //minute
		"s+" : this.getSeconds(),   //second
		"w+" : "天一二三四五六".charAt(this.getDay()),   //week
		"q+" : Math.floor((this.getMonth() + 3) / 3),  //quarter
		"S"  : this.getMilliseconds() //millisecond
	}
	if(/(y+)/.test(style)) {
		style = style.replace(RegExp.$1,
		(this.getFullYear() + "").substr(4 - RegExp.$1.length));
	}
	for(var k in o){
		if(new RegExp("("+ k +")").test(style)){
			style = style.replace(RegExp.$1,
			RegExp.$1.length == 1 ? o[k] :
			("00" + o[k]).substr(("" + o[k]).length));
		}
	}
	return style;
};

//会员菜单控制
function userMenu(){
	$(function(){
		//隐藏按钮
		$('#userMenu dt span').click(function(){
			$(this).css({"cursor":"pointer"});
			var pobj=$(this).parent().parent();
			if(pobj.attr('class')!='hide'){
				pobj.find('dd').hide();
				pobj.attr('class','hide');
				}else{
				pobj.find('dd').show();
				pobj.attr('class','oncur');
			}
		});
	});
}
//会员通用栏目
var menu_tt;
function getUserTop(tagObj){
	clearTimeout(vote_tt);
	var p=getOperaPath();
	vote_tt=setTimeout(function(){$.ajax({
		type: "POST",
		url: "/Lib/user/common/?action=usergobal&r="+Math.random(),
		data: dataStr="getType=u&p="+p,
		cache:false,
		async:false,
		timeout: 5000,
		success: function(msg){
			if(unescape(msg)=='False'){location.href='/login.shtml';return false;}else if(unescape(msg)=='isb'){location.href='/buser';return false;}
			var udata=(new Function("return [" + msg + "]"))();
			var path=unescape(udata[0].nValidator);
			if(path=='iss'){location.href='/school';return false;}
			else if(path=='ist'){location.href='/train';return false;}
			else if(path=='isp'){location.href='/partuser';return false;}
			else if(path=='isu'){location.href='/user';return false;}
			else if(path=='1'){
				if($('#userbaseInfo').length>0){$(tagObj).hide();return false;}
				$(tagObj).html('<ul>\
					  <li class="userName">'+unescape(udata[0].nRealName)+'<span>&lt;'+unescape(udata[0].nEmail)+'&gt;</span></li>\
					  <li class="secNav"><a href="/user/">返回会员首页</a><a href="/user/Basic/Primary.shtml">基本资料</a><a href="/user/resumer">个人简历</a><a href="/user/resumer/RsmAppliedLog.shtml">投递记录</a><a href="/user/message/">留言</a></li>\
				   </ul>\
				  <a href="/user/basic/headphoto.shtml" rel="external"> <img src="/Lib/?action=outputsmallpic&width=100&height=100&url='+unescape(udata[0].nHeadPhoto)+'" class="headImg"/></a>');
				return true;}
			},
        error: function(msg){//alert(msg);
		$(tagObj).html('');return false;}
	})},200);
}

function getBuserTop(tagObj){
	clearTimeout(vote_tt);
	var p=getOperaPath();var userpath="/buser";	var nGroupID='0';var typecss='';var certtemp;var countlink='';var basiclink='';
	vote_tt=setTimeout(function(){$.ajax({
		type: "POST",
		url: "/Lib/buser/common/?action=busergobal&r="+Math.random(),
		data: dataStr="getType=u&p="+p,
		cache:false,
		async:false,
		timeout: 5000,
		success: function(msg){
			if(unescape(msg)=='False'){location.href='/login.shtml';return false;}else if(unescape(msg)=='isb'){location.href='/buser';return false;}
			var udata=(new Function("return [" + msg + "]"))();
			var path=unescape(udata[0].nValidator);
			if(path=='iss'){location.href='/school';return false;}
			else if(path=='ist'){location.href='/train';return false;}
			else if(path=='isp'){location.href='/partuser';return false;}
			else if(path=='isu'){location.href='/user';return false;}
			else if(path=='1'){
				if($(tagObj).length=0){return false;}
				nGroupID=udata[0].nGroupID;
				countlink='共收到简历[<a href="'+userpath+'/Apply/ApplyNews.shtml" >'+udata[0].CountData[0].RsmAllCount+'</a>]； 未查看简历[<a href="'+userpath+'/Apply/ApplyNews.shtml" >'+udata[0].CountData[0].RsmNewCount+'</a>]； 正在招聘职位[<a href="'+userpath+'/Apply/" >'+udata[0].CountData[0].JobIngCount+'</a>]； 留言[<a href="'+userpath+'/message" >'+udata[0].CountData[0].MsgNewCount+'</a>]';
				basiclink='<a href="'+userpath+'">返回会员首页</a><a href="'+userpath+'/Basic/Primary.shtml">基本资料</a><a href="'+userpath+'/Apply/">发布职位</a><a href="'+userpath+'/Apply/ApplyNews.shtml">投简查收</a><a href="http://zph.zgz93.com" target="_blank" class="reclink">网络招聘会</a>';
				switch(nGroupID){
					case "0":
						userpath="/buser";
						typecss='company'
						break;
					case "183L122K3MF9628E5KU0":
						userpath="/school";
						typecss='school'
						countlink='申请加入学生[<a href="'+userpath+'/apply/StudentRsm.shtml" >'+udata[0].CountData[0].StudentCount+'</a>]；';
						basiclink='<a href="'+userpath+'">返回会员首页</a><a href="'+userpath+'/Basic/Primary.shtml">基本资料</a><a href="'+userpath+'/Apply/">发布职位</a><a href="'+userpath+'/Apply/ApplyNews.shtml">投简查收</a><a href="http://zph.zgz93.com" target="_blank" class="reclink">网络招聘会</a>';
						break;
					case "E6YP3K7QZCHR8FG85SFF":
						userpath="/train";
						typecss='train'
						countlink='共发布课程[<a href="'+userpath+'/course" >'+udata[0].CountData[0].CourseCount+'</a>]； 正在招生的课程有[<a href="'+userpath+'/course" >'+udata[0].CountData[0].nCourseUnLockCount+'</a>]； 报名人数[<a href="'+userpath+'/course/userapply.shtml" >'+udata[0].CountData[0].CourseApplyCount+'</a>]； 留言[<a href="'+userpath+'/message" >'+udata[0].CountData[0].MsgNewCount+'</a>]';
						basiclink='<a href="'+userpath+'">返回会员首页</a><a href="'+userpath+'/Basic/Primary.shtml">基本资料</a><a href="'+userpath+'/course/">课程管理</a><a href="'+userpath+'/couser/course/CourseEdit.shtml?actstr=add">添加课程</a>';
						break;
					case "64P0S5763E0DV45I1845":
						userpath="/partuser";
						typecss='partuser'
						countlink='共收到简历[<a href="'+userpath+'/Apply/ApplyNews.shtml" >'+udata[0].CountData[0].RsmAllCount+'</a>]； 未查看简历[<a href="'+userpath+'/Apply/ApplyNews.shtml" >'+udata[0].CountData[0].RsmNewCount+'</a>]； 正在招聘职位[<a href="'+userpath+'/Apply/" >'+udata[0].CountData[0].JobIngCount+'</a>]； 留言[<a href="'+userpath+'/message" >'+udata[0].CountData[0].MsgNewCount+'</a>]';
				basiclink='<a href="'+userpath+'">返回会员首页</a><a href="'+userpath+'/Basic/Primary.shtml">基本资料</a><a href="'+userpath+'/Apply/">发布职位</a><a href="'+userpath+'/Apply/ApplyNews.shtml">投简查收</a><a href="http://zph.zgz93.com" target="_blank" class="reclink">网络招聘会</a>';
						break;
					
					}
				if(udata[0].IsUpCert!='1'){certtemp='<span class="nolicense"><a href="'+userpath+'/Basic/photoup.shtml">未上传</a></span>';}else{certtemp='<span class="license"><a href="'+userpath+'/Basic/photoup.shtml">已上传</a></span>';}
				temp='<div class="memberInfoBlock">\
						<ul>\
						  <li class="userName">'+unescape(udata[0].nCompanyName)+' </li>\
						  <li class="secNav">'+basiclink+'</li>\
						  <li class="lastTime">上一次登录时间为：'+unescape(udata[0].nLoginLastTime)+'</li>\
						  <li class="approveInfo">\
						  	<span>账户类型:</span><span class="'+typecss+'"></span><span>营业执照:</span>'+certtemp+'\
							<div class="parameter">'+countlink+'</div>\
						  </li>\
						</ul>\
					  </div>';
				$(tagObj).html(temp);
				return true;}
			},
        error: function(msg){$(tagObj).html('');return false;}
	})},200);
}
//简约留言框
function showMsgForm(utype,sendType,nSendUserID){
	if (sendType==''||sendType==undefined)return false;
	if (nSendUserID==''||nSendUserID==undefined)return false;
	temp='<div class="LayerForm">\
	  <form id="form1" name="form1" method="post" action=""><input name="NewsID" type="hidden" id="NewsID" value="" /><input name="SumbitType" type="hidden" id="SumbitType" value="add" /><input name="nIsSend" type="hidden" id="nIsSend" value="1" />\
		<ul>\
		<li><label for="nSendUserID">收件人：</label>\
		  <span id="nRecevie_Name"></span> <span class="hint" id="nSendUserID_info">*</span>\
		  <input name="nSendUserID" type="hidden" id="nSendUserID" value="" /></li>\
		<li><label for="nSubTitle"><span class="warning" >*</span>主题：</label>\
		  <input name="nSubTitle" type="text" class="input" id="nSubTitle"   onblur="checkComTxt(\'#nSubTitle\',\'#nSubTitle_info\',2,50,\'留言主题\');" maxlength="50" style="width:70%"/><span class="hint" id="nSubTitle_info">*</span> </li>\
		<li><label for="nCont"><span class="warning" >*</span>内容：</label>\
		  <textarea name="nCont" cols="40" rows="6" class="textarea" id="nCont" onBlur="checkComTxt(\'#nCont\',\'#nCont_info\',2,500,\'留言内容\');"></textarea></li>\
		<li><label >&nbsp;</label>\
		  <span class="hint" id="nCont_info">内容不能超过500个字</span> </li>\
		  </ul>\
	  </form>\
	</div>';
	SysUI.NewLayer('',500,80);
	$('#out_Main').html(temp);
	$('#out_Title').html('发表/回复留言');
	$('#out_Foot').html('<input name="bntok" type="button" id="bntok" value="确认发送" class="btn69" onclick="UserSendMsg(\''+utype+'\',\''+sendType+'\');"/><input name="bntok" type="button" id="bntok" value="取消关闭" class="btn69" onclick="closeActMsg();"/>');
	$("#nSendUserID").attr("value",nSendUserID);$("#SumbitType").attr("value","add");
	new Model().AjaxComon('getRealName','/param/?subaction=getRealName','ReadGo=ok&getType='+sendType+'&NewsID='+nSendUserID,'#nRecevie_Name');
	
}
function checkMsgsumbit(){
	if(checkComTxt('#nSubTitle','#nSubTitle_info',2,50,'留言主题')&&checkComTxt('#nCont','#nCont_info',2,500,'留言内容')){
		return true;
	}else{
		return false;
	}
}
function UserSendMsg(utype,sendType){
	if(checkMsgsumbit()){
		var actionTitle="回复";
		if(getObjValue("#SumbitType")=='edit'){
			actionTitle="发送";
			if (!confirm('您确定要发送吗？'))return false;
		}
		var dataStr="";
		$("#nIsSend").attr("value",1);
		dataStr=model.GetTagVal('nSendUserID','nSubTitle','nCont','NewsID','SumbitType','nIsSend')+'&getType='+sendType;
		SysUI.LoadMsg(Loadimg3,"正在发送");
		var postUrl='/Lib/buser/message/?action=addMessage';
		if (utype=='2')postUrl='/Lib/user/message/?action=addMessage';
		//new Model().Insert("addMessage","/Lib/buser/message/?action=addMessage",dataStr,"index.shtml","留言",actionTitle,2,"#formMain");
		//return true;
		clearTimeout(vote_tt);
		vote_tt=setTimeout(function(){$.ajax({
			type: "POST",
			url: postUrl+"&r="+Math.random(),
			data: dataStr,
			success: function(msg){
				switch(unescape(msg)){
					case "err_nulluser":
						SysUI.ErrMsg("收件人不存在，或被锁定");
						break;
					case "msg_saveok":
						SysUI.AlertMsg(350,"草稿箱保存成功");
						break;
					case "msg_sendok":
						SysUI.AlertMsg(350,'<img src="http://file.zgz93.com/Images/Titpic/success.gif">&nbsp;&nbsp;&nbsp;发送成功');
						break;	
					default:
						SysUI.ErrMsg("发送失败");
						break;
				}
			},
			error:function(msg){
				closeActMsg();
			},
			timeout:function(msg){
				closeActMsg();
			}
		})},200);		
	}
	else{SysUI.ErrMsg("发送失败");return false;}
}
function showVoucherDownNum(nVoucherID,tag){
	if(nVoucherID!=''){ new Model().AjaxComon('vdlnum','/Lib/coop/?action=vdlnum','ReadGo=ok&vid='+nVoucherID,tag);}
	}


