Hi guys,
I was playing with some code in my wordpress theme and this javascript is what also calls on php to search my blog. However, Chrome is giving me an Uncaught TypeError: Object #<Object> has no method 'getElementsById' and I was hoping someone could help me fix it.
I do not understand why it thinks the method does not exist as I believe it does and I need the elements to be "fetched" by their id.

Does anyone have any suggestions?

Here is my code.
Code JavaScript:
<script type="text/javascript">
			//<![CDATA[
			var searchbox = MGJS.$("searchbox");
			var searchtxt = MGJS.getElementsById("textfield", "input", searchform)[0];
			var searchbtn = MGJS.getElementsById("button", "input", searchform)[0];
			var tiptext = "<?php _e('Search...', 'inove'); ?>";
			if(searchtxt.value == "" || searchtxt.value == tiptext) {
				searchtxt.className += " searchtip";
				searchtxt.value = tiptext;
			}
			searchtxt.onfocus = function(e) {
				if(searchtxt.value == tiptext) {
					searchtxt.value = "";
					searchtxt.className = searchtxt.className.replace(" searchtip", "");
				}
			}
			searchtxt.onblur = function(e) {
				if(searchtxt.value == "") {
					searchtxt.className += " searchtip";
					searchtxt.value = tiptext;
				}
			}
			searchbtn.onclick = function(e) {
				if(searchtxt.value == "" || searchtxt.value == tiptext) {
					return false;
				}
			}
			//]]>
		</script>

I would really appreciate any Feedback or solution.

Thanks in Advance & Best Regards,
Team 1504