<html> 
   <head> 
<meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" href='stylemain.css' type='text/css'>
<link rel="stylesheet" href='colors.css' type='text/css'>
<script type="text/javascript" src="lang/b28n.js"></script>
<script language="javascript"><%ejGetOther(forbidHTMLCode)%></script>
<script language="javascript" src="util.js"></script> 
<script language="javascript"> 
var ba1= '<%ejGetVoice(bareMgcAddr1)%>';    
var mp1 = '<%ejGetVoice(mgcAddr1Port)%>';
var ba2 = '<%ejGetVoice(bareMgcAddr2)%>';    
var mp2 = '<%ejGetVoice(mgcAddr2Port)%>';  
var ss = '<%ejGetVoice(snowSlide)%>';
var tn1 = '<%ejGetVoice(termName1)%>';
var tn2 = '<%ejGetVoice(termName2)%>';
var rn1 = '<%ejGetVoice(rtpPrefix)%>';  
var rn2 = '<%ejGetVoice(rtpNameScope)%>';
var rn3 = '<%ejGetVoice(rtpBase)%>';
var pc = 'G711U,G711A,G723,G729,';
var  an= '<%ejGetVoice(authName)%>';
var  ak= '<%ejGetVoice(authKey)%>';
var  tt= '<%ejGetVoice(transportType)%>';
var  dr= '<%ejGetVoice(dtmfRelay)%>';
var  ve= '<%ejGetVoice(vadEnable)%>';
var  ig= '<%ejGetVoice(ingressGain)%>';
var  eg= '<%ejGetVoice(egressGain)%>';
var  hd= '<%ejGetVoice(dscpMark)%>';
var  hv= '<%ejGetVoice(vlanIdMark)%>';
var  mp= '<%ejGetVoice(mgPort)%>';
var  mn= '<%ejGetVoice(mgName)%>';
var  ifc= '<%ejGetVoice(ifName)%>';
var  am= '<%ejGetVoice(authMehtod)%>';
var  et= '<%ejGetVoice(encodingType)%>';
var  jtb= '<%ejGetVoice(jitterBuffer)%>';
var  jtm= '<%ejGetVoice(jitterBufferMode)%>';   
var  mtv= '<%ejGetVoice(mgTopVersion)%>';
var  dmm= '<%ejGetVoice(digitMapMod)%>';
var  mif= '<%ejGetVoice(midFormat)%>';
var  mef= '<%ejGetVoice(messageFormat)%>';
var  dst= '<%ejGetVoice(digitMapStartTimer)%>';
var  dlm= '<%ejGetVoice(digitMapLongTimer)%>'; 
var  dsm= '<%ejGetVoice(digitMapShortTimer)%>';
var  ftm= '<%ejGetVoice(faxTransMod)%>';   
var  fnm= '<%ejGetVoice(faxNegoMod)%>';   
var  rpt= '<%ejGetVoice(rfc2198PT)%>';
var  vre= '<%ejGetVoice(vbdRed)%>';
var  vc= '<%ejGetVoice(vbdCodec)%>';
var  ece= '<%ejGetVoice(echoCancel)%>';
var  hbt= '<%ejGetVoice(heartBeatTime)%>';
var  rt= '<%ejGetVoice(rfc2833PT)%>';
var  pt= '20,20,30,20,20';
var ifList  = '<%ejGetVoice(ifList)%>';
var locList = '<%ejGetVoice(localeList)%>';
var selectedLocale = '<%ejGetVoice(localeName)%>';
var voiceRunning = '<%ejGetVoice(voiceStatus)%>';
var sessionKey='<%ejGetOther(sessionKey)%>';

setLanguage('<%ejGet(webUILanguage)%>'); 
Butterlate.setTextDomain("voip");
function initTranslation() {
      var idArray = new Array( "vocbasic_id1","vocbasic_id2","vocbasic_id3","vocbasic_id4","vocbasic_id5","vocbasic_id6","vocbasic_id7","vocbasic_id8",
	  	"vocbasic_id9","vocbasic_id10","vocbasic_id11","vocbasic_id12","vocbasic_id13","vocbasic_id14","vocbasic_id15","vocbasic_id16","vocbasic_id17",
	  	"vocbasic_id18","vocbasic_id19","vocbasic_id20","vocbasic_id21","vocbasic_id22","vocbasic_id23","vocbasic_id24","vocbasic_id25","vocbasic_id26",
	  	"vocbasic_id27","vocbasic_id28","vocbasic_id29","vocbasic_id30","vocbasic_id31","vocbasic_id32","vocbasic_id33","vocbasic_id34","vocbasic_id35",
	  	"vocbasic_id36","vocbasic_id37","vocbasic_id38","vocbasic_id39","vocbasic_id40","vocbasic_id41","vocbasic_id42","vocbasic_id43","vocbasic_id44",
	  	"vocbasic_id45","vocbasic_id46","vocbasic_id47","vocbasic_id48","vocbasic_id49");
	setAllIdValue(idArray);
}
                                                                                                                                              
function addParamsToQuery(loc_init, current_view) {                                                                                                                                       
   var loc = loc_init;                                                    

   with ( document.forms[0] ) {
   	 loc += 'currentview=' + current_view; 													  
	   if(current_view == 'basic') {												   
           if ( isValueNull( bareMgcAddr1.value,bareMgcAddr2.value ) == false )  {      
         if ( Bakmgc1Info.checked == true ) {                                           
           if ( isValidMGCAddress( 64,bareMgcAddr1.value) == true )  {      
             }                                                                             
           else{        
                    msg =  bareMgcAddr1.value + _("voiceh248_notValidMac");
                    alert( msg );           
                    return;              
                  }                                                                               
 		}																				
 	else {		 
 				 bareMgcAddr1.value =  '0.0.0.0';		
  				 mgcAddr1Port.value = '2944';		  
         }                                                                               
         if ( Bakmgc2Info.checked == true ) {                                           
           if ( isValidMGCAddress( 64,bareMgcAddr2.value) == true )  {      
             }                                                                             
           else{        
                    msg =  bareMgcAddr2.value + _("voiceh248_notValidSt");
                    alert( msg );           
                    return;              
                  }                                                                               
 		}																				
 	else {		 
 				 bareMgcAddr2.value =  '0.0.0.0';		
  				 mgcAddr2Port.value = '2944';		  
         }                                                                               
         if (( Bakmgc1Info.checked == false )&&( Bakmgc2Info.checked == false )) {                                           
 				 bareMgcAddr1.value =  '192.168.99.99';		
  				 mgcAddr1Port.value = '2944';		  
         }                                                                               
           }                                                                               
           else{        
                    msg =  bareMgcAddr1.value + _("voiceh248_notValidSt");
                    alert( msg );           
                    return;              
             }                                                                               
			if ( isValidClientPortforH248(2900, 2999, mgPort.value ) == true )  {	  
			  } 																			
			else{		 
					 msg =	mgPort.value + _("voiceh248_notValidP");
					 alert( msg );			 
					 return;			  
			  } 																			  
           if ( isValidServerPortforH248( mgcAddr1Port.value ) == true )  {      
             }                                                                             
           else{        
                    msg =  mgcAddr1Port.value + _("voiceh248_notValidmacP");
                    alert( msg );           
                    return;              
             }                                                                               
           if ( isValidServerPortforH248( mgcAddr2Port.value ) == true )  {      
             }                                                                             
           else{        
                    msg =  mgcAddr2Port.value + _("voiceh248_notValidStP");
                    alert( msg );           
                    return;              
             }                                                                               
           if ( isValidLenforH248(17, authName.value ) == true )  {      
             }                                                                             
           else{        
                    msg =  authName.value + _("voiceh248_invalidGtID");
                    alert( msg );           
                    return;              
             }                                                                               
           if ( isValidLenforH248(17, authKey.value ) == true )  {      
             }                                                                             
           else{        
                    msg =  authKey.value + _("voiceh248_invalidPriK");
                    alert( msg );           
                    return;              
             }                                                                               
		   if ( isValidLenforH248(65, mgName.value ) == true )	{
			 }												   
		   else{		
					msg =  mgName.value + _("voiceh248_invalidName");
					alert( msg );			
					return; 			 
			 }												 
																					   
	     loc += '&ifName=' + ifName.value; 											  
      loc += '&bareMgcAddr1=' + bareMgcAddr1.value;                                                
      loc += '&mgcAddr1Port=' + mgcAddr1Port.value;                                                
      loc += '&bareMgcAddr2=' + bareMgcAddr2.value;                                                
      loc += '&mgcAddr2Port=' + mgcAddr2Port.value;                                                
      loc += '&authMehtod=' + authMehtod.value;                                                
      loc += '&encodingType=' + encodingType.value;                                                                                        
		   if ( isValidLenforH248TermName(65, termName1.value ) == true )	{
			 }												   
		   else{		
					msg =  termName1.value + _("voiceh248_invalidTID");
					alert( msg );			
					return; 			 
			 }												 
      loc += '&termName1=' + termName1.value;          
		   if ( isValidLenforH248TermName(65, termName2.value ) == true )	{
			 }												   
		   else{		
					msg =  termName2.value + _("voiceh248_invalidTID");
					alert( msg );			
					return; 			 
			 }												 
      loc += '&termName2=' + termName2.value;          
		   if ( isValidforH248RtpName(65, rtpPrefix.value ) == true )	{
			 }										   
		   else{		
					msg =  rtpPrefix.value + _("voiceh248_invalidRTP");
					alert( msg );			
					return; 			 
			 }										 
		   if ( isValidValue2forH248(2, 128, rtpNameScope.value ) == true )	{
			 }										   
		   else{		
					msg =  rtpNameScope.value + _("voiceh248_invalidtempPCont");
					alert( msg );			
					return; 			 
			 }										 
	  loc += '&rtpPrefix=' + rtpPrefix.value; 			   
	  loc += '&rtpNameScope=' + rtpNameScope.value;
	  loc += '&rtpBase=' + rtpBase.value; 			   
         pt = '';                    
         pt += G711U.value+ ',';                         
         pt += G711A.value + ',';                         
         pt += G723.value + ',';                         
         pt += G729.value + ',';                         
         pt += G722.value + ',';                         
      loc += '&packetTime=' + pt;                                       
	   loc += '&localeName=' + localeName.value;									   
	   loc += '&authName=' + encodeUrl(authName.value);									   
	   loc += '&authKey=' + authKey.value;									   
	   loc += '&transportType=' + transportType.value;										 
	   loc += '&mgPort=' + mgPort.value;										 
	   loc += '&mgName=' + mgName.value;									   
     loc += '&midFormat=' + midFormat.value;                
	   }																			   
	   if(current_view == 'advanced') { 												  
		   if ( isValidValue2forH248( 0,7,vlanIdMark.value ) == true )  {	 
			 }																			   
		   else{		
					msg =  vlanIdMark.value + _("voiceh248_invalidRTPP");
					alert( msg );			
					return; 			 
			 }																				 
 		  if ( isValidValue2forH248( 0,7,dscpMark.value ) == true )  { 	
 			}																			  
 		  else{ 	   
 				   msg =  dscpMark.value + _("voiceh248_invalidSnP");
 				   alert( msg );		   
 				   return;				
 			}																				
		  if ( isValidValue2forH248(0, 6000, snowSlide.value ) == true )  {	
			}																			  
		  else{ 	   
				   msg =  snowSlide.value + _("voiceh248_invldtime");
				   alert( msg );		   
				   return;				
			}																				
		  if ( isValidValue2forH248(1, 4, mgTopVersion.value ) == true )  {	
			}																			  
		  else{ 	   
				   msg =  mgTopVersion.value + _("voiceh248_invldProRe");
				   alert( msg );		   
				   return;				
			}																				
		  if ( isValidValue2forH248(5, 655, heartBeatTime.value ) == true )  {	
			}																			  
		  else{ 	   
				   msg =  heartBeatTime.value + _("voiceh248_invldfrTme");
				   alert( msg );		   
				   return;				
			}																				
      loc += '&heartBeatTime=' + heartBeatTime.value;                
         if ( dtmfRelay.value == '1' ) {                                             
            loc += '&dtmfRelay=' + dtmfRelay.value;                                    
            if ( isValidValue2( 96,127,rfc2833PT.value ) == true ){
               if ( isEqualValue( rfc2198PT.value,rfc2833PT.value) == true )
               {
                  msg = _("voiceh248_cannotSame");
                  alert( msg );
                  return;
               }
            }
            else{
                msg =  rfc2833PT.value + _("voiceh248_invld2833"); 
                alert( msg );
                 return;
            } 
            loc += '&rfc2833PT=' + rfc2833PT.value;                                    
         }                                                                               
         else {                                                                          
            loc += '&dtmfRelay=' + dtmfRelay.value;                                    
         }                                                                               
		   if ( isValidValue2forH248( 1,99,digitMapStartTimer.value ) == true )  {	 
			 }																			   
		   else{		
					msg =  digitMapStartTimer.value + _("voiceh248_invldCouTm");
					alert( msg );			
					return; 			 
			 }																				 
      loc += '&digitMapStartTimer=' + digitMapStartTimer.value;                
		   if ( isValidValue2forH248( 1,99,digitMapLongTimer.value ) == true )  {	 
			 }																			   
		   else{		
					msg =  digitMapLongTimer.value + _("voiceh248_invlddigCou");
					alert( msg );			
					return; 			 
			 }																				 
      loc += '&digitMapLongTimer=' + digitMapLongTimer.value;                
		   if ( isValidValue2forH248( 1,99,digitMapShortTimer.value ) == true )  {	 
			 }																			   
		   else{		
					msg =  digitMapShortTimer.value + _("voiceh248_invldcouVld");
					alert( msg );			
					return; 			 
			 }																				 
      loc += '&digitMapShortTimer=' + digitMapShortTimer.value;                
      loc += '&messageFormat=' + messageFormat.value;                
      loc += '&digitMapMod=' + digitMapMod.value;                
      loc += '&faxTransMod=' + faxTransMod.value;                
      loc += '&faxNegoMod=' + faxNegoMod.value;                
      loc += '&vbdCodec=' + vbdCodec.value;                
         if ( echoCancel.checked == true ) {                                             
            loc += '&echoCancel=1';                                                    
         }                                                                               
         else {                                                                          
            loc += '&echoCancel=0';                                                     
         }                                                                               
         if ( vbdRed.checked == true ) {                                             
            loc += '&vbdRed=1';                                                    
         }                                                                               
         else {                                                                          
            loc += '&vbdRed=0';                                                     
         }                                                                               
		   if ( isValidValue2forH248( 96,127,rfc2198PT.value ) == true )  {	 
			 }																			   
		   else{		
					msg =  rfc2198PT.value + _("voiceh248_invld2198");
					alert( msg );			
					return; 			 
			 }																				 
      loc += '&rfc2198PT=' + rfc2198PT.value;                
        if ( isValidValue2( 0,180,jitterBuffer.value ) == true )   {    
          }                                                         
        else{     
               msg =   jitterBuffer.value + _("voiceh248_invldJit")
               alert( msg );        
               return;         
          }                                                           
      loc += '&jitterBuffer=' + jitterBuffer.value;                                       
      loc += '&jitterBufferMode=' + jitterBufferMode.value;                                       
         if ( vadEnable.checked == true ) {                                             
            loc += '&vadEnable=1';                                                    
         }                                                                               
         else {                                                                          
            loc += '&vadEnable=0';                                                     
         }                                                                               
	   loc += '&ingressGain=' + ingressGain.value;										 
	   loc += '&egressGain=' + egressGain.value;									   
	   loc += '&dscpMark=' + dscpMark.value;									   									   
	   loc += '&vlanIdMark=' + vlanIdMark.value;									   
      loc += '&snowSlide=' + snowSlide.value;                                                
      loc += '&mgTopVersion=' + mgTopVersion.value;                                                
	   }																			   
	}																				   
   return loc;                                                                        
}  

function btnStartH248(current_view) {
   var loc = 'voiceh248start.cmd?';

   loc += addParamsToQuery( loc, current_view );   

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

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


function btnStopH248(current_view) {
   var loc = 'voiceh248stop.cmd?';

   loc += addParamsToQuery( loc, current_view );
   
   //Stripping quotes and spaces
   loc = loc.replace(/['" ]/g,'');

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


function btnApplyH248(current_view) {
   var loc = 'voiceh248apply.cmd?';

   loc += addParamsToQuery( loc, current_view );
   
   //Stripping quotes and spaces
   loc = loc.replace(/['" ]/g,'');

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

function enableButtons(){
   var buttonStart = document.getElementById("startH248cBtn");
   var buttonStop = document.getElementById("stopH248cBtn");
   var buttonApply = document.getElementById("applyH248cBtn");
   
   if ( voiceRunning == 1 ) {
      buttonStart.disabled = true;
      buttonStop.disabled = false;
      buttonApply.disabled = false;
   } else {
      buttonStart.disabled = false; 
      buttonStop.disabled = true;
      buttonApply.disabled = true;
   }
}
                                                                                   
function frmLoad(current_view) {
   with ( document.forms[0] ) {
   	  initTranslation();
   	  enableButtons();                                                       
      if(current_view == 'basic') {                                                   
	     ifName.value = ifc; 					
      bareMgcAddr1.value = ba1;                                                              
      mgcAddr1Port.value = mp1;                                                              
      bareMgcAddr2.value = ba2;                                                              
      mgcAddr2Port.value = mp2;                                                              
	     termName1.value = tn1;				   
	     termName2.value = tn2;				   
	     rtpPrefix.value = rn1;			        
	     rtpNameScope.value = rn2;
	     rtpBase.value = rn3;			        
      if ( pt ){                          
         var temp = new Array();             
            temp = pt.split(',');                   
            G711U.value = temp[0];   
            G711A.value = temp[1];   
            G723.value = temp[2];   
            G729.value = temp[3];   
            G722.value = temp[4];   
      }                           
      localeName.value = selectedLocale;                                                          
      transportType.value = tt;                                                          
      authMehtod.value = am;                                                          
	     if(am =='0')		      	 
	     {										
	        hideAuthInfo(1);										
	     }        									
	     else{										
	        hideAuthInfo(0);										
	     }        									
      authName.value = an;                                                          
      authKey.value = ak;                                                          
	     encodingType.value = et; 		            					 
      mgPort.value = mp;                                                          
      midFormat.value = mif;                                                          
	     if(mif =='0')		      	 
	     {										
	        hideMgNameifo(0);										
	     }        									
	     else{										
	        hideMgNameifo(1);										
	     }        									
      mgName.value = mn;                                                          
         if (ba1 != '0.0.0.0') {                                  
            Bakmgc1Info.checked = true;                                                    
            hidebakmgc1Info(0);                                                            
         } else {                                                                        
            Bakmgc1Info.checked = false;                                                   
            hidebakmgc1Info(1);                                                            
         }                                                                               
         if (ba2 != '0.0.0.0') {                                  
            Bakmgc2Info.checked = true;                                                    
            hidebakmgc2Info(0);                                                            
         } else {                                                                        
            Bakmgc2Info.checked = false;                                                   
            hidebakmgc2Info(1);                                                            
         }
         
         if('<%ejGetVisible(localeNameinfo)%>' == 'visible'){
              hidelocaleNameinfo(0);
         } else {
              hidelocaleNameinfo(1);
         }                                                                               
      }                                                                                  
      if(current_view == 'advanced'){                                                 
      dtmfRelay.value = dr.toUpperCase();
         if (dtmfRelay.value != '1') {                                  
            hidepayload(1);                                                            
         } else {                                                                        
            hidepayload(0);                                                            
         }                                                                               
      rfc2833PT.value = rt;
      digitMapMod.value = dmm;
      messageFormat.value = mef;
      digitMapStartTimer.value = dst;
      digitMapLongTimer.value = dlm;
      digitMapShortTimer.value = dsm;
      faxTransMod.value = ftm;
      faxNegoMod.value = fnm;
      rfc2198PT.value = rpt;
      vbdRed.value = vre;
         if(vre == '1'){
            vbdRed.checked = true;
         } else {
            vbdRed.checked = false;
         }
      vbdCodec.value = vc;
      echoCancel.value = ece;
         if(ece == '1'){
            echoCancel.checked = true;
         } else {
            echoCancel.checked = false;
         }
      heartBeatTime.value = hbt;                                                          
      ingressGain.value = ig;                                                          
      egressGain.value = eg;                                                          
      dscpMark.value = hd;                                                          
      vlanIdMark.value = hv;                                                          
      jitterBuffer.value = jtb;                                                          
      jitterBufferMode.value = jtm;                                                          
	     snowSlide.value = ss;										
      mgTopVersion.value = mtv;                                                
         vadEnable.value = ve.toUpperCase();
         if(ve == '1'){
            vadEnable.checked = true;
         } else {
            vadEnable.checked = false;
         }
      }                                                                                  
   }                                                                                
}                                                                                     
function hideAuthInfo(hide) {                                                     
   var status = 'block';                                                            
                                                                                      
   if ( hide == 1 )                                                                   
      status = 'none';                                                              
   if (document.getElementById)  // DOM3 = IE5, NS6                                   
      document.getElementById('authInfo').style.display = status;              
   else {                                                                             
      if (document.layers == false) // IE4                                            
         document.all.authInfo.style.display = status;                         
   }                                                                                  
}                                                                                     
function hideMgNameifo(hide) {                                                     
   var status = 'block';                                                            
                                                                                      
   if ( hide == 1 )                                                                   
      status = 'none';                                                              
   if (document.getElementById)  // DOM3 = IE5, NS6                                   
      document.getElementById('mgNameInfo').style.display = status;              
   else {                                                                             
      if (document.layers == false) // IE4                                            
         document.all.mgNameInfo.style.display = status;                         
   }                                                                                  
}                                                                                     
function midFormatcbClick(cb) { 														  
   if ( cb.value == '0')														  
	  hideMgNameifo(0); 															  
   else 																			  
	  hideMgNameifo(1); 															  
}																					  
function authMethodcbClick(cb) { 														  
   if ( cb.value == '0' )														  
	  hideAuthInfo(1); 															  
   else 																			  
	  hideAuthInfo(0); 															  
}																					  
function hidepayload(hide) {                                                    
   var status = 'block';                                                            
                                                                                      
   if ( hide == 1 )                                                                   
      status = 'none';                                                              
   if (document.getElementById)  // DOM3 = IE5, NS6                                   
      document.getElementById('rfc2833PT').style.display = status;                  
   else {                                                                             
      if (document.layers == false) // IE4                                            
         document.all.rfc2833PT.style.display = status;                            
   }                                                                                  
}                                                                                     
function dtmfRelayCbClick(cb) {                                                           
   if ( cb.value == '1' )                                                          
      hidepayload(0);                                                               
   else                                                                               
      hidepayload(1);                                                               
}                                                                                     
function hidebakmgc1Info(hide) {                                                          
   var status = 'block';                                                            
                                                                                      
   if ( hide == 1 )                                                                   
      status = 'none';                                                              
   if (document.getElementById)  // DOM3 = IE5, NS6                                   
      document.getElementById('MGC1Info').style.display = status;                   
   else {                                                                             
      if (document.layers == false) // IE4                                            
         document.all.MGC1Info.style.display = status;                              
   }                                                                                  
}                                                                                     
function Bakmgc1CbClick(cb) {                                                        
   if ( cb.checked == true )                                                          
      hidebakmgc1Info(0);                                                            
   else                                                                               
      hidebakmgc1Info(1);                                                            
}                                                                                     
function hidebakmgc2Info(hide) {                                                          
   var status = 'block';                                                            
                                                                                      
   if ( hide == 1 )                                                                   
      status = 'none';                                                              
   if (document.getElementById)  // DOM3 = IE5, NS6                                   
      document.getElementById('MGC2Info').style.display = status;                   
   else {                                                                             
      if (document.layers == false) // IE4                                            
         document.all.MGC2Info.style.display = status;                              
   }                                                                                  
}                                                                                     
function Bakmgc2CbClick(cb) {                                                        
   if ( cb.checked == true )                                                          
      hidebakmgc2Info(0);                                                            
   else                                                                               
      hidebakmgc2Info(1);                                                            
}                                                                                     
function cbClick(cb) {                                                           
}

function hidelocaleNameinfo(hide) {
   var status = 'block';

   if ( hide == 1 )
   {
      status = 'none';
   }
   if (document.getElementById)  // DOM3 = IE5, NS6
   {
      document.getElementById('localeNamediv').style.display = status;   
   }
   else {
      if (document.layers == false) // IE4
      {
         document.all.localeNamediv.style.display = status;    
	  }
   }
}

function printInterfaceListBox(){
   var tokInterfaceList = ifList.split(" ");

   for(i = 0; i < tokInterfaceList.length; i++)
   {
      document.writeln("<option value=\"" + tokInterfaceList[i] + "\" selected>");  
      document.writeln(tokInterfaceList[i]);
   }
}

function printLocaleListBox(){   
   var tokLocCodeList = locList.split(",");
   
   for(i = 0; i < tokLocCodeList.length; i++)
   {
      var tokCodeNameList = tokLocCodeList[i].split(" - ");
      document.writeln("<option value=\"" + tokCodeNameList[0] + "\" selected>");      
      document.writeln(tokCodeNameList[0] + " - " + tokCodeNameList[1]);          
   }  
}


                                                                                     
// done hiding -->                                                                    
</script>                                                                             
</head>                                                                               
<body onLoad="frmLoad('basic')">                                                             
   <blockquote>                                                                       
      <form>                                                                          
   <b id='vocbasic_id1'>Voice -- H248 基本配置</b><br>                                              
   <br>                                                                               
      <td colspan="4"><font color="red"><span id='vocbasic_id2'>配置 VoIP 参数, 需要点击 </span><b><span id='vocbasic_id3'>保存</span></b>   
           <span id='vocbasic_id4'>按钮来保存参数, 点击 </span><b><span id='vocbasic_id5'>启动</span></b><span id='vocbasic_id6'> 后生效</span><br></font></td>                      
   <br>                                                                               
   <br>                   
         <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="150"><span id='vocbasic_id7'>接口名:</span></td>  
            <td><select name="ifName" size="1">
                  <script TYPE="text/javascript">
                     printInterfaceListBox()
                  </script>
               </select></td>
            </tr>
         </table>
         
         <div id = 'localeNamediv'>
         <table border="0" cellpadding="0" cellspacing="0">
         <tr>
            <td width="150"><span id='vocbasic_id8'>当地选择:</span></td>
         <td><select name="localeName" size="1">
               <script TYPE="text/javascript">
                  printLocaleListBox()
               </script>                                             
               </select></td>
         </tr>
         </table>   
         </div>
                                                                                 
   <table border="0" cellpadding="0" cellspacing="0">                           
      <td width="150"><span id='vocbasic_id9'>打包周期配置:</span></td>                              
<td width="50">G711U</td>                     
<td><select name="G711U" size="1" onClick=''> 
<option value="10" selected>
10ms
<option value="20" >
20ms
<option value="30" >
30ms
           </select></td>
<td width="10"> </td>                             
<td width="50">G711A</td>                     
<td><select name="G711A" size="1" onClick=''> 
<option value="10" selected>
10ms
<option value="20" >
20ms
<option value="30" >
30ms
           </select></td>
<td width="10"> </td>                             
<td width="40">G723</td>                     
<td><select name="G723" size="1" onClick=''> 
<option value="30" selected>
30ms
           </select></td>
<td width="10"> </td>                             
<td width="40">G729</td>                     
<td><select name="G729" size="1" onClick=''> 
<option value="10" selected>
10ms
<option value="20" >
20ms
<option value="30" >
30ms
           </select></td>
<td width="10"> </td>                             
<td width="40">G722</td>                     
<td><select name="G722" size="1" onClick=''> 
<option value="10" selected>
10ms
<option value="20" >
20ms
<option value="30" >
30ms
           </select></td>
<td width="10"> </td>                             
    </tr>                                                       
   </table>
<br>                                                                                  
<div id='transportType'>
<table border="0" cellpadding="0" cellspacing="0" ID="Table1">
<tr>
<td width="150"><span id='vocbasic_id10'>传输协议:</span></td>
<td><select name="transportType" size="1" onClick='cbClick(this)'>
<option value="0" selected>
UDP
<option value="1" >
TCP
</select></td>
</tr>
</table>
</div>
<br>                                                                                  
<div id='encodingType'>
<table border="0" cellpadding="0" cellspacing="0" ID="Table1">
<tr>
<td width="150"><span id='vocbasic_id11'>协议编码类型:</span></td>
<td><select name="encodingType" size="1" onClick='cbClick(this)'>
<option value="0" >
<span id='vocbasic_id12'>文本</span>
<option value="1" selected>
<span id='vocbasic_id13'>二进制</span>
</select></td>
</tr>
</table>
</div>
<br>                                                                                  
   <td valign="middle" align="center" colspan="2" width="30" height="30"><input type='checkbox' name='Bakmgc1Info' onClick='Bakmgc1CbClick(this)' ID="Checkbox1"></td> 
   <td colspan="2">                                                                   
   <span id='vocbasic_id14'>主服务器</span>                                                                 
<br>                                                                                  
<div id='MGC1Info'>																  
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id15'>服务器地址:</td>										
		 <td><input type='text' name='bareMgcAddr1'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id16'>(长度[1,64])</td>                                                 
	  </tr> 																		  
	  <tr>																			  
		 <td width="150" id='vocbasic_id17'>服务器端口:</td>										
		 <td><input type='text' name='mgcAddr1Port'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id18'>(范围[1,65534])</td>                                                 
	  </tr> 																		  
</table>
</div>                                                                                
			  <br>																			  
   <td valign="middle" align="center" colspan="2" width="30" height="30"><input type='checkbox' name='Bakmgc2Info' onClick='Bakmgc2CbClick(this)' ID="Checkbox1"></td> 
   <td colspan="2">                                                                   
 <span id='vocbasic_id19'>  备用服务器</span>                                                                 
<br>                                                                                  
<div  id='MGC2Info'>																  
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id20'>备用服务器地址:</td>										
		 <td><input type='text' name='bareMgcAddr2'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id21'>(长度[1,64])</td>                                                 
	  </tr> 																		  
	  <tr>																			  
		 <td width="150" id='vocbasic_id22'>备用服务器端口:</td>										
		 <td><input type='text' name='mgcAddr2Port'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id23'>(范围[1,65534])</td>                                                 
	  </tr> 																		  
</table>
</div>                                                                                
	<br>																			  
<br>                                                                                  
<div id='midFormat'>
<table border="0" cellpadding="0" cellspacing="0" ID="Table1">
<tr>
<td width="150" id='vocbasic_id24'>MG注册方式:</td>
<td><select name="midFormat" size="1" onClick='midFormatcbClick(this)'>
<option value="0" selected id='vocbasic_id25'>
MG域名
<option value="1"  id='vocbasic_id26'>
IP地址
<option value="2"  id='vocbasic_id27'>
MAC地址
</select></td>
</tr>
</table>
</div>
<div style="position:relative;" id='mgNameInfo'>                                                                  
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id28'>域名:</td>										
		 <td><input type='text' name='mgName'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id29'>(长度[1,64])</td>                                                 
	  </tr> 																		  
</table>
</div>
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id30'>MG端口:</td>										
		 <td><input type='text' name='mgPort'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id31'>(范围[1,65534])</td>                                                 
	  </tr> 																		  
</table>
			  <br>																			  
			  <br>																			  
<div id='authMethod'>
<table border="0" cellpadding="0" cellspacing="0" ID="Table1">
<tr>
<td width="150" id='vocbasic_id32'>授权方式:</td>
<td><select name="authMehtod" size="1" onClick='authMethodcbClick(this)'>
<option value="0" id='vocbasic_id33'>
无
<option value="1" selected>
MD5 
</select></td>
</tr>
</table>
</div>
<div style="position:relative;" id='authInfo'>                                                                  
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id34'>授权MG ID:</td>										
		 <td><input type='text' name='authName'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id35'>(长度[1,16])</td>                                                 
	  </tr> 																		  
</table>
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id36'>授权密钥:</td>										
		 <td><input type='password' name='authKey'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id37'>(长度[1,16])</td>                                                 
	  </tr> 																		  
</table>
</div>
			  <br>																			  
			  <br>																			  
   <b id='vocbasic_id38'>资源</b><br>                                              
<div style="position:relative;" id='authInfo'>                                                                  
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id39'>临时端点前辍:</td>										
		 <td><input type='text' name='rtpPrefix'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id40'>(长度[1,64])</td>                                                 
	  </tr> 																		  
</table>
   <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id41'>起始临时端点:</td>										
		 <td><input type='text' name='rtpBase'></td>							 
         <td width="20"> </td>                                                 
         <td width="300"></td> 
	  </tr> 																		  
</table>
 <table border="0" cellpadding="0" cellspacing="0">                           
	  <tr>																			  
		 <td width="150" id='vocbasic_id42'>临时端点数目:</td>										
		 <td><input type='text' name='rtpNameScope'></td>							 
         <td width="20"> </td>                                                 
         <td width="300" id='vocbasic_id43'>(范围[2,128])</td> 
	  </tr> 																		  
</table>
</div>
			  <br>																			  
<table cellspacing="0" cellpadding="0" border="0">                                    
  <tbody>                                                                             
    <tr>                                                                              
      <td width="50"> </td>                                                               
      <td width="140" id='vocbasic_id44'>线路1</td>                                           
      <td width="140" id='vocbasic_id45'>线路2</td>                                           
    </tr>                                                                             
    <tr>                                                                              
      <td width="50" id='vocbasic_id46'>终端</td>                                                               
      <td><input type='text'  name='termName1'></td> 
      <td><input type='text'  name='termName2'></td> 
	   <td width="20"> </td>												 
    </tr>                                                       
  </tbody>                                                                            
</table>                                                                              
  </tbody>                                                                            
</table>                                                                              
<br>                                                                                  
<center>                                                                              
            <input class="buttonX" type='button' onClick="btnStartH248('basic')" ID="startH248cBtn" value='启动' disabled=true id='vocbasic_id47'>
            <br>
            <br>
            <input class="buttonX" type='button' onClick="btnStopH248('basic')" ID="stopH248cBtn" value='停止' disabled=true id='vocbasic_id48'>
            <br>
            <br>
            <input class="buttonX" type='button' onClick="btnApplyH248('basic')" ID="applyH248cBtn" value='保存' disabled=true id='vocbasic_id49'>
            <br>
            <br>                                                                               
</center>                                                                             
</form>                                                                               
</blockquote>                                                                         
</body>                                                                               
</html>                                                                               
