
function hideFinancialLocationText()
{    
    var txtFin=document.getElementById('txtFinancialSearch');    
    if(txtFin.value==zipDefaultText)
    {
        txtFin.value='';
    }
    return false;
}

function showFinancialText()
{
    var txtFin=document.getElementById('txtFinancialSearch');   
    if(txtFin.value=='')
    {        
        txtFin.value=zipDefaultText;                
    }            
    
    return false;
}

function hideConsultantLastName()
{
    var txt=document.getElementById('cnsltLastName');
    if(txt.value==cnsltDefaultText)
    {        
        txt.value='';                
    }       
    return false;
}

function showCnsltLastName()
{
    var txt=document.getElementById('cnsltLastName');   
    if(txt.value=='')
    {        
        txt.value=cnsltDefaultText;               
    }            
    return false;
}

function redirectToSearchPage()
{
     var txtFin=document.getElementById('txtFinancialSearch');
     var txtLastName=document.getElementById('cnsltLastName');
     
    
    if((txtFin.value == "" || txtFin.value == zipDefaultText) && (txtLastName.value == "" || txtLastName.value == cnsltDefaultText))
    {
        alert('please enter zip code or consultant name to search.');
        txtFin.value='';
        txtFin.focus();
    } 
    else
    {
        locationSearchUrl=locationSearchUrl+'?ZipCode=' + txtFin.value.replace(zipDefaultText,'') + '&LastName=' + txtLastName.value.replace(cnsltDefaultText,'');
        window.location.href=locationSearchUrl;  
    }    
    return false;
}

function redirectToAdvancedSearch()
{
    window.location.href=locationSearchUrl;
    return false;
}

$(document).ready(function(){
/* Highlight Branding Text On Home Page */
	$("div.branding ul li").hover(function(){
		var thisId = $(this).attr("id");
		$(this).children("div").addClass("brandText" + thisId + "hover");
	},function(){
		var thisId = $(this).attr("id");
		$(this).children("div").removeClass("brandText" + thisId + "hover");
	});
});


/* Function to resize the Text of a Block */ 
function resizeText(multiplier) 
 { 
    var c = document.getElementById("mainContent"); 
    if (c)
    {
        if (c.style.fontSize == "")
            { 
                c.style.fontSize = "1.0em"; 
            }     
        if (multiplier == "-1" || multiplier == "+1" )
            c.style.fontSize = parseFloat(c.style.fontSize) + (multiplier * 0.2) + "em";
        else if (ReadCookie("FontSize") != -1)
        c.style.fontSize = ReadCookie("FontSize");        
        document.cookie = "FontSize=" + c.style.fontSize;   
    }
}

function ReadCookie(cookieName) 
{
     var theCookie = "" + document.cookie;
     var ind = theCookie.indexOf(cookieName);
     if (ind == -1 || cookieName == "") 
        return ""; 
     var ind1 = theCookie.indexOf(';', ind);
     if (ind1 == -1) 
        ind1 = theCookie.length; 
     var val = unescape(theCookie.substring(ind+cookieName.length+1,ind1));
     val = ReplaceAll(val, cookieName + "=" , "");
     val = ReplaceAll(val, ";" , "");
     return val;
}

function ReplaceAll(str, pcFrom, pcTo)
{     
    var i = str.indexOf(pcFrom);    
    var c = str;  
    while (i > -1)
    {       
        c = c.replace(pcFrom, pcTo);            
        i = c.indexOf(pcFrom);      
    } 
    return c;
}

function controlCenter (btnId, evt) 
{   
    var btn = document.getElementById(btnId);
    if (btn)
    {
        if (evt.keyCode == 13)
        {
            evt.returnValue = false;
            evt.cancel = true;            
            btn.click();
            return false;
        } 
    } 
}




function post(url) 
{
      var temp = document.createElement("form");
      temp.action = url;
      temp.method = "POST";
      temp.style.display = "none";

      document.body.appendChild(temp);
      temp.submit();

      return temp;
}
