document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); document.write(""); var afterLogonT = ' [退出]'; var beforeLogonT = '您好,欢迎来到人保![ 登录 ] [ 免费注册 ] '; var beforeLogonR = ''; var afterLogonR = ''; var iners;//表示登陆框 的 HTML 内容; var fowardDiv; //获取元素对象; var docEle = function() { return (document.getElementById(arguments[0]) || false); } //登录注册; //loginType:1:登录,2:注册;3:成功提示 ////pageTogo 0原页面,1单证上传 2 赔款人信息提交 function changeLogin2(loginType,pageTogo){ //iners 表示登陆框 的 HTML 内容 //alert("加入计划点击登录"); var formHtml = ""; if(loginType == 4){ formHtml = "
"+ "

"+ "用户登录

"+ "
"; iners = formHtml; }else if(loginType == 5){ formHtml = "
"+ "

"+ "人员选择

"+ "
"; iners = formHtml; } } function chk_passw(){ showErrMsg2('msg_pwdAddPlan', '0', '0', '0'); $("#passwordAddPlan").removeClass("yxred_erro_ly"); if($.trim($('#passwordAddPlan').val())==""){ return true; } //密码数字,字母、下划线验证; var usern = /^[a-zA-Z0-9_]+$/; var upwd = $.trim($('#passwordAddPlan').val()); if(!upwd.match(usern)){ showErrMsg2('msg_pwdAddPlan', '1', '请输入数字、字母或下划线', '0'); return false; } } function checkErrorTimes2(){ $("#userNameAddPlan").removeClass("yxred_erro_ly"); var entryId=$("#userNameAddPlan").val(); if(entryId==null||entryId==""||entryId==undefined){ entryId=$("#userNameAddPlan").val(); } $.ajax({ url:'/ecenter/loginRegister/isBeforeEntry', async:false, data:'entryId='+entryId, success:function(data){ if(data>=2){ $("#randCode").css('display',''); }else if(data==-1){ var isShow=$('#randCode').css('display'); $("#randCode").css('display',isShow); }else{ $("#randCode").css('display','none'); } $("#errorTimes").val(data); }, error:function(){ } }); showErrMsg2('msg_usernameAddPlan', '0', '', '0'); showErrMsg2('msg_pwdAddPlan', '0', '', '0'); showErrMsg2('msg_randAddPlan', '0', '', '0'); } //显示隐藏密码; function chagePwdType(obj){ var val = $.trim($('#password1').val()); var pwd = $('#password1'); if(pwd.attr('type') == 'password' && obj.checked){ $('#div_password').html(""); }else{ $('#div_password').html(""); } } //显示错误信息; //flag,0:清除内容,1:错误提示; //logintype,0:登录,1:注册; function showErrMsg2(id, flag, msgcontent, logintype){ if(flag == '0'){ $('#' + id).html(" "); }else{ $('#' + id).html(msgcontent); } } //判断浏览器版本 function userAgent(){ var version = ""; var ua = navigator.userAgent; ua = ua.toLowerCase(); var match = /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || !/compatible/.test(ua) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua) || []; //match[2]判断版本号 switch(match[1]){ case "msie": //ie if (parseInt(match[2]) == 6) //ie6 version = "ie6"; else if (parseInt(match[2]) == 7) //ie7 version = "ie7"; else if (parseInt(match[2]) == 8) //ie8 version = "ie8"; break; case "webkit": //safari or chrome version = "chromeorsafari"; break; case "opera": //opera version = "opera"; break; case "mozilla": //Firefox version = "Firefox"; break; default: break; } return version; } //关闭弹层 function closediv2(obj){ $("#login_popwin_addp").remove(); $('.ui-messager').remove(); var m = "mask_addp"; if (docEle(m)) document.body.removeChild(docEle(m)); } //登录名录入域的提示语; //flag: 1:获取焦点;2:焦点离开; function delLoginName(flag){ var username = $.trim($('#userNameAddPlan').val()); if('1' == flag){ if($('#userNameAddPlan').attr('ov') == username){ $('#userNameAddPlan').val('').attr('style', ''); } }else{ if('' == username){ $('#userNameAddPlan').attr('style','color:#B8B8B8;').val($('#userNameAddPlan').attr('ov')); } showErrMsg2('msg_usernameAddPlan', '1', '请输入用户名/邮箱/已验证的手机号', '0'); } } //遮罩层设置; function openlogin_div2(loginType) { userAgent(); //alert("加入计划遮罩层"); var m = "mask_addp"; //alert(docEle("login_popwin_addp")); //alert(docEle(m)); if (docEle("login_popwin_addp")) document.body.removeChild(docEle("login_popwin_addp")); if (docEle(m)) document.body.removeChild(docEle(m)); //mask遮罩层,作用是屏蔽底层页面控件 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1002"; _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth); _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight); _scrollHeight = Math.max(_scrollHeight,window.screen.availHeight); //alert("document.body.scrollHeight = " + document.body.scrollHeight + " document.documentElement.scrollHeight = " + document.documentElement.scrollHeight + "_scrollHeight = " + _scrollHeight + " window.screen.availHeight = " + window.screen.availHeight); newMask.style.width = '100%'; newMask.style.height = _scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=50)"; newMask.style.opacity = "0.50"; document.body.appendChild(newMask); //遮罩层加上 iframe,防止下拉列表穿透层 var ifra = document.createElement("iframe"); ifra.src=""; ifra.style.cssText = "position:absolute;visibility:inherit; top:0px; left:0px; width:100%; height:"+_scrollHeight+"px;z-index:-1; filter:chroma(color=#ffffff)" ; newMask.appendChild(ifra); //新弹出层 var login_div = document.createElement("div"); login_div.id = "login_popwin_addp"; var login_divWidth = 422; var login_divHeight = 300; login_div.style.position = "absolute"; login_div.style.zIndex = "9999"; login_div.style.width = login_divWidth + 'px'; login_div.style.height = login_divHeight + 'px'; login_div.style.display = 'block'; login_div.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - login_divHeight/2) + "px"; login_div.style.left = (document.body.scrollLeft + document.documentElement.clientWidth/2 - login_divWidth/2) + "px"; document.body.appendChild(login_div); //弹出层滚动居中 function login_divCenter() { login_div.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - login_divHeight/2) + "px"; login_div.style.left = (document.body.scrollLeft + document.documentElement.clientWidth/2 - login_divWidth/2) + "px"; } if(document.all){ window.attachEvent("onscroll",login_divCenter); } else{ window.addEventListener('scroll',login_divCenter,false); } //关闭新图层和mask遮罩层 /* var newA = document.createElement("a"); newA.href = "#"; newA.onclick = function() { if(document.all) { window.detachEvent("onscroll",login_divCenter); } else { window.removeEventListener('scroll',login_divCenter,false); } document.body.removeChild(docEle("login_div")); document.body.removeChild(docEle(m)); return false; }*/ login_div.innerHTML = iners; //login_div.appendChild(newA); /* if(loginType == 1){ document.getElementById("box_content").style.height = "280px"; document.getElementById("login_div").style.height = "320px"; } else{ document.getElementById("box_content").style.height = "360px"; document.getElementById("login_div").style.height = "380px"; }*/ if(document.getElementById('logonImg') || document.getElementById('logonImgAddPlan')){ if($("#apple").val() == "0"){ newRandImg2('logonImg'); }else{ newRandImg2('logonImgAddPlan'); } } } //提示层设置; function showlogin_div(loginType) { var m = "mask_addp"; if (docEle("login_popwin_addp")) document.body.removeChild(docEle("login_popwin_addp")); if (docEle(m)) document.body.removeChild(docEle(m)); //mask遮罩层,作用是屏蔽底层页面控件 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "999"; _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth); _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight); _scrollHeight = Math.max(_scrollHeight,window.screen.availHeight); //alert("document.body.scrollHeight = " + document.body.scrollHeight + " document.documentElement.scrollHeight = " + document.documentElement.scrollHeight + "_scrollHeight = " + _scrollHeight + " window.screen.availHeight = " + window.screen.availHeight); newMask.style.width = '100%'; newMask.style.height = _scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=50)"; newMask.style.opacity = "0.50"; document.body.appendChild(newMask); //遮罩层加上 iframe,防止下拉列表穿透层 var ifra = document.createElement("iframe"); ifra.src=""; ifra.style.cssText = "position:absolute;visibility:inherit; top:0px; left:0px; width:100%; height:"+_scrollHeight+"px;z-index:-1; filter:chroma(color=#ffffff)" ; newMask.appendChild(ifra); //新弹出层 var login_div = document.createElement("div"); login_div.id = "popDiv_1"; var login_divWidth = 380; var login_divHeight = 150; login_div.style.position = "absolute"; login_div.style.zIndex = "9999"; login_div.style.width = login_divWidth + 'px'; login_div.style.height = login_divHeight + 'px'; login_div.style.display = 'block'; login_div.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - login_divHeight/2) + "px"; login_div.style.left = (document.body.scrollLeft + document.documentElement.clientWidth/2 - login_divWidth/2) + "px"; document.body.appendChild(login_div); //弹出层滚动居中 function login_divCenter() { login_div.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - login_divHeight/2) + "px"; login_div.style.left = (document.body.scrollLeft + document.documentElement.clientWidth/2 - login_divWidth/2) + "px"; } if(document.all){ window.attachEvent("onscroll",login_divCenter); } else{ window.addEventListener('scroll',login_divCenter,false); } login_div.innerHTML = iners; } //关闭弹出层; function close_LoginDiv2(){ var _id = "login_popwin_addp"; var m = "mask_addp"; if (docEle(_id)) document.body.removeChild(docEle(_id)); if (docEle(m)) document.body.removeChild(docEle(m)); } function close_ShowDiv(){ var _id = "popDiv_1"; var m = "mask_addp"; if (docEle(_id)) document.body.removeChild(docEle(_id)); if (docEle(m)) document.body.removeChild(docEle(m)); } function chekKey1(keyCode){ if(keyCode==13){document.getElementById('sub').click();} } //登录; function submitLogon2(pageToGo){ //用户登陆 $("#hidflagpassword").val($("#password").val()); if($.trim($('#userNameAddPlan').val())=="" || $.trim($('#userNameAddPlan').val())==$('#userNameAddPlan').attr('ov')){ showErrMsg2('msg_usernameAddPlan', '1', '请输入用户名/邮箱/已验证的手机号','0'); $("#userNameAddPlan").focus(); $("#userNameAddPlan").addClass("yxred_erro_ly"); return false; } showErrMsg2('msg_usernameAddPlan', '0', '', '0'); if($('#passwordAddPlan').val()==""){ showErrMsg2('msg_pwdAddPlan', '1', '请输入密码', '0'); $('#passwordAddPlan').focus(); $("#passwordAddPlan").addClass("yxred_erro_ly"); return false; } //密码数字,字母、下划线验证; var usern = /^[a-zA-Z0-9_]+$/; var upwd = $.trim($('#passwordAddPlan').val()); if(!upwd.match(usern)){ showErrMsg2('msg_pwdAddPlan', '1', '请输入数字、字母或下划线', '0'); $("#passwordAddPlan").focus(); $("#passwordAddPlan").addClass("yxred_erro_ly"); return false; } showErrMsg2('msg_pwdAddPlan', '0', '', '0'); //add 20140726 EBS-4306 var errorTimes=$('#errorTimes').val(); if(errorTimes>=2){ if($.trim($('#randAddPlan').val())==""){ showErrMsg2('msg_randAddPlan', '1', '请输入验证码', '0'); $("#randAddPlan").focus(); $("#randAddPlan").addClass("yxred_erro_ly"); return false; } } showErrMsg2('msg_rand', '0', '', '0'); //在此添加保存cookie标志 add by zcg 20120728; var remember = ""; //修改取值去掉头尾空格 //登录用户名密码加密 var securityVal = enceypt($.trim($("#userNameAddPlan").val()), $.trim($("#passwordAddPlan").val())); var enc_str = $("#MUserCode").val(); var enc_pwd1 = $("#MPassword").val(); var pswKey = $("#psw").val(); var param = "UIAction=logon&userName=" + enc_str + "&password=" + enc_pwd1 + "&pswkey=" + pswKey + "&rand=" + $.trim($("#randAddPlan").val()) + "&remember=" + remember + "&randName=loginRandDiv&uuid=" + $("#uuidLogin").val()+"&loginType=logonClubDiv"; $.ajax({ url:'http://www.epicc.com.cn/idprovider/login', data:param, type:'post', success:function(data){ logonResult2(data,pageToGo); }, error:function(){} }); } //登录成功; function doLogon2(){ if(document.getElementById("cmpid")){ if(document.getElementById("cmpid").value!="null"&&document.getElementById("cmpid").value!=""){ var cmpid=document.getElementById("cmpid").value; var entryId = ""; if(document.getElementById("entryId")){ entryId = document.getElementById("entryId").value==null?"":document.getElementById("entryId").value; } $.ajax({ type:'get', url:'/EbsWeb/marketActivity.do', data:{cmpid:cmpid,entryId:entryId}, dataType:'html', success:function(data){ } }); } } try{addentryId();}catch(e){} //登陆成功 隐藏按钮 atuhor:赵奇瑞 if($("#myPolicy").css("display")=="block"){ document.getElementById("myPolicy").style.display="none"; document.getElementById("dengLuBaoDan_shouYe").style.display="block"; document.getElementById("weiDengLuBaoDan_shouYe").style.display="none"; } } //退出; function doExit(){ try{removeEntryId();}catch(e){} //退出成功 显示按钮 atuhor:赵奇瑞 if($("#myPolicy").css("display")=="none"){ document.getElementById("myPolicy").style.display="block"; document.getElementById("dengLuBaoDan_shouYe").style.display="none"; document.getElementById("weiDengLuBaoDan_shouYe").style.display="block"; } //用户体验改版-加入计划-功能-如果登录成功则刷新子页面(子页面为addPlanFrame的iframe) 2013-02-25 孙亚飞 if($("#main").length>0){ main.window.location.href="/EbsWeb/foreignQuoted/userexperienceNew/EbsEnterPlan.jsp"; } } //登录注册回调函数; function logonResult2(Rjson,pageToGo){ eval("returnJson="+Rjson); var result = returnJson.result; var errorTimes=returnJson.errorTimes; var entryId=returnJson.entryId; if("1" != result){//登陆失败 $("#errorTimes").val(errorTimes); document.getElementById("logonImgAddPlan").src="http://www.epicc.com.cn/ecenter/CreateImage?randName=loginRandDiv&uuid="+$("#uuidLogin").val()+"&next="+Math.random(); showErrMsg2('msg_randAddPlan', '0', '', '0'); if(errorTimes>=2){ $('#randCode').css('display','block'); } if('2' == result){ showErrMsg2('msg_usernameAddPlan', '1', '用户名信息与密码不匹配', '0'); $("#userNameAddPlan").focus(); $("#userNameAddPlan").addClass("yxred_erro_ly"); return false; } showErrMsg2('msg_pwd', '0', '', '0'); if('3' == result){ showErrMsg2('msg_usernameAddPlan', '1', '您的登录账号异常,请联系在线客服解决', '0'); $("#userNameAddPlan").addClass("yxred_erro_ly"); return false; } showErrMsg2('msg_randAddPlan', '0', '', '0'); if('4' == result){ showErrMsg2('msg_randAddPlan', '1', '用户名信息与密码不匹配', '0'); $("#randAddPlan").focus(); $("#randAddPlan").addClass("yxred_erro_ly"); return false; } showErrMsg2('msg_pwdAddPlan', '0', '', '0'); if('5' == result){ showErrMsg2('msg_pwdAddPlan', '1', '验证码错误', '0'); $("#passwordAddPlan").focus(); $("#passwordAddPlan").addClass("yxred_erro_ly"); return false; } return false; }else if("1" == result){//登陆成功! //把用户名定义一下 $("#entryId").val(entryId); $("#entryIdHidden").val(entryId); var password =$("#passwordAddPlan").val(); casLogin(entryId,password); var pageTogoLiPeiIn=$("#pageTogoLiPeiIn").val(); //取手机登录后的用户名 add by zcg 20120816; $("#casLogin").submit(); if(pageToGo=='1'){ window.open("/ecenter/insuringAndClaims/docupload/policyDocument/findClaimInfoSub?clickMenu=5","_self"); }else if(pageToGo=='2'){ window.open("/ecenter/insuringAndClaims/submitInfo/carPolicyClaim/findCarPolicy?clickMenu=20","_self"); }else if(pageToGo=='3'){ if(document.getElementById('main')){ document.getElementById('main').contentWindow.document.getElementById('entryID').value=entryId; } var uuname = $("#userNameAddPlan").val(); if(vtop !=null){ vtop.style.display = 'inline-block'; vtop.innerHTML = '您好,' + (uuname.length > 30 ? (uuname.substring(0,30) + '..'):uuname)+'' + afterLogonT; } //setMyIns($("#userNameAddPlan").val()); }else{ var entryid = $("#entryId").val(); if(entryid != null){ entryid.value = entryId; } } doLogon2(); } close_LoginDiv2(); } function casLogin(username ,password){ flushLoginTicket(); $("#J_username").val(username); $("#J_password").val(password); } //add by sunyafei 2013-2-28 function setMyIns(entryId){ $.ajax({ url:'/ecenter/ecenterClub/loginRegisterNew/personelNew/findinsured', data:'', dataType:"jsonp",//数据类型为jsonp jsonp:"jsonpCallback", async:false, method:'post', success:function(data){ close_LoginDiv2(); var _data = data; if(_data.length==0) { getMyInfo(entryId); //alert(entryId); return; } changeLogin2(5); openlogin_div2(); var c = ""; var version = userAgent(); var i1=0;//控制换行 var j=0;//统计被保人个数 ie-7-8:98px guge:103px; var table_margin = 0; var default1 = ""; //alert(version); if(version=="chromeorsafari" || version=="Firefox"){ table_margin = 100; }else if(version=="ie7"){ table_margin = 65; }else if(version=="ie6"){ table_margin = 60; }else{ table_margin = 95; } $.each(_data, function(i, item){//元素个数 var birthdate = item.insuredbirthday; j++; if(birthdate ==""){ birthdate =""; }else{ birthdate = (parseInt(item.insuredbirthday.year)+1900)+"-"+(parseInt(item.insuredbirthday.month)+1)+"-"+item.insuredbirthday.day; } var entryid = item.entryid; var name = item.insuredname; var sex = item.insuredsex;// var phone = item.insuredmobile;// var email = item.insuredemail;// var flag = item.flag; var sethtml = entryid+"|"+birthdate+"|"+name+"|"+sex+"|"+phone+"|"+email; if(flag == 1){//morenbeibaoxianren default1 = sethtml; } c +="
  
" +"
" +name +"
"; }); if(version=="ie6"){ //alert(0); if(j>=10){ //alert(1000); $("#addPlanRadioTable").attr("style","margin-left: -100px;"); } }else if(version=="ie7"||version=="ie8"||version=="ie9"||version=="chromeorsafari"){ if(j>1&&j<=7){ }else if(j>7&&j<10){ $("#long1").attr("style","diaplay:block"); $("#long2").attr("style","diaplay:block"); $("#long3").attr("style","diaplay:block"); }else if(j>=10){ } } $("#collectionname").html(c); if(j==1){ var ins = document.getElementsByName("myinsname"); if(version!='ie6'){ $("#addPlanRadioTable").attr("style","margin-left: 62px;margin-top: 0px"); } if(version=="ie7"){ $("#addPlanRadioTable").attr("style","margin-left: -50px;margin-top:0px;"); } if(version=="ie6"){ $("#addPlanRadioTable").attr("style","margin-left: -50px;margin-top: -30px"); $("#myinsLabel").attr("style","margin-left: -24px;margin-top: -20px;"); } if(default1!=""){ $(ins).attr("checked","checked");//margin-left: 62px;margin-top: -38px; showMyins($(ins).attr("value")); }else{ $("#myinsname").text(""); $("#myinssex").text(""); $("#myinsbirth").text(""); $("#myinsphone").text(""); $("#myinsemail").text(""); } }else if(j>1){ var inss = document.getElementsByName("myinsname"); if(default1==""){ $("#myinsname").text(""); $("#myinssex").text(""); $("#myinsbirth").text(""); $("#myinsphone").text(""); $("#myinsemail").text(""); }else{ for(var ele in inss){ if(default1==$(inss[ele]).val()){ $(inss[ele]).attr("checked","checked"); showMyins($(inss[ele]).attr("value")); } } } } }, error:function(){ alert("error"); }, complete:function(data){ } }); } function showMyins(entryid){ var allval = entryid.split("|"); //alert(allval[0]+allval[1]+allval[2]+allval[3]+allval[4]+allval[5]); $("#myinsname").text(allval[2]); var sex = allval[3]; if(sex==1){ sex='男'; }else if(sex==2){ sex='女'; }else{ sex=''; } $("#myinssex").text(sex); var birth = allval[1]; var birth_true = birth; $("#myinsbirth").text(birth_true); $("#myinsphone").text(allval[4]); $("#myinsemail").text(allval[5]); $("#myinsentryid").val(allval[0]); } //add by sunyafei 2013-03-01 function setMyInsToDown(){ if(document.getElementById('main')){ document.getElementById('main').contentWindow.document.getElementById('realName').value=$("#myinsname").text(); document.getElementById('main').contentWindow.document.getElementById('birthday').value=$("#myinsbirth").text(); document.getElementById('main').contentWindow.document.getElementById('birthday').className='sd_input birdaydate inputFocus'; if($("#myinsphone").text()==""){ $("#myinsphone").text("请输入您的手机号码或固定电话"); document.getElementById('main').contentWindow.document.getElementById('phoneNo').value=$("#myinsphone").text(); document.getElementById('main').contentWindow.document.getElementById('phoneNo').className='sd_input birdaydate input_color inputFocus'; }else{ document.getElementById('main').contentWindow.document.getElementById('phoneNo').value=$("#myinsphone").text(); document.getElementById('main').contentWindow.document.getElementById('phoneNo').className='sd_input birdaydate inputFocus'; } document.getElementById('main').contentWindow.document.getElementById('email').value=$("#myinsemail").text(); document.getElementById('main').contentWindow.document.getElementById('insuranceAccount').value=$("#myinsentryid").val(); var sex = 0; if($("#myinssex").text()=='男'){ $(document.getElementById('main').contentWindow.document.getElementById('sexLab')).removeClass("female"); }else if($("#myinssex").text()=='女'){ $(document.getElementById('main').contentWindow.document.getElementById('sexLab')).addClass("female"); }else{ $(document.getElementById('main').contentWindow.document.getElementById('sexLab')).removeClass("female"); } } closediv2(); } //add by sunyafei 2013-03-01 如果没有被保人 则查询自己的信息将自己信息带入 //checkform.action='/EbsWeb/postConsultation.do?UIAction=enterplan&action=q&entryid='+entryID; function getMyInfo(entryID){ $.ajax({ url:'/ecenter/ecenterClub/loginRegisterNew/personelNew/enterplan', data:'', dataType:'html', async:false, method:'post', success:function(data){ var _data =eval('('+data+')'); $.each(_data, function(i, item){//元素个数 if(typeof(item.birthday)== "undefined"){ var birthdate =""; }else{ var birthdate = item.birthday; } if(typeof(item.entryId)== "undefined"){ var entryid =""; }else{ var entryid = item.entryId; } if(typeof(item.realName)== "undefined"){ var name =""; }else{ var name = item.realName; } if(typeof(item.sex)== "undefined"){ var sex =""; }else{ var sex = item.sex; } if(typeof(item.phone)== "undefined"){ var phone =""; }else{ var phone = item.phone; } if(typeof(item.email)== "undefined"){ var email =""; }else{ var email = item.email; } var sethtml = entryid+"|"+birthdate+"|"+name+"|"+sex+"|"+phone+"|"+email; if(document.getElementById('main')){ document.getElementById('main').contentWindow.document.getElementById('realName').value=name; document.getElementById('main').contentWindow.document.getElementById('birthday').value=birthdate; document.getElementById('main').contentWindow.document.getElementById('birthday').className='sd_input birdaydate inputFocus'; document.getElementById('main').contentWindow.document.getElementById('phoneNo').value=phone; document.getElementById('main').contentWindow.document.getElementById('phoneNo').className='sd_input birdaydate inputFocus'; document.getElementById('main').contentWindow.document.getElementById('email').value=email; document.getElementById('main').contentWindow.document.getElementById('insuranceAccount').value=entryid; if(sex=='1'){ $(document.getElementById('main').contentWindow.document.getElementById('sexLab')).removeClass("female"); }else if(sex=='2'){ $(document.getElementById('main').contentWindow.document.getElementById('sexLab')).addClass("female"); } } }); }, error:function(){ alert("error"); }, complete:function(data){ } }); } //退出登陆 function exitLogon(){ $.ajax({ url:'/ecenter/ecenterClub/loginRegisterNew/newLogin/logout', type:'post', async:false, success:function(data){ if('success' == data){ //清空登录信息; $.ajax({ url:'/EbsWeb/GetEntryid', async:false, data:'flag=exit&entryID='+$("#entryId").val()+'&next=' + Math.random(), success:function(data){}, error:function(data){} }); if(document.getElementById("entryId")!=null){ document.getElementById("entryId").value = ""; } if(document.getElementById('main')){ document.getElementById('main').contentWindow.document.getElementById('entryID').value=""; } $("#isExitLogin").val("1"); var service = window.location.href; var redirectUrl = "/cas/logout?service="+service ; window.location.href = redirectUrl; } }, error:function(data){} }); var forwardUrl = "http://www.epicc.com.cn/EbsWeb/loginAjax.do"; var param = "UIAction=exit"; $.get(forwardUrl + "?next=" + Math.random() + "&acrossDomain=acrossDomain&" + param,{}, function (data){logonResult2(returnXML);},"script"); } $(document).ready(function(){ var vtop = document.getElementById("vtop");//头部 $.ajax({ url:'/ecenter/views/loginRegister/support/findLt.jsp?n=' + Math.random(), type:'get', dateType:'html', success:function(data){ var unamelt = $.trim(data); if (unamelt !='null' && ""!=unamelt) { if("@".indexOf(unamelt) == -1){ if(unamelt.substring(0,4) == "sina"){ unamelt = "新浪微博用户"; }else if(unamelt.substring(0,2) == "qq"){ unamelt = "腾讯用户"; } } if(document.getElementById("entryId") != null){ $("#entryId").val(unamelt); } if(document.getElementById('main')){ $(document.getElementById('main').contentWindow.document.getElementById('entryID')).val(unamelt); } var showname = unamelt; if(vtop != null){ if(showname.length >30){ showname = showname.substring(0, 30) + '..'; } vtop.style.display = 'inline-block'; vtop.innerHTML = '您好,' + (showname.length > 30 ? (showname.substring(0,30) + '..'):showname) + afterLogonT; } doLogon2(); } }, error:function(){} }); }); //校验用户名必须是:5-50个字符(包括小写字母、数字、下划线、中文),一个汉字为两个字符。 function bytes(str){ if(typeof(str)!='string'){ str = str.value; } var len = 0; for(var i = 0; i < str.length; i++){ if(str.charCodeAt(i) > 127){ len++; } len++; } return len; } function chkstr(str){ if(typeof(str)!='string'){ str = str.value; } for(var i = 0; i < str.length; i++){ if (!str.substr(i,1).match(/^\w+$/ig)){//str.charCodeAt(i) < 127 && return false; } } return true; } //获取验证码; function newRandImg2(rand){ document.getElementById(rand).src="http://www.epicc.com.cn/ecenter/CreateImage?randName=loginRandDiv&uuid="+$("#uuidLogin").val()+"&next="+Math.random(); } //监测代码 function loginSuccess(){ } function lightJGlogin(){ }