// JScript File
// Created 1-17-08 by Will Morrison

// Basically this just gives us an image submit button,
//   the alternate is an <input type=image> but the problem was
//   that our Google search was getting &x=0&y=0 from the image submit
//   so in order to avoid that, we are using this.

function getImageButton()
{
    var str;
          str = '<a href="#" onclick="document.search.submit(); return false;">';
    str = str + '<img border="0" alt="Submit" src="images-index/searchbtn-go4.gif">';
    str = str + '</a>';
    return str;
}


//Following function borrowed from
//http://snook.ca/archives/javascript/your_favourite_1/
function getElementsByClassName(classname, node) 
{ 
    if (node == "" || node == undefined) 
    { // this next line is basically a check to see if the page is done loading. 
    // document.body is undefined till the page has fully loaded. 
        if (document.body) 
        { node = document.body; } 
    } 
    var a = []; 
    // the regular expression tests against word boundaries, in case 
    // this item has several CSS classes assigned to it. 
    var re = new RegExp('\\b' + classname + '\\b'); 
    var els = node.getElementsByTagName("*"); 
    for(var i=0,j=els.length; i<j; i++)
       if(re.test(els[i].className))
       a.push(els[i]);
    return a;
}


function checktextbox()
	{
		
		if (document.search.my_filter.value.replace(/\s+/g,'') == '')
		{
			document.search.my_filter.value = 'SEARCH';
		}
		return false;
	}
	
	
	function erasetextbox()
	{
		if ( document.search.my_filter.value.toUpperCase() == 'SEARCH')
		{
			document.search.my_filter.value = '';
		}
		return false;
	}