$(document).ready(function()
{
	Cufon.replace("#main-navigation ul li", { 
		fontFamily: 'MetaCondOT-Normal',
		hover: true,
        hoverables: {
            a: true
        }
	});
	
    $("#overlay-input").focusin(function() {
    	clearText(this);
    });
	
	$("#search-box .main-search").focusin(function() {
		clearText(this);
    });
    
   	$("#search-bar .main-search").focusin(function() {
		clearText(this);
    });
    
   	$("#practitioner-search-page-input").focusin(function() {
		clearText(this);
    });
    
   	$("#knowledgebase-search-box").focusin(function() {
		clearFAQText(this);
    });
    
	$("#knowledgebase-search-box").focusout(function() {
		showFAQText(this);
    });
	
    
	$("#practitioner-search-page-input").focusout(function() {
		showText(this);
    });
	
	$("#search-box .main-search").focusout(function() {
		showText(this);
    });
    
	$("#search-bar .main-search").focusout(function() {
		showText(this);
    });

    $("#overlay-input").focusout(function() {
		showText(this);
    });
    
	$("#main-navigation ul li.selected").find('a').css('color','#69a1b1', 'font-weight', 'bold');
});

var getStarted = {
	openOverlay: function()
	{
		$('#overlay-container').css('display', 'block');
		this.setSemiTransparentBG();
	},
	closeOverlay: function()
	{
		$('#overlay-container').css('display', 'none');
		this.setSemiTransparentBG();
	},
	setSemiTransparentBG: function()
	{
		var thediv=document.getElementById('displaybox');
		if(thediv.style.display == "none"){
			thediv.style.display = "";
			
		}else{
			thediv.style.display = "none";
		}
		return false;
	}
}

/* ---------------- */
/* GLOBAL FUNCTIONS */
/* ---------------- */

function jumpScroll() {
	window.scroll(0,0); // Jump to top of the page
}
function clearText(theText) {
	if (theText.value == theText.defaultValue) {
		theText.value = ""
	}
}
function showText(theText) {
	if (theText.value == "") {
		theText.value = theText.defaultValue;
	}
}

function clearFAQText(theText) {
	if (theText.value == 'Enter a question or keyword') {
		theText.value = ""
	}
}
function showFAQText(theText) {
	if (theText.value == "") {
		theText.value = 'Enter a question or keyword';
	}
}

String.prototype.Trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "");
} 


