var SP_FadeInDuration = 300;
var SP_FadeOutDuration = 300;
var SP_SuggestionBoxDisplayDuration = 2000;
var SP_SearchDelay = 1;

$(function() 
{
	//Form field default val
    $("input.toggle-blank").focus(function()
    {
    	if (this.value == "Search for an answer...") { this.value = ""; }
    });
	$("input.toggle-blank").blur(function()
    {
    	if (this.value == "") { this.value = "Search for an answer..."; }
    });
	
	$("a[rel='single']").colorbox();
	$("a[rel='gallery']").colorbox({current: '{current} of {total}'});
	$("a.colorbox").colorbox();
	
	$(".inlineEmbeddedLink").each(function(i)
	{ 
		$(this).simpletip(
		{
			position: 'right',
			offset: [-35, -75],
			content: arr_tooltips[i]
		});
	}); 
});

function HandleFocus(defaultText, controlID) {

    var formControl = document.getElementById(controlID);
    
    if (formControl.value == defaultText) { formControl.value = ''; }
}

function toggleExplaination() {
    if (document.getElementById('status-info').style.display == 'block')
        document.getElementById('status-info').style.display = 'none'
    else {
        document.getElementById('status-info').style.display = 'block'
    }
}

function HandleBlur(defaultText, controlID) {

    var formControl = document.getElementById(controlID);

    if (formControl.value == '') { formControl.value = defaultText; }
}

function moveWindow() {
    var targetAnchor = document.getElementById('ctl00_cphMainContent_hdnScrollAnchor');

    if (targetAnchor != null) 
    {
        if (targetAnchor.value != '') {
            window.location.hash = targetAnchor.value;
        }
    }
}

//Homepage tabs
function changeHomePageTab(tabNo)
{

    document.getElementById("tabLink1").setAttribute('class', ''); 
    document.getElementById("tabLink1").setAttribute('className', ''); 
    document.getElementById("tabLink2").setAttribute('class', ''); 
    document.getElementById("tabLink2").setAttribute('className', ''); 
    document.getElementById("tabLink3").setAttribute('class', ''); 
    document.getElementById("tabLink3").setAttribute('className', ''); 
    document.getElementById("tabLink4").setAttribute('class', ''); 
    document.getElementById("tabLink4").setAttribute('className', ''); 

    document.getElementById("ctl00_pnlTab1").style.display='none';
    document.getElementById("ctl00_pnlTab2").style.display='none';
    document.getElementById("ctl00_pnlTab3").style.display='none';
    document.getElementById("ctl00_pnlTab4").style.display='none';
    
    if(tabNo==1)
    {
        document.getElementById("tabLink1").setAttribute('class', 'current'); 
        document.getElementById("tabLink1").setAttribute('className', 'current'); 
        document.getElementById("ctl00_pnlTab1").style.display='block';
    }
    else if(tabNo==2)
    {
        document.getElementById("tabLink2").setAttribute('class', 'current'); 
        document.getElementById("tabLink2").setAttribute('className', 'current'); 
        document.getElementById("ctl00_pnlTab2").style.display='block';
    } 
    else if(tabNo==3)
    {
        document.getElementById("tabLink3").setAttribute('class', 'current'); 
        document.getElementById("tabLink3").setAttribute('className', 'current'); 
        document.getElementById("ctl00_pnlTab3").style.display='block';
    }
    else if(tabNo==4)
    {
        document.getElementById("tabLink4").setAttribute('class', 'current'); 
        document.getElementById("tabLink4").setAttribute('className', 'current'); 
        document.getElementById("ctl00_pnlTab4").style.display='block';
    }
   }

   function RegistrationSectionToggle() {
       var dropdown = document.getElementById("ctl00_cphMainContent_ddlYouAre");

       var myindex = dropdown.selectedIndex
       var SelValue = dropdown.options[myindex].value
       if (SelValue == '3') {
           document.getElementById("form-section-pregnancy").style.display = 'block';
           document.getElementById("form-section-youngest-child").style.display = 'none';
       }
       else if (SelValue == '4') {
           document.getElementById("form-section-pregnancy").style.display = 'none';
           document.getElementById("form-section-youngest-child").style.display = 'block';
       }
       else {
           document.getElementById("form-section-pregnancy").style.display = 'none';
           document.getElementById("form-section-youngest-child").style.display = 'none';
       }
      }


