$().ready(function(){	           	            	            	    
	            $(".txtKeywords").autocomplete("/Services/AutoComplete.ashx");
	            $(".txtKeywords").keydown(function(e){
//	                             $(".txtKeywords").focus();                                       
                                 if ($(".ac_results").length!=0){                               
                                     if ($(".ac_results")[0].style.display!="none"){
                                         if($(".btnSearch").length!=0){                                                                    
                                             return EnterPressAdd(e, function(){
                                                $(".btnSearch").click();
                                             });
                                             
                                         }                                         
                                     }                                                                             
                                 }        
                                 else{
                                    return EnterPressAdd(e, function(){
                                                $(".btnSearch").click();
                                             });                                  
                                 }                         
                         });                 
	            });

function EnterPressAdd(oEvent, fn)
{    
    var iAscii;
     
    if (window.event){
          
        iAscii = event.keyCode; 
    }
    else
        iAscii = oEvent.which; 
      
    if (iAscii == 13)
    {      
        fn(); 
        return false;        
    }

    return true;
} 