weixin_common.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  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. //新的判断用户是否登录的方法,先校验openid是否一致
  160. function checkUserAgent(){
  161. var Request = new Object();
  162. Request = GetRequest();
  163. var code = Request["code"];
  164. var userAgent = window.localStorage.getItem(agentName);
  165. var agentCode = localStorage.getItem("weixinCode");
  166. if(code == "" || code == null || code == undefined){
  167. if(agentCode){
  168. //存在agentCode,说明一定获取openid成功过。
  169. if(!userAgent){
  170. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  171. agentOpenids = JSON.parse(agentOpenids);
  172. var url = window.parent.location.href;
  173. saveAgentPage(url);
  174. window.location.href = "../../home/html/login.html?type=0&openid=" + agentOpenids.openid;
  175. }else{
  176. try{
  177. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  178. if(agentOpenids){
  179. agentOpenids = JSON.parse(agentOpenids);
  180. checkCanPayOnline(agentOpenids.openid);
  181. checkCanPrescription(agentOpenids.openid);
  182. }
  183. queryInit();
  184. }catch(e){
  185. }
  186. }
  187. }else{
  188. if(!userAgent){
  189. // d.close();
  190. // dialog({contentType:'tipsbox', skin:'bk-popup' , content:'授权失败',bottom:true}).show();
  191. //模板消息的情况,模板消息带上openid的值给页面
  192. var agentOpenids = JSON.parse(window.localStorage.getItem(OpenidAgent));
  193. var openid = Request['openid']||agentOpenids.openid?agentOpenids.openid:"";
  194. saveAgentOpenid(openid);
  195. var url = window.parent.location.href;
  196. saveAgentPage(url);
  197. if(openid){
  198. window.location.href = "../../home/html/login.html?type=0&openid=" + openid;
  199. }else{
  200. window.location.href = "../../home/html/login.html?type=0";
  201. }
  202. }else{
  203. try{
  204. checkCanPayOnline(Request['openid']);
  205. checkCanPrescription(Request['openid']);
  206. queryInit();
  207. }catch(e){
  208. }
  209. }
  210. }
  211. }
  212. else{
  213. //校验code与缓存中的code是否一致,一致的话则不再向后端获取openid,因为code只能使用一次
  214. if(agentCode && (code == agentCode)){
  215. try{
  216. var agentOpenids = window.localStorage.getItem(OpenidAgent);
  217. if(agentOpenids){
  218. agentOpenids = JSON.parse(agentOpenids);
  219. checkCanPayOnline(agentOpenids.openid);
  220. checkCanPrescription(agentOpenids.openid)
  221. }
  222. queryInit();
  223. }catch(e){
  224. }
  225. }else{
  226. //校验登录的openid是否与缓存中存在的一致
  227. // d.show();
  228. sendPost('weixin/getOpenidByCode', {code: code}, 'json', 'post', openidFailed, function(res){
  229. if (res.status == 200) {
  230. //d.close();
  231. localStorage.setItem("weixinCode", code);
  232. var openid = res.openid,
  233. agentOpenids = window.localStorage.getItem(OpenidAgent),
  234. agentOpenid = agentOpenids && JSON.parse(agentOpenids).openid;
  235. saveAgentOpenid(openid);
  236. if( agentOpenid == openid){
  237. if(!userAgent){
  238. var url = window.parent.location.href;
  239. saveAgentPage(url);
  240. window.location.href = "../../home/html/login.html?type=0&openid=" + openid;
  241. }else{
  242. try{
  243. checkCanPayOnline(openid);
  244. checkCanPrescription(openid);
  245. queryInit();
  246. }catch(e){
  247. }
  248. }
  249. }else{
  250. var url = window.parent.location.href;
  251. saveAgentPage(url);
  252. window.location.href = server + "wx/html/home/html/login.html?type=0&openid=" + openid;
  253. }
  254. } else {
  255. openidFailed(res);
  256. }
  257. });
  258. }
  259. }
  260. }
  261. //判断用户是否登录
  262. function checkUserAgent1(){
  263. var userAgent = window.localStorage.getItem(agentName);
  264. if(!userAgent){
  265. var agentOpenid = window.localStorage.getItem(OpenidAgent);
  266. if(!agentOpenid||agentOpenid=="undefined"){
  267. var Request = new Object();
  268. Request = GetRequest();
  269. var code = Request["code"];
  270. if(code == "" || code == null || code == undefined){
  271. d.close();
  272. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'授权失败',bottom:true}).show();
  273. }
  274. else{
  275. d.show();
  276. var data = {};
  277. data.code = code;
  278. sendPost('weixin/getOpenidByCode', data, 'json', 'post', openidFailed, openidSuccess);
  279. }
  280. }
  281. else{
  282. var jsonstr = $.parseJSON(agentOpenid);
  283. var openid = jsonstr.openid;
  284. if((pagetype>=20&&pagetype<=27) || pagetype=='-1' || pagetype==3 || !pagetype){
  285. pagetype = 0;
  286. window.localStorage.setItem(pageName, JSON.stringify({pageurl: location.href}))
  287. }
  288. // window.location.href = server + "wx/html/home/html/zhmm-login.html?type=" + pagetype + "&openid=" + openid;
  289. window.location.href = "../../home/html/login.html?type=" + pagetype //+ "&openid=" + openid;
  290. }
  291. }
  292. else{
  293. try{
  294. queryInit();
  295. }catch(e){
  296. }
  297. }
  298. }
  299. //判断openid是否在可以在线支付的白名单里面
  300. function checkCanPayOnline(id){
  301. if(id && openidList.indexOf(id)>-1){
  302. canPayOnline = true;
  303. }
  304. }
  305. //判断openid是否在可以开启处方功能的白名单中
  306. function checkCanPrescription(id){
  307. if(id && prescriptionOpenidList.indexOf(id)>-1){
  308. canPrescription = true;
  309. }
  310. }
  311. //成功
  312. function openidSuccess(res) {
  313. if (res.status == 200) {
  314. var openid = res.openid;
  315. saveAgentOpenid(openid);
  316. window.location.href = server + "wx/html/home/html/zhmm-login.html?type=" + pagetype + "&openid=" + openid;
  317. } else {
  318. openidFailed(res);
  319. }
  320. }
  321. //失败
  322. function openidFailed(res) {
  323. d.close();
  324. // if(window.localStorage.getItem(OpenidAgent)){
  325. // window.localStorage.removeItem(OpenidAgent);
  326. // }
  327. if (res && res.msg) {
  328. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
  329. } else {
  330. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'获取认证信息失败',bottom:true}).show();
  331. }
  332. }
  333. //判断用户是否有签约
  334. function checkSign(type){
  335. d.show();
  336. var userAgent = window.localStorage.getItem(agentName);
  337. if(userAgent){
  338. var data = {};
  339. $.ajax(server + "patient/is_sign", {
  340. data: data,
  341. type: 'POST',
  342. dataType: 'json',
  343. beforeSend: function(request) {
  344. request.setRequestHeader("userAgent", userAgent);
  345. },
  346. error: function(res) {
  347. d.close();
  348. if(res.status == 999 || res.status == 998 || res.status == 997){
  349. loginUrl(res.status);
  350. return;
  351. }
  352. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'校验失败',bottom:true}).show();
  353. },
  354. success: function(res) {
  355. d.close();
  356. if(res.status == 999 || res.status == 998 || res.status == 997){
  357. loginUrl(res.status);
  358. }
  359. else if (res.status == 200) {
  360. var is_sign = res.data;//0未签约,1已签约
  361. if(is_sign == 0){
  362. dialog({
  363. title: '提示',
  364. content: '您还未签约,请先签约,谢谢!',
  365. okValue:'签约',
  366. ok: function (){
  367. window.location.href = server + "wx/html/ssgg/html/choose-region.html";
  368. },
  369. cancelValue: '不了',
  370. cancel: function () {
  371. return;
  372. }
  373. }).showModal();
  374. }else{
  375. if(type == 1){
  376. window.location.href = server + "wx/html/zxwz/html/teachers-consult-commit.html";
  377. }
  378. }
  379. } else {
  380. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg,bottom:true}).show();
  381. }
  382. }
  383. });
  384. }
  385. else{
  386. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'用户信息错误',bottom:true}).show();
  387. }
  388. }
  389. var toUsers = localStorage.getItem("toUser");
  390. var curId = localStorage.getItem("id");
  391. var toName = localStorage.getItem("toName");
  392. var consultCode = localStorage.getItem("consultCode");
  393. var article = localStorage.getItem("article");
  394. var pageUrl = {
  395. /**通用跳转**/
  396. 0:function(){
  397. var pageurl = "";
  398. var agentPage = window.localStorage.getItem(pageName);
  399. if(agentPage){
  400. var jsonstr = $.parseJSON(agentPage);
  401. pageurl = jsonstr.pageurl;
  402. }
  403. if(pageurl){
  404. return pageurl;
  405. }else{
  406. return "../../grzx/html/my-detail.html";
  407. }
  408. }(),
  409. //关注咨询列表
  410. "1": "../../yszx/html/doctor-consultation.html",
  411. //我的关注医生列表
  412. "2": "../../yszx/html/focused-doctor.html",
  413. //查找医生
  414. "3": "../../yszx/html/select-consult-doctor.html",
  415. //个人中心
  416. "4": "../../grzx/html/my-detail.html",
  417. // 健康档案
  418. "5": "../../profile/html/index.html",
  419. //我的家庭
  420. "6":"../../jtgx/html/family.html",
  421. /**医生指导详情**/
  422. "25":"../../yszd/html/guidance-detail.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  423. // /**新的健康教育详情**/
  424. "50":"../../jkjy/html/article2.html?dataId="+article+"&toUser="+toUsers+"&toName="+toName,
  425. //预约挂号
  426. "51": "../../wdyy/html/yuyueguahao.html",
  427. //预约记录
  428. "52": "../../wdyy/html/yuyuejilu.html",
  429. ///**签约管理首页**/ "-1":"../../qygl/html/signing-doctors.html",//签约管理首页
  430. ///**医生咨询首页**/ 1:"../../yszx/html/doctor-consultation.html",
  431. ///**医生指导首页**/ 3:"../../yszd/html/doctor-guidance.html",//医生指导首页
  432. ///**疾病社区首页**/ 4:"../../jbsq/html/disease-community.html",//疾病社区首页
  433. ///**健康记录首页**/ 5:"../../jkjl/html/health-record.html",//健康记录
  434. ///**我的设备首页**/ 6:"../../wdsb/html/my-equipments.html",//我的设备
  435. ///**我的资料首页**/ 11:"../../grzx/html/my-detail.html",
  436. ///**我的设备首页**/ 15:"../../wdsb/html/my-equipments.html",
  437. ///**签约选择医生**/ 16:"../../qygl/html/select-doctor.html",
  438. ///**签约搜索医生**/ 17:"../../qygl/html/search-doctor.html",
  439. ///**签约医生主页**/ 18:function(){
  440. // var doctor = localStorage.getItem("doccode");
  441. // return "../../ssgg/html/doctor-homepage-new.html?openid="+0+"&state="+doctor;
  442. // }(),
  443. ///**我的预约首页**/ 20:"../../wdyy/html/my-appointment.html",
  444. ///**预约挂号提交**/ 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",
  445. // 22:"../../jtgx/html/family.html",
  446. ///**预约详情首页**/ 23:"../../wdyy/html/detail-appointment.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  447. ///**医生咨询详情**/ 24:"../../yszx/html/consulting-doctor.html?openid="+0+"&toUser="+toUsers+"&consult="+consultCode+"&toName="+toName,
  448. ///**医生指导详情**/ 25:"../../yszd/html/guidance-detail.html?openid="+0+"&toUser="+toUsers+"&id="+curId+"&toName="+toName,
  449. ///**健康教育**/ 26:"../../jkjy/html/article_list.html",
  450. ///**健康详情**/ 27:function(){
  451. // var artoUser = localStorage.getItem("toUser");
  452. // var article = localStorage.getItem("article");
  453. // return "../../jkjy/html/article.html?dataId="+article+"&toUser="+artoUser+"&toName="+toName;
  454. // }(),
  455. // /**新的健康详情**/ 50:function(){
  456. // var artoUser = localStorage.getItem("toUser");
  457. // var article = localStorage.getItem("article");
  458. // return "../../jkjy/html/article2.html?dataId="+article+"&toUser="+artoUser+"&toName="+toName;
  459. // }(),
  460. // 28:"../../jkda/html/jiuzhenjilu.html",
  461. // 29:"../../jkda/html/jianchajianyan.html",
  462. // 30:"../../survey/html/survey_info.html?openid="+0+"&toUser="+toUsers+"&toName="+toName+"&survey_id="+localStorage.getItem("survey_id"),
  463. ///**签约管理首页2**/ 31:"../../qygl/html/signing_management.html",//签约管理首页
  464. ///*社区体检*/ 32: "../../jkda/html/jiankangtijian.html",
  465. ///*续签页面*/ 33: "../../xuqian/html/information.html",
  466. ///**意见反馈**/ 34:"../../yjfk/html/feedback.html",
  467. ///**公共咨询**/ 36:"../../jbsq/html/public-consult-detail.html",
  468. ///*处方记录 */ 38: "../../prescription/html/prescription_records.html",
  469. ///*续方订单跟踪页*/ 41: '../../prescription/html/order_tracking.html?openid='+0+'&toUser='+toUsers+'&toName='+toName+'&code='+window.localStorage.getItem("prescriptionCode"),
  470. /////*续方记录页*/ 42: '../../prescription/html/re-prescription_info.html?openid='+0+'&toUser='+toUsers+'&toName='+toName+'&code='+window.localStorage.getItem("prescriptionCode"),
  471. // /*孕检计划*/ 45: "../../fybj/html/yunjianjihua.html",
  472. // /*免疫计划*/ 46: "../../fybj/html/mianyijihua.html",
  473. // /*慢病管理修改*/ 47: "../../jbsq/html/slow-disease-manage.html",
  474. // /**免疫预约首页**/ 48:"../../wdyy/html/immune-appointment.html",
  475. // /**免疫预约详情页**/ 49:"../../wdyy/html/detail-immune-appointment.html"
  476. }
  477. Date.prototype.Format = function(formatStr)
  478. {
  479. var str = formatStr;
  480. var Week = ['日','一','二','三','四','五','六'];
  481. str=str.replace(/yyyy|YYYY/,this.getFullYear());
  482. str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));
  483. str=str.replace(/MM/,this.getMonth()>8?(this.getMonth()+1).toString():'0' + (this.getMonth()+1));
  484. str=str.replace(/M/g,this.getMonth()+1);
  485. str=str.replace(/w|W/g,Week[this.getDay()]);
  486. str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());
  487. str=str.replace(/d|D/g,this.getDate());
  488. str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());
  489. str=str.replace(/h|H/g,this.getHours());
  490. str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());
  491. str=str.replace(/m/g,this.getMinutes());
  492. str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());
  493. str=str.replace(/s|S/g,this.getSeconds());
  494. return str;
  495. }
  496. var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
  497. //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"));