xosski

var httpobject=null

Jan 10th, 2025
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 261.57 KB | None | 0 0
  1. var httpObject = null;
  2. var wrong_entrytmrs = null;
  3. var i=0;
  4. //var rsuchange = new Array(63);
  5. var ntpval = null;
  6. var pmval = null;
  7. var haval = null;
  8. var licval = null;
  9. var networkchange = null;
  10. var ntpdchange = null;
  11. var licchange = null;
  12. var pmchange = null;
  13. var rsucha = null;
  14. var setradiopg = null;
  15. var detradioval = null;
  16. var defvalues = new Array();
  17.  
  18. function navlink(elem) {
  19. // get all 'a' elements
  20. var a = document.getElementsByClassName('nav_link');
  21. for (i = 0; i < a.length; i++) {
  22. // Remove the class 'active' if it exists
  23. a[i].classList.remove('active')
  24. }
  25. elem.classList.add('active');
  26. }
  27.  
  28. function get_dt()
  29. {
  30. //alert("goin for data");
  31. doWork(true,"get_dt_time","config");
  32. document.getElementById("close").style.display = "inline";
  33. document.getElementById("dt").style.opacity = 1.0;
  34. document.getElementById("dt").style.filter= "alpha(opacity=100)";
  35. document.getElementById("licence").style.opacity = 0.6;
  36. document.getElementById("licence").style.filter= "alpha(opacity=60)";
  37. }
  38.  
  39. function networkonly()
  40. {
  41. var a = document.getElementById("net_0").value;
  42. var b = document.getElementById("net_1").value;
  43. var c = document.getElementById("net_2").value;
  44. if((a==b)||(a==c)||(b==c))
  45. {
  46. alert("server addresses cannot be same");
  47. }
  48. else
  49. {
  50. for(i=0;i<10;i++)
  51. {
  52. var s = document.getElementById("net_"+i);
  53. if(s.name == "no")
  54. {
  55. s.style.border = "1px solid #FF0000";
  56. document.getElementById("cross"+"net_"+i).style.display="inline";
  57. break;
  58. }
  59. else
  60. {
  61. var ntp = null;
  62. for(i=0;i<9;i++)
  63. {
  64. if(document.getElementById("net_"+i).value == "")
  65. break;
  66. else if(i==8)
  67. {
  68. for(jdx=0;jdx<10;jdx++)
  69. {
  70. var x = document.getElementById("net_"+jdx);
  71. if(ntp == null)
  72. ntp = x.value;
  73. else
  74. ntp += ":"+x.value;
  75. }
  76. }
  77. }
  78. doWork(ntp,"set_confirm","config");
  79. }
  80. }
  81. }
  82. }
  83.  
  84. function maskvalid(mask)
  85. {
  86. //m[0] can be 128, 192, 224, 240, 248, 252, 254, 255
  87. //m[1] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[0] is 255, else m[1] must be 0
  88. //m[2] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[1] is 255, else m[2] must be 0
  89. //m[3] can be 128, 192, 224, 240, 248, 252, 254, 255 if m[2] is 255, else m[3] must be 0
  90.  
  91. var flag = 'True';
  92. var correct_range = {128:1,192:1,224:1,240:1,248:1,252:1,254:1,255:1,0:1};
  93. var m = mask.split('.');
  94.  
  95. for (var i = 0; i <= 3; i ++)
  96. {
  97. if (!(m[i] in correct_range)) {
  98. flag = 'False';
  99. break;
  100. }
  101. }
  102.  
  103. if ((m[0] == 0) || (m[0] != 255 && m[1] != 0) || (m[1] != 255 && m[2] != 0) || (m[2] != 255 && m[3] != 0)) {
  104. flag = 'False';
  105. }
  106.  
  107. return flag;
  108. }
  109.  
  110. function get_enblock()
  111. {
  112. //var data = document.getElementById("grpno").value;
  113. doWork(true,"get_enblock","enblock");
  114. }
  115. function rfr_tone()
  116. {
  117. var data = document.getElementById("grpno").value;
  118. doWork(data,"get_tonetab","tone");
  119. }
  120. function rfr_proto()
  121. {
  122. //alert("rfr_proto");
  123. var data = document.getElementById("prino").value;
  124. if(data == "Select")
  125. {
  126. alert("Please select pri number");
  127. return;
  128. }
  129. if(document.getElementById("proto_type").value == "P")
  130. {
  131. col_me(0);
  132. doWork(data,"get_protoprop","protocol");
  133. }
  134. else if(document.getElementById("proto_type").value == "T")
  135. {
  136. col_me(1);
  137. doWork(data,"get_prototim","protocol");
  138. }
  139. }
  140. function rfr_protim()
  141. {
  142. var data = document.getElementById("prino").value;
  143. if(data == "Select")
  144. {
  145. alert("Please select pri number");
  146. return;
  147. }
  148. if(document.getElementById("proto_type").value == "P")
  149. {
  150. col_me(0);
  151. doWork(data,"get_protoprop","protocol");
  152. }
  153. else if(document.getElementById("proto_type").value == "T")
  154. {
  155. col_me(1);
  156. doWork(data,"get_prototim","protocol");
  157. }
  158. }
  159. function get_prototab()
  160. {
  161. document.getElementById("notify").style.display = "none";
  162. doWork(true,"get_prototab","protocol");
  163. }
  164. function get_tonesel()
  165. {
  166. document.getElementById("notify").style.display = "none";
  167. doWork(true,"get_tonesel","tone");
  168. }
  169. function get_ccmd()
  170. {
  171. document.getElementById("notify").style.display = "none";
  172. doWork(true,"get_ccmd","ccmd");
  173. }
  174. function get_dcmd()
  175. {
  176. document.getElementById("notify").style.display = "none";
  177. doWork(true,"get_dcmd","dcmd");
  178. }
  179. function get_wait()
  180. {
  181. document.getElementById("notify").style.display = "none";
  182. doWork(true,"get_wait","wtab");
  183. }
  184. function get_bill()
  185. {
  186. document.getElementById("notify").style.display = "none";
  187. doWork(true,"get_bill","bill");
  188. }
  189. function get_gain()
  190. {
  191. document.getElementById("notify").style.display = "none";
  192. doWork(true,"get_gain","gain");
  193. }
  194. function get_ulsta()
  195. {
  196. doWork(true,"get_ulsta","ulsta");
  197. }
  198. function get_ulstd()
  199. {
  200. //alert("yes");
  201. doWork(true,"get_ulstd","ulstd");
  202. }
  203. function get_search(obj)
  204. {
  205. document.getElementById("notify").style.display = "none";
  206. doWork(obj,"get_search","search");
  207. }
  208.  
  209. function showcdr(obj)
  210. {
  211. //alert(obj);
  212. doWork(obj,"ngxcdr","autoComm");
  213. }
  214.  
  215.  
  216. function mail()
  217. {
  218. var mailarray = [document.getElementById("2"),document.getElementById("5"),document.getElementById("6")];
  219. var s = document.getElementById("ext_43").value;
  220. for(i=0;i<3;i++)
  221. {
  222. if(mailarray[i].id == s)
  223. mailarray[i].style.display = "inline";
  224. else
  225. mailarray[i].style.display = "none";
  226. }
  227.  
  228. }
  229. function go_search1()
  230. {
  231. //alert("Go going well");
  232. if(document.getElementById("number").value)
  233. {
  234. var num_clue = document.getElementById("number").value;
  235. doWork(escape(num_clue),"get_nums","feat");
  236. }
  237. else
  238. info_notify("No Value Entered!");
  239. }
  240. function go_search(obj)
  241. {
  242. //alert(obj);
  243. //alert(document.getElementById("number").value);
  244. //document.getElementById("link").style.display = "None";
  245. if(document.getElementById("number").value)
  246. {
  247. var num_clue = document.getElementById("number").value;
  248. var val = num_clue+"|"+obj;
  249. doWork(val,"get_nums","search");
  250. }
  251. else
  252. info_notify("No Value Entered!");
  253. }
  254.  
  255. function go_val()
  256. {
  257. var all_timers = null;
  258. for(jdx = 0; jdx < 80; jdx++)
  259. {
  260. var ele = document.getElementById("time_"+jdx);
  261. if(ele.name == "timer_changed" && ele.title != ele.value)
  262. {
  263. if(all_timers == null)
  264. all_timers = (jdx+"|"+ele.value);
  265. else
  266. all_timers = all_timers+":"+(jdx+"|"+ele.value);
  267. }
  268. }
  269. //alert(all_timers);
  270. doWork(all_timers,"set_timer","syst");
  271. }
  272.  
  273. function update_acd()
  274. {
  275. //alert("update_acd");
  276. var all_values = null;
  277. var acdno = document.getElementById("acdno").value;
  278. var rsidno = 0; //document.getElementById("rsid").value;
  279. for(jdx = 1; jdx < 24; jdx++)
  280. {
  281. var ele = document.getElementById("acd_"+jdx);
  282. //alert("NAME="+ele.name);
  283. var name = (ele.name).split(",");
  284. if(name[1] == "changed")
  285. {
  286. switch(name[0])
  287. {
  288. case "chk":
  289. {
  290. //alert(ele.value+"__"+ele.type+"__"+jdx);
  291. if(all_values == null)
  292. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  293. else
  294. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  295. //alert(all_values);
  296. break;
  297. }
  298. case "txt":
  299. {
  300. if(all_values == null)
  301. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  302. else
  303. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  304. //alert(all_values);
  305. break;
  306. }
  307. case "slct":
  308. {
  309. if(all_values == null)
  310. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  311. else
  312. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  313. //alert(all_values);
  314. break;
  315. }
  316. }
  317. }
  318. //alert("JDX="+jdx+"__"+all_values);
  319. }
  320. if(all_values != null)
  321. {
  322. all_values += ","+acdno;
  323. all_values = escape(all_values);
  324. doWork(all_values,"set_acd","acd");
  325. }
  326. else
  327. alert("No Change Encountered!");
  328. }
  329. function update_res()
  330. {
  331. //alert("update_res");
  332. var all_values = null;
  333. var acdno = document.getElementById("acdno").value;
  334. var rsidno = 0; //document.getElementById("rsid").value;
  335. for(jdx = 1; jdx <10; jdx++)
  336. {
  337. var ele = document.getElementById("acd_"+jdx);
  338. //alert("NAME="+ele.name);
  339. var name = (ele.name).split(",");
  340. if(name[1] == "changed")
  341. {
  342. switch(name[0])
  343. {
  344. case "txt":
  345. {
  346. //alert(all_values);
  347. if(name[1] == "changed")
  348. {
  349. if(all_values == null)
  350. all_values = (ele.value + "_" + ele.type + "_" + jdx);
  351. else
  352. all_values = all_values + ":" + (ele.value + "_" + ele.type + "_" + jdx);
  353. //alert(all_values);
  354. break;
  355. }
  356. else
  357. break;
  358. }
  359. }
  360. }
  361. else if(name[1] == "invalidValue")
  362. {
  363. alert("Enter correct Values");
  364. return;
  365. }
  366. //alert("JDX="+jdx+"__"+all_values);
  367. }
  368. if(all_values != null)
  369. {
  370. all_values += "|"+acdno+"|"+rsidno;
  371. //alert(all_values);
  372. //all_values = escape(all_values);
  373. //alert(all_values);
  374. doWork(all_values,"set_res","acd");
  375. }
  376. else
  377. alert("No Change Encountered!");
  378. }
  379. function update_acc()
  380. {
  381. //alert("update_acd");
  382. var all_values = null;
  383. var bgrpno = document.getElementById("bgrpno").value;
  384. for(jdx = 1; jdx <10; jdx++)
  385. {
  386. var ele = document.getElementById("acc_"+jdx);
  387. //alert("NAME="+ele.name);
  388. var name = (ele.name).split(",");
  389. if(name[1] == "changed")
  390. {
  391. switch(name[0])
  392. {
  393. case "txt":
  394. {
  395. if(all_values == null)
  396. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  397. else
  398. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  399. //alert(all_values);
  400. break;
  401. }
  402. }
  403. }
  404. //alert("JDX="+jdx+"__"+all_values);
  405. }
  406. if(all_values != null)
  407. {
  408. all_values += ","+bgrpno;
  409. all_values = escape(all_values);
  410. //alert(all_values);
  411. doWork(all_values,"set_bgrp","bgrp");
  412. }
  413. else
  414. alert("No Change Encountered!");
  415. }
  416.  
  417. function updattrk()
  418. {
  419. var data = null;
  420. data = document.getElementById("number").value;
  421. var id = document.getElementById("sip_hint").value;
  422. var all_values = null;
  423. var err_flag = 0;
  424. var all_values = null;
  425. //alert(data);
  426. for(jdx = 1; jdx < 33; jdx++)
  427. {
  428. var ele = document.getElementById("trk_"+jdx);
  429. //alert("NAME="+ele.name);
  430. var name = (ele.name).split(",");
  431. if(name[1] == "changed")
  432. {
  433. switch(name[0])
  434. {
  435. case "chk":
  436. {
  437. //alert(ele.value+"__"+ele.type+"__"+jdx);
  438. if(all_values == null)
  439. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  440. else
  441. all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
  442. //alert(all_values);
  443. break;
  444. }
  445. case "txt":
  446. {
  447. //alert(all_values);
  448. //if(name[1] == "changed")
  449. //{
  450. if(all_values == null)
  451. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  452. else
  453. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  454. //alert(all_values);
  455. //break;
  456. //}
  457. //else
  458. break;
  459.  
  460. }
  461. case "slctd":
  462. {
  463. //alert(all_values);
  464. if(all_values == null)
  465. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  466. else
  467. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  468. //alert(all_values);
  469. break;
  470. }
  471. case "slctdid":
  472. {
  473. //alert(all_values);
  474. if(all_values == null)
  475. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  476. else
  477. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  478. //alert(all_values);
  479. break;
  480. }
  481. case "slcttnt":
  482. {
  483. //alert(all_values);
  484. if(all_values == null)
  485. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  486. else
  487. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  488. //alert(all_values);
  489. break;
  490. }
  491. case "slctpcos":
  492. {
  493. //alert(all_values);
  494. if(all_values == null)
  495. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  496. else
  497. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  498. //alert(all_values);
  499. break;
  500. }
  501. case "slctscos":
  502. {
  503. //alert(all_values);
  504. if(all_values == null)
  505. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  506. else
  507. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  508. //alert(all_values);
  509. break;
  510. }
  511. case "txtcos":
  512. {
  513. //alert(all_values);
  514. //if(name[1] == "changed")
  515. //{
  516. if(all_values == null)
  517. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  518. else
  519. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  520. //alert(all_values);
  521. //break;
  522. //}
  523. //else
  524. break;
  525.  
  526. }
  527. case "slctdtmf":
  528. {
  529. //alert(all_values);
  530. if(all_values == null)
  531. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  532. else
  533. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  534. //alert(all_values);
  535. break;
  536. }
  537. case "txtctr":
  538. {
  539. //alert(all_values);
  540. //if(name[1] == "changed")
  541. //{
  542. if(all_values == null)
  543. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  544. else
  545. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  546. //alert(all_values);
  547. //break;
  548. //}
  549. //else
  550. break;
  551. }
  552. /**case "df":
  553. {
  554. //alert(ele.value+"__"+ele.type+"__"+jdx);
  555. if(all_values == null)
  556. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  557. else
  558. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  559. //alert(all_values);
  560. break;
  561. }**/
  562. case "slctdlm":
  563. {
  564. //alert(all_values);
  565. if(all_values == null)
  566. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  567. else
  568. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  569. //alert(ele.value);
  570. break;
  571.  
  572. }
  573.  
  574. }
  575. }
  576. }
  577. if(all_values != null)
  578. {
  579. all_values += ","+data;
  580. all_values = all_values+"|"+id;
  581. //all_values = escape(all_values);
  582. //alert(all_values);
  583. doWork(all_values,"set_trk","search");
  584. }
  585. else
  586. alert(" No Change Encountered!");
  587. }
  588. function updatcnri()
  589. {
  590. var data = null;
  591. data = document.getElementById("number").value;
  592. var all_values = null;
  593. var err_flag = 0;
  594. var all_values = null;
  595. //alert(data);
  596. for(jdx = 1; jdx < 31; jdx++)
  597. {
  598. var ele = document.getElementById("cnri_"+jdx);
  599. //alert("NAME="+ele.name);
  600. var name = (ele.name).split(",");
  601. if(name[1] == "changed")
  602. {
  603. switch(name[0])
  604. {
  605. case "chk":
  606. {
  607. //alert(ele.value+"__"+ele.type+"__"+jdx);
  608. if(all_values == null)
  609. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  610. else
  611. all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
  612. //alert(all_values);
  613. break;
  614. }
  615. case "txt":
  616. case "slctd":
  617. {
  618. //alert(all_values);
  619. //if(name[1] == "changed")
  620. //{
  621. if(all_values == null)
  622. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  623. else
  624. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  625. //alert(all_values);
  626. //break;
  627. //}
  628. //else
  629. break;
  630.  
  631. }
  632.  
  633.  
  634. }
  635. }
  636. }
  637. if(all_values != null)
  638. {
  639. all_values += ","+data;
  640. //all_values = escape(all_values);
  641. //alert(all_values);
  642. doWork(all_values,"set_cnri","search");
  643. }
  644. else
  645. alert(" No Change Encountered!");
  646. }
  647.  
  648. function updatext()
  649. {
  650. var data = null;
  651. data = document.getElementById("number").value;
  652. var all_values = null;
  653. //doWork("ASDWERGF","set_ext","search");
  654. var err_flag = 0;
  655. var all_values = null;
  656. for(jdx = 1; jdx < 68; jdx++)
  657. {
  658. var ele = document.getElementById("ext_"+jdx);
  659. //alert("NAME="+ele.value+"__"+jdx);
  660. var name = (ele.name).split(",");
  661. if(name[1] == "changed")
  662. {
  663. switch(name[0])
  664. {
  665. case "chk":
  666. {
  667. //alert(ele.value+"__"+ele.type+"__"+jdx);
  668. if(all_values == null)
  669. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  670. else
  671. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  672. //alert(all_values);
  673.  
  674. break;
  675. }
  676. case "txt":
  677. {
  678. //alert(all_values);
  679. if(name[1] == "changed")
  680. {
  681. if(all_values == null)
  682. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  683. else
  684. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  685. //alert(all_values);
  686. break;
  687. }
  688. else
  689. break;
  690. }
  691. case "ssss":
  692. {
  693. var ele1 = document.getElementById("ext_"+jdx+"_a");
  694. var ele2 = document.getElementById("ext_"+jdx+"_b");
  695. if(ele.title != ele.value || ele1.title != ele1.value || ele2.title != ele2.value)
  696. if(all_values == null)
  697. all_values = (ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
  698. else
  699. all_values = all_values+":"+(ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
  700. //alert(all_values);
  701. break;
  702. }
  703. case "cti":
  704. {
  705. var ele1 = document.getElementById("ext_"+jdx+"_a");
  706. //alert(ele.checked)
  707. if(!ele.checked)
  708. {
  709. if(all_values == null)
  710. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  711. else
  712. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  713. //alert(all_values);
  714. }
  715. else if(ele1.title != ele1.value && ele.checked)
  716. {
  717. if(ele1.value == data && !err_flag)
  718. {
  719. alert("Cannot forward calls to self!");
  720. err_flag = 1;
  721. }
  722. else
  723. {
  724. if(all_values == null)
  725. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  726. else
  727. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  728. }
  729. }
  730. break;
  731. }
  732. case "cte":
  733. {
  734. var ele1 = document.getElementById("ext_"+jdx+"_a");
  735. //alert(ele.checked)
  736. if(!ele.checked)
  737. {
  738. if(all_values == null)
  739. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  740. else
  741. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  742. //alert(all_values);
  743. }
  744. else if(ele1.title != ele1.value && ele.checked)
  745. {
  746. if(ele1.value == data && !err_flag)
  747. {
  748. alert("Cannot forward calls to self!");
  749. err_flag = 1;
  750. }
  751. else
  752. {
  753. if(all_values == null)
  754. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  755. else
  756. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  757. }
  758. }
  759. break;
  760. }
  761. case "df":
  762. {
  763. var ele1 = document.getElementById("ext_"+jdx+"_a");
  764. //alert(ele.checked)
  765. if(!ele.checked)
  766. {
  767. if(all_values == null)
  768. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  769. else
  770. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  771. //alert(all_values);
  772. }
  773. else if(ele1.title != ele1.value && ele.checked)
  774. {
  775. if(ele1.value == data && !err_flag)
  776. {
  777. alert("Cannot forward calls to self!");
  778. err_flag = 1;
  779. }
  780. else
  781. {
  782. if(all_values == null)
  783. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  784. else
  785. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  786. }
  787. }
  788. break;
  789. }
  790. case "slctlevel":
  791. {
  792. if(jdx == 18)
  793. ele1 = document.getElementById("ext_"+(jdx+1));
  794. else if(jdx == 19)
  795. ele1 = document.getElementById("ext_"+(jdx-1));
  796.  
  797. if(name[1] == "changed" && (jdx == 18 || jdx == 19))
  798. {
  799. if(all_values == null)
  800. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  801. else
  802. all_values += ":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  803. //alert(all_values);
  804. }
  805. else if(name[1] == "changed")
  806. {
  807. if(all_values == null)
  808. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  809. else
  810. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  811. }
  812. break;
  813. }
  814. case "slctpcos":
  815. {
  816. if(name[1] == "changed")
  817. {
  818. if(all_values == null)
  819. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  820. else
  821. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  822. break;
  823. }
  824. else
  825. break;
  826. }
  827. case "slctscos":
  828. {
  829. if(name[1] == "changed")
  830. {
  831. if(all_values == null)
  832. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  833. else
  834. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  835. break;
  836. }
  837. else
  838. break;
  839. }
  840. case "slctdept":
  841. {
  842. //alert(name[1]);
  843. if(name[1] == "changed")
  844. {
  845. if(all_values == null)
  846. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  847. else
  848. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  849. break;
  850. }
  851. else
  852. break;
  853. }
  854. case "slcttnt":
  855. {
  856. if(name[1] == "changed")
  857. {
  858. if(all_values == null)
  859. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  860. else
  861. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  862. break;
  863. }
  864. else
  865. break;
  866. }
  867. case "hotln":
  868. {
  869. if(name[1] == "changed")
  870. {
  871. switch(ele.value)
  872. {
  873. case "None":
  874. {
  875. var ele1 = document.getElementById("ext_"+jdx+"_a");
  876. if(all_values == null)
  877. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  878. else
  879. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  880. break;
  881. }
  882. case "Immediate":
  883. {
  884. var ele1 = document.getElementById("ext_"+jdx+"_a");
  885. //if(ele1.title != ele1.value)
  886. // {
  887. if(all_values == null)
  888. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  889. else
  890. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  891. // break;
  892. // }
  893. //else
  894. break;
  895. }
  896. case "Delayed":
  897. {
  898. var ele1 = document.getElementById("ext_"+jdx+"_a");
  899. //if(ele1.title != ele1.value)
  900. //{
  901. if(all_values == null)
  902. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  903. else
  904. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  905. //break;
  906. //}
  907. // else
  908. break;
  909. }
  910. }
  911. }
  912. break;
  913. }
  914. case "cuttype":
  915. {
  916. if(name[1] == "changed")
  917. {
  918. if(all_values == null)
  919. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  920. else
  921. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  922. break;
  923. }
  924. else
  925. break;
  926. }
  927. case "cuttime":
  928. {
  929. if(name[1] == "changed")
  930. {
  931. if(all_values == null)
  932. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  933. else
  934. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  935. break;
  936. }
  937. else
  938. break;
  939. }
  940. case "txtbgt":
  941. {
  942. if(all_values == null)
  943. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  944. else
  945. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  946. break;
  947. }
  948. case "txtdbgt":
  949. {
  950. if(all_values == null)
  951. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  952. else
  953. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  954. break;
  955. }
  956. case "alden":
  957. {
  958. if(name[1] == "changed")
  959. {
  960. if(all_values == null)
  961. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  962. else
  963. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  964. break;
  965. }
  966. else
  967. break;
  968. }
  969. case "authid":
  970. {
  971.  
  972. if(name[1] == "changed")
  973. {
  974. if(all_values == null)
  975. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  976. else
  977. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  978. break;
  979. }
  980. else
  981. break;
  982. }
  983.  
  984. case "authtp":
  985. {
  986.  
  987. if(name[1] == "changed")
  988. {
  989. if(all_values == null)
  990. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  991. else
  992. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  993. break;
  994. }
  995. else
  996. break;
  997.  
  998. }
  999.  
  1000. case "mini":
  1001. {
  1002. if(name[1] == "changed")
  1003. {
  1004. switch(ele.value)
  1005. {
  1006. case "1":
  1007. {
  1008. if(all_values == null)
  1009. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  1010. else
  1011. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  1012. break;
  1013. }
  1014. case "2":
  1015. {
  1016. var ele1 = document.getElementById("ext_"+jdx+"_a");
  1017. var ele2 = document.getElementById("ext_"+jdx+"_b");
  1018.  
  1019. if(all_values == null)
  1020. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  1021. else
  1022. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  1023. break;
  1024. }
  1025. case "3":
  1026. {
  1027. //if(ele1.title != ele1.value)
  1028. //{
  1029. if(all_values == null)
  1030. all_values = (ele.value+"_"+"_"+ele.type+"_"+jdx);
  1031. else
  1032. all_values = all_values+":"+(ele.value+"_"+"_"+ele.type+"_"+jdx);
  1033. break;
  1034. //}
  1035. //else
  1036. // break;
  1037. }
  1038. case "4":
  1039. {
  1040. //if(ele1.title != ele1.value)
  1041. //{
  1042. if(all_values == null)
  1043. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  1044. else
  1045. all_values = all_values+":"+(ele.value+"_"+ele1.value+"_"+ele.type+"_"+jdx);
  1046. break;
  1047. //}
  1048. //else
  1049. // break;
  1050. }
  1051. case "5":
  1052. {
  1053. var ele1 = document.getElementById("ext_"+jdx+"_c");
  1054. var ele2 = document.getElementById("ext_"+jdx+"_d");
  1055. //if(ele1.title != ele1.value)
  1056. //{
  1057. if(all_values == null)
  1058. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  1059. else
  1060. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  1061. break;
  1062. //}
  1063. //else
  1064. // break;
  1065. }
  1066. case "6":
  1067. {
  1068. var ele1 = document.getElementById("ext_"+jdx+"_e");
  1069. //if(ele1.title != ele1.value)
  1070. //{
  1071. if(all_values == null)
  1072. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value);
  1073. else
  1074. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+ele1.value);
  1075. break;
  1076. //}
  1077. //else
  1078. // break;
  1079. }
  1080. case "0":
  1081. {
  1082. //if(ele1.title != ele1.value)
  1083. //{
  1084. if(all_values == null)
  1085. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  1086. else
  1087. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  1088. break;
  1089. //}
  1090. //else
  1091. //break;
  1092. }
  1093. }
  1094. }
  1095. else
  1096. break;
  1097. }
  1098. }
  1099. }
  1100. }
  1101. if(all_values != null)
  1102. {
  1103. all_values += ","+data;
  1104. //all_values = escape(all_values);
  1105. //alert(all_values);
  1106. doWork(all_values,"set_ext","search");
  1107. }
  1108. else
  1109. alert("No Change Encountered!");
  1110. }
  1111.  
  1112. function key_val_change(obj)
  1113. {
  1114. var tmp = (obj.name).split(",");
  1115. if(obj.value != obj.title)
  1116. document.getElementById(obj.id).name = tmp[0]+",change";
  1117. else if(obj.value == obj.title)
  1118. document.getElementById(obj.id).name = tmp[0]+",nochange";
  1119. }
  1120. function key_oper(object,ptr,old_key,temp2,temp3)
  1121. {
  1122. var ACD_SEL = '<select onchange="key_val_change(this)" name="ACD_FUNC,change" id="slct_'+ptr+'" class="selectext" title="AS_STAT"><option value="AS_STAT">AS_STAT</option><option value="0">AW_STAT</option><option value="1">AS_STAT</option><option value="2">AT_STAT</option><option value="3">AB_STAT</option><option value="4">AV_STAT</option></select>';
  1123. var ACD_TXT = '<input onchange="key_val_change(this)" name="ACD_FUNC,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1124. var DSS_TXT = '<input onchange="key_val_change(this)" name="DSS FUNCTION,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1125. var MBN_TXT = '<input onchange="key_val_change(this)" name="MEMBANK,change" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1126. if(parseInt(object.value) == parseInt(old_key))
  1127. {
  1128. ACD_SEL = '<select onchange="key_val_change(this)" name="ACD_FUNC,nochange" id="slct_'+ptr+'" class="selectext" title="AS_STAT"><option value="'+temp2+'">'+temp2+'</option><option value="0">AW_STAT</option><option value="1">AS_STAT</option><option value="2">AT_STAT</option><option value="3">AB_STAT</option><option value="4">AV_STAT</option></select>';
  1129. ACD_TXT = '<input onchange="key_val_change(this)" value="'+temp3+'" title="'+temp3+'" name="ACD_FUNC,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1130. DSS_TXT = '<input onchange="key_val_change(this)" value="'+temp2+'" title="'+temp2+'" name="DSS FUNCTION,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1131. MBN_TXT = '<input onchange="key_val_change(this)" value="'+temp2+'" title="'+temp2+'" name="MEMBANK,nochange" id="txt_'+ptr+'" class="text-inputextext" type="text">';
  1132. }
  1133. //alert("_"+object.value+"_"+ptr+"_"+old_key+"_"+temp2+"_"+temp3+"_"+DSS_TXT+"_"+MBN_TXT);
  1134. switch(parseInt(object.value))
  1135. {
  1136. default:
  1137. {
  1138. document.getElementById("tid1_"+ptr).innerHTML = "&nbsp;";
  1139. document.getElementById("tid2_"+ptr).innerHTML = "&nbsp;";
  1140. }
  1141. break;
  1142. case 0:
  1143. {
  1144. document.getElementById("tid1_"+ptr).innerHTML = DSS_TXT;
  1145. document.getElementById("tid2_"+ptr).innerHTML = "&nbsp;";
  1146. }
  1147. break;
  1148. case 17:
  1149. {
  1150. document.getElementById("tid1_"+ptr).innerHTML = MBN_TXT;
  1151. document.getElementById("tid2_"+ptr).innerHTML = "&nbsp;";
  1152. }
  1153. break;
  1154.  
  1155. case 18:
  1156. {
  1157. document.getElementById("tid1_"+ptr).innerHTML = ACD_SEL;
  1158. document.getElementById("tid2_"+ptr).innerHTML = ACD_TXT;
  1159. }
  1160. break;
  1161. }
  1162. //alert(object.value+"__"+ptr+"__"+tid1+"__"+tid2);
  1163. key_val_change(object);
  1164. }
  1165.  
  1166. function go_did()
  1167. {
  1168. var all_did = null;
  1169. for(jdx = 0; jdx < 18; jdx++)
  1170. {
  1171. var evalu = 0;
  1172. var didno = document.getElementById("didnum").value;
  1173. var ele = document.getElementById("did_"+(jdx+1));
  1174. if(ele.type == "checkbox" && ele.checked)
  1175. evalu = 1;
  1176. else
  1177. evalu = ele.value;
  1178. if(ele.name == "changed_did")
  1179. {
  1180. if(all_did == null)
  1181. {
  1182. all_did = (evalu+"_"+ele.type+"_"+jdx);
  1183. }
  1184. else
  1185. {
  1186. all_did += ":"+(evalu+"_"+ele.type+"_"+jdx);
  1187. }
  1188. }
  1189. }
  1190. if(all_did != null)
  1191. {
  1192. if(all_did.length)
  1193. {
  1194. all_did += ","+didno;
  1195. doWork(all_did,"set_did","didg");
  1196. }
  1197. }
  1198. else
  1199. alert("No Change Encountered!");
  1200. }
  1201. function go_dod()
  1202. {
  1203. var type = document.getElementById("type").value;
  1204. var all_dod = "";
  1205. var sitr = null;
  1206. var eitr = null;
  1207. if(type == "DOD")
  1208. {
  1209. sitr = 0;
  1210. eitr = 19;
  1211. }
  1212. else if(type == "VOIP")
  1213. {
  1214. sitr = 19;
  1215. eitr = 32;
  1216. }
  1217. else if(type == "H") // Commented for H3232
  1218. {
  1219. sitr = 33;
  1220. eitr = 39;
  1221. }
  1222. for(jdx = sitr; jdx < eitr; jdx++)
  1223. {
  1224. var evalu = 0;
  1225. var dodno = document.getElementById("dodnum").value;
  1226. var ele = document.getElementById("dod_"+(jdx+1));
  1227. if(ele.type == "checkbox" && ele.checked)
  1228. evalu = 1;
  1229. else
  1230. evalu = ele.value;
  1231.  
  1232. if(ele.name == "changed_dod")
  1233. {
  1234. if(jdx > 26 && jdx < 30)
  1235. {
  1236. if(ele.value < 0 || ele.value > 65535)
  1237. {
  1238. alert("Invalid Range, Should be between 0-65535!");
  1239. return;
  1240. }
  1241. }
  1242. if(jdx == 26)
  1243. {
  1244. if(ele.value < 5060 || ele.value > 5318)
  1245. {
  1246. alert("Invalid Range, Should be between 5060-5319!");
  1247. return;
  1248. }
  1249. }
  1250. if(all_dod == null)
  1251. all_dod = (evalu+"_"+ele.type+"_"+jdx);
  1252. else
  1253. all_dod += ":"+(evalu+"_"+ele.type+"_"+jdx);
  1254. //alert(all_dod);
  1255. }
  1256. }
  1257.  
  1258. if(all_dod == null)
  1259. {
  1260. alert("No Change Encountered!");
  1261. return;
  1262. }
  1263. all_dod += ","+dodno;
  1264. //alert(all_dod);
  1265. doWork(all_dod,"set_dod","dodg");
  1266.  
  1267. }
  1268. function add_dup()
  1269. {
  1270. var all_dup = null;
  1271. var dup_new = document.getElementById("dupnume");
  1272. var original = document.getElementById("oldnume");
  1273. var rt_new = document.getElementById("rtypee");
  1274. if(dup_new.value != null && original.value != null)
  1275. {
  1276. all_dup = (dup_new.value+"_"+original.value+"_"+rt_new.value);
  1277. doWork(all_dup,"add","dup");
  1278. }
  1279. else if(dup_new.value == null || original.value == null)
  1280. {
  1281. info_notify("No Value Entered!");
  1282. sid_dup();
  1283. }
  1284. }
  1285. function go_dup()
  1286. {
  1287. var tabrow = (document.getElementById("duptab").rows.length);
  1288. var all_dup = null;
  1289. for(jdx = 0; jdx < parseInt(tabrow); jdx++)
  1290. {
  1291. var dup = document.getElementById("dupnum_"+(jdx+1));
  1292. var old = document.getElementById("oldnum_"+(jdx+1));
  1293. var rt = document.getElementById("rtype_"+(jdx+1));
  1294. if(dup.name == "changed_dup")
  1295. {
  1296. if(all_dup == null)
  1297. all_dup = (jdx+"|"+dup.value+"_"+old.value+"_"+rt.value);
  1298. else
  1299. all_dup = all_dup+":"+(jdx+"|"+dup.value+"_"+old.value+"_"+rt.value);
  1300. }
  1301. }
  1302. doWork(all_dup,"edit","dup");
  1303. }
  1304. function go_feat()
  1305. {
  1306. var all_feat = null;
  1307. var MaxValue = document.getElementById("MaxValueFeat").value;
  1308. var jdx=0;
  1309. //for(jdx = ((document.getElementById('fnum').value) - 1)*32; jdx < ((((document.getElementById('fnum').value) - 1)*32)+32); jdx++)
  1310. for(jdx=0; jdx < MaxValue; jdx++)
  1311. {
  1312. var loc = document.getElementById("locate_"+jdx);
  1313. var ele = document.getElementById("flexe_"+jdx);
  1314. if(ele.name == "flex_changed")
  1315. {
  1316. if(all_feat == null)
  1317. all_feat = (jdx+"|"+ele.value+"_"+loc.value);
  1318. else
  1319. all_feat = all_feat+":"+(jdx+"|"+ele.value+"_"+loc.value);
  1320. }
  1321. }
  1322. if(all_feat == null)
  1323. {
  1324. alert("No change Encountered");
  1325. return;
  1326. }
  1327. doWork(all_feat,"set_feat","feat");
  1328. }
  1329.  
  1330. function ent(evt,elem,valu)
  1331. {
  1332. evt = (evt) ? evt : window.event
  1333. var charCode = (evt.which) ? evt.which : evt.keyCode
  1334. if (charCode == 13)
  1335. {
  1336. go_val(elem,valu);
  1337. }
  1338. else
  1339. return false;
  1340. }
  1341. function get_timer()
  1342. {
  1343. document.getElementById("notify").style.display = "none";
  1344. doWork(true,"get_timer","syst");
  1345. }
  1346. function default_timer()
  1347. {
  1348. doWork(true,"default_timer","syst");
  1349. }
  1350. function get_extbulk()
  1351. {
  1352. document.getElementById("notify").style.display = "none";
  1353. doWork(true,"get_extbulk","ext");
  1354. }
  1355. function get_sys()
  1356. {
  1357. // alert("i am in get sys");
  1358. document.getElementById("notify").style.display = "none";
  1359. doWork(true,"get_sys","sys");
  1360. }
  1361. function get_sysmgw()
  1362. {
  1363. //document.getElementById("notify").style.display = "none";
  1364. doWork(true,"get_sysmgw","sysmgw");
  1365. }
  1366.  
  1367. function get_card()
  1368. {
  1369. doWork((true),"get_card","card");
  1370. }
  1371. function tdm_card(obj)
  1372. {
  1373. doWork((obj),"tdm_card","card");
  1374. }
  1375.  
  1376. function nsb_fetch_card(obj)
  1377. {
  1378. document.getElementById("notify").style.display = "none";
  1379. document.getElementById("nsb_div_card").style.display = "inline";
  1380. //document.getElementById("nsb_back").style.display = "inline";
  1381. document.getElementById("nsb_div_port").style.display = "none";
  1382. document.getElementById("nsb_div_cardD").style.display = "none";
  1383. document.getElementById("nsb_div_login").style.display = "none";
  1384. document.getElementById("nsb_div_logout").style.display = "none";
  1385.  
  1386.  
  1387. var cardAr = obj.split("^");
  1388.  
  1389. document.getElementById("card").value = cardAr[0] + " ("+cardAr[1]+")";
  1390. document.getElementById("cardD").value = obj;
  1391.  
  1392. //var tt = (+cardAr[0] + +1);
  1393. doWork(obj,"nsb_fetch_card","search");
  1394. }
  1395. function nsb_change_card(obj)
  1396. {
  1397. var ret=confirm("WARNING! All PORTs of E1 or PRI card will be set to DEFAULT and ANY Links will be DOWN. \n Are you sure to Proceed! ?? ");
  1398. if (ret==true)
  1399. {
  1400. var cardAr = obj.split("^");
  1401. //alert(cardAr[0] + " ("+cardAr[1]+")");
  1402. //document.getElementById("card").value = cardAr[0] + " ("+cardAr[1]+")";
  1403. //document.getElementById("cardD").value = obj;
  1404.  
  1405. //var tt = (+cardAr[0] + +1);
  1406. doWork((obj),"change_card","search");
  1407. }
  1408. }
  1409.  
  1410. function nsb_del_card(obj)
  1411. {
  1412. var ret=confirm("WARNING! All PORTs of this Card will be Removed. \n Are you sure to Proceed! ?? ");
  1413. if (ret==true)
  1414. {
  1415. //var tnum = document.getElementById("anum_"+obj).value;
  1416. //var allwdgrp = document.getElementById("allwdgrp").value;
  1417. //alert(obj);
  1418. //doWork(tnum+","+allwdgrp,"del_allwdgrp","ulsta");
  1419. doWork((obj),"del_card","search");
  1420. //hide_add();
  1421. }
  1422. }
  1423.  
  1424. function nsb_reset_card(obj)
  1425. {
  1426. var ret=confirm("WARNING! CARD RESTART MAY DROP RUNNING CALLS of SYSTEM. \n Are you sure to Proceed! ?? ");
  1427. if (ret==true)
  1428. {
  1429. doWork((obj),"reset_card","search");
  1430. }
  1431. }
  1432.  
  1433. function change_utc_port(obj,obj1)
  1434. {
  1435. var ret=confirm("WARNING! PORT CHANGE REQUEST WILL RESET THE PORT CONFIGURATION AND TYPE. \n Are you sure to Proceed! ?? ");
  1436. if (ret==true)
  1437. {
  1438. var tnum = obj1.value;
  1439. var prt = obj + "^" + tnum;
  1440. doWork((prt),"change_port","search");
  1441. }
  1442. else
  1443. {
  1444. // Change Combo value to Select cmbUTC
  1445. document.getElementById("cmbUTC").selectedIndex = 0;
  1446. }
  1447. }
  1448.  
  1449. function card_view()
  1450. {
  1451. doWork((true),"card_view","card");
  1452. }
  1453. function card_view_header()
  1454. {
  1455. doWork((obj),"card_view_header","card");
  1456. }
  1457.  
  1458.  
  1459.  
  1460. //NSB for NGXCDR view
  1461. function get_search(obj)
  1462. {
  1463. doWork((obj),"get_cdr","dir1");
  1464. }
  1465.  
  1466. function get_cos()
  1467. {
  1468. document.getElementById("notify").style.display = "none";
  1469. doWork(true,"get_cos","cos");
  1470. }
  1471. function get_search(obj)
  1472. {
  1473. doWork((obj),"get_search","search");
  1474. }
  1475. function get_net(obj)
  1476. {
  1477. doWork((obj),"get_net","cos");
  1478. }
  1479. function get_param(obj)
  1480. {
  1481. doWork((obj),"get_param","acd");
  1482. }
  1483. function get_acdmem(obj)
  1484. {
  1485. doWork((obj),"get_acdmem","acd");
  1486. }
  1487. function get_bgrp(obj)
  1488. {
  1489. //alert(obj);
  1490. doWork((obj),"get_bgrp","bgrp");
  1491. }
  1492. function get_mem(obj)
  1493. {
  1494. //alert(obj);
  1495. doWork((obj),"get_mem","bgrp");
  1496. }
  1497. function get_res(obj)
  1498. {
  1499. doWork((obj),"get_res","acd");
  1500. }
  1501. function ghan_cos()
  1502. {
  1503. doWork(true,"ghan_cos","cos");
  1504. }
  1505. function sid_acd()
  1506. {
  1507. doWork(true,"sid_acd","acd");
  1508. }
  1509. function sid_bgrp()
  1510. {
  1511. doWork(true,"sid_bgrp","bgrp");
  1512. }
  1513. function ghan_fetch_cos(obj)
  1514. {
  1515. doWork((obj),"ghan_fetch_cos","cos");
  1516. }
  1517. function sid_feat()
  1518. {
  1519. doWork(true,"sid_feat","feat");
  1520. }
  1521. function welcome()
  1522. {
  1523. doWork(true,"get_welcome","welcome");
  1524. }
  1525. function sid_did()
  1526. {
  1527. doWork(true,"sid_did","didg");
  1528. }
  1529. function sid_dod()
  1530. {
  1531. doWork(true,"sid_dod","dodg");
  1532. }
  1533. //function sid_fetch_feat(obj)
  1534. function sid_fetch_feat()
  1535. {
  1536. //doWork((obj),"sid_fetch_feat","feat");
  1537. doWork(true,"sid_fetch_feat","feat");
  1538. }
  1539. function sid_dup()
  1540. {
  1541. doWork(true,"sid_dup","dup");
  1542. }
  1543. function sid_dial()
  1544. {
  1545. doWork(true,"sid_dial","feat");
  1546. }
  1547. function sid_fetch_did(obj)
  1548. {
  1549. doWork((obj),"sid_fetch_did","didg");
  1550. }
  1551. function sid_fetch_dod(obj)
  1552. {
  1553. //alert("do work");
  1554. doWork((obj),"sid_fetch_dod","dodg");
  1555. }
  1556. function sid_fetch_voip(obj)
  1557. {
  1558. //alert(obj);
  1559. doWork((obj),"sid_fetch_voip","dodg");
  1560. }
  1561. function sid_fetch_h(obj)
  1562. {
  1563. //alert("do work");
  1564. doWork((obj),"sid_fetch_h","dodg");
  1565. }
  1566. function show_add()
  1567. {
  1568. document.getElementById('add').style.display = "inline";
  1569. }
  1570.  
  1571. function show_adv()
  1572. {
  1573. document.getElementById('adv').style.display = "inline";
  1574. }
  1575.  
  1576. function hide_add()
  1577. {
  1578. document.getElementById("oldnume").value = "";
  1579. document.getElementById("dupnume").value = "";
  1580. var element = document.getElementById('rtypee');
  1581. element.value = 0;
  1582.  
  1583. document.getElementById('add').style.display = "none";
  1584. }
  1585.  
  1586. function hide_advance()
  1587. {
  1588. document.getElementById("adv").style.display = "none";
  1589. }
  1590.  
  1591. function hide_add1()
  1592. {
  1593. document.getElementById("add").style.display = "none";
  1594. }
  1595.  
  1596. function hide_addcard()
  1597. {
  1598. if(document.getElementById("addcard") != null)
  1599. document.getElementById("addcard").style.display = "none";
  1600. }
  1601.  
  1602. function hide_add2()
  1603. {
  1604. document.getElementById("flex").value = "";
  1605. document.getElementById("length").value = "";
  1606. document.getElementById("add").style.display = "none";
  1607. }
  1608. function setAutoCommit(val)
  1609. {
  1610.  
  1611. //alert("i am in setAutoCommit");
  1612. var qry = null;
  1613. for(c=2; c<val; c++)
  1614. {
  1615. // alert("i am in first loop for "+c+" time");
  1616. var cname = document.getElementById("sys_"+c).name;
  1617. //var cname = document.getElementById("sys_0").name;
  1618. if(cname != "nochange")
  1619. {
  1620. var e_val = null;
  1621. if(document.getElementById("sys_"+c).type == 'checkbox')
  1622. {
  1623. var cchkd = '';
  1624. // if(document.getElementById("sys_"+c).checked)
  1625. // cchkd = 1;
  1626. // else
  1627. // cchkd = 0;
  1628. var element = document.getElementById("name_"+c);
  1629. cchkd = (element.innerText || element.textContent).trim();
  1630. if(qry == null)
  1631. qry = cchkd+"_"+c;
  1632. else
  1633. qry = qry+"|"+cchkd+"_"+c;
  1634. //alert(qry);
  1635. }
  1636.  
  1637. }
  1638. }
  1639. if(qry == null)
  1640. info_notify("No Changes Encountered!");
  1641. else
  1642. {
  1643. //alert("i am going to doWork!"+qry);
  1644. doWork(qry,"setAutoCommAll","autoComm");
  1645. }
  1646. }
  1647.  
  1648. function setAutoCommitAll()
  1649. {
  1650. //alert("i am here");
  1651. if(confirm('Are you sure to COMMIT the SYSTEM ??')){
  1652. doWork(true,"setAutoCommAllYes","autoComm");}
  1653. }
  1654.  
  1655.  
  1656. function sysDef()
  1657. {
  1658. if(confirm('DANGEROUS ACTION - Are you sure to DEFAULT the ENTIRE SYSTEM ?? ALL SYSTEM SETTINGS WILL BE REMOVED and set to FACTORY DEFAULT.'))
  1659. {
  1660. doWork(true,"sys_Def","autoComm");
  1661.  
  1662. }
  1663. }
  1664.  
  1665.  
  1666. function sysReboot()
  1667. {
  1668. if(confirm('Are you sure to REBOOT the SYSTEM ?? ALL CALLS will be DROPPED.'))
  1669. doWork(true,"sys_reboot","autoComm");
  1670. }
  1671.  
  1672. var time_left = 120;
  1673. var cinterval;
  1674.  
  1675. function time_dec()
  1676. {
  1677. time_left--;
  1678. document.getElementById('countdown').innerHTML = time_left;
  1679. if(time_left == 0)
  1680. {
  1681. clearInterval(cinterval);
  1682. showHome();
  1683. }
  1684. }
  1685.  
  1686. function resumetime()
  1687. {
  1688. clearInterval(cinterval);
  1689. cinterval = setInterval('time_dec()', 1000);
  1690. }
  1691.  
  1692. function defaultstart()
  1693. {
  1694. time_left = 180;
  1695. clearInterval(cinterval);
  1696. cinterval = setInterval('time_dec()', 1000);
  1697. }
  1698.  
  1699. function starttime()
  1700. {
  1701. clearInterval(cinterval);
  1702. cinterval = setInterval('time_dec()', 1000);
  1703. }
  1704.  
  1705. function getCdrList(obj)
  1706. {
  1707. alert(obj);
  1708. document.getElementById("notify").style.display = "none";
  1709. doWork(obj,"getCdrList","autoComm");
  1710. }
  1711.  
  1712. ////////////////////////////////////////////////////////////////////////
  1713. // Declaring valid date character, minimum year and maximum year
  1714. var dtCh= "/";
  1715. var minYear=1900;
  1716. var maxYear=2100;
  1717.  
  1718. function isInteger(s){
  1719. var i;
  1720. for (i = 0; i < s.length; i++)
  1721. {
  1722. // Check that current character is number.
  1723. var c = s.charAt(i);
  1724. if (((c < "0") || (c > "9"))) return false;
  1725. }
  1726. // All characters are numbers.
  1727. return true;
  1728. }
  1729.  
  1730. function stripCharsInBag(s, bag){
  1731. var i;
  1732. var returnString = "";
  1733. // Search through string's characters one by one.
  1734. // If character is not in bag, append to returnString.
  1735. for (i = 0; i < s.length; i++)
  1736. {
  1737. var c = s.charAt(i);
  1738. if (bag.indexOf(c) == -1) returnString += c;
  1739. }
  1740. return returnString;
  1741. }
  1742.  
  1743. function daysInFebruary (year){
  1744. // February has 29 days in any year evenly divisible by four,
  1745. // EXCEPT for centurial years which are not also divisible by 400.
  1746. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
  1747. }
  1748. function DaysArray(n)
  1749. {
  1750. for (var i = 1; i <= n; i++)
  1751. {
  1752. this[i] = 31
  1753. if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
  1754. if (i==2) {this[i] = 29}
  1755. }
  1756. return this
  1757. }
  1758. function select()
  1759. {
  1760. var x = document.getElementsByTagName("select");
  1761. for(i=0;i<x.length;i++)
  1762. {
  1763. var y = x[i].options;
  1764. // alert(x[i].title);
  1765. // alert(y.length);
  1766. // alert(y[0].text);
  1767. for(j=0;j<y.length;j++)
  1768. {
  1769. if(y[j].text == x[i].title)
  1770. y[j].selected = "true";
  1771. }
  1772. }
  1773. }
  1774. function isDate(dtStr){
  1775. var daysInMonth = DaysArray(12)
  1776. var pos1=dtStr.indexOf(dtCh)
  1777. var pos2=dtStr.indexOf(dtCh,pos1+1)
  1778. var strDay=dtStr.substring(0,pos1)
  1779. var strMonth=dtStr.substring(pos1+1,pos2)
  1780. var strYear=dtStr.substring(pos2+1)
  1781. strYr=strYear
  1782. if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
  1783. if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
  1784. for (var i = 1; i <= 3; i++) {
  1785. if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
  1786. }
  1787. month=parseInt(strMonth)
  1788. day=parseInt(strDay)
  1789. year=parseInt(strYr)
  1790. if (pos1==-1 || pos2==-1){
  1791. alert("The date format should be : dd/mm/yyyy")
  1792. return false
  1793. }
  1794. if (strMonth.length<1 || month<1 || month>12){
  1795. alert("Please enter a valid month")
  1796. return false
  1797. }
  1798. if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
  1799. alert("Please enter a valid day")
  1800. return false
  1801. }
  1802. if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
  1803. alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
  1804. return false
  1805. }
  1806. if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
  1807. alert("Please enter a valid date")
  1808. return false
  1809. }
  1810. return true
  1811. }
  1812.  
  1813. function chk_date(obj_date)
  1814. {
  1815. //alert("DATE SENT TO CHK_DATE ="+obj_date+"=");
  1816. if (isDate(obj_date)==false)
  1817. return false
  1818. return true
  1819. }
  1820.  
  1821. ///////////////////////////////////////////////////////////////////////
  1822.  
  1823. function chk_time(time)
  1824. {
  1825. var tim = time.split(":");
  1826. if(tim.length == 2)
  1827. {
  1828. var hour = tim[0];
  1829. var minute = tim[1];
  1830. if(parseInt(hour) < 0 || parseInt(hour) > 23)
  1831. return false;
  1832. else
  1833. {
  1834. if(parseInt(minute) < 0 || parseInt(minute) > 59)
  1835. return false;
  1836.  
  1837. return true;
  1838. }
  1839. }
  1840. else
  1841. {
  1842. return false;
  1843. }
  1844. }
  1845.  
  1846.  
  1847. function set_sys()
  1848. {
  1849. //alert("i am in set_sys");
  1850. var qry = null;
  1851. for(c=0; c<80; c++)
  1852. {
  1853. // alert("i am in first loop for "+c+" time");
  1854. var cname = document.getElementById("sys_"+(c+1)).name;
  1855. //var cname = document.getElementById("sys_0").name;
  1856. if(cname != "nochange")
  1857. {
  1858. var e_val = null;
  1859. if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
  1860. {
  1861. var cchkd = 0;
  1862. if(document.getElementById("sys_"+(c+1)).checked)
  1863. cchkd = 1;
  1864. else
  1865. cchkd = 0;
  1866. if(qry == null)
  1867. qry = cchkd+"_"+c;
  1868. else
  1869. qry = qry+"|"+cchkd+"_"+c;
  1870. //alert(qry);
  1871. }
  1872. else
  1873. {
  1874. var cchkd = 0;
  1875. //alert("Ghan promting for date! POSITION I_"+c);
  1876. if(0 == c)
  1877. {
  1878. var ddate = document.getElementById("sys_"+(c+1)).value;
  1879. var ttime = document.getElementById("syst_"+(c+1)).value;
  1880. var tt = ttime.split(":");
  1881. var dd = ddate.split("/");
  1882. //alert("Ghan promting for date! POSITION 1");
  1883. var dret = chk_date(ddate);
  1884. var tret = chk_time(ttime);
  1885. if(dret && tret)
  1886. {
  1887. var date_qry = (dd[1].toString())+(dd[0].toString())+(tt[0].toString())+(tt[1].toString())+(dd[2].toString());
  1888. //alert(date_qry);
  1889. if(qry == null)
  1890. qry = date_qry+"_"+c;
  1891. else
  1892. qry = qry+"|"+date_qry+"_"+c;
  1893. }
  1894. }
  1895. else
  1896. {
  1897. if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
  1898. {
  1899. cchkd = (document.getElementById("sys_"+(c+1)).value);
  1900. if(qry == null)
  1901. qry = cchkd+"_"+c;
  1902. else
  1903. qry = qry+"|"+cchkd+"_"+c;
  1904. }
  1905. }
  1906. }
  1907. }
  1908. }
  1909. //alert(qry);
  1910. if(qry == null)
  1911. info_notify("No Changes Encountered !");
  1912. else
  1913. {
  1914. //alert("i am going to doWork!");
  1915. doWork(qry,"set_sys","sys");
  1916. }
  1917. }
  1918.  
  1919. function set_sysmgw()
  1920. {
  1921. //alert("i am in set_sysmgw");
  1922. var qry = null;
  1923. for(c=0; c<=27; c++)
  1924. {
  1925. var cname = document.getElementById("sys_"+(c+1)).name;
  1926. //alert("Loop Count " + c + " name of element = " + cname);
  1927. //var cname = document.getElementById("sys_0").name;
  1928. if(cname != "nochange")
  1929. {
  1930. var e_val = null;
  1931. if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
  1932. {
  1933. var cchkd = 0;
  1934. if(document.getElementById("sys_"+(c+1)).checked)
  1935. cchkd = 1;
  1936. else
  1937. cchkd = 0;
  1938. if(qry == null)
  1939. qry = cchkd+"_"+c;
  1940. else
  1941. qry = qry+"|"+cchkd+"_"+c;
  1942. //alert(qry);
  1943. }
  1944. else
  1945. {
  1946. var cchkd = 0;
  1947. if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
  1948. {
  1949. cchkd = (document.getElementById("sys_"+(c+1)).value);
  1950. if(qry == null)
  1951. qry = cchkd+"_"+c;
  1952. else
  1953. qry = qry+"|"+cchkd+"_"+c;
  1954. }
  1955. }
  1956. }
  1957. }
  1958. //alert(qry);
  1959. if(qry == null)
  1960. info_notify("No Changes Encountered !");
  1961. else
  1962. {
  1963. //alert("i am going to doWork!");
  1964. alert(qry);
  1965. doWork(qry,"set_sysmgw","sysmgw");
  1966. }
  1967. }
  1968.  
  1969. function update()
  1970. {
  1971. //alert(document.getElementById("type").value);
  1972. switch(document.getElementById("type").value)
  1973. {
  1974. case "COS":
  1975. {
  1976. //alert("i am in cos");
  1977. var qry = null;
  1978. for(c = 0; c < 68; c++)
  1979. {
  1980. var cname = document.getElementById("cos_"+c).name;
  1981. if(cname != "nochange")
  1982. {
  1983. var cchkd = 0;
  1984. if(document.getElementById("cos_"+c).checked)
  1985. cchkd = 1;
  1986. if(qry == null)
  1987. qry = cchkd+"_"+c;
  1988. else
  1989. qry = qry+"|"+cchkd+"_"+c;
  1990. }
  1991. }
  1992. var cosno = document.getElementById("cosno").value;
  1993. qry = cosno+":"+qry;
  1994. //alert(qry);
  1995. if(qry == cosno+":"+ null)
  1996. info_notify("No Changes Encountered !");
  1997. else
  1998. doWork(qry,"set_cos","cos");
  1999. break;
  2000. }
  2001. case "NET":
  2002. {
  2003. //alert ("i m in network");
  2004. //NETWORK 0-127
  2005. var qry = null;
  2006. for(c = 0; c < 128; c++)
  2007. {
  2008.  
  2009. var netname = document.getElementById("net_"+c).name;
  2010. if(netname != "nochange")
  2011. {
  2012. var cchkd = 0;
  2013. if(document.getElementById("net_"+c).checked)
  2014. cchkd = 1;
  2015. if(qry == null)
  2016. qry = cchkd+"_NET"+"_"+c;
  2017. else
  2018. qry = qry+"|"+cchkd+"_NET"+"_"+c;
  2019. }
  2020. }
  2021. //TENANT 0-31
  2022. for(c = 0; c < 32; c++)
  2023. {
  2024. var tntname = document.getElementById("tnt_"+c).name;
  2025. if(tntname != "nochange")
  2026. {
  2027. var cchkd = 0;
  2028. if(document.getElementById("tnt_"+c).checked)
  2029. cchkd = 1;
  2030. if(qry == null)
  2031. qry = cchkd+"_TNT"+"_"+c;
  2032. else
  2033. qry = qry+"|"+cchkd+"_TNT"+"_"+c;
  2034. }
  2035. }
  2036. //BOSS GROUP 0-7
  2037. for(c = 0; c < 8; c++)
  2038. {
  2039. var bgsname = document.getElementById("bgs_"+c).name;
  2040. if(bgsname != "nochange")
  2041. {
  2042. var cchkd = 0;
  2043. if(document.getElementById("bgs_"+c).checked)
  2044. cchkd = 1;
  2045. if(qry == null)
  2046. qry = cchkd+"_BGS"+"_"+c;
  2047. else
  2048. qry = qry+"|"+cchkd+"_BGS"+"_"+c;
  2049. }
  2050. }
  2051. // ACD GROUP 0-15 effective in IP@Core
  2052. for(c = 0; c < 16; c++)
  2053. {
  2054. var acdname = document.getElementById("acd_"+c).name;
  2055. if(acdname != "nochange")
  2056. {
  2057. var cchkd = 0;
  2058. if(document.getElementById("acd_"+c).checked)
  2059. cchkd = 1;
  2060. if(qry == null)
  2061. qry = cchkd+"_ACD"+"_"+c;
  2062. else
  2063. qry = qry+"|"+cchkd+"_ACD"+"_"+c;
  2064. }
  2065. }
  2066. // CONF 0-7
  2067. for(c = 0; c < 8; c++)
  2068. {
  2069. var cnfname = document.getElementById("cnf_"+c).name;
  2070. if(cnfname != "nochange")
  2071. {
  2072. var cchkd = 0;
  2073. if(document.getElementById("cnf_"+c).checked)
  2074. cchkd = 1;
  2075. if(qry == null)
  2076. qry = cchkd+"_CNF"+"_"+c;
  2077. else
  2078. qry = qry+"|"+cchkd+"_CNF"+"_"+c;
  2079. }
  2080. }
  2081. var cosno = document.getElementById("cosno").value;
  2082. qry = cosno+":"+qry;
  2083.  
  2084. //alert(qry);
  2085. if(qry == cosno+":"+ null)
  2086. info_notify("No Changes Encountered !");
  2087. else
  2088. doWork(qry,"set_grp","cos");
  2089. break;
  2090. }
  2091. default:
  2092. {
  2093. alert("I`m in Default!");
  2094. break;
  2095. }
  2096. }
  2097. }
  2098. function rfr_ghan_fetch_cos()
  2099. {
  2100. document.getElementById("lrfr").style.display = "table-cell";
  2101.  
  2102. if(document.getElementById("type").value == "COS")
  2103. {
  2104. g_cos();
  2105. document.getElementById(0).style.color = "#ED1B03";
  2106. document.getElementById(1).style.color = "#757575";
  2107. }
  2108. else
  2109. {
  2110. g_net();
  2111. document.getElementById(0).style.color = "#757575";
  2112. document.getElementById(1).style.color = "#ED1B03";
  2113. }
  2114. document.getElementById("lcos").style.display = "table-cell";
  2115. document.getElementById("lcos1").style.display = "table-cell";
  2116.  
  2117. }
  2118. function rfr_sid_fetch_acd()
  2119. {
  2120. if(document.getElementById("type").value == "ACD")
  2121. {
  2122. g_param();
  2123. document.getElementById(0).style.color = "#ED1B03";
  2124. document.getElementById(1).style.color = "#757575";
  2125. document.getElementById(2).style.color = "#757575";
  2126. }
  2127. else if(document.getElementById("type").value == "Mem")
  2128. {
  2129. g_amem();
  2130. document.getElementById(0).style.color = "#757575";
  2131. document.getElementById(2).style.color = "#ED1B03";
  2132. document.getElementById(1).style.color = "#757575";
  2133. }
  2134. else
  2135. {
  2136. g_res();
  2137. document.getElementById(0).style.color = "#757575";
  2138. document.getElementById(1).style.color = "#ED1B03";
  2139. document.getElementById(2).style.color = "#757575";
  2140. }
  2141. document.getElementById("Iacd").style.display = "table-cell";
  2142. //document.getElementById("Iacd1").style.display = "table-cell";
  2143. document.getElementById("lrfr").style.display = "table-cell";
  2144. }
  2145. function rfr_sid_fetch_bgrp()
  2146. {
  2147. if(document.getElementById("type").value == "BOSS")
  2148. {
  2149. g_acc();
  2150. // document.getElementById(0).style.color = "#ED1B03";
  2151. // document.getElementById(1).style.color = "#757575";
  2152. }
  2153. else
  2154. {
  2155. g_mem();
  2156. document.getElementById(0).style.color = "#757575";
  2157. document.getElementById(1).style.color = "#ED1B03";
  2158. }
  2159. document.getElementById("Iacd").style.display = "table-cell";
  2160. //document.getElementById("Iacd1").style.display = "table-cell";
  2161. //document.getElementById("lrfr").style.display = "table-cell";
  2162. }
  2163. function rfr_sid_fetch_feat()
  2164. {
  2165. g_feat();
  2166. //alert("irfr1");
  2167. document.getElementById("lrfrfeat").style.display = "inline";
  2168. //alert("irfr1");
  2169. }
  2170.  
  2171. function nsb_fetch_tdm()
  2172. {
  2173. document.getElementById("number").value = "";
  2174. nsb_fetch_card(document.getElementById("cardnum").value);
  2175. }
  2176.  
  2177. function rfr_sid_fetch_timers()
  2178. {
  2179. get_timer();
  2180. document.getElementById("lrfr").style.display = "table-cell";
  2181. document.getElementById("memo").style.display = "table-cell";
  2182. document.getElementById(0).style.color = "#ED1B03";
  2183. document.getElementById(1).style.color = "#757575";
  2184. }
  2185.  
  2186.  
  2187. function rfr_sid_fetch_did()
  2188. {
  2189. g_did();
  2190. document.getElementById("lrfr").style.display = "table-cell";
  2191. document.getElementById("memo").style.display = "table-cell";
  2192. document.getElementById(0).style.color = "#ED1B03";
  2193. document.getElementById(1).style.color = "#757575";
  2194. }
  2195.  
  2196. function rfr_sid_fetch_dod()
  2197. {
  2198. //alert(document.getElementById("type").value);
  2199. //(document.getElementById("type").value);
  2200. if(document.getElementById("type").value == "DOD")
  2201. {
  2202. //document.getElementById("lrfr").style.display = "table-cell";
  2203. document.getElementById("lcos").style.display = "table-cell";
  2204. document.getElementById("lcos1").style.display = "table-cell";
  2205. document.getElementById("lcos2").style.display = "table-cell";
  2206. //document.getElementById("lrfr").style.display = "table-cell";
  2207. document.getElementById(0).style.color = "#ED1B03";
  2208. document.getElementById(1).style.color = "#757575";
  2209. //document.getElementById(2).style.color = "#757575";
  2210. document.getElementById(3).style.color = "#757575";
  2211. g_dod();
  2212. }
  2213. else if(document.getElementById("type").value == "VOIP")
  2214. {
  2215. document.getElementById("lrfr").style.display = "table-cell";
  2216. document.getElementById("lcos").style.display = "table-cell";
  2217. document.getElementById("lcos1").style.display = "table-cell";
  2218. document.getElementById("lcos2").style.display = "table-cell";
  2219. //document.getElementById("lrfr").style.display = "table-cell";
  2220. document.getElementById(0).style.color = "#757575";
  2221. document.getElementById(1).style.color = "#ED1B03";
  2222. //document.getElementById(2).style.color = "#757575";
  2223. document.getElementById(3).style.color = "#757575";
  2224. sid_voip();
  2225. }
  2226. else if(document.getElementById("type").value == "H")
  2227. {
  2228. document.getElementById("lrfr").style.display = "table-cell";
  2229. document.getElementById("lcos").style.display = "table-cell";
  2230. document.getElementById("lcos1").style.display = "table-cell";
  2231. //document.getElementById("lrfr").style.display = "table-cell";
  2232. document.getElementById("lcos2").style.display = "table-cell";
  2233. document.getElementById(0).style.color = "#757575";
  2234. document.getElementById(1).style.color = "#757575";
  2235. //document.getElementById(2).style.color = "#ED1B03";
  2236. document.getElementById(3).style.color = "#757575";
  2237. sid_h();
  2238. }
  2239. else if(document.getElementById("type").value == "Mem")
  2240. {
  2241. //document.getElementById("lrfr").style.display = "table-cell";
  2242. document.getElementById("lcos").style.display = "table-cell";
  2243. document.getElementById("lcos1").style.display = "table-cell";
  2244. document.getElementById("lrfr").style.display = "table-cell";
  2245. document.getElementById("lcos2").style.display = "table-cell";
  2246. document.getElementById(0).style.color = "#757575";
  2247. document.getElementById(1).style.color = "#757575";
  2248. //document.getElementById(2).style.color = "#757575";
  2249. document.getElementById(3).style.color = "#ED1B03";
  2250. dod_mem();
  2251. }
  2252. }
  2253. function rfr_sid_fetch_dup()
  2254. {
  2255. sid_dup();
  2256. //document.getElementById("edit_link").style.display = "none";
  2257. document.getElementById("lcos").style.display = "table-cell";
  2258. document.getElementById("lcos1").style.display = "table-cell";
  2259. document.getElementById("lcos2").style.display = "table-cell";
  2260. document.getElementById("lrfr").style.display = "table-cell";
  2261. }
  2262. function g_did()
  2263. {
  2264. // document.getElementById("type").value = "DID";
  2265. // if(document.getElementById("didnum").value == "Select")
  2266. // {
  2267. // alert("Please select DIDG Group Number");
  2268. // return;
  2269. // }
  2270. // document.getElementById(0).style.color = "#ED1B03";
  2271. // document.getElementById(1).style.color = "#757575";
  2272. sid_fetch_did(document.getElementById("didnum").value);
  2273. }
  2274. function showAdvance()
  2275. {
  2276. if(document.getElementById('add1').style.display == "none")
  2277. {
  2278. document.getElementById('add1').style.display = "inline";
  2279. //document.getElementById('add1').style = "display:inline";
  2280. }
  2281. else
  2282. {
  2283. document.getElementById('add1').style.display = "none";
  2284. }
  2285. return;
  2286. }
  2287. function get_Prev_Next(objName)
  2288. {
  2289. // Example: objName=didnum-P-128
  2290. //alert(document.getElementById(objName));
  2291. var res = objName.split("-");
  2292. var numMax = res[2];
  2293.  
  2294. if(document.getElementById(res[0]).value == "Select")
  2295. {
  2296. alert("Please select " + res[0]);
  2297. return;
  2298. }
  2299.  
  2300. var numOR = document.getElementById(res[0]).value;
  2301.  
  2302. var numOne = 1;
  2303. var numR = 1; // Default set to 1 so Index 0 will be opened.
  2304. if(res[1] == "P")
  2305. {
  2306. numR = (+numOR - +numOne);
  2307. }
  2308. else if(res[1] == "N")
  2309. {
  2310. numR = (+numOR + +numOne);
  2311. //document.getElementById('add').style.display = "inline";
  2312. }
  2313.  
  2314. if(numR <= 0)
  2315. {
  2316. //alert("MAX Low Reached : " + numR);
  2317. document.getElementById(55).style.display = "none";
  2318. return;
  2319. }
  2320. else if(numMax < numR)
  2321. {
  2322. //alert("MAX High Reached : " + numR);
  2323. document.getElementById(66).style.display = "none";
  2324. return;
  2325.  
  2326. }
  2327. else
  2328. {
  2329. document.getElementById(66).style.display = "inline";
  2330. document.getElementById(55).style.display = "inline";
  2331. }
  2332. document.getElementById(res[0]).value = numR;
  2333. switch(res[0])
  2334. {
  2335. case 'didnum':
  2336. //sid_fetch_did(numR);
  2337. rfr_sid_fetch_did();
  2338. break;
  2339. case 'dodnum':
  2340. rfr_sid_fetch_dod();
  2341. //document.getElementById('add1').style.display = "inline";
  2342. //sid_fetch_dod(numR);
  2343. break;
  2344. case 'acdno':
  2345. rfr_sid_fetch_acd();
  2346. break;
  2347. case 'allwdgrp':
  2348. fetch_allwdnum();
  2349. break;
  2350. case 'dendgrp':
  2351. fetch_dendnum();
  2352. break;
  2353. default:
  2354. return;
  2355. break;
  2356. }
  2357.  
  2358. }
  2359.  
  2360. function g_dod()
  2361. {
  2362. if(document.getElementById("dodnum").value == "Select")
  2363. {
  2364. alert("Please select DIDG Group Number");
  2365. return;
  2366. }
  2367. sid_fetch_dod(document.getElementById("dodnum").value);
  2368. }
  2369. function sid_voip()
  2370. {
  2371. sid_fetch_voip(document.getElementById("dodnum").value);
  2372. }
  2373. function sid_h()
  2374. {
  2375. sid_fetch_h(document.getElementById("dodnum").value);
  2376. }
  2377. function g_feat()
  2378. {
  2379. //sid_fetch_feat(document.getElementById("fnum").value);
  2380. sid_fetch_feat();
  2381. }
  2382. function g_dup()
  2383. {
  2384. // sid_fetch_feat(document.getElementById("fnum").value);
  2385. sid_fetch_feat();
  2386. }
  2387. function g_cos()
  2388. {
  2389. document.getElementById("type").value = "COS";
  2390. ghan_fetch_cos(document.getElementById("cosno").value);
  2391. }
  2392. function g_net()
  2393. {
  2394. document.getElementById("type").value = "NET";
  2395. get_net(document.getElementById("cosno").value);
  2396. }
  2397. function g_param()
  2398. {
  2399. document.getElementById(2).style.color = "#757575";
  2400. document.getElementById(0).style.color = "#ED1B03";
  2401. document.getElementById(1).style.color = "#757575";
  2402.  
  2403. //alert(document.getElementById("acdno").value);
  2404. if(document.getElementById("acdno").value == "Select")
  2405. {
  2406. alert("Please select ACD group number");
  2407. return;
  2408. }
  2409. document.getElementById("type").value = "ACD";
  2410. get_param(document.getElementById("acdno").value);
  2411. }
  2412. function g_amem()
  2413. {
  2414. //alert(document.getElementById("acdno").value);
  2415. if(document.getElementById("acdno").value == "Select")
  2416. {
  2417. alert("Please select ACD group number");
  2418. return;
  2419. }
  2420. document.getElementById("type").value = "Mem";
  2421. document.getElementById(0).style.color = "#757575";
  2422. document.getElementById(2).style.color = "#ED1B03";
  2423. document.getElementById(1).style.color = "#757575";
  2424. get_acdmem(document.getElementById("acdno").value);
  2425. }
  2426. function g_acc()
  2427. {
  2428. //alert(document.getElementById("bgrpno").value);
  2429. if(document.getElementById("bgrpno").value == "Select")
  2430. {
  2431. alert("Please enter Boss group number");
  2432. return;
  2433. }
  2434. document.getElementById("type").value = "BOSS";
  2435. get_bgrp(document.getElementById("bgrpno").value);
  2436. }
  2437. function g_mem()
  2438. {
  2439. //alert(document.getElementById("acdno").value);
  2440. if(document.getElementById("bgrpno").value == "Select")
  2441. {
  2442. alert("Please enter Boss group number");
  2443. return;
  2444. }
  2445. document.getElementById("type").value = "MEM";
  2446. get_mem(document.getElementById("bgrpno").value);
  2447. }
  2448. function g_res()
  2449. {
  2450. document.getElementById(0).style.color = "#757575";
  2451. document.getElementById(1).style.color = "#ED1B03";
  2452. document.getElementById(2).style.color = "#757575";
  2453. document.getElementById("type").value = "RES";
  2454. //alert(document.getElementById("rsuid").value);
  2455. //get_res(document.getElementById("acdno").value+":"+document.getElementById("rsid").value);
  2456. if(document.getElementById("acdno").value == "Select")
  2457. {
  2458. alert("Please select ACD group number");
  2459. return;
  2460. }
  2461. get_res(document.getElementById("acdno").value+":1");
  2462. }
  2463. function rfr_sid_res()
  2464. {
  2465. //alert(document.getElementById("acdno").value);
  2466. document.getElementById("type").value = "RES";
  2467. document.getElementById(0).style.color = " #757575";
  2468. document.getElementById(1).style.color = "#ED1B03";
  2469. get_res(document.getElementById("acdno").value+":"+document.getElementById("rsid").value);
  2470. }
  2471. function rfr_trk()
  2472. {
  2473. var data = null;
  2474. data=document.getElementById("number").value;
  2475. doWork(data,"gettrk","search");
  2476. }
  2477. function rfr_cnri()
  2478. {
  2479. var data = null;
  2480. if(setradiopg != null)
  2481. setradiopg = null;
  2482. data = document.getElementById("number").value;
  2483. doWork(data+"|cnri","getcnri","search");
  2484. }
  2485.  
  2486. function rfr_ext()
  2487. {
  2488. var data = null;
  2489. data = document.getElementById("number").value;
  2490. doWork(data,"getext","search");
  2491. }
  2492. function updateDssKtsKeys()
  2493. {
  2494. var data = null;
  2495. data = document.getElementById("number").value;
  2496. doWork(data,"getextDssKts","search");
  2497. }
  2498. function updateKeys()
  2499. {
  2500. var numkeys = null;
  2501. var name = "";
  2502. var data = "";
  2503. var i = 0;
  2504. var change = 0;
  2505. var number = document.getElementById("number").value;
  2506. numkeys = parseInt(document.getElementById("numkeys").value);
  2507. data += number+","
  2508. //alert("_"+number+"_");
  2509. for(i=0;i<numkeys;i++)
  2510. {
  2511. var keyopr = (document.getElementById("keyopr_"+i).value);
  2512. //alert("KEYOPR="+keyopr+"_");
  2513. if(keyopr == "18")
  2514. {
  2515. var txt_name = document.getElementById("txt_"+i).name;
  2516. var slct_name = document.getElementById("slct_"+i).name;
  2517. var tmpa = txt_name.split(",");
  2518. var tmpb = slct_name.split(",");
  2519. if(tmpa[1] == "change" && ((document.getElementById("txt_"+i).value).length) < 1)
  2520. {
  2521. alert("Value can not be NULL!");
  2522. break;
  2523. }
  2524. if(tmpa[1] == "change")
  2525. {
  2526. data += i+"_"+keyopr+"_"+document.getElementById("slct_"+i).value+"_"+document.getElementById("txt_"+i).value+"|";
  2527. change++;
  2528. }
  2529. //name += keyopr+"_"+txt_name+","+slct_name+"\n";
  2530. }
  2531. else if(keyopr == "0" || keyopr == "17")
  2532. {
  2533. var tmpa = (document.getElementById("txt_"+i).name).split(",");
  2534. if(tmpa[1] == "change" && ((document.getElementById("txt_"+i).value).length) < 1)
  2535. {
  2536. alert("Value can not be NULL!");
  2537. break;
  2538. }
  2539. if(tmpa[1] == "change")
  2540. {
  2541. data += i+"_"+keyopr+"_"+document.getElementById("txt_"+i).value+"|";
  2542. change++;
  2543. }
  2544. //name += keyopr+"_"+document.getElementById("txt_"+i).name+"\n";
  2545. }
  2546. else
  2547. {
  2548. var tmpa = (document.getElementById("keyopr_"+i).name).split(",");
  2549. if(tmpa[1] == "change")
  2550. {
  2551. data += i+"_"+keyopr+"|";
  2552. change++;
  2553. }
  2554. //name += keyopr+"_"+"NONE\n"
  2555. }
  2556. }
  2557. if(!change)
  2558. data = null;
  2559. //alert(data);
  2560. doWork(data,"setextDssKts","search");
  2561. }
  2562. function sel_all(obj,typ,itr)
  2563. {
  2564. if(obj.checked)
  2565. {
  2566. for(i =0; i < itr; i++)
  2567. {
  2568. if(document.getElementById(typ+i).checked == false)
  2569. {
  2570. check_s(document.getElementById(typ+i),i)
  2571. document.getElementById(typ+i).checked = true;
  2572. }
  2573. }
  2574. }
  2575. else
  2576. {
  2577. for(i =0; i < itr; i++)
  2578. {
  2579. check_s(document.getElementById(typ+i),i)
  2580. document.getElementById(typ+i).checked = false;
  2581. }
  2582. }
  2583. }
  2584. function checkIt(evt)
  2585. {
  2586. evt = (evt) ? evt : window.event
  2587. var charCode = (evt.which) ? evt.which : evt.keyCode
  2588. if (charCode > 31 && (charCode < 48 || charCode > 57))
  2589. {
  2590. status = "This field accepts numbers only."
  2591. return false;
  2592. }
  2593. status = "";
  2594. return true;
  2595. }
  2596. function checkclktext(evt)
  2597. {
  2598. evt = (evt) ? evt : window.event
  2599. var charCode = (evt.which) ? evt.which : evt.keyCode
  2600. if(charCode == 35 || charCode == 42)
  2601. return true;
  2602. else if (charCode > 31 && (charCode < 48 || charCode > 58))
  2603. {
  2604. status = "This field accepts numbers only.";
  2605. return false;
  2606. }
  2607. status = "";
  2608. return true;
  2609. }
  2610.  
  2611. function ipchecktext(evt)
  2612. {
  2613. evt = (evt) ? evt : window.event
  2614. var charCode = (evt.which) ? evt.which : evt.keyCode
  2615. if(charCode == 35 || charCode == 42)
  2616. return true;
  2617. else if (charCode > 31 && (charCode < 46 || charCode > 57 || charCode == 47))
  2618. {
  2619. status = "This field accepts IP formet only."
  2620. return false;
  2621. }
  2622. status = "";
  2623. return true;
  2624. }
  2625.  
  2626. function checkItextName(evt)
  2627. {
  2628. evt = (evt) ? evt : window.event
  2629. var charCode = (evt.which) ? evt.which : evt.keyCode
  2630. if(charCode == 32)
  2631. return true;
  2632.  
  2633. if(charCode >= 33 && charCode <= 47)
  2634. return false;
  2635. if(charCode >= 58 && charCode <= 64)
  2636. return false;
  2637. if(charCode >= 91 && charCode <= 96)
  2638. return false;
  2639. if(charCode == 124 || charCode == 123 || charCode == 125 || charCode == 126)
  2640. return false;
  2641.  
  2642. else if (charCode > 31 && (charCode < 48 || charCode > 122))
  2643. {
  2644. status = "This field accepts Alfa Numeric and * @ - _ char only."
  2645. return false;
  2646. }
  2647. status = "";
  2648. return true;
  2649. }
  2650.  
  2651. function checkItextT(evt,obj)
  2652. {
  2653. evt = (evt) ? evt : window.event
  2654. var charCode = (evt.which) ? evt.which : evt.keyCode
  2655.  
  2656. if(charCode == 35 || charCode == 42)
  2657. {
  2658. if(obj.value != "" && obj.value != 0 && (obj.value <= 0 || obj.value >= 60000))
  2659. {
  2660. alert("Invalid Range, Valid range is 0 - 60000!");
  2661. obj.value = obj.title;
  2662. return false;
  2663. }
  2664. return true;
  2665. }
  2666. else if (charCode > 31 && (charCode < 48 || charCode > 57))
  2667. {
  2668. status = "This field accepts numbers only."
  2669. return false;
  2670. }
  2671.  
  2672. if(obj.value != "" && obj.value != 0 && (obj.value <= 0 || obj.value >= 60000))
  2673. {
  2674. alert("Invalid Range, Valid range is 0 - 60000!");
  2675. obj.value = obj.title;
  2676. return false;
  2677. }
  2678. return true;
  2679. }
  2680.  
  2681. function validate_timer(obj)
  2682. {
  2683. if(obj.value != "" && obj.value != 0 && (obj.value < 0 || obj.value > 60000))
  2684. {
  2685. alert("Invalid Range, Valid range is 0 - 60000!");
  2686. obj.value = obj.title;
  2687. return false;
  2688. }
  2689. }
  2690.  
  2691. function isAlphaNum(event)
  2692. {
  2693. var regex = new RegExp("^[a-zA-Z0-9\\s]+$");
  2694. //alert(event + ' - ' + regex);
  2695. var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
  2696. var cKey = (!event.charCode ? event.which : event.charCode);
  2697. if(cKey == 8 || cKey == 0 || cKey == 32)
  2698. return true;
  2699.  
  2700. if(!regex.test(key))
  2701. {
  2702. event.preventDefault();
  2703. return false;
  2704. }
  2705. }
  2706.  
  2707. function getHTTPObject()
  2708. {
  2709. if(window.ActiveXObject)
  2710. return new ActiveXObject("Microsoft.XMLHTTP");
  2711. else if(window.XMLHttpRequest)
  2712. return new XMLHttpRequest();
  2713. else
  2714. {
  2715. alert("Your browser does not support AJAX.");
  2716. return null;
  2717. }
  2718. }
  2719. function doWork(obj,name,pgname)
  2720. {
  2721. //alert(obj+"__"+name+"__"+pgname);
  2722. if(obj == null)
  2723. obj = "NULL";
  2724. httpObject = getHTTPObject();
  2725. var nocache = Math.random();
  2726. // alert(nocache);
  2727. if(pgname == "gain" && name == "set_gain")
  2728. {
  2729. //document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
  2730.  
  2731. httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
  2732.  
  2733. httpObject.send(null);
  2734. httpObject.onreadystatechange = setOutput;
  2735. }
  2736. else if(pgname == "card" && name == "nsb_fetch_card")
  2737. {
  2738. //document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
  2739.  
  2740. httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
  2741.  
  2742. httpObject.send(null);
  2743. httpObject.onreadystatechange = setOutput;
  2744. }
  2745. else if(httpObject != null)
  2746. {
  2747. document.getElementById('notify_conf2').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
  2748. document.getElementById('tab_data').innerHTML = "<center><img src='resources/images/ajax-loader.gif' style='margin-top:15%;'></center>";
  2749.  
  2750. //To hide Menu On Click = NSB
  2751. document.getElementById('mn1').style = "overflow:visible; visibility:hidden";
  2752. document.getElementById('mn2').style = "overflow:visible; visibility:hidden";
  2753. document.getElementById('mn3').style = "overflow:visible; visibility:hidden";
  2754. document.getElementById('mn4').style = "overflow:visible; visibility:hidden";
  2755. document.getElementById('mn5').style = "overflow:visible; visibility:hidden";
  2756. document.getElementById('mn6').style = "overflow:visible; visibility:hidden";
  2757. document.getElementById('mn7').style = "overflow:visible; visibility:hidden";
  2758. document.getElementById('mn8').style = "overflow:visible; visibility:hidden";
  2759.  
  2760. httpObject.open("POST", "resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache, true);
  2761. // alert("resources/scripts/"+pgname+".php?"+name+"="+obj+'&nocache = '+nocache);
  2762. // alert(obj+"__"+name+"__"+pgname);
  2763. httpObject.send(null);
  2764. httpObject.onreadystatechange = setOutput;
  2765. }
  2766. else
  2767. {
  2768. alert("NSB else Case :: systmr> httpObject is null");
  2769. }
  2770. return true;
  2771. }
  2772. function setOutput()
  2773. {
  2774. var all_data = (httpObject.responseText).split("|");
  2775. //alert(all_data);
  2776. if(httpObject.readyState == 4 && httpObject.status == 200)
  2777. {
  2778. if(all_data[0] == "<h5>Welcome</h5>")
  2779. {
  2780. //alert("here we go");
  2781. var evr_data = (all_data[1]).split(",");
  2782. document.getElementById('tab_data').innerHTML = evr_data[0];
  2783. var sys = evr_data[3].replace(/^\s+|\s+$/g,'');
  2784. if(evr_data[2] == 1)
  2785. {
  2786. //basic_config();
  2787. }
  2788. if(sys == "i686")
  2789. {
  2790. if(evr_data[4] == "0")
  2791. {
  2792. alert("Licence not found");
  2793. document.getElementById("fileinfo").style.display = "inline";
  2794. document.getElementById("licinfo2").style.display = "inline";
  2795. }
  2796. else if(evr_data[4] == "1")
  2797. {
  2798. alert("Dongle not Connected");
  2799. document.getElementById("donginfo").style.display = "inline";
  2800. document.getElementById("licinfo2").style.display = "inline";
  2801. }
  2802. else if(evr_data[4] == "2")
  2803. {
  2804. alert("Licence expired");
  2805. document.getElementById("licinfo").style.display = "inline";
  2806. document.getElementById("licinfo2").style.display = "inline";
  2807. }
  2808. }
  2809. else
  2810. {
  2811. document.getElementById('lic').style.display ="none";
  2812. document.getElementById("lich").style.display = "none";
  2813. }
  2814.  
  2815. }
  2816. else if(all_data[0] == "SETFLEX")
  2817. {
  2818. var displayData = all_data[1].split(',');
  2819. var cardinfo = displayData[2].split('^'); //3,FXS32,97,128,32,Trk
  2820. var cardDet = cardinfo[0]+"^"+cardinfo[1]+"^"+cardinfo[2]+"^"+cardinfo[3]+"^"+cardinfo[4];
  2821.  
  2822. // alert(cardinfo);
  2823. if(displayData[0])
  2824. {
  2825. if(cardinfo[5]== "Trk")
  2826. {
  2827. //alert(" in trunk mode");
  2828. sucs_notify(displayData[0]);
  2829. nsb_fetch_card(cardDet);
  2830.  
  2831. }
  2832. else if(displayData[2] == "sip-ext")
  2833. {
  2834. sucs_notify(displayData[0]);
  2835. sip_ext_show();
  2836. }
  2837. else if(displayData[2] == "sip-trk")
  2838. {
  2839. sucs_notify(displayData[0]);
  2840. sip_trunk_show();
  2841.  
  2842. }
  2843. else
  2844. {
  2845. sucs_notify(displayData[0]);
  2846. add_flex(displayData[1]);
  2847. }
  2848. }
  2849. else
  2850. {
  2851. if(cardinfo[5]== "Trk")
  2852. {
  2853. //alert(" in trunk mode else section");
  2854. sucs_notify("Operation Successful!");
  2855. nsb_fetch_card(cardDet);
  2856.  
  2857. }
  2858.  
  2859. else if(displayData[2] == "sip-ext")
  2860. {
  2861. sucs_notify("Operation Successful!");
  2862. sip_ext_show();
  2863.  
  2864. }
  2865. else if(displayData[2] == "sip-trk")
  2866. {
  2867. sucs_notify("Operation Successful!");
  2868. sip_trunk_show();
  2869.  
  2870. }
  2871.  
  2872. else
  2873. {
  2874. sucs_notify("Operation Successful!");
  2875. add_flex(displayData[1]);
  2876. }
  2877. }
  2878. }
  2879. else if(all_data[0] == "SETPRI")
  2880. {
  2881. //alert(all_data[2]);
  2882. if(all_data[1])
  2883. {
  2884. sucs_notify(all_data[1]);
  2885. rfr_proto();
  2886. }
  2887. else
  2888. {
  2889. sucs_notify("Operation Successful!");
  2890. rfr_proto();
  2891. }
  2892. }
  2893. else if(all_data[0] == "SET")
  2894. {
  2895. //alert(all_data[0]);
  2896. if(all_data[1] == "No Changes Encountered!")
  2897. info_notify(all_data[1]);
  2898. else
  2899. sucs_notify(all_data[1] + wrong_entrytmrs);
  2900. wrong_entrytmrs = "";
  2901. get_timer();
  2902. }
  2903. else if(all_data[0] == "SETFEAT")
  2904. {
  2905. if(all_data[1] == "No Changes Encountered!")
  2906. {
  2907. info_notify(all_data[1]);
  2908. rfr_sid_fetch_feat();
  2909. }
  2910. else
  2911. {
  2912. sucs_notify(all_data[1]);
  2913. rfr_sid_fetch_feat();
  2914. }
  2915. }
  2916. else if(all_data[0] == "DELFLEX")
  2917. {
  2918. //alert("i am in deflex");
  2919. if(all_data[1] == "No Changes Encountered!")
  2920. {
  2921. info_notify(all_data[1]);
  2922. go_search1();
  2923. }
  2924. else
  2925. {
  2926. sucs_notify(all_data[1]);
  2927. go_search1();
  2928. }
  2929. }
  2930. else if(all_data[0] == "<h5>ADDEN</h5>" || all_data[0] == "<h5>DELDEN</h5>")
  2931. {
  2932. //alert("i am in deflex");
  2933. if(all_data[1] == "No Changes Encountered!")
  2934. {
  2935. info_notify(all_data[1]);
  2936. fetch_dendnum();
  2937. }
  2938. else
  2939. {
  2940. sucs_notify(all_data[1]);
  2941. fetch_dendnum();
  2942. }
  2943. }
  2944. else if(all_data[0] == "<h5>ADDALL</h5>" || all_data[0] == "<h5>DELALL</h5>")
  2945. {
  2946. //alert("i am in deflex");
  2947. if(all_data[1] == "No Changes Encountered!")
  2948. {
  2949. info_notify(all_data[1]);
  2950. fetch_allwdnum();
  2951. }
  2952. else
  2953. {
  2954. sucs_notify(all_data[1]);
  2955. fetch_allwdnum();
  2956. }
  2957. }
  2958. else if(all_data[0] == "<h5>Session Timeout</h5>")
  2959. {
  2960. var evr_data = (all_data[1]).split("`");
  2961. document.getElementById('tab_data').innerHTML = evr_data[0];
  2962.  
  2963. document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div><a href='ngx.php' class='link'>LOGIN</a></div>";
  2964. document.getElementById('data_update').innerHTML = "<table><tr>Relogin to Continue.<a href='ngx.php'>&nbsp;LOGIN&nbsp;</a> </tr></table>";
  2965. }
  2966. else if(all_data[0] == "<h5>System Timers</h5>")
  2967. {
  2968. var evr_data = (all_data[1]).split("`");
  2969. document.getElementById('tab_data').innerHTML = evr_data[0];
  2970. //document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div class='link'><a href='javascript:'>Help&nbsp;</a>&nbsp;|&nbsp;<a href='javascript:default_timer()'>&nbsp;Default All&nbsp;</a>&nbsp;|&nbsp;<a href='javascript:get_timer()'>&nbsp;Refresh&nbsp;</a>&nbsp;|&nbsp;<a href='javascript:go_val()'>&nbsp;Update&nbsp;</a></div>";
  2971. document.getElementById('contentboxhead').innerHTML =all_data[0]+"<div><a href='javascript:get_timer()' class='link'>&nbsp;Refresh&nbsp;</a><a href='javascript:go_val()' class='link'>&nbsp;Update&nbsp;</a></div>";
  2972. document.getElementById('data_update').innerHTML = evr_data[1];
  2973. $(document).ready(function()
  2974. {
  2975. $('tbody tr:even').addClass("alt-row"); // Add class "alt-row" to even table rows
  2976. });
  2977. }
  2978. else if(all_data[0] == "<h5>User Properties</h5>")
  2979. {
  2980. var evr_data = (all_data[1]).split(",");
  2981. document.getElementById('tab_data').innerHTML = evr_data[0];
  2982. document.getElementById('data_update').innerHTML = evr_data[1];
  2983. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></div>";
  2984.  
  2985. $(document).ready(function(){
  2986. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  2987. });
  2988. }
  2989. else if(all_data[0] == "<h5>User Search</h5>")
  2990. {
  2991. // alert(all_data[1]);
  2992. var evr_data = all_data[1];
  2993. //alert(evr_data);
  2994. document.getElementById('tab_data').innerHTML = (evr_data);
  2995. document.getElementById('data_update').innerHTML = all_data[0];
  2996. document.getElementById('contentboxhead').innerHTML = all_data[0];
  2997.  
  2998.  
  2999. $(document).ready(function(){
  3000. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3001. $('#body1 tr:even').addClass("alt-row1");
  3002. $('#body1 tr:odd').addClass("ext");
  3003. $('#body2 tr:even').addClass("alt-row1");
  3004. $('#body2 tr:odd').addClass("ext");
  3005. });
  3006. }
  3007. else if(all_data[0] == "<h5>Dial Plan</h5>")
  3008. {
  3009. //alert(all_data[1]);
  3010. var evr_data = all_data[1];
  3011. document.getElementById('tab_data').innerHTML = (evr_data);
  3012. //document.getElementById('data_update').innerHTML = evr_data[1];
  3013. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3014.  
  3015. $(document).ready(function(){
  3016. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3017. $('#body1 tr:even').addClass("alt-row1");
  3018. $('#body1 tr:odd').addClass("ext");
  3019. $('#body2 tr:even').addClass("alt-row1");
  3020. $('#body2 tr:odd').addClass("ext");
  3021. });
  3022. }
  3023. else if(all_data[0] == "<h5>Subscriber Properties</h5>")
  3024. {
  3025. //alert(all_data[1]);
  3026. var evr_data = all_data[1];
  3027. document.getElementById('tab_data').innerHTML = (evr_data);
  3028. //document.getElementById('data_update').innerHTML = evr_data[1];
  3029. document.getElementById('contentboxhead').innerHTML = all_data[0]
  3030. + "<div> <a href=\"javascript:getCard();\" class='link'>Cards</a>"
  3031. +"<a href='javascript:rfr_ext()' class='link' >Refresh</a><a href='javascript:updatext()' class='link'>Update</a></div>";
  3032. select();
  3033. // mail();
  3034. $(document).ready(function(){
  3035. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3036. $('#body1 tr:even').addClass("alt-row1");
  3037. $('#body1 tr:odd').addClass("ext");
  3038. $('#body2 tr:even').addClass("alt-row1");
  3039. $('#body2 tr:odd').addClass("ext");
  3040. });
  3041. }
  3042. else if(all_data[0] == "<h5>Subscriber Properties-DCC</h5>")
  3043. {
  3044. //alert("I am in DCC ext");
  3045. //alert(all_data[1]);
  3046. var evr_data = all_data[1];
  3047. document.getElementById('tab_data').innerHTML = (evr_data);
  3048. //document.getElementById('data_update').innerHTML = evr_data[1];
  3049. all_data[0] = "<h5>Subscriber Properties</h5>";
  3050. document.getElementById('contentboxhead').innerHTML = all_data[0]
  3051. + "<div> <a href=\"javascript:getCard();\" class='link'>Cards</a>"
  3052. + " <a href='javascript:rfr_ext()' class='link'>Refresh</a><a href='javascript:updatext()' class='link'>Update</a> </div>";
  3053. select();
  3054. $(document).ready(function(){
  3055. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3056. $('#body1 tr:even').addClass("alt-row1");
  3057. $('#body1 tr:odd').addClass("ext");
  3058. $('#body2 tr:even').addClass("alt-row1");
  3059. $('#body2 tr:odd').addClass("ext");
  3060. });
  3061. }
  3062. else if(all_data[0] == "<h5>KTS-DSS Keys</h5>")
  3063. {
  3064. //alert("I am in KTS-DSS Keys");
  3065. //alert(all_data[1]);
  3066. var evr_data = all_data[1];
  3067. document.getElementById('tab_data').innerHTML = (evr_data);
  3068. //document.getElementById('data_update').innerHTML = evr_data[1];
  3069. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_ext()' class='link' >Refresh</a><a href='javascript:updateKeys()' class='link'>Update</a><a href='javascript:updateDssKtsKeys()' class='link'>KTS Keys</a></span></div>";
  3070.  
  3071. $(document).ready(function(){
  3072. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3073. $('#body1 tr:even').addClass("alt-row1");
  3074. $('#body1 tr:odd').addClass("ext");
  3075. $('#body2 tr:even').addClass("alt-row1");
  3076. $('#body2 tr:odd').addClass("ext");
  3077. });
  3078. }
  3079. else if(all_data[0] == "SETKTSDSS")
  3080. {
  3081. if(all_data[1].length)
  3082. info_notify(all_data[1]);
  3083. else
  3084. sucs_notify("KTS Key Configuration saved successfully!");
  3085.  
  3086. updateDssKtsKeys();
  3087. }
  3088. else if(all_data[0] == "BACKUP")
  3089. {
  3090. //alert(httpObject.responseText);
  3091. if(all_data[1] == "No Changes Encountered!")
  3092. {
  3093. info_notify(all_data[1]);
  3094. }
  3095. else
  3096. {
  3097. sucs_notify(all_data[1]);
  3098. export_backup();
  3099. }
  3100. }
  3101. else if(all_data[0] == "<h5>Trunk Properties</h5>")
  3102. {
  3103. //alert(all_data[1]);
  3104. var evr_data = all_data[1];
  3105. document.getElementById('tab_data').innerHTML = evr_data;
  3106. var sip_hint = document.getElementById('sip_hint').value;
  3107. sip_hint= sip_hint.trim();
  3108. //alert(sip_hint);
  3109. if(sip_hint == "sip-trk")
  3110. {
  3111. //document.getElementById('data_update').innerHTML = evr_data[1];
  3112. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
  3113. + " <a href='javascript:sip_trunk_show()'>Back</a>&nbsp;|&nbsp;"
  3114. + " <a href=\"javascript:getCard();\">Cards</a>&nbsp;|&nbsp;"
  3115. + " <a href='javascript:rfr_sip_trk()'>Refresh</a>&nbsp;|&nbsp;"
  3116. + " <a href='javascript:updatsiptrk()'>Update</a></span></div>";
  3117.  
  3118. select();
  3119. $(document).ready(function(){
  3120. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3121. $('#body1 tr:even').addClass("alt-row1");
  3122. $('#body1 tr:odd').addClass("ext");
  3123. $('#body2 tr:even').addClass("alt-row1");
  3124. $('#body2 tr:odd').addClass("ext");
  3125. });
  3126.  
  3127.  
  3128. }
  3129. else
  3130. {
  3131. //document.getElementById('data_update').innerHTML = evr_data[1];
  3132. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
  3133. //+ " <a href=\"javascript:getCard();\">Cards</a>&nbsp;|&nbsp;"
  3134. //+ " <a href='javascript:rfr_trk()'>Refresh</a>&nbsp;|&nbsp;"
  3135. + " <a href='javascript:updattrk()'>Update</a></span></div>";
  3136.  
  3137. select();
  3138. $(document).ready(function(){
  3139. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3140. $('#body1 tr:even').addClass("alt-row1");
  3141. $('#body1 tr:odd').addClass("ext");
  3142. $('#body2 tr:even').addClass("alt-row1");
  3143. $('#body2 tr:odd').addClass("ext");
  3144. });
  3145. }
  3146.  
  3147. }
  3148. else if (all_data[0] == "<h5>CDR Display</h5>")
  3149. {
  3150. var evr_data = (all_data[1]).split(",");
  3151. // alert(evr_data[1]);
  3152. document.getElementById('tab_data').innerHTML = evr_data[0];
  3153. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:printDiv()' class='link'>Download</a>&nbsp&nbsp<a href='javascript:showcdr(\"/etc/vihaas\")' class='link'>Back</a></div>";
  3154.  
  3155. //document.getElementById('data_update').innerHTML = evr_data[1];
  3156. //document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'><a href='javascript:showcdr(\"/etc/vihaas\")'>Refresh</a>&nbsp;</div>";
  3157. }
  3158. else if(all_data[0] == "<h5>CNRI Properties</h5>")
  3159. {
  3160. var evr_data = all_data[1];
  3161. document.getElementById('tab_data').innerHTML = evr_data;
  3162. //document.getElementById('data_update').innerHTML = evr_data[1];
  3163. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_cnri()' class='link'>Refresh</a><a href='javascript:updatcnri()' class='link'>Update</a></span></div>";
  3164. select();
  3165. var radiotyp = document.getElementById("cnri_2").value;
  3166.  
  3167. if(setradiopg == null){
  3168. setradiopg = all_data[1];
  3169. setradioval = radiotyp;
  3170.  
  3171. }
  3172. else
  3173. {
  3174. if(radiotyp == 7)
  3175. valu = 1;
  3176. else if(radiotyp == 3)
  3177. valu = 2;
  3178. else if(radiotyp == 4)
  3179. valu = 3;
  3180. else
  3181. valu = 0;
  3182. document.getElementById("cnri_2").name = "slctd,changed";
  3183. defvalues[valu] = all_data[1];
  3184.  
  3185. }
  3186. if(document.getElementById("cnri_21").checked == true)
  3187. document.getElementById("cnri_22").disabled = false;
  3188. else
  3189. document.getElementById("cnri_22").disabled = true;
  3190.  
  3191.  
  3192. $(document).ready(function(){
  3193. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3194. $('#body1 tr:even').addClass("alt-row1");
  3195. $('#body1 tr:odd').addClass("ext");
  3196. $('#body2 tr:even').addClass("alt-row1");
  3197. $('#body2 tr:odd').addClass("ext");
  3198. });
  3199. }
  3200. else if(all_data[0] == "SETEXT")
  3201. {
  3202. //alert(httpObject.responseText);
  3203. if(all_data[1] == "No Changes Encountered!")
  3204. {
  3205. info_notify(all_data[1]);
  3206. rfr_ext();
  3207. }
  3208. else
  3209. {
  3210. sucs_notify(all_data[1]);
  3211. rfr_ext();
  3212. }
  3213. }
  3214. else if(all_data[0] == "SETENBLK")
  3215. {
  3216. //alert(httpObject.responseText);
  3217. if(all_data[1] == "No Changes Encountered!")
  3218. {
  3219. info_notify(all_data[1]);
  3220. }
  3221. else
  3222. {
  3223. sucs_notify(all_data[1]);
  3224. get_enblock();
  3225. }
  3226. }
  3227. else if(all_data[0] == "DELCARD")
  3228. {
  3229. //alert(httpObject.responseText);
  3230. if(all_data[1] == "No Changes Encountered!")
  3231. {
  3232. info_notify(all_data[1]);
  3233. }
  3234. else
  3235. {
  3236. sucs_notify(all_data[1]);
  3237. getCard();
  3238. }
  3239. }
  3240. else if(all_data[0] == "RESETCARD")
  3241. {
  3242. //alert(httpObject.responseText);
  3243. if(all_data[1] == "No Changes Encountered!")
  3244. {
  3245. info_notify(all_data[1]);
  3246. }
  3247. else
  3248. {
  3249. sucs_notify(all_data[1]);
  3250. getCard();
  3251. }
  3252. }
  3253. else if(all_data[0] == "CHANGECARD")
  3254. {
  3255. //alert(httpObject.responseText);
  3256. if(all_data[1] == "No Changes Encountered!")
  3257. {
  3258. info_notify(all_data[1]);
  3259. }
  3260. else
  3261. {
  3262. sucs_notify(all_data[1]);
  3263. getCard();
  3264. }
  3265. }
  3266.  
  3267. else if(all_data[0] == "CHANGECARDMODE")
  3268. {
  3269. //alert(httpObject.responseText);
  3270. if(all_data[1] == "No Changes Encountered!")
  3271. {
  3272. info_notify(all_data[1]);
  3273. }
  3274. else
  3275. {
  3276. sucs_notify(all_data[1]);
  3277. getCard();
  3278. }
  3279. }
  3280. else if(all_data[0] == "CHANGECARDPRIDB")
  3281. {
  3282. //alert(httpObject.responseText);
  3283. if(all_data[1] == "No Changes Encountered!")
  3284. {
  3285. info_notify(all_data[1]);
  3286. }
  3287. else
  3288. {
  3289. sucs_notify(all_data[1]);
  3290. getCard();
  3291. }
  3292. }
  3293.  
  3294. else if(all_data[0] == "CHANGEPORT")
  3295. {
  3296. //alert(httpObject.responseText);
  3297. if(all_data[1] == "No Changes Encountered!")
  3298. {
  3299. info_notify(all_data[1]);
  3300. }
  3301. else
  3302. {
  3303. sucs_notify(all_data[1]);
  3304. getCard();
  3305. }
  3306. }
  3307. else if(all_data[0] == "ADDCARD")
  3308. {
  3309. //alert(httpObject.responseText);
  3310. if(all_data[1] == "No Changes Encountered!")
  3311. {
  3312. info_notify(all_data[1]);
  3313. }
  3314. else
  3315. {
  3316. sucs_notify(all_data[1]);
  3317. getCard();
  3318. }
  3319. }
  3320.  
  3321. else if(all_data[0] == "SETACD")
  3322. {
  3323. //alert(httpObject.responseText);
  3324. if(all_data[1] == "No Changes Encountered!")
  3325. {
  3326. info_notify(all_data[1]);
  3327. rfr_sid_fetch_acd();
  3328. }
  3329. else
  3330. {
  3331. sucs_notify(all_data[1]);
  3332. rfr_sid_fetch_acd();
  3333. }
  3334. }
  3335. else if(all_data[0] == "SETRES")
  3336. {
  3337. //alert(httpObject.responseText);
  3338. if(all_data[1] == "No Changes Encountered!")
  3339. {
  3340. info_notify(all_data[1]);
  3341. rfr_sid_fetch_acd();
  3342. }
  3343. else
  3344. {
  3345. sucs_notify(all_data[1]);
  3346. rfr_sid_fetch_acd();
  3347. }
  3348. }
  3349. else if(all_data[0] == "ADDMEM")
  3350. {
  3351. //alert(httpObject.responseText);
  3352. if(all_data[1] == "No Changes Encountered!")
  3353. {
  3354. info_notify(all_data[1]);
  3355. document.getElementById("type").value == "Mem"
  3356. rfr_sid_fetch_acd();
  3357. }
  3358. else
  3359. {
  3360. sucs_notify(all_data[1]);
  3361. document.getElementById("type").value == "Mem"
  3362. rfr_sid_fetch_acd();
  3363. }
  3364. }
  3365. else if(all_data[0] == "SETBGRP")
  3366. {
  3367. //alert(httpObject.responseText);
  3368. if(all_data[1] == "No Changes Encountered!")
  3369. {
  3370. info_notify(all_data[1]);
  3371. rfr_sid_fetch_bgrp();
  3372. }
  3373. else
  3374. {
  3375. sucs_notify(all_data[1]);
  3376. rfr_sid_fetch_bgrp();
  3377. }
  3378. }
  3379. else if(all_data[0] == "DELBGRP" || all_data[0] == "ADDBGRP")
  3380. {
  3381. //alert(httpObject.responseText);
  3382. if(all_data[1] == "No Changes Encountered!")
  3383. {
  3384. info_notify(all_data[1]);
  3385. rfr_sid_fetch_bgrp();
  3386. }
  3387. else
  3388. {
  3389. sucs_notify(all_data[1]);
  3390. rfr_sid_fetch_bgrp();
  3391. }
  3392. }
  3393. else if(all_data[0] == "SETTRK")
  3394. {
  3395. //alert(httpObject.responseText);
  3396.  
  3397.  
  3398. if(all_data[1] == "No Changes Encountered!")
  3399. {
  3400. info_notify(all_data[1]);
  3401. rfr_trk();
  3402. }
  3403. else
  3404. {
  3405. sucs_notify(all_data[1]);
  3406. rfr_trk();
  3407. }
  3408. }
  3409. else if(all_data[0] == "SETSIPTRK")
  3410. {
  3411. if(all_data[1] == "No Changes Encountered!")
  3412. {
  3413. var val = all_data[1].split("^");
  3414. info_notify(all_data[1]);
  3415. rfr_sip_trk(val[1]);
  3416. }
  3417. else
  3418. {
  3419. var val = all_data[1].split("^");
  3420. sucs_notify(val[0]);
  3421. rfr_sip_trk1(val[1]);
  3422. }
  3423. }
  3424. else if(all_data[0] == "SETCNRI")
  3425. {
  3426. //alert(httpObject.responseText);
  3427. if(all_data[1] == "No Changes Encountered!")
  3428. {
  3429. info_notify(all_data[1]);
  3430. rfr_cnri();
  3431. }
  3432. else
  3433. {
  3434. sucs_notify(all_data[1]);
  3435. rfr_cnri();
  3436. }
  3437. }
  3438. else if(all_data[0] == "<h5>Bulk Configuration</h5>")
  3439. {
  3440. document.getElementById('tab_data').innerHTML = all_data[1];
  3441. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:get_extensions()' class='link'>Refresh</a><a href='javascript:' class='link'>Update</a></div>";
  3442.  
  3443. $(document).ready(function(){
  3444. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3445. $('#body1 tr:even').addClass("alt-row1");
  3446. $('#body1 tr:odd').addClass("ext");
  3447. $('#body2 tr:odd').addClass("alt-row1");
  3448. $('#body2 tr:even').addClass("ext");
  3449. });
  3450. }
  3451. else if (all_data[0] == "<h5>System Features</h5>")
  3452. {
  3453. //alert("i am in System features");
  3454. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3455. //alert(all_data[1]);
  3456. document.getElementById('tab_data').innerHTML = all_data[1];
  3457. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:get_sys()' class='link'>Refresh</a><a href='javascript:set_sys()' class='link'>Update</a></div>";
  3458. select();
  3459. $(document).ready(function(){
  3460. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3461. $('#body1 tr:even').addClass("alt-row1");
  3462. $('#body1 tr:odd').addClass("ext");
  3463. $('#body2 tr:even').addClass("alt-row1");
  3464. $('#body2 tr:odd').addClass("ext");
  3465. });
  3466. }
  3467. else if (all_data[0] == "<h5>SYS Configuration</h5>")
  3468. {
  3469. //alert("i am in System features");
  3470. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3471. //alert(all_data[1]);
  3472. document.getElementById('tab_data').innerHTML = all_data[1];
  3473. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:get_sysmgw()' class='link'>Refresh</a><a href='javascript:set_sysmgw()' class='link'>Update</a></div>";
  3474. select();
  3475. $(document).ready(function(){
  3476. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3477. $('#body1 tr:even').addClass("alt-row1");
  3478. $('#body1 tr:odd').addClass("ext");
  3479. $('#body2 tr:even').addClass("alt-row1");
  3480. $('#body2 tr:odd').addClass("ext");
  3481. });
  3482. }
  3483. else if (all_data[0] == "<h5>System Maintenance</h5>")
  3484. {
  3485. //alert("i am in System Commit");
  3486. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3487. //alert(all_data[1]);
  3488. document.getElementById('tab_data').innerHTML = all_data[1];
  3489. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3490.  
  3491. $(document).ready(function(){
  3492. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3493. $('#body1 tr:even').addClass("alt-row1");
  3494. $('#body1 tr:odd').addClass("ext");
  3495. $('#body2 tr:even').addClass("alt-row1");
  3496. $('#body2 tr:odd').addClass("ext");
  3497. });
  3498. }
  3499. else if (all_data[0] == "<h5>getCdrList</h5>")
  3500. {
  3501. //alert("i am in System Commit");
  3502. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3503. //alert(all_data[1]);
  3504. document.getElementById('tab_data').innerHTML = all_data[1];
  3505. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3506.  
  3507. $(document).ready(function(){
  3508. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3509. $('#body1 tr:even').addClass("alt-row1");
  3510. $('#body1 tr:odd').addClass("ext");
  3511. $('#body2 tr:even').addClass("alt-row1");
  3512. $('#body2 tr:odd').addClass("ext");
  3513. });
  3514. }
  3515. else if (all_data[0] == "<h5>System Commit</h5>")
  3516. {
  3517. //alert("i am in System Commit");
  3518. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3519. //alert(all_data[1]);
  3520. document.getElementById('tab_data').innerHTML = all_data[1];
  3521. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:showAutoCommit()' class='link'>Refresh</a><a href='javascript:setAutoCommit("+all_data[2]+")' class='link' class='link'>Update</a>|<a href='javascript:setAutoCommitAll()' class='link'>Commit All</a></div>";
  3522.  
  3523. $(document).ready(function(){
  3524. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3525. $('#body1 tr:even').addClass("alt-row1");
  3526. $('#body1 tr:odd').addClass("ext");
  3527. $('#body2 tr:even').addClass("alt-row1");
  3528. $('#body2 tr:odd').addClass("ext");
  3529. });
  3530. }
  3531. else if (all_data[0] == "<h5>CDR</h5>")
  3532. {
  3533. //alert("<h5>CDR</h5>");
  3534. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  3535. //alert(all_data[1]);
  3536. document.getElementById('tab_data').innerHTML = all_data[1];
  3537. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'><a href='javascript:showcdr(\"/etc/vihaas/\")'>Refresh</a>&nbsp;</div>";
  3538.  
  3539. $(document).ready(function(){
  3540. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3541. $('#body1 tr:even').addClass("alt-row1");
  3542. $('#body1 tr:odd').addClass("ext");
  3543. $('#body2 tr:even').addClass("alt-row1");
  3544. $('#body2 tr:odd').addClass("ext");
  3545. });
  3546. }
  3547.  
  3548. else if (all_data[0] == "setAutoCommit")
  3549. {
  3550. // alert(all_data[1]);
  3551. document.getElementById("tab_data").innerHTML = "";
  3552. if(all_data[1])
  3553. sucs_notify(all_data[1])
  3554. else
  3555. {
  3556. var err = all_data[1].split(",");
  3557. var errn = null;
  3558. for(i =0 ; i < err.length; i++)
  3559. {
  3560. if(errn == null)
  3561. errn = "Set operation failed for "+err[i]+"\n";
  3562. else
  3563. errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
  3564. }
  3565. //alert(errn);
  3566. }
  3567.  
  3568. $(document).ready(function(){
  3569. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3570. $('#body1 tr:even').addClass("alt-row1");
  3571. $('#body1 tr:odd').addClass("ext");
  3572. $('#body2 tr:even').addClass("alt-row1");
  3573. $('#body2 tr:odd').addClass("ext");
  3574. });
  3575. }
  3576. else if (all_data[0] == "set_sys")
  3577. {
  3578. //alert(all_data[1]);
  3579. document.getElementById("tab_data").innerHTML = "";
  3580. if(all_data[1])
  3581. {
  3582. sucs_notify(all_data[1]);
  3583. //nsbAlert(all_data[1] ,10000);
  3584. }
  3585. else
  3586. {
  3587. var err = all_data[1].split(",");
  3588. var errn = null;
  3589. for(i =0 ; i < err.length; i++)
  3590. {
  3591. if(errn == null)
  3592. errn = "Set operation failed for "+err[i]+"\n";
  3593. else
  3594. errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
  3595. }
  3596. //alert(errn);
  3597. }
  3598. get_sys();
  3599. $(document).ready(function(){
  3600. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3601. $('#body1 tr:even').addClass("alt-row1");
  3602. $('#body1 tr:odd').addClass("ext");
  3603. $('#body2 tr:even').addClass("alt-row1");
  3604. $('#body2 tr:odd').addClass("ext");
  3605. });
  3606. }
  3607. else if (all_data[0] == "set_sysmgw")
  3608. {
  3609. //alert(all_data[1]);
  3610. //alert(all_data[1]);
  3611. document.getElementById("tab_data").innerHTML = "";
  3612. if(all_data[1])
  3613. {
  3614. sucs_notify(all_data[1]);
  3615. //nsbAlert(all_data[1] ,10000);
  3616. }
  3617. else
  3618. {
  3619. var err = all_data[1].split(",");
  3620. var errn = null;
  3621. for(i =0 ; i < err.length; i++)
  3622. {
  3623. if(errn == null)
  3624. errn = "Set operation failed for "+err[i]+"\n";
  3625. else
  3626. errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
  3627. }
  3628. //alert(errn);
  3629. }
  3630. get_sysmgw();
  3631. $(document).ready(function(){
  3632. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3633. $('#body1 tr:even').addClass("alt-row1");
  3634. $('#body1 tr:odd').addClass("ext");
  3635. $('#body2 tr:even').addClass("alt-row1");
  3636. $('#body2 tr:odd').addClass("ext");
  3637. });
  3638. }
  3639. else if (all_data[0] == "<h5>Class of Service</h5>")
  3640. {
  3641. var evr_data = (all_data[1]).split(",");
  3642. document.getElementById('tab_data').innerHTML = evr_data[0];
  3643. document.getElementById('data_update').innerHTML = evr_data[1];
  3644. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3645. }
  3646. else if (all_data[0] == "<h5>Protocol Table</h5>")
  3647. {
  3648. var evr_data = (all_data[1]).split(",");
  3649. document.getElementById('tab_data').innerHTML = evr_data[0];
  3650. document.getElementById('data_update').innerHTML = evr_data[1];
  3651. //alert(all_data[0]+"_"+evr_data[0]+"|||||||||"+evr_data[1]+"_________________");
  3652.  
  3653. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateproto()' class='link'>Update</a></span></div>";
  3654. }
  3655. else if (all_data[0] == "<h5>Tone Table</h5>")
  3656. {
  3657. var evr_data = (all_data[1]).split(",");
  3658. document.getElementById('tab_data').innerHTML = evr_data[0];
  3659. document.getElementById('data_update').innerHTML = evr_data[1];
  3660. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_ghan_fetch_cos()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3661. }
  3662. else if (all_data[0] == "<h5>Tone Configuration</h5>")
  3663. {
  3664. //var evr_data = (all_data[1]).split(",");
  3665. document.getElementById('tab_data').innerHTML = all_data[1];
  3666. //alert(evr_data[0]);
  3667. //document.getElementById('data_update').innerHTML = evr_data[1];
  3668. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_tone()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3669. $(document).ready(function(){
  3670. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3671. $('#body1 tr:even').addClass("alt-row1");
  3672. $('#body1 tr:odd').addClass("ext");
  3673. $('#body2 tr:even').addClass("alt-row1");
  3674. $('#body2 tr:odd').addClass("ext");
  3675. });
  3676. }
  3677. else if (all_data[0] == "<h5>Bill Calculation</h5>")
  3678. {
  3679. var evr_data = (all_data[1]).split(",");
  3680. document.getElementById('tab_data').innerHTML = evr_data[0];
  3681. //alert(evr_data[0]);
  3682. document.getElementById('data_update').innerHTML = evr_data[1];
  3683. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_bill()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3684. $(document).ready(function(){
  3685. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3686. $('#body1 tr:even').addClass("alt-row1");
  3687. $('#body1 tr:odd').addClass("ext");
  3688. $('#body2 tr:even').addClass("alt-row1");
  3689. $('#body2 tr:odd').addClass("ext");
  3690. });
  3691. }
  3692. else if (all_data[0] == "<h5>Wait Tone Table</h5>")
  3693. {
  3694. var evr_data = (all_data[1]).split(",");
  3695. document.getElementById('tab_data').innerHTML = evr_data[0];
  3696. //alert(evr_data[0]);
  3697. document.getElementById('data_update').innerHTML = evr_data[1];
  3698. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_wait()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3699. $(document).ready(function(){
  3700. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3701. $('#body1 tr:even').addClass("alt-row1");
  3702. $('#body1 tr:odd').addClass("ext");
  3703. $('#body2 tr:even').addClass("alt-row1");
  3704. $('#body2 tr:odd').addClass("ext");
  3705. });
  3706. }
  3707. else if (all_data[0] == "<h5>Gain Configuration</h5>")
  3708. {
  3709. var evr_data = (all_data[1]).split(",");
  3710. document.getElementById('tab_data').innerHTML = evr_data[0];
  3711. //alert(evr_data[0]);
  3712. document.getElementById('data_update').innerHTML = evr_data[1];
  3713. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><a href='javascript:get_gain()' class='link'>Refresh</a></div>";
  3714. select();
  3715. $(document).ready(function(){
  3716. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3717. $('#body1 tr:even').addClass("alt-row1");
  3718. $('#body1 tr:odd').addClass("ext");
  3719. $('#body2 tr:even').addClass("alt-row1");
  3720. $('#body2 tr:odd').addClass("ext");
  3721. });
  3722. }
  3723. else if (all_data[0] == "<h5>Search</h5>")
  3724. {
  3725. //alert(all_data[1]);
  3726. var evr_data = (all_data[1]).split(",");
  3727. // alert(evr_data[1]);
  3728. document.getElementById('tab_data').innerHTML = evr_data[0];
  3729. document.getElementById('data_update').innerHTML = evr_data[1];
  3730. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3731. }
  3732. else if (all_data[0] == "<h5>CNRI Trunk</h5>")
  3733. {
  3734. var evr_data = (all_data[1]).split(",");
  3735. document.getElementById('tab_data').innerHTML = evr_data[0];
  3736. document.getElementById('data_update').innerHTML = evr_data[1];
  3737. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3738. }
  3739. else if (all_data[0] == "<h5>Dial Plan Search</h5>")
  3740. {
  3741. var evr_data = (all_data[1]).split(",");
  3742. document.getElementById('tab_data').innerHTML = evr_data[0];
  3743. document.getElementById('data_update').innerHTML = evr_data[1];
  3744. document.getElementById('contentboxhead').innerHTML = all_data[0];
  3745. // document.getElementById("usersubtype1").style.display = "none";
  3746. // document.getElementById("usersubtype2").style.display = "none";
  3747. }
  3748. else if (all_data[0] == "<h5>Config Flex</h5>")
  3749. {
  3750. var evr_data = (all_data[1]).split(",");
  3751. document.getElementById('tab_data').innerHTML = evr_data[0];
  3752. //document.getElementById('data_update').innerHTML = evr_data[1];
  3753. if(evr_data[1] == 1)
  3754. {
  3755. document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Add)</h5>";
  3756. document.getElementById("new3").style.display = "none";
  3757. document.getElementById("new4").style.display = "none";
  3758. document.getElementById("usersubtype1").style.display = "none";
  3759. document.getElementById("usersubtype2").style.display = "none";
  3760. }
  3761. else if(evr_data[1] == 2)
  3762. {
  3763. document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Delete)</h5>";
  3764. document.getElementById("new3").style.display = "none";
  3765. document.getElementById("new4").style.display = "none";
  3766. document.getElementById("usersubtype1").style.display = "none";
  3767. document.getElementById("usersubtype2").style.display = "none";
  3768. }
  3769. else if(evr_data[1] == 3)
  3770. {
  3771. //alert("MOdify");
  3772. document.getElementById('contentboxhead').innerHTML = "<h5>Config Flex (Modify)</h5>";
  3773. document.getElementById("usertype1").style.display = "none";
  3774. document.getElementById("usertype2").style.display = "none";
  3775. document.getElementById("sub1").style.display = "none";
  3776. document.getElementById("sub2").style.display = "none";
  3777. document.getElementById("sub3").style.display = "absolute";
  3778. document.getElementById("sub4").style.display = "absolute";
  3779. document.getElementById("new3").style.display = "absolute";
  3780. document.getElementById("new4").style.display = "absolute";
  3781. }
  3782. //document.getElementById("usersubtype1").style.display = "none";
  3783. //document.getElementById("usersubtype2").style.display = "none";
  3784. }
  3785. else if (all_data[0] == "<h5>ACD Group</h5>")
  3786. {
  3787. // alert("sid_acd");
  3788. var evr_data = (all_data[1]).split(",");
  3789. document.getElementById('tab_data').innerHTML = evr_data[0];
  3790. document.getElementById('data_update').innerHTML = evr_data[1];
  3791. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
  3792. document.getElementById("type").value = "ACD";
  3793. }
  3794. else if (all_data[0] == "<h5>ACD Group (Member)</h5>")
  3795. {
  3796. // alert("sid_acd");
  3797. // var evr_data = (all_data[1]).split(",");
  3798. document.getElementById('tab_data').innerHTML = all_data[1];
  3799. //document.getElementById('data_update').innerHTML = all_data[2];
  3800. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:add_acd()' class='link'>Add</a><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
  3801. $(document).ready(function(){
  3802. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3803. $('#body1 tr:even').addClass("alt-row1");
  3804. $('#body1 tr:odd').addClass("ext");
  3805. $('#body2 tr:even').addClass("alt-row1");
  3806. $('#body2 tr:odd').addClass("ext");
  3807. });
  3808. }
  3809. else if (all_data[0] == "<h5>ACD Group (Member ADD)</h5>")
  3810. {
  3811. // alert("sid_acd");
  3812. // var evr_data = (all_data[1]).split(",");
  3813. //document.getElementById('tab_data').innerHTML = all_data[2];
  3814. document.getElementById('tab_data').innerHTML = all_data[1];
  3815. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Back</a><a href='javascript:update_acdmem()' class='link'>Update</a></span></div>";
  3816. }
  3817. else if (all_data[0] == "<h5>Boss Group (Member ADD)</h5>")
  3818. {
  3819. // alert("sid_acd");
  3820. // var evr_data = (all_data[1]).split(",");
  3821. //document.getElementById('tab_data').innerHTML = all_data[2];
  3822. document.getElementById('tab_data').innerHTML = all_data[1];
  3823. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Back</a></span></div>"; //|&nbsp;<a href='javascript:update_acd()'>Update</a>
  3824. }
  3825. else if (all_data[0] == "<h5>Boss Group</h5>")
  3826. {
  3827. //alert("Boss Group Called");
  3828. var evr_data = (all_data[1]).split(",");
  3829. document.getElementById('tab_data').innerHTML = evr_data[0];
  3830. document.getElementById('data_update').innerHTML = evr_data[1];
  3831. document.getElementById('contentboxhead').innerHTML = all_data[0] ;
  3832. }
  3833.  
  3834. else if(all_data[0] == "<h5>Boss Group (Access Code)</h5>")
  3835. {
  3836. //alert(all_data[1]);
  3837. var evr_data = all_data[1];
  3838. document.getElementById('tab_data').innerHTML = evr_data;
  3839. //document.getElementById('data_update').innerHTML = evr_data[1];
  3840. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Refresh</a><a href='javascript:update_acc()' class='link'>Update</a></span></div>";
  3841.  
  3842. $(document).ready(function(){
  3843. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3844. $('#body1 tr:even').addClass("alt-row1");
  3845. $('#body1 tr:odd').addClass("ext");
  3846. $('#body2 tr:even').addClass("alt-row1");
  3847. $('#body2 tr:odd').addClass("ext");
  3848. });
  3849. }
  3850. else if(all_data[0] == "<h5>Boss Group (Member)</h5>")
  3851. {
  3852. //alert(all_data[1]);
  3853. var evr_data = all_data[1];
  3854. document.getElementById('tab_data').innerHTML = evr_data;
  3855. //document.getElementById('data_update').innerHTML = evr_data[1];
  3856. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_bgrp()' class='link'>Refresh</a><a href='javascript:add_bgrp()' class='link'>Add</a></span></div>"; //&nbsp;<a href='javascript:update_acd()'>Update</a>&nbsp;|
  3857.  
  3858. $(document).ready(function(){
  3859. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3860. $('#body1 tr:even').addClass("alt-row1");
  3861. $('#body1 tr:odd').addClass("ext");
  3862. $('#body2 tr:even').addClass("alt-row1");
  3863. $('#body2 tr:odd').addClass("ext");
  3864. });
  3865. }
  3866. else if(all_data[0] == "<h5>ACD Parameters</h5>")
  3867. {
  3868. //alert(all_data[1]);
  3869. var evr_data = all_data[1];
  3870. document.getElementById('tab_data').innerHTML = evr_data;
  3871. //document.getElementById('data_update').innerHTML = evr_data[1];
  3872. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_acd()' class='link'>Update</a></span></div>";
  3873. select();
  3874. $(document).ready(function(){
  3875. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3876. $('#body1 tr:even').addClass("alt-row1");
  3877. $('#body1 tr:odd').addClass("ext");
  3878. $('#body2 tr:even').addClass("alt-row1");
  3879. $('#body2 tr:odd').addClass("ext");
  3880. });
  3881. }
  3882. else if (all_data[0] == "<h5>NTP</h5>")
  3883. {
  3884. document.getElementById("conff").innerHTML = null;
  3885. var evr_data = all_data[1].split('*');
  3886. document.getElementById("configtab").innerHTML = evr_data[0];
  3887. process = evr_data[1].replace(/^\s+|\s+$/g,'');
  3888. document.getElementById("lich").innerHTML = evr_data[2];
  3889.  
  3890. if(ntpval)
  3891. {
  3892. var val = ntpval.split(':');
  3893. for(i=0;i<10;i++)
  3894. document.getElementById("net_"+i).value = val[i];
  3895.  
  3896. }
  3897. else
  3898. {
  3899. ntpoldval = null;
  3900. for(i=0;i<10;i++)
  3901. {
  3902. if(ntpoldval == null)
  3903. ntpoldval = document.getElementById("net_"+i).value;
  3904. else
  3905. ntpoldval += "|"+document.getElementById("net_"+i).value;
  3906. }
  3907. }
  3908.  
  3909. }
  3910. else if( all_data[0] == "<h5>Getstart</h5>")
  3911. {
  3912. document.getElementById("conff").innerHTML = null;
  3913. document.getElementById("configtab").innerHTML = all_data[1];
  3914. }
  3915. else if( all_data[0] == "<h5>HA Confstart</h5>")
  3916. {
  3917. document.getElementById("conff").innerHTML = null;
  3918. document.getElementById("configtab").innerHTML = all_data[1];
  3919.  
  3920. }
  3921. else if(all_data[0] == "<h5>allsetin</h5>")
  3922. {
  3923. document.getElementById("confirmdata").innerHTML = all_data[1];
  3924. document.getElementById("close").style.display = "none";
  3925. document.getElementById("confirmtab").style.display = "inline";
  3926. select();
  3927. }
  3928. else if(all_data[0] == "<h5>ACD Resource</h5>")
  3929. {
  3930. //alert(all_data[1]);
  3931. var evr_data = all_data[1];
  3932. document.getElementById('tab_data').innerHTML = evr_data;
  3933. //document.getElementById('data_update').innerHTML = evr_data[1];
  3934. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_sid_fetch_acd()' class='link'>Refresh</a><a href='javascript:update_res()' class='link'>Update</a></span></div>";
  3935.  
  3936. $(document).ready(function(){
  3937. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3938. $('#body1 tr:even').addClass("alt-row1");
  3939. $('#body1 tr:odd').addClass("ext");
  3940. $('#body2 tr:even').addClass("alt-row1");
  3941. $('#body2 tr:odd').addClass("ext");
  3942. });
  3943. }
  3944. else if(all_data[0] == "<h5>DCMD Configuration</h5>")
  3945. {
  3946. //alert(all_data[1]);
  3947. var evr_data = all_data[1];
  3948. document.getElementById('tab_data').innerHTML = evr_data;
  3949. //document.getElementById('data_update').innerHTML = evr_data[1];
  3950. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_dcmd()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  3951.  
  3952. $(document).ready(function(){
  3953. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3954. $('#body1 tr:even').addClass("alt-row1");
  3955. $('#body1 tr:odd').addClass("ext");
  3956. $('#body2 tr:even').addClass("alt-row1");
  3957. $('#body2 tr:odd').addClass("ext");
  3958. });
  3959. }
  3960. else if(all_data[0] == "<h5>TDM Interface</h5>")
  3961. {
  3962. //alert(all_data[0]);
  3963. //alert(all_data[1]);
  3964. var evr_data = all_data[1];
  3965. document.getElementById('tab_data').innerHTML = evr_data;
  3966. document.getElementById('contentboxhead').innerHTML = all_data[0] +
  3967. "<div><span id='lrfr' style='display:inline'> "
  3968. + "<a href='javascript:get_card()' class='link'>Refresh</a>&nbsp;"
  3969. + "</span></div>";
  3970.  
  3971. $(document).ready(function(){
  3972. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3973. $('#body1 tr:even').addClass("alt-row1");
  3974. $('#body1 tr:odd').addClass("ext");
  3975. $('#body2 tr:even').addClass("alt-row1");
  3976. $('#body2 tr:odd').addClass("ext");
  3977. });
  3978. }
  3979. else if (all_data[0] == "<h5>tdm_card</h5>") // Showing Card Details, i.e. Ports of the card.
  3980. {
  3981. //var evr_data = (all_data[1]).split(",");
  3982.  
  3983. var evr_data = all_data[1];
  3984. //var cardSelected = document.getElementById('nsbCardNo');Card Number
  3985. //alert(cardSelected);
  3986. document.getElementById('tab_data').innerHTML = evr_data;
  3987. document.getElementById('contentboxhead').innerHTML = "<H5>Card Number</H5>" +
  3988. "<div> "
  3989. //+ links
  3990. + "<a href=\"javascript:getCard();\" class='link'>Back</a>"
  3991. + "</div>";
  3992.  
  3993. $(document).ready(function(){
  3994. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  3995. $('#body1 tr:even').addClass("alt-row1");
  3996. $('#body1 tr:odd').addClass("ext");
  3997. $('#body2 tr:even').addClass("alt-row1");
  3998. $('#body2 tr:odd').addClass("ext");
  3999. });
  4000. }
  4001. else if (all_data[0] == "<h5>Card Number</h5>") // Show Card Page
  4002. {
  4003. //alert(all_data[1]);
  4004. var evr_data = (all_data[1]).split(",");
  4005. // var data = "<div><h5>Card Number</h5></div>"
  4006. document.getElementById('tab_data').innerHTML = evr_data[0];
  4007. document.getElementById('data_update').innerHTML = evr_data[1];
  4008. document.getElementById('contentboxhead').innerHTML = "<H5>Card Number</H5>" +
  4009. "<div> "
  4010. //+ links
  4011. + "<a href=\"javascript:add_card()\" class='link'>New Card</a>"
  4012. + "<a href=\"javascript:getCard()\" class='link'>Refresh</a>"
  4013. + "</div>";
  4014.  
  4015. }
  4016. else if (all_data[0] == "tdm_port")
  4017. {
  4018. document.getElementById("tab_data").innerHTML = all_data[1];
  4019. select();
  4020. $(document).ready(function(){
  4021. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4022. $('#body1 tr:even').addClass("alt-row1");
  4023. $('#body1 tr:odd').addClass("ext");
  4024. $('#body2 tr:even').addClass("alt-row1");
  4025. $('#body2 tr:odd').addClass("ext");
  4026. });
  4027. }
  4028. else if (all_data[0] == "<h5>Backup</h5>")
  4029. {
  4030. var evr_data = (all_data[1]).split(",");
  4031. // alert(evr_data[1]);
  4032. document.getElementById('tab_data').innerHTML = evr_data[0];
  4033. document.getElementById('data_update').innerHTML = evr_data[1];
  4034. //document.getElementById('contentboxhead').innerHTML = all_data[0];
  4035. }
  4036. else if (all_data[0] == "<h5>Restore</h5>")
  4037. {
  4038. //alert(all_data[1]);
  4039. var evr_data = (all_data[1]).split(",");
  4040. // alert(evr_data[1]);
  4041. if(all_data[1] == "")
  4042. {
  4043. document.getElementById('tab_data').innerHTML = "Backup file not fond!!!";
  4044. }
  4045. else
  4046. {
  4047. document.getElementById('tab_data').innerHTML = all_data[1];
  4048. }
  4049. }
  4050. else if(all_data[0] == "<h5>CCMD Configuration</h5>")
  4051. {
  4052. //alert(all_data[1]);
  4053. var evr_data = all_data[1];
  4054. document.getElementById('tab_data').innerHTML = evr_data;
  4055. //document.getElementById('data_update').innerHTML = evr_data[1];
  4056. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:get_ccmd()' class='link'>Refresh</a><a href='javascript:update()' class='link'>Update</a></span></div>";
  4057.  
  4058. $(document).ready(function(){
  4059. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4060. $('#body1 tr:even').addClass("alt-row1");
  4061. $('#body1 tr:odd').addClass("ext");
  4062. $('#body2 tr:even').addClass("alt-row1");
  4063. $('#body2 tr:odd').addClass("ext");
  4064. });
  4065. }
  4066. else if(all_data[0] == "confirmshow")
  4067. {
  4068. //alert(httpObject.responseText);
  4069. //document.getElementById("contentconfig").style.opacity = "0.7";
  4070. //document.getElementById("contentconfig").style.filter= "alpha(opacity=70)";
  4071. //salert(all_data[1]);
  4072. var evr_data = (all_data[1]).split("*");
  4073. visible = null;
  4074. visible = evr_data[1];
  4075. document.getElementById("confirmdata").innerHTML = evr_data[0];
  4076. document.getElementById("close").style.display = "none";
  4077. document.getElementById("confirmtab").style.display = "inline";
  4078. //alert(rsuchange[1]);
  4079. for(i=0;i<64;i++)
  4080. {
  4081. if(rsuchange[i])
  4082. {
  4083. document.getElementById(rsuchange[i]).style.opacity = "1.0";
  4084. }
  4085. }
  4086. select();
  4087.  
  4088. if(process == "i686")
  4089. {
  4090. if(visible == 1)
  4091. {
  4092. var old = ntpoldval+"|"+licoldval+"|"+pmoldval;
  4093. var oldval = old.split("|");
  4094.  
  4095. for(i=0;i<18;i++)
  4096. {
  4097. var s = document.getElementById("conf_"+(i+2));
  4098. if(s.value == oldval[i])
  4099. { s.name = "nochnge"; }
  4100. else
  4101. { s.name = "changed"; }
  4102. }
  4103. }
  4104. else if(visible == 0)
  4105. {
  4106. var old = ntpoldval;
  4107. var oldval = old.split("|");
  4108. for(i=0;i<10;i++)
  4109. {
  4110. var s = document.getElementById("conf_"+(i+2));
  4111. if(s.value == oldval[i])
  4112. { s.name = "nochnge"; }
  4113. else
  4114. { s.name = "changed"; }
  4115. }
  4116. }
  4117. }
  4118. else /*if(process == "ppc")*/
  4119. {
  4120. var old = ntpoldval+"|"+pmoldval;
  4121. var oldval = old.split("|");
  4122.  
  4123. for(i=0;i<14;i++)
  4124. {
  4125. if(i<10)
  4126. var s = document.getElementById("conf_"+(i+2));
  4127. else
  4128. var s = document.getElementById("conf_"+(i+6));
  4129.  
  4130. if(s.value == oldval[i])
  4131. {
  4132. s.name = "nochnge";
  4133. }
  4134. else
  4135. {
  4136. s.name = "changed";
  4137. }
  4138. }
  4139. }
  4140. }
  4141. else if (all_data[0] == "fghan_cos")
  4142. {
  4143. document.getElementById("tab_data").innerHTML = all_data[1];
  4144. $(document).ready(function(){
  4145. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4146. $('#body1 tr:even').addClass("alt-row1");
  4147. $('#body1 tr:odd').addClass("ext");
  4148. $('#body2 tr:even').addClass("alt-row1");
  4149. $('#body2 tr:odd').addClass("ext");
  4150. });
  4151. }
  4152. else if (all_data[0] == "<h5>Protocol Configuration</h5>")
  4153. {
  4154. document.getElementById("tab_data").innerHTML = all_data[1];
  4155. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateproto()' class='link'>Update</a></span></div>";
  4156. select();
  4157. $(document).ready(function(){
  4158. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4159. $('#body1 tr:even').addClass("alt-row1");
  4160. $('#body1 tr:odd').addClass("ext");
  4161. $('#body2 tr:even').addClass("alt-row1");
  4162. $('#body2 tr:odd').addClass("ext");
  4163. });
  4164. }
  4165. else if (all_data[0] == "<h5>Protocol Timers</h5>")
  4166. {
  4167. document.getElementById("tab_data").innerHTML = all_data[1];
  4168. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:rfr_proto()' class='link'>Refresh</a><a href='javascript:updateTimer()' class='link'>Update</a></span></div>";
  4169. $(document).ready(function(){
  4170. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4171. $('#body1 tr:even').addClass("alt-row1");
  4172. $('#body1 tr:odd').addClass("ext");
  4173. $('#body2 tr:even').addClass("alt-row1");
  4174. $('#body2 tr:odd').addClass("ext");
  4175. });
  4176. }
  4177. else if (all_data[0] == "set_cos")
  4178. {
  4179. document.getElementById("tab_data").innerHTML = "";
  4180. if(all_data[1])
  4181. sucs_notify(all_data[1])
  4182. else
  4183. {
  4184. var err = all_data[1].split(",");
  4185. var errn = null;
  4186. for(i =0 ; i < err.length; i++)
  4187. {
  4188. if(errn == null)
  4189. errn = "Set operation failed for "+err[i]+"\n";
  4190. else
  4191. errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
  4192. }
  4193. //alert(errn);
  4194. }
  4195. g_cos();
  4196. $(document).ready(function(){
  4197. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4198. $('#body1 tr:even').addClass("alt-row1");
  4199. $('#body1 tr:odd').addClass("ext");
  4200. $('#body2 tr:even').addClass("alt-row1");
  4201. $('#body2 tr:odd').addClass("ext");
  4202. });
  4203. }
  4204. else if (all_data[0] == "set_grp")
  4205. {
  4206. document.getElementById("tab_data").innerHTML = "";
  4207. if(all_data[1].length < 1)
  4208. sucs_notify("COS tables have been updated successfully!");
  4209. else
  4210. {
  4211. var err = all_data[1].split(",");
  4212. var errn = null;
  4213. for(i =0 ; i < err.length; i++)
  4214. {
  4215. if(errn == null)
  4216. errn = "Set operation failed for "+err[i]+"\n";
  4217. else
  4218. errn = errn+"|"+"Set operation failed for "+err[i]+"\n";
  4219. }
  4220. //alert(errn);
  4221. //alert(all_data[1]);
  4222. }
  4223. g_net();
  4224. }
  4225. else if (all_data[0] == "<h5>Feature Numbering Plan</h5>")
  4226. {
  4227. var evr_data = (all_data[1]).split(",");
  4228. document.getElementById('tab_data').innerHTML = evr_data[0];
  4229. document.getElementById('data_update').innerHTML = evr_data[1];
  4230. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfrfeat' style='display:none'><a href='javascript:rfr_sid_fetch_feat()' class='link'>Refresh</a><a href='javascript:go_feat()' class='link'>Update</a></span></div>";
  4231. }
  4232. else if (all_data[0] == "fsid_feat")
  4233. {
  4234. var evr_data = (all_data[1]).split(",");
  4235. document.getElementById("tab_data").innerHTML = evr_data[0];
  4236. document.getElementById('data_update').innerHTML = evr_data[1];
  4237. document.getElementById('contentboxhead').innerHTML = "<h5>Feature Numbering Plan</h5>" + "<div><span id='lrfrfeat' ><a href='javascript:sid_feat()' class='link'>Refresh</a><a href='javascript:go_feat()' class='link'>Update</a></span></div>";
  4238.  
  4239. $(document).ready(function(){
  4240. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4241. $('#body1 tr:even').addClass("alt-row1");
  4242. $('#body1 tr:odd').addClass("ext");
  4243. $('#body2 tr:even').addClass("alt-row1");
  4244. $('#body2 tr:odd').addClass("ext");
  4245. });
  4246. }
  4247. else if (all_data[0] == "<h5>Duplicate Numbering Plan</h5>")
  4248. {
  4249. var evr_data = (all_data[1]).split("`");
  4250. document.getElementById('tab_data').innerHTML = evr_data[0];
  4251. document.getElementById('data_update').innerHTML = evr_data[1];
  4252. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_dup()' class='link'>Refresh</a><a href='javascript:show_add()' class='link'>Add</a></span></div>";
  4253. $(document).ready(function(){
  4254. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4255. $('#body1 tr:even').addClass("alt-row1");
  4256. $('#body1 tr:odd').addClass("ext");
  4257. $('#body2 tr:even').addClass("alt-row1");
  4258. $('#body2 tr:odd').addClass("ext");
  4259. });
  4260. }
  4261. else if (all_data[0] == "<h5>Enblock Table</h5>")
  4262. {
  4263. var evr_data = (all_data[1]).split("`");
  4264. document.getElementById('tab_data').innerHTML = evr_data[0];
  4265. document.getElementById('data_update').innerHTML = evr_data[1];
  4266. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:get_enblock()' class='link'>Refresh</a><a href='javascript:show_add()' class='link'>Add</a></span></div>";
  4267. $(document).ready(function(){
  4268. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4269. $('#body1 tr:even').addClass("alt-row1");
  4270. $('#body1 tr:odd').addClass("ext");
  4271. $('#body2 tr:even').addClass("alt-row1");
  4272. $('#body2 tr:odd').addClass("ext");
  4273. });
  4274. }
  4275. else if (all_data[0] == "GODUP")
  4276. {
  4277. //alert("i am in set output duplicate!");
  4278. if(all_data[1] == "No Changes Encountered!")
  4279. {
  4280. info_notify(all_data[1]);
  4281. sid_dup();
  4282. }
  4283. else
  4284. {
  4285. sucs_notify(all_data[1]);
  4286. sid_dup();
  4287. }
  4288. }
  4289. else if (all_data[0] == "<h5>Backup</h5>")
  4290. {
  4291. var evr_data = (all_data[1]).split(",");
  4292. // alert(evr_data[1]);
  4293. document.getElementById('tab_data').innerHTML = evr_data[0];
  4294. document.getElementById('data_update').innerHTML = evr_data[1];
  4295. //document.getElementById('contentboxhead').innerHTML = all_data[0];
  4296. }
  4297. else if (all_data[0] == "<h5>Restore</h5>")
  4298. {
  4299. //alert(all_data[1]);
  4300. var evr_data = (all_data[1]).split(",");
  4301. // alert(evr_data[1]);
  4302. if(all_data[1] == "")
  4303. {
  4304. document.getElementById('tab_data').innerHTML = "Backup file not fond!!!";
  4305. }
  4306. else
  4307. {
  4308. document.getElementById('tab_data').innerHTML = all_data[1];
  4309. }
  4310. }
  4311. else if (all_data[0] == "<h5>DID Group</h5>")
  4312. {
  4313. var evr_data = (all_data[1]).split(",");
  4314. document.getElementById('tab_data').innerHTML = evr_data[0];
  4315. document.getElementById('data_update').innerHTML = evr_data[1];
  4316. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_did()' class='link'>Refresh</a><a href='javascript:go_did()' class='link'>Update</a></span></div>";
  4317. }
  4318. else if (all_data[0] == "fsid_did")
  4319. {
  4320. document.getElementById("tab_data").innerHTML = all_data[1];
  4321. select();
  4322. $(document).ready(function(){
  4323. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4324. $('#body1 tr:even').addClass("alt-row1");
  4325. $('#body1 tr:odd').addClass("ext");
  4326. $('#body2 tr:even').addClass("alt-row1");
  4327. $('#body2 tr:odd').addClass("ext");
  4328. });
  4329. }
  4330. else if (all_data[0] == "<h5>DID Members</h5>")
  4331. {
  4332. document.getElementById("tab_data").innerHTML = all_data[1];
  4333. $(document).ready(function(){
  4334. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4335. $('#body1 tr:even').addClass("alt-row1");
  4336. $('#body1 tr:odd').addClass("ext");
  4337. $('#body2 tr:even').addClass("alt-row1");
  4338. $('#body2 tr:odd').addClass("ext");
  4339. });
  4340. }
  4341. else if (all_data[0] == "<h5>DOD Members</h5>")
  4342. {
  4343. document.getElementById("tab_data").innerHTML = all_data[1];
  4344. //document.getElementById("contentboxhead").innerHTML = all_data[0];
  4345. $(document).ready(function(){
  4346. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4347. $('#body1 tr:even').addClass("alt-row1");
  4348. $('#body1 tr:odd').addClass("ext");
  4349. $('#body2 tr:even').addClass("alt-row1");
  4350. $('#body2 tr:odd').addClass("ext");
  4351. });
  4352. }
  4353. else if(all_data[0] == "SETDID")
  4354. {
  4355. //alert(httpObject.responseText);
  4356. if(all_data[1] == "No Changes Encountered!")
  4357. {
  4358. info_notify(all_data[1]);
  4359. rfr_sid_fetch_did();
  4360. }
  4361. else
  4362. {
  4363. sucs_notify(all_data[1]);
  4364. rfr_sid_fetch_did();
  4365. }
  4366. }
  4367. else if(all_data[0] == "SETGAIN")
  4368. {
  4369. //alert(httpObject.responseText);
  4370. if(all_data[1] == "No Changes Encountered!")
  4371. {
  4372. info_notify(all_data[1]);
  4373. //get_gain();
  4374. }
  4375. else
  4376. {
  4377. info_notify(all_data[1]);
  4378. //sucs_notify_gain(all_data[1]);
  4379. //get_gain();
  4380. }
  4381. }
  4382. else if(all_data[0] == "SETDOD")
  4383. {
  4384. //alert(httpObject.responseText);
  4385. if(document.getElementById("type").value == "DOD")
  4386. gobj = 0;
  4387. else if(document.getElementById("type").value == "VOIP")
  4388. gobj = 1;
  4389. else if(document.getElementById("type").value == "H")
  4390. gobj = 2;
  4391. if(all_data[1] == "No Changes Encountered!")
  4392. {
  4393. info_notify(all_data[1]);
  4394. col_medod(gobj);
  4395. }
  4396. else
  4397. {
  4398. sucs_notify(all_data[1]);
  4399. col_medod(gobj);
  4400. }
  4401. }
  4402. else if (all_data[0] == "maskval")
  4403. {
  4404. var evr_data = all_data[1].split('^');
  4405. var valid = evr_data[1].replace(/^\s+|\s+$/g,'');
  4406. if(valid == "false")
  4407. {
  4408. document.getElementById(evr_data[0]).style.border = "1px solid #FF0000";
  4409. document.getElementById("cross"+evr_data[0]).style.display="inline";
  4410. document.getElementById(evr_data[0]).name = "no";
  4411. }
  4412. else
  4413. {
  4414. document.getElementById(evr_data[0]).style.border = "0px solid";
  4415. document.getElementById('cross'+evr_data[0]).style.display = "none";
  4416. document.getElementById(evr_data[0]).title = document.getElementById(evr_data[0]).value;
  4417. document.getElementById(evr_data[0]).name = "ok";
  4418. }
  4419.  
  4420. }
  4421. else if (all_data[0] == $)
  4422. {
  4423. alert(all_data[1]);
  4424. }
  4425. else if(all_data[0] == "LicRead")
  4426. {
  4427. var evr_data = all_data[1].split('*');
  4428. if(evr_data[0] == 0)
  4429. {
  4430. alert("licence not found");
  4431. }
  4432. else if(evr_data[0] == 1)
  4433. {
  4434. alert("Dongle not connected");
  4435. document.getElementById("confirmrsu").innerHTML = evr_data[1];
  4436. document.getElementById("confirmrsu").style.display = "inline";
  4437. }
  4438. else if(evr_data[0] == 2)
  4439. {
  4440. alert("Licence expired");
  4441. document.getElementById("confirmrsu").innerHTML = evr_data[1];
  4442. document.getElementById("confirmrsu").style.display = "inline";
  4443. }
  4444.  
  4445. }
  4446. else if(all_data[0] == "clockset")
  4447. {
  4448. document.getElementById("setclk").style.display = "none";
  4449. }
  4450. else if(all_data[0] == "NTPCONF")
  4451. {
  4452. apply_notify(all_data[1]);
  4453. if(visible == 0)
  4454. waittorestart();
  4455. else if(visible == 1)
  4456. licence_apply();
  4457. }
  4458. else if(all_data[0] == "NETCONF")
  4459. {
  4460. apply_notify(all_data[1]);
  4461. ntpd_apply();
  4462. }
  4463. else if(all_data[0] == "endrestart")
  4464. {
  4465. apply_notify(all_data[1]);
  4466. }
  4467. else if (all_data[0] == "STARTSET")
  4468. {
  4469. apply_notify(all_data[1]);
  4470. }
  4471.  
  4472. else if (all_data[0] == "ipCheck")
  4473. { var sh_data = (all_data[1]).split(",");
  4474. document.getElementById(sh_data[1]).style.border = "1px solid #FF0000";
  4475. document.getElementById("cross"+sh_data[1]).style.display="inline";
  4476. document.getElementById(sh_data[1]).name = "no";
  4477.  
  4478. }
  4479. else if (all_data[0] == "valtoname")
  4480. {
  4481. //alert(all_data[1]);
  4482. var x = all_data[1].replace(/^\s+|\s+$/g,'');
  4483. document.getElementById(x).title = document.getElementById(x).value;
  4484. document.getElementById(x).name = "ok";
  4485. document.getElementById(x).style.border = "0px solid";
  4486. document.getElementById('cross'+x).style.display = "none";
  4487.  
  4488. }
  4489. else if(all_data[0] == "Restart")
  4490. {
  4491. apply_restart(all_data[1],"System needs to reboot! reboot now");
  4492. }
  4493. else if(all_data[0] == "sys_reboot")
  4494. {
  4495. //apply_restart(all_data[1],"STSTEM REBOOT REQUEST");
  4496. document.getElementById("tab_data").innerHTML = all_data[1];
  4497. defaultstart();
  4498. }
  4499. else if(all_data[0] == "sys_commit_wait")
  4500. {
  4501. //apply_restart(all_data[1],"STSTEM REBOOT REQUEST");
  4502. document.getElementById("tab_data").innerHTML = all_data[1];
  4503. defaultstart();
  4504.  
  4505.  
  4506. }
  4507.  
  4508.  
  4509. else if (all_data[0] == "Liceexp")
  4510. {
  4511. document.getElementById("licinfo").style.display = "inline";
  4512. }
  4513. else if (all_data[0] == "fsid_dod")
  4514. {
  4515. //all_data[0] = null;
  4516. document.getElementById("tab_data").innerHTML = all_data[1];
  4517. //document.getElementById('contentboxhead').innerHTML += "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_sid_fetch_dod()'>Refresh</a>&nbsp;|&nbsp;<a href='javascript:go_dod()'>Update</a></span></div>";
  4518. select();
  4519. $(document).ready(function(){
  4520. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4521. $('#body1 tr:even').addClass("alt-row1");
  4522. $('#body1 tr:odd').addClass("ext");
  4523. $('#body2 tr:even').addClass("alt-row1");
  4524. $('#body2 tr:odd').addClass("ext");
  4525. });
  4526. }
  4527. else if (all_data[0] == "<h5>DOD Group</h5>")
  4528. {
  4529. //alert(all_data[0]);
  4530. var evr_data = (all_data[1]).split(",");
  4531. document.getElementById('tab_data').innerHTML = evr_data[0];
  4532. document.getElementById('data_update').innerHTML = evr_data[1];
  4533. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_sid_fetch_dod()' class='link'>Refresh</a><a href='javascript:go_dod()' class='link'>Update</a></span></div>";
  4534. }
  4535. else if (all_data[0] == "<h5>Allowed Table</h5>")
  4536. {
  4537. var evr_data = (all_data[1]).split(",");
  4538. document.getElementById('tab_data').innerHTML = evr_data[0];
  4539. document.getElementById('data_update').innerHTML = evr_data[1];
  4540. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr'><a href='javascript:rfr_allwdtable()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
  4541. $(document).ready(function(){
  4542. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4543. $('#body1 tr:even').addClass("alt-row1");
  4544. $('#body1 tr:odd').addClass("ext");
  4545. $('#body2 tr:even').addClass("alt-row1");
  4546. $('#body2 tr:odd').addClass("ext");
  4547. });
  4548. }
  4549. else if (all_data[0] == "<h5>Set Allowed Table</h5>")
  4550. {
  4551. //alert("__"+all_data[1]);
  4552. //var evr_data = (all_data[1]).split(",");
  4553. //document.getElementById('tab_data').innerHTML = evr_data[0];
  4554. //document.getElementById('data_update').innerHTML = evr_data[1];
  4555. //document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' >Refresh</a>&nbsp;|&nbsp;<a href='javascript:add_allwd()'>Add</a></span></div>";
  4556. fetch_allwdnum();
  4557. }
  4558.  
  4559. else if (all_data[0] == "<h5>Allowed Table Configuration</h5>")
  4560. {
  4561. //alert(all_data[1]);
  4562. //var evr_data = (all_data[1]).split(",");
  4563. //document.getElementById('tab_data').innerHTML = evr_data[0];
  4564. document.getElementById('tab_data').innerHTML = all_data[1];
  4565. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:fetch_allwdnum()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
  4566. //alert("done");
  4567. $(document).ready(function(){
  4568. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4569. $('#body1 tr:even').addClass("alt-row1");
  4570. $('#body1 tr:odd').addClass("ext");
  4571. $('#body2 tr:even').addClass("alt-row1");
  4572. $('#body2 tr:odd').addClass("ext");
  4573. });
  4574. }
  4575. else if (all_data[0] == "<h5>Denied Table</h5>")
  4576. {
  4577. var evr_data = (all_data[1]).split(",");
  4578. document.getElementById('tab_data').innerHTML = evr_data[0];
  4579. document.getElementById('data_update').innerHTML = evr_data[1];
  4580. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' class='link'>Refresh</a><a href='javascript:add_allwd()' class='link'>Add</a></span></div>";
  4581. $(document).ready(function(){
  4582. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4583. $('#body1 tr:even').addClass("alt-row1");
  4584. $('#body1 tr:odd').addClass("ext");
  4585. $('#body2 tr:even').addClass("alt-row1");
  4586. $('#body2 tr:odd').addClass("ext");
  4587. });
  4588. }
  4589. else if (all_data[0] == "<h5>Set Denied Table</h5>")
  4590. {
  4591. //alert("__"+all_data[1]);
  4592. //var evr_data = (all_data[1]).split(",");
  4593. //document.getElementById('tab_data').innerHTML = evr_data[0];
  4594. //document.getElementById('data_update').innerHTML = evr_data[1];
  4595. //document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfr' style='display:none'><a href='javascript:rfr_allwdtable()' >Refresh</a>&nbsp;|&nbsp;<a href='javascript:add_allwd()'>Add</a></span></div>";
  4596. fetch_dendnum();
  4597. }
  4598. else if (all_data[0] == "<h5>Denied Table Configuration</h5>")
  4599. {
  4600. //alert("i am an idiot");
  4601. //var evr_data = (all_data[1]).split(",");
  4602. //document.getElementById('tab_data').innerHTML = evr_data[0];
  4603. document.getElementById('tab_data').innerHTML = all_data[1];
  4604. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div><span id='lrfr' style='display:inline'><a href='javascript:fetch_dendnum()' class='link'>Refresh</a><a href='javascript:add_dend()' class='link'>Add</a></span></div>";
  4605. $(document).ready(function(){
  4606. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4607. $('#body1 tr:even').addClass("alt-row1");
  4608. $('#body1 tr:odd').addClass("ext");
  4609. $('#body2 tr:even').addClass("alt-row1");
  4610. $('#body2 tr:odd').addClass("ext");
  4611. });
  4612. //alert("done");
  4613. }
  4614. else if (all_data[0] == "<h5>nochange</h5>")
  4615. {
  4616. document.getElementById("con").style.display = "none";
  4617. alert(all_data[1]);
  4618. }
  4619. //Added by Anuja
  4620. else if(all_data[0] == "<h5>Date And Time</h5>")
  4621. {
  4622. /*var evr_data = (all_data[1]).split(",");
  4623. document.getElementById('tab_data').innerHTML = evr_data[0];
  4624. document.getElementById('data_update').innerHTML = evr_data[1];
  4625. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div class='link'><span id='lrfrfeat' style='display:none'><a href='javascript:rfr_sid_fetch_feat()' >Refresh</a>&nbsp;|&nbsp;<a href='javascript:go_feat()'>Update</a></span></div>";
  4626. */
  4627. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4628. //alert(all_data[1]);
  4629. document.getElementById('tab_data').innerHTML = all_data[1];
  4630. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:date_time()' class='link'>Refresh</a><a href='javascript:set_time_zone()' class='link'>Update</a></div>";
  4631.  
  4632. $(document).ready(function(){
  4633. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4634. $('#body1 tr:even').addClass("alt-row1");
  4635. $('#body1 tr:odd').addClass("ext");
  4636. $('#body2 tr:even').addClass("alt-row1");
  4637. $('#body2 tr:odd').addClass("ext");
  4638. });
  4639. }
  4640. else if(all_data[0] == "setDateTime")
  4641. {
  4642. //alert(all_data[1]);
  4643. date_time();
  4644. }
  4645. else if(all_data[0] == "set_lic_conf_out")
  4646. {
  4647. //alert(all_data[1]);
  4648. lic_conf();
  4649. }
  4650. else if(all_data[0] == "ipCheck_sys")
  4651. {
  4652. var sh_data = (all_data[1]).split(",");
  4653. //alert(sh_data[1]);
  4654. document.getElementById("lic_1").style.border = "1px solid #FF0000";
  4655. document.getElementById("cross"+sh_data[1]).style.display="inline";
  4656. document.getElementById(sh_data[1]).name = "no";
  4657. }
  4658. else if(all_data[0] == "valtoname_sys")
  4659. {
  4660. var x = all_data[1].replace(/^\s+|\s+$/g,'');
  4661. document.getElementById(x).title = document.getElementById(x).value;
  4662. document.getElementById(x).name = "ok";
  4663. document.getElementById(x).style.border = "0px solid";
  4664. document.getElementById('cross'+x).style.display = "none";
  4665. }
  4666. else if(all_data[0] == "<h5>Configuration</h5>")
  4667. {
  4668. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4669. document.getElementById('tab_data').innerHTML = all_data[1];
  4670. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
  4671. $(document).ready(function(){
  4672. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4673. $('#body1 tr:even').addClass("alt-row1");
  4674. $('#body1 tr:odd').addClass("ext");
  4675. $('#body2 tr:even').addClass("alt-row1");
  4676. $('#body2 tr:odd').addClass("ext");
  4677. });
  4678. }
  4679. else if(all_data[0] == "<h5>System Settings</h5>")
  4680. {
  4681. document.getElementById('data_update').innerHTML = all_data[1];
  4682. document.getElementById('tab_data').innerHTML = all_data[2];
  4683. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
  4684. $(document).ready(function(){
  4685. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4686. $('#body1 tr:even').addClass("alt-row1");
  4687. $('#body1 tr:odd').addClass("ext");
  4688. $('#body2 tr:even').addClass("alt-row1");
  4689. $('#body2 tr:odd').addClass("ext");
  4690. });
  4691. }
  4692. else if(all_data[0] == "<h5>Clocking</h5>")
  4693. {
  4694. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4695. document.getElementById('tab_data').innerHTML = all_data[1];
  4696. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a></div>";
  4697. $(document).ready(function(){
  4698. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4699. $('#body1 tr:even').addClass("alt-row1");
  4700. $('#body1 tr:odd').addClass("ext");
  4701. $('#body2 tr:even').addClass("alt-row1");
  4702. $('#body2 tr:odd').addClass("ext");
  4703. });
  4704. }
  4705.  
  4706. else if(all_data[0] == "<h5>IPCore Settings</h5>")
  4707. {
  4708. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4709. document.getElementById('tab_data').innerHTML = all_data[1];
  4710. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ip_conf()' class='link'>Refresh</a><a href='javascript:set_ip_conf()' class='link'>Update</a></div>";
  4711. $(document).ready(function(){
  4712. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4713. $('#body1 tr:even').addClass("alt-row1");
  4714. $('#body1 tr:odd').addClass("ext");
  4715. $('#body2 tr:even').addClass("alt-row1");
  4716. $('#body2 tr:odd').addClass("ext");
  4717. });
  4718. }
  4719. else if(all_data[0] == "<h5>IP Core Settings</h5>")
  4720. {
  4721. //alert(all_data[1]);
  4722. ip_conf();
  4723. }
  4724. else if(all_data[0] == "<h5>Version</h5>")
  4725. {
  4726. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4727. document.getElementById('tab_data').innerHTML = all_data[1];
  4728. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:doWork(true,\"show_ver\",\"systemConf\")' class='link'>Refresh</a></div>";
  4729. $(document).ready(function(){
  4730. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4731. $('#body1 tr:even').addClass("alt-row1");
  4732. $('#body1 tr:odd').addClass("ext");
  4733. $('#body2 tr:even').addClass("alt-row1");
  4734. $('#body2 tr:odd').addClass("ext");
  4735. });
  4736. }
  4737. else if(all_data[0] == "<h5>Home</h5>")
  4738. {
  4739. document.getElementById('tab_data').innerHTML = all_data[1];
  4740. document.getElementById('contentboxhead').innerHTML = all_data[0];
  4741. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4742. $(document).ready(function(){
  4743. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4744. $('#body1 tr:even').addClass("alt-row1");
  4745. $('#body1 tr:odd').addClass("ext");
  4746. $('#body2 tr:even').addClass("alt-row1");
  4747. $('#body2 tr:odd').addClass("ext");
  4748. });
  4749.  
  4750. }
  4751. else if(all_data[0] == "<h5>Date and Time</h5>")
  4752. {
  4753. document.getElementById('tab_data').innerHTML = all_data[1];
  4754. document.getElementById('contentboxhead').innerHTML = all_data[0];
  4755. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4756. $(document).ready(function(){
  4757. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4758. $('#body1 tr:even').addClass("alt-row1");
  4759. $('#body1 tr:odd').addClass("ext");
  4760. $('#body2 tr:even').addClass("alt-row1");
  4761. $('#body2 tr:odd').addClass("ext");
  4762. });
  4763.  
  4764. }
  4765. else if(all_data[0] == "<h5>Memory</h5>")
  4766. {
  4767. document.getElementById('tab_data').innerHTML = all_data[1];
  4768. document.getElementById('contentboxhead').innerHTML = all_data[0];
  4769. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4770. $(document).ready(function(){
  4771. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4772. $('#body1 tr:even').addClass("alt-row1");
  4773. $('#body1 tr:odd').addClass("ext");
  4774. $('#body2 tr:even').addClass("alt-row1");
  4775. $('#body2 tr:odd').addClass("ext");
  4776. });
  4777. }
  4778.  
  4779. else if(all_data[0] == "<h5>Network Configuration</h5>")
  4780. {
  4781. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4782. document.getElementById('tab_data').innerHTML = all_data[1];
  4783. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:network_conf()' class='link'>Refresh</a><a href='javascript:set_network_conf()' class='link'>Update</a></div>";
  4784. $(document).ready(function(){
  4785. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4786. $('#body1 tr:even').addClass("alt-row1");
  4787. $('#body1 tr:odd').addClass("ext");
  4788. $('#body2 tr:even').addClass("alt-row1");
  4789. $('#body2 tr:odd').addClass("ext");
  4790. });
  4791. }
  4792. /*
  4793. else if(all_data[0] == "<h5>Utils Configuration</h5>")
  4794. {
  4795. //alert(all_data[1]);
  4796. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  4797. document.getElementById('tab_data').innerHTML = all_data[1];
  4798. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div class='link'></div>";
  4799. $(document).ready(function(){
  4800. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4801. $('#body1 tr:even').addClass("alt-row1");
  4802. $('#body1 tr:odd').addClass("ext");
  4803. $('#body2 tr:even').addClass("alt-row1");
  4804. $('#body2 tr:odd').addClass("ext");
  4805. });
  4806. }
  4807. */
  4808. else if(all_data[0] == "set_network_conf")
  4809. {
  4810. //alert(all_data[1]);
  4811. network_conf();
  4812. }
  4813. else if(all_data[0] == "<h5>IVR LEVELS</h5>")
  4814. {
  4815. document.getElementById('data_update').innerHTML = "";
  4816. document.getElementById('tab_data').innerHTML = all_data[1];
  4817. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ivr_levels()' class='link'>Refresh</a></div>";
  4818. $(document).ready(function(){
  4819. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4820. $('#body1 tr:even').addClass("alt-row1");
  4821. $('#body1 tr:odd').addClass("ext");
  4822. $('#body2 tr:even').addClass("alt-row1");
  4823. $('#body2 tr:odd').addClass("ext");
  4824. });
  4825. }
  4826. else if(all_data[0] == "ivr_fetch_levels")
  4827. {
  4828. //document.getElementById('tab_data').innerHTML = all_data[1];
  4829. }
  4830. else if(all_data[0] == "update_ivr_levels")
  4831. {
  4832. //alert(all_data[1]);
  4833. document.getElementById("ivrAdd").style.display = "none";
  4834. ivr_levels();
  4835. }
  4836. else if(all_data[0] == "<h5>VMAIL USERS</h5>")
  4837. {
  4838. document.getElementById('data_update').innerHTML = "";
  4839. document.getElementById('tab_data').innerHTML = all_data[1];
  4840. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:vmail_users()' class='link'>Refresh</a><a href='javascript:addUser()' class='link'>Add</a></div>";
  4841. $(document).ready(function(){
  4842. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4843. $('#body1 tr:even').addClass("alt-row1");
  4844. $('#body1 tr:odd').addClass("ext");
  4845. $('#body2 tr:even').addClass("alt-row1");
  4846. $('#body2 tr:odd').addClass("ext");
  4847. });
  4848. }
  4849. else if(all_data[0] == "add_user")
  4850. {
  4851. document.getElementById('tab_data').innerHTML = all_data[1];
  4852. }
  4853. else if(all_data[0] == "add_vmail_user")
  4854. {
  4855. //alert(all_data[1]);
  4856. vmail_users();
  4857. }
  4858. else if(all_data[0] == "<h5>Vmail Prompts</h5>")
  4859. {
  4860. document.getElementById('data_update').innerHTML = "";
  4861. document.getElementById('tab_data').innerHTML = all_data[1];
  4862. document.getElementById('contentboxhead').innerHTML = all_data[0];
  4863. $(document).ready(function(){
  4864. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4865. $('#body1 tr:even').addClass("alt-row1");
  4866. $('#body1 tr:odd').addClass("ext");
  4867. $('#body2 tr:even').addClass("alt-row1");
  4868. $('#body2 tr:odd').addClass("ext");
  4869. });
  4870.  
  4871. }
  4872. else if(all_data[0] == "set_timer")
  4873. {
  4874. sucs_notify(all_data[1]);
  4875. rfr_protim();
  4876. }
  4877. else if(all_data[0] == "VmailFileUpdate")
  4878. {
  4879. //alert(all_data[1]);
  4880. //alert("NO Action ...");
  4881. }
  4882. else if(all_data[0] == "default_timer")
  4883. {
  4884. //alert(all_data[1]);
  4885. get_timer();
  4886. }
  4887. else if(all_data[0] == "<h5>Upload Music File</h5>")
  4888. {
  4889. document.getElementById('data_update').innerHTML = "";
  4890. document.getElementById('tab_data').innerHTML = all_data[1];
  4891. document.getElementById('contentboxhead').innerHTML = all_data[0];
  4892. $(document).ready(function(){
  4893. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4894. $('#body1 tr:even').addClass("alt-row1");
  4895. $('#body1 tr:odd').addClass("ext");
  4896. $('#body2 tr:even').addClass("alt-row1");
  4897. $('#body2 tr:odd').addClass("ext");
  4898. });
  4899.  
  4900. }
  4901. else if(all_data[0] == "CHANGECARDPROP")
  4902. {
  4903. var displayData = all_data[1].split(',');
  4904. var cardinfo = displayData[1].split('^');
  4905. var cardDet = cardinfo[0]+"^"+cardinfo[1]+"^"+cardinfo[2]+"^"+cardinfo[3]+"^"+cardinfo[4];
  4906. if(all_data[1] == "No Changes Encountered!")
  4907. {
  4908. info_notify(displayData[0]);
  4909. }
  4910. else
  4911. {
  4912. sucs_notify(displayData[0]);
  4913. nsb_fetch_card(cardDet);
  4914. }
  4915. }
  4916.  
  4917. else if(all_data[0] == "<h5>Sip Subscriber Properties</h5>")
  4918. {
  4919. //alert(all_data[1]);
  4920. var evr_data = all_data[1];
  4921. document.getElementById('tab_data').innerHTML = (evr_data);
  4922. var sip_num = document.getElementById('port_num1').value;
  4923. sip_num= sip_num.trim();
  4924. // alert(sip_num);
  4925. //document.getElementById('data_update').innerHTML = evr_data[1];
  4926. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link' ><span id='lrfr' style='display:inline'>"
  4927. + " <a href='javascript:sip_ext_show()'>Back</a>&nbsp;|&nbsp;"
  4928. + " <a href=\"javascript:getCard();\">Cards</a>&nbsp;|&nbsp;"
  4929. +"<a href='javascript:rfr_sip_ext()' >Refresh</a>&nbsp;|&nbsp;<a href='javascript:updatsipext()'>Update</a></span></div>";
  4930. select();
  4931. // mail();
  4932. $(document).ready(function(){
  4933. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4934. $('#body1 tr:even').addClass("alt-row1");
  4935. $('#body1 tr:odd').addClass("ext");
  4936. $('#body2 tr:even').addClass("alt-row1");
  4937. $('#body2 tr:odd').addClass("ext");
  4938. });
  4939. }
  4940.  
  4941. else if(all_data[0] == "SETSIPEXT")
  4942. {
  4943. //alert(httpObject.responseText);
  4944. if(all_data[1] == "No Changes Encountered!")
  4945. {
  4946. var val = all_data[1].split("^");
  4947. info_notify(all_data[1]);
  4948. rfr_sip_ext(val[1]);
  4949. }
  4950. else
  4951. {
  4952. var val = all_data[1].split("^");
  4953. sucs_notify(val[0]);
  4954. rfr_sip_ext1(val[1]);
  4955. }
  4956. }
  4957. else if(all_data[0] == "SETSIPTRK")
  4958. {
  4959. if(all_data[1] == "No Changes Encountered!")
  4960. {
  4961. var val = all_data[1].split("^");
  4962. info_notify(all_data[1]);
  4963. rfr_sip_trk(val[1]);
  4964. }
  4965. else
  4966. {
  4967. var val = all_data[1].split("^");
  4968. sucs_notify(val[0]);
  4969. rfr_sip_trk1(val[1]);
  4970. }
  4971. }
  4972. else if(all_data[0] == "<h5>Sip Trunk Properties</h5>")
  4973. {
  4974. //alert(all_data[1]);
  4975. var evr_data = all_data[1];
  4976. document.getElementById('tab_data').innerHTML = evr_data;
  4977. var sip_hint = document.getElementById('sip_hint').value;
  4978. sip_hint= sip_hint.trim();
  4979.  
  4980. //document.getElementById('data_update').innerHTML = evr_data[1];
  4981. document.getElementById('contentboxhead').innerHTML = all_data[0] + "<div align='right' class='link'><span id='lrfr' style='display:inline'>"
  4982. + " <a href='javascript:sip_trunk_show()'>Back</a>&nbsp;|&nbsp;"
  4983. + " <a href=\"javascript:getCard();\">Cards</a>&nbsp;|&nbsp;"
  4984. + " <a href='javascript:rfr_sip_trk()'>Refresh</a>&nbsp;|&nbsp;"
  4985. + " <a href='javascript:updatsiptrk()'>Update</a></span></div>";
  4986.  
  4987. select();
  4988. $(document).ready(function(){
  4989. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  4990. $('#body1 tr:even').addClass("alt-row1");
  4991. $('#body1 tr:odd').addClass("ext");
  4992. $('#body2 tr:even').addClass("alt-row1");
  4993. $('#body2 tr:odd').addClass("ext");
  4994. });
  4995.  
  4996. }
  4997. else if(all_data[0] == "<h5>Select Sip Trunk</h5>")
  4998. {
  4999. document.getElementById('data_update').innerHTML = "";
  5000. document.getElementById('tab_data').innerHTML = all_data[1];
  5001. document.getElementById('contentboxhead').innerHTML = all_data[0];
  5002. $(document).ready(function(){
  5003. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  5004. $('#body1 tr:even').addClass("alt-row1");
  5005. $('#body1 tr:odd').addClass("ext");
  5006. $('#body2 tr:even').addClass("alt-row1");
  5007. $('#body2 tr:odd').addClass("ext");
  5008. });
  5009.  
  5010. }
  5011. else if(all_data[0] == "<h5>ISP Trunk Configuration</h5>")
  5012. {
  5013. //alert("i am in System features");
  5014. document.getElementById('data_update').innerHTML = "<span>&nbsp;</span>";
  5015. //alert(all_data[1]);
  5016. document.getElementById('tab_data').innerHTML = all_data[1];
  5017. document.getElementById('contentboxhead').innerHTML = all_data[0]+"<div><a href='javascript:ispShow()' class='link'>Refresh</a><a href='javascript:set_isp()' class='link'>Update</a></div>";
  5018. select();
  5019. $(document).ready(function(){
  5020. $('tbody').addClass("ext"); // Add class "alt-row" to even table rows
  5021. $('#body1 tr:even').addClass("alt-row1");
  5022. $('#body1 tr:odd').addClass("ext");
  5023. $('#body2 tr:even').addClass("alt-row1");
  5024. $('#body2 tr:odd').addClass("ext");
  5025. });
  5026. }
  5027.  
  5028. }
  5029. }
  5030.  
  5031. function nsbAlert(msg,duration)
  5032. {
  5033. var el = document.createElement("div");
  5034. el.setAttribute("style","position:absolute;top:50%;left:40%;background-color:darkgrey;");
  5035. el.setAttribute("class","notification success png_bg");
  5036. el.setAttribute("id","notify_s");
  5037.  
  5038. var tempMsg = "<br/><b>&nbsp;&nbsp;&nbsp;&nbsp;Update Report &nbsp;&nbsp;&nbsp;&nbsp; </b> <a href='#' class='close' ><img src='resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close/></a> <div id='notify_subx'> <div id='notify_sub1'>"+ msg +"</div> </div>";
  5039. alert(tempMsg);
  5040. el.innerHTML = tempMsg;
  5041.  
  5042. setTimeout(function(){ el.parentNode.removeChild(el); },duration);
  5043. document.body.appendChild(el);
  5044. }
  5045.  
  5046.  
  5047.  
  5048. function sucs_notify(data)
  5049. {
  5050. document.getElementById("notify_s").style.position = "absolute";
  5051. document.getElementById("notify_sub1").innerHTML = data;
  5052. document.getElementById("notify_s").style.display = "block";
  5053. document.getElementById("notify_s").style.opacity = "1";
  5054. //get_timer();
  5055. }
  5056. function sucs_notify_gain(data)
  5057. {
  5058. document.getElementById("notify_s").style.position = "absolute";
  5059. document.getElementById("notify_sub1").innerHTML = data;
  5060. document.getElementById("notify_s").style.display = "block";
  5061. document.getElementById("notify_s").style.opacity = "1";
  5062. }
  5063. function info_notify(data)
  5064. {
  5065. document.getElementById("notify_i").style.position = "absolute";
  5066. document.getElementById("notify_sub2").innerHTML = data;
  5067. document.getElementById("notify_i").style.display = "block";
  5068. document.getElementById("notify_i").style.opacity = "1";
  5069. }
  5070. function apply_notify(data)
  5071. {
  5072. document.getElementById("notify_conf").style.display = "inline";
  5073. document.getElementById("notify_conf").style.position = "absolute";
  5074. document.getElementById("notify_conf3").innerHTML = data;
  5075. document.getElementById("notify_conf").style.display = "block";
  5076. document.getElementById("notify_conf").style.marginLeft = "220px";
  5077. document.getElementById("notify_conf").style.marginTop = "150px";
  5078. document.getElementById("notify_conf").style.opacity = "1";
  5079.  
  5080. }
  5081. function apply_restart(data,mess)
  5082. {
  5083. document.getElementById("notify_conf").style.display = "inline";
  5084. document.getElementById("notify_conf").style.position = "absolute";
  5085. document.getElementById("notify_conf3").innerHTML = mess;
  5086. document.getElementById("notify_conf2").innerHTML = data;
  5087. document.getElementById("notify_conf").style.display = "block";
  5088. document.getElementById("notify_conf").style.marginLeft = "220px";
  5089. document.getElementById("notify_conf").style.marginTop = "150px";
  5090. document.getElementById("notify_conf").style.opacity = "1";
  5091. document.getElementById("wait").style.display = "none";
  5092.  
  5093. }
  5094.  
  5095. function restartmsg(data)
  5096. {
  5097. document.getElementById("notify_conf").style.display = "inline";
  5098. document.getElementById("notify_conf").style.position = "absolute";
  5099. document.getElementById("notify_conf3").innerHTML = data;
  5100. document.getElementById("notify_conf").style.display = "block";
  5101. document.getElementById("notify_conf").style.marginLeft = "220px";
  5102. document.getElementById("notify_conf").style.marginTop = "150px";
  5103. document.getElementById("notify_conf").style.opacity = "1";
  5104. document.getElementById("wait").style.display = "none";
  5105.  
  5106. }
  5107.  
  5108. function foc_me(obj)
  5109. {
  5110. for(i = 0; i < 80; i++)
  5111. {
  5112. if(obj == i)
  5113. document.getElementById("sid_"+i).style.border = "1px outset #FF0000";
  5114. else
  5115. document.getElementById("sid_"+i).style.border = "0px";
  5116. }
  5117. }
  5118. function timers_onchange(obj)
  5119. {
  5120. var num = (obj.id).split("_");
  5121. if(parseInt(obj.value) > 255)
  5122. {
  5123. document.getElementById("img_"+num[1]).innerHTML = "&nbsp;<img src='resources/images/icons/cross.png' title='Out Of Range' width='14px' height='12px'></img>";
  5124. document.getElementById("img_"+num[1]).style.display = "inline";
  5125. document.getElementById("img_"+num[1]).style.visibility = "visible";
  5126. document.getElementById("img").innerHTML = "&nbsp;";
  5127. document.getElementById("img").style.display = "inline";
  5128. document.getElementById("img").style.visibility = "visible";
  5129. if(wrong_entrytmrs == null)
  5130. wrong_entrytmrs = "Timer No. "+(num[1])+" is not successfully updated!";
  5131. else
  5132. wrong_entrytmrs = wrong_entrytmrs+"<br/>"+("Timer No. "+(num[1])+" is not successfully updated!");
  5133. }
  5134. else if(parseInt(obj.value) <= 255)
  5135. {
  5136. document.getElementById("img_"+num[1]).innerHTML = "&nbsp;<img src='resources/images/icons/tick.gif' title='Correct Entry' width='14px' height='14px'> </img>";
  5137. document.getElementById("img_"+num[1]).style.display = "inline";
  5138. document.getElementById("img_"+num[1]).style.visibility = "visible";
  5139. document.getElementById("img").style.display = "inline";
  5140. document.getElementById("img").style.visibility = "visible";
  5141. obj.name = "timer_changed";
  5142. }
  5143. }
  5144. function anti_design()
  5145. {
  5146. doWork(true,"writetmpngx","config");
  5147. document.getElementById("contentconfig").style.display = "none";
  5148. document.getElementById("confirmtab").style.display = "none";
  5149. document.getElementById("confirmdata").innerHTML = null;
  5150. document.getElementById("confwin").style.display = "none";
  5151. document.getElementById("openimg").style.display = "none";
  5152. document.getElementById("dt").style.opacity = 0.6;
  5153. document.getElementById("pm").style.opacity = 0.6;
  5154. document.getElementById("ha").style.opacity = 0.6;
  5155. document.getElementById("rsu").style.opacity = 0.6;
  5156. document.getElementById("licence").style.opacity = 0.6;
  5157. ntpval = null;
  5158. pmval = null;
  5159. haval = null;
  5160. licval = null;
  5161. sid_feat();
  5162. }
  5163. function scrollin(obj)
  5164. {
  5165. obj.style.direction = "rtl";
  5166. obj.style.overflowY = "scroll";
  5167. obj.style.overflowX = "hidden";
  5168. }
  5169. function scrollout(obj)
  5170. {
  5171. obj.style.overflow = "hidden";
  5172. }
  5173.  
  5174. function design(obj)
  5175. {
  5176. //alert("IN DESIGN FUNC");
  5177. doWork(true,'show_home','systemConf')
  5178. if(obj)
  5179. {
  5180. // document.getElementById("contentconfig").style.display = "none";
  5181. document.getElementById("confwin").style.display = "none";
  5182. // document.getElementById("openimg").style.display = "none";
  5183. // sid_feat();
  5184. // welcome();
  5185. }
  5186. //document.getElementById("closeimg").style.display = "none";
  5187. //document.getElementById("openimg").style.display = "none";
  5188. //document.getElementById("openimg").style.display = "none";
  5189. }
  5190. function basic_config()
  5191. {
  5192. document.getElementById("openimg").style.display = "none";
  5193. document.getElementById("contentconfig").style.display = "inline";
  5194. document.getElementById("confwin").style.display = "inline";
  5195. document.getElementById("configtab").innerHTML = null;
  5196. document.getElementById("lich").innerHTML = null;
  5197. rsuchange = new Array(63);
  5198. ntpval = null;
  5199. pmval = null;
  5200. haval = null;
  5201. licval = null;
  5202. get_dt();
  5203. }
  5204. function sip_config()
  5205. {
  5206. window.open("./sipfw/index.php");
  5207. }
  5208. function desg()
  5209. {
  5210. document.getElementById("closeimg").style.display = "none";
  5211. document.getElementById("openimg").style.display = "inline";
  5212. document.getElementById("closeimg").style.display = "none";
  5213. }
  5214. function dess()
  5215. {
  5216. document.getElementById("closeimg").style.display = "inline";
  5217. document.getElementById("openimg").style.display = "none";
  5218. }
  5219. function check_s(obj,name)
  5220. {
  5221. //alert(obj + " == " + name);
  5222. document.getElementById(obj.id).name = name;
  5223. }
  5224. function col_me(obj)
  5225. {
  5226. //alert(obj);
  5227. if(obj == 0)
  5228. {
  5229. document.getElementById(0).style.color = "#ED1B03";
  5230. document.getElementById(1).style.color = "#757575";
  5231. }
  5232. else if(obj == 1)
  5233. {
  5234. document.getElementById(0).style.color = " #757575";
  5235. document.getElementById(1).style.color = "#ED1B03";
  5236. }
  5237. }
  5238. function col_me_proto(obj)
  5239. {
  5240. //alert(obj);
  5241. if(obj == 0)
  5242. {
  5243. document.getElementById("proto_type").value = "P";
  5244. document.getElementById(0).style.color = "#ED1B03";
  5245. document.getElementById(1).style.color = "#757575";
  5246. }
  5247. else if(obj == 1)
  5248. {
  5249. document.getElementById("proto_type").value = "T";
  5250. document.getElementById(0).style.color = " #757575";
  5251. document.getElementById(1).style.color = "#ED1B03";
  5252. }
  5253. }
  5254. function col_acd(obj)
  5255. {
  5256. //alert(obj);
  5257. if(obj == 0)
  5258. {
  5259. document.getElementById(0).style.color = "#ED1B03";
  5260. document.getElementById(1).style.color = "#757575";
  5261. document.getElementById(2).style.color = "#757575";
  5262. g_param();
  5263. }
  5264. else if(obj == 1)
  5265. {
  5266. document.getElementById(0).style.color = " #757575";
  5267. document.getElementById(1).style.color = "#ED1B03";
  5268. document.getElementById(2).style.color = "#757575";
  5269. g_res();
  5270. }
  5271. else if(obj == 2)
  5272. {
  5273. document.getElementById(0).style.color = " #757575";
  5274. document.getElementById(1).style.color = "#757575";
  5275. document.getElementById(2).style.color = "#ED1B03";
  5276. g_amem();
  5277. }
  5278. }
  5279.  
  5280. function def_do(obj)
  5281. {
  5282. //alert(obj);
  5283. // Must add something to page, to be used as link
  5284. }
  5285.  
  5286.  
  5287. function col_medod(obj)
  5288. {
  5289. //alert(obj);
  5290. if(obj == 0)
  5291. {
  5292. document.getElementById("type").value = "DOD";
  5293. document.getElementById(0).style.color = "#ED1B03";
  5294. document.getElementById(1).style.color = "#757575";
  5295. //document.getElementById(2).style.color = "#757575";
  5296. document.getElementById(3).style.color = "#757575";
  5297. g_dod();
  5298. }
  5299. else if(obj == 1)
  5300. {
  5301. document.getElementById("type").value = "VOIP";
  5302. document.getElementById(0).style.color = " #757575";
  5303. document.getElementById(1).style.color = "#ED1B03";
  5304. //document.getElementById(2).style.color = "#757575";
  5305. document.getElementById(3).style.color = "#757575";
  5306. sid_voip();
  5307. }
  5308. else if(obj == 2)
  5309. {
  5310. document.getElementById("type").value = "H";
  5311. document.getElementById(0).style.color = " #757575";
  5312. document.getElementById(1).style.color = "#757575";
  5313. //document.getElementById(2).style.color = "#ED1B03";
  5314. document.getElementById(3).style.color = "#757575";
  5315. sid_h();
  5316. }
  5317. else if(obj == 3)
  5318. {
  5319. document.getElementById("type").value = "Mem";
  5320. document.getElementById(0).style.color = " #757575";
  5321. document.getElementById(1).style.color = "#757575";
  5322. //document.getElementById(2).style.color = "#757575";
  5323. document.getElementById(3).style.color = "#ED1B03";
  5324. dod_mem();
  5325. }
  5326. }
  5327.  
  5328. function flex_onchange(obj)
  5329. {
  5330. var num = (obj.id).split("_");
  5331. if((obj.value) != (obj.title) || (obj.value) == null)
  5332. {
  5333. document.getElementById("img_"+num[1]).innerHTML = "&nbsp;<img src='resources/images/icons/pencil.png' title='Edited' width='14px' height='14px'></img>";
  5334. document.getElementById("img_"+num[1]).style.display = "inline";
  5335. document.getElementById("img_"+num[1]).style.visibility = "visible";
  5336. document.getElementById("img").style.display = "inline";
  5337. document.getElementById("img").style.visibility = "visible";
  5338. // alert(obj.name);
  5339. obj.name = "flex_changed";
  5340. // alert(obj.name);
  5341. }
  5342. else if((obj.value) = (obj.title))
  5343. {
  5344. document.getElementById("img_"+num[1]).innerHTML = "&nbsp;<img src='resources/images/icons/pencil.png' title='Edited' width='14px' height='14px'> </img>";
  5345. document.getElementById("img_"+num[1]).style.display = "inline";
  5346. document.getElementById("img_"+num[1]).style.visibility = "hidden";
  5347. document.getElementById("img").style.display = "inline";
  5348. document.getElementById("img").style.visibility = "hidden";
  5349. }
  5350. // alert(obj.name);
  5351. }
  5352.  
  5353. function delete_it(obj)
  5354. {
  5355. var r=confirm("Are you sure to proceed!");
  5356. if (r==true)
  5357. {
  5358. var delval = null;
  5359. delval = document.getElementById("dupnum_"+obj).value;
  5360. // alert(delval);
  5361. doWork(delval,"delete","dup");
  5362. // alert("You pressed OK!");
  5363. }
  5364. else
  5365. {
  5366. // alert("You pressed Cancel!");
  5367. }
  5368. }
  5369.  
  5370.  
  5371. function dup_onchange(obj)
  5372. {
  5373. if(document.getElementById("rtype_"+obj).title != document.getElementById("rtype_"+obj).value)
  5374. document.getElementById("dupnum_"+obj).name = "changed_dup";
  5375. // alert(document.getElementById("dupnum_"+obj).name);
  5376. }
  5377.  
  5378. function getTime()
  5379. {
  5380. doWork(true,'show_home','systemConf');
  5381. }
  5382.  
  5383. function showMem()
  5384. {
  5385. doWork(true,'show_mem','systemConf');
  5386. }
  5387.  
  5388. function getCard()
  5389. {
  5390. doWork(true,'tdm_header','search');
  5391. }
  5392.  
  5393. function getExt()
  5394. {
  5395. doWork('Sub','get_search','search');
  5396. }
  5397.  
  5398. function getTrk()
  5399. {
  5400. doWork('Trk','get_search','search');
  5401. }
  5402.  
  5403. function showVersion()
  5404. {
  5405. doWork(true,'show_ver','systemConf');
  5406. }
  5407.  
  5408. function did_change(obj)
  5409. {
  5410. if(obj.title != obj.value)
  5411. document.getElementById(obj.id).name = "changed_did";
  5412. }
  5413. function dod_change(obj)
  5414. {
  5415. // alert(obj);
  5416. if(obj.title != obj.value)
  5417. document.getElementById(obj.id).name = "changed_dod";
  5418. }
  5419. function ext_change(obj)
  5420. {
  5421.  
  5422. var name = (obj.name).split(",");
  5423. if(name[1] == "nochange" && obj.title != obj.value)
  5424. document.getElementById(obj.id).name = name[0]+",changed";
  5425. // alert(obj.name);
  5426. }
  5427.  
  5428. function ext_change1(obj)
  5429. {
  5430. var x = document.getElementById("ext_"+obj);
  5431. var name = (x.name).split(",");
  5432. if(name[1] == "nochange")
  5433. document.getElementById(x.id).name = name[0]+",changed";
  5434. }
  5435. function acd_change(obj)
  5436. {
  5437. //alert("yo");
  5438. var name = (obj.name).split(",");
  5439. //alert(obj.value);
  5440. var value = obj.value;
  5441. if(value != "reset" && value != "RESET")
  5442. {
  5443. //alert("not reset");
  5444. var valueSplit = value.split(',');
  5445. if(valueSplit.length != 2)
  5446. {
  5447. alert("Input Should be in this format : (cardNo,portNo)");
  5448. document.getElementById(obj.id).value = "";
  5449. return;
  5450. }
  5451. //alert(valueSplit[0]+"___"+valueSplit[1]);
  5452. if((valueSplit[0] >= 0 && valueSplit[0] <= 9) && (valueSplit[1] >= 0 && valueSplit[1] <=31))
  5453. {
  5454. //alert("Valid value");
  5455. if(name[1] == "nochange" && obj.title != obj.value)
  5456. document.getElementById(obj.id).name = name[0]+",changed";
  5457. }
  5458. else
  5459. {
  5460. document.getElementById(obj.id).name = name[0]+",invalidValue";
  5461. //alert("Invalid value");
  5462. }
  5463. }
  5464. else
  5465. {
  5466. if(name[1] == "nochange" && obj.title != obj.value)
  5467. document.getElementById(obj.id).name = name[0]+",changed";
  5468. }
  5469. }
  5470. function acd_changeChk(obj)
  5471. {
  5472. var name = (obj.name).split(",");
  5473. if(name[1] == "nochange" && obj.title != obj.value)
  5474. document.getElementById(obj.id).name = name[0]+",changed";
  5475. }
  5476. function acc_change(obj)
  5477. {
  5478. var name = (obj.name).split(",");
  5479. if(name[1] == "nochange" && obj.title != obj.value)
  5480. document.getElementById(obj.id).name = name[0]+",changed";
  5481. }
  5482. function trk_change(obj)
  5483. {
  5484. var name = (obj.name).split(",");
  5485. if(name[1] == "nochange" && obj.title != obj.value)
  5486. obj.name = name[0]+",changed";
  5487. }
  5488. function cnri_change(obj)
  5489. {
  5490. var name = (obj.name).split(",");
  5491. var val = null;
  5492. if(obj.type == "select-one")
  5493. val = obj.options[obj.selectedIndex].text;
  5494. else
  5495. val = obj.value;
  5496.  
  5497. if(name[1] == "nochange" && obj.title != val)
  5498. obj.name = name[0]+",changed";
  5499.  
  5500. if((obj.id == "cnri_21") && (obj.checked == true))
  5501. document.getElementById("cnri_22").disabled = false;
  5502. else if((obj.id == "cnri_21") && (obj.checked == false))
  5503. document.getElementById("cnri_22").disabled = true;
  5504.  
  5505. }
  5506.  
  5507. function sysmgw_change(obj,name)
  5508. {
  5509. //alert(name + " >>>> " + obj.value + " >>>> " + obj.title + " >>>> " + obj.name);
  5510. var name1 = (obj.name).split(",");
  5511. if(obj.title != obj.value)
  5512. document.getElementById(obj.id).name = name;
  5513. //alert(document.getElementById(obj.id));
  5514. }
  5515.  
  5516. function sysChange(obj)
  5517. {
  5518. //alert("Here in sys change");
  5519. //alert(obj.checked+"___"+obj.value);
  5520. if(obj.checked == true)
  5521. document.getElementById(obj.id).value ="1";
  5522. else
  5523. document.getElementById(obj.id).value ="0";
  5524. }
  5525.  
  5526. function dhcpChange(obj)
  5527. {
  5528. //alert("Here in dhcp change");
  5529. //alert(obj.checked+"___"+obj.value);
  5530. if(obj.checked == true)
  5531. {
  5532. document.getElementById(obj.id).value ="1";
  5533. document.getElementById("net_1").disabled = true;
  5534. document.getElementById("net_2").disabled = true;
  5535. document.getElementById("net_3").disabled = true;
  5536. document.getElementById("net_4").disabled = true;
  5537. document.getElementById("net_5").disabled = true;
  5538.  
  5539. document.getElementById("net_1").style.background = "#D3D3D3";
  5540. document.getElementById("net_1").style.color = "white";
  5541. document.getElementById("net_2").style.background = "#D3D3D3";
  5542. document.getElementById("net_2").style.color = "white";
  5543. document.getElementById("net_3").style.background = "#D3D3D3";
  5544. document.getElementById("net_3").style.color = "white";
  5545. document.getElementById("net_4").style.background = "#D3D3D3";
  5546. document.getElementById("net_4").style.color = "white";
  5547. document.getElementById("net_5").style.background = "#D3D3D3";
  5548. document.getElementById("net_5").style.color = "white";
  5549. }
  5550. else
  5551. {
  5552. document.getElementById(obj.id).value ="0";
  5553. //alert(document.getElementById("net_1").value);
  5554. document.getElementById("net_1").disabled = false;
  5555. document.getElementById("net_2").disabled = false;
  5556. document.getElementById("net_3").disabled = false;
  5557. document.getElementById("net_4").disabled = false;
  5558. document.getElementById("net_5").disabled = false;
  5559.  
  5560. document.getElementById("net_1").style.background = "#FFFFFF";
  5561. document.getElementById("net_1").style.color = "black";
  5562. document.getElementById("net_2").style.background = "#FFFFFF";
  5563. document.getElementById("net_2").style.color = "black";
  5564. document.getElementById("net_3").style.background = "#FFFFFF";
  5565. document.getElementById("net_3").style.color = "black";
  5566. document.getElementById("net_4").style.background = "#FFFFFF";
  5567. document.getElementById("net_4").style.color = "black";
  5568. document.getElementById("net_5").style.background = "#FFFFFF";
  5569. document.getElementById("net_5").style.color = "black";
  5570. }
  5571.  
  5572. }
  5573.  
  5574. function usertype(obj)
  5575. {
  5576. if(obj.value == 0)
  5577. {
  5578. document.getElementById("subtypet").style.display = "inline";
  5579. document.getElementById("subtypee").style.display = "none";
  5580. }
  5581. else if(obj.value == 1)
  5582. {
  5583. document.getElementById("subtypee").style.display = "inline";
  5584. document.getElementById("subtypet").style.display = "none";
  5585. }
  5586. else
  5587. {
  5588. document.getElementById("subtypee").style.display = "none";
  5589. document.getElementById("subtypet").style.display = "none";
  5590. document.getElementById("ext").style.display = "none";
  5591. }
  5592. }
  5593. function text(obj)
  5594. {
  5595. if(obj.value == 7)
  5596. {
  5597. document.getElementById("ext").style.display = "none";
  5598. }
  5599. else
  5600. document.getElementById("ext").style.display = "inline";
  5601. }
  5602. function searchon(obj)
  5603. {
  5604. var data = null;
  5605. var type = null;
  5606. type = document.getElementById('usertype').value;
  5607. if(type == 0)
  5608. var subtype = document.getElementById('subtypet').value;
  5609. else if(type == 1)
  5610. var subtype = document.getElementById('subtypee').value;
  5611.  
  5612. var number = document.getElementById('ext').value;
  5613. data = type+":"+subtype+"|"+number;
  5614. doWork(data,"getnum","search");
  5615. }
  5616. function get_propext(data)
  5617. {
  5618. //alert(data);
  5619. var elementExists = document.getElementById("nsb_div_port");
  5620. if(elementExists)
  5621. document.getElementById("nsb_div_port").style.display = "inline";
  5622. document.getElementById("nsb_div_login").style.display = "inline";
  5623. document.getElementById("nsb_div_logout").style.display = "inline";
  5624. var elementExists = document.getElementById("nsb_div_cardD");
  5625. if(elementExists)
  5626. document.getElementById("nsb_div_cardD").style.display = "inline";
  5627.  
  5628. var port = (data).split("^");
  5629. document.getElementById("number").value =port[0];;
  5630. doWork(data,"getext","search");
  5631. }
  5632. function get_proptrk(data)
  5633. {
  5634. var elementExists = document.getElementById("nsb_div_port");
  5635. if(elementExists)
  5636. document.getElementById("nsb_div_port").style.display = "inline";
  5637. var elementExists = document.getElementById("nsb_div_cardD");
  5638. if(elementExists)
  5639. document.getElementById("nsb_div_cardD").style.display = "inline";
  5640. var data = (data).split("^");
  5641. var add = data[1];
  5642. //alert(data[0]);
  5643. document.getElementById("number").value = data[0];
  5644. var data = data[0]+"|"+add;
  5645. doWork(data,"gettrk","search");
  5646. }
  5647. function get_propcnri(data)
  5648. {
  5649. document.getElementById("number").value = data;
  5650. doWork(data+"|cnri","getcnri","search");
  5651. }
  5652. function get_defcnri(data)
  5653. {
  5654. //alert(data);
  5655. if(data == setradioval)
  5656. {
  5657. // alert("found previous");
  5658. document.getElementById("tab_data").innerHTML = setradiopg;
  5659. select();
  5660.  
  5661. }
  5662. else
  5663. {
  5664. if(data == 3)
  5665. valu = 2
  5666. else if(data == 4)
  5667. valu = 3
  5668. else if(data == 7)
  5669. valu = 1
  5670. else
  5671. valu = 0;
  5672.  
  5673. if(defvalues[valu])
  5674. {
  5675. //alert("found default");
  5676. document.getElementById("tab_data").innerHTML = defvalues[valu];
  5677. select();
  5678. document.getElementById("cnri_2").options[data].selected = true;
  5679. document.getElementById("cnri_2").name = "slctd,changed";
  5680. //alert(document.getElementById("cnri_2").name);
  5681. }
  5682. else
  5683. {
  5684. //alert("going to create");
  5685. doWork(data+"|"+valu,"getcnri","search");
  5686. }
  5687. }
  5688. }
  5689. function set_gain(obj)
  5690. {
  5691. //alert(obj.name);
  5692. value = (obj.id+"|"+obj.value);
  5693. //alert(value);
  5694. doWork(value,"set_gain","gain");
  5695. }
  5696. function net_change(obj)
  5697. {
  5698. var date = document.getElementById("theDate").value;
  5699. var time = document.getElementById("date_1").value;
  5700. var dt = date+"|"+time;
  5701. doWork(value,"set_dt","config");
  5702. }
  5703. function pm_change(obj)
  5704. {
  5705. var x = document.getElementById("pm_1");
  5706. var y = document.getElementById("pm_2");
  5707. var z = document.getElementById("pm_3");
  5708. x.style.border = "0px solid";
  5709. y.style.border = "0px solid";
  5710. z.style.border = "0px solid";
  5711. document.getElementById("crosspm_1").style.display = "none";
  5712. document.getElementById("crosspm_2").style.display = "none";
  5713. document.getElementById("crosspm_3").style.display = "none";
  5714.  
  5715. if(obj.value == 0)
  5716. {
  5717. var val = ntpval.split(":");
  5718.  
  5719. x.readOnly = true;
  5720. x.value = val[3];
  5721.  
  5722. y.readOnly = true;
  5723. y.value = val[4];
  5724.  
  5725. z.readOnly = true;
  5726. z.value = val[7];
  5727. }
  5728. else if(obj.value == 1)
  5729. {
  5730. x.readOnly = false;
  5731. x.value = x.title;
  5732.  
  5733. y.readOnly = false;
  5734. y.value = y.title;
  5735.  
  5736. z.readOnly = false;
  5737. z.value = z.title;
  5738. }
  5739. }
  5740. function readwrite(obj)
  5741. {
  5742. if(document.getElementById("pm_0").value == 1)
  5743. {
  5744. document.getElementById(obj.id).readOnly = false;
  5745. }
  5746. else
  5747. {
  5748. document.getElementById(obj.id).readOnly = true;
  5749. }
  5750. }
  5751. function rsu_change(obj,data)
  5752. {
  5753. var pattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
  5754. var x = pattern.test(obj.value) ? true : false;
  5755. if(x == false)
  5756. {
  5757. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  5758. document.getElementById("cross"+obj.id).style.display="inline";
  5759. document.getElementById(obj.id).title = "no";
  5760. }
  5761. else if(x == true)
  5762. {
  5763. var cmnum = document.getElementById("cmnum");
  5764. var value = (obj.name+"|"+obj.id+"|"+obj.value);
  5765. document.getElementById(obj.id).style.border = "0px solid";
  5766. document.getElementById("cross"+obj.id).style.display="none";
  5767. document.getElementById(obj.id).title = "ok";
  5768. rsuchange[data] = (data+1);
  5769. doWork(value,"set_rsu","config");
  5770. }
  5771. }
  5772. function rsu_change1(obj,data)
  5773. {
  5774. var cmnum = document.getElementById("cmnum");
  5775. var value = (obj.name+"|"+obj.id+"|"+obj.value);
  5776. if(obj.id == "rsu_9")
  5777. {
  5778. if((document.getElementById("rsu_9").checked==true))
  5779. value = (obj.name+"|"+obj.id+"|"+1)
  5780. else if((document.getElementById("rsu_9").checked==false))
  5781. value = (obj.name+"|"+obj.id+"|"+0)
  5782. }
  5783. rsuchange[data] = (data+1);
  5784. //alert(rsuchange.length);
  5785. //alert(rsuchange[data]);
  5786. doWork(value,"set_rsu","config");
  5787.  
  5788. }
  5789. function check_rsu_change(obj,data)
  5790. {
  5791. var pattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
  5792. var x = pattern.test(obj.value) ? true : false;
  5793. if(x == false)
  5794. {
  5795. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  5796. document.getElementById("cross"+obj.id).style.display="inline";
  5797. document.getElementById(obj.id).title = "no";
  5798. }
  5799. }
  5800. function apply_rsu()
  5801. {
  5802. //document.getElementById("contentconfig").style.display = "none";
  5803. //document.getElementById("confwin").style.display = "none";
  5804. }
  5805. function show_sid()
  5806. {
  5807. //alert(document.getElementById("sid"));
  5808. //document.getElementById("sid").style.border = "4px solid #FF0000";
  5809. document.window.open("sid").style.display = "block";
  5810. document.getElementById("sid").style.zIndex = "100";
  5811. }
  5812. function apply_licence()
  5813. {
  5814. document.getElementById("contentconfig").style.display = "none";
  5815. document.getElementById("confwin").style.display = "none";
  5816. sid_feat();
  5817. }
  5818. function add_enblock()
  5819. {
  5820. var len = document.getElementById("length").value;
  5821. if(len < 0 || len >30)
  5822. {
  5823. alert("Length should be between 0 to 30");
  5824. return;
  5825. }
  5826. var value = (document.getElementById("flex").value+"|"+len);
  5827. //alert(value);
  5828. doWork(value,"set_enblock","enblock");
  5829.  
  5830. }
  5831. function delete_enblock(obj)
  5832. {
  5833. var r=confirm("Are you sure to proceed!");
  5834. if (r==true)
  5835. {
  5836. var flex = document.getElementById("flex_"+obj).value;
  5837. //alert(flex);
  5838. var length = document.getElementById("length_"+obj).value;
  5839. var value = flex+"|"+length;
  5840. doWork(value,"delete_enblock","enblock");
  5841. //alert("You pressed OK!");
  5842. }
  5843. else
  5844. {
  5845. //alert("You pressed Cancel!");
  5846. }
  5847. }
  5848. function fetch_allwdnum()
  5849. {
  5850. var allwdgrp = document.getElementById("allwdgrp").value;
  5851. //alert(allwdgrp);
  5852. doWork(allwdgrp,"get_allwdgrp","ulsta");
  5853. }
  5854. function fetch_dendnum()
  5855. {
  5856. var dendgrp = document.getElementById("dendgrp").value;
  5857. //alert(allwdgrp);
  5858. doWork(dendgrp,"get_denied","ulstd");
  5859. }
  5860. function set_allwdnum()
  5861. {
  5862. var tnum = document.getElementById("flex").value;
  5863. var allwdgrp = document.getElementById("allwdgrp").value;
  5864. //alert(tnum+","+allwdgrp);
  5865. doWork(tnum+","+allwdgrp,"set_allwdgrp","ulsta");
  5866. hide_add();
  5867. }
  5868. function del_allwdnum(obj)
  5869. {
  5870. var r=confirm("Are you sure to proceed!");
  5871. if (r==true)
  5872. {
  5873. var tnum = document.getElementById("anum_"+obj).value;
  5874. var allwdgrp = document.getElementById("allwdgrp").value;
  5875. //alert(tnum+"_"+allwdgrp);
  5876. doWork(tnum+","+allwdgrp,"del_allwdgrp","ulsta");
  5877. hide_add();
  5878. }
  5879. else
  5880. {
  5881. //alert("You pressed Cancel!");
  5882. }
  5883. }
  5884. function del_dendnum(obj)
  5885. {
  5886. var r=confirm("Are you sure to proceed!");
  5887. if (r==true)
  5888. {
  5889. var tnum = document.getElementById("dnum_"+obj).value;
  5890. var dendgrp = document.getElementById("dendgrp").value;
  5891. //alert(tnum+"_"+allwdgrp);
  5892. doWork(tnum+","+dendgrp,"del_dendgrp","ulstd");
  5893. hide_add();
  5894. }
  5895. else
  5896. {
  5897. //alert("You pressed Cancel!");
  5898. }
  5899. }
  5900. function set_denied()
  5901. {
  5902. var tnum = document.getElementById("flex").value;
  5903. var dendgrp = document.getElementById("dendgrp").value;
  5904. //alert(tnum+","+allwdgrp);
  5905. doWork(tnum+","+dendgrp,"set_dendgrp","ulstd");
  5906. hide_add();
  5907. }
  5908. function apply_haconfig()
  5909. {
  5910. if(document.getElementById("ha_0").value || document.getElementById("ha_1").value || document.getElementById("ha_2").value || document.getElementById("ha_3").value ||document.getElementById("ha_4").value)
  5911. {
  5912. var a = document.getElementById("ha_0").value;
  5913. var b = document.getElementById("ha_1").value;
  5914. var c = document.getElementById("ha_2").value;
  5915. var d = document.getElementById("ha_3").value;
  5916. var e = document.getElementById("ha_4").value;
  5917. }
  5918. else
  5919. {
  5920. alert("Filling all fields are mandatory");
  5921. }
  5922. doWork(a+"|"+b+"|"+c+"|"+d+"|"+e,"set_ha","config");
  5923. }
  5924.  
  5925. function add_card()
  5926. {
  5927. document.getElementById("slotno").value = "";
  5928. document.getElementById("cardid").value = "";
  5929. document.getElementById("addcard").style.display = "inline";
  5930. }
  5931.  
  5932. function nsb_add_card()
  5933. {
  5934. var slotnum = document.getElementById("slotno").value;
  5935. var cardid = document.getElementById("cardid").value;
  5936. //alert(slotnum+","+cardid);
  5937. if(slotnum <= 1 || slotnum >= 10)
  5938. {
  5939. alert("CARD NUMBER SHOULD BE BETWEEN 2 to 9.");
  5940. return;
  5941. }
  5942. else
  5943. doWork(slotnum +"^"+cardid,"add_card","search");
  5944. //hide_addcard();
  5945. }
  5946.  
  5947. function add_allwd()
  5948. {
  5949. document.getElementById("flex").value = "";
  5950. document.getElementById("add").style.display = "inline";
  5951. }
  5952. function add_dend()
  5953. {
  5954. document.getElementById("flex").value = "";
  5955. document.getElementById("add").style.display = "inline";
  5956. }
  5957.  
  5958.  
  5959.  
  5960. function typ_change(obj)
  5961. {
  5962. //alert (obj.value);
  5963. if(obj.value == "EXT")
  5964. {
  5965. document.getElementById("usersubtype1").style.display = "inline";
  5966. document.getElementById("usersubtype2").style.display = "none";
  5967. }
  5968. else if(obj.value == "TRK")
  5969. {
  5970. document.getElementById("usersubtype2").style.display = "inline";
  5971. document.getElementById("usersubtype1").style.display = "none";
  5972. }
  5973. else
  5974. {
  5975. document.getElementById("usersubtype1").style.display = "none";
  5976. document.getElementById("usersubtype2").style.display = "none";
  5977. }
  5978. }
  5979. function isNumber(evt)
  5980. {
  5981. evt = (evt) ? evt : window.event;
  5982. var charCode = (evt.which) ? evt.which : evt.keyCode;
  5983. //alert(charCode);
  5984. if (charCode > 31 && (charCode != 35) && (charCode != 42) && (charCode < 48 || charCode > 57))
  5985. {
  5986. //alert ("first case");
  5987. return false;
  5988. }
  5989. //alert ("final case");
  5990. return true;
  5991. }
  5992.  
  5993. function isNumberWithAt(evt)
  5994. {
  5995. evt = (evt) ? evt : window.event;
  5996. var charCode = (evt.which) ? evt.which : evt.keyCode;
  5997. //alert(charCode);
  5998. if (charCode > 31 && (charCode != 64) && (charCode != 35) && (charCode != 42) && (charCode < 48 || charCode > 57))
  5999. {
  6000. //alert ("first case");
  6001. return false;
  6002. }
  6003. //alert ("final case");
  6004. return true;
  6005. }
  6006.  
  6007.  
  6008. function add_flex(obj)
  6009. {
  6010. doWork(obj,"add-mod-del","feat");
  6011. }
  6012. function doit(obj)
  6013. {
  6014. //alert(obj);
  6015. if(obj == 1)
  6016. {
  6017. var usrtyp = document.getElementById("usertype").value;
  6018. var subusrtyp = "SIP";
  6019. /*
  6020. if(usrtyp == "EXT")
  6021. var subusrtyp = document.getElementById("usersubtype1").value;
  6022. else if(usrtyp == "TRK")
  6023. var subusrtyp = document.getElementById("usersubtype2").value;
  6024. else
  6025. {
  6026. alert("Please select User Type!");
  6027. return;
  6028. }
  6029. alert(subusrtyp);
  6030. if(subusrtyp == "-1")
  6031. {
  6032. alert("Please select User Sub Type!");
  6033. return;
  6034. }
  6035. */
  6036.  
  6037. var start = document.getElementById("start").value;
  6038. var end = document.getElementById("end").value;
  6039. if(start == "")
  6040. {
  6041. alert("Start Number is mandatory!");
  6042. return;
  6043. //doWork(obj,"add-mod-del","feat");
  6044. }
  6045. else if(end && start > end)
  6046. {
  6047. alert("Start value should be smaller than End value!");
  6048. return;
  6049. //doWork(obj,"add-mod-del","feat");
  6050. }
  6051. else if(usrtyp == "-1" || subusrtyp == "-1")
  6052. {
  6053. alert("Filling all fields is mandatory!");
  6054. return;
  6055. //doWork(obj,"add-mod-del","feat");
  6056. }
  6057. else if((end - start) > 50)
  6058. {
  6059. alert("Max Range is 50!");
  6060. return;
  6061. //doWork(obj,"add-mod-del","feat");
  6062. }
  6063. else
  6064. {
  6065. var value = (obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end);
  6066. //alert(value);
  6067. doWork(value,"doit","feat");
  6068. }
  6069. }
  6070. else if(obj == 2)
  6071. {
  6072. var usrtyp = document.getElementById("usertype").value;
  6073. var subusrtyp = "SIP";
  6074. /*
  6075. if(usrtyp == "EXT")
  6076. {
  6077. var subusrtyp = document.getElementById("usersubtype1").value;
  6078. }
  6079. else if(usrtyp == "TRK")
  6080. {
  6081. var subusrtyp = document.getElementById("usersubtype2").value;
  6082. }
  6083. else
  6084. {
  6085. alert("Please select User Type!");
  6086. return;
  6087. }
  6088. if(subusrtyp == "-1")
  6089. {
  6090. alert("Please select Sub User Type");
  6091. return;
  6092. }
  6093. */
  6094. var start = document.getElementById("start").value;
  6095. var end = document.getElementById("end").value;
  6096. if(start == "")
  6097. {
  6098. alert("Start Number is mandatory!");
  6099. return;
  6100. //doWork(obj,"add-mod-del","feat");
  6101. }
  6102. else if(end && start > end)
  6103. {
  6104. alert("Start value should be smaller than End value!");
  6105. return;
  6106. //doWork(obj,"add-mod-del","feat");
  6107. }
  6108. else if(usrtyp == "-1" || subusrtyp == "-1")
  6109. {
  6110. alert("Filling all fields is mandatory!");
  6111. return;
  6112. //doWork(obj,"add-mod-del","feat");
  6113. }
  6114. else if((end - start) > 50)
  6115. {
  6116. alert("Max Range is 50!");
  6117. return;
  6118. //doWork(obj,"add-mod-del","feat");
  6119. }
  6120. else
  6121. {
  6122. var value = obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end;
  6123. //alert(value);
  6124. doWork(value,"doit","feat");
  6125. }
  6126. }
  6127. else if(obj == 3)
  6128. {
  6129. var start = document.getElementById("start").value;
  6130. var end = document.getElementById("end").value;
  6131. var startnew = document.getElementById("startnewtxt").value;
  6132. //alert("i am in modify"+start+"_"+end+"-"+startnew);
  6133. // var endnew = document.getElementById("endnewtxt").value;
  6134. if(start == "")
  6135. {
  6136. alert("Start Number is mandatory!");
  6137. return;
  6138. //doWork(obj,"add-mod-del","feat");
  6139. }
  6140. else if(end && start > end)
  6141. {
  6142. alert("Start value should be smaller than End value!");
  6143. return;
  6144. //doWork(obj,"add-mod-del","feat");
  6145. }
  6146. else if((end - start) > 50)
  6147. {
  6148. alert("Max Range is 50!");
  6149. return;
  6150. //doWork(obj,"add-mod-del","feat");
  6151. }
  6152. else
  6153. {
  6154. var value = escape(obj+"|"+start+"|"+end+"|"+startnew);
  6155. //alert(value);
  6156. doWork(value,"doit","feat");
  6157. }
  6158. }
  6159. }
  6160.  
  6161. function did_mem()
  6162. {
  6163.  
  6164.  
  6165. if(document.getElementById("didnum").value == "Select")
  6166. {
  6167. alert("Please select DIDG Group Number");
  6168. return;
  6169. }
  6170.  
  6171. var didnum = document.getElementById("didnum").value;
  6172. document.getElementById(1).style.color = "#ED1B03";
  6173. document.getElementById(0).style.color = "#757575";
  6174. //alert(didnum);
  6175. doWork(didnum,"did_mem","didg");
  6176. }
  6177.  
  6178. function dod_mem()
  6179. {
  6180. var dodnum = document.getElementById("dodnum").value;
  6181. document.getElementById(3).style.color = "#ED1B03";
  6182. //document.getElementById(2).style.color = "#757575";
  6183. document.getElementById(1).style.color = "#757575";
  6184. document.getElementById(0).style.color = "#757575";
  6185. doWork(dodnum,"dod_mem","dodg");
  6186. }
  6187. function add_acd()
  6188. {
  6189. doWork(null,"add_acd","acd");
  6190. }
  6191. function add_bgrp()
  6192. {
  6193. doWork(null,"add_bgrp","bgrp");
  6194. }
  6195. function delete_acd(obj)
  6196. {
  6197. var r=confirm("Are you sure to proceed!");
  6198. if (r==true)
  6199. {
  6200. var acdno = document.getElementById("acdno").value;
  6201. var memnum = document.getElementById("acdnum_"+obj).value;
  6202. var value = acdno+"|"+memnum;
  6203. doWork(value,"del_acd","acd");
  6204. }
  6205. else
  6206. {
  6207. //alert("You pressed Cancel!");
  6208. }
  6209. }
  6210. function delete_bgrp(obj)
  6211. {
  6212. var r=confirm("Are you sure to proceed!");
  6213. if (r==true)
  6214. {
  6215. var bgrpno = document.getElementById("bgrpno").value;
  6216. var memnum = document.getElementById("acc_"+obj).value;
  6217. var value = bgrpno+"|"+memnum;
  6218. //alert(value);
  6219. doWork(value,"del_bgrp","bgrp");
  6220. }
  6221. else
  6222. {
  6223. //alert("You pressed Cancel!");
  6224. }
  6225. }
  6226. function update_acdmem()
  6227. {
  6228. var acdno = document.getElementById("acdno").value;
  6229. if(acdno == "Select")
  6230. {
  6231. alert("Please select ACD group number");
  6232. return;
  6233. }
  6234. var memnum = document.getElementById("addnum").value;
  6235. var value = acdno+"|"+memnum;
  6236. doWork(value,"add_member","acd");
  6237. }
  6238. function delete_flex(obj)
  6239. {
  6240. var r=confirm("Are you sure to proceed!");
  6241. if (r==true)
  6242. {
  6243. doWork(obj,"delete_flex","feat");
  6244. }
  6245. else
  6246. {
  6247. //alert("You pressed Cancel!");
  6248. }
  6249. //alert("done");
  6250. }
  6251. function proto_change(obj)
  6252. {
  6253. //alert(obj.name);
  6254. var name = (obj.name).split("_");
  6255. if(name[1] == "nochange" && obj.title != obj.value)
  6256. document.getElementById(obj.id).name = name[0]+"_changed";
  6257. //alert(obj.name);
  6258. }
  6259.  
  6260. //Added by AJ
  6261. function timer_change(obj)
  6262. {
  6263. //alert(obj.name);
  6264. var name = (obj.name).split(",");
  6265. if(name[1] == "nochange" && obj.title != obj.value)
  6266. {
  6267. document.getElementById(obj.id).name = name[0]+",changed";
  6268. }
  6269.  
  6270. }
  6271. function updateTimer()
  6272. {
  6273. var data = null;
  6274. data = document.getElementById("prino").value;
  6275. var all_values = null;
  6276. //alert("Here in update");
  6277. for(jdx = 1; jdx < 6; jdx++)
  6278. {
  6279. var ele = document.getElementById("tim_"+jdx);
  6280. var name = (ele.name).split(",");
  6281. //alert(name[1]+"_"+name[0]);
  6282. if(name[1] == "changed")
  6283. {
  6284. if(all_values == null)
  6285. all_values = ele.value+"_"+jdx;
  6286. else
  6287. all_values = all_values+":"+ele.value+"_"+jdx;
  6288. }
  6289. }
  6290. for(jdx = 6; jdx < 11; jdx++)
  6291. {
  6292. var ele = document.getElementById("tim_"+jdx);
  6293. var name = (ele.name).split(",");
  6294. //alert(name[1]+"_"+name[0]);
  6295. if(name[1] == "changed")
  6296. {
  6297. if(all_values == null)
  6298. all_values = ele.value+"_"+jdx;
  6299. else
  6300. all_values = all_values+":"+ele.value+"_"+jdx;
  6301. }
  6302. }
  6303. for(jdx = 11; jdx < 38; jdx++)
  6304. {
  6305. var ele = document.getElementById("tim_"+jdx);
  6306. var name = (ele.name).split(",");
  6307. //alert(name[1]+"_"+name[0]);
  6308. if(name[1] == "changed")
  6309. {
  6310. if(all_values == null)
  6311. all_values = ele.value+"_"+jdx;
  6312. else
  6313. all_values = all_values+":"+ele.value+"_"+jdx;
  6314. }
  6315. }
  6316. if(all_values != null)
  6317. {
  6318. all_values += ","+data;
  6319. //alert(all_values);
  6320. all_values = escape(all_values);
  6321. doWork(all_values,"set_timer","protocol");
  6322. }
  6323. else
  6324. alert("No Change Encountered!");
  6325.  
  6326. }
  6327. //till here
  6328. function updateproto()
  6329. {
  6330. var data = null;
  6331. data = document.getElementById("prino").value;
  6332. var all_values = null;
  6333. var err_flag = 0;
  6334. var all_values = null;
  6335. for(jdx = 1; jdx < 52; jdx++)
  6336. {
  6337. var ele = document.getElementById("proto_"+jdx);
  6338. var name = (ele.name).split("_");
  6339. //alert(name[1]+"_"+name[0]);
  6340. if(name[1] == "changed")
  6341. {
  6342. switch(name[0])
  6343. {
  6344. case "chk":
  6345. {
  6346. //alert(ele.value+"__"+ele.type+"__"+jdx);
  6347. if(all_values == null)
  6348. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  6349. else
  6350. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  6351. //alert(all_values);
  6352. break;
  6353. }
  6354. case "slct":
  6355. {
  6356. if(name[1] == "changed")
  6357. {
  6358. // alert(all_values);
  6359. if(all_values == null)
  6360. {
  6361. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  6362. // alert(ele.type);
  6363. }
  6364. else
  6365. {
  6366. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  6367. }
  6368. //break;
  6369. //alert(all_values);
  6370. }
  6371. else
  6372. break;
  6373. }
  6374. }
  6375. }
  6376. }
  6377. if(all_values != null)
  6378. {
  6379. all_values += ","+data;
  6380. //alert(all_values);
  6381. all_values = escape(all_values);
  6382. doWork(all_values,"set_proto","protocol");
  6383. }
  6384. else
  6385. alert("No Change Encountered!");
  6386. }
  6387. function add_bgrp_now()
  6388. {
  6389. var Bossmem = document.getElementById("bossmem").value;
  6390. var Bossring = document.getElementById("ringboss").value;
  6391. var Bgrpno = document.getElementById("bgrpno").value;
  6392. var stuff = Bossmem+"_"+Bossring+"_"+Bgrpno;
  6393. doWork(stuff,"add_boss_mem","bgrp");
  6394. }
  6395. function checkDomain(nname)
  6396. {
  6397. var arr = new Array(
  6398. '.com','.net','.org','.biz','.coop','.info','.museum','.name',
  6399. '.pro','.edu','.gov','.int','.mil','.ac','.ad','.ae','.af','.ag',
  6400. '.ai','.al','.am','.an','.ao','.aq','.ar','.as','.at','.au','.aw',
  6401. '.az','.ba','.bb','.bd','.be','.bf','.bg','.bh','.bi','.bj','.bm',
  6402. '.bn','.bo','.br','.bs','.bt','.bv','.bw','.by','.bz','.ca','.cc',
  6403. '.cd','.cf','.cg','.ch','.ci','.ck','.cl','.cm','.cn','.co','.cr',
  6404. '.cu','.cv','.cx','.cy','.cz','.de','.dj','.dk','.dm','.do','.dz',
  6405. '.ec','.ee','.eg','.eh','.er','.es','.et','.fi','.fj','.fk','.fm',
  6406. '.fo','.fr','.ga','.gd','.ge','.gf','.gg','.gh','.gi','.gl','.gm',
  6407. '.gn','.gp','.gq','.gr','.gs','.gt','.gu','.gv','.gy','.hk','.hm',
  6408. '.hn','.hr','.ht','.hu','.id','.ie','.il','.im','.in','.io','.iq',
  6409. '.ir','.is','.it','.je','.jm','.jo','.jp','.ke','.kg','.kh','.ki',
  6410. '.km','.kn','.kp','.kr','.kw','.ky','.kz','.la','.lb','.lc','.li',
  6411. '.lk','.lr','.ls','.lt','.lu','.lv','.ly','.ma','.mc','.md','.mg',
  6412. '.mh','.mk','.ml','.mm','.mn','.mo','.mp','.mq','.mr','.ms','.mt',
  6413. '.mu','.mv','.mw','.mx','.my','.mz','.na','.nc','.ne','.nf','.ng',
  6414. '.ni','.nl','.no','.np','.nr','.nu','.nz','.om','.pa','.pe','.pf',
  6415. '.pg','.ph','.pk','.pl','.pm','.pn','.pr','.ps','.pt','.pw','.py',
  6416. '.qa','.re','.ro','.rw','.ru','.sa','.sb','.sc','.sd','.se','.sg',
  6417. '.sh','.si','.sj','.sk','.sl','.sm','.sn','.so','.sr','.st','.sv',
  6418. '.sy','.sz','.tc','.td','.tf','.tg','.th','.tj','.tk','.tm','.tn',
  6419. '.to','.tp','.tr','.tt','.tv','.tw','.tz','.ua','.ug','.uk','.um',
  6420. '.us','.uy','.uz','.va','.vc','.ve','.vg','.vi','.vn','.vu','.ws',
  6421. '.wf','.ye','.yt','.yu','.za','.zm','.zw');
  6422.  
  6423. var mai = nname;
  6424. var val = true;
  6425.  
  6426. var dot = mai.lastIndexOf(".");
  6427. var dname = mai.substring(0,dot);
  6428. var ext = mai.substring(dot,mai.length);
  6429. //alert(ext);
  6430.  
  6431. if(dot>2 && dot<57)
  6432. {
  6433. for(var i=0; i<arr.length; i++)
  6434. {
  6435. if(ext == arr[i])
  6436. {
  6437. val = true;
  6438. break;
  6439. }
  6440. else
  6441. val = false;
  6442. }
  6443. if(val == false)
  6444. return false;
  6445. else
  6446. {
  6447. for(var j=0; j<dname.length; j++)
  6448. {
  6449. var dh = dname.charAt(j);
  6450. var hh = dh.charCodeAt(0);
  6451. if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
  6452. {
  6453. if((j==0 || j==dname.length-1) && hh == 45)
  6454. return false;
  6455. }
  6456. else
  6457. return false;
  6458. }
  6459. }
  6460. }
  6461. else
  6462. return false;
  6463.  
  6464. return true;
  6465. }
  6466. function nam_change(obj)
  6467. {
  6468. var z = checkDomain(obj.value);
  6469. if(z == false)
  6470. {
  6471. var data = obj.id+"^"+obj.value;
  6472. doWork(data,"ip_validate","config");
  6473. obj.name = "no";
  6474. }
  6475. else
  6476. {
  6477. document.getElementById(obj.id).style.border = "0px solid";
  6478. document.getElementById('cross'+obj.id).style.display = "none";
  6479. obj.title =obj.value;
  6480. obj.name = "ok";
  6481. }
  6482.  
  6483. }
  6484. function clkcheck(obj)
  6485. {
  6486. if(obj.value == "")
  6487. {
  6488. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6489. document.getElementById("cross"+obj.id).style.display = "inline";
  6490. obj.value = "";
  6491. }
  6492. else if(obj.value)
  6493. {
  6494. var n = obj.value.indexOf(":");
  6495. var l = obj.value.length;
  6496. if(n != "2" || l!= "5")
  6497. {
  6498. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6499. document.getElementById("cross"+obj.id).style.display = "inline";
  6500. obj.value = "";
  6501. alert(" Fill date in HH:MM formet") ;
  6502. }
  6503. else
  6504. {
  6505. var h = obj.value.split(":");
  6506. if(h[0][0]=="0" || h[0][0]=="1"|| h[0][0]=="2")
  6507. {
  6508. if(h[0][0] == "2")
  6509. {
  6510. //if(h[0][1]=="0" || h[0][1]=="1"|| h[0][1]=="2" || h[0][1]=="3")
  6511. if(h[0][1]>4)
  6512. {
  6513. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6514. document.getElementById("cross"+obj.id).style.display = "inline";
  6515. obj.value = "";
  6516. alert("Fill HH(0-23)");
  6517. }
  6518. }
  6519. else if((h[1][0]>5))
  6520. {
  6521. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6522. document.getElementById("cross"+obj.id).style.display = "inline";
  6523. obj.value = "";
  6524. alert("Fill MM(0-59)");
  6525. }
  6526. else
  6527. document.getElementById("setclk").style.display = "inline";
  6528.  
  6529. }
  6530. else
  6531. {
  6532. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6533. document.getElementById("cross"+obj.id).style.display = "inline";
  6534. obj.value = "";
  6535. alert("Fill HH(0-23)");
  6536. }
  6537. }
  6538. }
  6539. }
  6540. function datech()
  6541. {
  6542. document.getElementById("setclk").style.display = "inline";
  6543. }
  6544.  
  6545. function go_conf()
  6546. {
  6547. if(document.getElementById("cmnum").value != "select")
  6548. {
  6549. for(i=0;i<9;i++)
  6550. {
  6551. var s = document.getElementById("rsu_"+i);
  6552. if(s.value == "")
  6553. {
  6554. s.style.border = "1px solid #FF0000";
  6555. document.getElementById("crossrsu_"+i).style.display = "inline";
  6556. alert("Fill empty red shaded field correctly");
  6557. break;
  6558. }
  6559. else
  6560. {
  6561. if(s.title == "no")
  6562. {
  6563. alert("Fill empty red shaded field correctly");
  6564. break;
  6565. }
  6566. else if(i==8)
  6567. {
  6568. document.getElementById("rsu").style.opacity = 0.6;
  6569. document.getElementById("rsu").style.filter= "alpha(opacity=60)";
  6570. go_confirm();
  6571. }
  6572. }
  6573. }
  6574. }
  6575. else
  6576. go_confirm();
  6577.  
  6578. }
  6579. function go_confirm()
  6580. {
  6581. settingval = ntpval+"_"+licval+"_"+pmval+"_"+haval;
  6582. //alert(settingval);
  6583. document.getElementById("confirmrsu").style.display = "none";
  6584. doWork(settingval,"set_confirm","config");
  6585. }
  6586.  
  6587. function ntp_title(obj)
  6588. {
  6589. if(obj.name != "no")
  6590. {
  6591. document.getElementById(obj.id).style.border = "0px solid";
  6592. //document.getElementById('cross'+obj.id).style.display = "none";
  6593. }
  6594. }
  6595. function ntp_title1(obj)
  6596. {
  6597. if(obj.title != "no")
  6598. {
  6599. document.getElementById(obj.id).style.border = "0px solid";
  6600. document.getElementById('cross'+obj.id).style.display = "none";
  6601. }
  6602. }
  6603.  
  6604. function ha_typ()
  6605. {
  6606. if(document.getElementById("conf_16").value == "1")
  6607. {
  6608. for(i=0;i<8;i++)
  6609. document.getElementById("ha_ty"+i).style.display = "inline";
  6610. }
  6611. else
  6612. {
  6613. for(i=0;i<8;i++)
  6614. document.getElementById("ha_ty"+i).style.display = "none";
  6615. }
  6616. }
  6617.  
  6618. function rsuconf(obj)
  6619. {
  6620. var data = null;
  6621. //alert(obj.id);
  6622. data = obj.id;
  6623. doWork(data,"get_confrsu","config");
  6624. }
  6625.  
  6626. function edit_ntp()
  6627. {
  6628. document.getElementById("rsu").style.opacity = 0.6;
  6629. document.getElementById("rsu").style.filter= "alpha(opacity=60)";
  6630. document.getElementById("confirmtab").style.display = "none";
  6631. get_dt();
  6632. }
  6633.  
  6634. function cancel_setting()
  6635. {
  6636.  
  6637. document.getElementById("rsu").style.opacity = 0.6;
  6638. document.getElementById("rsu").style.filter= "alpha(opacity=60)";
  6639. document.getElementById("confirmtab").style.display = "none";
  6640. //basic_config();
  6641. }
  6642. function edit_lic()
  6643. {
  6644. document.getElementById("rsu").style.opacity = 0.6;
  6645. document.getElementById("rsu").style.filter= "alpha(opacity=60)";
  6646. document.getElementById("confirmtab").style.display = "none";
  6647. get_licence();
  6648. }
  6649. function edit_pm()
  6650. {
  6651. document.getElementById("rsu").style.opacity = 0.6;
  6652. document.getElementById("rsu").style.filter= "alpha(opacity=60)";
  6653. document.getElementById("confirmtab").style.display = "none";
  6654. get_pm();
  6655. }
  6656.  
  6657. function ntpd_apply()
  6658. {
  6659. ntpdchange = null;
  6660. for(vdx=2;vdx<5;vdx++)
  6661. {
  6662. if(document.getElementById("conf_"+vdx).name == "changed")
  6663. {
  6664. ntpdchange = 1;
  6665. var setvalue = null;
  6666. for(jdx = 2;jdx<5;jdx++)
  6667. {
  6668. var z = document.getElementById("conf_"+jdx);
  6669. if(setvalue == null)
  6670. setvalue = z.value;
  6671. else
  6672. setvalue += "|"+z.value;
  6673. }
  6674. doWork(setvalue,"apply_set","config");
  6675. break;
  6676. }
  6677. else
  6678. {
  6679. if(vdx == "4")
  6680. {
  6681. ntpdchange = 0;
  6682. if(visible == 0)
  6683. {
  6684. waittorestart();
  6685. break;
  6686. }
  6687. else
  6688. {
  6689. licence_apply();
  6690. break;
  6691. }
  6692. }
  6693. }
  6694. }
  6695.  
  6696. }
  6697. function network_apply()
  6698. {
  6699. document.getElementById("con").style.display="inline";
  6700. apply_notify(null);
  6701. networkchange = null;
  6702.  
  6703. for(vdx = 5;vdx<12;vdx++)
  6704. {
  6705. // alert(vdx);
  6706. if(document.getElementById("conf_"+vdx).name == "changed")
  6707. {
  6708. networkchange = 1;
  6709. var setvalue = null;
  6710. for(jdx = 5;jdx<12;jdx++)
  6711. {
  6712. var z = document.getElementById("conf_"+jdx);
  6713. if(!z.value)
  6714. {
  6715. z.value = "0";
  6716. }
  6717. if(setvalue == null)
  6718. setvalue = z.value;
  6719. else
  6720. setvalue += "|"+z.value;
  6721. }
  6722. doWork(setvalue,"network_set","config");
  6723. break;
  6724. }
  6725. else
  6726. {
  6727. if(vdx == "11")
  6728. {
  6729. ntpd_apply();
  6730. break;
  6731. }
  6732. }
  6733. }
  6734. }
  6735.  
  6736.  
  6737. function lic_ip(obj)
  6738. {
  6739. var data = obj.id+"^"+obj.value;
  6740. if(obj.value != "localhost")
  6741. doWork(data,"ip_validate","config");
  6742. }
  6743. function ip_check(obj)
  6744. {
  6745. var data = obj.id+"^"+obj.value;
  6746. if(obj.id == "pm_1")
  6747. {
  6748. if(obj.value == ntpval.split(':')[3])
  6749. {
  6750. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6751. document.getElementById("cross"+obj.id).style.display="inline";
  6752. obj.name = "no";
  6753. alert("Pm address should be different than eth0");
  6754. }
  6755. else
  6756. doWork(data,"ip_validate","config");
  6757. }
  6758. else if(obj.id == "net_9")
  6759. {
  6760. if((obj.value != "")||(obj.value == "NULL"))
  6761. doWork(data,"ip_validate","config");
  6762. else
  6763. {
  6764. document.getElementById(obj.id).style.border = "0px solid";
  6765. document.getElementById('cross'+obj.id).style.display = "none";
  6766. obj.name = "ok";
  6767. }
  6768.  
  6769. }
  6770. else
  6771. doWork(data,"ip_validate","config");
  6772.  
  6773. }
  6774. function validateEmail( obj ) // validation of email address in dongle
  6775. {
  6776. if(document.getElementById(obj.id).value)
  6777. {
  6778. var pattern = /^[a-z\d]+(?:[\-\.\_][a-z\d]+)*[a-z\d]+@[\w\d]+(?:[-\.][a-z\d][a-z\d\-]*[a-z\d])*[a-z\d]+\.([a-z]{2,4})(\.([a-z]{2,4}))*$/i;
  6779. var x = pattern.test(obj.value) ? true : false;
  6780. if(x == false)
  6781. {
  6782. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6783. document.getElementById("cross"+obj.id).style.display="inline";
  6784. obj.name = "no";
  6785. }
  6786. else
  6787. {
  6788. document.getElementById(obj.id).style.border = "0px solid";
  6789. document.getElementById('cross'+obj.id).style.display = "none";
  6790. obj.name = "ok";
  6791. }
  6792. }
  6793.  
  6794. }
  6795. function validateoffset(obj)
  6796. {
  6797. if(obj.value>4096 || obj.value<0 || obj.value == "")
  6798. {
  6799. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6800. document.getElementById("cross"+obj.id).style.display="inline";
  6801. obj.name = "no";
  6802. }
  6803. else
  6804. {
  6805. document.getElementById(obj.id).style.border = "0px solid";
  6806. document.getElementById('cross'+obj.id).style.display = "none";
  6807. obj.name = "ok";
  6808. }
  6809. }
  6810. function idcheck(obj)
  6811. {
  6812. if(obj.value == "")
  6813. {
  6814. document.getElementById(obj.id).style.border = "1px solid #FF0000";
  6815. document.getElementById("cross"+obj.id).style.display="inline";
  6816. obj.name == "no";
  6817. }
  6818. else
  6819. {
  6820. document.getElementById(obj.id).style.border = "0px solid";
  6821. document.getElementById('cross'+obj.id).style.display = "none";
  6822. obj.name == "ok";
  6823. }
  6824. }
  6825. function apply_last(data)
  6826. { document.getElementById("notify_conf").style.display = "inline";
  6827. document.getElementById("notify_conf").style.position = "absolute";
  6828. document.getElementById("notify_conf3").innerHTML = data;
  6829. document.getElementById("notify_conf").style.display = "block";
  6830. document.getElementById("notify_conf").style.marginLeft = "220px";
  6831. document.getElementById("notify_conf").style.marginTop = "150px";
  6832. document.getElementById("notify_conf").style.opacity = "1";
  6833. setTimeout("waittorestart()", 3000);
  6834. }
  6835.  
  6836. function waittorestart()
  6837. {
  6838.  
  6839. //var data = networkchange+"^"+ntpdchange+"^"+licchange+"^"+pmchange+"^"+rsucha;
  6840. var data;
  6841. if(networkchange)
  6842. data = networkchange;
  6843. if(ntpdchange)
  6844. data += "^"+ntpdchange;
  6845. if(licchange)
  6846. data += "^"+licchange;
  6847. if(pmchange)
  6848. data += "^"+pmchange;
  6849. if(rsucha)
  6850. data += "^"+rsucha;
  6851. document.getElementById("notify_conf").style.display = "none";
  6852. if(!data)
  6853. {
  6854. alert("No change encountered in previous settings");
  6855. document.getElementById("con").style.display = "none";
  6856. edit_ntp();
  6857. }
  6858. else
  6859. {
  6860. doWork(data,"restart","config");
  6861. }
  6862.  
  6863.  
  6864. }
  6865. function restart()
  6866. {
  6867. //alert(data);
  6868. document.getElementById("con").style.display = "none";
  6869. document.getElementById("notify_conf").style.display = "none";
  6870. restartmsg("System will reboot now ! Please wait...");
  6871. //doWork(true,"go_restart","config");
  6872. }
  6873.  
  6874. function norestart()
  6875. {
  6876. document.getElementById("notify_conf").style.display = "none";
  6877. document.getElementById("con").style.display = "none";
  6878. cancel_setting();
  6879. }
  6880.  
  6881. function replaceall(str,replace,with_this)
  6882. {
  6883. var str_hasil ="";
  6884. for(var i=0;i<str.length;i++)
  6885. {
  6886. if (str[i] == replace)
  6887. {
  6888. var temp = with_this;
  6889. }
  6890. else
  6891. {
  6892. var temp = str[i];
  6893. }
  6894. str_hasil += temp;
  6895. }
  6896. return str_hasil;
  6897. }
  6898. function applyclock()
  6899. {
  6900. var setvalue = null;
  6901. for(jdx = 10;jdx<12;jdx++)
  6902. {
  6903. var z = document.getElementById("net_"+jdx);
  6904. if(setvalue == null)
  6905. setvalue = z.value;
  6906. else
  6907. setvalue += "|"+z.value;
  6908. }
  6909. setvalue = replaceall(setvalue,"/","-");
  6910.  
  6911. doWork(setvalue,"apply_clock","config");
  6912. }
  6913.  
  6914. function yocheck(obj)
  6915. {
  6916. var data = obj.id+"^"+obj.value;
  6917. doWork(data,"maskcheck","config");
  6918.  
  6919. }
  6920.  
  6921. function exit_lic()
  6922. {
  6923. document.getElementById("confirmrsu").style.display = "none";
  6924. }
  6925.  
  6926. //Functions Added by Anuja
  6927.  
  6928. function date_time()
  6929. {
  6930. //alert("Here in function date_time");
  6931. doWork(true,"date_time","systemConf");
  6932. }
  6933.  
  6934. function ip_conf()
  6935. {
  6936. doWork(true,"ip_conf","systemConf");
  6937. }
  6938.  
  6939. function set_date_time()
  6940. {
  6941. /*
  6942. var a = document.getElementById("net_0").value;
  6943. var b = document.getElementById("net_1").value;
  6944. var c = document.getElementById("net_2").value;
  6945. if((a==b)||(a==c)||(b==c))
  6946. {
  6947. alert("Server addresses cannot be same.Please fill different server address");
  6948. }
  6949. var setvalue = null;
  6950. for(jdx = 10;jdx<12;jdx++)
  6951. {
  6952. var z = document.getElementById("net_"+jdx);
  6953. if(setvalue == null)
  6954. setvalue = z.value;
  6955. else
  6956. setvalue += "|"+z.value;
  6957. }
  6958. setvalue = replaceall(setvalue,"/","-");
  6959. setvalue += "|"+a+"|"+b+"|"+c;
  6960. */
  6961. //alert("DT Called");
  6962. var a = document.getElementById("net_10").value;
  6963. var b = document.getElementById("net_11").value;
  6964. var setvalue = a+"|"+b;
  6965. //alert(setvalue);
  6966. doWork(setvalue,"apply_clock","systemConf");
  6967. }
  6968.  
  6969.  
  6970. function ip_val(obj)
  6971. {
  6972. //alert(obj.value+"---"+obj.title+"___"+obj.id+"__"+document.getElementById(Id));
  6973. var IPvalue = obj.value;
  6974. var Id = obj.id;
  6975. if(IPvalue == "0.0.0.0")
  6976. {
  6977. errorString = "";//errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  6978. }
  6979. else
  6980. {
  6981. var ip = IPvalue.split(".", 4);
  6982. val = IPvalue.indexOf("0");
  6983. if(ip[0] > 255 || ip[1] > 255 || ip[2] > 255 || ip[3] > 255)
  6984. {
  6985. // alert(Id);
  6986. document.getElementById(Id).style.border = "1px solid #FF0000";
  6987. document.getElementById("cross"+Id).style.display="inline";
  6988. document.getElementById(Id).name = "no";
  6989. return false;
  6990. }
  6991. errorString = "";
  6992. theName = "IPaddress";
  6993. var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
  6994. var ipArray = IPvalue.match(ipPattern);
  6995.  
  6996. if(ipArray == null)
  6997. errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
  6998. else
  6999. {
  7000. for (i = 0; i < 4; i++)
  7001. {
  7002. thisSegment = ipArray[i];
  7003. if(thisSegment > 255)
  7004. {
  7005. errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
  7006. i = 4;
  7007. }
  7008. if((i == 0) && (thisSegment > 255))
  7009. {
  7010. errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  7011. i = 4;
  7012. }
  7013. }
  7014. }
  7015. }
  7016. if(errorString == "")
  7017. {
  7018. document.getElementById(Id).style.color = "#000000";
  7019. document.getElementById(Id).name = "Right";
  7020. return true;
  7021. }
  7022. else
  7023. {
  7024. document.getElementById(Id).style.border = "1px solid #FF0000";
  7025. document.getElementById("cross"+Id).style.display="inline";
  7026. document.getElementById(Id).name = "no";
  7027. }
  7028. }
  7029.  
  7030. function sys_set(obj)
  7031. {
  7032. //alert(obj);
  7033. val = obj;
  7034. //alert(val);
  7035. doWork(val,"sys_set","systemConf");
  7036. }
  7037. function sysIPchange(obj)
  7038. {
  7039. //alert(obj.value+"---"+obj.id+"---");//+document.getElementById("hiddenShelfVal").value);
  7040. var IPvalue = obj.value;
  7041. var Id = obj.id;
  7042. if(IPvalue == "0.0.0.0")
  7043. errorString = "";//errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  7044. else
  7045. {
  7046. var ip = IPvalue.split(".", 4);
  7047. val = IPvalue.indexOf("0");
  7048. if(ip[0] > 255 || ip[1] > 255 || ip[2] > 255 || ip[3] > 255)
  7049. {
  7050. // alert(Id);
  7051. document.getElementById(Id).style.border = "1px solid #FF0000";
  7052. document.getElementById("cross"+Id).style.display="inline";
  7053. document.getElementById(Id).name = "no";
  7054. return false;
  7055. }
  7056. errorString = "";
  7057. theName = "IPaddress";
  7058. var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
  7059. var ipArray = IPvalue.match(ipPattern);
  7060.  
  7061. if(ipArray == null)
  7062. errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
  7063. else
  7064. {
  7065. for (i = 0; i < 4; i++)
  7066. {
  7067. thisSegment = ipArray[i];
  7068. if(thisSegment > 255)
  7069. {
  7070. errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
  7071. i = 4;
  7072. }
  7073. if((i == 0) && (thisSegment > 255))
  7074. {
  7075. errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
  7076. i = 4;
  7077. }
  7078. }
  7079. }
  7080. }
  7081. if(errorString == "")
  7082. {
  7083. document.getElementById(Id).style.border = "#d5d5d5";
  7084. document.getElementById(Id).name = "Right";
  7085. document.getElementById("cross"+Id).style.display="none";
  7086. return true;
  7087. }
  7088. else
  7089. {
  7090. document.getElementById(Id).style.border = "1px solid #FF0000";
  7091. document.getElementById("cross"+Id).style.display="inline";
  7092. document.getElementById(Id).name = "no";
  7093. }
  7094.  
  7095. }
  7096.  
  7097. function set_ip_conf()
  7098. {
  7099. //alert("Here in function set_ip_conf");
  7100. var val = '';
  7101. var k = '';
  7102. var priority0 = document.getElementById("prio0").value;
  7103. var priority1 = document.getElementById("prio1").value;
  7104. var priority2 = document.getElementById("prio2").value;
  7105. var priority3 = document.getElementById("prio3").value;
  7106. if((priority0 != priority1) && (priority0 != priority2) && (priority0 != priority3))
  7107. {
  7108. if((priority1 != priority2) && (priority1 != priority3))
  7109. {
  7110. if(priority2 != priority3)
  7111. {
  7112. k = priority0 + priority1 + priority2 + priority3;
  7113. }
  7114. else
  7115. {
  7116. alert("Clock Priority cannot contain same values");
  7117. return;
  7118. }
  7119. }
  7120. else
  7121. {
  7122. alert("Clock Priority cannot contain same values");
  7123. return;
  7124. }
  7125. }
  7126. else
  7127. {
  7128. alert("Clock Priority cannot contain same values");
  7129. return;
  7130. }
  7131. /*
  7132. for(i=0;i<4;i++)
  7133. {
  7134. k += document.getElementById("prio"+i).value;
  7135. }
  7136. */
  7137. document.getElementById("sys_10").value = k;
  7138. //alert(k);
  7139. for(i=1;i<=11; i++)
  7140. {
  7141. if(document.getElementById("sys_"+i).name == "no")
  7142. {
  7143. alert("The field marked red contains invalid value, Please enter correctly ");
  7144. return;
  7145. }
  7146. val += document.getElementById("sys_"+i).value;
  7147. val += "|";
  7148. }
  7149. // alert(document.getElementById("sys_9").value);
  7150. doWork(val,"ipCore_set","systemConf");
  7151. }
  7152.  
  7153. function showHome()
  7154. {
  7155. //alert("Here in function showHome()");
  7156. doWork(true,"show_home","systemConf");
  7157. }
  7158.  
  7159. function network_conf()
  7160. {
  7161. //alert("here in function network_conf()")
  7162. doWork(true,"network_conf","systemConf");
  7163. }
  7164. function set_network_conf()
  7165. {
  7166. if (confirm('WARNING !! Changing IP Address will stop all communicaton with the device, You need to reconnect the device with NEW IP. \n Are you sure to CONTINUE ???'))
  7167. {
  7168. // NSB :: Field Count is changed from 9 to 6, as Eth2 is removed
  7169. for(i=1;i<6;i++)
  7170. {
  7171. if(document.getElementById("net_"+i).name == "no")
  7172. {
  7173. alert("Please fill red marked values correctly");
  7174. return;
  7175. }
  7176. }
  7177. var val = '';
  7178. for(i=1;i<6;i++)
  7179. {
  7180. val += document.getElementById("net_"+i).value + "|";
  7181. }
  7182. doWork(val,"set_network_conf","systemConf");
  7183. }
  7184. }
  7185. //Till here
  7186. //Functions added for Vmail/IVR page
  7187. /*function ivr_levels()
  7188. {
  7189. alert("Here in function ivr_levels");
  7190. doWork(true,"ivr_levels","vmailIVRConf");
  7191. }
  7192. function fetch_IVR_level_value()
  7193. {
  7194. alert(document.getElementById("ivrL").value);
  7195. var level = document.getElementById("ivrL").value;
  7196. if(level != "Select")
  7197. {
  7198. doWork(level,"ivr_fetch_levels","vmailIVRConf");
  7199. }
  7200. }*/
  7201. function ivr_levels()
  7202. {
  7203. //alert("Here in function ivr_levels");
  7204. doWork(true,"ivr_fetch_levels","vmailIVRConf");
  7205. }
  7206. function editIvrLevel(obj)
  7207. {
  7208. //alert("here in editIvrLevel()"+obj);
  7209. //alert(document.getElementById("ivr1_0").innerText);
  7210. var element1 = document.getElementById("ivr1_"+obj);
  7211. var accessCode = (element1.innerText || element1.textContent).trim();
  7212. var element2 = document.getElementById("ivr2_"+obj);
  7213. var actionType = (element2.innerText || element2.textContent).trim();
  7214. var element3 = document.getElementById("ivr3_"+obj);
  7215. var fileName = (element3.innerText || element3.textContent).trim();
  7216. var element4 = document.getElementById("ivr4_"+obj);
  7217. var fileIndex = (element4.innerText || element4.textContent).trim();
  7218. var element5 = document.getElementById("ivr5_"+obj);
  7219. var userNumber = (element5.innerText || element5.textContent).trim();
  7220. var editMenu = '';
  7221. editMenu += '<div style="width:60%; height:60%; margin-top:80px;">';
  7222. editMenu += '<div style="width:100%; height:10%;font-size:20px;font-weight:bold;">IVR Level Configuration</div>';
  7223. editMenu += '<div style="width:100%;height:100%;">';
  7224. editMenu += '<table width="70%" height="70%" style="margin-top:2%;">';
  7225. editMenu += '<tbody>';
  7226. editMenu += '<tr>';
  7227. editMenu += '<td>IVR Level</td><td><input id="ivr_lvl" readonly style="width:50px;text-align:center;background-color:#C0C0C0;cursor:default;" type="text" value='+obj+'></td>';
  7228. editMenu += '</tr>';
  7229. editMenu += '<tr id="accessCodeTR">';
  7230. editMenu += '<td >Access Code</td><td><input id="access_code" style="width:50px;text-align:center;" type="text" onKeyPress="return checkIt(event)" value='+accessCode+'></td>';
  7231. editMenu += '</tr>';
  7232. editMenu += '<tr>';
  7233. editMenu += '<td>Action type</td>';
  7234. editMenu += '<td><select id="action_type" style="width:90px;" onchange="enaDisValues(this.value)">';
  7235. /* if(actionType != "-")
  7236. {
  7237. editMenu += '<option value="'+actionType+'" selected>'+actionType+'</option>';
  7238. }
  7239. else
  7240. {
  7241. editMenu += '<option selected>Select</option>';
  7242. }
  7243. */ editMenu += '<option >Select</option>';
  7244. editMenu += '<option value="NO_ACTION">NO_ACTION</option>';
  7245. editMenu += '<option value="FILE_PLAY">FILE_PLAY</option>';
  7246. editMenu += '<option value="SUBSCRIBER">SUBSCRIBER</option>';
  7247. editMenu += '<option value="HANGUP">HANGUP</option>';
  7248. editMenu += '<option value="MAIN_MENU">MAIN_MENU</option>';
  7249. editMenu += '<option value="PREV_MENU">PREV_MENU</option>';
  7250. editMenu += '<option value="LAST_PLAY">LAST_PLAY</option>';
  7251. editMenu += '<option value="START_RECORDING">START_RECORDING</option>';
  7252. editMenu += '<option value="VMAIL_ACCS">VMAIL_ACCS</option>';
  7253. editMenu += '<option value="DISABLE">DISABLE</option>';
  7254. editMenu += '</select></td>';
  7255. editMenu += '</tr>';
  7256.  
  7257. editMenu += '<tr id="fileNameTR" style="display:none;">'; //style="visibility: hidden;">';
  7258. editMenu += '<td>File Name</td><td><input id="ivrFileName" style="width:50px;text-align:center;" type="text" value='+fileName+'></td>';
  7259. editMenu += '</tr>';
  7260. /* editMenu += '<tr>';
  7261. editMenu += '<td>File Index</td><td><input id="ivrFileIndex" style="width:50px;text-align:center;" type="text" value='+fileIndex+'></td>';
  7262. editMenu += '</tr>';
  7263. */ editMenu += '<tr id="userNoTR" style="display:none;">';
  7264. editMenu += '<td>User Number</td><td><input id="ivrUserNum" style="width:50px;text-align:center;" type="text" value='+userNumber+'></td>';
  7265. editMenu += '</tr>';
  7266. editMenu += '<tr><td><input type="button" value="submit" onclick="updateIvrLevel()"/></td>';
  7267. editMenu += '<td><input type="button" value="cancel" onclick="close_ivr()"/></td></tr>';
  7268. editMenu += '</tbody>';
  7269. editMenu += '</table>';
  7270. editMenu += '</div>';
  7271. editMenu += '</div>';
  7272. document.getElementById("ivrAdd").innerHTML = editMenu;
  7273. document.getElementById("ivrAdd").style.display = "inline";
  7274. if(actionType != "-")
  7275. {
  7276. document.getElementById("action_type").value = actionType;
  7277. }
  7278. else
  7279. {
  7280. document.getElementById("action_type").value = "Select";
  7281. }
  7282. if(actionType == "FILE_PLAY")
  7283. {
  7284. //document.getElementById("ivrUserNum").readOnly = true;
  7285. document.getElementById("fileNameTR").style.display = "table-row" ;
  7286. }
  7287. else if(actionType == "SUBSCRIBER")
  7288. {
  7289. //document.getElementById("ivrFileName").readOnly = true;
  7290. //document.getElementById("ivrFileIndex").readOnly = true;
  7291. document.getElementById("userNoTR").style.display = "table-row";
  7292. }
  7293. else if(actionType == "DISABLE")
  7294. {
  7295. document.getElementById("access_code").readOnly = true;
  7296. document.getElementById("access_code").style.backgroundColor = "#C0C0C0";
  7297. document.getElementById("access_code").style.cursor = "default";
  7298. }
  7299. else
  7300. {
  7301. //document.getElementById("ivrUserNum").readOnly = true;
  7302. //document.getElementById("ivrFileName").readOnly = true;
  7303. //document.getElementById("ivrFileIndex").readOnly = true;
  7304. }
  7305.  
  7306. }
  7307. function enaDisValues(obj)
  7308. {
  7309. //alert("Here in enaDisValues()__"+obj);
  7310. if(obj == "FILE_PLAY")
  7311. {
  7312. //document.getElementById("ivrUserNum").readOnly = true;
  7313. //document.getElementById("ivrFileName").readOnly = false;
  7314. //document.getElementById("ivrFileIndex").readOnly = false;
  7315. document.getElementById("fileNameTR").style.display = "table-row";
  7316. document.getElementById("userNoTR").style.display = "none";
  7317. document.getElementById("access_code").readOnly = false;
  7318. document.getElementById("access_code").style.backgroundColor = "White";
  7319. document.getElementById("access_code").style.cursor = "initial";
  7320. }
  7321. else if(obj == "SUBSCRIBER")
  7322. {
  7323. //document.getElementById("ivrUserNum").readOnly = false;
  7324. //document.getElementById("ivrFileName").readOnly = true;
  7325. //document.getElementById("ivrFileIndex").readOnly = true;
  7326. document.getElementById("fileNameTR").style.display = "none";
  7327. document.getElementById("userNoTR").style.display = "table-row";
  7328. document.getElementById("access_code").readOnly = false;
  7329. document.getElementById("access_code").style.backgroundColor = "White";
  7330. document.getElementById("access_code").style.cursor = "initial";
  7331. }
  7332. else if(obj == "DISABLE")
  7333. {
  7334. document.getElementById("access_code").readOnly = true;
  7335. document.getElementById("access_code").style.backgroundColor = "#C0C0C0";
  7336. document.getElementById("access_code").style.cursor = "default";
  7337. document.getElementById("fileNameTR").style.display = "none";
  7338. document.getElementById("userNoTR").style.display = "none";
  7339. }
  7340. else
  7341. {
  7342. //document.getElementById("ivrUserNum").readOnly = true;
  7343. //document.getElementById("ivrFileName").readOnly = true;
  7344. //document.getElementById("ivrFileIndex").readOnly = true;
  7345. document.getElementById("fileNameTR").style.display = "none";
  7346. document.getElementById("userNoTR").style.display = "none";
  7347. document.getElementById("access_code").readOnly = false;
  7348. document.getElementById("access_code").style.backgroundColor = "White";
  7349. document.getElementById("access_code").style.cursor = "initial";
  7350. }
  7351. }
  7352. function close_ivr()
  7353. {
  7354. document.getElementById("ivrAdd").style.display = "none";
  7355. }
  7356. function updateIvrLevel()
  7357. {
  7358. //alert("Here in updateIvrLevel()");
  7359. var val='';
  7360. val += document.getElementById("ivr_lvl").value+"|";
  7361. val += document.getElementById("access_code").value+"|";
  7362. val += document.getElementById("action_type").value+"|";
  7363. val += document.getElementById("ivrFileName").value+"|";
  7364. //val += document.getElementById("ivrFileIndex").value+"|";
  7365. val += document.getElementById("ivrUserNum").value;
  7366. //alert(val);
  7367. doWork(val,"update_ivr_levels","vmailIVRConf");
  7368. }
  7369. function ivr_options()
  7370. {
  7371. alert("Here in function ivr_options");
  7372. }
  7373. function vmail_users()
  7374. {
  7375. //alert("Here in function vmail_users");
  7376. doWork(true,"vmail_users","vmailIVRConf");
  7377. }
  7378.  
  7379. function addUser()
  7380. {
  7381. //alert("Here in addUser");
  7382. doWork(true,"add_user","vmailIVRConf");
  7383. }
  7384. function addVmailUser()
  7385. {
  7386. //alert("Here in addVmailUser");
  7387. if(document.getElementById("ext_no").value == '')
  7388. {
  7389. alert("Please fill the extension no correctly.")
  7390. return;
  7391. }
  7392. var val= '';
  7393. val += document.getElementById("ext_no").value+"|";
  7394. val += document.getElementById("on_busy").value+"|";
  7395. val += document.getElementById("on_no_answer").value;
  7396. //alert(val);
  7397. doWork(val,"add_vmail_user","vmailIVRConf");
  7398. }
  7399. function vmailCheck(obj)
  7400. {
  7401. //alert(obj.id+"---"+obj.value+"---"+obj.checked);
  7402. var id = obj.id;
  7403. if(obj.checked == true)
  7404. {
  7405. document.getElementById(id).value = '1';
  7406. }
  7407. else
  7408. {
  7409. document.getElementById(id).value = '0';
  7410. }
  7411.  
  7412. }
  7413. function editVmailUser(obj)
  7414. {
  7415. var element1 = document.getElementById("user1_"+obj);
  7416. var extnNo = (element1.innerText || element1.textContent).trim();
  7417. var element2 = document.getElementById("user2_"+obj);
  7418. var onBusy = (element2.innerText || element2.textContent).trim();
  7419. var element3 = document.getElementById("user3_"+obj);
  7420. var onNoAns = (element3.innerText || element3.textContent).trim();
  7421. //alert("Here in editVmailUser__"+obj+"___"+extnNo+"____"+onBusy+"____"+onNoAns);
  7422. var editData = '';
  7423. editData += '<div style="margin-top:50px;">';
  7424. editData += '<table width="40% border="1">';
  7425. editData += '<tr><td colspan="2" style="text-align:center;font-weight:bold;font-size:14px;">Edit Vmail User</td></tr>';
  7426. editData += '<tr><td>&nbsp</td></tr>';
  7427. editData += '<tr><td>Extension No</td><td>'+extnNo+'</td>';
  7428. editData += '<tr><td>On Busy</td>';
  7429. if(onBusy == "No")
  7430. editData += '<td><input type="checkbox" id="valOnBusy" value="0" unchecked onclick="changeVal(this)"></td>';
  7431. else
  7432. editData += '<td><input type="checkbox" id="valOnBusy" value="1" checked onclick="changeVal(this)"></td>';
  7433. editData += '</tr>';
  7434.  
  7435. editData += '<tr><td>On No Answer</td>';
  7436. if(onNoAns == "No")
  7437. editData += '<td><input type="checkbox" id="valOnAns" value="0" unchecked onclick="changeVal(this)"></td>';
  7438. else
  7439. editData += '<td><input type="checkbox" id="valOnAns" value="1" checked onclick="changeVal(this)"></td>';
  7440. editData += '</tr>';
  7441. editData += '<tr><td>&nbsp;</td></tr>';
  7442. editData += '<tr><td><input type="button" value="Update" onclick="updateUser('+extnNo+')"></td><td><input type="button" value="Cancel" onclick="vmail_users()"></td></tr>';
  7443. editData += '</table>';
  7444. editData += '</div>';
  7445. document.getElementById('tab_data').innerHTML = editData;
  7446. }
  7447. function changeVal(obj)
  7448. {
  7449. //alert(obj.id+"__"+obj.value+"__"+obj.checked);
  7450. if(obj.checked == true)
  7451. document.getElementById(obj.id).value = '1';
  7452. else
  7453. document.getElementById(obj.id).value = '0';
  7454. }
  7455. function updateUser(val)
  7456. {
  7457. //alert(val);
  7458. var updateVal = '';
  7459. updateVal += val+"|";
  7460. updateVal += document.getElementById("valOnBusy").value+"|";
  7461. updateVal += document.getElementById("valOnAns").value;
  7462. //alert(updateVal);
  7463. doWork(updateVal,"update_vmail_user","vmailIVRConf");
  7464. }
  7465. function deleteVmailUser(obj)
  7466. {
  7467. //alert("Here in deleteVmailUser");
  7468. var element = document.getElementById("user1_"+obj);
  7469. var extnNo = (element.innerText || element.textContent).trim();
  7470. //alert(extnNo);
  7471. doWork(extnNo,"delete_vmail_user","vmailIVRConf");
  7472. }
  7473. function vmail_options()
  7474. {
  7475. //alert("Here in function vmail_options");
  7476. }
  7477. function vmail_prompts()
  7478. {
  7479. //alert("Here in function vmail_prompts");
  7480. doWork(true,"vmail_prompts","vmailConf");
  7481. }
  7482. function hide_add_bgrp()
  7483. {
  7484. rfr_sid_fetch_bgrp();
  7485. }
  7486.  
  7487. function updateVmailPrompts(obj,objPrevName)
  7488. {
  7489. //alert("updateVmailPrompts()" + obj);
  7490. var id = obj.id;
  7491. var newFileName = document.getElementById(id).files[0].name;
  7492.  
  7493. var idArr = id.split('-');
  7494. var prevFileName = objPrevName;
  7495.  
  7496. //alert(newFileName+"____"+prevFileName);
  7497. var idNum = idArr[0].split('_');
  7498.  
  7499.  
  7500.  
  7501. {
  7502. document.getElementById("updateVmailButton_"+idNum[1]).disabled = false;
  7503. alert("New File Selected, Click on UPDATE to Upload the FILE");
  7504. }
  7505.  
  7506. }
  7507.  
  7508.  
  7509. function updateVmailPrompts1(obj)
  7510. {
  7511. alert("updateVmailPrompts()" + obj.id);
  7512. alert("File Selected = " + document.getElementById(obj.id).files[0].name);
  7513. }
  7514.  
  7515.  
  7516. function BackupAll()
  7517. {
  7518.  
  7519. doWork(true,'get_backup_name','search');
  7520.  
  7521. }
  7522.  
  7523. function get_backup()
  7524. {
  7525. //alert("i am here");
  7526. //alert(document.getElementById("number").value);
  7527. //var file_name = document.getElementById("number").value;
  7528.  
  7529. if(document.getElementById("number").value)
  7530. {
  7531. var file_name = document.getElementById("number").value;
  7532. var val = file_name+".tar.gz";
  7533. //alert(val);
  7534. doWork(val,'BackupAll','search');
  7535.  
  7536. }
  7537. else
  7538. info_notify("No Value Entered!");
  7539. }
  7540.  
  7541. function export_backup()
  7542. {
  7543.  
  7544. doWork(true,'export_backup','search');
  7545.  
  7546. }
  7547. function RestoreAll()
  7548. {
  7549.  
  7550. doWork(true,'get_restore_name','search');
  7551.  
  7552. }
  7553.  
  7554. function get_restore()
  7555. {
  7556. //alert("i am here");
  7557. //alert(document.getElementById("number").value);
  7558. //var file_name = document.getElementById("number").value;
  7559.  
  7560. if(document.getElementById("number").value)
  7561. {
  7562. var file_name = document.getElementById("number").value;
  7563. var val = file_name+".tar.gz";
  7564. //alert(val);
  7565. doWork(val,'RestoreAll','search');
  7566.  
  7567. }
  7568. else
  7569. info_notify("No Value Entered!");
  7570. }
  7571.  
  7572. function getKtsNumber()
  7573. {
  7574.  
  7575. doWork(true,'getKtsNum','search');
  7576.  
  7577. }
  7578.  
  7579. function change_in_master(cardnum)
  7580. {
  7581. val=+cardnum;
  7582. doWork(val,'change_in_master','search');
  7583.  
  7584. }
  7585.  
  7586. function change_in_slave(cardnum)
  7587. {
  7588. val=+cardnum;
  7589. doWork(val,'change_in_slave','search');
  7590.  
  7591. }
  7592.  
  7593. function set_time_zone()
  7594. {
  7595. var a = document.getElementById("selecttimezone").value;
  7596. var b = document.getElementById("net_10").value;
  7597. var c = document.getElementById("net_11").value;
  7598. if(a =="please select timezone")
  7599.  
  7600. {
  7601. alert("please select timezone");
  7602. }
  7603.  
  7604. var timezone = a.split("(");
  7605. alert(timezone[1]);
  7606. var setvalue = b+"|"+c+"|"+timezone[1];
  7607.  
  7608.  
  7609. doWork(setvalue,"apply_timezone","systemConf");
  7610.  
  7611. }
  7612. function nsb_soft_reset_card(obj)
  7613. {
  7614. val=+obj
  7615. var ret=confirm("WARNING! CARD RESTART MAY DROP RUNNING CALLS of SYSTEM. \n Are you sure to Proceed! ?? ");
  7616. if (ret==true)
  7617. {
  7618. doWork(val,'soft_reset_card','search');
  7619. }
  7620. }
  7621.  
  7622. function acd_login()
  7623. {
  7624.  
  7625. var c = document.getElementById("port_num1").value;
  7626.  
  7627. doWork(c,'acd_login','search');
  7628.  
  7629. }
  7630.  
  7631. function acd_logout()
  7632. {
  7633. var c = document.getElementById("port_num1").value;
  7634.  
  7635. doWork(c,'acd_logout','search');
  7636.  
  7637. }
  7638.  
  7639. function change_db(obj)
  7640. {
  7641. var val=+obj
  7642. db = document.getElementById("db_"+ val).value;
  7643. var setvalue = val+"|"+db;
  7644. //alert(setvalue);
  7645. doWork(setvalue,'change_database','search');
  7646. }
  7647.  
  7648. function displaycdr()
  7649. {
  7650.  
  7651. doWork(true,'display_cdr','search');
  7652.  
  7653. }
  7654.  
  7655.  
  7656. function sip_trunk_show()
  7657. {
  7658. var hintnum = "";
  7659. var type = "sip-trk";
  7660. var num_type = 3;
  7661. var pass = hintnum+"|"+type+"|"+num_type;
  7662. doWork(pass,'get_nums','search');
  7663. }
  7664.  
  7665. function sip_ext_show()
  7666. {
  7667. var hintnum = "";
  7668. var type = "sip-ext";
  7669. var num_type = "3";
  7670. var pass = hintnum+"|"+type+"|"+num_type;
  7671. doWork(pass,'get_nums','search');
  7672. }
  7673.  
  7674. function modify_sipnum()
  7675. {
  7676. document.getElementById("addwin").style.display = "none";
  7677. document.getElementById("delwin").style.display = "none";
  7678. document.getElementById("modifywin").style.display = "inline";
  7679. }
  7680.  
  7681. function delete_sipnum()
  7682. {
  7683. document.getElementById("addwin").style.display = "none";
  7684. document.getElementById("modifywin").style.display = "none";
  7685. document.getElementById("delwin").style.display = "inline";
  7686. }
  7687. function add_sipnum()
  7688. {
  7689. document.getElementById("delwin").style.display = "none";
  7690. document.getElementById("modifywin").style.display = "none";
  7691. document.getElementById("addwin").style.display = "inline";
  7692. }
  7693.  
  7694. function cancel_tab()
  7695. {
  7696. document.getElementById("delwin").style.display = "none";
  7697. document.getElementById("modifywin").style.display = "none";
  7698. document.getElementById("addwin").style.display = "none";
  7699.  
  7700. }
  7701.  
  7702.  
  7703. function modify_sip_num(data)
  7704. {
  7705. var temp = "";
  7706. var obj= 3;
  7707. var subusrtyp = "SIP";
  7708.  
  7709. if(data == "sip-trk")
  7710. {
  7711. //alert("in sip trunk");
  7712. var id ="sip-trk";
  7713. var usrtyp ="TRK";
  7714. }
  7715. else
  7716. {
  7717. //alert("in sip ext");
  7718. var id ="sip-ext";
  7719. var usrtyp = "EXT";
  7720.  
  7721. }
  7722.  
  7723. var start = document.getElementById("md_ser_start").value;
  7724. var end = document.getElementById("md_ser_end").value;
  7725. var startnew = document.getElementById("strt_new_ser").value;
  7726. if(start == "")
  7727. {
  7728. alert("Start Number is mandatory!");
  7729. return;
  7730. //doWork(obj,"add-mod-del","feat");
  7731. }
  7732. else if(end && start > end)
  7733. {
  7734. alert("Start value should be smaller than End value!");
  7735. return;
  7736. //doWork(obj,"add-mod-del","feat");
  7737. }
  7738. else if((end - start) > 50)
  7739. {
  7740. alert("Max Range is 50!");
  7741. return;
  7742. //doWork(obj,"add-mod-del","feat");
  7743. }
  7744. else
  7745. {
  7746. var value = escape(obj+"|"+start+"|"+end+"|"+startnew+"|"+temp+"|"+id);
  7747. //alert(value);
  7748. doWork(value,"doit","feat");
  7749. }
  7750.  
  7751. }
  7752.  
  7753. function add_sip_num(data)
  7754. {
  7755. var obj= 1;
  7756. var subusrtyp = "SIP";
  7757.  
  7758. if(data == "sip-trk")
  7759. {
  7760. //alert("in sip trunk");
  7761. var id ="sip-trk";
  7762. var usrtyp ="TRK";
  7763. }
  7764. else
  7765. {
  7766. //alert("in sip ext");
  7767. var id ="sip-ext";
  7768. var usrtyp = "EXT";
  7769.  
  7770. }
  7771.  
  7772. var start = document.getElementById("start").value;
  7773. var end = document.getElementById("end").value;
  7774. if(start == "")
  7775. {
  7776. alert("Start Number is mandatory!");
  7777. return;
  7778. //doWork(obj,"add-mod-del","feat");
  7779. }
  7780. else if(end && start > end)
  7781. {
  7782. alert("Start value should be smaller than End value!");
  7783. return;
  7784. //doWork(obj,"add-mod-del","feat");
  7785. }
  7786. else if(usrtyp == "-1" || subusrtyp == "-1")
  7787. {
  7788. alert("Filling all fields is mandatory!");
  7789. return;
  7790. //doWork(obj,"add-mod-del","feat");
  7791. }
  7792. else
  7793. {
  7794. var value = (obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end+"|"+id);
  7795. //alert(value);
  7796. doWork(value,"doit","feat");
  7797. }
  7798.  
  7799.  
  7800. }
  7801.  
  7802. function del_sip_num(data)
  7803. {
  7804. var obj= 2;
  7805. var subusrtyp = "SIP";
  7806.  
  7807. if(data == "sip-trk")
  7808. {
  7809. //alert("in sip trunk");
  7810. var id ="sip-trk";
  7811. var usrtyp ="TRK";
  7812. }
  7813. else
  7814. {
  7815. //alert("in sip ext");
  7816. var id ="sip-ext";
  7817. var usrtyp = "EXT";
  7818.  
  7819. }
  7820. var start = document.getElementById("md_ser_start1").value;
  7821. var end = document.getElementById("md_ser_end1").value;
  7822. if(start == "")
  7823. {
  7824. alert("Start Number is mandatory!");
  7825. return;
  7826. //doWork(obj,"add-mod-del","feat");
  7827. }
  7828. else if(end && start > end)
  7829. {
  7830. alert("Start value should be smaller than End value!");
  7831. return;
  7832. //doWork(obj,"add-mod-del","feat");
  7833. }
  7834. else if(usrtyp == "-1" || subusrtyp == "-1")
  7835. {
  7836. alert("Filling all fields is mandatory!");
  7837. return;
  7838. //doWork(obj,"add-mod-del","feat");
  7839. }
  7840. else
  7841. {
  7842. var value = obj+"|"+usrtyp+"|"+subusrtyp+"|"+start+"|"+end+"|"+id;
  7843. //alert(value);
  7844. doWork(value,"doit","feat");
  7845. }
  7846.  
  7847. }
  7848.  
  7849. function modify_card_num(data)
  7850. {
  7851. var id = "Trk";
  7852. var pass = data+"^"+id;
  7853. var value = data.split("^");
  7854. var temp = "";
  7855. var obj= 3;
  7856. var subusrtyp = "SIP";
  7857. var start = document.getElementById("md_ser_start").value;
  7858. var end = document.getElementById("md_ser_end").value;
  7859. var startnew = document.getElementById("strt_new_ser").value;
  7860. if(start == "")
  7861. {
  7862. alert("Start Number is mandatory!");
  7863. return;
  7864. //doWork(obj,"add-mod-del","feat");
  7865. }
  7866. else if(end && start > end)
  7867. {
  7868. alert("Start value should be smaller than End value!");
  7869. return;
  7870. //doWork(obj,"add-mod-del","feat");
  7871. }
  7872. else
  7873. {
  7874. var value = escape(obj+"|"+start+"|"+end+"|"+startnew+"|"+temp+"|"+pass);
  7875. //alert(value);
  7876. doWork(value,"doit","feat");
  7877. }
  7878.  
  7879.  
  7880. }
  7881.  
  7882.  
  7883. function upload_snd()
  7884. {
  7885.  
  7886. doWork(true,'upload_music','search');
  7887.  
  7888. }
  7889.  
  7890. function updatemusic(obj,objPrevName)
  7891. {
  7892. //alert("updateVmailPrompts()" + obj);
  7893. var id = obj.id;
  7894. //alert(id);
  7895. var newFileName = document.getElementById(id).files[0].name;
  7896. //alert(newFileName);
  7897. var prevFileName = objPrevName;
  7898. //alert(prevFileName);
  7899.  
  7900. if(id == "moh2")
  7901. {
  7902.  
  7903. document.getElementById("update_moh").disabled = false;
  7904. alert("New File Selected, Click on UPDATE to Upload the FILE");
  7905.  
  7906. }
  7907. else if(id == "rbt_1")
  7908. {
  7909. document.getElementById("update_rbt").disabled = false;
  7910. alert("New File Selected, Click on UPDATE to Upload the FILE");
  7911.  
  7912.  
  7913. }
  7914. else if(id == "dtm2")
  7915. {
  7916. document.getElementById("update_dt_musc").disabled = false;
  7917. alert("New File Selected, Click on UPDATE to Upload the FILE");
  7918. }
  7919. else
  7920. {
  7921. document.getElementById("update_musc").disabled = false;
  7922. alert("New File Selected, Click on UPDATE to Upload the FILE");
  7923. }
  7924. }
  7925.  
  7926.  
  7927. function bulk_prog(obj)
  7928. {
  7929. if(obj >= 16 && obj <= 31)
  7930. {
  7931. document.getElementById("delwin").style.display = "none";
  7932. document.getElementById("modifywin").style.display = "none";
  7933. document.getElementById("addwin").style.display = "inline";
  7934. }
  7935. else
  7936. {
  7937.  
  7938. document.getElementById("delwin").style.display = "inline";
  7939. document.getElementById("modifywin").style.display = "none";
  7940. document.getElementById("addwin").style.display = "none";
  7941. }
  7942.  
  7943. }
  7944.  
  7945.  
  7946. function display_submenu()
  7947. {
  7948. var data = document.getElementById("selct_prop").value;
  7949. if(data == "Select")
  7950. {
  7951. alert("please select valid option");
  7952.  
  7953. }
  7954. switch(data)
  7955. {
  7956. case "Active":
  7957. document.getElementById("select_me").style.display = "inline";
  7958. document.getElementById("textme").style.display = "none";
  7959. document.getElementById("select_lvl").value = "select";
  7960. document.getElementById("select_lvl").style.display = "none";
  7961. break;
  7962. case "Dialing Rights Day":
  7963. document.getElementById("select_lvl").style.display = "inline";
  7964. document.getElementById("select_me").style.display = "none";
  7965. document.getElementById("textme").style.display = "none";
  7966. break;
  7967. case "Dialing Rights Night":
  7968. document.getElementById("select_lvl").style.display = "inline";
  7969. document.getElementById("select_me").style.display = "none";
  7970. document.getElementById("textme").style.display = "none";
  7971. break;
  7972. case "PCOS":
  7973. document.getElementById("textme").style.display = "inline";
  7974. document.getElementById("select_me").style.display = "none";
  7975. document.getElementById("select_lvl").value = "select";
  7976. document.getElementById("select_lvl").style.display = "none";
  7977. break;
  7978. case "SCOS":
  7979. document.getElementById("textme").style.display = "inline";
  7980. document.getElementById("select_me").style.display = "none";
  7981. document.getElementById("select_lvl").value = "select";
  7982. document.getElementById("select_lvl").style.display = "none";
  7983. break;
  7984. case "Call Waiting":
  7985. document.getElementById("select_me").style.display = "inline";
  7986. document.getElementById("textme").style.display = "none";
  7987. document.getElementById("select_lvl").value = "select";
  7988. document.getElementById("select_lvl").style.display = "none";
  7989. break;
  7990. case "Hot Line":
  7991. document.getElementById("select_me").style.display = "inline";
  7992. document.getElementById("textme").style.display = "none";
  7993. document.getElementById("select_lvl").value = "select";
  7994. document.getElementById("select_lvl").style.display = "none";
  7995. case "Second Trunk Selection Rights":
  7996. document.getElementById("select_me").style.display = "inline";
  7997. document.getElementById("textme").style.display = "none";
  7998. document.getElementById("select_lvl").style.display = "none";
  7999. break;
  8000. case "Enable * key as On Off hook":
  8001. document.getElementById("select_me").style.display = "inline";
  8002. document.getElementById("textme").style.display = "none";
  8003. document.getElementById("select_lvl").value = "select";
  8004. document.getElementById("select_lvl").style.display = "none";
  8005. break;
  8006. case "BackGround Music":
  8007. document.getElementById("select_me").style.display = "inline";
  8008. document.getElementById("textme").style.display = "none";
  8009. document.getElementById("select_lvl").value = "select";
  8010. document.getElementById("select_lvl").style.display = "none";
  8011. break;
  8012. case "Send CLI On Out Calls":
  8013. document.getElementById("select_me").style.display = "inline";
  8014. document.getElementById("textme").style.display = "none";
  8015. document.getElementById("select_lvl").value = "select";
  8016. document.getElementById("select_lvl").style.display = "none";
  8017. break;
  8018. case "Day Mode":
  8019. document.getElementById("select_me").style.display = "none";
  8020. document.getElementById("textme").style.display = "none";
  8021. document.getElementById("select_dnmode").value = "select";
  8022. document.getElementById("select_dnmode").style.display = "inline";
  8023. break;
  8024. case "Night Mode":
  8025. document.getElementById("select_me").style.display = "none";
  8026. document.getElementById("textme").style.display = "none";
  8027. document.getElementById("select_dnmode").value = "select";
  8028. document.getElementById("select_dnmode").style.display = "inline";
  8029. break;
  8030.  
  8031. }
  8032.  
  8033. }
  8034.  
  8035. function display_trk_submenu()
  8036. {
  8037. var data = document.getElementById("selct_trk_prop").value;
  8038. if(data == "Select")
  8039. {
  8040. alert("please select valid option");
  8041.  
  8042. }
  8043. switch(data)
  8044. {
  8045. case "Active":
  8046. document.getElementById("trk_select_me").style.display = "inline";
  8047. document.getElementById("trk_textme").style.display = "none";
  8048. document.getElementById("select_dnmode").value = "Select";
  8049. document.getElementById("select_dnmode").style.display = "none";
  8050. document.getElementById("destnum_text").style.display = "none";
  8051. break;
  8052. case "Day Mode":
  8053. document.getElementById("trk_select_me").style.display = "none";
  8054. document.getElementById("trk_textme").style.display = "none";
  8055. document.getElementById("select_dnmode").value = "Select";
  8056. document.getElementById("select_dnmode").style.display = "inline";
  8057. document.getElementById("destnum_text").style.display = "none";
  8058. break;
  8059. case "Night Mode":
  8060. document.getElementById("trk_select_me").style.display = "none";
  8061. document.getElementById("trk_textme").style.display = "none";
  8062. document.getElementById("select_dnmode").value = "Select";
  8063. document.getElementById("select_dnmode").style.display = "inline";
  8064. document.getElementById("destnum_text").style.display = "none";
  8065. break;
  8066. case "PCOS":
  8067. document.getElementById("trk_select_me").style.display = "none";
  8068. document.getElementById("trk_textme").style.display = "inline";
  8069. document.getElementById("select_dnmode").value = "Select";
  8070. document.getElementById("select_dnmode").style.display = "none";
  8071. document.getElementById("destnum_text").style.display = "none";
  8072. break;
  8073. case "SCOS":
  8074. document.getElementById("trk_select_me").style.display = "none";
  8075. document.getElementById("trk_textme").style.display = "inline";
  8076. document.getElementById("select_dnmode").value = "Select";
  8077. document.getElementById("select_dnmode").style.display = "none";
  8078. document.getElementById("destnum_text").style.display = "none";
  8079. break;
  8080. case "DID Group":
  8081. document.getElementById("trk_select_me").style.display = "none";
  8082. document.getElementById("trk_textme").style.display = "inline";
  8083. document.getElementById("select_dnmode").value = "Select";
  8084. document.getElementById("select_dnmode").style.display = "none";
  8085. break;
  8086. case "DOD Group":
  8087. document.getElementById("trk_select_me").style.display = "none";
  8088. document.getElementById("trk_textme").style.display = "inline";
  8089. document.getElementById("select_dnmode").value = "Select";
  8090. document.getElementById("select_dnmode").style.display = "none";
  8091. break;
  8092. case "Silent Dialing":
  8093. document.getElementById("trk_select_me").style.display = "inline";
  8094. document.getElementById("trk_textme").style.display = "none";
  8095. document.getElementById("select_dnmode").value = "Select";
  8096. document.getElementById("select_dnmode").style.display = "none";
  8097. break;
  8098. case "ISD Redial":
  8099. document.getElementById("trk_select_me").style.display = "inline";
  8100. document.getElementById("trk_textme").style.display = "none";
  8101. document.getElementById("select_dnmode").value = "Select";
  8102. document.getElementById("select_dnmode").style.display = "none";
  8103. document.getElementById("destnum_text").style.display = "none";
  8104. break;
  8105. case "Local Redial":
  8106. document.getElementById("trk_select_me").style.display = "inline";
  8107. document.getElementById("trk_textme").style.display = "none";
  8108. document.getElementById("select_dnmode").value = "Select";
  8109. document.getElementById("select_dnmode").style.display = "none";
  8110. document.getElementById("destnum_text").style.display = "none";
  8111. break;
  8112. case "STD Redial":
  8113. document.getElementById("trk_select_me").style.display = "inline";
  8114. document.getElementById("trk_textme").style.display = "none";
  8115. document.getElementById("select_dnmode").value = "Select";
  8116. document.getElementById("select_dnmode").style.display = "none";
  8117. document.getElementById("destnum_text").style.display = "none";
  8118. break;
  8119.  
  8120. }
  8121.  
  8122. }
  8123.  
  8124. function display_childmenu()
  8125. {
  8126. var data = document.getElementById("select_dnmode").value;
  8127.  
  8128. if(data == "Select")
  8129. {
  8130. alert("please select valid option");
  8131.  
  8132. }
  8133. switch(data)
  8134. {
  8135. case "3":
  8136. document.getElementById("destnum_text").style.display = "inline";
  8137. break;
  8138. case "4":
  8139. document.getElementById("destnum_text").style.display = "inline";
  8140. break;
  8141. }
  8142. }
  8143.  
  8144. function modify_ext_prop(obj)
  8145. {
  8146. var prop = document.getElementById("selct_prop").value;
  8147. var start = document.getElementById("ser_strt").value;
  8148. var end = document.getElementById("ser_end").value;
  8149. var action = document.getElementById("select_me").value;
  8150. var lvl = document.getElementById("select_lvl").value;
  8151. var txt = document.getElementById("textme").value;
  8152. var hint = document.getElementById("select_dnmode").value;
  8153. if(start == "" || end == "")
  8154. {
  8155. alert("Please fill number range !!!");
  8156. }
  8157. else if( prop == "Select" && action == "Select")
  8158. {
  8159. alert("Please select valid property and its action !!!");
  8160. }
  8161. else
  8162. {
  8163. var value = start+"|"+end+"|"+prop+"|"+action+"|"+lvl+"|"+txt;
  8164. value = value+"/"+obj;
  8165. doWork(value,'modify_ext_prop','search');
  8166. }
  8167. }
  8168. function modify_trk_prop(obj)
  8169. {
  8170. var prop = document.getElementById("selct_trk_prop").value;
  8171. var start = document.getElementById("trk_ser_strt").value;
  8172. var end = document.getElementById("trk_ser_end").value;
  8173. var action = document.getElementById("trk_select_me").value;
  8174. var lvl = document.getElementById("select_dnmode").value;
  8175. var txt = document.getElementById("trk_textme").value;
  8176. var txt1 = document.getElementById("destnum_text").value
  8177. var hint = document.getElementById("select_dnmode").value;
  8178. if(start == "" || end == "")
  8179. {
  8180. alert("Please fill number range !!!");
  8181. }
  8182. else if( prop == "Select" && action == "Select")
  8183. {
  8184. alert("Please select valid property and its action !!!");
  8185. }
  8186. else if(txt < 0 && txt > 127)
  8187. {
  8188. alert("Please select between 0 - 127 !!!");
  8189. }
  8190.  
  8191. else
  8192. {
  8193. var value = start+"|"+end+"|"+prop+"|"+action+"|"+lvl+"|"+txt+"|"+hint+"|"+txt1;
  8194. value = value+"/"+obj;
  8195. doWork(value,'modify_trk_prop','search');
  8196.  
  8197. }
  8198. }
  8199.  
  8200. function get_propsipext(data)
  8201. {
  8202. var elementExists = document.getElementById("nsb_div_port");
  8203. if(elementExists)
  8204. document.getElementById("nsb_div_port").style.display = "inline";
  8205. var elementExists = document.getElementById("nsb_div_cardD");
  8206. if(elementExists)
  8207. document.getElementById("nsb_div_cardD").style.display = "inline";
  8208. var port = (data).split("^");
  8209. document.getElementById("number").value = port[0];
  8210. doWork(data,"getsipext","search");
  8211. }
  8212.  
  8213.  
  8214. function rfr_sip_ext(sipnum)
  8215. {
  8216. var data = null;
  8217. data = document.getElementById("number").value;
  8218. doWork(data,"getsipext","search");
  8219. }
  8220. function rfr_sip_ext1(sipnum)
  8221. {
  8222. var data = null;
  8223. data = sipnum;
  8224. doWork(data,"getsipext","search");
  8225. }
  8226.  
  8227.  
  8228. function updatsipext()
  8229. {
  8230. var data = null;
  8231. data = document.getElementById("number").value;
  8232. var all_values = null;
  8233. //doWork("ASDWERGF","set_ext","search");
  8234. var err_flag = 0;
  8235. var all_values = null;
  8236. for(jdx = 1; jdx < 68; jdx++)
  8237. {
  8238. var ele = document.getElementById("ext_"+jdx);
  8239. //alert("NAME="+ele.value+"__"+jdx);
  8240. var name = (ele.name).split(",");
  8241. if(name[1] == "changed")
  8242. {
  8243. switch(name[0])
  8244. {
  8245. case "chk":
  8246. {
  8247. //alert(ele.value+"__"+ele.type+"__"+jdx);
  8248. if(all_values == null)
  8249. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  8250. else
  8251. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  8252. //alert(all_values);
  8253.  
  8254. break;
  8255. }
  8256. case "txt":
  8257. {
  8258. //alert(all_values);
  8259. if(name[1] == "changed")
  8260. {
  8261. if(all_values == null)
  8262. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8263. else
  8264. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8265. //alert(all_values);
  8266. break;
  8267. }
  8268. else
  8269. break;
  8270. }
  8271. case "ssss":
  8272. {
  8273. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8274. var ele2 = document.getElementById("ext_"+jdx+"_b");
  8275. if(ele.title != ele.value || ele1.title != ele1.value || ele2.title != ele2.value)
  8276. if(all_values == null)
  8277. all_values = (ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8278. else
  8279. all_values = all_values+":"+(ele.value+"'"+ele1.options[ele1.selectedIndex].text+"'"+ele2.options[ele2.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8280. //alert(all_values);
  8281. break;
  8282. }
  8283. case "cti":
  8284. {
  8285. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8286. //alert(ele.checked)
  8287. if(!ele.checked)
  8288. {
  8289. if(all_values == null)
  8290. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8291. else
  8292. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8293. //alert(all_values);
  8294. }
  8295. else if(ele1.title != ele1.value && ele.checked)
  8296. {
  8297. if(ele1.value == data && !err_flag)
  8298. {
  8299. alert("Cannot forward calls to self!");
  8300. err_flag = 1;
  8301. }
  8302. else
  8303. {
  8304. if(all_values == null)
  8305. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8306. else
  8307. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8308. }
  8309. }
  8310. break;
  8311. }
  8312. case "cte":
  8313. {
  8314. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8315. //alert(ele.checked)
  8316. if(!ele.checked)
  8317. {
  8318. if(all_values == null)
  8319. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8320. else
  8321. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8322. //alert(all_values);
  8323. }
  8324. else if(ele1.title != ele1.value && ele.checked)
  8325. {
  8326. if(ele1.value == data && !err_flag)
  8327. {
  8328. alert("Cannot forward calls to self!");
  8329. err_flag = 1;
  8330. }
  8331. else
  8332. {
  8333. if(all_values == null)
  8334. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8335. else
  8336. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8337. }
  8338. }
  8339. break;
  8340. }
  8341. case "df":
  8342. {
  8343. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8344. //alert(ele.checked)
  8345. if(!ele.checked)
  8346. {
  8347. if(all_values == null)
  8348. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8349. else
  8350. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8351. //alert(all_values);
  8352. }
  8353. else if(ele1.title != ele1.value && ele.checked)
  8354. {
  8355. if(ele1.value == data && !err_flag)
  8356. {
  8357. alert("Cannot forward calls to self!");
  8358. err_flag = 1;
  8359. }
  8360. else
  8361. {
  8362. if(all_values == null)
  8363. all_values = (ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8364. else
  8365. all_values += ":"+(ele.checked+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8366. }
  8367. }
  8368. break;
  8369. }
  8370. case "slctlevel":
  8371. {
  8372. if(jdx == 18)
  8373. ele1 = document.getElementById("ext_"+(jdx+1));
  8374. else if(jdx == 19)
  8375. ele1 = document.getElementById("ext_"+(jdx-1));
  8376.  
  8377. if(name[1] == "changed" && (jdx == 18 || jdx == 19))
  8378. {
  8379. if(all_values == null)
  8380. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8381. else
  8382. all_values += ":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8383. //alert(all_values);
  8384. }
  8385. else if(name[1] == "changed")
  8386. {
  8387. if(all_values == null)
  8388. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8389. else
  8390. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8391. }
  8392. break;
  8393. }
  8394. case "slctpcos":
  8395. {
  8396. if(name[1] == "changed")
  8397. {
  8398. if(all_values == null)
  8399. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8400. else
  8401. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8402. break;
  8403. }
  8404. else
  8405. break;
  8406. }
  8407. case "slctscos":
  8408. {
  8409. if(name[1] == "changed")
  8410. {
  8411. if(all_values == null)
  8412. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8413. else
  8414. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8415. break;
  8416. }
  8417. else
  8418. break;
  8419. }
  8420. case "slctdept":
  8421. {
  8422. //alert(name[1]);
  8423. if(name[1] == "changed")
  8424. {
  8425. if(all_values == null)
  8426. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8427. else
  8428. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8429. break;
  8430. }
  8431. else
  8432. break;
  8433. }
  8434. case "slcttnt":
  8435. {
  8436. if(name[1] == "changed")
  8437. {
  8438. if(all_values == null)
  8439. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8440. else
  8441. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8442. break;
  8443. }
  8444. else
  8445. break;
  8446. }
  8447. case "hotln":
  8448. {
  8449. if(name[1] == "changed")
  8450. {
  8451. switch(ele.value)
  8452. {
  8453. case "None":
  8454. {
  8455. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8456. if(all_values == null)
  8457. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8458. else
  8459. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8460. break;
  8461. }
  8462. case "Immediate":
  8463. {
  8464. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8465. //if(ele1.title != ele1.value)
  8466. // {
  8467. if(all_values == null)
  8468. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8469. else
  8470. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8471. // break;
  8472. // }
  8473. //else
  8474. break;
  8475. }
  8476. case "Delayed":
  8477. {
  8478. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8479. //if(ele1.title != ele1.value)
  8480. //{
  8481. if(all_values == null)
  8482. all_values = (ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8483. else
  8484. all_values = all_values+":"+(ele.value+"'"+ele1.value+"_"+ele.type+"_"+jdx);
  8485. //break;
  8486. //}
  8487. // else
  8488. break;
  8489. }
  8490. }
  8491. }
  8492. break;
  8493. }
  8494. case "cuttype":
  8495. {
  8496. if(name[1] == "changed")
  8497. {
  8498. if(all_values == null)
  8499. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8500. else
  8501. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8502. break;
  8503. }
  8504. else
  8505. break;
  8506. }
  8507. case "cuttime":
  8508. {
  8509. if(name[1] == "changed")
  8510. {
  8511. if(all_values == null)
  8512. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8513. else
  8514. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8515. break;
  8516. }
  8517. else
  8518. break;
  8519. }
  8520. case "txtbgt":
  8521. {
  8522. if(all_values == null)
  8523. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8524. else
  8525. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8526. break;
  8527. }
  8528. case "txtdbgt":
  8529. {
  8530. if(all_values == null)
  8531. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8532. else
  8533. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8534. break;
  8535. }
  8536. case "alden":
  8537. {
  8538. if(name[1] == "changed")
  8539. {
  8540. if(all_values == null)
  8541. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8542. else
  8543. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8544. break;
  8545. }
  8546. else
  8547. break;
  8548. }
  8549. case "authid":
  8550. {
  8551.  
  8552. if(name[1] == "changed")
  8553. {
  8554. if(all_values == null)
  8555. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8556. else
  8557. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8558. break;
  8559. }
  8560. else
  8561. break;
  8562. }
  8563.  
  8564. case "authtp":
  8565. {
  8566.  
  8567. if(name[1] == "changed")
  8568. {
  8569. if(all_values == null)
  8570. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8571. else
  8572. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8573. break;
  8574. }
  8575. else
  8576. break;
  8577.  
  8578. }
  8579.  
  8580. case "mini":
  8581. {
  8582. if(name[1] == "changed")
  8583. {
  8584. switch(ele.value)
  8585. {
  8586. case "1":
  8587. {
  8588. if(all_values == null)
  8589. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8590. else
  8591. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8592. break;
  8593. }
  8594. case "2":
  8595. {
  8596. var ele1 = document.getElementById("ext_"+jdx+"_a");
  8597. var ele2 = document.getElementById("ext_"+jdx+"_b");
  8598.  
  8599. if(all_values == null)
  8600. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  8601. else
  8602. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  8603. break;
  8604. }
  8605. case "3":
  8606. {
  8607. //if(ele1.title != ele1.value)
  8608. //{
  8609. if(all_values == null)
  8610. all_values = (ele.value+"_"+"_"+ele.type+"_"+jdx);
  8611. else
  8612. all_values = all_values+":"+(ele.value+"_"+"_"+ele.type+"_"+jdx);
  8613. break;
  8614. //}
  8615. //else
  8616. // break;
  8617. }
  8618. case "4":
  8619. {
  8620. //if(ele1.title != ele1.value)
  8621. //{
  8622. if(all_values == null)
  8623. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8624. else
  8625. all_values = all_values+":"+(ele.value+"_"+ele1.value+"_"+ele.type+"_"+jdx);
  8626. break;
  8627. //}
  8628. //else
  8629. // break;
  8630. }
  8631. case "5":
  8632. {
  8633. var ele1 = document.getElementById("ext_"+jdx+"_c");
  8634. var ele2 = document.getElementById("ext_"+jdx+"_d");
  8635. //if(ele1.title != ele1.value)
  8636. //{
  8637. if(all_values == null)
  8638. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  8639. else
  8640. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value+"_"+ele2.value);
  8641. break;
  8642. //}
  8643. //else
  8644. // break;
  8645. }
  8646. case "6":
  8647. {
  8648. var ele1 = document.getElementById("ext_"+jdx+"_e");
  8649. //if(ele1.title != ele1.value)
  8650. //{
  8651. if(all_values == null)
  8652. all_values = (ele.value+"_"+ele.type+"_"+jdx+"_"+ele1.value);
  8653. else
  8654. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+ele1.value);
  8655. break;
  8656. //}
  8657. //else
  8658. // break;
  8659. }
  8660. case "0":
  8661. {
  8662. //if(ele1.title != ele1.value)
  8663. //{
  8664. if(all_values == null)
  8665. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8666. else
  8667. all_values = all_values+":"+(ele.value+"_"+ele.type+"_"+jdx);
  8668. break;
  8669. //}
  8670. //else
  8671. //break;
  8672. }
  8673. }
  8674. }
  8675. else
  8676. break;
  8677. }
  8678. }
  8679. }
  8680. }
  8681. if(all_values != null)
  8682. {
  8683. all_values += ","+data;
  8684. //all_values = escape(all_values);
  8685. //alert(all_values);
  8686. doWork(all_values,"set_sip_ext","search");
  8687. }
  8688. else
  8689. alert("No Change Encountered!");
  8690. }
  8691.  
  8692. function updatsiptrk()
  8693. {
  8694. var data = null;
  8695. data = document.getElementById("number").value;
  8696. var id = document.getElementById("sip_hint").value;
  8697. var all_values = null;
  8698. var err_flag = 0;
  8699. var all_values = null;
  8700. //alert(data);
  8701. for(jdx = 1; jdx < 33; jdx++)
  8702. {
  8703. var ele = document.getElementById("trk_"+jdx);
  8704. //alert("NAME="+ele.name);
  8705. var name = (ele.name).split(",");
  8706. if(name[1] == "changed")
  8707. {
  8708. switch(name[0])
  8709. {
  8710. case "chk":
  8711. {
  8712. //alert(ele.value+"__"+ele.type+"__"+jdx);
  8713. if(all_values == null)
  8714. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  8715. else
  8716. all_values += ":"+(ele.checked+"_"+ele.type+"_"+jdx);
  8717. //alert(all_values);
  8718. break;
  8719. }
  8720. case "txt":
  8721. {
  8722. //alert(all_values);
  8723. //if(name[1] == "changed")
  8724. //{
  8725. if(all_values == null)
  8726. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8727. else
  8728. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8729. //alert(all_values);
  8730. //break;
  8731. //}
  8732. //else
  8733. break;
  8734.  
  8735. }
  8736. case "slctd":
  8737. {
  8738. //alert(all_values);
  8739. if(all_values == null)
  8740. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8741. else
  8742. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8743. //alert(all_values);
  8744. break;
  8745. }
  8746. case "slctdid":
  8747. {
  8748. //alert(all_values);
  8749. if(all_values == null)
  8750. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8751. else
  8752. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8753. //alert(all_values);
  8754. break;
  8755. }
  8756. case "slcttnt":
  8757. {
  8758. //alert(all_values);
  8759. if(all_values == null)
  8760. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8761. else
  8762. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8763. //alert(all_values);
  8764. break;
  8765. }
  8766. case "slctpcos":
  8767. {
  8768. //alert(all_values);
  8769. if(all_values == null)
  8770. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8771. else
  8772. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8773. //alert(all_values);
  8774. break;
  8775. }
  8776. case "slctscos":
  8777. {
  8778. //alert(all_values);
  8779. if(all_values == null)
  8780. all_values = (ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8781. else
  8782. all_values += ":"+(ele.options[ele.selectedIndex].text+"_"+ele.type+"_"+jdx);
  8783. //alert(all_values);
  8784. break;
  8785. }
  8786. case "txtcos":
  8787. {
  8788. //alert(all_values);
  8789. //if(name[1] == "changed")
  8790. //{
  8791. if(all_values == null)
  8792. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8793. else
  8794. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8795. //alert(all_values);
  8796. //break;
  8797. //}
  8798. //else
  8799. break;
  8800.  
  8801. }
  8802. case "slctdtmf":
  8803. {
  8804. //alert(all_values);
  8805. if(all_values == null)
  8806. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8807. else
  8808. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8809. //alert(all_values);
  8810. break;
  8811. }
  8812. case "txtctr":
  8813. {
  8814. //alert(all_values);
  8815. //if(name[1] == "changed")
  8816. //{
  8817. if(all_values == null)
  8818. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8819. else
  8820. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8821. //alert(all_values);
  8822. //break;
  8823. //}
  8824. //else
  8825. break;
  8826. }
  8827. /**case "df":
  8828. {
  8829. //alert(ele.value+"__"+ele.type+"__"+jdx);
  8830. if(all_values == null)
  8831. all_values = (ele.checked+"_"+ele.type+"_"+jdx);
  8832. else
  8833. all_values = all_values+":"+(ele.checked+"_"+ele.type+"_"+jdx);
  8834. //alert(all_values);
  8835. break;
  8836. }**/
  8837. case "slctdlm":
  8838. {
  8839. //alert(all_values);
  8840. if(all_values == null)
  8841. all_values = (ele.value+"_"+ele.type+"_"+jdx);
  8842. else
  8843. all_values += ":"+(ele.value+"_"+ele.type+"_"+jdx);
  8844. //alert(ele.value);
  8845. break;
  8846.  
  8847. }
  8848.  
  8849. }
  8850. }
  8851. }
  8852. if(all_values != null)
  8853. {
  8854. all_values += ","+data;
  8855. //all_values = escape(all_values);
  8856. all_values = all_values+"|"+id;
  8857. doWork(all_values,"set_sip_trk","search");
  8858. }
  8859. else
  8860. alert(" No Change Encountered!");
  8861. }
  8862.  
  8863. function rfr_sip_trk(val)
  8864. {
  8865. var data = null;
  8866. data=document.getElementById("number").value;
  8867. var id = "sip-trk";
  8868. data = data+"|"+id;
  8869. doWork(data,"getsiptrk","search");
  8870. }
  8871. function rfr_sip_trk1(val)
  8872. {
  8873. var data = null;
  8874. data=val;
  8875. var id = "sip-trk";
  8876. data = data+"|"+id;
  8877. doWork(data,"getsiptrk","search");
  8878. }
  8879.  
  8880. function printDiv()
  8881. {
  8882. // Automatically find the table with id 'cdrTable'
  8883. const content = document.getElementById('print').outerHTML;
  8884.  
  8885. // Create a new print window
  8886. const printWindow = window.open('', '', 'height=600,width=800');
  8887. printWindow.document.write('<html><head></head><body>');
  8888. printWindow.document.write('<h2>CDR Display</h2>');
  8889. printWindow.document.write(content);
  8890. printWindow.document.write('</body></html>');
  8891.  
  8892. // Close document to apply styles and open print dialog
  8893. printWindow.document.close();
  8894. printWindow.print();
  8895. }
  8896.  
  8897.  
  8898. function ispShow()
  8899. {
  8900. doWork(true,"ispShow","isp");
  8901. }
  8902.  
  8903. function showSelectedValue(obj)
  8904. {
  8905. var val = obj.value;
  8906. val = "set_"+val;
  8907. //alert(val);
  8908. doWork(val,"showSlctIsp","isp");
  8909. }
  8910.  
  8911.  
  8912. function set_isp(obj)
  8913. {
  8914. //alert("i am in set_sysmgw");
  8915. var qry = null;
  8916. for(c=0; c<=8; c++)
  8917. {
  8918. var cname = document.getElementById("sys_"+(c+1)).name;
  8919. //alert("Loop Count " + c + " name of element = " + cname);
  8920. //var cname = document.getElementById("sys_0").name;
  8921. if(cname != "nochange")
  8922. {
  8923. var e_val = null;
  8924. if(document.getElementById("sys_"+(c+1)).type == 'checkbox')
  8925. {
  8926. var cchkd = 0;
  8927. if(document.getElementById("sys_"+(c+1)).checked)
  8928. cchkd = 1;
  8929. else
  8930. cchkd = 0;
  8931. if(qry == null)
  8932. qry = cchkd+"_"+c;
  8933. else
  8934. qry = qry+"|"+cchkd+"_"+c;
  8935. //alert(qry);
  8936. }
  8937. else
  8938. {
  8939. var cchkd = 0;
  8940. if(document.getElementById("sys_"+(c+1)).value != document.getElementById("sys_"+(c+1)).title)
  8941. {
  8942. cchkd = (document.getElementById("sys_"+(c+1)).value);
  8943. if(qry == null)
  8944. qry = cchkd+"_"+c;
  8945. else
  8946. qry = qry+"|"+cchkd+"_"+c;
  8947. }
  8948. }
  8949. }
  8950. }
  8951. //alert(qry);
  8952. if(qry == null)
  8953. info_notify("No Changes Encountered !");
  8954. else
  8955. {
  8956. //alert(qry);
  8957. qry = qry+"?"+obj;
  8958. doWork(qry,"set_sysisp","isp");
  8959. }
  8960. }
  8961.  
  8962.  
  8963. //Till here
  8964.  
  8965.  
  8966.  
Add Comment
Please, Sign In to add comment