﻿ //document.onkeydown = checkKeycode;
         
           function CallSearch()
           {
               var objsearchText = document.getElementById("<%= txtSearchText.ClientID %>");
               var searchText;
               if ((objsearchText!=null))
               {
                   searchText = objsearchText.value;
                   searchText = searchText.replace(/>/gi, " >");
                   searchText = searchText.replace(/</gi, "< ");
                   objsearchText.value = searchText;
               }
             
               //This cookie is used for the backbutton to work in search on postback
               //This cookie must be cleared to prevent old search results from displayed
               document.cookie='postbackcookie=';
               location.href="http://devleeds.colorado.edu/Search/SearchPage.aspx?searchtext=" + searchText.replace('alert','').replace('confirm','') + "&folderid=0&searchfor=all&orderby=id&orderdirection=ascending";

               //Set websearch properties using querystring parameters
               //Properties set here- search text,Orderby, FolderId, and SearchFor
               //SearchFor can be a value from all/html/documents/images/multimedia/discussionForum
               //Orderby can be one of these - editor,id,rank,title,datecreated,datemodified
               //OrderDirection can be ascending or descending
           }
           
           function checkKeycode(e) {
             var keycode=0;
              if (window.event) // IE
                   keycode = window.event.keyCode;
              else if (e) // Netscape/Firefox/Opera
                   keycode = e.which;
               
              if(keycode == 13)
                 { 
                     CallSearch();            
                 }              
            }