Advertisement
Guest User

Untitled

a guest
Aug 10th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4.   <title>C530 IP</title>
  5.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6.   <meta http-equiv="Content-Script-Type" content="text/javascript">
  7.   <meta http-equiv="Content-Style-Type" content="text/css">
  8.   <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9.  
  10.   <!-- external scripts for common tasks -->
  11.   <script language="JavaScript" type="text/javascript">
  12.   <!--
  13.   /* file global.js */
  14. var labeling = 0;
  15.  
  16.  
  17.  
  18. if (document.images)
  19. {
  20.   var pic1 = new Image;
  21.  
  22.  
  23.   pic1.src = "../images/bg_button_100_pressed.gif";
  24.  
  25.   var pic2 = new Image;
  26.  
  27.  
  28.   pic2.src = "../images/bg_button_215_pressed.gif";
  29.  
  30. }
  31.  
  32.   /* file tools.js */
  33. var browserDetect = navigator.userAgent.toLowerCase();
  34. var browserDetectOS,browserDetectBrowser,browserDetectVersion,browserDetectTotal,browserDetectString;
  35. if (checkIt('konqueror'))
  36. {
  37.   browserDetectBrowser = "Konqueror";
  38.   browserDetectOS = "Linux";
  39. }
  40. else if (checkIt('firefox')) browserDetectBrowser = "Firefox"
  41. else if (checkIt('safari')) browserDetectBrowser = "Safari"
  42. else if (checkIt('omniweb')) browserDetectBrowser = "OmniWeb"
  43. else if (checkIt('opera')) browserDetectBrowser = "Opera"
  44. else if (checkIt('webtv')) browserDetectBrowser = "WebTV";
  45. else if (checkIt('icab')) browserDetectBrowser = "iCab"
  46. else if (checkIt('msie')) browserDetectBrowser = "Internet Explorer"
  47. else if (checkIt('trident')) browserDetectBrowser = "Internet Explorer"
  48. else if (!checkIt('compatible'))
  49. {
  50.   browserDetectBrowser = "Netscape Navigator"
  51.   browserDetectVersion = browserDetect.charAt(8);
  52. }
  53. else browserDetectBrowser = "An unknown browser";
  54. if (!browserDetectVersion) browserDetectVersion = browserDetect.charAt(broswerPlace + browserDetectString.length);
  55. if (!browserDetectOS)
  56. {
  57.   if (checkIt('linux')) browserDetectOS = "Linux";
  58.   else if (checkIt('x11')) browserDetectOS = "Unix";
  59.   else if (checkIt('mac')) browserDetectOS = "Mac"
  60.   else if (checkIt('win')) browserDetectOS = "Windows"
  61.   else browserDetectOS = "an unknown operating system";
  62. }
  63.  
  64. function checkIt(string)
  65. {
  66.   broswerPlace = browserDetect.indexOf(string) + 1;
  67.   browserDetectString = string;
  68.   return broswerPlace;
  69. }
  70.  
  71. function instr(haystack, needle)
  72. {
  73.   if (haystack.lastIndexOf(needle) == -1) {
  74.     return false;
  75.   }
  76.   return true;
  77. }
  78.  
  79. function getKey(eventObj)
  80. {
  81.   if (!eventObj) var eventObj = window.event;
  82.   return document.all?eventObj.keyCode:eventObj.which;
  83. }
  84.  
  85. function getUTF8Bytes(unicode)
  86. {
  87.   if (unicode < 0x00000080)
  88.   {
  89.     return 1;
  90.   }
  91.   else if (unicode < 0x00000800)
  92.   {
  93.     return 2;
  94.   }
  95.   else if (unicode < 0x00010000)
  96.   {
  97.     return 3;
  98.   }
  99.   return 4;
  100. }
  101.  
  102. function countUTF8Bytes(unicode)
  103. {
  104.   utf8bytescount = 0;
  105.   for (i = 0; i < unicode.length; i++)
  106.   {
  107.     utf8bytescount += getUTF8Bytes(unicode.charCodeAt(i));
  108.   }
  109.   return utf8bytescount;
  110. }
  111.  
  112. function checkUTF8Bytes(formfield, eventObj, maxlen)
  113. {
  114.   if (!eventObj) var eventObj = window.event;
  115.   keyCode = getKey(eventObj);
  116.   if ((keyCode == 0) || (keyCode == 8)) return true;
  117.   return ((countUTF8Bytes(formfield.value + String.fromCharCode(getKey(eventObj))) - countUTF8Bytes(getSelected(formfield))) <= maxlen);
  118. }
  119.  
  120. function getG0G1Bytes(unicode)
  121. {
  122.   // check for euro sign
  123.   if (unicode == 0x20AC)
  124.   {
  125.     return 3;
  126.   }
  127.   return 1;
  128. }
  129.  
  130. function countG0G1Bytes(unicode)
  131. {
  132.   g0g1bytescount = 0;
  133.   for (i = 0; i < unicode.length; i++)
  134.   {
  135.     g0g1bytescount += getG0G1Bytes(unicode.charCodeAt(i));
  136.   }
  137.   return g0g1bytescount;
  138. }
  139.  
  140. function checkG0G1Bytes(formfield, eventObj, maxlen)
  141. {
  142.   if (!eventObj) var eventObj = window.event;
  143.   keyCode = getKey(eventObj);
  144.   if ((keyCode == 0) || (keyCode == 8)) return true;
  145.   return ((countG0G1Bytes(formfield.value + String.fromCharCode(getKey(eventObj))) - countG0G1Bytes(getSelected(formfield))) <= maxlen);
  146. }
  147.  
  148. function isValidG0G1Char(eventObj) {
  149.   if (checkForPaste(eventObj))
  150.   {
  151.     return true;
  152.   }
  153.   if (!eventObj) var eventObj = window.event;
  154.   keyCode = getKey(eventObj);
  155.   keyChar = getEventCharacter(eventObj);
  156.   unicode = keyChar.charCodeAt(0);
  157.   // Allow only numbers, *, #, R, r, P, p, tab, backspace and enter
  158.   if (
  159.        ("\b\r".indexOf(keyChar) != -1)
  160.        ||
  161.        ((unicode >= 0x20) && (unicode <= 0xFF))
  162.        ||
  163.        (unicode == 0x20AC)
  164.        ||
  165.        (keyCode == 0)
  166.      )
  167.   {
  168.     return true;
  169.   }
  170.   return false;
  171. }
  172.  
  173. function getSelected()
  174. {
  175.   var sel = "";
  176.   var formfield = null;
  177.  
  178.   if (arguments.length > 1)
  179.   {
  180.     return "";
  181.   }
  182.  
  183.   if (arguments.length == 1)
  184.   {
  185.     formfield = arguments[0];
  186.   }
  187.  
  188.   if (window.getSelection)
  189.   {
  190.     sel = window.getSelection();
  191.   } else if (document.getSelection)
  192.     {
  193.       sel = document.getSelection();
  194.     } else if (document.selection)
  195.       {
  196.         sel = document.selection.createRange().text;
  197.       }
  198.  
  199.   if ((sel == "") && (formfield))
  200.   {
  201.     if (formfield.selectionStart != formfield.selectionEnd)
  202.     {
  203.       sel = formfield.value.substring(formfield.selectionStart, formfield.selectionEnd);
  204.     }
  205.   }
  206.        
  207.   return sel;
  208. }
  209.  
  210. function getEventCharacter(e)
  211. {
  212.   var code;
  213.   if (!e) var e = window.event;
  214.   if (e.keyCode) code = e.keyCode;
  215.   else if (e.which) code = e.which;
  216.   return String.fromCharCode(code);
  217. }
  218.  
  219. function checkForPaste(e)
  220. {
  221.   if (!e) var e = window.event;
  222.   if (
  223.        (e.ctrlKey)
  224.        &&
  225.        (
  226.          (getEventCharacter(e) == "x")
  227.          ||
  228.          (getEventCharacter(e) == "c")
  229.          ||
  230.          (getEventCharacter(e) == "v")
  231.        )
  232.      )
  233.   {
  234.     return true;
  235.   }
  236.   return false;
  237. }
  238.  
  239. function isNumber(eventObj) {
  240.   if (checkForPaste(eventObj))
  241.   {
  242.     return true;
  243.   }
  244.   if (!eventObj) var eventObj = window.event;
  245.   keyCode = getKey(eventObj);
  246.   // Allow only numbers, backspace, tab and enter
  247.   if ((keyCode >= "0".charCodeAt(0) && keyCode <= "9".charCodeAt(0)) ||
  248.       (keyCode == 8) ||
  249.       (keyCode == 9) ||
  250.       (keyCode == 0))
  251.   {
  252.     return true;
  253.   }
  254.   return false;
  255. }
  256.  
  257.  
  258. function isHexNumber(eventObj) {
  259.   if (checkForPaste(eventObj))
  260.   {
  261.     return true;
  262.   }
  263.   if (!eventObj) var eventObj = window.event;
  264.   keyCode = getKey(eventObj);
  265.   // Allow only hex numbers, backspace, tab and enter
  266.   if ((keyCode >= "0".charCodeAt(0) && keyCode <= "9".charCodeAt(0)) ||
  267.       (keyCode >= "a".charCodeAt(0) && keyCode <= "f".charCodeAt(0)) ||
  268.       (keyCode >= "A".charCodeAt(0) && keyCode <= "F".charCodeAt(0)) ||
  269.       (keyCode == 8) ||
  270.       (keyCode == 9) ||
  271.       (keyCode == 0))
  272.   {
  273.     return true;
  274.   }
  275.   return false;
  276. }
  277.  
  278.  
  279. function checkNumber(txt)
  280. {
  281.   txt = txt.replace(/\D/g, "");
  282.   return txt;
  283. }
  284.  
  285.  
  286. function checkHexNumber(txt)
  287. {
  288.   txt = txt.replace(/[^a-fA-F0-9]/g, "");
  289.   return txt;
  290. }
  291.  
  292.  
  293. function isNegNumber(eventObj) {
  294.   if (checkForPaste(eventObj))
  295.   {
  296.     return true;
  297.   }
  298.   if (!eventObj) var eventObj = window.event;
  299.   keyCode = getKey(eventObj);
  300.   // Allow only numbers, backspace, tab and enter AND '-'
  301.   if ((keyCode >= "0".charCodeAt(0) && keyCode <= "9".charCodeAt(0)) ||
  302.       (keyCode == "-".charCodeAt(0)) ||
  303.       (keyCode == 8) ||
  304.       (keyCode == 9) ||
  305.       (keyCode == 0))
  306.   {
  307.     return true;
  308.   }
  309.   return false;
  310. }
  311.  
  312. function checkNegNumber(txt)
  313. {
  314.   var negative;
  315.  
  316.   if (txt.charAt(0) == "-")
  317.   {
  318.     negative = true;
  319.   }
  320.  
  321.   txt = checkNumber(txt);
  322.  
  323.   if (negative)
  324.   {
  325.     txt = "-" + txt;
  326.   }
  327.  
  328.   return txt;
  329. }
  330.  
  331. //LwP, Check for digits only, limit to specific number of such
  332. function isValidPin(formfield, eventObj, maxlen) {
  333.   if (checkForPaste(eventObj))
  334.   {
  335.     return true;
  336.   };
  337.   if (!eventObj) var eventObj = window.event;
  338.   keyCode = getKey(eventObj);
  339.   // Allow only numbers, backspace, tab and enter
  340.   if (keyCode >= "0".charCodeAt(0) && keyCode <= "9".charCodeAt(0))      
  341.   {
  342.     if(formfield.value.length<maxlen){
  343.       return true;
  344.     };
  345.   };
  346.   if( (keyCode == 8) ||
  347.       (keyCode == 9) ||
  348.       (keyCode == 0)
  349.     )
  350.   {
  351.     if(formfield.value.length<=maxlen){
  352.       return true;
  353.     };
  354.   }
  355.   return false;
  356. };
  357.  
  358. function isValidDomainChar(eventObj) {
  359.   if (checkForPaste(eventObj))
  360.   {
  361.     return true;
  362.   }
  363.   if (!eventObj) var eventObj = window.event;
  364.   keyCode = getKey(eventObj);
  365.   keyChar = String.fromCharCode(keyCode);
  366.   // Allow only numbers, chars, -, ., tab and enter
  367.   if (
  368.        ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-.\b\r".indexOf(keyChar) != -1)
  369.        ||
  370.        (keyCode == 0)
  371.      )
  372.   {
  373.     return true;
  374.   }
  375.   return false;
  376. }
  377.  
  378. function isValidSipDomainChar(eventObj) {
  379.   if (checkForPaste(eventObj))
  380.   {
  381.     return true;
  382.   }
  383.   if (!eventObj) var eventObj = window.event;
  384.   keyCode = getKey(eventObj);
  385.   keyChar = String.fromCharCode(keyCode);
  386.   // Allow only numbers, chars, -, ., tab and enter
  387.   if (
  388.        ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-.\b\r".indexOf(keyChar) != -1)
  389.        ||
  390.        (keyCode == 0)
  391.      )
  392.   {
  393.     return true;
  394.   }
  395.   return false;
  396. }
  397.  
  398. function isValidNetworkNameChar(eventObj) {
  399.   if (checkForPaste(eventObj))
  400.   {
  401.     return true;
  402.   }
  403.   if (!eventObj) var eventObj = window.event;
  404.   keyCode = getKey(eventObj);
  405.   keyChar = String.fromCharCode(keyCode);
  406.   // Allow only numbers, chars, -, tab and enter
  407.   if (
  408.        ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-\b\r".indexOf(keyChar) != -1)
  409.        ||
  410.        (keyCode == 0)
  411.      )
  412.   {
  413.     return true;
  414.   }
  415.   return false;
  416. }
  417.  
  418. function isValidDomainCharWithColon(eventObj) {
  419.   if (checkForPaste(eventObj))
  420.   {
  421.     return true;
  422.   }
  423.   if (!eventObj) var eventObj = window.event;
  424.   keyCode = getKey(eventObj);
  425.   keyChar = String.fromCharCode(keyCode);
  426.   // Allow only numbers, chars, -, ., tab and enter
  427.   //LwP, also check for Colon ( : )
  428.   if (
  429.        ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:-.\b\r".indexOf(keyChar) != -1)
  430.        ||
  431.        (keyCode == 0)
  432.      )
  433.   {
  434.     return true;
  435.   }
  436.   return false;
  437. }
  438.  
  439. function checkValidDomainChar(txt)
  440. {
  441.   txt = txt.replace(/[^0-9a-zA-Z-.]/g, "");
  442.   return txt;
  443. }
  444.  
  445. function checkValidSipDomainChar(txt)
  446. {
  447.   txt = txt.replace(/[^0-9a-zA-Z-._]/g, "");
  448.   return txt;
  449. }
  450.  
  451. function isValidTeleNoChar(eventObj) {
  452.   if (checkForPaste(eventObj))
  453.   {
  454.     return true;
  455.   }
  456.   if (!eventObj) var eventObj = window.event;
  457.   keyCode = getKey(eventObj);
  458.   keyChar = getEventCharacter(eventObj);
  459.   // Allow only numbers, *, #, R, P, tab, backspace and enter
  460.   if (
  461.        ("0123456789*#RP\b\r".indexOf(keyChar) != -1)
  462.        ||
  463.        (keyCode == 0)
  464.      )
  465.   {
  466.     return true;
  467.   }
  468.   return false;
  469. }
  470.  
  471. function checkValidTeleNoChar(txt)
  472. {
  473.   txt = txt.replace(/[^0-9*#RPrp]/g, "");
  474.   return txt;
  475. }
  476.  
  477. function intToBin(iInt)
  478. {
  479.   var sBin = "";
  480.   var i = 0;
  481.  
  482.   for (i = 0; i < 8; i++)
  483.   {
  484.     if ((iInt % 2) == 1)
  485.     {
  486.       sBin = "1" + sBin;
  487.     }
  488.     else
  489.     {
  490.       sBin = "0" + sBin;
  491.     }
  492.     iInt = iInt >> 1;
  493.   }
  494.  
  495.   return sBin;
  496. }
  497.  
  498. function isValidSubnetmask(oSub1, oSub2, oSub3, oSub4)
  499. {
  500.   var sSub;
  501.  
  502.   if (
  503.        !isIntInRange(oSub1, 128, 255) ||
  504.        !isIntInRange(oSub2, 0, 255) ||
  505.        !isIntInRange(oSub3, 0, 255) ||
  506.        !isIntInRange(oSub4, 0, 254)
  507.      )
  508.   {
  509.     return false;
  510.   }
  511.  
  512.   sSub = intToBin(parseInt(oSub1.value, 10));
  513.   sSub += intToBin(parseInt(oSub2.value, 10));
  514.   sSub += intToBin(parseInt(oSub3.value, 10));
  515.   sSub += intToBin(parseInt(oSub4.value, 10));
  516.  
  517.   if (sSub.indexOf("0") < sSub.lastIndexOf("1"))
  518.   {
  519.     return false;
  520.   }
  521.    
  522.   return true;
  523. }
  524.  
  525. function isValidIP(oIP1, oIP2, oIP3, oIP4, oSub1, oSub2, oSub3, oSub4)
  526. {
  527.   if (
  528.        isIntInRange(oIP1, 127, 127) ||
  529.        !isIntInRange(oIP1, 1, 223) ||
  530.        !isIntInRange(oIP2, 0, 255) ||
  531.        !isIntInRange(oIP3, 0, 255) ||
  532.        !isIntInRange(oIP4, 0, 255)
  533.      )
  534.   {
  535.     return false;
  536.   }
  537.  
  538.   if (!oSub1)
  539.   {
  540.     return true;
  541.   }
  542.  
  543.   var iIP1_1 = parseInt(oIP1.value, 10);
  544.   var iIP1_2 = parseInt(oIP2.value, 10);
  545.   var iIP1_3 = parseInt(oIP3.value, 10);
  546.   var iIP1_4 = parseInt(oIP4.value, 10);
  547.   var iSub1 = parseInt(oSub1.value, 10);
  548.   var iSub2 = parseInt(oSub2.value, 10);
  549.   var iSub3 = parseInt(oSub3.value, 10);
  550.   var iSub4 = parseInt(oSub4.value, 10);
  551.   var iSub = (iSub1 << 24) + (iSub2 << 16) + (iSub3 << 8) + iSub4;
  552.   var iIP1 = (iIP1_1 << 24) + (iIP1_2 << 16) + (iIP1_3 << 8) + iIP1_4;
  553.  
  554.   iSub = ~iSub;
  555.   if (((iIP1 & iSub) == iSub) || ((iIP1 & iSub) == 0))
  556.   {
  557.     // all host bits are 1 or 0 -> illegal (broadcast // net)
  558.     return false;
  559.   }
  560.  
  561.   return true;
  562. }
  563.  
  564. function isInSameSubnet(oIP1_1, oIP1_2, oIP1_3, oIP1_4, oIP2_1, oIP2_2, oIP2_3, oIP2_4, oSub1, oSub2, oSub3, oSub4)
  565. {
  566.   var iIP1_1 = parseInt(oIP1_1.value, 10);
  567.   var iIP1_2 = parseInt(oIP1_2.value, 10);
  568.   var iIP1_3 = parseInt(oIP1_3.value, 10);
  569.   var iIP1_4 = parseInt(oIP1_4.value, 10);
  570.   var iIP2_1 = parseInt(oIP2_1.value, 10);
  571.   var iIP2_2 = parseInt(oIP2_2.value, 10);
  572.   var iIP2_3 = parseInt(oIP2_3.value, 10);
  573.   var iIP2_4 = parseInt(oIP2_4.value, 10);
  574.   var iSub1 = parseInt(oSub1.value, 10);
  575.   var iSub2 = parseInt(oSub2.value, 10);
  576.   var iSub3 = parseInt(oSub3.value, 10);
  577.   var iSub4 = parseInt(oSub4.value, 10);
  578.  
  579.   var iIP1 = (iIP1_1 << 24) + (iIP1_2 << 16) + (iIP1_3 << 8) + iIP1_4;
  580.   var iIP2 = (iIP2_1 << 24) + (iIP2_2 << 16) + (iIP2_3 << 8) + iIP2_4;
  581.   var iSub = (iSub1 << 24) + (iSub2 << 16) + (iSub3 << 8) + iSub4;
  582.  
  583.   if ((iIP1 & iSub) != (iIP2 & iSub))
  584.   {
  585.     return false;
  586.   }
  587.  
  588.   return true;
  589. }
  590.  
  591. function isGatewaySameAsDevice(oIP1_1, oIP1_2, oIP1_3, oIP1_4, oIP2_1, oIP2_2, oIP2_3, oIP2_4)
  592. {
  593.   if ((parseInt(oIP1_1.value, 10) == parseInt(oIP2_1.value, 10)) &&
  594.       (parseInt(oIP1_2.value, 10) == parseInt(oIP2_2.value, 10)) &&
  595.       (parseInt(oIP1_3.value, 10) == parseInt(oIP2_3.value, 10)) &&
  596.       (parseInt(oIP1_4.value, 10) == parseInt(oIP2_4.value, 10)))
  597.   {
  598.     return false;
  599.   }
  600.  
  601.   return true;
  602. }
  603.  
  604. function GetVoIPLineStatus(line) {
  605.   //
  606.   // Disabled
  607.   if (line[3]-0 == 0)
  608.   {
  609.     return "Disabled";
  610.   }
  611.   //
  612.   //not disabled
  613.   //Runlevel states disabled!
  614.   if(line[4]>=10)
  615.   {
  616.     switch(line[4]){
  617.       case 90:
  618.       case 60:
  619.       case 50:
  620.         return "Registered";
  621.         break;
  622.       case 40:
  623.       case 30:  
  624.         return "Registration failed.";
  625.         break;
  626.       case 20:
  627.       case 15:
  628.       case 10:
  629.       default:
  630.         return "Registration failed.";
  631.         break;
  632.     }
  633.   };
  634.     //in case we are asked about other type of status (like in Saturn)
  635.   switch (line[4])
  636.   {
  637.     case 1:
  638.     case 3: //left for future use
  639.       return 'Registration failed.'; // running, aka. Registration Failed
  640.       break;
  641.     case 2:
  642.       return 'Registered'; // registered
  643.       break;
  644.     //case 3:
  645.       //return 'Server not accessible.'; // failed, actually this means it's working
  646.     //break;
  647.     default:
  648.       return 'Disabled'; // disabled
  649.       break;
  650.   }
  651. }
  652.  
  653. function isInt(oInt)
  654. {
  655.   var sInt = oInt.value;
  656.  
  657.   return !isNaN(sInt) && (sInt != "");
  658. }
  659.  
  660.  
  661. function isIntInRange(oInt, iMin, iMax)
  662. {
  663.   var iInt = parseInt(oInt.value, 10);
  664.  
  665.   if (!isInt(oInt))
  666.   {
  667.     return false;
  668.   }
  669.    
  670.   if ((iInt < iMin) ||
  671.       (iInt > iMax))
  672.   {
  673.     return false;
  674.   }
  675.  
  676.   return true;
  677. }
  678.  
  679. function bBitSet(byteval, bitno)
  680. {
  681.   return ((byteval & Math.pow(2, bitno)) != 0);
  682. }
  683.  
  684. function iSetBit(byteval, bitno)
  685. {
  686.   return (byteval | Math.pow(2, bitno));
  687. }
  688.  
  689. function create_tag()
  690. {
  691.   var e_name = "";
  692.   var elem;
  693.  
  694.   if (arguments.length < 1)
  695.   {
  696.     return null;
  697.   }
  698.  
  699.   if (arguments.length > 1)
  700.   {
  701.     for (var i = 1; i < arguments.length; i++)
  702.     {
  703.       var attributes = new Array();
  704.       attributes[0] = arguments[i].substring(0, arguments[i].indexOf("|"));
  705.       attributes[1] = arguments[i].substring(arguments[i].indexOf("|") + 1);
  706.       if (attributes[0] == "name")
  707.       {
  708.         e_name = attributes[1];
  709.       }
  710.     }
  711.   }
  712.  
  713.   if (e_name != "")
  714.   {
  715.     elem = createElementWithName(arguments[0], e_name);
  716.   }
  717.   else
  718.   {
  719.     elem = document.createElement(arguments[0]);
  720.   }
  721.  
  722.   if (arguments.length > 1)
  723.   {
  724.     for (var i = 1; i < arguments.length; i++)
  725.     {
  726.       var attributes = new Array();
  727.       attributes[0] = arguments[i].substring(0, arguments[i].indexOf("|"));
  728.       attributes[1] = arguments[i].substring(arguments[i].indexOf("|") + 1);
  729.       var subattributes = attributes[0].split(".");
  730.       var is_bool_attribute = new RegExp("#" + subattributes[0] + "#");
  731.  
  732.       var bool_attributes = "#defaultChecked#defaultSelected#selected#multiple#disabled#";
  733.      
  734.       switch (subattributes.length)
  735.       {
  736.         case 1:
  737.           if (is_bool_attribute.test(bool_attributes))
  738.           {
  739.             if ((attributes[1] == "true") || (attributes[1] == "1") || (attributes[1] == "disabled") || (attributes[1] == "selected") )
  740.             {
  741.               elem[subattributes[0]] = true;
  742.             }
  743.             else
  744.             {
  745.               elem[subattributes[0]] = false;
  746.             }
  747.           }
  748.           else
  749.           {
  750.             elem[subattributes[0]] = attributes[1];
  751.           }
  752.         break;
  753.         case 2:
  754.           elem[subattributes[0]][subattributes[1]] = attributes[1];
  755.         break;
  756.         default:
  757.           ;
  758.       }
  759.     }
  760.   }
  761.  
  762.   return elem;
  763. }
  764.  
  765. function create_tr()
  766. {
  767.   var tr;
  768.   var td;
  769.  
  770.   if (arguments.length < 2)
  771.   {
  772.     return null;
  773.   }
  774.  
  775.   tr = create_tag("tr");
  776.  
  777.  
  778.   td = create_tag("td", "className|label");
  779.  
  780.  
  781.   if ((arguments.length >= 3) && (arguments[2]))
  782.   {
  783.     var h2 = create_tag("h2", "className|first");
  784.     h2.appendChild(document.createTextNode(arguments[0]));
  785.     td.appendChild(h2);
  786.   }
  787.   else
  788.   {
  789.     td.appendChild(document.createTextNode(arguments[0]));
  790.   }
  791.  
  792.   tr.appendChild(td);
  793.  
  794.   if ((arguments.length >= 4) && (arguments[3]))
  795.   {
  796.  
  797.  
  798.     td = create_tag("td", "className|rightSide");
  799.  
  800.   }
  801.   else
  802.   {
  803.  
  804.  
  805.     td = create_tag("td");
  806.  
  807.   }
  808.  
  809.   td.appendChild(arguments[1]);
  810.  
  811.   tr.appendChild(td);
  812.  
  813.   return tr;
  814. }
  815.  
  816. function create_trfix()
  817. {
  818. // fixes the width of the first column
  819.   var tr = create_tag("tr");
  820.   var td;
  821.   var w = 360;
  822.   var c = 1;
  823.  
  824.   if (arguments.length > 0)
  825.   {
  826.     w = arguments[0];
  827.   }
  828.  
  829.   if (arguments.length > 1)
  830.   {
  831.     c = arguments[1];
  832.   }
  833.  
  834.   td = create_tag("td", "style.padding|0");
  835.   td.appendChild(create_tag("img", "src|images/spacer.gif", "alt|", "width|200", "height|1", "border|0"));
  836.   tr.appendChild(td);
  837.   td = create_tag("td", "style.padding|0", "colSpan|" + c);
  838.   td.appendChild(create_tag("img", "src|images/spacer.gif", "alt|", "width|" + w, "height|1", "border|0"));
  839.   tr.appendChild(td);
  840.  
  841.   return tr;
  842. }
  843.  
  844. function create_button_table(t_save, t_cancel)
  845. {
  846.   var tab, bod, tab2, bod2, tr, tr2, td, td2, a, img;
  847.  
  848.   tab = create_tag("table", "border|0", "cellSpacing|0", "style.width|100%");
  849.   bod = create_tag("tbody");
  850.   tr = create_tag("tr");
  851.   td = create_tag("td");
  852.   td.appendChild(document.createTextNode("\u00a0"));
  853.   tr.appendChild(td);
  854.   td = create_tag("td", "className|separatorButton");
  855.   tab2 = create_tag("table", "border|0", "cellSpacing|0");
  856.   bod2 = create_tag("tbody");
  857.   tr2 = create_tag("tr");
  858.   td2 = create_tag("td");
  859.   a = create_tag("a", "href|#", "className|buttonLink100");
  860.   a.appendChild(document.createTextNode(t_save));
  861.   a.onclick = function (e) {javascript:submit_gigaset_form(); return false;};
  862.   td2.appendChild(a);
  863.   tr2.appendChild(td2);
  864.   td2 = create_tag("td");
  865.   a = create_tag("a", "href|#", "className|buttonLink100");
  866.   a.appendChild(document.createTextNode(t_cancel));
  867.   a.onclick = function (e) {javascript:cancel_gigaset_form(); return false;};
  868.   td2.appendChild(a);
  869.   tr2.appendChild(td2);
  870.   bod2.appendChild(tr2);
  871.   tab2.appendChild(bod2);
  872.   td.appendChild(tab2);
  873.   tr.appendChild(td);
  874.   bod.appendChild(tr);
  875.   bod.appendChild(create_trfix());
  876.   tab.appendChild(bod);
  877.  
  878.   return tab;
  879. }
  880.  
  881.  
  882.  
  883. function printNode(node)
  884. {
  885.   var output = "";
  886.  
  887.   return _printNode(node, output);
  888. }
  889.  
  890. function createElementWithName(){}
  891. (
  892.   function()
  893.   {
  894.     try
  895.     {
  896.       var el=document.createElement( '<div name="foo">' );
  897.       if (
  898.            ('DIV'!=el.tagName)
  899.            ||
  900.            ('foo'!=el.name)
  901.          )
  902.       {
  903.          throw 'create element error';
  904.       }
  905.       createElementWithName =
  906.         function(tag, name)
  907.           {
  908.             return document.createElement('<'+tag+' name="'+name+'"></'+tag+'>');
  909.           }
  910.     }
  911.     catch(e)
  912.     {
  913.       createElementWithName =
  914.         function(tag, name)
  915.         {
  916.           var el = document.createElement(tag);
  917.           el.name = name;
  918.           return el;
  919.         }
  920.     }
  921.   }
  922. )();
  923.  
  924. function _printNode(node, output)
  925. {
  926.   var i;
  927.   var o = output;
  928.  
  929.   if (node)
  930.   {
  931.     if (node.nodeType != 1)
  932.     {
  933.       o += node.data;
  934.     }
  935.     else
  936.     {
  937.       o += "<";
  938.       o += node.nodeName;
  939.       if (node.attributes)
  940.       {
  941.         for (i = 0; i < node.attributes.length; i++)
  942.         {
  943.           if (i == 0)
  944.           {
  945.             o += " ";
  946.           }
  947.           o += node.attributes[i].nodeName;
  948.           o += '="';
  949.           o += node.attributes[i].nodeValue;
  950.           o += '"';
  951.           if (i != (node.attributes.length - 1))
  952.           {
  953.             o += " ";
  954.           }
  955.         }
  956.       }
  957.       o += ">";
  958.       if (node.childNodes)
  959.       {
  960.         for (i = 0; i < node.childNodes.length; i++)
  961.         {
  962.           o = _printNode(node.childNodes[i], o);
  963.         }
  964.       }
  965.       o += "</" + node.nodeName + ">";
  966.     }
  967.    
  968.     return o;
  969.   }
  970. }
  971.  
  972. function open_external_link(id, url) {
  973.   var tmp_popup_url = url;
  974.   var tmp_popup_identifier = id;
  975.   var tmp_popup_width = screen.availWidth;
  976.   var tmp_popup_height = screen.availHeight;
  977.   var tmp_popup_x = 0;
  978.   var tmp_popup_y = 0;
  979.   new_window = window.open(tmp_popup_url, tmp_popup_identifier, "location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,width="+tmp_popup_width+",height="+tmp_popup_height+",left="+tmp_popup_x+",top="+tmp_popup_y+"");
  980.   new_window.focus();
  981. }
  982.  
  983. function isLatinChar(chr)
  984. {
  985.   if(((chr >= 65) && (chr <= 90)) || ((chr >= 97) && (chr <= 122))) return true;
  986.   else return false;
  987. }
  988.  
  989. function isArabicChar(chr)
  990. {
  991.   if((chr >= 1536) && (chr <= 1791)) return true;
  992.   else return false;
  993. }
  994.  
  995. function isSpace(chr)
  996. {
  997.   if(chr == 32) return true;
  998.   else return false;
  999. }
  1000.  
  1001. function isSentenceMarker(chr)
  1002. {
  1003.   if((chr == 46) || (chr == 63) || (chr == 33) || (chr == 40) || (chr == 41)) return true;
  1004.   else return false;
  1005. }
  1006.  
  1007. function isRightBracket(chr)
  1008. {
  1009.   if(chr == 41) return true;
  1010.   else return false;
  1011. }
  1012.  
  1013. function isLeftBracket(chr)
  1014. {
  1015.   if(chr == 40) return true;
  1016.   else return false;
  1017. }
  1018.  
  1019. function switch_order(msg)
  1020. {
  1021.   var strTmp = "";
  1022.   var strRes = "";
  1023.   var chrI;
  1024.   var isWordArabic = false;
  1025.   var addSpace = false;
  1026.   var addPoint = false;
  1027.   for(var i=0; i<msg.length; i++)
  1028.   {
  1029.     chrI = msg.charCodeAt(i);
  1030.     if(isArabicChar(chrI))
  1031.     {
  1032.       if(isWordArabic == true)
  1033.       {
  1034.         if(addSpace)
  1035.         {
  1036.           strTmp += " ";
  1037.           addSpace = false;
  1038.         }
  1039.         strTmp += msg.charAt(i);
  1040.       }
  1041.       else
  1042.       {
  1043.         if(addSpace)
  1044.         {
  1045.           strTmp = " " + strTmp;
  1046.           addSpace = false;
  1047.         }
  1048.         strRes = strTmp + strRes;
  1049.         strTmp = msg.charAt(i);
  1050.       }
  1051.       isWordArabic = true;
  1052.     }
  1053.     else
  1054.     {
  1055.       if(isSpace(chrI))
  1056.       {
  1057.         addSpace = true;
  1058.       }
  1059.       else
  1060.       {
  1061.         if((isLatinChar(chrI)) && (isWordArabic == true))
  1062.         {
  1063.           if(addSpace)
  1064.           {
  1065.             strTmp = " " + strTmp;
  1066.             addSpace = false;
  1067.           }
  1068.           strRes = strTmp + strRes;
  1069.           strTmp = msg.charAt(i);
  1070.           isWordArabic = false;
  1071.         }
  1072.         else
  1073.         {
  1074.           if(addSpace)
  1075.           {
  1076.             strTmp += " ";
  1077.             addSpace = false;
  1078.           }
  1079.           if((i == (msg.length - 1)) && (isSentenceMarker(chrI)))
  1080.           {
  1081.             if(isRightBracket(chrI))
  1082.             {
  1083.               strTmp = '(' + strTmp;
  1084.             }
  1085.             else
  1086.             {
  1087.               if(isLeftBracket(chrI))
  1088.               {
  1089.                 strTmp = ')' + strTmp;
  1090.               }
  1091.               else
  1092.               {
  1093.                 strTmp = msg.charAt(i) + strTmp;
  1094.               }
  1095.             }
  1096.           }
  1097.           else
  1098.           {
  1099.             if(msg.charAt(i) == '\n')
  1100.             {
  1101.               addSpace = true;
  1102.             }
  1103.             else
  1104.             {
  1105.               strTmp += msg.charAt(i);
  1106.             }
  1107.           }
  1108.         }
  1109.       }
  1110.     }
  1111.   }
  1112.   if(addSpace)
  1113.   {
  1114.     strTmp += " ";
  1115.     addSpace = false;
  1116.   }
  1117.   strRes = strTmp + strRes + " ";
  1118.  
  1119.   return strRes;
  1120. }
  1121.  
  1122. function alert_msg(msg)
  1123. {
  1124.  
  1125.   alert(msg);
  1126. }
  1127.  
  1128. function confirm_msg(msg)
  1129. {
  1130.  
  1131.   return confirm(msg);
  1132. }
  1133.  
  1134. function decode_utf8( txt )
  1135. {
  1136.   var ret;
  1137.  
  1138.   try
  1139.   {
  1140.     ret = decodeURIComponent( escape( txt ) );
  1141.   }
  1142.   catch(err)
  1143.   {
  1144.     //for added safety
  1145.     try
  1146.     {
  1147.       ret = unescape( escape( txt ) );
  1148.     }
  1149.     catch(err2)
  1150.     {
  1151.       ret = txt;
  1152.     }
  1153.   }
  1154.   return ret;
  1155. }
  1156.  
  1157.  
  1158. function fixLongTextsForTagWithClass(tagName, elemClass)
  1159. {
  1160.   // only firefox doesn't support text-overflow:ellipsis so this is solution
  1161.   if (browserDetectBrowser == "Firefox")
  1162.   {
  1163.     var classes;
  1164.     var elemArray = document.getElementsByTagName(tagName);
  1165.  
  1166.     for (var i = 0; i < elemArray.length; i++)
  1167.     {
  1168.       classes = elemArray[i].className.split(" ");
  1169.      
  1170.       for (var j = 0; j < classes.length; j++)
  1171.       {
  1172.         if (classes[j] == elemClass)
  1173.         {
  1174.           addOverflowEllipsis(elemArray[i]);
  1175.           break;
  1176.         }
  1177.       }
  1178.     }
  1179.   }
  1180. }
  1181.  
  1182. function addOverflowEllipsis(elem)
  1183. {
  1184.   // only firefox doesn't support text-overflow:ellipsis so this is solution
  1185.   if (browserDetectBrowser == "Firefox")
  1186.   {
  1187.    
  1188.     var elemWidth = elem.clientWidth;
  1189.     var elemText;
  1190.  
  1191.  
  1192.  
  1193.     while (elemWidth < elem.scrollWidth)
  1194.     {      
  1195.       elemText = elem.innerHTML;
  1196.       elem.innerHTML = elemText.substr(0, elemText.length - 2) + "&hellip;";
  1197.     }
  1198.   }
  1199. }
  1200.  
  1201.  
  1202.  
  1203.  
  1204. // returns the version of Internet Explorer or a -1 indicating the use of another browser
  1205. function getInternetExplorerVersion()
  1206. {
  1207.   var retVal = -1;
  1208.   if (navigator.appName == "Microsoft Internet Explorer")
  1209.   {
  1210.     var userAgent = navigator.userAgent;
  1211.     var regularExp = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  1212.     if (regularExp.exec(userAgent) != null)
  1213.     {
  1214.       retVal = parseFloat(RegExp.$1);
  1215.     }
  1216.   }
  1217.   return retVal;
  1218. }
  1219.  
  1220. // if dropdown's width is less than max width of its options
  1221. // then in IE8 options are cut
  1222. function fixDropDownForIE8()
  1223. {
  1224.   var IEversion = getInternetExplorerVersion();
  1225.   if (IEversion == 8.0)
  1226.   {
  1227.     var selects = document.getElementsByTagName("select");
  1228.     for (var i = 0; i < selects.length; i++)
  1229.     {
  1230.       if (
  1231.            (selects[i].clientWidth < selects[i].scrollWidth)
  1232.            &&
  1233.            (!selects[i].attributes.size)
  1234.          )
  1235.       {
  1236.         var f_onchange = selects[i].onchange;
  1237.         var defaultWidth = selects[i].style.width;
  1238.         selects[i].onblur = function()
  1239.                             {
  1240.                               this.style.width = defaultWidth;
  1241.                               this.parentNode.style.width = defaultWidth;
  1242.                             };
  1243.         selects[i].onmousedown = function()
  1244.                                  {
  1245.                                    this.style.width = "auto";
  1246.                                    this.parentNode.style.width = this.style.width;
  1247.                                  };
  1248.         selects[i].onchange = function()
  1249.                               {
  1250.                                 if (typeof(f_onchange) == typeof(Function))
  1251.                                 {
  1252.                                   f_onchange();
  1253.                                 }
  1254.                                 this.style.width = defaultWidth;
  1255.                                 this.parentNode.style.width = defaultWidth;
  1256.                               };
  1257.       }
  1258.     }
  1259.   }
  1260. }
  1261.  
  1262.  
  1263. // in some cases strings in UTF-8 are cut in the middle of UTF-8 2-bytes char
  1264. // which is cause that question marks are shown instead of real chars
  1265. function correctTooLongUtf8String()
  1266. {
  1267.   var editfields = document.getElementsByTagName("input");
  1268.   for (var i = 0; i < editfields.length; i++)
  1269.   {
  1270.     if ((editfields[i].type == "text") && (typeof editfields[i].maxLength != "undefined"))
  1271.     {
  1272.       while (countUTF8Bytes(editfields[i].value) > editfields[i].maxLength)
  1273.       {
  1274.         // remove last char
  1275.         editfields[i].value = editfields[i].value.substring(0, editfields[i].value.length - 1);
  1276.       }
  1277.     }
  1278.   }
  1279. }
  1280.  
  1281. function checkIfValidKeyToCallBrowse(event)
  1282. {
  1283.   var allowedKeyCodes = new Array("13", "32"); // enter, spacebar
  1284.   var receivedKeyCode = event.keyCode;
  1285.   for(var i=0; i<allowedKeyCodes.length; i++)
  1286.   {
  1287.     if(allowedKeyCodes[i] == receivedKeyCode)
  1288.     {
  1289.  
  1290.       return true;
  1291.     }
  1292.   }
  1293.   return false;
  1294. }
  1295.  
  1296. function clickBrowse(inputFileId)
  1297. {
  1298.   document.getElementById(inputFileId).click();
  1299. }
  1300.  
  1301. function handleKeyPressBrowseButton(inputFileId, event)
  1302. {
  1303.   if(!checkIfValidKeyToCallBrowse(event))
  1304.   {
  1305.     return false;
  1306.   }
  1307.   clickBrowse(inputFileId);
  1308. }
  1309.  
  1310. function checkIfValidKeyToCallNext(event)
  1311. {
  1312.   var allowedKeyCodes = new Array("13"); // enter
  1313.   var receivedKeyCode = event.keyCode;
  1314.   for(var i=0; i<allowedKeyCodes.length; i++)
  1315.   {
  1316.     if(allowedKeyCodes[i] == receivedKeyCode)
  1317.     {
  1318.       return true;
  1319.     }
  1320.   }
  1321.   return false;
  1322. }
  1323.  
  1324. function randomString(length)
  1325. {
  1326.   var text = "";
  1327.   var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  1328.  
  1329.   for (var i = 0; i < length; i++)
  1330.   {
  1331.     text += chars.charAt(Math.floor(Math.random() * chars.length));
  1332.   }
  1333.  
  1334.   return text;
  1335. }
  1336.  
  1337. function forceHttpDigestLogout()
  1338. {
  1339.   if (window.XMLHttpRequest)
  1340.   {
  1341.     var xhr = new XMLHttpRequest();
  1342.     xhr.open("GET", '/logout_digest.html', true, "admin", randomString(5));
  1343.     xhr.onreadystatechange = function() { if (xhr.readyState == 4) { window.location.href='/login.html'; } }
  1344.     xhr.send("");
  1345.   }
  1346. }
  1347.  
  1348. function writeLanguageDropdown()
  1349. {
  1350.   var body = document.getElementsByTagName("body")[0];
  1351.   var select = document.createElement("select");
  1352.   var div = document.createElement("div");
  1353.   select.name = "language";
  1354.   select.id = "language";
  1355.   select.onchange = function() { changeLanguage(document.getElementsByName(select.name)[0]) };
  1356.   select.innerHTML = "<option value='1' selected='selected'>English</option><option value='2'>Deutsch</option><option value='9'>Français</option><option value='10'>Nederlands</option><option value='7'>Italiano</option><option value='23'>Русский</option><option value='4'>Espanol</option><option value='20'>Portugues (BR)</option><option value='17'>Polski</option><option value='24'>Ελληνικά</option><option value='5'>Portugues</option><option value='15'>Čeština</option><option value='16'>Turkce</option>";
  1357.   div.id = "language-container";
  1358.   body.appendChild(div);
  1359.   div.appendChild(select);
  1360. }
  1361.  
  1362. function changeLanguage(elem)
  1363. {
  1364.   if (window.XMLHttpRequest)
  1365.   {
  1366.     var parameters = "language="+elem.options[elem.options.selectedIndex].value;
  1367.     var xhr = new XMLHttpRequest();
  1368.     if (xhr)
  1369.     {
  1370.       xhr.onreadystatechange = function(){ if (xhr.readyState == 4) { document.location.href = document.location.href; } };
  1371.       xhr.open("POST", "/change_lang.html", true);
  1372.       xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  1373.       xhr.send(parameters);
  1374.     }
  1375.   }
  1376. }
  1377.  
  1378.  
  1379. /* AJAX
  1380.    ----------------------------------------------------- */
  1381.  
  1382. function getXMLHttpRequest()
  1383. {
  1384.   if (window.XMLHttpRequest)
  1385.   {
  1386.     try
  1387.     {
  1388.       request = new XMLHttpRequest();
  1389.     }
  1390.     catch(e)
  1391.     {
  1392.       request = null;
  1393.     }
  1394.   }
  1395.   else if (window.ActiveXObject)
  1396.   {
  1397.     var XMLHttpRequestVersion = new Array();
  1398.     XMLHttpRequestVersion[0] = "MSXML2.XMLHTTP.6.0";
  1399.     XMLHttpRequestVersion[1] = "MSXML2.XMLHTTP.5.0";
  1400.     XMLHttpRequestVersion[2] = "MSXML2.XMLHTTP.4.0";
  1401.     XMLHttpRequestVersion[3] = "MSXML2.XMLHTTP.3.0";
  1402.     XMLHttpRequestVersion[4] = "MSXML2.XMLHTTP";
  1403.     XMLHttpRequestVersion[5] = "Microsoft.XMLHTTP";
  1404.  
  1405.     for (var i = 0; i < XMLHttpRequestVersion.length; i++)
  1406.     {
  1407.       try
  1408.       {
  1409.         request = new ActiveXObject(XMLHttpRequestVersion[i]);
  1410.       }
  1411.       catch(e)
  1412.       {
  1413.         request = null;
  1414.       }
  1415.     }
  1416.   }
  1417.   return request;
  1418. }
  1419.  
  1420.   /* file navtools.js */
  1421. var mainTitle="";
  1422. var pageTitle="";
  1423. var mainTitleSeparator="|";
  1424. var navLastID1=0;
  1425. var navLastID2=0;
  1426. var navLastID3=0;
  1427. var navLastID4=0;
  1428. var navLastID5=0;
  1429. var navVisibleCount1=0;
  1430. var navVisibleCount2=0;
  1431. var navVisibleCount3=0;
  1432. var navVisibleCount4=0;
  1433. var navVisibleCount5=0;
  1434. var currentURL=document.location.href;
  1435. var currNav=new Array();
  1436.  
  1437. function doLogout()
  1438. {
  1439.   if(typeof(help_window)!='undefined')help_window.close();
  1440.   top.location.href='logout.stm';
  1441. }
  1442. function checkMenuLevels(L1, L2, L3, L4, L5)
  1443. {
  1444.   if ((arguments.length>0) && (typeof(nav[L1])=='undefined'))
  1445.   {
  1446.     alert_msg('Menu L1 is missing');
  1447.   }
  1448.   if ((arguments.length>1) &&(typeof(nav[L1][L2])=='undefined'))
  1449.   {
  1450.     alert_msg('Menu L2 is missing');
  1451.   }
  1452.   if ((arguments.length>2) &&(typeof(nav[L1][L2][L3])=='undefined'))
  1453.   {
  1454.     alert_msg('Menu L3 is missing');
  1455.   }
  1456.   if ((arguments.length>3) &&(typeof(nav[L1][L2][L3][L4])=='undefined'))
  1457.   {
  1458.     alert_msg('Menu L4 is missing');
  1459.   }
  1460.   if ((arguments.length>4) &&(typeof(nav[L1][L2][L3][L4][L5])=='undefined'))
  1461.   {
  1462.     alert_msg('Menu L5 is missing');
  1463.   }
  1464. }
  1465.  
  1466. function addNavigationItem(navLevel,navLink,navCaption,navVisible)
  1467. {
  1468.   switch (navLevel)
  1469.   {
  1470.     case 1:
  1471.       navID1=navLastID1+1;
  1472.       nav[navID1]=new Array();
  1473.       nav[navID1]['link']=navLink;
  1474.       nav[navID1]['caption']=navCaption;
  1475.       nav[navID1]['visible']=navVisible;
  1476.       if(navVisible==1)navVisibleCount1++;
  1477.       nav['visible_count']=navVisibleCount1;
  1478.       nav['count']=navID1;
  1479.       navLastID1=navID1;
  1480.       navLastID2=0;
  1481.       navLastID3=0;
  1482.       navLastID4=0;
  1483.       navLastID5=0;
  1484.       navVisibleCount2=0;
  1485.       navVisibleCount3=0;
  1486.       navVisibleCount4=0;
  1487.       navVisibleCount5=0;
  1488.       break;
  1489.  
  1490.     case 2:
  1491.       navID1=navLastID1;
  1492.       navID2=navLastID2+1;
  1493.         checkMenuLevels(navID1);
  1494.       nav[navID1][navID2]=new Array();
  1495.       nav[navID1][navID2]['link']=navLink;
  1496.       nav[navID1][navID2]['caption']=navCaption;
  1497.       nav[navID1][navID2]['visible']=navVisible;
  1498.       if(navVisible==1)navVisibleCount2++;
  1499.       nav[navID1]['visible_count']=navVisibleCount2;
  1500.       nav[navID1]['count']=navID2;
  1501.       navLastID1=navID1;
  1502.       navLastID2=navID2;
  1503.       navLastID3=0;
  1504.       navLastID4=0;
  1505.       navLastID5=0;
  1506.       navVisibleCount3=0;
  1507.       navVisibleCount4=0;
  1508.       navVisibleCount5=0;
  1509.       break;
  1510.  
  1511.     case 3:
  1512.       navID1=navLastID1;
  1513.       navID2=navLastID2;
  1514.       navID3=navLastID3+1;
  1515.         checkMenuLevels(navID1, navID2);
  1516.       nav[navID1][navID2][navID3]=new Array();
  1517.       nav[navID1][navID2][navID3]['link']=navLink;
  1518.       nav[navID1][navID2][navID3]['caption']=navCaption;
  1519.       nav[navID1][navID2][navID3]['visible']=navVisible;
  1520.       if(navVisible==1)navVisibleCount3++;
  1521.       nav[navID1][navID2]['visible_count']=navVisibleCount3;
  1522.       nav[navID1][navID2]['count']=navID3;
  1523.       navLastID1=navID1;
  1524.       navLastID2=navID2;
  1525.       navLastID3=navID3;
  1526.       navLastID4=0;
  1527.       navLastID5=0;
  1528.       navVisibleCount4=0;
  1529.       navVisibleCount5=0;
  1530.       break;
  1531.  
  1532.     case 4:
  1533.       navID1=navLastID1;
  1534.       navID2=navLastID2;
  1535.       navID3=navLastID3;
  1536.       navID4=navLastID4+1;
  1537.         checkMenuLevels(navID1, navID2, navID3);
  1538.       nav[navID1][navID2][navID3][navID4]=new Array();
  1539.       nav[navID1][navID2][navID3][navID4]['link']=navLink;
  1540.       nav[navID1][navID2][navID3][navID4]['caption']=navCaption;
  1541.       nav[navID1][navID2][navID3][navID4]['visible']=navVisible;
  1542.       if(navVisible==1)navVisibleCount4++;
  1543.       nav[navID1][navID2][navID3]['visible_count']=navVisibleCount4;
  1544.       nav[navID1][navID2][navID3]['count']=navID4;
  1545.       navLastID1=navID1;
  1546.       navLastID2=navID2;
  1547.       navLastID3=navID3;
  1548.       navLastID4=navID4;
  1549.       navLastID5=0;
  1550.       navVisibleCount5=0;
  1551.       break;
  1552.  
  1553.     case 5:
  1554.       navID1=navLastID1;
  1555.       navID2=navLastID2;
  1556.       navID3=navLastID3;
  1557.       navID4=navLastID4;
  1558.       navID5=navLastID5+1;
  1559.         checkMenuLevels(navID1, navID2, navID3, navID4);
  1560.       nav[navID1][navID2][navID3][navID4][navID5]=new Array();
  1561.       nav[navID1][navID2][navID3][navID4][navID5]['link']=navLink;
  1562.       nav[navID1][navID2][navID3][navID4][navID5]['caption']=navCaption;
  1563.       nav[navID1][navID2][navID3][navID4][navID5]['visible']=navVisible;
  1564.       if(navVisible==1)navVisibleCount5++;
  1565.       nav[navID1][navID2][navID3][navID4]['visible_count']=navVisibleCount5;
  1566.       nav[navID1][navID2][navID3][navID4]['count']=navID5;
  1567.       navLastID1=navID1;
  1568.       navLastID2=navID2;
  1569.       navLastID3=navID3;
  1570.       navLastID4=navID4;
  1571.       navLastID5=navID5;
  1572.       break;
  1573.   }
  1574. }
  1575.  
  1576.  
  1577. function getCurrentNavigationID2(navBranch,level)
  1578. {
  1579.   if(typeof(navBranch)!='undefined')
  1580.   {
  1581.     for(currNav[level]=1;currNav[level]<=navBranch['count'];currNav[level]++)
  1582.     {
  1583.       if(typeof(navBranch[currNav[level]]['count'])!='undefined')
  1584.       {
  1585.         if(getCurrentNavigationID2(navBranch[currNav[level]],level+1))
  1586.         {
  1587.           return true;
  1588.         }
  1589.       }
  1590.       if(instr(currentURL,navBranch[currNav[level]]['link']))
  1591.       {
  1592.         return true;
  1593.       }
  1594.     }
  1595.   }
  1596.   currNav[level]=0;
  1597.   return false;
  1598. }
  1599.  
  1600. function getPageTitle(nav,level)
  1601. {
  1602.   if(typeof(currNav[level])!='undefined')
  1603.   {
  1604.     if(currNav[level]!=0)
  1605.     {
  1606.       pageTitle=nav[currNav[level]]['caption'];
  1607.       getPageTitle(nav[currNav[level]],level+1);
  1608.     }
  1609.   }
  1610. }
  1611.  
  1612. function getCurrentNavigationID(newMainTitle)
  1613. {
  1614.   mainTitle=newMainTitle;
  1615.   pageTitle='Configuration';
  1616.   getCurrentNavigationID2(nav,1);
  1617.   getPageTitle(nav,1);
  1618.   return;
  1619. }
  1620.  
  1621. function writeNavigation()
  1622. {
  1623.   if(typeof(currNav[1])!='undefined')
  1624.   {
  1625.     if((currNav[1]>0)&&(nav[currNav[1]]['visible']==1))
  1626.     {
  1627.       navigationTabs='<table border="0" cellspacing="0" cellpadding="0">';navigationTabs+='<tr>';for(var i=1;i<=nav['count'];i++){if(nav[i]['visible']==1){navigationTabs+='<td style="padding:0;"><a'+((i==currNav[1])?' class="active'+(i-1)+'"':'')+' href="'+nav[i]['link']+'">'+nav[i]['caption']+'<\/a><\/td>';}}navigationTabs+='<\/tr>';navigationTabs+='<\/table>';document.write(navigationTabs);
  1628.     }
  1629.   }
  1630. }
  1631.  
  1632. function writeNavigationA(navBranch,level)
  1633. {
  1634.   if(typeof(navBranch)=='undefined') return;
  1635.   for(var navNodeNo=1;navNodeNo<=navBranch['count'];navNodeNo++)
  1636.   {
  1637.     document.write(level+":"+navBranch[navNodeNo]['caption']+"|"+navBranch[navNodeNo]['visible']+"<br>");writeNavigationA(navBranch[navNodeNo],level+1);
  1638.   }
  1639. }
  1640.  
  1641. function writeSubNavigation2(navBranch,level)
  1642. {
  1643.   var subsel;
  1644.   if(typeof(navBranch)!='undefined')
  1645.   {
  1646.     if((navBranch['count']>0)&&(navBranch['visible_count']>0))
  1647.     {
  1648.       document.write('<ul>');if(typeof(currNav[level+1])!='undefined'){subsel=currNav[level+1];}else{subsel=0;}nextsubsel=0;if(typeof(currNav[level+2])!='undefined'){if(typeof(navBranch[currNav[level+1]][currNav[level+2]])!='undefined'){if(navBranch[currNav[level+1]][currNav[level+2]]['visible']==1){nextsubsel=currNav[level+2];}}}for(var navNodeNo=1;navNodeNo<=navBranch['count'];navNodeNo++){document.write('<li>');if(navBranch[navNodeNo]['visible']==1){document.write('<div'+(((subsel==navNodeNo)&&(nextsubsel==0))?' class="activeSub" style="width: '+(220-level*12)+'px;"':'')+'>');document.write('<div><a href="'+navBranch[navNodeNo]['link']+'">'+navBranch[navNodeNo]['caption']+'<\/a><\/div><\/div>');}if(subsel==navNodeNo){writeSubNavigation2(navBranch[navNodeNo],level+1);}document.write('<\/li>');}document.write('<\/ul>');
  1649.     }
  1650.   }
  1651. }
  1652.  
  1653. function writeSubNavigation()
  1654. {
  1655.   writeSubNavigation2(nav[currNav[1]],1);document.title=pageTitle+' '+mainTitleSeparator+' '+mainTitle;
  1656. }
  1657.   /* file navnodes.js */
  1658. nav = new Array();
  1659.  
  1660.  
  1661. /*************
  1662.     Merkur
  1663. *************/
  1664.  
  1665. /* Begining of the PSTN-VoIP Variant */
  1666.  
  1667.   addNavigationItem (1, 'nowhere.xxx', '', 0);
  1668.   addNavigationItem (2, 'login.html', 'Login', 1);
  1669.   addNavigationItem (1, 'security_advice.html', 'Security Advice', 0);
  1670.  
  1671.  
  1672.   addNavigationItem (1, 'home.html', 'Home', 1);
  1673.  
  1674.  
  1675.  
  1676.  
  1677.   // Settings
  1678.   addNavigationItem (1, 'settings_lan.html', 'Settings', 1);
  1679.    
  1680.  
  1681.     // Network
  1682.     addNavigationItem (2, 'settings_lan.html', 'Network', 1);
  1683.       //
  1684.       // IP Configuration
  1685.       addNavigationItem (3, 'settings_lan.html', 'IP Configuration', 1);
  1686.       //
  1687.  
  1688.       //Security
  1689.       addNavigationItem (3, 'settings_telephony_security.html', 'Security', 1);
  1690.  
  1691.  
  1692.  
  1693.     //
  1694.     // Telephony
  1695.     addNavigationItem (2, 'settings_telephony_voip_multi.html', 'Telephony', 1);
  1696.       //
  1697.       // Connections
  1698.      
  1699.       addNavigationItem (3, 'settings_telephony_voip_multi.html', 'Connections', 1);
  1700.       addNavigationItem (4, 'settings_telephony_voip.html', 'Connections', 0);
  1701.       addNavigationItem (4, 'settings_telephony_pstn.html', 'Connections', 0);
  1702.       addNavigationItem (4, 'settings_telephony_shc.html', 'Connections', 0);
  1703.      
  1704.       //
  1705.       //Audio
  1706.       addNavigationItem (3, 'settings_telephony_audio.html', 'Audio', 1);
  1707.       //
  1708.       // Number Assignment
  1709.       addNavigationItem (3, 'settings_telephony_assignment.html', 'Number Assignment', 1);
  1710.       //
  1711.  
  1712.       //Call Divert
  1713.      
  1714.       addNavigationItem (3, 'settings_telephony_callforwarding.html', 'Call Divert', 1);
  1715.      
  1716.       //
  1717.       // Dialling Plans
  1718.       addNavigationItem (3, 'settings_telephony_dialplan.html', 'Dialling Plans', 1);
  1719.       //
  1720.       // Network Mailboxes
  1721.       addNavigationItem (3, 'settings_telephony_network_mailboxes.html', 'Network mailboxes', 1);
  1722.       //
  1723.       //Advanced VoIP-Settings
  1724.       addNavigationItem (3, 'settings_telephony_advanced.html', 'Advanced VoIP Settings', 1);
  1725.  
  1726.  
  1727.     //
  1728.     // Messaging
  1729.    
  1730.     addNavigationItem (2, 'settings_messaging_email.html', 'Messaging', 1)
  1731.    
  1732.  
  1733.    
  1734.  
  1735.       //
  1736.       // E-mail
  1737.      
  1738.       addNavigationItem (3, 'settings_messaging_email.html', 'Email', 1)
  1739.       addNavigationItem (4, 'settings_messaging_email_editor.html', 'Email', 0);
  1740.      
  1741.       //
  1742.       // MWI Light
  1743.       addNavigationItem (3, 'settings_mwi_light.html', 'Message Notification', 1)
  1744.  
  1745.       // Elements
  1746.      
  1747.    
  1748.    
  1749.     // Info Services
  1750.     addNavigationItem (2, 'settings_infoservice.html', 'Info Services', 1);
  1751.    
  1752.    
  1753.  
  1754.  
  1755.  
  1756. // Directories for other variants than Netia
  1757.     //
  1758.     // Directories
  1759.     addNavigationItem (2, 'settings_services_online_directory.html', 'Directories', 1);
  1760.       //
  1761.       // Online Directory
  1762.       addNavigationItem (3, 'settings_services_online_directory.html', 'Online Directory', 1);
  1763.       //  
  1764.  
  1765.       //Additional Provider
  1766.       addNavigationItem (4, 'settings_online_directory_additional_provider.html', 'Online Directory', 0);
  1767.  
  1768.  
  1769.  
  1770.       // "Directory Transfer"
  1771.       addNavigationItem (3, 'settings_phonebook_transfer.html', 'Directory Transfer', 1);
  1772.  
  1773.  
  1774.  
  1775.  
  1776.     // Management
  1777.     addNavigationItem (2, 'settings_management_date_n_time.html', 'Management', 1);
  1778.       //
  1779.       // Date & Time
  1780.       addNavigationItem (3, 'settings_management_date_n_time.html', 'Date and Time', 1);
  1781.       //
  1782.       // Local Settings
  1783.       addNavigationItem (3, 'settings_management_local_settings.html', 'Local Settings ', 1);
  1784.       //
  1785.       // Miscellaneous
  1786.       addNavigationItem (3, 'settings_management_miscellaneous.html', 'Miscellaneous', 1);
  1787.       //
  1788.       // Reboot & Reset
  1789.       addNavigationItem (3, 'settings_management_reboot_and_reset.html', 'Reboot & Reset ', 1);
  1790.       //
  1791.       // Save & Restore
  1792.       addNavigationItem (3, 'settings_management_save_and_restore.html', 'Save and Restore', 1);
  1793.  
  1794.       //
  1795.       // Firmware Update
  1796.       addNavigationItem (3, 'settings_management_firmware_update.html', 'Firmware Update', 1);
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.     // Status
  1804.     addNavigationItem (1, 'status_device.html', 'Status', 1);
  1805.       //
  1806.       // Status
  1807.       addNavigationItem (2, 'status_device.html', 'Status', 1);
  1808.       //
  1809.       // Device
  1810.       addNavigationItem (3, 'status_device.html', 'Device', 1);
  1811.       //
  1812.       // (Status) Connections
  1813.       addNavigationItem (3, 'status_connections.html', 'Connections', 1);
  1814.  
  1815.   //
  1816.   getCurrentNavigationID('C530 IP');
  1817.  
  1818. /* End of PSTN-VoIP Variant */
  1819.  
  1820.  
  1821. ///////////////////////////////////////////////////////////////////////////////
  1822.  
  1823.  
  1824.  
  1825. ///////////////////////////////////////////////////////////////////////////////
  1826.  
  1827.  
  1828. /********************
  1829.     End of Merkur
  1830. ********************/
  1831.  
  1832.  
  1833.  
  1834.   /* file help.js */
  1835. function open_gigaset_help_window() {
  1836.   var tmp_popup_identifier = 'gigaset_help';
  1837.   var tmp_popup_width = 500;
  1838.   var tmp_popup_height = 300;
  1839.  
  1840.   if(window.innerWidth)
  1841.   {
  1842.     //FF
  1843.     var tmp_popup_x = (window.screenX + window.outerWidth - tmp_popup_width - 20);
  1844.   }
  1845.   else
  1846.   {
  1847.     //Everything else
  1848.     var tmp_popup_x = (screen.width - tmp_popup_width - 50);
  1849.   }
  1850.  
  1851.   if (window.screenY)
  1852.   {
  1853.     //FF, Safari, Opera
  1854.     if(window.innerHeight)
  1855.     {
  1856.       //FF
  1857.       var tmp_popup_y = window.screenY + window.outerHeight - window.innerHeight - 20 ;
  1858.     }
  1859.     else
  1860.     {
  1861.       //Safari, Opera
  1862.       var tmp_popup_y = window.screenY + 150;
  1863.     }
  1864.   }
  1865.   else
  1866.   {
  1867.     //IE, Chrome
  1868.     var tmp_popup_y = window.screenTop +50;
  1869.   };
  1870.   var help_window = window.open("help.html", tmp_popup_identifier, "dependent=yes,directory=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width="+tmp_popup_width+",height="+tmp_popup_height+",left="+tmp_popup_x+",top="+tmp_popup_y+"");
  1871.   help_window.focus();
  1872. }
  1873.  
  1874.   /* file blocks.js */
  1875. function writeBlockStaticAreaTop()
  1876. {      
  1877.   var argv = writeBlockStaticAreaTop.arguments;
  1878.   var argc = writeBlockStaticAreaTop.arguments.length;
  1879.   var withTabs = (argc > 0) ? argv[0] : true;
  1880.   var withLogout = (argc > 1) ? argv[1] : true;
  1881.  
  1882.   //  +++++++++++++++++++++++++  
  1883.   //  BEGINN STATIC AREA TOP  
  1884.  
  1885.   //  Gigaset logo & product name  
  1886.   document.write('<div id="Gigalogo"><table border="0" cellspacing="0" cellpadding="0" width=100% ><tr>');
  1887.   switch (labeling)
  1888.   {
  1889.     case 1:
  1890.       document.write('<td id="logotd" width="1"><img src="images/dip-phone-450.gif" alt="product" border="0" ><\/td>');
  1891.       break;
  1892.     case 2:
  1893.       document.write('<td id="logotd" width="1"><img src="images/tesco.gif" alt="TESCO" border="0" ><\/td>');
  1894.       document.write('<td id="productnametxt" style="padding-bottom: 8px;">C530 IP<\/td>');
  1895.       break;
  1896.     case 3:
  1897.       document.write('<td id="logotd" width="1"><img id="bannername" src="images/t-home-banner.gif" alt="T-HOME" border="0" ><\/td>');
  1898.       break;
  1899.     case 4:
  1900.       document.write('<td id="logotd" width="1"><img src="images/stc.gif" alt="Saudi Telecom" border="0"><\/td>');
  1901.  
  1902.  
  1903.       document.write('<td id="productnametxt" >C530 IP<\/td>');
  1904.  
  1905.       break;
  1906.     case 5:
  1907.       document.write('<td id="logotd" width="1"><img id="bannername" src="flexible_provider_logo.gif" alt="provider_logo" border="0" ><\/td>');
  1908.       document.write('<td id="productnametxt" style="vertical-align:middle;" align="left">C530 IP<\/td>');
  1909.       break;
  1910.     case 6:
  1911.       document.write('<td id="logotd" width="1"><img src="vox/images/supafone.gif" alt="Supafone" border="0" align=left><\/td>');
  1912.       break;
  1913.     case 7:
  1914.       document.write('<td id="logotd" width="1"><img src="images/gigaset_p.gif" alt="Gigaset" border="0" align=left><\/td>');
  1915.       document.write('<td id="productnametxt" align="left" >C530 IP<\/td>');
  1916.       break;
  1917.     case 8:
  1918.       document.write('<td id="productnametxt" align="left" >C530 IP<\/td>');
  1919.       document.write('<td id="logotd" width="1"><img src="elmeg/images/elmeg.gif" alt="elmeg" border="0" align=right><\/td>');      
  1920.       break;
  1921.     case 10:
  1922.       document.write('<td id="logotd" width="1"><img src="upc/images/logo.png" height="70px" width="70px" alt="UPC" border="0" align=left><\/td>');
  1923.       document.write('<td id="productnametxt" align="left" >C530 IP<\/td>');      
  1924.       break;
  1925.     default:
  1926.       document.write('<td id="logotd" width="1"><img src="images/gigaset.png" alt="Gigaset" border="0" align=left><\/td>');
  1927.  
  1928.  
  1929.       document.write('<td id="productnametxt" align="left" >C530 IP<\/td>');
  1930.  
  1931.   }
  1932. // ESz right up corner - SIEMENS logo  
  1933.   switch (labeling)
  1934.   {
  1935.     case 1:
  1936.       document.write('<td id="logotdup" style="vertical-align:middle;" align=right><img src="images/targa.gif" alt="Targa" border="0" ><\/td>');
  1937.       break;
  1938.     case 3:
  1939.       break;
  1940.     case 4:
  1941.       break;
  1942.     case 7:
  1943.       break;
  1944.     default:
  1945.       break;
  1946.   }
  1947.  
  1948.  
  1949.   document.write('<\/tr><\/table><\/div>');
  1950.  
  1951.   //navigationtab
  1952.   if (withTabs)
  1953.   {
  1954.   document.write('<div id="div_tabs">');
  1955.   writeNavigation();    
  1956.     if (labeling == 3)
  1957.     {
  1958.       document.write('<div id="sinus_produkt_name"><img src="images/produktname.gif" alt="Product" border="0" ><\/div>');
  1959.     }
  1960.   document.write('<\/div>');
  1961.   }
  1962.  
  1963.   //  logout  
  1964.   document.write('<div id="div_home_logout">');  
  1965.   if (withLogout)
  1966.   {
  1967.     document.write('<a id="logouttoptext" href="logout.html" title="End the configuration session">Log off<\/a>');
  1968.   }
  1969.   else
  1970.   {
  1971.     document.write('&nbsp;');
  1972.   }
  1973.   document.write('<\/div>');
  1974.  
  1975.   //  top area of grey  
  1976.  
  1977.  
  1978.   document.write('<div id="greyTop"><img src="images/spacer.gif" alt="" width="1" height="5" border="0" ><\/div>');
  1979.  
  1980.  
  1981.   //   middle area of grey  
  1982.   document.write('<div id="greyMiddle">');
  1983.  
  1984.   //  END STATIC AREA TOP  
  1985.   //  +++++++++++++++++++++++++  
  1986. }
  1987.  
  1988. function writeBlockSubmenu()
  1989. {
  1990.   //  the menue on the left side  
  1991.   document.write('<div id="div_menue">');
  1992.   writeSubNavigation();
  1993.   document.write('<\/div>');
  1994.   //  END of menue  
  1995. }
  1996.  
  1997. function writeBlockHelp()
  1998. {
  1999.   var argv = writeBlockHelp.arguments;
  2000.   var argc = writeBlockHelp.arguments.length;
  2001.   var writehelp = (argc > 0) ? argv[0] : true;
  2002.  
  2003.   document.write('<div id="div_help">');
  2004.   if (writehelp && 1 && (labeling != 9)) // no help access for Netia
  2005.   {
  2006.     switch (labeling)
  2007.     {
  2008.       case 7:
  2009.         document.write('<a href=" " onclick="javascript:open_gigaset_help_window(); return false;" title=""><img src="images/help_p.gif" alt="" width="20" height="30" border="0" ><\/a>');
  2010.         break;
  2011.  
  2012.       default:
  2013.         document.write('<a href=" " onclick="javascript:open_gigaset_help_window(); return false;" title=""><img src="images/help.gif" alt="" width="20" height="30" border="0" ><\/a>');
  2014.         break;
  2015.     }
  2016.   }
  2017.   else
  2018.   {
  2019.     document.write('&nbsp;');
  2020.   }
  2021.   document.write('<\/div>');
  2022. }
  2023.  
  2024. function writeBlockStaticAreaBottom()
  2025. {
  2026.   //  +++++++++++++++++++++++++  
  2027.   //  BEGINN STATIC AREA BOTTOM  
  2028.  
  2029.   document.write('<\/div>');
  2030.   //   END middle area of grey  
  2031.    
  2032.   //  bottom area of grey  
  2033.   document.write('<div id="greyBottom"><img src="images/spacer.gif" alt="" width="1" height="7" border="0" ><\/div>');
  2034.  
  2035.   switch (labeling)
  2036.     {
  2037.         case 6: // AICS_VARIANT_VOX
  2038.         document.write('<div id="Siemenslogo" style="padding-right: 30px;"><img src="vox/images/vox.gif" alt="vox" border="0" ><\/div>');
  2039.         break;
  2040.     case 11: // AICS_VARIANT_O2
  2041.     case 9:  // AICS_VARIANT_NETIA
  2042.         writeLanguageDropdown();
  2043.         break;
  2044.     default:
  2045.       ;
  2046.     }
  2047.    
  2048.   //  END STATIC AREA BOTTOM  
  2049.   //  +++++++++++++++++++++++++  
  2050. }
  2051.  
  2052.  
  2053. function writeBlockStaticAreaBottomLicense()
  2054. {
  2055.   //  +++++++++++++++++++++++++  
  2056.   //  BEGINN STATIC AREA BOTTOM LICENSE  
  2057.    
  2058.   //  license text  
  2059.   switch (labeling)
  2060.   {
  2061.     case 7:
  2062.       document.write('<div style="vertical-align: top; text-align: left;font-size: 12px;">&copy; Gigaset Communications GmbH. All rights reserved.<\/div>');
  2063.       break;
  2064.     case 8:
  2065.       break;
  2066.     default:
  2067.       document.write('<div style="vertical-align: top; text-align: left;font-size: 12px;" id="bottomcopytext" >&copy; Gigaset Communications GmbH. All rights reserved.<\/div>');
  2068.       break;
  2069.   }
  2070.  
  2071.   //  END STATIC AREA BOTTOM LICENSE  
  2072.   //  +++++++++++++++++++++++++  
  2073. }
  2074.  
  2075.   function locking_message(evt)
  2076. {
  2077.   if (!evt) var evt = window.event;
  2078.   evt.preventDefault ? evt.preventDefault() : evt.returnValue = false;
  2079.   alert_msg("The PIN you entered was incorrect. For security reasons, the PIN field will be locked for a few seconds.");
  2080.   document.getElementById("password").focus();
  2081. }
  2082.  
  2083. function alter_password_field()
  2084. {
  2085.  
  2086.   var lockingTime = 1000;
  2087.   var pass = document.getElementById("password");
  2088.  
  2089.   // changing password field
  2090.   pass.readOnly = true;
  2091.   submit_gigaset_form = function()
  2092.                         {
  2093.                           alert_msg("The PIN you entered was incorrect. For security reasons, the PIN field will be locked for a few seconds.");
  2094.                           document.getElementById("password").focus();
  2095.                         };
  2096.  
  2097.  
  2098.   pass.style.backgroundColor = "#DDDDDD";
  2099.  
  2100.  
  2101.   if (pass.addEventListener)
  2102.   {
  2103.     pass.addEventListener('click',locking_message,false);
  2104.         pass.addEventListener('keypress', locking_message, false);
  2105.   }
  2106.   else if (pass.attachEvent)
  2107.   {
  2108.     pass.attachEvent('onclick', locking_message);
  2109.         pass.attachEvent('onkeypress', locking_message);
  2110.   }
  2111.   else
  2112.   {
  2113.     pass.onclick = locking_message;
  2114.     pass.onkeypress = locking_message;
  2115.   }
  2116.  
  2117.   // setting timeouts for changes
  2118.   setTimeout(function()
  2119.              {
  2120.                document.getElementById('password').readOnly = false;
  2121.                submit_gigaset_form = function()
  2122.                                      {
  2123.                                        document.gigaset.submit();
  2124.                                      };
  2125.              }, lockingTime);
  2126.  
  2127.  
  2128.   if (pass.removeEventListener)
  2129.   {
  2130.     setTimeout(function()
  2131.                {
  2132.                  document.getElementById('password').removeEventListener('click',locking_message,false);
  2133.                  document.getElementById('password').removeEventListener('keypress',locking_message,false);
  2134.                  document.getElementById('password').blur();
  2135.                  document.getElementById('password').focus();
  2136.                                  
  2137.                                  document.getElementById("password").style.backgroundColor = "#ffffff";
  2138.                                  
  2139.                }, lockingTime);
  2140.   }
  2141.   else if (pass.detachEvent)
  2142.   {
  2143.     setTimeout(function()
  2144.                {
  2145.                  document.getElementById('password').detachEvent('onclick',locking_message);
  2146.                  document.getElementById('password').detachEvent('onkeypress',locking_message);
  2147.                  document.getElementById('password').blur();
  2148.                  document.getElementById('password').focus();
  2149.                                  
  2150.                                  document.getElementById("password").style.backgroundColor = "#ffffff";
  2151.                                  
  2152.                }, lockingTime);
  2153.   }
  2154.   else
  2155.   {
  2156.     setTimeout(function()
  2157.                {
  2158.                  document.getElementById('password').onclick = function(){ };
  2159.                  document.getElementById('password').onkeypress = function(){ };
  2160.                  document.getElementById('password').blur();
  2161.                  document.getElementById('password').focus();
  2162.                                  
  2163.                                  document.getElementById("password").style.backgroundColor = "#ffffff";
  2164.                                  
  2165.                }, lockingTime);
  2166.   }
  2167. }
  2168.  
  2169.   //-->
  2170.   </script>
  2171.   <!-- additional scripts for special tasks -->
  2172.   <script language="JavaScript" type="text/javascript">
  2173.   <!--
  2174.     var error = 0;
  2175.  
  2176.     function focus_gigaset_form()
  2177.     {
  2178.       switch (error-0)
  2179.       {
  2180.         case 0x01:    // wrong pass
  2181.             alert_msg('Invalid System PIN.');
  2182.             document.getElementById("password").focus();
  2183.             break;
  2184.  
  2185.         case 0x02:    // session running
  2186.             alert_msg('Access denied - session already initialized by another client.');
  2187.             break;
  2188.  
  2189.         case 0x04:    //fw download running
  2190.             alert_msg('Please wait for firmware update to finish.');
  2191.             break;
  2192.  
  2193.         case 0x05:    // Rebooting device
  2194.             break;
  2195.  
  2196.         case 0x07:    //settings restore requires reset
  2197.             alert_msg('Please wait until the settings have been restored.');
  2198.             break;
  2199.  
  2200.         case 0xA0:    // lang download running
  2201.         case 0xA4:    // lang download running - ok
  2202.             setTimeout('document.location.href="login.html";',5000);
  2203.             break;
  2204.  
  2205.         case 0xA1:    // lang download error - not reachable
  2206.         case 0xA2:    // lang download error - transfer error
  2207.         case 0xA3:    // lang download error - file corrupt
  2208.             setTimeout('document.location.href="login.html";',5000);
  2209.             break;
  2210.  
  2211.         default:
  2212.             ;
  2213.       }
  2214.  
  2215.  
  2216.       document.getElementById("password").focus();
  2217.  
  2218.     }
  2219.  
  2220.     function submit_gigaset_form()
  2221.     {
  2222.       document.gigaset.submit();
  2223.     }
  2224.  
  2225.     function change_lang() {
  2226.       document.gigaset.submit();
  2227.     }
  2228.   //-->
  2229.   </script>
  2230.  
  2231.   <!-- external stylesheet for common elements -->
  2232.  
  2233.  
  2234.   <link rel="stylesheet" type="text/css" media="screen" href="styles/main.css">
  2235.   <link rel="stylesheet" type="text/css" media="screen" href="styles/siemens.css">
  2236.  
  2237.  
  2238.   <style type="text/css">
  2239.     #container {display:none;}        
  2240.   </style>
  2241.  
  2242.    <link rel="shortcut icon" href="/images/favicon.ico">
  2243.  
  2244. </head>
  2245. <body onunload="" onLoad="focus_gigaset_form(); fixDropDownForIE8();">
  2246.  
  2247.   <noscript>        
  2248.     <div class="noscriptmsg">    
  2249.       <h1>You don&#39;t have JavaScript enabled. You need to have JavaScript enabled to use this page.</h1>
  2250.     </div>
  2251.   </noscript>
  2252.  
  2253.   <!--  CONTAINER -->
  2254.   <div id="container">
  2255.  
  2256.     <script language="JavaScript" type="text/javascript">
  2257.       writeBlockStaticAreaTop(false, false);
  2258.       // writeBlockSubmenu();
  2259.     </script>
  2260.  
  2261.       <!-- content -->
  2262.       <div id="content">
  2263.       <div id="minheight340"></div>
  2264.       <form name="gigaset" action="login.html" onsubmit="javascript:submit_gigaset_form(); return false;" method="post" style="padding:1px;">
  2265.         <div class="contentTable">
  2266.           <table border="0" cellspacing="0" cellpadding="0" style="width:230px;">
  2267.            
  2268.             <tr>
  2269.               <td colspan="2"><h1>Welcome</h1></td>
  2270.             </tr>
  2271.             <tr>
  2272.             <td colspan="2"
  2273.               >You can use this interface to administer your device. For your security, the configuration program is protected with the system PIN.
  2274.               <br><br>
  2275.             </td>
  2276.             </tr>
  2277.             <tr>
  2278.               <td colspan="2">Please choose your language for menus and dialogs:</td>
  2279.             </tr>
  2280.             <tr>
  2281.               <td colspan="2">
  2282.                 <select name="language" onchange="javascript:change_lang();" style="width:100px;">
  2283.                 <option value='1' selected='selected'>English</option><option value='2'>Deutsch</option><option value='9'>Français</option><option value='10'>Nederlands</option><option value='7'>Italiano</option><option value='23'>Русский</option><option value='4'>Espanol</option><option value='20'>Portugues (BR)</option><option value='17'>Polski</option><option value='24'>Ελληνικά</option><option value='5'>Portugues</option><option value='15'>Čeština</option><option value='16'>Turkce</option>
  2284.                 </select>
  2285.               </td>
  2286.             </tr>
  2287.             <tr>
  2288.               <td colspan="2">&nbsp;</td>
  2289.             </tr>
  2290.             <tr>
  2291.             <td colspan="2"
  2292.             >Please enter your system PIN:
  2293.             <br></td>
  2294.             </tr>
  2295.             <tr>
  2296.               <td style="vertical-align:middle;">        
  2297.                 <div class="edit_100">
  2298.  
  2299.  
  2300.                   <input type="password" maxlength="4" size="30" class="textfield edit_100" value="" name="password" id="password" style="width:100px;" onkeydown="if(checkIfValidKeyToCallNext(event)) submit_gigaset_form();" onkeypress="return isValidPin(this, event, 4);">&nbsp;&nbsp;
  2301.  
  2302.                 </div>
  2303.               </td>
  2304.               <td style="vertical-align:top;"><a href="#" onclick="javascript:submit_gigaset_form(); return false;" class="buttonLink100">OK</a></td>
  2305.             </tr>
  2306.            
  2307.  
  2308.            
  2309.           </table>
  2310.         </div>
  2311.         <div id="productimg">
  2312.         <img src="images/product_housing.jpg" alt="" border="0" >
  2313.         </div>
  2314.       </form>
  2315.      
  2316.       <div id="endminheight"></div>
  2317.       </div>
  2318.       <!-- END of content -->
  2319.      
  2320.     <script language="JavaScript" type="text/javascript">
  2321.       writeBlockHelp(false);
  2322.       writeBlockStaticAreaBottom();
  2323.       writeBlockStaticAreaBottomLicense();
  2324.  
  2325.       document.getElementById("container").style.display = "block";
  2326.    
  2327.     </script>
  2328.  
  2329.   </div>
  2330.   <!-- END CONTAINER -->
  2331.  
  2332.  
  2333. </body>
  2334. </html>
  2335.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement