/**************************************************************************************************
 * Author           :   Nishanth S
 * Project          :   LoanModMeter
 * Module Name      :   General
 * Dated            :   13-Jun-2008
 * Modified on      :
**************************************************************************************************/
/*************************************************************************
 * Revision No      : 0001
 * Revised By & On  : Prajeesh.K.K ON  05-Nov-09
 * Purpose          : Included two additional functions ShowPopupUc() and  RunThroughMessagesUc()
 *                    To support Processing pop up from Loan Meter User Control also. 
 * 
 * **********************************************************************/
//=================================================================================================
// * Contains the java script functions required in the page
//=================================================================================================


//-----------------------------------------------------------------------------
//Show the processig message pop up for 5 seconds
//called before showing the loan meter page
//-----------------------------------------------------------------------------
function ShowPopup()
{
    //set the div visibility to true    
    document.getElementById('ModalPopup').style.display="block";
    document.getElementById('popContent').style.display="block";
    //Show the processing messages
    RunThroughMessages(1);
    //Hide the div after 5 seconds
    setTimeout('HidePopup()',5000);            
}
//-----------------------------------------------------------------------------
//Show the processig message pop up for 5 seconds
//called before showing the loan meter page
//It is calling when Loanmeter is a user control
//-----------------------------------------------------------------------------
function ShowPopupUc()
{
    //set the div visibility to true    
    document.getElementById('ModalPopup').style.display="block";
    document.getElementById('popContent').style.display="block";
    //Show the processing messages
    RunThroughMessagesUc(1);
    //Hide the div after 5 seconds
    setTimeout('HidePopup()',5000);            
}


//-----------------------------------------------------------------------------
//Hide the processing message pop up
//called automatically from within the ShowPopup function
//-----------------------------------------------------------------------------
function HidePopup()
{
    //set the div visibility to false
    document.getElementById('ModalPopup').style.display="none";
    document.getElementById('popContent').style.display="none";            
}

//-----------------------------------------------------------------------------
//Function for displaying the processing messages in the pop up
//called from within the ShowPopup function 
//It will be called from ShowPopupUc()
//Modified on 06 Nov 2009 to fix a bug.
//-----------------------------------------------------------------------------

function RunThroughMessagesUc(msgId)
{
    //Show the required message in the div
    if(msgId == 1)
        document.getElementById('ctl00_MainContentPlaceHolder_LoanMeter1_lblProcMsg').innerHTML = "Calculating income/expenses...";
    if(msgId == 2)
        document.getElementById('ctl00_MainContentPlaceHolder_LoanMeter1_lblProcMsg').innerHTML = "Calculating monthly payments...";
    if(msgId == 3)
        document.getElementById('ctl00_MainContentPlaceHolder_LoanMeter1_lblProcMsg').innerHTML = "Calculating ability to repay... ";
    
    //Show the next message until all the messages are finished
    //the interval between each message is 7 milliseconds
    msgId = msgId + 1;
    if(msgId < 4)
        setTimeout('RunThroughMessagesUc(' + msgId.toString() + ')',700);            
}
//-----------------------------------------------------------------------------
//Function for displaying the processing messages in the pop up
//called from within the ShowPopup function 
//It will be called from Loanmeter page
//-----------------------------------------------------------------------------

function RunThroughMessages(msgId)
{
    //Show the required message in the div
    if(msgId == 1)
        document.getElementById('ctl00_ContentPlaceHolder1_lblProcMsg').innerHTML = "Calculating income/expenses...";
    if(msgId == 2)
        document.getElementById('ctl00_ContentPlaceHolder1_lblProcMsg').innerHTML = "Calculating monthly payments...";
    if(msgId == 3)
        document.getElementById('ctl00_ContentPlaceHolder1_lblProcMsg').innerHTML = "Calculating ability to repay... " ;
    
    //Show the next message until all the messages are finished
    //the interval between each message is 7 milliseconds
    msgId = msgId + 1;
    if(msgId < 4)
        setTimeout('RunThroughMessages(' + msgId.toString() + ')',700);            
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function ShowRequestMessage()
{
    //alert('your request will be send to the counselor. Please wait while processing');
    RemoveFlash();
}

//-----------------------------------------------------------------------------
//Remove the flash content from the page and show the logo instead
//called when the user navigates from first tab to next tab
//(from within the ClientClick event of the navigate buttons)
//-----------------------------------------------------------------------------
function RemoveFlash()
{    
    document.getElementById('flashdiv').style.display="none";
    document.getElementById('logodiv').style.display="none";
}

//-----------------------------------------------------------------------------
//Display given tooltip for controls
//called from within the onmouseover event of the controls
//-----------------------------------------------------------------------------
function ShowToolTip(evt, toolTip)
{
    var xPos = 0;
    var yPos = 0;
    
    //Get the horizontal position of the mouse cursor
    if (evt.pageX) xPos = evt.pageX;
    else if (evt.clientX)
        xPos = evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
    else xPos = 0;
    
    //Get the vertical position of the mouse cursor
    if (evt.pageY) yPos = evt.pageY;
    else if (evt.clientY)
        yPos = evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
    else yPos = 0;           
    
    //Fill the tool tip div with the given tool tip content
    //and display the tooltip div at the cursor position
    var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = toolTip;
	obj.style.display = 'block';
	obj.style.left = xPos + 'px';
	obj.style.top = yPos + 'px';
	
	//An i-frame is also displayed at the same position and size of the div
	//this is to placethe div above all the controls in the page
	//if this is not there, the comboboxes, if any, will overlap the div
	var iframe = document.getElementById('iframetop');
    iframe.style.display = 'block';
    iframe.style.width = obj.offsetWidth;
    iframe.style.height = obj.offsetHeight;
    iframe.style.left = obj.offsetLeft;
    iframe.style.top = obj.offsetTop;
}

//-----------------------------------------------------------------------------
//Hide the tool tip div
//called from within onmouseout and onmousedown events of the controls
//-----------------------------------------------------------------------------
function HideToolTip()
{        
    document.getElementById('bubble_tooltip').style.display = 'none';
    document.getElementById('iframetop').style.display = 'none';   
}

//-----------------------------------------------------------------------------
//Show the confirmation message and then relaod the start page (clear data)
//called when the borrower is submitted/saved to the database
//-----------------------------------------------------------------------------
function ShowConfirmation()
{ 
    document.getElementById('spnConfirmMsg').style.display = 'block';
    document.getElementById('spnInitialMsg').style.display = 'none';
    alert("A counselor will contact you shortly. If you don't receive a call within 24 hours please call our hotline at 800-947-3752. Thank you for using Loan Advice Tool");
    window.location = 'SideBarConfirmation.aspx';
}

//-----------------------------------------------------------------------------
//show the content of the given left menu in the page
//called when a left menu item is clicked
//-----------------------------------------------------------------------------
function ShowLeftMenuContent(textId)
{
    //hide the meter screen and show the menu content screen
    document.getElementById('divMeterScreen').style.display = 'none';
    document.getElementById('menuContents').style.display = 'block';
    
    //change the text of the content screen
    ChangeBannerText(textId);
    return false;
}

//-----------------------------------------------------------------------------
//show the meter in the page
//called when the meter button in the content div is clicked
//-----------------------------------------------------------------------------
function ShowMeterScreen()
{
    //hide the meter screen and show the meter screen
    document.getElementById('divMeterScreen').style.display = 'block';
    document.getElementById('menuContents').style.display = 'none';
    
    //change the header of the meter screen
    document.getElementById('ctl00_loan_meter_title').innerHTML = "Need Help with your Mortgage?";
    RemoveFlash();
    document.getElementById('flashdiv').style.display="block";
    return false;
}

/****************************************************************************************
THESE FUNCTIONS ARE CURRENTLY NOT USED B'CAZ
THE CONFIRMATION MESSAGE IS NOW DISPLAYED AS AN ALERT MESSAGE

//-----------------------------------------------------------------------------
//Show the confirmation message pop up div
//called when the borrower is submitted/saved to the database
//-----------------------------------------------------------------------------
function ShowConfirmation()
{            
    document.getElementById('divConfirmOuter').style.display="block";
    document.getElementById('divConfirmContainer').style.display="block";   
}

//-----------------------------------------------------------------------------
//Hide the confirmation message popup div
//called when the close button in the div is clicked
//-----------------------------------------------------------------------------
function HideConfirmation()
{            
    document.getElementById('divConfirmOuter').style.display="none";
    document.getElementById('divConfirmContainer').style.display="none";      
}
****************************************************************************************/

//-----------------------------------------------------------------------------
//Change the text content left link content div
//called from within the ShowLeftMenuContent function
//-----------------------------------------------------------------------------
function ChangeBannerText(textId)
{    
    var text = "";
    var header = "";
    
    switch(textId)
    {
    //Changed the Phone number to 1-800-294-1801 on 08 Jan 2009
        case 1:
            header = "Fore Closure Prevention";
            text = "Whatever your situation, a certified counselor can help you find a solution tailored to meet your needs. <br/><br/>";
            text += "Call us now at 1-800-294-1801 to talk to someone who can help. <br/><br/>";
            text += "Even if you're not behind on your mortgage yet, if you're facing difficulty it's never too soon to call. In fact, the sooner you call, the easier it may be for us to help you. <br/><br/>";
            text += "Please contact us immediately if you're already behind on your mortgage or facing imminent foreclosure. We'll make a detailed assessment of your situation and work with you to find the best possible outcome. <br/><br/>";
            text += "When you call, know that your certified counselor is on your side and is ready to do whatever it takes to help you succeed. We deal with thousands of homeowners just like you, who find themselves facing foreclosure for a wide variety of reasons.<br /><br />";
//            text += "<b>The counseling process </b> <br /><br />";
//            text += "You can start by filling out this simple form to give us some basic information: <br /><br />";
//            text += "Try to gather a list of all the bills you regularly pay every month. It's also very helpful if you have a copy of your mortgage statement that has complete payment information and your loan number on it. The more information you can give us about your expenses, the better we'll be able to serve you. <br /><br />";
            break;
        case 2:
            header = "When you're facing foreclosure";
            text = "No matter where you are in foreclosure process, there are things you can do to remedy the situation short of losing your home. Please call us right away at 800-947-3752 to talk to a counselor about what you can do to prevent foreclosure and save your home. <br/><br/>";
            text += "Whatever you do, don't ignore the problem. Make yourself available to talk with your lender. They want to avoid foreclosure as much as you do, and avoiding them only makes the problem worse. <br/><br/>";
            
            text += "<b>About foreclosure </b> <br /><br />";
            text += "Foreclosure is a legal action taken by a mortgage company when a borrower's mortgage payment is not paid as agreed. The mortgage lender takes the property from the borrower through the foreclosure process. <br /><br />";
            text += "The actual process varies depending on what state you live in, but any borrower who does not make his or her mortgage payments may end up in foreclosure. <br /><br />";
            
            text += "<b>Foreclosure on the rise </b> <br /><br />";
            text += "As turmoil in the mortgage industry rises, millions of American homeowners are facing foreclosure. Even if you miss a single mortgage payment, your lender will fear the worst. <br /><br />";
            text += "Your lender wants to see you save your home and continue to be a successful borrower; if they are forced to foreclose on your home, everybody loses. It's important to remember this, because no matter how dire your situation may seem, there are solutions we can discuss with you. <br /><br />";
            
            text += "<b>The foreclosure process</b> <br /><br />";
            text += "If a borrower stops making mortgage payments, the lender will claim possession of the mortgaged property. This process usually involves serving notice to the borrower and going to court to seek a judgment.<br /><br />";
            text += "If the borrower still resides in the home, s/he may face eviction when the property is sold. It is usually then sold by the lender or auctioned off by state or county officials. Proceeds of the sale go to the mortgage lender to satisfy the unpaid debt.<br /><br />";        
            text += "The mortgage process varies from one jurisdiction to another, but it generally takes around six months from start to finish. It can take longer, and in some places the process can be completed as quickly as 45 days.<br /><br />";
            text += "Throughout that long process, you can stay in your home, and it is quite possible to negotiate a remedy that will help you avoid foreclosure. It's never too late to act to save your home.<br /><br />";
            
            text += "<b>Glossary of Mortgage Terms</b> <br /><br />";
            text += "<b>ARM </b>(Adjustable Rate Mortgage): A mortgage that has an interest rate which changes over the life of the loan, usually increasing at regular intervals.<br /><br />";
            text += "<b>Bankruptcy</b>: A legal proceeding that can legally release a person from repaying debts.<br /><br />";        
            text += "<b>Deed in lieu of foreclosure</b>: A process whereby the owner, with the approval of the lender, deeds the property to the lender to avoid foreclosure.<br /><br />";
            text += "<b>Equity</b>: The value of mortgaged property after the deduction of charges against it.<br /><br />";
            
            text += "<b>Extension Agreement</b>: An agreement giving additional time to repay a loan.<br /><br />";
            text += "<b>Fixed Rate Mortgage</b>: An home loan in which the interest rate and monthly payment is fixed for the term of the loan.<br /><br />";
            text += "<b>Foreclosure</b>: The legal proceeding in which a mortgage lender repossesses a borrower's property due to the borrower's failure to repay the loan.<br /><br />";
            text += "<b>Gross Income</b>: Your total income, before any taxes or other deductions have been applied.<br /><br />";
            text += "<b>Loan to Value Ratio (LTV)</b>: A percentage ratio determined by dividing home's current value into the loan amount. For example, with a sales price of $200,000 and a mortgage loan of $160,000, your loan to value ratio would be 80%.<br /><br />";
            text += "<b>Modification Agreement</b>: A written document, signed by the beneficiary and the borrower that alters the terms of mortgage.<br /><br />";
            break;
        case 3:
            header = "Alternatives to foreclosure";
            text = "There are many strategies we can talk to you about that can help you when you're facing foreclosure.<br/><br/>";
            text += "Here are just a few of the things you might consider in order to address an imminent foreclosure:<br/><br/>";  
            text += '<b><a href="" onclick="return ShowLeftMenuContent(4);">Loan Modification</a><br/><a href="" onclick="return ShowLeftMenuContent(5);">Short Sale</a><br/><a href="" onclick="return ShowLeftMenuContent(6);">Bankruptcy</a></b><br /><br />';
            text += "There are many more options available that might help you, and the sooner you seek help, the more options you have. Don't hesitate to contact us if you think your mortgage might be in trouble.<br/><br/>";
            break;
        case 4:
            header = "Loan Modification";
            text = "In order to avoid foreclosure, your lender may agree to modify some of the terms of the loan.<br/><br/>";
            text += 'Use the "Loan Option Advisor" tool to help us determine if we can use a loan modification to help you.<br/><br/>';
            text += "<b>How do I request a loan modification?</b><br /><br />";
            text += "This is a negotiation between the borrower and lender. It begins by contacting your mortgage company, discussing your problem, and proposing a solution that involves modifying the loan. <br/><br/>";        
            text += "Most homeowners are reluctant to enter into this sort of negotiation on their own. Thankfully, there are nonprofit entities that can negotiate on behalf of homeowners seeking a loan modification.<br/><br/>";
            text += "There are also for-profit companies who will perform this service for a fee, but they cannot guarantee the lender will accept the proposed loan modification. If you pay someone to help you modify your loan and the negotiation fails, you're left worse off than you started. And even if you get modification under these circumstances, the lender will not help you pay the fees incurred by the for-profit company.<br/><br/>";
            text += "As a HUD-approved nonprofit housing counseling agency, we can help you request a loan modification at no charge. Call us at 800-947.3752 or enter your information in the form above to see if we can help you.<br/><br/>";
            
            text += "<b>Making Payments Affordable</b><br /><br />";
            text += "The goal of mortgage modification is to get monthly payments to a more affordable level. An \"affordable\" mortgage payment is typically defined as 38 percent of the borrower's monthly gross income.<br/><br/>";        
            text += "To achieve this affordable payment, your lender may agree to extend the term of the mortgage. For instance, if you currently have a 15-year mortgage, it may be converted to a 30-year mortgage. A 30-year mortgage may be extended to 40 years.<br/><br/>";
            text += "Another way to make your monthly mortgage payment more affordable is to reduce your interest rate or temporarily convert your mortgage to an interest-only loan.<br/><br/>";
            text += 'Remember, not everyone will qualify for a loan modification. Use our "Loan Option Advisor" tool or call one of our certified counselors for a confidential session.<br/><br/>';
            break;
        case 5:
            header = "Short Sale";
            text = "With a short sale, the property facing foreclosure is sold and the lender accepts the sale price as full payment for the outstanding mortgage debt. This must be negotiated in advance, as the short sale price is less than the amount owed on the mortgage.<br/><br/>";
            text += "Because banks lose an average of $58,000 when they foreclose on a residential property, they may be willing to agree to a short sale to cut their losses.<br/><br/>";
            text += "In some cases, the bank will ask for a foreclosure deficiency; that means if the house sells for less than you owe on it, you must pay the different to the lender.<br /><br />";
            text += "Call us at 800.947.3752 and ask one of our certified counselors if a short sale might be right for you. If you decide to seek this option, we'll help you communicate with your mortgage lender and reach an agreement.<br/><br/>";        
            break;
        case 6:
            header = "Bankruptcy";
            text = "When facing foreclosure, bankruptcy can be an option that might help you keep your home.<br/><br/>";
            text += "Like foreclosure, bankruptcy is devastating to your credit rating. However, keeping a roof over your head with bad credit is better than losing your home.<br/><br/>";
            text += "If you file for bankruptcy protection, foreclosure proceedings are stopped. In this situation, unlike <u>loan modification</u> or <u>short sales</u>, you don't need to get your mortgage lender's agreement before proceeding.<br /><br />";
            text += "Bankruptcy isn't right for every debtor. Our bankruptcy counselors can help you determine if this is the right option for you. We're also approved by the Executive Office of US Trustees to provide bankruptcy counseling in accordance with federal laws. This approval doesn't imply an endorsement of our services.<br/><br/>";       
            
            text += "<b>How will bankruptcy save my home?</b><br /><br />";
            text += "With a chapter 7 bankruptcy, your debts are wiped out by the court. You will be able to request exemptions for important assets like your home and car. Because you will no longer be required to make your other debt payments (like credit cards and medical bills), income is freed up to be put toward your house payment. <br/><br/>";
            text += "In a chapter 13 bankruptcy, you and the court create a plan to repay your creditors over a 3 to 5 year period. The court may wipe out a portion of your debt. The court will look at your finances closely, and may monitor your progress while you are on this plan. Your mortgage lender may not proceed with foreclosure during this period so long as you are under chapter 13 protection and you make all of your debt payments.<br /><br />";
            text += "It's crucial that consumers who declare bankruptcy change their future behavior so they do not end up in the same situation down the road. Having all of one's debts wiped out by the court creates a strong temptation to acquire more debts (at much higher interest rates, thanks to the damage bankruptcy has done to one's credit rating). Let us help teach you strategies for managing your personal finances that can help you avoid future financial difficulties.<br/><br/>";
            
            text += "<b>How do I start the process of declaring bankruptcy?</b><br /><br />";
            text += "We strongly recommend that consumers seeking bankruptcy employ the services of a competent attorney. A bankruptcy lawyer will guide you through all of the steps of the complicated bankruptcy process.<br/><br/>";
            text += "Before you can file for bankruptcy protection, you'll need to talk to us or another EOUST-approved counseling agency. You can call our housing counselors to help you determine if bankruptcy is a solution that can help you keep your home and achieve debt relief.<br /><br />";
            text += 'Call us now at 800-947-3752 to talk to one of our certified counselors. Or visit <a href="http://www.bkhelp.org" target="_blank">www.bkhelp.org</a> for more information about bankruptcy counseling.<br/><br/>';
            break;
        case 7:
            header = "Becoming a homeowner";
            text = "While homeownership.org's primary mission is to help consumers who are having trouble paying their mortgage, we also offer information to help those who are looking to become homeowners for the first time. <br/><br/>";
            text += "It's important for homebuyers to get as much information as possible to help them become successful in the long term. The best way for us to help people avoid foreclosure is to set them on the right path as early as possible.<br/><br/>";
            text += "If you live in Southern California, you can attend one of our free <u>First-Time Homebuyer</u> workshops.<br /><br />";
            text += "We'll also offer some information about loan products for new homeowners, including <u>FHA loans</u>. <br/><br/>";
            break;
        case 8:
            header = "First-Time Homebuyer education";
            text = "When preparing to buy your first home, it's important to plan ahead so you can manage your finances and be a successful homeowner. <br/><br/>";
            text += "Our first-time homebuyer education course will help you make good decisions when buying a home. It's approved by HUD, Freddie Mac and Fannie Mae, and can qualify you for savings on the cost of FHA mortgage insurance as well as other first time homebuyer assistance programs. <br/><br/>";
            text += "Our first-time homebuyer education is offered free of charge and is available only in Southern California. To find out when our next first-time homebuyer seminar is being offered and to register to attend, call 951-781-0114 ext. 8820, or email education@credit.org. <br /><br />";
            text += "If you live outside of Southern California, visit HUD's website [http://www.hud.gov/buying/localbuying.cfm] to find a first-time homebuyer workshop near you. <br/><br/>";
            break;
        case 9:
            header = "FHA Loans";
            text = "An FHA loan allows a first-time homebuyer to purchase a home with less than 3% down payment. These loans typically help lower-income homebuyers who would otherwise not be able to afford a home.  <br/><br/>";
            text += "Not every homebuyer will qualify for an FHA loan. Generally, one needs to have 2 years of steady employment history, no recent bankruptcies, a stable credit history, no recent foreclosures, and enough income to afford the loan. <br/><br/>";
            text += "Because FHA loans have strict guidelines about the property that can be purchased, additional fees, and monthly mortgage insurance premiums, they may not be the best choice for a particular homebuyer. If one qualifies for a conventional mortgage, that may be a better option than an FHA loan. Currently FHA loans make up around 5% of mortgages in the US. <br /><br />";
            
            text += "<b>FHA Refinancing</b><br /><br />";
            text += "If you currently have a subprime or an adjustable rate mortgage, you may be able to refinance into an FHA loan. <br/><br/>";
            text += "With this refinancing, you will end up with lower monthly payments, making it easier to get by and avoid foreclosure. However, your monthly payments must be current before you can qualify for an FHA refinance. Unlike traditional mortgage refinancing, you cannot cash out any of your home's equity with an FHA refinance. <br/><br/>";
            text += "Refinancing might be an option that can help you if you're facing foreclosure. To speak with a HUD-certified housing counselor about your options, call us now at 800-947.3752. <br/><br/>";
            break;
        case 10:
            header = "About Us";
            text = "Homeownership.org is a free service of Springboard Nonprofit Consumer Credit Management. <br/><br/>";
            text += "As a HUD-approved nonprofit housing counseling agency, we help new homebuyers prepare themselves for homeownership, conduct reverse mortgage counseling for senior citizens, and provide foreclosure prevention counseling for any homeowner who needs assistance. <br/><br/>";
            text += "We were among the first agencies to receive approval by the EOUST to conduct bankruptcy counseling and education, and we were one of the founding counseling agencies in the Homeownership Preservation Foundation. <br /><br />";
            text += "For over 34 years, we've provided free financial education, credit counseling, and debt management services to consumers from coast to coast. We're members of the Better Business Bureau, accredited by the Council on Accreditation, and members of the National Foundation for Credit Counseling, the Association of Independent Consumer Credit Counseling Agencies, and the American Association of Debt Management Organizations. <br /><br />";
            text += "Our mission is simple, yet vital: to offer education on the wise use of credit. We are here to help. <br /><br />";        
            break;
         //Added on 12/12/2008   
         case 11:
           header ="Mortgage Relief Resources"; 
           text="Various programs and resources are available for homeowners:<br/><br/>";
           text+='* <a href="http://hocnetwork.squarespace.com/citigroup-citimortgage/" target="_blank"> Citigroup / CitiMortgage</a><br/><br/>'; 
           text+='* <a href="http://my.countrywide.com/media/FinancialAssistanceEN.html" target="_blank"> Countrywide Financial Settlement (Bank of America)</a><br/><br/>'; 
           text+='* <a href="http://www.fanniemae.com/homepath/homeowners/in_foreclosure.jhtml" target="_blank"> FannieMae</a><br/><br/>';
           text+='* <a href="http://www.fhfa.gov/GetFile.aspx?FileID=169" target="_blank"> FHFA Program</a><br/><br/>';
           text+='* <a href="http://www.freddiemac.com/service/factsheets/woinc.html" target="_blank"> Freddie Mac</a><br/><br/>';
           text+='* <a href="http://portal.hud.gov/portal/page?_pageid=73,7601299&_dad=portal&_schema=PORTAL" target="_blank"> HOPE for Homeowners (H4H)</a><br/><br/>';
           text+='* <a href="https://www.indymac.com/dynamic.aspx?id=1224&linkidentifier=id&itemid=1224" target="_blank"> IndyMac Federal Bank, FDIC</a><br/><br/>';
           text+='* <a href="https://www.chase.com/shared/marketing/ForeclosureDtls" target="_blank"> JP Morgan Chase & Co</a><br/><br/>';
           text+='* <a href="http://www.car.org/legal/mortgage-workout-programs/" target="_blank"> California Association of Realtors</a><br/><br/>';
        break;
        case 12:
         header ="The counseling process"; 
         text = "Here are some ways you can help make the counseling process as effective as possible:<br/><br/>";
         text += "* Try to gather a list of all the bills you regularly pay every month.<br/><br/>";
         text += "* It's also very helpful if you have a copy of your mortgage statement that has complete payment information and your loan number on it.<br/><br/>";
         text += "* Be ready to share an honest narrative of your situation. If you are eligible for a loan modification, you'll be expected to demonstrate to your lender that you have a genuine hardship and are deserving of assistance.<br/><br/>";
         text += "* It's important that your financial information is accurate; if you are found to be hiding income or over-stating expenses, you may lose any chance of a favorable workout with your lender.<br/><br/>";
         text += "* Before you resign yourself to foreclosure or commit to a short sale, call us at 800.947.3752 for counseling.<br/><br/>";
         text += "The more information you can give us about your expenses, the better we'll be able to serve you.<br/><br/>";
            break;
            case 13:
         header ="Federal Relief Programs"; 
         text = "As a HUD-approved housing counseling agency and an original member of the Homeownership Preservation Foundation, our agency is dedicated to helping homeowners find the best solution when facing difficulty with their mortgages.<br/><br/>";
         text += "We offer free one-on-one counseling that's always just a phone call away: call us 800.947.3752 to talk to a counselor about your situation.<br/><br/>";
         text += "You can also use this site to learn about some of your options, like loan modification, short sale, or bankruptcy.<br/><br/>";
         text += "We also offer educational information about the foreclosure process, mortgage lending, first-time homebuyer programs, and more.<br/><br/>";
         
         text += "<b>Streamlined Mortgage Modification Plan</b><br /><br />";
            text += "We are a part of the HOPE NOW alliance, which worked with the Treasury Department and various major mortgage services to create a streamlined modification plan (or SMP) to help at-risk homeowners stay in their homes.<br/><br/>";
            text += "Not everyone will qualify for the SMP; call one of our housing counselors to find out more about this program.<br/><br/>";            
            break;
        default:
            header = "Save Your Home";
            text = "As a HUD-approved housing counseling agency and an original member of the Homeownership Preservation Foundation, our agency is dedicated to helping homeowners find the best solution when facing difficulty with their mortgages. <br/><br/>";
            text += "We offer free one-on-one counseling that's always just a phone call away: call us 800.947.3752 to talk to a counselor about your situation. <br/><br/>";
            text += "You can also use this site to learn about some of your options, like loan modification, short sale, or bankruptcy. <br /><br />";
            text += "We also offer educational information about the foreclosure process, mortgage lending, first-time homebuyer programs, and more. <br /><br />";
            break;
    }           
    
    document.getElementById('divLMenuContent').innerHTML = text;
    //document.getElementById('divLMenuHeader').innerHTML = header;
    //Modified on Nov 06 To make Title visible in Loanmeter control
    if(document.getElementById('ctl00_loan_meter_title') !=null)
    {
      document.getElementById('ctl00_loan_meter_title').innerHTML = header;  
    }
    else
    {
    document.getElementById('ctl00_contentplaceHolder1_LoanMeter1_loan_meter_title').innerHTML=header;  
    
    }
}
