weixin_common.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. //切换发布版本 true:正式版,连接生产环境;false:测试版,连接测试环境。
  2. var publish_version = true;
  3. //var publish_version = false;
  4. if(publish_version){
  5. //正式环境(城市爱健康)
  6. var server = "http://srijk.yihu.com/wlyy/";
  7. var appId = "wx49aa3a51b0aca27d";
  8. var urlName = "wlyy";
  9. var weixinUrl = "srijk.yihu.com";
  10. var agentName = "wlyyAgent";
  11. var agentName1 = "wlyyAgent1";
  12. var OpenidAgent = "OpenidAgent";
  13. var judgeAgent = "judgeAgent";
  14. var pageName = "pageurl";
  15. var wxurl = "http%3a%2f%2fwww.srijk.com%2fwlyy%2fwx%2fhtml";
  16. var imurl="http://27.154.233.186:3030";
  17. var imgUrlDomain = 'http://srijk.yihu.com/';
  18. var profileServer = "http://srijk.yihu.com"; // 健康档案(上饶)服务地址
  19. var registrationServer = "https://wxauth.yihu.com";// 预约挂号服务地址
  20. var yuYueAppId = "9000424";//预约挂号-应用ID
  21. var hospitalId = "1025056";//预约挂号-上饶县人民医院的id
  22. }else{
  23. //测试环境
  24. // var server = "http://ehr.yihu.com/csijk/"; //旧
  25. // var server = "http://172.19.103.72:9096/wlyy/"; //旧
  26. var server = "http://172.26.0.122:8081/wlyy/";
  27. // var server = "http://192.168.131.24:8082/";//仕杰
  28. // var server = "http://192.168.131.102:8081/";//伟达
  29. // var server = "http://192.168.131.127:8081/";//逸祥
  30. // var server = "http://192.168.131.133:8080/";//文杰
  31. //var server = "http://192.168.131.250:8081/";
  32. //var server = "http://192.168.131.131:8080/"; //文斌
  33. // var server = "http://192.168.131.128:8081/"; //维山
  34. // var server = "http://192.168.131.144:8081/"; //冬梅
  35. var appId = "wx0a06b75a40b28f2a";
  36. var urlName = "wlyy";
  37. var weixinUrl = "srijk.yihu.com";
  38. var agentName = "wlyyAgent";
  39. var agentName1 = "wlyyAgent1";
  40. var OpenidAgent = "OpenidAgent";
  41. var judgeAgent = "judgeAgent";
  42. var pageName = "pageurl";
  43. var wxurl = "http%3a%2f%2fwww.srijk.com%2fwlyy%2fwx%2fhtml";
  44. var imgUrlDomain = "http://172.26.0.110:8888/";//添加图片服务器路径;
  45. var imurl="http://172.26.0.118:3000";
  46. // var imurl="http://172.19.103.72:3000"; //旧
  47. // var imgUrlDomain = 'http://172.19.103.54/'; //旧
  48. var profileServer = "http://ehr.yihu.com"; // 健康档案(上饶)服务地址
  49. var registrationServer = "https://mguidewebtest.yihu.com";// 预约挂号服务地址
  50. var yuYueAppId = "9000424";//预约挂号-应用ID
  51. var hospitalId = "1024727";//预约挂号-健康之路(演示医院)
  52. }
  53. //添加openid白名单,只有这个名单内的openid才可以在线支付
  54. var openidList = [];
  55. //设置变量,控制是否可以在线支付
  56. var canPayOnline = true;
  57. if(GetRequest().openid){
  58. checkCanPayOnline(GetRequest().openid);
  59. }
  60. //添加处方功能的openid白名单
  61. var prescriptionOpenidList = ['123456'];
  62. var canPrescription = true;
  63. if(GetRequest().openid){
  64. checkCanPrescription(GetRequest().openid);
  65. }
  66. //保存userAgent
  67. function wxSaveUserAgent(id, uid, openid, token,lastUid) {
  68. if(window.localStorage.getItem(agentName)){
  69. window.localStorage.removeItem(agentName);
  70. }
  71. var userAgent = {
  72. id: id,
  73. uid: uid,
  74. openid: openid,
  75. token: token,
  76. lastUid: (lastUid ? lastUid:""),
  77. platform: 3
  78. }
  79. userAgent = JSON.stringify(userAgent);
  80. // var userAgent = "{\"id\":" + id + ",\"uid\":\"" + uid + "\",\"openid\":\"" + openid + "\",\"token\":\"" + token + "\",\"lastUid\":\"" + (lastUid ? lastUid:"") + "\",\"platform\":3}";
  81. window.localStorage.setItem(agentName, userAgent);
  82. return userAgent;
  83. }
  84. //保存userAgent1
  85. function wxSaveUserAgent1(uid, name, photo) {
  86. if(window.localStorage.getItem(agentName1)){
  87. window.localStorage.removeItem(agentName1);
  88. }
  89. var userAgent = {
  90. uid: uid,
  91. name: name,
  92. photo: photo
  93. }
  94. userAgent = JSON.stringify(userAgent);
  95. // var userAgent = "{\"uid\":" + uid + ",\"name\":\"" + name + "\",\"photo\":\"" + photo + "\"}";
  96. window.localStorage.setItem(agentName1, userAgent);
  97. return userAgent;
  98. }
  99. //保存openid
  100. function saveAgentOpenid(openid){
  101. if(window.localStorage.getItem(OpenidAgent)){
  102. window.localStorage.removeItem(OpenidAgent);
  103. }
  104. var agentOpenid = "{\"openid\":\"" + openid + "\"}";
  105. window.localStorage.setItem(OpenidAgent, agentOpenid);
  106. }
  107. //保存页面跳转值
  108. function saveAgentJudge(judge){
  109. if(window.localStorage.getItem(judgeAgent)){
  110. window.localStorage.removeItem(judgeAgent);
  111. }
  112. var agentJudge = "{\"judge\":" + judge + "}";
  113. window.localStorage.setItem(judgeAgent, agentJudge);
  114. }
  115. //保存跳转页面到agent
  116. function saveAgentPage(pageurl){
  117. if(window.localStorage.getItem(pageName)){
  118. window.localStorage.removeItem(pageName);
  119. }
  120. var agentPage = "{\"pageurl\":\"" + pageurl + "\"}";
  121. window.localStorage.setItem(pageName, agentPage);
  122. //如果页面中有code这个参数,及微信授权返回的code,将这个code保存在storage中
  123. if(pageurl.indexOf("code=") > -1){
  124. var arr = pageurl.split("code=");
  125. var code = arr[1].split("&")[0];
  126. window.localStorage.setItem("weixinCode", code);
  127. }
  128. }
  129. //清空所有的agent
  130. function clearAgent(){
  131. if(window.localStorage.getItem(agentName)){
  132. window.localStorage.removeItem(agentName);
  133. }
  134. if(window.localStorage.getItem(agentName1)){
  135. window.localStorage.removeItem(agentName1);
  136. }
  137. window.localStorage.removeItem("weixinCode"); //清楚缓存的code
  138. // if(window.localStorage.getItem(OpenidAgent)){
  139. // window.localStorage.removeItem(OpenidAgent);
  140. // }
  141. }
  142. //获取链接上的参数
  143. function GetRequest() {
  144. var url = location.search; //获取url中"?"符后的字串
  145. var theRequest = new Object();
  146. if (url.indexOf("?") != -1) {
  147. var str = url.substr(1);
  148. strs = str.split("&");
  149. for(var i = 0; i < strs.length; i ++) {
  150. theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
  151. }
  152. }
  153. //添加toName的信息
  154. if(theRequest.toName){
  155. localStorage.setItem("toName", theRequest.toName);
  156. }
  157. return theRequest;
  158. }
  159. // 验证居民信息是否完善
  160. function checkBaseInfo() {
  161. var userAgent = window.localStorage.getItem(agentName);
  162. if(userAgent) {
  163. userAgent = JSON.parse(userAgent)
  164. sendPost('weixin/checkBaseInfo', {patient: userAgent.uid}, 'json', 'post', function(res) {
  165. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg || "信息获取失败!",bottom:true}).show();
  166. }, function(res){
  167. console.log(res)
  168. if(!res.data) {
  169. window.location.href = "../../home/html/improve-user-info.html"
  170. }
  171. })
  172. }
  173. }
  174. //新的判断用户是否登录的方法,先校验openid是否一致
  175. function checkUserAgent(){
  176. var Request = new Object();
  177. Request = GetRequest();
  178. var code = Request["code"];
  179. var userAgent = window.localStorage.getItem(agentName);
  180. var agentCode = localStorage.getItem("weixinCode");
  181. if(code == "" || code == null || code == undefined){
  182. if(agentCode){
  183. //存在agentCode,说明一定获取openid成功过。
  184. if(!userAgent){
  185. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  186. agentOpenids = JSON.parse(agentOpenids);
  187. var url = window.parent.location.href;
  188. saveAgentPage(url);
  189. window.location.href = "../../home/html/login.html?type=0&openid=" + agentOpenids.openid;
  190. }else{
  191. try{
  192. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  193. if(agentOpenids){
  194. agentOpenids = JSON.parse(agentOpenids);
  195. checkCanPayOnline(agentOpenids.openid);
  196. checkCanPrescription(agentOpenids.openid);
  197. }
  198. queryInit();
  199. }catch(e){
  200. }
  201. }
  202. }else{
  203. if(!userAgent){
  204. // d.close();
  205. // dialog({contentType:'tipsbox', skin:'bk-popup' , content:'授权失败',bottom:true}).show();
  206. //模板消息的情况,模板消息带上openid的值给页面
  207. var agentOpenids = JSON.parse(window.localStorage.getItem(OpenidAgent));
  208. var openid = Request['openid']||((agentOpenids && agentOpenids.openid)?agentOpenids.openid:"");
  209. saveAgentOpenid(openid);
  210. var url = window.parent.location.href;
  211. saveAgentPage(url);
  212. if(openid){
  213. window.location.href = "../../home/html/login.html?type=0&openid=" + openid;
  214. }else{
  215. window.location.href = "../../home/html/login.html?type=0";
  216. }
  217. }else{
  218. try{
  219. checkCanPayOnline(Request['openid']);
  220. checkCanPrescription(Request['openid']);
  221. queryInit();
  222. }catch(e){
  223. }
  224. }
  225. }
  226. }
  227. else{
  228. //校验code与缓存中的code是否一致,一致的话则不再向后端获取openid,因为code只能使用一次
  229. if(agentCode && (code == agentCode)){
  230. try{
  231. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  232. if(agentOpenids){
  233. agentOpenids = JSON.parse(agentOpenids);
  234. checkCanPayOnline(agentOpenids.openid);
  235. checkCanPrescription(agentOpenids.openid)
  236. }
  237. queryInit();
  238. }catch(e){
  239. }
  240. }else{
  241. //校验登录的openid是否与缓存中存在的一致
  242. // d.show();
  243. sendPost('weixin/getOpenidByCode', {code: code}, 'json', 'post', openidFailed, function(res){
  244. if (res.status == 200) {
  245. //d.close();
  246. localStorage.setItem("weixinCode", code);
  247. var openid = res.openid,
  248. agentOpenids = window.localStorage.getItem(OpenidAgent),
  249. agentOpenid = agentOpenids && JSON.parse(agentOpenids).openid;
  250. saveAgentOpenid(openid);
  251. if( agentOpenid == openid){
  252. if(!userAgent){
  253. var url = window.parent.location.href;
  254. saveAgentPage(url);
  255. window.location.href = "../../home/html/login.html?type=0&openid=" + openid;
  256. }else{
  257. try{
  258. checkCanPayOnline(openid);
  259. checkCanPrescription(openid);
  260. queryInit();
  261. }catch(e){
  262. }
  263. }
  264. }else{
  265. var url = window.parent.location.href;
  266. saveAgentPage(url);
  267. window.location.href = server + "wx/html/home/html/login.html?type=0&openid=" + openid;
  268. }
  269. } else {
  270. openidFailed(res);
  271. }
  272. });
  273. }
  274. }
  275. }
  276. //判断用户是否登录
  277. function checkUserAgent1(){
  278. var userAgent = window.localStorage.getItem(agentName);
  279. if(!userAgent){
  280. var agentOpenid = window.localStorage.getItem(OpenidAgent);
  281. if(!agentOpenid||agentOpenid=="undefined"){
  282. var Request = new Object();
  283. Request = GetRequest();
  284. var code = Request["code"];
  285. if(code == "" || code == null || code == undefined){
  286. d.close();
  287. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'授权失败',bottom:true}).show();
  288. }
  289. else{
  290. d.show();
  291. var data = {};
  292. data.code = code;
  293. sendPost('weixin/getOpenidByCode', data, 'json', 'post', openidFailed, openidSuccess);
  294. }
  295. }
  296. else{
  297. var jsonstr = $.parseJSON(agentOpenid);
  298. var openid = jsonstr.openid;
  299. if((pagetype>=20&&pagetype<=27) || pagetype=='-1' || pagetype==3 || !pagetype){
  300. pagetype = 0;
  301. window.localStorage.setItem(pageName, JSON.stringify({pageurl: location.href}))
  302. }
  303. // window.location.href = server + "wx/html/home/html/zhmm-login.html?type=" + pagetype + "&openid=" + openid;
  304. window.location.href = "../../home/html/login.html?type=" + pagetype //+ "&openid=" + openid;
  305. }
  306. }
  307. else{
  308. try{
  309. queryInit();
  310. }catch(e){
  311. }
  312. }
  313. }
  314. //判断openid是否在可以在线支付的白名单里面
  315. function checkCanPayOnline(id){
  316. if(id && openidList.indexOf(id)>-1){
  317. canPayOnline = true;
  318. }
  319. }
  320. //判断openid是否在可以开启处方功能的白名单中
  321. function checkCanPrescription(id){
  322. if(id && prescriptionOpenidList.indexOf(id)>-1){
  323. canPrescription = true;
  324. }
  325. }
  326. //成功
  327. function openidSuccess(res) {
  328. if (res.status == 200) {
  329. var openid = res.openid;
  330. saveAgentOpenid(openid);
  331. window.location.href = server + "wx/html/home/html/zhmm-login.html?type=" + pagetype + "&openid=" + openid;
  332. } else {
  333. openidFailed(res);
  334. }
  335. }
  336. //失败
  337. function openidFailed(res) {
  338. d.close();
  339. // if(window.localStorage.getItem(OpenidAgent)){
  340. // window.localStorage.removeItem(OpenidAgent);
  341. // }
  342. if (res && res.msg) {
  343. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
  344. } else {
  345. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'获取认证信息失败',bottom:true}).show();
  346. }
  347. }
  348. //判断用户是否有签约
  349. function checkSign(type){
  350. d.show();
  351. var userAgent = window.localStorage.getItem(agentName);
  352. if(userAgent){
  353. var data = {};
  354. $.ajax(server + "patient/is_sign", {
  355. data: data,
  356. type: 'POST',
  357. dataType: 'json',
  358. beforeSend: function(request) {
  359. request.setRequestHeader("userAgent", userAgent);
  360. },
  361. error: function(res) {
  362. d.close();
  363. if(res.status == 999 || res.status == 998 || res.status == 997){
  364. loginUrl(res.status);
  365. return;
  366. }
  367. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'校验失败',bottom:true}).show();
  368. },
  369. success: function(res) {
  370. d.close();
  371. if(res.status == 999 || res.status == 998 || res.status == 997){
  372. loginUrl(res.status);
  373. }
  374. else if (res.status == 200) {
  375. var is_sign = res.data;//0未签约,1已签约
  376. if(is_sign == 0){
  377. dialog({
  378. title: '提示',
  379. content: '您还未签约,请先签约,谢谢!',
  380. okValue:'签约',
  381. ok: function (){
  382. window.location.href = server + "wx/html/ssgg/html/choose-region.html";
  383. },
  384. cancelValue: '不了',
  385. cancel: function () {
  386. return;
  387. }
  388. }).showModal();
  389. }else{
  390. if(type == 1){
  391. window.location.href = server + "wx/html/zxwz/html/teachers-consult-commit.html";
  392. }
  393. }
  394. } else {
  395. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
  396. }
  397. }
  398. });
  399. }
  400. else{
  401. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'用户信息错误',bottom:true}).show();
  402. }
  403. }
  404. var toUsers = localStorage.getItem("toUser");
  405. var curId = localStorage.getItem("id");
  406. var toName = localStorage.getItem("toName");
  407. var consultCode = localStorage.getItem("consultCode");
  408. var article = localStorage.getItem("article");
  409. var pageUrl = {
  410. /**通用跳转**/
  411. 0:function(){
  412. var pageurl = "";
  413. var agentPage = window.localStorage.getItem(pageName);
  414. if(agentPage){
  415. var jsonstr = $.parseJSON(agentPage);
  416. pageurl = jsonstr.pageurl;
  417. }
  418. if(pageurl){
  419. return pageurl;
  420. }else{
  421. return "../../grzx/html/my-detail.html";
  422. }
  423. }(),
  424. //关注咨询列表
  425. "1": "../../yszx/html/doctor-consultation.html",
  426. //我的关注医生列表
  427. "2": "../../yszx/html/focused-doctor.html",
  428. //查找医生
  429. "3": "../../yszx/html/select-consult-doctor.html",
  430. //个人中心
  431. "4": "../../grzx/html/my-detail.html",
  432. // 健康档案
  433. "5": "../../profile/html/index.html",
  434. //我的家庭
  435. "6":"../../jtgx/html/family.html",
  436. /**医生指导详情**/
  437. "25":"../../yszd/html/guidance-detail.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  438. // /**新的健康教育详情**/
  439. "50":"../../jkjy/html/article2.html?dataId="+article+"&toUser="+toUsers+"&toName="+toName,
  440. //预约挂号
  441. "51": "../../wdyy/html/yuyueguahao.html",
  442. //预约记录
  443. "52": "../../wdyy/html/yuyuejilu.html",
  444. ///**签约管理首页**/ "-1":"../../qygl/html/signing-doctors.html",//签约管理首页
  445. ///**医生咨询首页**/ 1:"../../yszx/html/doctor-consultation.html",
  446. ///**医生指导首页**/ 3:"../../yszd/html/doctor-guidance.html",//医生指导首页
  447. ///**疾病社区首页**/ 4:"../../jbsq/html/disease-community.html",//疾病社区首页
  448. ///**健康记录首页**/ 5:"../../jkjl/html/health-record.html",//健康记录
  449. ///**我的设备首页**/ 6:"../../wdsb/html/my-equipments.html",//我的设备
  450. ///**我的资料首页**/ 11:"../../grzx/html/my-detail.html",
  451. ///**我的设备首页**/ 15:"../../wdsb/html/my-equipments.html",
  452. ///**签约选择医生**/ 16:"../../qygl/html/select-doctor.html",
  453. ///**签约搜索医生**/ 17:"../../qygl/html/search-doctor.html",
  454. ///**签约医生主页**/ 18:function(){
  455. // var doctor = localStorage.getItem("doccode");
  456. // return "../../ssgg/html/doctor-homepage-new.html?openid="+0+"&state="+doctor;
  457. // }(),
  458. ///**我的预约首页**/ 20:"../../wdyy/html/my-appointment.html",
  459. ///**预约挂号提交**/ 21:"https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+wxurl+"%2fwdyy%2fhtml%2finfo-confirm.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect",
  460. // 22:"../../jtgx/html/family.html",
  461. ///**预约详情首页**/ 23:"../../wdyy/html/detail-appointment.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  462. ///**医生咨询详情**/ 24:"../../yszx/html/consulting-doctor.html?openid="+0+"&toUser="+toUsers+"&consult="+consultCode+"&toName="+toName,
  463. ///**医生指导详情**/ 25:"../../yszd/html/guidance-detail.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  464. ///**健康教育**/ 26:"../../jkjy/html/article_list.html",
  465. ///**健康详情**/ 27:function(){
  466. // var artoUser = localStorage.getItem("toUser");
  467. // var article = localStorage.getItem("article");
  468. // return "../../jkjy/html/article.html?dataId="+article+"&toUser="+artoUser+"&toName="+toName;
  469. // }(),
  470. // /**新的健康详情**/ 50:function(){
  471. // var artoUser = localStorage.getItem("toUser");
  472. // var article = localStorage.getItem("article");
  473. // return "../../jkjy/html/article2.html?dataId="+article+"&toUser="+artoUser+"&toName="+toName;
  474. // }(),
  475. // 28:"../../jkda/html/jiuzhenjilu.html",
  476. // 29:"../../jkda/html/jianchajianyan.html",
  477. // 30:"../../survey/html/survey_info.html?openid="+0+"&toUser="+toUsers+"&toName="+toName+"&survey_id="+localStorage.getItem("survey_id"),
  478. ///**签约管理首页2**/ 31:"../../qygl/html/signing_management.html",//签约管理首页
  479. ///*社区体检*/ 32: "../../jkda/html/jiankangtijian.html",
  480. ///*续签页面*/ 33: "../../xuqian/html/information.html",
  481. ///**意见反馈**/ 34:"../../yjfk/html/feedback.html",
  482. ///**公共咨询**/ 36:"../../jbsq/html/public-consult-detail.html",
  483. ///*处方记录 */ 38: "../../prescription/html/prescription_records.html",
  484. ///*续方订单跟踪页*/ 41: '../../prescription/html/order_tracking.html?openid='+0+'&toUser='+toUsers+'&toName='+toName+'&code='+window.localStorage.getItem("prescriptionCode"),
  485. /////*续方记录页*/ 42: '../../prescription/html/re-prescription_info.html?openid='+0+'&toUser='+toUsers+'&toName='+toName+'&code='+window.localStorage.getItem("prescriptionCode"),
  486. // /*孕检计划*/ 45: "../../fybj/html/yunjianjihua.html",
  487. // /*免疫计划*/ 46: "../../fybj/html/mianyijihua.html",
  488. // /*慢病管理修改*/ 47: "../../jbsq/html/slow-disease-manage.html",
  489. // /**免疫预约首页**/ 48:"../../wdyy/html/immune-appointment.html",
  490. // /**免疫预约详情页**/ 49:"../../wdyy/html/detail-immune-appointment.html"
  491. }
  492. Date.prototype.Format = function(formatStr)
  493. {
  494. var str = formatStr;
  495. var Week = ['日','一','二','三','四','五','六'];
  496. str=str.replace(/yyyy|YYYY/,this.getFullYear());
  497. str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));
  498. str=str.replace(/MM/,this.getMonth()>8?(this.getMonth()+1).toString():'0' + (this.getMonth()+1));
  499. str=str.replace(/M/g,this.getMonth()+1);
  500. str=str.replace(/w|W/g,Week[this.getDay()]);
  501. str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());
  502. str=str.replace(/d|D/g,this.getDate());
  503. str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());
  504. str=str.replace(/h|H/g,this.getHours());
  505. str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());
  506. str=str.replace(/m/g,this.getMinutes());
  507. str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());
  508. str=str.replace(/s|S/g,this.getSeconds());
  509. return str;
  510. }
  511. var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
  512. //document.write(unescape("%3Cspan style='display:none' id='cnzz_stat_icon_1265315380'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s22.cnzz.com/z_stat.php%3Fid%3D1265315380' type='text/javascript'%3E%3C/script%3E"));