
        /** 
         * validateForm    : This function is used to validate the form incase validation successfull, shal call
         *                   invokeFind function
         * Parameters : form : current form object to validate
         * Return Value: return false - if validation failed
         * Compatibility:IE 6.0,Mozilla Firefox 1.0.7, Netscape Navigator 7.1
         **/
        function validateForm(form)
        {
           try{
                closeDiv('view_sponsor_slot')  
           }
           catch(e) 
           {}
           if(validateRequired(form,'required'))
            {
                invokeFind(); 
            }
            else
            {
                return false;
            }
        } 
        
        /** 
         * required   : This function is used to check 
         *                   whether search field is entered or not
         * Parameters : No parameters
         * Return Value: return true - if validation succesfull
         *               return false - if validation failed
         * Compatibility:IE 6.0,Mozilla Firefox 1.0.7, Netscape Navigator 7.1
         **/
        function required ()
        {
            this.aa = new Array('sponsor_keyword', ERR_TGS016_001,
                 new Function ('varName', ' return this[varName];'));
        }
        
       /** 
        *  displaySponsorProfile: This function is used to call the ajax method makeGETRequest() 
        *                          to display the sponsor profile
        *  Parameters           : sponsor_id: used to get sponsor_id
        *                       : event  : event occured
        *  Return Value         : return true - if validation succesfull
        *                         return false - if validation failed
        *  Compatibility        : IE 6.0,Mozilla Firefox 1.0.7, Netscape Navigator 7.1
        **/
        
        function displaySponsorProfile(sponsor_id,event)
        {
            setDivId('view_sponsor_slot');
            var url = base_url + "/sponsorManager/viewsponsor/sponsorProfilePT?sponsor_id="+encodeURI(sponsor_id);
            makeGETRequest(url,'view_sponsor_slot');
            displayWindow('view_sponsor_slot',event);

        } 
        /** 
        *  displaySponsorList: This function is used to call the ajax method makeGETRequest() 
        *                      to display the sponsor_type based on level_id
        *  Parameters        : sponsor_id: used to get sponsor_id
        *                    : event  : event occured
        *  Return Value      : return true - if validation succesfull
        *                      return false - if validation failed
        *  Compatibility     : IE 6.0,Mozilla Firefox 1.0.7, Netscape Navigator 7.1
        **/
        function displaySponsorList(level_id,event)
        {
           try{
                closeDiv('view_sponsor_slot')  
           }
           catch(e) 
           {}            makeGETRequest(level_id,'display_sponsor_type_slot');
        }
  
        /** 
        *  invokeFind       : This function is used to call the ajax method makeGETRequest() 
        *                     to display the sponsor based on the search criteria
        *  Parameters       : No parameters
        *  Return Value     : null
        *  Compatibility    : Internet Explorer(6.0)&Mozilla Firefox(5.0)
        **/
        function invokeFind() 
        {
            var sponsor_obj = document.getElementById('find_value');
            var chapter_id = document.getElementById('chapter_id').value;
            var sponsor_entered = sponsor_obj.value;
            var url = base_url + "/sponsorManager/viewsponsor/listSponsorPT?sponsor_value="+encodeURI(sponsor_entered)+"&find_value=true"+"&chapter_id=" +encodeURI(chapter_id);
            var search_display_slot_id = 'display_sponsor_type_slot';
            try{
                closeDiv('view_sponsor_slot')  
            }
            catch(e) 
            {}
            makeGETRequest(url, search_display_slot_id);
        }
        
        /**
         * enterkeyHandler: This function is used to submit the form when enter 
         *                  key is pressed from the keyboard
         * Parameters : event  : event occured
         *              frm    : document form name
         * Return Value: Shall not return any value
         * Compatibility: IE 6.0,Mozilla Firefox 1.0.7, Netscape Navigator 7.1
         **/
        function enterKeyHandler(event,frm)
        {
            var key;
            var ENTER_KEY = 13;
            if(window.event)
            {
                key = window.event.keyCode;     //IE
            }
            else
            {
                key = event.which;
            }
            if(key == ENTER_KEY)
            {
                is_valid = validateForm(frm); 
                if(is_valid)
                {
                    frm.submit();
                }  
                else
                {
                    return false;
                } 
            }
            else
            {
                return true;
            }  
        }
        
        function cursorFocus()
        {
            document.view_search.sponsor_keyword.focus();
	      
        }