﻿function showSearch() {

    positionDiv("search", "gotosearch");
    document.getElementById("search").style.display = document.getElementById("search").style.display == 'block' ? 'none' : 'block';


}

function findPosX(obj) {
    //alert(obj.offsetParent);
    var curleft = 0;
    if (obj.offsetParent) {
        while (obj.offsetParent) {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
    return curleft;
}
function findPosY(obj) {
    var curtop = 0;
    if (obj.offsetParent) {
        while (obj.offsetParent) {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
    return curtop;

}
function positionDiv(divid, id) {

    var x = findPosX(document.getElementById(id));
    var y = findPosY(document.getElementById(id)) + document.getElementById(id).offsetHeight + 1;
    document.getElementById(divid).style.top = y - 12 + 'px';
    document.getElementById(divid).style.left = x - 120 + 'px';

}

var currlocation = location.href;


if (currlocation.substring(currlocation.lastIndexOf("/") + 1) == 'default.aspx') {
    location.href = 'http://' + document.domain;

}

var _dinamicbannerimgAr1 = new Array();
var _currentbanner = 0;
var _currentbannermax = 1;
var rImg1 = new Array();
setTimeout("Changebanner()", 5000);
function Changebanner() {
    try {
        var _innerloop = 0;
        for (_innerloop = 0; _innerloop <= _currentbannermax; _innerloop++) {
            document.getElementById('divdinamicbanner' + _innerloop).style.display = 'none';
        }
        document.getElementById('divdinamicbanner' + _currentbanner).style.display = '';
        _currentbanner++;
        if (_currentbanner > _currentbannermax) {
            _currentbanner = 0;
        }

        setTimeout("Changebanner()", 5000);
    }
    catch (err) {
    }
}

//Shadobox





var welcomemessage = ""
Shadowbox.init({
    // let's skip the automatic setup because we don't have any
    // properly configured link elements on the page
    skipSetup: true
    // include the html player because we want to display some html content

});


function showFlash() {
    document.getElementById('divlogin').style.display = "none";

}


function shooo() {

    ShowBanner();
    setTimeout("CloseShadobox()", 13000);




}

function CloseShadobox() {
    Shadowbox.close();
}

function ShowBanner() {
    Shadowbox.open({
        content: '<div id="divlogin"> <div id="divclosebutton" style="position: absolute; display: none; top: 0px; right: 0px; border: 0; left: 600px;"> <a href="javascript:void(0)"> <img src="images/close.png" style="margin-top: 3px; margin-right: 0px" onclick="CloseDivLogin()" alt="close" /></a> </div> <div> <table> <tr> <td> <div id="Div110"> <div id="Div2"> <img  src="http://www.eurekaforbes.com/images/Ganeshchathu.jpg" width="600" height="370" border="0" usemap="#Map" /> <map name="Map" id="Map1"> <area shape="rect" coords="119,314,275,350" href="http://www.eurekaforbes.com/blog/BlogDetails.aspx?BlogID=54" /> <area shape="rect" coords="329,312,482,349" href="http://www.facebook.com/EurekaForbes" target="_blank" /> </map> </div> </div> </td> </tr> </table> </div> </div>',
        player: "html",
        title: "",
        height: 378,
        width: 607
    });


};



//Added on 21 sep By Rajesh Thakur for Awtar Navigation

function hiddendiv() {

    document.getElementById('p1').style.display = "block";
    //$get('divavtar').innerHTML = '<ul class="options"> <li> <input name="lp" type="radio" value="" /> I am looking for Products</li> <li> <input name="lp" type="radio" value="" /> I am lookinf for After sales service</li> <li> <input name="lp" type="radio" value="" /> I want to know more about EFL</li> <li> <input name="lp" type="radio" value="" /> I am lookin for a career in EFL</li> <li> <input name="lp" type="radio" value="" /> I am looking to Partner with EFL</li> <li> <input name="lp" type="radio" value="" /> I am lookinf for EFL&#39;s office address</li> </ul>';
}
function hiddendivserach(id, visibility) {
    document.getElementById(id).style.display = visibility;
}

function StartProcess() {
    $get('divavtar').innerHTML = "rajesh Thakur";
}

function CheckFlash() {
    if (FlashDetect.installed) {

        document.getElementById('homeFlash').innerHTML = '<div id="homeFlashMain"> <!--FLASH--> <div id="flashcontent2"><embed type="application/x-shockwave-flash" src="water-purifier.swf" width="1002" height="424" id="movie" name="movie" bgcolor="#D8EFF0" quality="high" scale="noscale" wmode="opaque"></div></div>'


        document.getElementById('bflashID').innerHTML = '<div id="flashcontent20" style="z-index: 500; display: none; top: 102px; position: absolute;"> <embed type="application/x-shockwave-flash" src="images/Avatar_lrg.swf" width="1002" height="600" id="movie" name="movie" bgcolor="#D8EFF0" quality="high" scale="noscale" wmode="transparent"> </embed> </div> <div id="divshowhide" style="width:315px;height:180px; display:none;"> </div> <div id="flashcontent1" style="top:500px;"> <embed type="application/x-shockwave-flash" src="images/Avatar_sm.swf" width="315" height="180" id="movie" name="movie" bgcolor="#D8EFF0" quality="high" scale="noscale" wmode="transparent"> </embed> </div>'

    } else {


        $("#homeFlash").removeClass()
        $("#shomeFlash").removeClass()
        $("#homeFlash").addClass("innovative");
        $("#shomeFlash").addClass("bginnovative1");
        document.getElementById('homeFlash').innerHTML = ' <div class="bginnovative1"> <div align="center"><img src="images/innovative-txt.gif" alt="" title="" /></div> <div class="clrhight15px"></div> <div class="innovative-box"> <div class="innovation-box_in"> <div class="clrhight40px"></div> <div align="center" class="imghght"> <img src="images/img-aquaguard1.png" alt="" /> </div> <div class="left"><img src="images/txt-aqua1.png" alt="" width="185" height="30" /></div> <div class="lftnav"> <ul> <li><a href="http://www.eurekaforbes.com/water-purifiers/aquaguard-total-enhance.aspx">Know more...</a></li> <li><a href="http://www.eurekaforbes.com/296-BuyNow/ShoppingCart.aspx">Buy now for Rs. 12,990</a></li> <li><a href="demo_request.aspx">Book a Demo</a></li> </ul> </div> </div> <div class="innovation-box_in"> <div class="clrhight40px"></div> <div align="center" class="imghght"> <img src="images/img-amrit.gif" alt="" /> </div> <div class="left"><img src="images/txt-amrit.gif" alt="" width="186" height="30" /></div> <div class="lftnav"> <ul> <li><a href="http://www.eurekaforbes.com/water-purifiers/amrit.aspx">Know more...</a></li><li><a href="http://www.eurekaforbes.com/244-BuyNow/ShoppingCart.aspx">Buy now for Rs. 1,990</a></li> </ul> </div> </div> <div class="innovation-box_in"> <div class="clrhight40px"></div> <div align="center" class="imghght"> <img src="images/img-bravo.gif" alt="" width="157" height="188" /> </div> <div class="left"> <img src="images/txt-bravo.gif" alt="" width="186" height="30" /> </div> <div class="lftnav"> <ul> <li><a href="http://www.eurekaforbes.com/vacuum-cleaners/euroclean-bravo.aspx">Know more...</a></li> <li><a href="http://www.eurekaforbes.com/245-BuyNow/ShoppingCart.aspx">Buy now for Rs. 3,990</a></li> <li><a href="demo_request.aspx">Book a Demo</a></li> </ul> </div> </div> <div class="innovation-box_in"> <div class="clrhight40px"></div> <div align="center" class="imghght"> <img src="images/img-euriair.png" alt="" /> </div> <div class="left"></div> <div class="left"> <img src="images/txt-euroair.gif" alt="" width="186" height="30" /> </div> <div class="lftnav"> <ul> <li><a href="http://www.eurekaforbes.com/air-purifiers/euroair-detox.aspx">Know more...</a></li> <li><a href="http://www.eurekaforbes.com/261-BuyNow/ShoppingCart.aspx">Buy now for Rs. 10,990</a></li> <li><a href="demo_request.aspx">Book a Demo</a></li> </ul> </div> </div> <div class="innovation-box_in"> <div class="clrhight40px"></div> <div align="center" class="imghght"> <img src="images/img-colour.gif" alt="" width="166" height="190" /> </div> <div class="left"> <img src="images/txt-colorvideo.png" alt="" /> </div> <div class="lftnav"> <ul> <li><a href="http://www.eurekaforbes.com/security-systems/state-of-the-art-colour-video-door-phone.aspx">Know more...</a></li> <li><a href="demo_request.aspx">Book a Demo</a></li> </ul> </div> </div> </div> </div>'


        document.getElementById('bflashID').innerHTML = '<div id="divstatic"> <div class="bflash"> <div class="iconbottom"> <a href="http://www.eurekaforbes.com/blog/blog.aspx"> <img src="images/icon-blog.gif" alt="Blog" title="Blog" /></a><br /> <a href="http://www.eurekaforbes.com/forums.aspx"> <img src="images/icon-forum.gif" width="46" height="35" alt="Forum" title="Forum" /></a><br /> <a href="http://www.eurekaforbes.com/Demo_Request.aspx"> <img src="images/icon-demo.gif" width="46" height="46" alt="Demo" title="Demo" /></a><br /> </div> <div style="float: left;"> <a href="#" onmouseover=hiddendiv();> <img src="images/bottom-flash2.gif" alt="" width="255" height="167" /></a> </div> </div> </div>';
    }
}
function CloseDiv() {

    $get('hdncheck').value = "";
    document.getElementById('p1').style.display = "none";
    document.getElementById('p1').innerHTML = ' <br /> <br /> <div class="right" align="right"> <a href="javascript://" onclick="CloseDiv();"> <img src="images/popup-avatar-close.gif" alt="Close" title="Close" /></a></div> <div class="avatarLarge"> <img src="images/img-avatar-large.png" alt="" /></div> <!--Options Block--> <div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6" /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-submitavtar.gif" alt="Submit" title="Submit" onclick="ProcessAvtar()" /></a></div> </div> <!--End Options Block--> </div>'

}

// process first screen
function ProcessAvtar() {

    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                             
            case "1":
                CreateHTML();

                break;

            //I am lookinf for After sales service             
            case "2":
                window.location = strdomain + "servicerequeststeps.aspx";

                break;

            //I want to know more about EFL                             
            case "3":

                window.location = strdomain + "aboutus/aboutus-profile.aspx";

                break;

            //I am lookin for a career in EFL            
            case "4":
                window.location = strdomain + "careers.aspx";

                break;

            //I am looking to Partner with EFL                             
            case "5":
                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> I am looking to <b>partner</b> with <b>EFL</b> </h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> I&#39;m interested in partnering as a Dealer</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I&#39;m interested in partnering as a Sales Franchisee</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I&#39;m interested in partnering as a Packaged Drinking Water Franchisee</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> I&#39;m interested in partnering as a Customer Service Business Associate</li> <li> <input name="lp" id="avop5" type="radio" value="5" /> I&#39;m looking to Partner with EFL in Technology innovation</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-submitavtar.gif" alt="Submit" title="Submit" onclick="ProcesssecPartnerWithEFL()" /></a><span style="padding-left: 40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromPartnetWithEFL")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span></div> </div>';
                break;

            //I am lookinf for EFL's office address                             
            case "6":
                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> I am looking for <b>EFL</b>  Office Address </h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> I am looking for a Customer Response Center</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I am looking for a Franchisee</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I am looking for Global Business</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-submitavtar.gif" alt="Submit" title="Submit" onclick="ProcessOfficeAddress()" /></a><span style="padding-left: 40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromOfficeAddress")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span></div> </div>';
                break;


        }


    }
);

}


//process Product Category
function ManageProducts() {
    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                             
            case "1":
                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2>Know the best <b>Purification Technology</b> for you water now!!</h2><br /><br /> Water in your locality needs special treatment to make it pure and safe for drinking.<br/><b>ENTER YOUR PINCODE</b> and water source to <b>KNOW THE WATER PURIFICATION <br/>TECHNOLOGY</b> that best suits your water conditions. <br /> <br /> <div> <table> <tr> <td> Enter Pincode: </td> <td> <input type="text" id="txtpincode" maxlength="6" class="inputfield1" onkeypress="return isNumberKey(event)" /> </td> <td> Your Name: </td> <td> <input type="text" id="txtmname" maxlength="20" class="inputfield1"/> </td> </tr> <tr> <td> Water Source: </td> <td> <select class="inputfield1" style="height:auto;width:187px;" id="ddlwatersource"> <option value="0">Select Water Source</option> <option value="1">Corporation</option> <option value="2">Bore Well</option> <option value="3">Open Well</option> <option value="4">Mixed(Corporation+ Tanker)</option> <option value="5">Donn&#39;t Know</option> <option value="6">Others</option> </select> </td> <td> Mobile No: </td> <td> <input type="text" id="txtmobileno" maxlength="10" onkeypress="return isNumberKey(event)" class="inputfield1"/> </td> </tr> <tr id="trstate" style="display:none;"><td>State:</td><td><select id="ddlstate" style="height:auto;width:187px;" class="inputfield1" onchange="FillCity()"></select></td><td>City:</td><td><select id="ddlcity" style="height:auto;width:187px;" class="inputfield1"></select><input class="inputfield1" type="text" id="txtcitybox" style="display:none;" /></td></tr> <tr id="tremail" style="display:none;"><td>Email:</td><td><input type="text" id="Email" maxlength="100" class="inputfield1" /></td><td>&nbsp;</td><td>&nbsp;</td></tr> </table> </div> <br /> <div style="padding-left: 90px;"> <a href="javascript:void(0)"> <img src="images/btn-submitavtar.gif" alt="Submit" title="Submit" onclick="return ProcessWaterDoctor();" /></a><span id="divloader" style="display:none;padding-left: 40px;"><img src="images/69.gif"></span> <span style="padding-left: 80px;"><a href="javascript:void(0)" onclick=processBackEvents("backfromwaterdoctorform")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div> </div>';
                //                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2>Know the best Purification Technology for you water now!!</h2><br /><br /> Water in your locality needs special treatment to make it pure and safe for drinking.ENTER YOUR PINCODE<br /> and water source to KNOW THE WATER PURIFICATION TECHNOLOGY that best suits your water conditions. <br /> <br /> <div> <table> <tr> <td> Enter Pincode: </td> <td> <input type="text" id="txtpincode" maxlength="6" class="inputfield1" onkeypress="return isNumberKey(event)" /> </td> <td> Your Name: </td> <td> <input type="text" id="txtmname" maxlength="20" class="inputfield1"/> </td> </tr> <tr> <td> Water Source: </td> <td> <select class="inputfield1" style="height:auto;width:187px;" id="ddlwatersource"> <option value="0">Select Water Source</option> <option value="1">Corporation</option> <option value="2">Bore Well</option> <option value="3">Open Well</option> <option value="4">Mixed(Corporation+ Tanker)</option> <option value="5">Donn&#39;t Know</option> <option value="6">Others</option> </select> </td> <td> Mobile No: </td> <td> <input type="text" id="txtmobileno" maxlength="10" onkeypress="return isNumberKey(event)" class="inputfield1"/> </td> </tr> </table> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next" onclick="return ProcessWaterDoctor();" /></a><span id="divloader" style="display:none;padding-left: 40px;"><img src="images/ajax-loaderavatr.gif">Processing...</span> <span style="padding-left: 80px;"><a href="javascript:void(0)" onclick=processBackEvents("backfromwaterdoctorform")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div> </div>';
                break;

            //I am lookinf for After sales service             
            case "2":
                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Vacum Cleaners</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" /> I need a Vacuum Cleaner that can clean automatically</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I need a light Vacuum Cleaner for daily cleaning</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I need a vacuum cleaner which is versatile and helps me clean every part of my house</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> I need a vacuum that not only does through cleaning but helps me wet clean my home </li> <li> <input name="lp" id="avop5" type="radio" value="5" /> I need a cleaning solution to clean the exteriors  of my house,wash my car,etc</li> <li><input name="lp" id="avop6" type="radio" value="6" /> I need a complete sanitiser for my house</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)" onclick="ManageVacuumCleaner()"> <img src="images/btn-submitavtar.gif" alt="Submit" title="Submit" /></a> <span style="padding-left: 40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromvacuumcleaners")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div> </div>';

                break;

            //I want to know more about EFL                             
            case "3":

                $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Air Purifier</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" /> I need a Air Purifier for my car</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I need a Air Purifier for small offices/pubs</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I need a Air Purifier for my home</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next"  onclick="ProcessAirpurifier()" /></a> <span style="padding-left: 40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromAirpurifier")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div> </div>';

                break;

            //I am lookin for a career in EFL            
            case "4":
                $get('innovativeform').innerHTML = ' <div class="innovativeform" id="innovativeform"> <h2> Security System</h2> <br /> <div> <b>I Want to secure my home & office, when i am away</b><br /><br /><ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" /> CCTV</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> Biometric Lock</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> Before i open my home i need to see who is on the other side</li> </ul> <b>I need complete protection and control to protect my family and belongings</b><br/><br/>  <ul class="options"> <li> <input name="lp" id="Radio1" type="radio" value="1" /> Wireless</li> <li> <input name="lp" id="Radio2" type="radio" value="2" /> Wired</li> <li> <input name="lp" id="Radio3" type="radio" value="3" /> Hybrid</li> </ul> <ul class="options"> <li> <input name="lp" id="Radio4" type="radio" value="1" /> Access Control for homes and offices </li> <li> <input name="lp" id="Radio5" type="radio" value="2" /> Complete convenience and control of my home on finger tips</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next"  onclick="ProcesssecuritySystem()" /></a> <span style="padding-left: 40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromSecuritySystem")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div> </div>';

                break;


        }


    }
);

}

function CreateHTML() {

    $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2><span> I am <b>Interested</b> in:</span></h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> Water Purifiers</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> Vacuum Cleaners</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> Air Purifiers</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> Security Systems</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next" onclick="ManageProducts()" /></a> <span style="padding-left:40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromproduct")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div>';

}


function CreateHTMLProductCategoryWise(productcategory) {

    $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> I am <b>Interested</b> in:</h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> Water Purifiers</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> Vacuum Cleaners</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> Air Purifiers</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> Security Systems</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next" onclick="ProcessProduct()" /></a> <span style="padding-left:40px;"> <a href="javascript:void(0)" onclick=processBackEvents("backfromproduct")> <img src="images/btn-back.gif" alt="Back" title="Back" /></a></span> </div>';

}


//process back events
function processBackEvents(backposition) {

    switch (backposition) {

        case "backfromproduct":

            //            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6" /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>'
            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" onfocus=changeimage("Next") /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" onfocus=changeimage("submit") /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" onfocus=changeimage("submit") /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" onfocus=changeimage("submit") /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" onfocus=changeimage("Next") /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6"  onfocus=changeimage("Next") /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" id="imgnext" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>';
            break;


        case "backfromvacuumcleaners":

            CreateHTML();
            break;

        case "backfromwaterdoctorform":

            CreateHTML();
            break;


        case "backfromAirpurifier":

            CreateHTML();
            break;

        case "backfromSecuritySystem":

            CreateHTML();
            break;

        case "backfromPartnetWithEFL":

            //            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp"  id="avop1" type="radio" value="1" onfocus=changeimage("Next") /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6" /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>'
            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" onfocus=changeimage("Next") /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" onfocus=changeimage("submit") /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" onfocus=changeimage("submit") /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" onfocus=changeimage("submit") /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" onfocus=changeimage("Next") /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6"  onfocus=changeimage("Next") /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" id="imgnext" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>';
            break;

        case "backfromOfficeAddress":
            //            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" onfocus=changeimage("Next"); /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" onfocus=changeimage("submit"); /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" onfocus=changeimage("submit");" /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" onfocus=changeimage("submit"); /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" onfocus=changeimage("Next"); /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6"  onfocus=changeimage("Next"); /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" id="imgnext" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>';
            $get('innovativeform').innerHTML = '<div class="innovativeform" id="innovativeform"> <h2> Welcome to the World of <b>Eureka Forbes</b>. I am glad to Assist you.<br /> <span>Choose <b>any 1</b> of the options for which <b>you need help</b></span>.</h2> <br /> <div> <ul class="options"> <li> <input name="lp" id="avop1" type="radio" value="1" onfocus=changeimage("Next") /> I am looking for Products</li> <li> <input name="lp" id="avop2" type="radio" value="2" onfocus=changeimage("submit") /> I am looking for After sales service</li> <li> <input name="lp" id="avop3" type="radio" value="3" onfocus=changeimage("submit") /> I want to know more about EFL</li> <li> <input name="lp" id="avop4" type="radio" value="4" onfocus=changeimage("submit") /> I am looking for a career in EFL</li> <li> <input name="lp" id="avop5" type="radio" value="5" onfocus=changeimage("Next") /> I am looking to Partner with EFL</li> <li> <input name="lp" id="avop6" type="radio" value="6"  onfocus=changeimage("Next") /> I am looking for EFL&#39;s office address</li> </ul> </div> <br /> <div style="padding-left: 30px;"> <a href="javascript:void(0)"> <img src="images/btn-next.gif" id="imgnext" alt="Next" title="Next" onclick="ProcessAvtar()" /></a></div> </div>';
            break;







    }

}

// Process Vacumm Cleanrs

function ManageVacuumCleaner() {
    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                               
            case "1":

                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/euroclean-robocleanz.aspx';
                break;

            //I am lookinf for After sales service               
            case "2":
                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/clean-automatically.aspx';

                break;

            //I want to know more about EFL                               
            case "3":

                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/vacuum-versatile.aspx';

                break;

            //I am lookin for a career in EFL              
            case "4":
                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/euroclean-wet-dry.aspx';

                break;

            case "5":
                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/euroclean-power-wash.aspx';

                break;

            case "6":
                window.location = 'http://www.eurekaforbes.com/vacuum-cleaners/spakle.aspx';

                break;




        }


    }
);

}


// Process Air Purifier

function ProcessAirpurifier() {
    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                                
            case "1":

                window.location = 'http://www.eurekaforbes.com/air-purifiers/euroair-pureair.aspx';
                break;

            //I am lookinf for After sales service                
            case "2":
                window.location = 'http://www.eurekaforbes.com/air-purifiers/euroair-energie.aspx';

                break;

            //I want to know more about EFL                                
            case "3":

                window.location = 'http://www.eurekaforbes.com/air-purifiers/airpurifier-home.aspx';

                break;



        }


    }
);

}


// Process Security System

function ProcesssecuritySystem() {
    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                                 
            case "1":

                window.location = 'http://www.eurekaforbes.com/security-systems/cctv-system.aspx';
                break;

            //I am lookinf for After sales service                 
            case "2":
                window.location = 'http://www.eurekaforbes.com/security-systems/biometric-fingerprint-door-lock.aspx';

                break;

            //I want to know more about EFL                                 
            case "3":

                window.location = 'http://www.eurekaforbes.com/security-systems/videodoorphone.aspx';

                break;

            case "4":

                window.location = 'http://www.eurekaforbes.com/security-systems/Wirelessdoorphone.aspx';

                break;

            case "5":

                window.location = 'http://www.eurekaforbes.com//security-systems/b-100.aspx';

                break;

            case "6":

                window.location = 'http://www.eurekaforbes.com/security-systems/Hybridpannel.aspx';

                break;


            case "7":

                window.location = 'http://www.eurekaforbes.com/security-systems/access-control-systems.aspx';

                break;



            case "8":

                window.location = 'http://www.eurekaforbes.com/security-systems/home-automation-systems.aspx';

                break;




        }


    }
);

}

// Process Security System


function ProcesssecPartnerWithEFL() {
    var strdomain = "http://www.eurekaforbes.com/";


    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                                  
            case "1":

                window.location = 'http://www.eurekaforbes.com/becomedealer.aspx';
                break;

            //I am lookinf for After sales service                  
            case "2":
                window.location = 'http://www.eurekaforbes.com/becomefranchisee.aspx';

                break;

            //I want to know more about EFL                                  
            case "3":

                window.location = 'http://www.eurekaforbes.com/pdwfranchisee.aspx';

                break;

            case "4":

                window.location = 'http://www.eurekaforbes.com/becomesalespartner.aspx';

                break;

            case "5":

                window.location = 'http://www.eurekaforbes.com/aboutus/aboutUs-technology-innovation.aspx';

                break;





        }


    }
);

}



// Process Looking For Office Adress


function ProcessOfficeAddress() {



    $("input[@type=radio][@checked]").each(
    function() {

        var x = $(this).val();

        switch (x) {

            //I am looking for Products                                   
            case "1":

                window.location = 'http://www.eurekaforbes.com/locator.aspx';
                break;

            //I am lookinf for After sales service                   
            case "2":
                window.location = 'http://www.eurekaforbes.com/franchiseelocator.aspx';

                break;

            //I want to know more about EFL                                   
            case "3":

                window.location = 'http://www.eurekaforbes.com/global_business_locator.aspx';

                break;

        }


    }
);

}

function ProcessWaterDoctor() {

    if (validateWaterDoctorForm() == true) {





        var pincode = $get('txtpincode').value;
        var name = $get('txtmname').value;
        var ddlwatersource = $get('ddlwatersource');
        var ddlwatersourcevalue = ddlwatersource.options[ddlwatersource.selectedIndex].value;

        var MobileNO = $get('txtmobileno').value;





        if ($get('hdncheck').value == "PincodeNotFound") {

            var pincode = $get('Email').value;
            if (pincode == "") {
                alert('Please enter Email ID!');
                $get('Email').focus();
                return false;

            }

            var RegEmail = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;

            if (!RegEmail.test($get('Email').value)) {
                alert("Please enter a valid Email Address.");
                $get('Email').focus();
                return false;
            }


            var ddlstate = $get('ddlstate');
            var ddlstateselectedvalue = ddlstate.options[ddlstate.selectedIndex].value;
            if (ddlstateselectedvalue == "0") {
                alert('Please Select State!');
                $get('ddlstate').focus();
                return false;

            }


            if ($get('txtcitybox').style.display == "" || $get('txtcitybox').style.display == "block") {

                if ($get('txtcitybox').value == "") {
                    alert('Please Enter City !');
                    $get('txtcitybox').focus();
                    return false;
                }


            }
            if ($get('ddlcity').style.display == "" || $get('ddlcity').style.display == "block") {

                var ddlcity = $get('ddlcity');
                var ddlcityselectedvakue = ddlcity.options[ddlcity.selectedIndex].value;
                if (ddlcityselectedvakue == "") {
                    alert('Please Select City!');
                    $get('ddlcity').focus();
                    return false;

                }

            }
            $('#divloader').show();

            var ddlwatersource = $get('ddlwatersource');
            var ddlwatersourcevalue = ddlwatersource.options[ddlwatersource.selectedIndex].text;
            var ddlstate = $get('ddlstate');
            var ddlstatevalue = ddlstate.options[ddlstate.selectedIndex].text;

            var ddlcity = $get('ddlcity');
            var ddlcityvalue = null;


            if ($get('txtcitybox').style.display == "" || $get('txtcitybox').style.display == "block") {
                ddlcityvalue = $get('txtcitybox').value;
            }
            else {
                ddlcityvalue = ddlcity.options[ddlcity.selectedIndex].text;
            }



            //pincode, Name, watersource, MobileNo, state, city, email
            pkkd.PKDoctor.InsertWaterDoctorData($get('txtpincode').value, $get('txtmname').value, ddlwatersourcevalue, $get('txtmobileno').value, ddlstatevalue, ddlcityvalue, $get('Email').value, onsucessofEntry);
            //Inset Datta To Datbase

        }
        else {
            $('#divloader').show();
            pkkd.PKDoctor.GetTDSForOIS("pkusr1234", "pkpwd456", pincode, ddlwatersourcevalue, onsucess, onError);
        }
    }


}

function onsucessofEntry(result) {
    $('#divloader').hide();
    $get('hdncheck').value = "PincodeFound";
    alert('Thanks for your Enquiry.\r Our Team Will get in touch with you shortly !');

}


function onsucess(result) {
    if (result != "Not Found") {
        $get('innovativeform').innerHTML = result;
        $('#divloader').hide();
        $('#trstate').hide();
        $('#tremail').hide();
        $get('hdncheck').value = "PincodeFound";

    }
    else {

        $get('hdncheck').value = "PincodeNotFound";

        $('#divloader').hide();
        $('#trstate').show();
        $('#tremail').show();
        FillState();

        //        $get('innovativeform').innerHTML = "Form";
    }
}
function onError() {
    $('#divloader').hide();
}
function validateWaterDoctorForm() {


    var pincode = $get('txtpincode').value;
    if (pincode == "") {
        alert('Please enter Pincode !');
        return false;
    }

    if ($get('txtpincode').value.length < 6) {
        alert("Please enter 6 digit Pincode !");
        $get('txtpincode').focus();
        return false;
    }

    var checkpincode = IsNumber($get('txtpincode').value)

    if (checkpincode == false) {
        alert('Please enter valid 6 digit Pincode !');
        $get('txtpincode').focus;
        return false;
    }

    var name = $get('txtmname').value;
    if (name == "") {
        alert('Please Enter Name!');
        $get('txtmname').focus();
        return false;
    }

    var checkName = addressSpecial($get('txtmname').value);

    if (checkName == 'false') {
        alert("Special Character[|%;`^<>[]{}=?~'\\\] are not in Name !");
        $get('txtmname').focus();
        return false;
    }

    var ddlwatersource = $get('ddlwatersource');
    var ddlwatersourcevalue = ddlwatersource.options[ddlwatersource.selectedIndex].value;
    if (ddlwatersourcevalue == "0") {
        alert('Please Select Water Source !');
        return false;

    }

    var MobileNO = $get('txtmobileno').value;
    if (MobileNO == "") {
        alert('Please Enter Mobile No !');
        return false;
    }

    if ($get('txtmobileno').value.length < 10) {
        alert("Please enter 10 digit Mobile No !");
        $get('txtmobileno').focus();
        return false;

    }


    var checkMobileNO = IsNumber($get('txtmobileno').value)

    if (checkMobileNO == false) {
        alert('Please Enter 10 digit Valid Mobile No !');
        $get('txtmobileno').focus;
        return false;
    }



    return true;
}


function addressSpecial(sText) {
    var ValidChars = "|%;`^<>[]{}=?~'\\\"";
    var IsNumber = true;
    var Char;

    for (i = 0; i < sText.length && IsNumber == true; i++) {
        Char = sText.charAt(i);
        if (ValidChars.indexOf(Char) != -1) {
            IsNumber = "false";
            //alert ("Please enter characters only.");						
        }
    }
    return IsNumber;
} //character validation

function IsNumber(sText) {
    var ValidChars = "0123456789";
    var IsNumber = true;
    var Char;

    for (i = 0; i < sText.length && IsNumber == true; i++) {
        Char = sText.charAt(i);

        if (ValidChars.indexOf(Char) == -1) {
            IsNumber = "false";
            //alert ("please enter numeric only.");						
        }
    }

    return IsNumber;
} //number validation


function isNumberKey(evt) {
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;

    return true;
}


function FillState() {


    pkkd.PKDoctor.GetStateLists(OnRequestCompleteState, onerrorofFillCity);


}

function onerrorofFillCity() {
    alert("error");
}

function OnRequestCompleteState(result) {

    var ddlstate = $get('ddlstate');

    ddlstate.innerHTML = "";
    ddlstate.length = 0;


    var option = document.createElement("option");
    option.value = "0";
    option.innerHTML = "--Select State--";
    ddlstate.appendChild(option);

    for (var n = 0; n < result.length; n++) {

        var option = document.createElement("option");
        option.value = result[n].SateID;
        option.innerHTML = result[n].StateName;
        ddlstate.appendChild(option);
    }
    document.getElementById('ddlstate').selectedIndex = 0;


}

function onerrorofFillCity() {
    alert('error');
}

function FillCity() {
    var ddlstate = $get('ddlstate');

    var valddlstate = ddlstate.options[ddlstate.selectedIndex].value;

    pkkd.PKDoctor.FillCity(valddlstate, OnRequestCompleteCity);


}

function OnRequestCompleteCity(result) {
    var ddlcity = $get('ddlcity');

    ddlcity.innerHTML = "";
    ddlcity.length = 0;

    var ddlstate = $get('ddlstate');

    var valddlstate = ddlstate.options[ddlstate.selectedIndex].value;
    if (valddlstate != 0) {
        if (result.length == 0) {
            $get('txtcitybox').style.display = "";
            $get('ddlcity').style.display = "none";
        }
        else {
            $get('txtcitybox').style.display = "none";
            $get('ddlcity').style.display = "";
        }
    }
    for (var n = 0; n < result.length; n++) {

        var option = document.createElement("option");
        option.value = result[n].CityID;
        option.innerHTML = result[n].CityName;
        ddlcity.appendChild(option);
    }

}

//Swape Next and Submit Button

function changeimage(obj) {
    if (obj == "Next") {
        $get('imgnext').src = 'images/btn-next.gif';
    }
    else {
        $get('imgnext').src = 'images/btn-submitavtar.gif';
    }
}

        
