<html>
   <head>
      <style type="text/css">
      ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; }
      ul#tabs li { display: inline; }
      ul#tabs li a { color: #42454a; background-color: #dedbde; border: 1px solid #c9c3ba; border-bottom: none; padding: 0.3em; text-decoration: none; }
      ul#tabs li a:hover { background-color: #f1f0ee; }
      ul#tabs li a.selected { color: #000; background-color: #f1f0ee; font-weight: bold; padding: 0.7em 0.3em 0.38em 0.3em; }
      div.tabContent { border: 1px solid #c9c3ba; padding: 0.5em; background-color: #f1f0ee; }
      div.tabContent.hide { display: none; }
      </style>

      <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
      <link rel="stylesheet" href='stylemain.css' type='text/css'>
      <link rel="stylesheet" href='colors.css' type='text/css'>
      <script language="javascript" src="util.js"></script>
      <script type="text/javascript" src="lang/b28n.js"></script>

<script language="javascript">

//setLanguage('<%ejGet(webUILanguage)%>'); 
// Butterlate.setTextDomain("advanced_1");

/*
function initTranslation() {
	var idArray = new Array("voiceIMSset","voiceIMSAkaEn","voiceIMSRportEn","voiceIMSAcNwifEn","voiceIMSUrlPortEn","voiceIMSUrlTranpEn",
		"voiceIMSCallIDEn","voiceIMSIntRingId","voiceIMSExtRingId","voiceIMSSigCompEn","voiceIMSOPValue","voiceIMSAcNwifInfo",
		"voiceIMSDisRing","voiceIMSSecAllin","voiceIMSResoRes","voiceIMSErMedia");
	setAllIdValue(idArray);
}
*/

var maxLines = new Array();
var maxSp = 			'<%ejGetVoice(maxSp)%>';
var sessionKey=			'<%ejGetOther(sessionKey)%>';
var voiceRunning = 		'<%ejGetVoice(voiceStatus)%>';
var telUrlTypeList =    '<%ejGetVoice(telUrlTypeList)%>';

for (var i = 0; i < maxSp; i++) {
	eval( "var re" + i + " \= \"\" " );
	eval( "var akae" + i + " \= \"\" " );
	eval( "var pane" + i + " \= \"\" " );
	eval( "var upe" + i + " \= \"\" " );
	eval( "var ute" + i + " \= \"\" " );
	eval( "var phc" + i + " \= \"\" " );
	eval( "var inr" + i + " \= \"\" " );
	eval( "var exr" + i + " \= \"\" " );
	eval( "var sipce" + i + " \= \"\" " );   
	eval( "var akaop" + i + " \= \"\" " );
	eval( "var pani" + i + " \= \"\" " );
	eval( "var drl" + i + " \= \"\" " );
	eval( "var sat" + i + " \= \"\" " );
	eval( "var pdt" + i + " \= \"\" " );
	eval( "var emt" + i + " \= \"\" " );
	
   var tmpml = '<%ejGetVoice(maxLines)%>';
   eval(tmpml);
   
   eval("maxLines[" + i + "] = ml" + i);

   for (var j = 0; j < maxLines[i]; j++) {
   		eval( "var subr" + i + "_" + j + " \= \"\" " );
		eval( "var subu" + i + "_" + j + " \= \"\" " );
		eval( "var tue" + i + "_" + j + " \= \"\" " );
		eval( "var tut" + i + "_" + j + " \= \"\" " );
		eval( "var imscu" + i + "_" + j + " \= \"\" " );
   }
}

var tmpre        ='<%ejGetVoice(RportEnable)%>';
var tmpakae      ='<%ejGetVoice(akaAuthEnable)%>';
var tmppane	     ='<%ejGetVoice(pAccessNwifEnable)%>';
var tmpupe       ='<%ejGetVoice(urlPortEnable)%>';
var tmpute       ='<%ejGetVoice(urlTransportEnable)%>';
var tmpphc       ='<%ejGetVoice(pheaderCid)%>';
var tmpinr       ='<%ejGetVoice(internalRingId)%>';
var tmpexr  	 ='<%ejGetVoice(externalRingId)%>';
var tmpsipce 	 ='<%ejGetVoice(sipcompEnable)%>';
var tmpakaop     ='<%ejGetVoice(akaAuthOp)%>';
var tmppani	     ='<%ejGetVoice(pAccessNwifInfo)%>';
var tmpdrl       ='<%ejGetVoice(distRingList)%>';
var tmpsat       ='<%ejGetVoice(secAgreeType)%>';
var tmppdt       ='<%ejGetVoice(preconditionType)%>';
var tmpemt       ='<%ejGetVoice(earlyMediaType)%>';
var tmpsubr      ='<%ejGetVoice(subsReg)%>';
var tmpsubu		 ='<%ejGetVoice(subsUA)%>';
var tmptue 		 ='<%ejGetVoice(telUrlEnable)%>';
var tmptut       ='<%ejGetVoice(telUrlType)%>';
var tmpimscu	 ='<%ejGetVoice(IMSConferenceUri)%>';

eval(tmpre);
eval(tmpakae);
eval(tmppane);
eval(tmpupe);
eval(tmpute);
eval(tmpphc);
eval(tmpinr);
eval(tmpexr);
eval(tmpsipce);
eval(tmpakaop);
eval(tmppani);
eval(tmpdrl);
eval(tmpsat);
eval(tmppdt);
eval(tmpemt);

if ( tmpsubr.search("ejGetVoice") < 0 ) {
   eval( tmpsubr );
}
if ( tmpsubu.search("ejGetVoice") < 0 ) {
   eval( tmpsubu );
}
if ( tmptue.search("ejGetVoice") < 0 ) {
   eval( tmptue );
}
if ( tmptut.search("ejGetVoice") < 0 ) {
   eval( tmptut );
}
if ( tmpimscu.search("ejGetVoice") < 0 ) {
   eval( tmpimscu );
}

function btnStartSip() {
   var loc = 'voicesipstart.cmd?';

   loc += addParamsToQuery( loc, "ims");

   //Stripping quotes and spaces 
   eval( "loc = loc.replace(/[\'\" ]/g,\'\')" );

   loc += '&sessionKey=' + sessionKey;
   var code = 'location="' + loc + '"';
   eval(code);
}


function btnStopSip() {
   var loc = 'voicesipstop.cmd?';
      
   loc += addParamsToQuery( loc, "ims" ); 
 
   //Stripping quotes and spaces 
   eval( "loc = loc.replace(/[\'\" ]/g,\'\')" );

   loc += '&sessionKey=' + sessionKey;
   var code = 'location="' + loc + '"';
   eval(code);
}

function btnApplySip() {
   var loc = 'voicesipapply.cmd?';
   
   loc += addParamsToQuery( loc, "ims" );
   
   //Stripping quotes and spaces
   eval( "loc = loc.replace(/[\'\" ]/g,\'\')" );
   
   loc += '&sessionKey=' + sessionKey;
   var code = 'location="' + loc + '"';

   eval(code);
}
 

function addParamsToQuery( loc_init, current_view) {

   var loc = loc_init;

   with ( document.forms[0] ) {
      loc += 'currentview=' + current_view;

	  for (var sp = 0; sp < maxSp; sp++)
	  {
	     eval( "loc += \'&akaAuthOp" + sp + "=\' + akaAuthOp" + sp + ".value.replace(/[\'\" ]/g,\'\')" );
		 eval( "loc += \'&pAccessNwifInfo" + sp + "=\' + pAccessNwifInfo" + sp + ".value.replace(/[\'\" ]/g,\'\')" );
		 eval( "loc += \'&distRingList" + sp + "=\' + distRingList" + sp + ".value.replace(/[\'\" ]/g,\'\')" );
		 eval( "loc += \'&secAgreeType" + sp + "=\' + secAgreeType" + selectedTab + ".value.replace(/[\'\" ]/g,\'\')" );
		 eval( "loc += \'&preconditionType" + sp + "=\' + preconditionType" + selectedTab + ".value.replace(/[\'\" ]/g,\'\')" );
		 eval( "loc += \'&earlyMediaType" + sp + "=\' + earlyMediaType" + selectedTab + ".value.replace(/[\'\" ]/g,\'\')" );

		 var temp = eval( "RportEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&RportEnable" + sp + "=on";
		 }
		 else {
		    loc += "&RportEnable" + sp + "=off";
		 }

		 temp = eval( "akaAuthEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&akaAuthEnable" + sp + "=on";
		 }
		 else {
		    loc += "&akaAuthEnable" + sp + "=off";
		 }

		 temp = eval( "pAccessNwifEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&pAccessNwifEnable" + sp + "=on";
		 }
		 else {
		    loc += "&pAccessNwifEnable" + sp + "=off";
		 }

		 temp = eval( "urlPortEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&urlPortEnable" + sp + "=on";
		 }
		 else {
		    loc += "&urlPortEnable" + sp + "=off";
		 }

		 temp = eval( "urlTransportEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&urlTransportEnable" + sp + "=on";
		 }
		 else {
		    loc += "&urlTransportEnable" + sp + "=off";
		 }

		 temp = eval( "pheaderCid" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&pheaderCid" + sp + "=on";
		 }
		 else {
		    loc += "&pheaderCid" + sp + "=off";
		 }

		 temp = eval( "internalRingId" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&internalRingId" + sp + "=on";
		 }
		 else {
		    loc += "&internalRingId" + sp + "=off";
		 }

		 temp = eval( "externalRingId" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&externalRingId" + sp + "=on";
		 }
		 else {
		    loc += "&externalRingId" + sp + "=off";
		 }

		 temp = eval( "sipcompEnable" + sp + ".checked == true");
		 if ( temp ){
		    loc += "&sipcompEnable" + sp + "=on";
		 }
		 else {
		    loc += "&sipcompEnable" + sp + "=off";
		 }

		 var checkMarkTest;
		 for (var i = 0; i < maxLines[sp]; i++) 
		 {
			checkMarkTest = eval("subsReg" + sp + "_" + i + ".checked == true");
            if ( checkMarkTest ){
               loc+= "&subsReg" + sp + "_" + i + "=on";
            } else {
               loc+= "&subsReg" + sp + "_" + i + "=off";
            }

			checkMarkTest = eval("subsUA" + sp + "_" + i + ".checked == true");
            if ( checkMarkTest ){
               loc+= "&subsUA" + sp + "_" + i + "=on";
            } else {
               loc+= "&subsUA" + sp + "_" + i + "=off";
            }

			checkMarkTest = eval("telUrlEnable" + sp + "_" + i + ".checked == true");
            if ( checkMarkTest ){
               loc+= "&telUrlEnable" + sp + "_" + i + "=on";
            } else {
               loc+= "&telUrlEnable" + sp + "_" + i + "=off";
            }

			eval( "loc += \'&telUrlType" + sp + "_" + i + "=\' + telUrlType" + sp + "_" + i + ".value.replace(/[\'\" ]/g,\'\')" );
		    eval( "loc += \'&IMSConferenceUri" + sp + "_" + i + "=\' + IMSConferenceUri" + sp + "_" + i + ".value.replace(/[\'\" ]/g,\'\')" );
		 }
	  }
   }
   return loc;
}

function frmLoad(current_view) {
   //initTranslation()
   init();

   for (var i = 0; i < maxSp; i++) {
      generatePerLineTable(i);
   }

   with ( document.forms[0] ) {
      
      for (var i = 0; i < maxSp; i++) {
         enableButtons(i);
      }

	  // Fill in values based on provisioning
	  for (var i = 0; i < maxSp; i++) {

	     eval( "akaAuthOp" + i + ".value = akaop" + i );
		 eval( "pAccessNwifInfo" + i + ".value = pani" + i );
		 eval( "distRingList" + i + ".value = drl" + i );
		 eval( "secAgreeType" + i + ".value = sat" + i );
		 eval( "preconditionType" + i + ".value = pdt" + i );
		 eval( "earlyMediaType" + i + ".value = emt" + i );

		 if (eval("akae" + i + "==0"))
      	 {
			eval( "akaAuthEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "akaAuthEnable" + i + ".checked = true" );
	     }

		 if (eval("re" + i + "==0"))
      	 {
			eval( "RportEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "RportEnable" + i + ".checked = true" );
	     }

		 if (eval("pane" + i + "==0"))
      	 {
			eval( "pAccessNwifEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "pAccessNwifEnable" + i + ".checked = true" );
	     }

		 if (eval("upe" + i + "==0"))
      	 {
			eval( "urlPortEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "urlPortEnable" + i + ".checked = true" );
	     }

		 if (eval("ute" + i + "==0"))
      	 {
			eval( "urlTransportEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "urlTransportEnable" + i + ".checked = true" );
	     }

		 if (eval("phc" + i + "==0"))
      	 {
			eval( "pheaderCid" + i + ".checked = false" );
	     } 
         else
         {
			eval( "pheaderCid" + i + ".checked = true" );
	     }

		 if (eval("inr" + i + "==0"))
      	 {
			eval( "internalRingId" + i + ".checked = false" );
	     } 
         else
         {
			eval( "internalRingId" + i + ".checked = true" );
	     }

		 if (eval("exr" + i + "==0"))
      	 {
			eval( "externalRingId" + i + ".checked = false" );
	     } 
         else
         {
			eval( "externalRingId" + i + ".checked = true" );
	     }

		 if (eval("sipce" + i + "==0"))
      	 {
			eval( "sipcompEnable" + i + ".checked = false" );
	     } 
         else
         {
			eval( "sipcompEnable" + i + ".checked = true" );
	     }
		 
		 for (var j = 0; j < maxLines[i]; j++) {

			if ( eval("subr" + i + "_" + j + "==1") ){
               eval("subsReg" + i + "_" + j + ".checked = true");
            } else {
               eval("subsReg" + i + "_" + j + ".checked = false");
            }

			if ( eval("subu" + i + "_" + j + "==1") ){
               eval("subsUA" + i + "_" + j + ".checked = true");
            } else {
               eval("subsUA" + i + "_" + j + ".checked = false");
            }
			
		    if ( eval("tue" + i + "_" + j + "==1") ){
               eval("telUrlEnable" + i + "_" + j + ".checked = true");
            } else {
               eval("telUrlEnable" + i + "_" + j + ".checked = false");
            }

			eval("telUrlType" + i + "_" + j + ".value=tut"+ i + "_" + j);
			eval("IMSConferenceUri" + i + "_" + j + ".value=imscu"+ i + "_" + j);
		 }
	  }
   	}
}
function generatePerLineTable(index) {

	// Generate the table
	if (document.body.innerHTML) {
		var tableHtmlOutput = "<table id='perLineTable" + index + "' border='1'><tbody id='perLineTbody" + index + "'>";

		// 线路
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>Line <\/td>"
		for (var line = 1; line <= maxLines[index]; line++) {
			var data = line;
			tableHtmlOutput += "<td align=center>" + data + "</td>";
		}
		tableHtmlOutput += "</tr>";

		// 注册事件预定使能
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>Up for the event scheduled to be<\/td>"
		for (var line = 0; line < maxLines[index]; line++) {
			var data = "<input type='checkbox' size=10 name=\'subsReg" + index + "_" + line + "\'>";
			tableHtmlOutput += "<td align=center>" + data + "</td>";
		}
		tableHtmlOutput += "</tr>";

		//业务信息预定使能
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>Business information intended to enable<\/td>"
		for (var line = 0; line < maxLines[index]; line++) {
			var data = "<input type='checkbox' size=20 maxlength=20 name=\'subsUA" + index + "_" + line + "\'>";
			tableHtmlOutput += "<td align=center>" + data + "</td>";
		}
		tableHtmlOutput += "</tr>";

		//telurl格式使能
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>telurl format enabled<\/td>"
		for (var line = 0; line < maxLines[index]; line++) {
			var data = "<input type='checkbox' size=20 maxlength=20 name=\'telUrlEnable" + index + "_" + line + "\'>";
			tableHtmlOutput += "<td align=center>" + data + "</td>";
		}
		tableHtmlOutput += "</tr>";
		
		//telurl格式类型
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>telurl format type<\/td>"
		var tokenizedList = telUrlTypeList.split(",");
      	var selectOptions = Array();
      	for ( var i = 0; i < tokenizedList.length; i++ ) {
         	selectOptions[i] = "<option value=" + tokenizedList[i] + " selected>" + tokenizedList[i];
      	}
		for (var line = 0; line < maxLines[index]; line++) {
         var data = "<select name='telUrlType" + index + "_" + line + "' style='width:200px;'>" + selectOptions.join("") + "<\/select>";
                  tableHtmlOutput += "<td width=100  align=center>" + data + "</td>";
      	}
		tableHtmlOutput += "</tr>";

		//会议URI
		tableHtmlOutput += "<tr>";
		tableHtmlOutput += "<td class='hd'>Conference URI<\/td>"
		for (var line = 0; line < maxLines[index]; line++) {
			var data = "<input type='text' size=20 maxlength=20 name=\'IMSConferenceUri" + index + "_" + line + "\'>";
			tableHtmlOutput += "<td align=center>" + data + "</td>";
		}
		tableHtmlOutput += "</tr>";

		//End of table
		tableHtmlOutput += "</tbody></table>";

		document.getElementById("perLineTablePlaceholder" + index).innerHTML = tableHtmlOutput;
	}
	else{
		alert("Cannot create per line table in this browser.");
	}
}

function enableButtons(index){
   /*
   var idName = "StartButton" + index;
   var buttonStart = document.getElementById( idName );
   idName = "StopButton" + index;
   var buttonStop = document.getElementById( idName );
   */
   idName = "ApplyButton" + index;
   var buttonApply = document.getElementById( idName );

   if ( voiceRunning == 1 ) {
   	
      //buttonStart.disabled = true;
      //buttonStop.disabled = false;
      buttonApply.disabled = false;
   } else {
      //buttonStart.disabled = false;
      //buttonStop.disabled = true;
      buttonApply.disabled = true;
   }
}

var tabLinks = new Array();
var contentDivs = new Array();
var selectedTab;

function init() {

  // Grab the tab links and content divs from the page
  var tabListItems = document.getElementById('tabs').childNodes;
  for ( var i = 0; i < tabListItems.length; i++ ) {
    if ( tabListItems[i].nodeName == "LI" ) {
      var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
      var id = getHash( tabLink.getAttribute('href') );
      tabLinks[id] = tabLink;
      contentDivs[id] = document.getElementById( id );
    }
  }

  // Assign onclick events to the tab links, and
  // highlight the first tab
  var i = 0;
  selectedTab = 0;

  for ( var id in tabLinks ) {
    tabLinks[id].onclick = showTab;
    tabLinks[id].onfocus = function() { this.blur() };
    if ( i == 0 ) tabLinks[id].className = 'selected';
    i++;
  }

  // Hide all content divs except the first
  var i = 0;
  
  for ( var id in contentDivs ) {
    if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
    i++;
  }
}


function showTab() {
  var selectedId = getHash( this.getAttribute('href') );

  // Highlight the selected tab, and dim all others.
  // Also show the selected content div, and hide all others.
  for ( var id in contentDivs ) {
    if ( id == selectedId ) {
      selectedTab = selectedId;
      tabLinks[id].className = 'selected';
      contentDivs[id].className = 'tabContent';
    } else {
      tabLinks[id].className = '';
      contentDivs[id].className = 'tabContent hide';
    }
  }

  // Stop the browser following the link
  return false;
}

function getFirstChildWithTagName( element, tagName ) {
  for ( var i = 0; i < element.childNodes.length; i++ ) {
    if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
  }
}

function getHash( url ) {
  var hashPos = url.lastIndexOf ( '#' );
  return url.substring( hashPos + 1 );
}


function createTabs() {
  document.writeln("<ul id='tabs'>");
    
  for ( var i = 0; i < maxSp; i++ ) {
     document.writeln("<li><a href='#" + i + "'><span id='voiceIMSset'>Voice -- SIP IMS Setting" + "</span></a></li>");
  } 
}

function createContent() {
  
  for (var index = 0; index < maxSp; index++) {
    document.writeln("<div class='tabContent' id='" + index + "'>");
    document.writeln("<div>");

	/* AKA Authentication enabled*/
    document.writeln("   <div id='akaAuthEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='akaAuthEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSAkaEn'>AKA Authentication enabled</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*Report enabled*/
	document.writeln("   <div id='RportEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='RportEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSRportEn'>Rport enabled</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*Enable access to network information */
	document.writeln("   <div id='pAccessNwifEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='pAccessNwifEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSAcNwifEn'>Enable access to network information</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");
	
	/*Url and port*/
    document.writeln("   <div id='urlPortEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='urlPortEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSUrlPortEn'>Url and port</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");
	
	/*Url and transport parameters */
    document.writeln("   <div id='urlTransportEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='urlTransportEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSUrlTranpEn'>Url and transport parameters</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*Caller ID processing is enabled */
    document.writeln("   <div id='pheaderCid" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='pheaderCid" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSCallIDEn'>Caller ID processing is enabled</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*Internal ringing id */
    document.writeln("   <div id='internalRingId" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='internalRingId" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSIntRingId'>Internal ringing id</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*External ringing id*/
    document.writeln("   <div id='externalRingId" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='externalRingId" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSExtRingId'>External ringing id</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	/*Signaling compression enabled */
    document.writeln("   <div id='sipcompEnable" + index + "'>");
    document.writeln("   <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("      <tr>");
    document.writeln("         <td class='txt' valign='middle' align='center' colspan='2' width='30' height='30'>");
    document.writeln("            <input type='checkbox' name='sipcompEnable" + index + "' ID='Checkbox" + index + "' value='YES' checked></td>");
    document.writeln("         <td class='txt' colspan='2'>");
    document.writeln("            <span id='voiceIMSSigCompEn'>Signaling compression enabled</span></td>");
    document.writeln("      </tr>");
    document.writeln("   </table>");
    document.writeln("   </div>");

	document.writeln("   <br>");

	/*OP value */
	document.writeln("   <div id='akaAuthOp" + index + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt'  width='150'><span id='voiceIMSOPValue'>OP value</span></td>");
    document.writeln("            <td><input type='text' name='akaAuthOp" + index + "'></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");

	/*Access to network information*/
	document.writeln("   <div id='pAccessNwifInfo" + index + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt'  width='150'><span id='voiceIMSAcNwifInfo'>Access to network information</span></td>");
    document.writeln("            <td><input type='text' name='pAccessNwifInfo" + index + "'></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");

	/*Distinctive Ringing*/
	document.writeln("   <div id='distRingList" + index + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt'  width='150'><span id='voiceIMSDisRing'>Distinctive Ringing</span></td>");
    document.writeln("            <td><input type='text' name='distRingList" + index + "'></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");

	document.writeln("   <br>");
	
	/*Security Alliance*/
	document.writeln("   <div id='secAgreeType" + i + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt' width='150'><span id='voiceIMSSecAllin'>Security Alliance</span></td>");
    document.writeln("            <td class='txt' ><select name='secAgreeType" + index + "' size='1'>");
    document.writeln("               <option value='0' selected>");
    document.writeln("               disable");
    document.writeln("               <option value='1' >");
    document.writeln("               required");
    document.writeln("            </select></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");

	/*Resource Reservation*/
	document.writeln("   <div id='preconditionType" + i + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt' width='150'><span id='voiceIMSResoRes'>Resource Reservation</span></td>");
    document.writeln("            <td class='txt' ><select name='preconditionType" + index + "' size='1'>");
    document.writeln("               <option value='0' selected>");
    document.writeln("               disable");
    document.writeln("               <option value='1' >");
    document.writeln("               required");
    document.writeln("            </select></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");


	/*Early media processing*/
	document.writeln("   <div id='earlyMediaType" + i + "'>");
    document.writeln("      <table border='0' cellpadding='0' cellspacing='0' ID='Table" + index + "'>");
    document.writeln("         <tr>");
    document.writeln("            <td class='txt' width='150'><span id='voiceIMSErMedia'>Early media processing</span></td>");
    document.writeln("            <td class='txt' ><select name='earlyMediaType" + index + "' size='1'>");
    document.writeln("               <option value='0' selected>");
    document.writeln("               disable");
    document.writeln("               <option value='1' >");
    document.writeln("               required");
    document.writeln("            </select></td>");
    document.writeln("         </tr>");
    document.writeln("      </table>");
    document.writeln("   </div>");
	document.writeln("   <br>");

	/*表格*/
	document.writeln("   <br>");
    document.writeln("   <div class='tableWrapper' id='perLineTablePlaceholder" + index + "'>");
    document.writeln("   <table></table>");
    document.writeln("   </div>");
    document.writeln("   <br>" );

	
    document.writeln("   <center>");
	/*
    document.writeln("      <input type='button' onClick='btnStartSip()' value='Start SIP client' id='StartButton" + index + "' disabled=true>");
    document.writeln("      <br>");
    document.writeln("      <br>");
    document.writeln("      <input type='button' onClick='btnStopSip()' value='Stop SIP client' id='StopButton" + index + "' disabled=true>");
	*/
    document.writeln("      <br>");
    document.writeln("      <br>");
    document.writeln("      <input type='button' onClick='btnApplySip()' value='Apply' id='ApplyButton" + index + "' disabled=true>");
    document.writeln("      <br>");
    document.writeln("   </center>");
    document.writeln("    <br>");
    //document.writeln("    * Changing this parameter for one service provider affects all other service providers.");
    document.writeln("</div>");
    document.writeln("</div>");
  }
}
 
</script>
<body onLoad="frmLoad('ims')">
   <blockquote>
      <form>
      <script TYPE="text/javascript">
        createTabs();
        createContent();
     </script>
     
     </form>
   </blockquote>
</body>
</html>

