/**************************************************
* getJisaName()                            				*
**************************************************/
function getJisaName() {
    forms = document.lctE;
    forms.h_retn_type.value = "T";
    
    if ( forms.p_jisa_code.selectedIndex == 0 )
        forms.p_jisa_name.value = '';
    else
        forms.p_jisa_name.value = forms.p_jisa_code.options[forms.p_jisa_code.selectedIndex].text;

/*    forms.target = 'hidden';
    forms.method = 'post';
    forms.action = '/servlet/lctEcom.lctErnah';
    forms.submit();*/
}


/**************************************************
* setJisaName()                            				*
**************************************************
function setJisaName(Hforms) {                                                        
    forms = document.lctE;                                                       
    var RetnType = Hforms.h_retn_type.value;                                         
                                                                                     
    if ( RetnType =='S'){                                                            
        count = Hforms.p_jisa_code.length;                                           
        forms.p_jisa_code.length = count+1;                                          
        forms.p_jisa_code.selectedIndex = 0;                                         
                                                                                      
        forms.p_jisa_code.options[0].value ='';                                      
        forms.p_jisa_code.options[0].text  ='Selected...';                               
        for( i=1; i <= count; i++ ) {                                                
            forms.p_jisa_code.options[i].value = Hforms.p_jisa_code.options[i-1].value;
            forms.p_jisa_code.options[i].text  = Hforms.p_jisa_code.options[i-1].text;
        }                                                                            
    }
   // else if (RetnType =='T'){                                                       
   //     forms.p_user_name.value = Hforms.p_jisa_code.value;                         
   // }                                                                               
}    


**************************************************
* getDeptCode()                            				*
**************************************************/
function getDeptCode() {
    forms = document.lctE;

    if ( forms.p_obux_code.selectedIndex == 0 )
        forms.p_obux_name.value = '';
    else
        forms.p_obux_name.value = forms.p_obux_code.options[forms.p_obux_code.selectedIndex].text;

    forms.h_retn_type.value = "S";
   
    forms.target = 'hidden';
    forms.method = 'post';
    forms.action = '/servlet/lctEcom.lctEdnah';
    forms.submit();
}

/**************************************************
* setDeptCode()                           				*
**************************************************/
function setDeptCode(Hforms) {                                                        
    forms = document.lctE;                                                       
    var RetnType = Hforms.h_retn_type.value;                                         
                                                                                     
    if ( RetnType =='S'){                                                            
        count = Hforms.p_dept_code.length;                                           
        forms.p_dept_code.length = count+1;                                          
        forms.p_dept_code.selectedIndex = 0;                                         
                                                                                      
        forms.p_dept_code.options[0].value ='';                                      
        forms.p_dept_code.options[0].text  ='Selected...';                               
        for( i=1; i <= count; i++ ) {                                                
            forms.p_dept_code.options[i].value = Hforms.p_dept_code.options[i-1].value;
            forms.p_dept_code.options[i].text  = Hforms.p_dept_code.options[i-1].text;
        }                                                                            
    }else if (RetnType =='H'){  
        forms.p_dept_code.value = Hforms.p_dept_code.value;                                                   
        forms.p_engl_name.value = Hforms.p_engl_name.value;                         
    }                                                                               
}    
        

/**************************************************
* transMail()                             				*
**************************************************/
function transMail() {
    forms = document.lctE;
    
    
 		if((forms.p_comp_name[0].value == '' ) & (forms.p_comp_name[1].value == '' )) {
 		  alert('Insert a  Company Name!!!');
		  return;
   	}
		
		if((forms.p_cust_name[0].value == '' ) & (forms.p_cust_name[1].value == '' )) {
 		  alert('Insert a  Name!!!');
		  return;
   	}
   	
   	if((forms.p_tell_numb[0].value == '' ) & (forms.p_tell_numb[1].value == '' )) {
 		  alert('Insert a Telephone!!!');
		  return;
   	}
   	
   	if((forms.p_nato_name[0].value == '' ) & (forms.p_nato_name[1].value == '' )) {
 		  alert('Insert a Country!!!');
		  return;
   	}
   	
   	if((forms.p_mail_addr[0].value == '' ) & (forms.p_mail_addr[1].value == '' )) {
 		  alert('Insert a  E-mail Address!!!');
		  return;
   	}
           
    forms.target = '_self';
    forms.method = 'post';
    forms.action = '/servlet/lctE950.lctE950s';
    forms.submit();
}

/**************************************************
* emptyHead()                              				*
**************************************************/
function emptyHead(flag) {
    forms = document.lctE;
    
    if ( flag == '1' ) {
        forms.p_obux_code.selectedIndex = 0;
        forms.p_dept_code.selectedIndex = 0;
        forms.p_comp_name[1].value= '';
        forms.p_cust_name[1].value= '';
        forms.p_tell_numb[1].value= '';
        forms.p_nato_name[1].value= '';
        forms.p_mail_addr[1].value= '';
    }else {
        forms.p_jisa_code.selectedIndex = 0;
        forms.p_user_name.value= '';
        forms.p_comp_name[0].value= '';
        forms.p_cust_name[0].value= '';
        forms.p_tell_numb[0].value= '';
        forms.p_nato_name[0].value= '';
        forms.p_mail_addr[0].value= '';
    }    
}

/**************************************************
* getDetpCode()                            				*
**************************************************/
function getDetpName() {
    if ( forms.p_dept_code.selectedIndex == 0 )
        forms.p_dept_name.value = '';
    else
        forms.p_dept_name.value = forms.p_dept_code.options[forms.p_dept_code.selectedIndex].text;

}
