﻿// JScript File

/************************/
var imgHTTP = getreq();
function isEmpty(elem, helperMsg) {
    if (elem.value.length == 0) {
        alert(helperMsg);
        elem.focus();
        return true;
    }
    return false;
}
function IsNumeric(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;
        }
    }
    return IsNumber;
}
function isAlphabet(elem, helperMsg) {
    var alphaExp = /^[a-zA-Z ]+$/;
    if (elem.value.match(alphaExp)) {
        return true;
    }
    else {
        alert(helperMsg);
        elem.focus();
        return false;
    }
}
function isAlphanumeric(elem, helperMsg) {
    var alphaExp = /^[0-9a-zA-Z ]+$/;
    if (elem.value.match(alphaExp)) {
        return true;
    } else {
        alert(helperMsg);
        elem.focus();
        return false;
    }
}

function emailValidator(elem) {
    var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,3}$/;
    if (elem.value.match(emailExp)) {
        return true;
    }
    else {
        return false;
    }
}
function lengthRestrictiondate(elem, min, max) {
    var uInput = elem.value;
    if (uInput.length >= min && uInput.length <= max) {
        return true;
    } else {
        alert("Please enter a valid expiry date");
        elem.focus();
        return false;
    }
}
function lengthRestrictionmax(elem, min, max) {
    var uInput = elem.value;
    if (uInput.length >= min && uInput.length <= max) {
        return true;
    } else {
        alert("Please enter between 6 and 16 characters");
        elem.focus();
        return false;
    }
}
function lengthRestriction(elem, min, max) {
    var uInput = elem.value;
    if (uInput.length >= min && uInput.length <= max) {
        return true;
    } else {
        alert("Please enter a valid Phone Number");
        elem.focus();
        return false;
    }
}
function ismobileno(elem, max) {
    var uInput = elem.value;
    if (uInput.length == max) {
        return true;
    } else {
        alert("Please enter a valid 10 digit Mobile Number");
        elem.focus();
        return false;
    }
}
function isDescription(objValue) {
    var alphaExp = /[^-_()".',a-zA-Z0-9\s]/;
    if (objValue.match(alphaExp))
        return false;
    return true;
}
function trim(str) {
    return RTrim(LTrim(str));
}
function RTrim(str) {
    // We don't want to trip JUST spaces, but also tabs,line feeds, etc.  Add anything else you want to "trim" here in Whitespace
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(s.length - 1)) != -1) {
        // We have a string with trailing blank(s)...
        var i = s.length - 1;       // Get length of string
        // Iterate from the far right of string until we don't have any more whitespace...
        while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
            i--;
        // Get the substring from the front of the string to where the last non-whitespace character is...
        s = s.substring(0, i + 1);
    }
    return s;
}
function LTrim(str) {
    var whitespace = new String(" \t\n\r");
    var s = new String(str);
    if (whitespace.indexOf(s.charAt(0)) != -1) {
        // We have a string with leading blank(s)...
        var j = 0, i = s.length;
        // Iterate from the far left of string until we don't have any more whitespace...
        while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
            j++;
        // Get the substring from the first non-whitespace character to the end of the string...
        s = s.substring(j, i);
    }
    return s;
}
/**************************/
function eservice_go(link) {
    window.location = link.value;
}
function livechatlink() {
    var url_add = "https://server.iad.liveperson.net/hc/44482436/?cmd=file&file=visitorWantsToChat&site=44482436&byhref=1&SESSIONVAR!&imageUrl=https://www.royalsundaram.in/chatonline/";
    window.open(url_add, 'welcome', 'width=400,height=475');
    return false;
}
function CheckProduct() {
    if ((document.getElementById("oncall").checked == false) && (document.getElementById("atdoor").checked == false)) {
        alert('Please check how to contact you');
        document.getElementById("oncall").focus();
        return false;
    }
    if ((document.getElementById("oncall").checked == true) || (document.getElementById("atdoor").checked == true)) {

        if (document.getElementById("txtname").value == "") {
            alert('Please enter your Name');
            document.getElementById("txtname").focus();
            return false;
        }
        if (document.getElementById("txtname").value != "") {
            if (!isAlphabet(document.getElementById("txtname"), 'Please enter alphabets only')) {
                document.getElementById("txtname").value = "";
                document.getElementById("txtname").focus();
                return false;
            }
        }

        if (document.getElementById("txttel").value == "") {
            alert("Please enter your Phone Number");
            document.getElementById("txttel").focus();
            return false;
        }
        if (document.getElementById("txttel").value != "") {
            if (!IsNumeric(document.getElementById("txttel").value)) {
                alert("Please enter numbers only ");
                document.getElementById("txttel").value = "";
                document.getElementById("txttel").focus();
                return false;
            }
            else {
                if (!lengthRestrictionmax(document.getElementById("txttel"), 6, 16)) {
                    return false;
                }
            }
        }

    }
}
function CheckRenew() {
    if (document.getElementById("txtpolicyno").value == "") {
        alert('Please enter your policy number');
        document.getElementById("txtpolicyno").focus();
        return false;
    }
    if (document.getElementById("txtpolicyno").value != "") {
        if (!isAlphanumeric(document.getElementById("txtpolicyno"), 'Please enter alphanumeric values only')) {
            document.getElementById("txtpolicyno").value = "";
            document.getElementById("txtpolicyno").focus();
            return false;
        }
    }
    if ((document.getElementById("txtexpday").value == "")) {
        alert("Please enter the expiry day");
        document.getElementById("txtexpday").focus();
        return false;
    }
    if (document.getElementById("txtexpday").value != "") {
        if (!IsNumeric(document.getElementById("txtexpday").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtexpday").value = "";
            document.getElementById("txtexpday").focus();
            return false;
        }
        else {
            if (!lengthRestrictiondate(document.getElementById("txtexpday"), 2, 2)) {
                return false;
            }
        }
    }
    if ((document.getElementById("txtexpmonth").value == "")) {
        alert("Please enter the expiry month");
        document.getElementById("txtexpmonth").focus();
        return false;
    }
    if (document.getElementById("txtexpmonth").value != "") {
        if (!IsNumeric(document.getElementById("txtexpmonth").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtexpmonth").value = "";
            document.getElementById("txtexpmonth").focus();
            return false;
        }
        else {
            if (!lengthRestrictiondate(document.getElementById("txtexpmonth"), 2, 2)) {
                return false;
            }
        }
    }
    if ((document.getElementById("txtexpyear").value == "")) {
        alert("Please enter the expiry year");
        document.getElementById("txtexpyear").focus();
        return false;
    }
    if (document.getElementById("txtexpyear").value != "") {
        if (!IsNumeric(document.getElementById("txtexpyear").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtexpyear").value = "";
            document.getElementById("txtexpyear").focus();
            return false;
        }
        else {
            if (!lengthRestrictiondate(document.getElementById("txtexpyear"), 4, 4)) {
                return false;
            }
        }
    }
}
function objectcreate() {
    var browser = navigator.appname;
    var objectres;
    if (browser == "Microsoft Internet Explorer") {
        objectres = new ActiveXObject("MicrosoftXMLHttp");
    }
    else {
        objectres = new XMLHttpRequest();
    }
    return objectres;
}
var newHTTP = getreq();
function getreq() { // returns false if exists
    if (window.ActiveXObject) { // if IE
        try {
            return new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                return new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                return;
            }
        }
    } else if (window.XMLHttpRequest) { // if Mozilla, Safari, etc.
        return new XMLHttpRequest();
    }
}
var typevalue;
var catvalue;
var typevalue1;
var genvalue;
var http_section = getreq();
var sType;
var sName;
var sTelno;

/* Added for sokrati implementation  Parent Function used on OnClick Event */

/* Child Function used to feed the values in the db */

function loadproduct(pagenm, prodstype) {
    var Name = document.getElementById("txtname").value;

    if (document.getElementById("txtemail")) {
        var Email = document.getElementById("txtemail").value;
    }
    if (Name == "" || Email == "") {
        alert("Please fill mandatory fields");
        return false;
    }
    else {
        if (Name != "") {
            if (!isAlphabet(document.getElementById("txtname"), 'Please enter alphabets only')) {
                document.getElementById("txtname").value = "";
                document.getElementById("txtname").focus();
                return false;
            }
        }
        if (document.getElementById("txtemail")) {
            if (document.getElementById("txtemail").value != "") {
                if (!emailValidator(document.getElementById("txtemail"))) {
                    alert("Please enter a valid Email id ");
                    document.getElementById("txtemail").focus();
                    return false;
                }

            }
        }
        if (document.getElementById("txttel")) {

            var TelNo = document.getElementById("txttel").value; /* Mobile */
            if (TelNo == "") {
                alert("Please enter mobile number");
                return false;
            }
            else {
                if (!IsNumeric(document.getElementById("txttel").value)) {
                    alert("Please enter valid mobile number");
                    document.getElementById("txttel").value = "";
                    document.getElementById("txttel").focus();
                    return false;
                }
                else if (!ismobileno(document.getElementById("txttel"), 10)) {
                    return false;
                }
            }

        }
        if ((Name != "" && Email != "")) {
            var TrackVal = window.location.search;
            if (document.getElementById("prodvalue")) {
                var telphone = '';
                var prodfilenotour = document.getElementById("prodvalue").value;
                var urls = "&pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&telphone=" + telphone;
                if (TrackVal != "") {
                    urls = TrackVal + urls;
                }
                else {
                    urls = "?pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&telphone=" + telphone;
                }
                http_section.open("get", "/Ajax/Product_Insert.aspx" + urls, true);
                //http_section.open("get", "/Ajax/Product_Insert.aspx?pagenm=" + pagenm + "&prodstype=" + prodstype + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&telphone=" + telphone, true);

            }
            if (document.getElementById("drp_prod")) {
                var prodfileour = document.getElementById("drp_prod").value;
                var urls = "&pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour;
                if (TrackVal != "") {
                    urls = TrackVal + urls;
                }
                else {
                    urls = "?pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour;
                }
                http_section.open("get", "/Ajax/Product_Insert.aspx" + urls, true);
                // http_section.open("get", "/Ajax/Product_Insert.aspx?pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour, true);
            }
            var sockracticvalue = "Dial a Policy" + '$' + Name + '$' + TelNo;
            document.getElementById('sockraticvalue').value = sockracticvalue;
            var sockracticdata = document.getElementById('sockraticvalue').value;
            var sockracticsplit = sockracticdata.split('$');
            for (var i = 0; i < sockracticsplit.length; i++) {
                sType = sockracticsplit[0];
                sName = sockracticsplit[1];
                sTelno = sockracticsplit[2];

            }

            /* Getting the sokrati Data's Ends*/
            http_section.onreadystatechange = returnsection;
            http_section.send(null);

        }

    }

}

function lengthRestrictioncode(elem, min, max) {
    var uInput = elem.value;
    if (uInput.length >= min && uInput.length <= max) {
        return true;
    } else {
        alert("Please enter a valid STD code");
        elem.focus();
        return false;
    }
}
function loadsubproduct(page) {
    var Name = document.getElementById("txtname").value;

    if (document.getElementById("txtemail")) {
        var Email = document.getElementById("txtemail").value;
    }
    if (Name == "" || Email == "") {
        alert("Please fill mandatory fields");
        return false;
    }
    else {
        if (Name != "") {
            if (!isAlphabet(document.getElementById("txtname"), 'Please enter alphabets only')) {
                document.getElementById("txtname").value = "";
                document.getElementById("txtname").focus();
                return false;
            }
        }
        if (document.getElementById("txtemail")) {
            if (document.getElementById("txtemail").value != "") {
                if (!emailValidator(document.getElementById("txtemail"))) {
                    alert("Please enter a valid Email id ");
                    document.getElementById("txtemail").focus();
                    return false;
                }

            }
        }
        if (document.getElementById("txttel")) {

            var TelNo = document.getElementById("txttel").value; /* Mobile */
            if (TelNo == "") {
                alert("Please enter mobile number");
                return false;
            }
            else {
                if (!IsNumeric(document.getElementById("txttel").value)) {
                    alert("Please enter valid mobile number");
                    document.getElementById("txttel").value = "";
                    document.getElementById("txttel").focus();
                    return false;
                }
                else if (!ismobileno(document.getElementById("txttel"), 10)) {
                    return false;
                }
            }

        }
        if ((Name != "") && (TelNo != "")) {
            var TrackVal = window.location.search;
            if (document.getElementById("prodvalue")) {
                var telphone = Code + Phone;
                var prodfilenotour = document.getElementById("prodvalue").value;
                var urls = "&pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&telphone=" + telphone;
                if (TrackVal != "") {
                    urls = TrackVal + urls;
                }
                else {
                    urls = "?pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&telphone=" + telphone;
                }
                http_section.open("get", "/Ajax/Product_Insert.aspx" + urls, true);
                //http_section.open("get", "/Ajax/Product_Insert.aspx?pagenm=" + page + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfilenotour + "&email=" + Email + "&code=" + Code + "&phone=" + Phone + "&telphone=" + telphone, true);
            }
            if (document.getElementById("drp_prod")) {
                var prodfileour = document.getElementById("drp_prod").value;
                var urls = "&pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour;
                if (TrackVal != "") {
                    urls = TrackVal + urls;
                }
                else {
                    urls = "?pagenm=" + pagenm + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour;
                }
                http_section.open("get", "/Ajax/Product_Insert.aspx" + urls, true);
                //http_section.open("get", "/Ajax/Product_Insert.aspx?pagenm=" + page + "&name=" + Name + "&telNo=" + TelNo + "&contact=Dial a Policy&product=" + prodfileour, true);
            }
            var sockracticvalue = "Dial a Policy" + '$' + Name + '$' + TelNo;
            document.getElementById('sockraticvalue').value = sockracticvalue;
            var sockracticdata = document.getElementById('sockraticvalue').value;
            var sockracticsplit = sockracticdata.split('$');
            for (var i = 0; i < sockracticsplit.length; i++) {
                sType = sockracticsplit[0];
                sName = sockracticsplit[1];
                sTelno = sockracticsplit[2];

            }

            /* Getting the sokrati Data's Ends*/
            http_section.onreadystatechange = returnsection;
            http_section.send(null);
        }
    }
}
function returnsection() {
    if (http_section.readyState == 4) {

        var res_section = http_section.responseText.split("$");
        document.getElementById("txtname").value = "";
        document.getElementById("txttel").value = "";

        if (document.getElementById("txtemail")) {
            document.getElementById("txtemail").value = "";
        }
        if (document.getElementById("txtphone")) {
            document.getElementById("txtphone").value = "";
        }
        if (document.getElementById("txtcode")) {
            document.getElementById("txtcode").value = "";
        }

        if (document.getElementById("drp_prod")) {
            document.getElementById("drp_prod").value = "#";
        }
        /* Added for sokrati code to implement the Dynamic values starts */
        var paramList = {};
        paramList['transaction_type'] = sType;
        paramList['inquirer_name'] = sName;
        paramList['inquirer_contact'] = sTelno;
        try { sokrati.trackParams('link', 'RSAIAHC009787', paramList); }
        catch (err) { }
        /* Added for sokrati code implement the Dynamic values ends */
        //alert('Thanks for your interest.We will get in touch with you shortly.');

        window.location = 'http://www.royalsundaram.in/thank-you.aspx';
    }
}
function sokratiloading() {
    document.write("<script type='text/javascript'>");
    var paramList = {};
    paramList['transaction_type'] = sType;
    paramList['inquirer_name'] = sName;
    paramList['inquirer_contact'] = sTelno;
    try { sokrati.trackParams('link', 'RSAIAHC009787', paramList); }
    catch (err) { }
    document.write("</script>");
}

function searchclick() {
    document.getElementById("srchvalue").value = '';
}
function searchmouseout() {
    document.getElementById("srchvalue").value = '        Search this Site';
}
function searchonkeypress(a) {
    var kc;
    if (document.all) {
        kc = event.keyCode;
    }
    else if (document.getElementById) {
        kc = a;
    }
    else if (document.layers) {
        kc = a;
    }
    if (kc == 13) {
        document.getElementById('srchvalue').value = document.getElementById('srchvalue').value;
        return false;
    }
}
function interest_product() {

    var temp = true;
    if (document.getElementById("txtname").value == "") {
        alert("Please enter your name");
        document.getElementById("txtname").focus();
        temp = false;
        return false;
    }
    if (document.getElementById("txtname").value != "") {
        if (!isAlphabet(document.getElementById("txtname"), 'Please enter alphabets only')) {
            document.getElementById("txtname").value = "";
            document.getElementById("txtname").focus();
            return false;
        }
    }
    if (document.getElementById("txtemail").value == "") {
        alert("Please enter your email id");
        document.getElementById("txtemail").focus();
        temp = false;
        return false;
    }
    if (document.getElementById("txtemail").value != "") {
        if (!emailValidator(document.getElementById("txtemail"))) {
            alert("Please enter a valid Email id ");
            document.getElementById("txtemail").focus();
            temp = false;
            return false;
        }
    }
    //    if ((document.getElementById("txtno").value == "") && (document.getElementById("txtMoblie").value == "")) {
    //        alert("Enter Either Phone/Mobile Number ");
    //        document.getElementById("txtno").focus();
    //        temp = false;
    //        return false;
    //    }
    if ((document.getElementById("txtMoblie").value == "")) {
        alert("Please enter your mobile number ");
        document.getElementById("txtMoblie").focus();
        temp = false;
        return false;
    }
    //    if (document.getElementById("txtno").value != "") {
    //        if (!IsNumeric(document.getElementById("txtno").value)) {
    //            alert("Please enter numbers only");
    //            document.getElementById("txtno").value = "";
    //            document.getElementById("txtno").focus();
    //            temp = false;
    //            return false;
    //        }
    //        else {
    //            if (document.getElementById("txtno").value.substring(0, 1) != "0") {
    //                alert("STD Code should starts with 0");
    //                document.getElementById("txtno").value = "";
    //                document.getElementById("txtno").focus();
    //                temp = false;
    //                return false;
    //            }
    //            else {
    //                if (!lengthRestriction(document.getElementById("txtno"), 6, 16)) {
    //                    return false;
    //                }
    //            }
    //        }
    //    }
    if (document.getElementById("txtMoblie").value != "") {
        if (!IsNumeric(document.getElementById("txtMoblie").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtMoblie").value = "";
            document.getElementById("txtMoblie").focus();
            temp = false;
            return false;
        }
        if (!ismobileno(document.getElementById("txtMoblie"), 10)) {
            return false;
        }
    }
    //    if (document.getElementById("txtcity").value == "") {
    //        alert("Please enter your city");
    //        document.getElementById("txtcity").focus();
    //        temp = false;
    //        return false;
    //    }
    //    if (document.getElementById("txtcity").value != "") {
    //        if (!isAlphabet(document.getElementById("txtcity"), 'Please enter alphabets only')) {
    //            document.getElementById("txtcity").value = "";
    //            document.getElementById("txtcity").focus();
    //            return false;
    //        }
    //    }
    //    if (document.getElementById("ddlhour").value == 'Select') {
    //        alert("Please tell us preferred time to contact");
    //        document.getElementById("ddlhour").focus();
    //        temp = false;
    //        return false;
    //    }


}
function callback_form() {
    var temp = true;
    if (document.getElementById("txtname").value == "") {
        alert("Please enter your name");
        document.getElementById("txtname").focus();
        temp = false;
        return false;
    }
    if (document.getElementById("txtname").value != "") {
        if (!isAlphabet(document.getElementById("txtname"), 'Please enter alphabets only')) {
            document.getElementById("txtname").value = "";
            document.getElementById("txtname").focus();
            return false;
        }
    }
    if (document.getElementById("txtMoblie").value != "") {
        if (!IsNumeric(document.getElementById("txtMoblie").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtMoblie").value = "";
            document.getElementById("txtMoblie").focus();
            temp = false;
            return false;
        }
        if (!ismobileno(document.getElementById("txtMoblie"), 10)) {
            return false;
        }
    }
    if ((document.getElementById("txtno").value == "") && (document.getElementById("txtMoblie").value == "")) {
        alert("Enter Either Phone/Mobile Number ");
        document.getElementById("txtMoblie").focus();
        temp = false;
        return false;
    }
    if (document.getElementById("txtno").value != "") {
        if (!IsNumeric(document.getElementById("txtno").value)) {
            alert("Please enter numbers only");
            document.getElementById("txtno").value = "";
            document.getElementById("txtno").focus();
            temp = false;
            return false;
        }
        else {
            if (document.getElementById("txtno").value.substring(0, 1) != "0") {
                alert("STD Code should starts with 0");
                document.getElementById("txtno").value = "";
                document.getElementById("txtno").focus();
                temp = false;
                return false;
            }
            else {
                if (!lengthRestriction(document.getElementById("txtno"), 6, 16)) {
                    return false;
                }
            }
        }
    }
    if (document.getElementById("txtemail").value == "") {
        alert("Please enter your email id");
        document.getElementById("txtemail").focus();
        temp = false;
        return false;
    }
    if (document.getElementById("txtemail").value != "") {
        if (!emailValidator(document.getElementById("txtemail"))) {
            alert("Please enter a valid Email id ");
            document.getElementById("txtemail").focus();
            temp = false;
            return false;
        }
    }
}



/*Newly added for calculate product premium*/
function calcproduct() {
    var prodtype = document.getElementById("prodtype").value;
    if (prodtype == "health") {
        if (document.getElementById("family good").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Family Good Health', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/FamilyGoodHealthQuote.do?id=familyGoodHealth";
        }
        else if (document.getElementById("hospital cash").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Hospital Cash Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/HospitalCashQuote.do?id=hospitalCash";
        }
    }
    else if (prodtype == "car") {

        if (document.getElementById("renewcar").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Car Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/Car-Insurance-Renewal-GetQuote.do?method=previousInsurer&id=CarInsurance";
        }
        else if (document.getElementById("newcar").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Car Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/Car-Insurance-NewCar-GetQuote.do?method=quote&id=CarInsurance";
        }
    }
    else if (prodtype == "travel") {
        if (document.getElementById("travel").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Travel Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/TravelShieldQuote.do?id=travelShield";
        }
    }
    else if (prodtype == "home") {
        if (document.getElementById("homebuilding").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Home Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/HomeShieldQuote.do?id=homeShield";
        }
        else if (document.getElementById("homecontent").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Home Content Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/HomeContentQuote.do?id=homeContent";
        }
    }
    else if (prodtype == "family good") {
        if (document.getElementById("familygood").checked == true) {
            javascript:_gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Family Good Health', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/FamilyGoodHealthQuote.do?id=familyGoodHealth";
        }
        if (document.getElementById("hospital").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Hospital Cash Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/HospitalCashQuote.do?id=hospitalCash";
        }
    }
    else if (prodtype == "accident") {
        if (document.getElementById("accident").checked == true) {
            javascript: _gaq.push(['pageTracker._trackEvent', 'Specific Product Page', 'Accident Insurance Online', 'Calculate Premium Now']);
            window.location = "https://www.royalsundaram.in/DTC/AccidentShieldQuote.do?id=accidentShield";
        }
    }

}
function loadpeoplefillingtrack(prodtype, subprodtype, pagename) {
    if (prodtype.toLowerCase() == "health") {
        javascript: _gaq.push(['_trackEvent', 'Health_Lead', 'Health_Lead_Form', 'Health_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "health" && subprodtype.toLowerCase() == "individual health") {
        javascript: _gaq.push(['_trackEvent', 'Health_Shield_Lead', 'Health_Shield_Lead_Form', 'Health_Shield_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "health" && subprodtype.toLowerCase() == "family health") {
        javascript: _gaq.push(['_trackEvent', 'Family_Health_Lead', 'Family_Health_Lead_Form', 'Family_Health_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "car") {
        javascript: _gaq.push(['_trackEvent', 'Car_Lead', 'Car_Lead_Form', 'Car_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "travel") {
        javascript: _gaq.push(['_trackEvent', 'Travel_Lead', 'Travel_Lead_Form', 'Travel_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "hospital cash") {
        javascript: _gaq.push(['_trackEvent', 'Hospital_Lead', 'Hospital_Lead_Form', 'Hospital_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "accident") {
        javascript: _gaq.push(['_trackEvent', 'Accident_Lead', 'Accident_Lead_Form', 'Accident_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "business") {
        javascript: _gaq.push(['_trackEvent', 'Business_Lead', 'Business_Lead_Form', 'Business_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "home" && subprodtype.toLowerCase() == "home shield") {
        javascript: _gaq.push(['_trackEvent', 'Home_Shield_Lead', 'Home_Shield_Lead_Form', 'Home_Shield_Lead_Submit']);
    }
    else if (prodtype.toLowerCase() == "home" && subprodtype.toLowerCase() == "home content") {
        javascript: _gaq.push(['_trackEvent', 'Home_Content_Lead', 'Home_Content_Lead_Form', 'Home_Content_Lead_Submit']);
    }
    loadproduct(pagename, 'product');
}

