	function searchBox()
	{
		this.searchBox = document.getElementById('searchBox');
		this.defaultValue = "Search Our Site";
		
		this.clearBox = function()
		{			
			var value = this.searchBox.value;
			if(value == this.defaultValue)
			{
				this.searchBox.value = "";
			}
		}
		
		this.populateBox = function()
		{
			var value = this.trim(this.searchBox.value);
			if(value == "" || value == undefined || value == this.defaultValue)
			{
				this.searchBox.value = this.defaultValue;
			}
		}
		
		this.attachHandlers = function()
		{
			this.searchBox.value = this.defaultValue;
			Event.observe(this.searchBox,'focus',function(){sB.clearBox();});
			Event.observe(this.searchBox,'blur',function(){sB.populateBox();});
		}
		
		this.trim = function(str)
		{
			return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
		}
	}


	function patientEdRoll(id,status)
	{
		var span = document.getElementById(id+"Info");	

		if(status == 'over')
		{
			span.style.backgroundColor = "rgb(57,141,151)";
		}
		else
		{
			span.style.backgroundColor = "rgb(110,172,179)";
		}	
	}
	
	function pEattachHandlers()
	{
		if($$('div#patientEdMenu ul li a'))
		{
		var links = $$('div#patientEdMenu ul li a');
			for(var i=0;i<links.length;i++)
			{
				Event.observe(links[i].id,'mouseover',function(){
					patientEdRoll(this.id,'over');
				});
				Event.observe(links[i].id,'mouseout',function(){
					patientEdRoll(this.id,'out');
				});
				
			}
		}
	}
	
	function glossaryWin(url)
	{
		url = 'http://keemspineinstitute'+url;
		window.open(url,'hourWin','width=276,height=400,left=1,top=1,toolbar=no,scrollbars=yes,resizable=no');
		return false;
	}
//-------------------------\

	Event.observe(window,'load',function(){
		sB = new searchBox();
		sB.attachHandlers();
		pEattachHandlers();
	});