String.prototype.klength = function() {var cArr = this.match(/[^\x00-\xff]/ig);return this.length + (cArr == null ? 0 : cArr.length);};String.prototype.trim = function (){var t = this.replace(/(^\s*)|(\s*$)/g, "");    return t.replace(/(^　*)|(　*$)/g, "");};function fnGetFck(i){var oEditor = FCKeditorAPI.GetInstance("content");$("#fckcont").attr("value", oEditor.GetXHTML(true));}function fnReferer(url) {function R() {window.location.href = url;}setTimeout(R, 1000);}function showMsg(msg, color, id) {$('#'+id).show();$('#'+id).css('color', color);$('#'+id).html('<strong>系统提示：</strong>'+ msg +'...');function H() {$('#'+id).hide();}setTimeout(H, 10000);}function fnIsDate(str){var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); if(r == null)return false; var d= new Date(r[1], r[3]-1, r[4]); return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]);}document.write("<div id=\"info\" style=\"z-index:10; position:absolute; display:none;\"><span style=\"background:url(/images/tip.gif) no-repeat; height:50px;background-position:0 0; width:45px; float:left;\"></span><p style=\"background:url(/images/tip.gif) no-repeat; height:50px; background-position:0 -50px; background-repeat:repeat-x;float:left; display:inline; margin:0; padding:10px 18px;font-family:'微软雅黑','黑体'; font-size:20px;letter-spacing:1px;color:#811e08;\"></p><span style=\"background:url(/images/tip.gif) no-repeat; height:50px;background-position:-45px 0; width:5px; float: left;\"></span></div>");function fnShowMsg(txt, time, url) {time = time*1000;$('#info').show('fast');$('#info p').html(txt);$('#info').css('top', document.documentElement.scrollTop+100);$('#info').css('left', document.documentElement.offsetWidth/3);if (url != '') {setTimeout("$('#info').hide('fast');window.location.href='"+url+"';", time);}else {setTimeout("$('#info').hide('fast')", time);}}function spChar(value){var str = value.split("_");return str[str.length-1];}function fnIsOrderid(value) {var rules = /^\d{1,3}$/i;if (!rules.test(value) || value > 255) {$('#orderid').val('255');}}function fnIsNum(id, value) {var rules = /^\d{1,5}$/i;if (!rules.test(value)) {$('#'+id).val('');}}function fnGetInen(id) {var iden = $('#'+id).val().trim();$.ajax({type: 'POST',url: 'ajax/getiden.php',data: 'iden='+iden,dataType: 'json',success: function(data) {if (data['success']) {$('#iden').val(data['iden']);}}});}function fnLeave() {if (confirm('内容可能没有保存，确定离开该页面？')) {window.history.go(-1);}}function fnNetError(id) {showMsg('网络繁忙，请稍后再试', 'red', id);}function fnBfSend(id) {showMsg('数据处理中，请稍后', 'green', id);}function fnOpenUpload(id, ftype, catDir) { window.open('/upload.php?ipnID='+id+'&ftype='+ftype+'&catDir='+catDir,'uploadWindow','width=530, height=130, top=193, left=205, toolbar=0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');}function fnOpenUpload2(id, ftype, catDir) { window.open('/upload2.php?ipnID='+id+'&ftype='+ftype+'&catDir='+catDir,'uploadWindow','width=530, height=130, top=193, left=205, toolbar=0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');}function copyToClipBoard(content){var clipBoardContent = ''; clipBoardContent = content;window.clipboardData.setData("Text",clipBoardContent);fnShowMsg('成功复制到您的剪贴板', 3, '');}function fnExtend(id) {if ($('#jjinfo_a_'+id).text() == '查看更多..') {$('#bjjinfo_'+id).toggleClass('info_all');$('#jjinfo_a_'+id).text('收起..');}else {$('#bjjinfo_'+id).toggleClass('info_all');$('#jjinfo_a_'+id).text('查看更多..');}}function fnInsertInfo() {var name = $('#name').val();var tel = $('#tel').val();var qq = $('#qq').val();var email = $('#email').val();var from = $('#from').val();var content = $('#content').val();var course = $('#course').val();if (name == '') {fnShowMsg('请填写姓名', 3, ''); $('#name').focus(); return false;}if (tel == '') {fnShowMsg('请填写电话', 3, ''); $('#name').focus(); return false;}if (qq == '') {fnShowMsg('请填写QQ', 3, ''); $('#name').focus(); return false;}if (email == '') {fnShowMsg('请填写邮箱', 3, ''); $('#name').focus(); return false;}if(content == '' || content == '1.免费试听为您量身安排的培训课程      2.获得FLASH源码、网页设计素材一份     3.定期免费参加FLASH路上公开课.        请详细留下您的信息以便我们联系'){fnShowMsg('请填写留言信息', 3, ''); $('#content').focus(); return false;}if(course != null){name = name + '-' + course;}$.post('ajaxApply.php', {name:name,tel:tel,qq:qq,email:email,from:from,content:content}, function(data){fnShowMsg(data['msg'], 3, '');if(data.success){document.getElementById('myform').reset();}},"json");}function fnMemberReg() {var type = $('#type').val().trim();var username = $('#nickName').val().trim();var passwd = $('#password').val().trim();var cfpasswd = $('#cpassword').val().trim();var email = $('#txtemail').val().trim();var sex = $('#sex').val().trim();var qq = $('#qq').val().trim();var province = $('#province').val().trim();var city = $('#city').val().trim();var ss = $('#ss').val().trim();var code = $('#validatecode').val().trim();if (!type.klength()) {showMsg('请选择您要注册的会员类型', 'red', 'error'); $('#btnSubmit').attr('disabled', ''); return false;}if (!ss.klength()) {showMsg('请选择您是如何得知FLASH路上的', 'red', 'error'); $('#btnSubmit').attr('disabled', ''); return false;}$.ajax({type: 'POST',url: 'ajaxMemberReg.php',data: 'username='+username+'&passwd='+passwd+'&code='+code+'&type='+type+'&cfpasswd='+cfpasswd+'&email='+email+'&sex='+sex+'&qq='+qq+'&province='+province+'&city='+city+'&ss='+ss,dataType: 'json',beforeSend: function() {showMsg('数据处理中，请稍后', 'green', 'error');},success: function(data) {if (data['shenhe']) {$('#btnSubmit').attr('disabled', 'disabled');fnShowMsg(data['msg'], 5, '../index.php');}else if (data['success']) {$('#btnSubmit').attr('disabled', 'disabled');showMsg(data['msg'], 'green', 'error');fnReferer('index.php');}else if (data['error'] != '') {$('#btnSubmit').attr('disabled', '');showMsg(data['msg'], 'red', 'error');}else {$('#btnSubmit').attr('disabled', '');fnNetError('error');}}});}function fnMemberLogin(refererUrl) {var username = $('#username').val().trim();var passwd = $('#passwd').val().trim();if (!username.klength()) {fnShowMsg('请填写用户名！', 3, ''); $('#username').focus(); return false;}if (!passwd.klength()) {fnShowMsg('请填写密码！', 3, ''); $('#passwd').focus(); return false;}$.post('/member/ajaxMember.php', {action:'login', username:username, passwd:passwd}, function(data){if(data['success']) {window.location.href = refererUrl;}else {fnShowMsg(data['msg'], 3, '');}},'json')}function fnMemberLogout(refererUrl) {if (window.confirm('确定注销登录？')) {$.post('/member/ajaxMember.php', {action:'logout'}, function(data){if(data['success']){window.location.href=refererUrl}}, 'json')}}function fnMemberInfo(mid) {var image = $('#imgfile').val().trim();var truename = $('#truename').val().trim();var iftruename = $('#iftruename').attr('checked') ? 1 : 0;var sex = $('#sex').val().trim();var mingzu = $('#mingzu').val().trim();var age = $('#agex').val().trim();var zhiye = $('#zhiye').val().trim();var qq = $('#qq').val().trim();var ifqq = $('#ifqq').attr('checked') ? 1 : 0;var email = $('#email').val().trim();var ifemail = $('#ifemail').attr('checked') ? 1 : 0;var site = $('#site').val().trim();var jprovince = $('#jprovince').val().trim();var jcity = $('#jcity').val().trim();var province = $('#province').val().trim();var city = $('#city').val().trim();var shengxiao = $('#shengxiao').val().trim();var xingzuo = $('#xingzuo').val().trim();var aihao = $('#aihao').val().trim();var ifstudent = $('#ifstudent').attr('checked') ? 1 : 0;if (ifstudent) {var address = $('#address').val().trim();var tel = $('#tel').val().trim();var iftel = $('#iftel').attr('checked') ? 1 : 0;var idka = $('#idka').val().trim();var fclass = $('#fclass').val().trim();var mclass = $('#mclass').val().trim();var fee = $('#fee').val().trim();var kfee = $('#kfee').val().trim();var csid = $('#csid').val().trim();var time = $('#time').val().trim();}if (!truename.klength()) {showMsg('真实姓名不能为空', 'red', 'error'); $('#truename').focus(); return false;}if (!zhiye.klength()) {showMsg('职业不能为空', 'red', 'error'); $('#zhiye').focus(); return false;}if (!email.klength()) {showMsg('邮箱不能为空', 'red', 'error'); $('#email').focus(); return false;}if (!province.klength() || !city.klength()) {showMsg('请选择现居地', 'red', 'error'); return false;}if (ifstudent) {if (!tel.klength()) {showMsg('联系电话不能为空', 'red', 'error'); $('#tel').focus(); return false;}if (!idka.klength()) {showMsg('身份证号码不能为空', 'red', 'error'); $('#idka').focus(); return false;}if (!address.klength()) {showMsg('街道地址不能为空', 'red', 'error'); $('#address').focus(); return false;}if (!mclass.klength() || mclass == '#') {showMsg('请选择您要报名的班级', 'red', 'error'); return false;}if (!fee.klength()) {showMsg('请填写应缴学费', 'red', 'error'); return false;}if (!kfee.klength()) {showMsg('请填写已缴学费', 'red', 'error'); return false;}if (fee != kfee) {if (!time.klength()) {showMsg('请填写余款缴纳时间', 'red', 'error'); return false;}if (!fnIsDate(time)) {showMsg('请填写正确的余款缴纳时间', 'red', 'error'); return false;}}if (!csid.klength()) {showMsg('请选择为您服务的客服', 'red', 'error'); return false;}var kdata = 'mid='+mid+'&truename='+truename+'&age='+age+'&ifusername='+iftruename+'&image='+image+'&sex='+sex+'&mingzu='+mingzu+'&zhiye='+zhiye+'&qq='+qq+'&ifqq='+ifqq+'&email='+email+'&ifemail='+ifemail+'&tel='+tel+'&iftel='+iftel+'&site='+site+'&jprovince='+jprovince+'&jcity='+jcity+'&province='+province+'&city='+city+'&shengxiao='+shengxiao+'&xingzuo='+xingzuo+'&aihao='+aihao+'&address='+address+'&idka='+idka+'&ifstudent='+ifstudent+'&mclass='+mclass+'&fclass='+fclass+'&fee='+fee+'&kfee='+kfee+'&time='+time+'&csid='+csid;}else {var kdata = 'mid='+mid+'&truename='+truename+'&age='+age+'&ifusername='+iftruename+'&image='+image+'&sex='+sex+'&mingzu='+mingzu+'&zhiye='+zhiye+'&qq='+qq+'&ifqq='+ifqq+'&email='+email+'&ifemail='+ifemail+'&site='+site+'&jprovince='+jprovince+'&jcity='+jcity+'&province='+province+'&city='+city+'&shengxiao='+shengxiao+'&xingzuo='+xingzuo+'&aihao='+aihao+'&ifstudent='+ifstudent;}$.ajax({type: 'POST',url: '/member/admin/ajaxMemberInfo.php',data: kdata,dataType: 'json',beforeSend: function() {showMsg('数据处理中，请稍后', 'green', 'error');},success: function(data) {if (data['success']) {$('.btnInput').attr('disabled', 'disabled');showMsg(data['msg'], 'green', 'error');fnReferer('index.php');}else if (data['error'] != '') {showMsg(data['msg'], 'red', 'error');}else {fnNetError('error');}}});}function fnEnterpriseInfo(mid) {var image = $('#imgfile').val().trim();var truename = $('#truename').val().trim();var qq = $('#qq').val().trim();var ifqq = $('#ifqq').attr('checked') ? 1 : 0;var tel = $('#tel').val().trim();var iftel = $('#iftel').attr('checked') ? 1 : 0;var email = $('#email').val().trim();var ifemail = $('#ifemail').attr('checked') ? 1 : 0;var site = $('#site').val().trim();var province = $('#province').val().trim();var city = $('#city').val().trim();var address = $('#address').val().trim();var aihao = $('#aihao').val().trim();var fax = $('#fax').val().trim();if (!truename.klength()) {showMsg('公司名称不能为空', 'red', 'error'); $('#truename').focus(); return false;}if (!tel.klength()) {showMsg('联系电话不能为空', 'red', 'error'); $('#tel').focus(); return false;}if (!fax.klength()) {showMsg('传真不能为空', 'red', 'error'); $('#fax').focus(); return false;}if (!email.klength()) {showMsg('邮箱不能为空', 'red', 'error'); $('#email').focus(); return false;}if (!province.klength() || !city.klength()) {showMsg('请选择所在城市', 'red', 'error'); $('#address').focus(); return false;}if (!address.klength()) {showMsg('街道地址不能为空', 'red', 'error'); $('#address').focus(); return false;}$.ajax({type: 'POST',url: '/member/admin/ajaxEnterpriseInfo.php',data: 'mid='+mid+'&truename='+truename+'&image='+image+'&qq='+qq+'&ifqq='+ifqq+'&tel='+tel+'&iftel='+iftel+'&email='+email+'&ifemail='+ifemail+'&site='+site+'&province='+province+'&city='+city+'&aihao='+aihao+'&fax='+fax+'&address='+address,dataType: 'json',beforeSend: function() {showMsg('数据处理中，请稍后', 'green', 'error');},success: function(data) {if (data['success']) {$('.btnInput').attr('disabled', 'disabled');showMsg(data['msg'], 'green', 'error');fnReferer('index.php');}else if (data['error'] != '') {showMsg(data['msg'], 'red', 'error');}else {fnNetError('error');}}});}function fnEditpasswd() {var oldpasswd = $('#oldpasswd').val().trim();var passwd = $('#passwd').val().trim();var cfpasswd = $('#cfpasswd').val().trim();if (!oldpasswd.klength()) {showMsg('原密码不能为空', 'red', 'error'); $('#oldpasswd').focus(); return;}if (!passwd.klength()) {showMsg('新密码不能为空', 'red', 'error'); $('#passwd').focus(); return;}if (cfpasswd != passwd) {showMsg('两次密码输入不一样', 'red', 'error'); $('#cfpasswd').focus(); return;}$.post('ajaxEditpasswd.php', {oldpasswd:oldpasswd, passwd:passwd, cfpasswd:cfpasswd}, function(data){if (data['success']) {showMsg(data['msg'], 'green', 'error');fnReferer('index.php');}else {showMsg(data['msg'], 'red', 'error');}},'json');}function fnRenwu(act, id) {var name = $('#name').val().trim();var fee = $('#fee').val().trim();var time = $('#time').val().trim();var ifcomplete = $('#ifcomplete').val().trim();var content = $('#content').val().trim();if (!name.klength()) {showMsg('任务名称不能为空', 'red', 'error'); $('#name').focus(); return;}if (!fee.klength()) {showMsg('设计费用不能为空', 'red', 'error'); $('#fee').focus(); return;}if (!time.klength()) {showMsg('结束时间不能为空', 'red', 'error'); $('#time').focus(); return;}if (!content.klength()) {showMsg('任务描述不能为空', 'red', 'error'); $('#content').focus(); return;}$.post('ajaxRenwu.php', {act:act, name:name, fee:fee, time:time, ifcomplete:ifcomplete, content:content, id:id}, function(data){if (data['success']) {showMsg(data['msg'], 'green', 'error');fnReferer('?action=bws');}else {showMsg(data['msg'], 'red', 'error');}},'json');}function fnZhaopin(act, id) {var name = $('#name').val().trim();var title = $('#title').val().trim();var number = $('#number').val().trim();var city = $('#city').val().trim();var tel = $('#tel').val().trim();var email = $('#email').val().trim();var site = $('#site').val().trim();var address = $('#address').val().trim();var time = $('#time').val().trim();var ifcomplete = $('#ifcomplete').val().trim();var description = $('#description').val().trim();var content = $('#content').val().trim();var price = $('#price').val().trim();if (!title.klength()) {showMsg('招聘职位不能为空', 'red', 'error'); $('#title').focus(); return;}if (!number.klength()) {showMsg('请填写招聘人数', 'red', 'error'); $('#number').focus(); return;}if (!city.klength()) {showMsg('请填写工作地点', 'red', 'error'); $('#city').focus(); return;}if (!tel.klength()) {showMsg('请填写联系电话', 'red', 'error'); $('#tel').focus(); return;}if (!name.klength()) {showMsg('联系人不能为空', 'red', 'error'); $('#name').focus(); return;}if (!site.klength()) {showMsg('请填写公司网址', 'red', 'error'); $('#site').focus(); return;}if (!address.klength()) {showMsg('请填写联系地址', 'red', 'error'); $('#address').focus(); return;}if (!content.klength()) {showMsg('职位要求不能为空', 'red', 'error'); $('#content').focus(); return;}if (!description.klength()) {showMsg('工作概述不能为空', 'red', 'error'); $('#description').focus(); return;}$.post('ajaxZhaopin.php', {act:act, name:name, title:title, price:price, number:number, city:city, tel:tel, email:email, site:site, address:address, ifcomplete:ifcomplete, time:time, content:content, description:description, id:id}, function(data){if (data['success']) {showMsg(data['msg'], 'green', 'error');fnReferer('?action=bws');}else {showMsg(data['msg'], 'red', 'error');}}, 'json');}function fnAddFriend(mid) {$.post('ajaxFriend.php', {action:'add', mid:mid}, function(data){fnShowMsg(data['msg'], 3, '');},'json');}function fnAddFriendGZ(mid, status, reload) {$.post('/member/ajaxFriend.php', {action:'gz', mid:mid, status:status}, function(data){fnShowMsg(data['msg'], 3, window.location)},'json');}function fnDelete(table, field, id) {if (confirm('确定删除？')) {$.post('ajaxDelete.php', {table:table, field:field, id:id}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}},'json');}}function fnComFriend(id , uid) {$.post('ajaxComFriend.php', {id:id, uid:uid}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}},'json');}function fnSendMessage() {var username = $('#username').val().trim();var title = $('#title').val().trim();var content = $('#content').val().trim();if (!username.klength()) {showMsg('请填写收件人', 'red', 'error'); $('#username').focus(); return false;}if (!title.klength()) {showMsg('请填写邮件标题', 'red', 'error'); $('#title').focus(); return false;}if (!content.klength() || content == '最多可输入255个字符') {showMsg('请填写邮件内容', 'red', 'error'); $('#mcontent').focus(); return false;}if (content.klength() > 255) {showMsg('邮件内容不能超过255个字符', 'red', 'error'); $('#mcontent').focus(); return false;}$.post('ajaxSendMessage.php', {username:username, title:title, content:content}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer('?action=msg');}else{showMsg(data['msg'], 'red', 'error')}},'json');}function fnAddmessage(uid) {var content = $('#mcontent').val().trim();if (!content.klength() || content == '最多可输入255个字符') {showMsg('请填写留言内容', 'red', 'error'); $('#mcontent').focus(); return false;}if (content.klength() > 255) {showMsg('留言内容不能超过255个字符', 'red', 'error'); $('#mcontent').focus(); return false;}$.post('ajaxAddmessage.php', {content:content, uid:uid}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}},'json');}function fnApplyOrder() {var file = $('#rarfile').val().trim();var content = $('#content').val().trim();var rid = $('#rid').val().trim();if (!content.klength()) {showMsg('请填写您的留言', 'red', 'error'); $('#mcontent').focus(); return false;}$.post('ajaxApplyOrder.php', {rid:rid, file:file, content:content}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}}, 'json');}function fnSetSelect(rid, rlid) {if (confirm('确定将该作品设置为中标作品？\n该设置将不可更改！')) {$.post('ajaxSetSelect.php', {rid:rid, rlid:rlid}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}}, 'json');}}function fnApplyZhaopin(zid) {$.post('/ajaxApplyZhaopin.php', {zid:zid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');}else{fnShowMsg(data['msg'], 3, '')}}, 'json');}function fnWork(wid) {var wtype = $('#wtype').val().trim();var wname = $('#wname').val().trim();var simage = $('#simage').val().trim();var width = $('#width').val().trim();var height = $('#height').val().trim();var wurl = $('#wurl').val().trim();var content = $('#content').val().trim();if (!wtype.klength()) {showMsg('请选择作品类型', 'red', 'error'); $('#wtype').focus(); return false;}if (!wname.klength()) {showMsg('请填写作品名称', 'red', 'error'); $('#wname').focus(); return false;}if (!simage.klength()) {showMsg('请上传缩略图', 'red', 'error'); $('#simage').focus(); return false;}if (wtype == 2) {var image = $('#fflash').val().trim();var image1 = $('#fflash1').val().trim();var image2 = $('#fflash2').val().trim();var image3 = $('#fflash3').val().trim();var image4 = $('#fflash4').val().trim();var width1 = $('#width1').val().trim();var width2 = $('#width2').val().trim();var width3 = $('#width3').val().trim();var width4 = $('#width4').val().trim();var height1 = $('#height1').val().trim();var height2 = $('#height2').val().trim();var height3 = $('#height3').val().trim();var height4 = $('#height4').val().trim();if (!image.klength()) {showMsg('请上传动画文件', 'red', 'error'); $('#fimage').focus(); return false;}if (width == 0) {showMsg('请填写动画文件宽度', 'red', 'error'); $('#width').focus(); return false;}if (width > 670) {showMsg('动画文件宽度不能大于670px', 'red', 'error'); $('#width').focus(); return false;}var kdata = 'wid='+wid+'&wtype='+wtype+'&wname='+wname+'&simage='+simage+'&image='+image+'&image1='+image1+'&image2='+image2+'&image3='+image3+'&image4='+image4+'&width='+width+'&height='+height+'&wurl='+wurl+'&content='+content+'&width1='+width1+'&width2='+width2+'&width3='+width3+'&width4='+width4+'&height1='+height1+'&height2='+height2+'&height3='+height3+'&height4='+height4;}else {var image = $('#fimage').val().trim();var image1 = $('#fimage1').val().trim();var image2 = $('#fimage2').val().trim();var image3 = $('#fimage3').val().trim();var image4 = $('#fimage4').val().trim();if (!image.klength()) {showMsg('请上传效果图', 'red', 'error'); $('#fimage').focus(); return false;}var kdata = 'wid='+wid+'&wtype='+wtype+'&wname='+wname+'&simage='+simage+'&image='+image+'&image1='+image1+'&image2='+image2+'&image3='+image3+'&image4='+image4+'&width='+width+'&height='+height+'&wurl='+wurl+'&content='+content;}if (!content.klength()) {showMsg('请填写作品描述', 'red', 'error'); $('#content').focus(); return false;}$.ajax({type: 'POST',url: '/member/ajaxWork.php',data: kdata,dataType: 'json',beforeSend: function() {showMsg('数据处理中，请稍后', 'green', 'error');},success: function(data) {if (data['success']) {$('.btnInput').attr('disabled', 'disabled');showMsg(data['msg'], 'green', 'error');fnReferer('?action=bws');}else if (data['error'] != '') {showMsg(data['msg'], 'red', 'error');}else {fnNetError('error');}}});}function fnDigg(act, wid) {$.post('ajaxDigg.php', {act:act, wid:wid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');if (act == 'good') {var g = parseInt($('#d_g').text()) + 1; $('#d_g').text(g);}if (act == 'bad') {var b = parseInt($('#d_b').text()) + 1; $('#d_b').text(b);}}else{fnShowMsg(data['msg'], 3, '')}}, 'json');}function fnHDigg(act, wid) {$.post('ajaxHDigg.php', {act:act, wid:wid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');if (act == 'good') {var g = parseInt($('#d_g').text()) + 1; $('#d_g').text(g);}if (act == 'bad') {var b = parseInt($('#d_b').text()) + 1; $('#d_b').text(b);}}else{fnShowMsg(data['msg'], 3, '')}}, 'json');}function fnCollect(wid) {$.post('ajaxCollect.php', {wid:wid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');var c = parseInt($('#d_c').text()) + 1; $('#d_c').text(c);}else{fnShowMsg(data['msg'], 3, '')}}, 'json');}function fnHCollect(wid) {$.post('ajaxHCollect.php', {wid:wid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');var c = parseInt($('#d_c').text()) + 1; $('#d_c').text(c);}else{fnShowMsg(data['msg'], 3, '')}}, 'json');}function fnWorkReview(wid) {var content = $('#content').val().trim();if (!content.klength() || content == '最多可输入255个字符') {showMsg('请填写留言内容', 'red', 'error'); $('#mcontent').focus(); return false;}if (content.klength() > 255) {showMsg('留言内容不能超过255个字符', 'red', 'error'); $('#mcontent').focus(); return false;}$.post('ajaxWorkReview.php', {wid:wid, content:content}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}}, 'json');}function fnHWorkReview(wid) {var content = $('#content').val().trim();if (!content.klength() || content == '最多可输入255个字符') {showMsg('请填写留言内容', 'red', 'error'); $('#mcontent').focus(); return false;}if (content.klength() > 255) {showMsg('留言内容不能超过255个字符', 'red', 'error'); $('#mcontent').focus(); return false;}$.post('ajaxHWorkReview.php', {wid:wid, content:content}, function(data){if(data['success']){showMsg(data['msg'], 'green', 'error');fnReferer(window.location);}else{showMsg(data['msg'], 'red', 'error')}}, 'json');}function fnStudentDigg(mid) {$.post('/member/ajaxStudentDigg.php', {mid:mid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, ''); var g = parseInt($('#d_g_'+mid).text()) + 1;  $('#d_g_'+mid).text(g);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnReset(cid) {$.post('ajaxReset.php', {cid:cid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, window.location);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnReplyMsg(mmid) {var content = $('#r_'+mmid).val().trim();if (!content.klength() || content == '最多可输入255个字符') {fnShowMsg('请填写回复内容', 3, ''); $('#r_'+mmid).focus(); return false;}if (content.klength() > 255) {fnShowMsg('回复内容不能超过255个字符', 3, ''); $('#r_'+mmid).focus(); return false;}$.post('ajaxReplyMsg.php', {mmid:mmid, content:content}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, window.location);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnHWork(wid) {var wtype = $('#wtype').val().trim();var wname = $('#wname').val().trim();var simage = $('#simage').val().trim();var width = $('#width').val().trim();var height = $('#height').val().trim();var wurl = $('#wurl').val().trim();var content = $('#content').val().trim();if (!wtype.klength()) {showMsg('请选择作品类型', 'red', 'error'); $('#wtype').focus(); return false;}if (!wname.klength()) {showMsg('请填写作品名称', 'red', 'error'); $('#wname').focus(); return false;}if (!simage.klength()) {showMsg('请上传缩略图', 'red', 'error'); $('#simage').focus(); return false;}if (wtype == 2) {var image = $('#fflash').val().trim();var image1 = $('#fflash1').val().trim();var image2 = $('#fflash2').val().trim();var image3 = $('#fflash3').val().trim();var image4 = $('#fflash4').val().trim();var width1 = $('#width1').val().trim();var width2 = $('#width2').val().trim();var width3 = $('#width3').val().trim();var width4 = $('#width4').val().trim();var height1 = $('#height1').val().trim();var height2 = $('#height2').val().trim();var height3 = $('#height3').val().trim();var height4 = $('#height4').val().trim();if (!image.klength()) {showMsg('请上传动画文件', 'red', 'error'); $('#fimage').focus(); return false;}if (width == 0) {showMsg('请填写动画文件宽度', 'red', 'error'); $('#width').focus(); return false;}if (width > 670) {showMsg('动画文件宽度不能大于670px', 'red', 'error'); $('#width').focus(); return false;}var kdata = 'wid='+wid+'&wtype='+wtype+'&wname='+wname+'&simage='+simage+'&image='+image+'&image1='+image1+'&image2='+image2+'&image3='+image3+'&image4='+image4+'&width='+width+'&height='+height+'&wurl='+wurl+'&content='+content+'&width1='+width1+'&width2='+width2+'&width3='+width3+'&width4='+width4+'&height1='+height1+'&height2='+height2+'&height3='+height3+'&height4='+height4;}else {var image = $('#fimage').val().trim();var image1 = $('#fimage1').val().trim();var image2 = $('#fimage2').val().trim();var image3 = $('#fimage3').val().trim();var image4 = $('#fimage4').val().trim();if (!image.klength()) {showMsg('请上传效果图', 'red', 'error'); $('#fimage').focus(); return false;}var kdata = 'wid='+wid+'&wtype='+wtype+'&wname='+wname+'&simage='+simage+'&image='+image+'&image1='+image1+'&image2='+image2+'&image3='+image3+'&image4='+image4+'&width='+width+'&height='+height+'&wurl='+wurl+'&content='+content;}if (!content.klength()) {showMsg('请填写作品描述', 'red', 'error'); $('#content').focus(); return false;}$.ajax({type: 'POST',url: '/member/ajaxHWork.php',data: kdata,dataType: 'json',beforeSend: function() {showMsg('数据处理中，请稍后', 'green', 'error');},success: function(data) {if (data['success']) {$('.btnInput').attr('disabled', 'disabled');showMsg(data['msg'], 'green', 'error');fnReferer('?action=bws');}else if (data['error'] != '') {showMsg(data['msg'], 'red', 'error');}else {fnNetError('error');}}});}function fnReplyReview(wid, wlid) {var content = $('#r_'+wlid).val().trim();if (!content.klength() || content == '最多可输入255个字符') {fnShowMsg('请填写回复内容', 3, ''); $('#r_'+wlid).focus(); return false;}if (content.klength() > 255) {fnShowMsg('回复内容不能超过255个字符', 3, ''); $('#r_'+wlid).focus(); return false;}$.post('ajaxReplyReview.php', {wid:wid, wlid:wlid, content:content}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, window.location);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnHReplyReview(wid, wlid) {var content = $('#r_'+wlid).val().trim();if (!content.klength() || content == '最多可输入255个字符') {fnShowMsg('请填写回复内容', 3, ''); $('#r_'+wlid).focus(); return false;}if (content.klength() > 255) {fnShowMsg('回复内容不能超过255个字符', 3, ''); $('#r_'+wlid).focus(); return false;}$.post('ajaxHReplyReview.php', {wid:wid, wlid:wlid, content:content}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, window.location);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnToMejob(mid) {$.post('ajaxToMejob.php', {mid:mid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}function fnDActivity(aid) {if (confirm('确定兑换？')) {$.post('ajaxDActivity.php', {aid:aid}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, '');}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}}function fnAReplyOrder(rid) {var content = $('#r_'+rid).val().trim();if (!content.klength() || content == '最多可输入255个字符') {fnShowMsg('请填写回复内容', 3, ''); $('#r_'+rid).focus(); return false;}if (content.klength() > 255) {fnShowMsg('回复内容不能超过255个字符', 3, ''); $('#r_'+mmid).focus(); return false;}$.post('ajaxAReplyOrder.php', {rid:rid, content:content}, function(data){if(data['success']){fnShowMsg(data['msg'], 3, window.location);}else{fnShowMsg(data['msg'], 3, '');}}, 'json');}

