$(function() {
  $('input#top_search_box')
    .blur(function(event) {
      if(jQuery.trim($(this).val()) == "") {
        $(this).addClass('default').val('Search Conditions & Treatments');
      }
    })
    .focus(function(event) {
      if(jQuery.trim($(this).val()) == "Search Conditions & Treatments") {
        $(this).removeClass('default').val('');
      }
    })
    .parent().parent()
    .submit(function() {
      if($('input#top_search_box').hasClass('default')) {
        $('input#top_search_box').val('');
      }
    });
});

Object.extend = function(destination, source) {
  for (var property in source)
    destination[property] = source[property];
  return destination;
};

Object.extend(String.prototype, {
	strip: function() {
		return this.replace(/^\s+/, '').replace(/\s+$/, '');
	},
	empty: function() {
		return this == '';
	},

	blank: function() {
		return /^\s*$/.test(this);
	}
});
 $(document).ready(function() {
    pic1= new Image(118,26); 
  pic1.src="/tbi/_images/improvnav/red-about-us-button.gif"; 
 pic2= new Image(119,27); 
  pic2.src="/tbi/_images/improvnav/red-condition_treat_appt-button.gif"; 
 pic4= new Image(118,28); 
  pic4.src="/tbi/_images/improvnav/red-FAQs-button.gif"; 
 pic5= new Image(122,28); 
  pic5.src="/tbi/_images/improvnav/red-doctors-button.gif"; 
 pic6= new Image(123,28); 
  pic6.src="/tbi/_images/improvnav/red-contact-us-button.gif"; 
 pic8= new Image(119,28); 
  pic8.src="/tbi/_images/improvnav/red-ask-a-doc-button.gif"; 
 });

function rollme(imgfront,txtbg,imgback)
{	
	if(imgfront == 'begintab')
	{
		document.getElementById(imgfront).src='/tbi/_images/beginhighlight.gif';	
		document.getElementById(imgback).src='/tbi/_images/backhighlight.gif';
		document.getElementById(txtbg).background='/tbi/_images/redtabbg.gif';		
	}	
	else
	{
		document.getElementById(imgfront).src='/tbi/_images/fronthighlight.gif';
		document.getElementById(imgback).src='/tbi/_images/backhighlight.gif';
		document.getElementById(txtbg).background='/tbi/_images/redtabbg.gif';
	}
	
	if(imgback == 'endtab')
	{
		document.getElementById(imgback).src='/tbi/_images/redtabbg.gif';
	}
	else
	{
		document.getElementById(imgback).src='/tbi/_images/backhighlight.gif';
	}
}
	

