sorry here is the code

 Im in the // Validate function and i cant get past the first  //while loop. From what I've learned the // (query) is the paramater in which i need to pass one of the global variables through in order to complete the function, but the only global variable that would work is the //currentSearch but it causes the browser to get stuck in a loop and freeze up. I tried the //resultDIV but the error said an HTML element cannot be used and the same with //searchInput . I know it's something simple but i dont see any other global variables and when i call the function with out a variable to pass through it says that //(query) is undefined.