function formvalidate(ob)
{
    var nameob=document.getElementById("txtName");
    var phoneob=document.getElementById("txtPhone");
    var emailob=document.getElementById("txtEmail");

    if(nameob.value=="")
    {
        alert("Enter Name");
        nameob.focus();

        return false;
    }

    if(phoneob.value=="")
    {
        alert("Enter Phone number");
        phoneob.focus();

        return false;
    }

    if(emailob.value=="")
    {
        alert("Enter Email-Id");
        emailob.focus();

        return false;
    }
    else if(!IsValidEmail(emailob.value))
    {
        alert("Enter valid Email-Id");
        emailob.focus();

        return false;
    }


    //window.open("../pdf/Benefit_Consultants.pdf",'CouponDownload','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
    return true;


}

function formvalidate_c(ob)
{
    var nameob=document.getElementById("txtName");
    var phoneob=document.getElementById("txtPhone");
    var emailob=document.getElementById("txtEmail");

    var zipob=document.getElementById("txtZip");

    var ageob=document.getElementById("txtAge");

     

    if(nameob.value=="")
    {
        alert("Enter Name");
        nameob.focus();

        return false;
    }

    if(phoneob.value=="")
    {
        alert("Enter Phone number");
        phoneob.focus();

        return false;
    }


    if(zipob.value!="")
    {
        if(!isInt(zipob.value))
        {
            alert("Enter valid Zip Code")
            zipob.focus();
            return false;
        }
        
    }

    if(ageob.value!="")
    {
        if(!isInt(ageob.value))
        {
            alert("Enter valid Age")
            ageob.focus();

            return false;
        }
        
    }
 
    if(emailob.value=="")
    {
        alert("Enter Email-Id");
        emailob.focus();

        return false;
    }
    else if(!IsValidEmail(emailob.value))
    {
        alert("Enter valid Email-Id");
        emailob.focus();

        return false;
    }


    window.open("../pdf/Benefit_Consultants.pdf",'CouponDownload','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');
    return true;


}

function isInt(x) {
    var y=parseInt(x);
    if (isNaN(y)) return false;
    return x==y && x.toString()==y.toString();
} 
//alert(isInt("1"));
// alert(isInt(1));
// alert(!isInt("1a"));
// alert(!isInt("1.0"));

function IsValidEmail(emailid)
{

    var email =/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

    if(!email.test(emailid))
    {
        return false;
    }
    else
    {
        return true;
    }


}



var Quotes =

{

    getRandomQuote: function()

    {

        var quote = [];
       
        quote[0] = 'I am pleased to inform you that we chose Benefit Consultants - Midwest after talking to several different insurance agents. <br/>I was very  pleased how you presented yourself and your company, as we felt that you were  looking out for our&nbsp;interest. <br />\n\
            <br />\n\
            &nbsp;1. You saved us money by looking for the best and  cheapest plan and you took your time to explain what the differences were and  that all plan F supplements for Medicare are the same and provide the same.<br />\n\
            <br />\n\
            &nbsp;2. Not only did you save us money but time as you were  very prepared.<br />\n\
            <br />\n\
            &nbsp;3. Most important you were very knowledgeable and your  follow up was excellent.<br />\n\
            <br />\n\
            &nbsp;4. Not only were you on top of taking care of my  requests but the follow up on my wife the following year took away the worry of  looking and starting over to get her insurance in&nbsp;line.<br />\n\
            We are very pleased with you and your company and would  recommend them to any individual or family. <br />\n\
            <span class="italic_head1"> -Jack &amp; Mary Ann, Frankfort IL</span>';

        quote[1] = 'We were at a loss in determining  if there was a supplement plan available to us because of our disabilities  and age (under 65). You were recommended by a friend which certainly was  beneficial for us. Your knowledge of the different options available was  certainly a time saver and more importantly reduced our stress level. Since our  initial meeting&nbsp;we have called numerous times and you have always  responded quickly and always with helpful&nbsp;information.&nbsp; <br />\n\
                                            <span class="italic_head1"> -Pat and Joe, Schaumburg IL</span>';

        quote[2] = 'You saved me hundreds of dollars a  month by recommending switching from an expensive group plan to supplement  Medicare.&nbsp; Then when the Medicare supplement plans changed, you were able  to find a new one that saved me even more money!<br />\n\
                                            <span class="italic_head1">-Janice, Beecher IL</span> ';

        quote[3] = 'After searching many individual sites and becoming more and  more confused I found this &quot;all in one site&quot; which sounded like it could  help me with the &quot;mess&quot;.&nbsp; It did.&nbsp; Had I found this site  first it would have saved me&nbsp;time, frustration and confusion.&nbsp;  Benefit Consultants &ndash; Midwest was fantastic!!!&nbsp; <br />\n\
                                            <span class="italic_head1">-Maureen, Danville IL</span>';

        quote[4] = 'Both Maryann and I wanted to say thanks for all your help  and guidance in getting us into the appropriate Medical Plans.&nbsp; Your  knowledge and experience was invaluable especially in light of the mis and  conflicting information we were receiving from both the Insurance Companies and  Medicare.&nbsp; To be sure we, and those we have recommended, would not be in  the quality plans we enjoy today without you.&nbsp; Keep up the good work.<br />\n\
                                            <span class="italic_head1">-Rick and Maryann,  Elmhurst IL</span>';

        

        var maxLength = quote.length;

        var position =  Math.floor(Math.random() * maxLength);
        //alert(Math.random()+"d"+position);
        return Quotes.displayQuote("quoteWrapper", quote[position]);

    },

    displayQuote: function(ctl, quote)

    {
 
        var   ctlo = document.getElementById(ctl);

        ctlo.innerHTML = "<div onmouseover='stopclock();' onmouseout='startclock();'><p>"+quote+"</p>\n\
<div onmouseover='stopclock();' onmouseout='startclock();' style='text-align:right;padding-top:10px;'>\n\
<a href='../about_us/testimonials.html' class='link'>Read more</a></div></div>";
        try{
            if(homepage!="")
            {
                ctlo.innerHTML = "<div onmouseover='stopclock();' onmouseout='startclock();'><p>"+quote+"</p>\n\
<div onmouseover='stopclock();' onmouseout='startclock();' style='text-align:right;padding-top:10px;'>\n\
<a href='about_us/testimonials.html' class='link'>Read more</a></div></div>";
       
            }
        }catch(e){}



    }

};


function GetZipcode_quoteInfo_calculator()

{

   
    var BCML_Zipcode=document.getElementById("BCML_Zipcode").value;

    if(BCML_Zipcode=="")
    {
        alert("Please enter Zip Code");
        document.getElementById("BCML_Zipcode").focus();
        return false;
    }
    else if(!isInt(BCML_Zipcode))
    {
        alert("Please enter valid Zip Code");
        document.getElementById("BCML_Zipcode").focus();
        return false;
    }
    else
    {
        location="medicare_supplement_plans/calculator.php?zipcode="+BCML_Zipcode;
        return false;
    }
    return false;

}

function GetZipcode_quoteInfo_calculator_root()

{


    var BCML_Zipcode=document.getElementById("BCML_Zipcode").value;

    if(BCML_Zipcode=="")
    {
        alert("Please enter Zip Code");
        document.getElementById("BCML_Zipcode").focus();
		
        return false;
    }
    else if(!isInt(BCML_Zipcode))
    {
        alert("Please enter valid Zip Code");
        document.getElementById("BCML_Zipcode").focus();
        return false;
    }
    else
    {
        location="../medicare_supplement_plans/calculator.php?zipcode="+BCML_Zipcode;
        return false;
    }
    return false;
}

function changezipcode(zipcode)
{

    document.getElementById("BCML_Zipcode").value=zipcode;
    GetZipcodeInfo()
}

try{



    var timerID = null
    var timerRunning = false

    // 1 minute = 60000 milliseconds. Quotes.getRandomQuote()*/
     
    function startclock(){
        // Make sure the clock is stopped
        stopclock()
        timerID = setInterval("Quotes.getRandomQuote()",4000)
        timerRunning = true
    }

    function stopclock(){
        if(timerRunning)
            clearInterval(timerID)
        timerRunning = false
    }

    startclock();
}catch(e){}
