/* ---------------------------------------------------------------------------
	
	Hospital Physician Partners Master Javascript file
	http://hppartners.com
	
	Author: nGen Works
	http://ngenworks.com
	
--------------------------------------------------------------------------- */

function init()
{
	$('#nav-global-partner').click(function(){
		$('#partner-links').toggle();
		$('#nav-global-partner a').toggleClass('here');
		return false;
	});
	
	$('#submit').click(function(){
		$('#upload-icon').toggle();
	});
	
	// Set sort by select to trigger onChange
	$("#sort-options").change(function() {
		window.location=$(this).val();
	});
	
	// Set sort by select to trigger onChange
	$("#sort-event-options").change(function() {
		window.location=$(this).val();
	});
	
}

// Hide and show the text in a form field on focus on blur, respectivley.
function clear_it(object){
  object.each(function(){
    $(this).bind("focus", function(){
      var orig_text = $(this).val();
      $(this).val('');
      $(this).bind("blur", function(){
        orig_text = ($(this).val() !== "") ? $(this).val() : orig_text ;
        $(this).val(orig_text);
      });
    });
  });
}

//Wait till the page has loaded
$(document).ready(function(){
	//////////////////////////////////////////////////////
	//INITIALIZE
	//////////////////////////////////////////////////////
	init();
	clear_it($(".callout-subscribe input"));
});