// JavaScript Document
function go(object)
{
	box = object;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}

function CatalogSearch() {
	document.location.href = 'http://catalog.bloomingtonlibrary.org/uhtbin/cgisirsi.exe/x/0/0/5?searchdata1=' + document.form1.search.value + '{general}';
}

function onEnter( evt, frm ) {
	
	var keyCode = null;

	if( evt.which ) {
	keyCode = evt.which;
	} else if( evt.keyCode ) {
	keyCode = evt.keyCode;
	}
	if( 13 == keyCode ) {
		CatalogSearch();
		return false;
	}
	return true;
}


// Message Fade Functionality
	hexGreen=255;
	hexBlue=255;
	
	function messageFade(element){ 


		elementID = element;	

		
			
		
		  if (hexGreen>0) { //If color is not black yet
			hexGreen-=5; // increase color darkness
			document.getElementById(elementID).style.color="rgb("+255+","+hexGreen+","+hexBlue+")";
			setTimeout("messageFade(elementID)",15); 
		  } else if (hexBlue>0) { //If color is not black yet
			hexBlue-=5; // increase color darkness
			document.getElementById(elementID).style.color="rgb("+255+","+hexGreen+","+hexBlue+")";
			setTimeout("messageFade(elementID)",15); 
		  } else {
		
			hexGreen=255;
			hexBlue=255;
		  	
		  }
	}

// End Message Fade Funtionality

// Check array of strings for validation
function oc(a)
{
  var o = {};
  for(var i=0;i<a.length;i++)
  {
    o[a[i]]='';
  }
  return o;
}
//

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}



