<script>
var pagecount = 1;
var renewaltitle;
var statusid;
var totalpolicycount = 0;
var policycount = 15;
var policyListCopy = [];
var policyListsearch = [];
var expirydatesort = "Y";
var policyholdersort = "";
var duedatesort = "";
</script>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Renewal Info</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <script type="text/javascript" src="js/lib/aes.js"></script>
  <script type="text/javascript" src="js/lib/pbkdf2.js"></script>
  <script type="text/javascript" charset="UTF-8" src="Commondata.js"></script>
  <script type="text/javascript" charset="UTF-8" src="VehicleDetCommonData.js"></script>
  <script type="text/javascript" charset="UTF-8" src="Apiservice.js"></script>
  <link rel="stylesheet" type="text/css" href="fonts/stylesheet.css">
  <link rel="stylesheet" type="text/css" href="css/normalize.css">
  <link rel="stylesheet" type="text/css" href="css/framework.css">
  <link rel="stylesheet" type="text/css" href="css/axa.min.css">
  <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
  <script type="text/javascript" src="js/index.js"></script>
  <script type="text/javascript" charset="UTF-8" src="js/axa-popup.js"></script>
  <script src="js/webfont.js"></script>
  <script>
  WebFont.load({
    google: {
      families: ["Montserrat:400,700"]
    }
  });

  </script>
  <script>
  //window onload
  window.onload = function () {
    var sheight=screen.height;
    if(sheight>=800)
    {
      policycount=30;
    }
     /* Motor and Non Motor Diff */
     motorhealthdiff();
    /* Motor and Non Motor Diff */
    localStorage.removeItem("requeryInd");
    localStorage.removeItem("requerypaymentDO");
    localstorageclearMotor("Y");
    statusid = getItem("policytype");
    var userAgentResponse =  getItem("userlist");
    var userAgentResponseList=JSON.parse(userAgentResponse);
    if(isEmpty(statusid)){
      statusid = 1;
    }
    else if(statusid > 10)
    {
      statusid = statusid % 10;
    }
    if(userAgentResponseList.length<=1){
      document.getElementById('switchuserclass').style.display = 'none';
    }
    if (statusid == 4) {
      renewaltitle = "Expired Policy";
      headertag(false);
    }
    else if (statusid == 1) {
      renewaltitle = "Expiring Soon";
      headertag(false);
    }
    else if (statusid == 2) {
      renewaltitle = "Payment Received";
      headertag(false);
    }
    else if (statusid == 3) {
      renewaltitle = "Renewed Policy";
      headertag(false);
    }
    else if (statusid == 5) {
      renewaltitle = "Offline Case";
      document.getElementById('sortduedayseperator').style.display='block';
      document.getElementById('sortduedayseperator1').style.display='block';

      document.getElementById('sortdueday').style.display='block';
      document.getElementById('sortdueday1').style.display='block';
      headertag(true);
    }
    else {
      setItem("policytype", 1);
      renewaltitle = "Expired Policy";
      headertag(false);
    }
     document.getElementById('txttitle').innerHTML = renewaltitle + " (0)";
        var request = {policystatusid:statusid,	 agentid:getItem("agentcode"),pageno:pagecount,pagesize:policycount,expirydatesort:expirydatesort,policyholdersort:policyholdersort,duedatesort:duedatesort};
        //policies service call when onload
        Apiservicecall(function(result)
        {
          if(result.status==1)
          {
            var response=result.response;
            setItem("scrolllastdata",result.response.status);
            policylist = response.data;
            totalpolicycount = response.policycount;
            if(totalpolicycount==null || totalpolicycount==undefined){
              totalpolicycount = 0;
            }
            //setting policy count in header.
            document.getElementById('txttitle').innerHTML = renewaltitle + " (" + totalpolicycount + ")";
            if (policylist != null) {
              for(var i=0;i<policylist.length;i++){
                policyListCopy.push(policylist[i]);
              }
                loadTable(policyListCopy);
            }
            else{
              $('#list').find('tbody').empty();
              $('#list').append("<tbody><tr><td colspan='3' align='center'>No Records Found</td></tr></tbody>");
            }
          }
          else {
            $('#list').find('tbody').empty();
            $('#list').append("<tbody><tr><td colspan='3' align='center'>No Records Found</td></tr></tbody>");
          }
        },renewalinfo,request);
    var scrollTableDiv = document.getElementById("scrollTableDiv");
    resizeElementHeight(scrollTableDiv);
    clearSearch();
  }
// scrolling table policies service call
function renewalinfotableload(){
    if(checkOnline()){
  var request = {policystatusid:statusid,	 agentid:getItem("agentcode"),pageno:pagecount,pagesize:policycount,expirydatesort:expirydatesort,policyholdersort:policyholdersort,duedatesort:duedatesort};
  scrolllastdata = getItem("scrolllastdata");
  if(scrolllastdata==0){
    $("#loading").hide();
  }
  else if(scrolllastdata==1){
    Apiservicecallpolicies(function(result)
    {
      if(result.status==1)
      {
        var response=result.response;
        if(response.status==1)
        {
          totalpolicycount = response.policycount;
          if(totalpolicycount==null || totalpolicycount==undefined){
            totalpolicycount = 0;
          }
          //setting policy count in header.
          document.getElementById('txttitle').innerHTML = renewaltitle + " (" + totalpolicycount + ")";
        }
        setItem("scrolllastdata",result.response.status);
        policylist = response.data;
        if (policylist != null) {
          $("#loading").hide();
          for(var i=0;i<policylist.length;i++){
            policyListCopy.push(policylist[i]);
          }
          loadTable(policyListCopy);
          $("#loading").hide();
        }
        else{
          $("#loading").hide();
        }
      }
      else {
        $("#loading").hide();
      }
    },renewalinfo,request);
  }
}
}
  // sorting from A to Z
  function sortaz() {
    sortreset();
    duedatesort = "";
    expirydatesort = "";
    policyholdersort = "Y";
    renewalinfotableload();
  }
  //sorting from Z to A
  function sortza() {
    sortreset();
    duedatesort = "";
    expirydatesort = "";
    policyholdersort = "N";
    renewalinfotableload();
  }
  // sorting from nearest expiry date to fartest expiry date
  function sortnf() {
    sortreset();
    policyholdersort = "";
    duedatesort = "";
    expirydatesort = "N";
    renewalinfotableload();
  }
  // sorting from fartest expiry date to nearest expiry date
  function sortfn() {
    sortreset();
    policyholdersort = "";
    duedatesort = "";
    expirydatesort = "Y";
    renewalinfotableload();
  }
  // sorting from duedate accessending
  function sortduedaysaccending(){
    sortreset();
    policyholdersort = "";
    expirydatesort = "";
    duedatesort = "Y";
    renewalinfotableload();
  }
  // sorting from duedate descending
  function sortduedaysdecending(){
    sortreset();
    policyholdersort = "";
    expirydatesort = "";
    duedatesort = "N";
    renewalinfotableload();
  }
  //reseting when switching sorting
  function sortreset(){
    var input = document.getElementById("myInput").value = "";
    scrollToTop();
    policyListCopy = [];
    policyListsearch = [];
    setItem("scrolllastdata",1);
    pagecount = 1;
  }

  function scrollToTop(){
    var scrolldiv = document.getElementById('scrollTableDiv');
    scrolldiv.scrollTop = 0;
    scrolldiv.innerHeight = 0;
    scrolldiv.scrollHeight = 0;
  }

  //loading table
  function loadTable(policylist) {
    $('#list').find('tbody').empty();
    $('#list').append("<tbody>");
    var statusidfortable = getItem("policytype");
    if (policylist.length > 0) {
      for (var i = 0; i < policylist.length; i++) {
        if(policylist[i].policyno != null)
        {
          if(statusidfortable == 5){
            if(policylist[i].overdueind=="Y"){
              $('#list').append("<tr><td colspan='3'><table class='e-det-t effect1 tbl-layout' width=100%><tr class='bottom-line-sp'><td colspan='2' class='e-det-t-axa tbl_td_w'>"+ policylist[i].policyholdername+ "</td><td colspan='1' class='e-det-t-axa e-det-t-lastOfflineCase'>Overdue, please pay</td></tr><tr><td class='e-det-t-axa e-det-t-exleft'>"+ policylist[i].policyexpirydate+ "</td><td class='e-det-t-axa e-det-t-excenter' >"+ policylist[i].contracttype.toUpperCase()+ "/"+ policylist[i].policyno.toUpperCase()+ "</td><td class='e-det-t-axa e-det-t-exright'>"+ currencyformat(policylist[i].grosspremium,"")+ "</td></tr></table></td></tr>");
            }else {
              $('#list').append("<tr><td colspan='3'><table class='e-det-t effect1 tbl-layout' width=100%> <tr class='bottom-line-sp'><td colspan='2' class='e-det-t-axa tbl_td_w'>"+ policylist[i].policyholdername+ "</td><td colspan='1' class='e-det-t-axa e-det-t-lastOfflineCase'>Due by &nbsp;"+ policylist[i].overdueDate+ "</td></tr><tr><td class='e-det-t-axa e-det-t-exleft'>"+ policylist[i].policyexpirydate+ "</td><td class='e-det-t-axa e-det-t-excenter' >"+ policylist[i].contracttype.toUpperCase()+ "/"+ policylist[i].policyno.toUpperCase()+ "</td><td class='e-det-t-axa e-det-t-exright'>"+ currencyformat(policylist[i].grosspremium,"")+ "</td></tr></table></td></tr>");
            }
          }
          else if(statusidfortable == 2){
              $('#list').append("<tr><td colspan='3'><table class='e-det-t effect1 tbl-layout' width=100%><tr class='bottom-line-sp'><td colspan='2' class='e-det-t-axa tbl_td_w'>"+ policylist[i].policyholdername+ "</td><td colspan='1' class='e-det-t-axa e-det-t-last'>"+ policylist[i].paymentmode +"</td></tr><tr><td class='e-det-t-axa e-det-t-exleft'>"+ policylist[i].policyexpirydate+ "</td><td class='e-det-t-axa e-det-t-excenter' >"+ policylist[i].contracttype.toUpperCase()+ "/"+ policylist[i].policyno.toUpperCase()+ "</td><td class='e-det-t-axa e-det-t-exright'>"+ currencyformat(policylist[i].grosspremium,"")+ "</td></tr></table></td></tr>");
          }
          else{
            $('#list').append("<tr><td colspan='3'><table class='e-det-t effect1 tbl-layout' width=100%><tr class='bottom-line-sp'><td class='e-det-t-axa tbl_td_w' colspan='3'>"+ policylist[i].policyholdername+ "</td></tr><tr><td class='r-info-t-axa r-info-t-exleft'>"+ policylist[i].policyexpirydate+ "</td><td class='r-info-t-axa r-info-t-excenter'>"+ policylist[i].contracttype.toUpperCase()+ "/"+ policylist[i].policyno.toUpperCase()+ "</td><td class='r-info-t-axa r-info-t-exright'>"+ currencyformat(policylist[i].grosspremium,"")+ "</td></tr></table></td></tr>");
          }
        }
        else {
          $('#list').append("<tr><td colspan='3'><table class='e-det-t effect1 tbl-layout' width=100%><tr class='bottom-line-sp'><td class='e-det-t-axa tbl_td_w' colspan='3'>"+ policylist[i].policyholdername+ "</td></tr><tr><td class='r-info-t-axa r-info-t-exleft' style='text-align: right;'>"+ policylist[i].policyexpirydate+ "</td><td class='r-info-t-axa r-info-t-excenter'>"+ policylist[i].contracttype.toUpperCase()+ "/"+ policylist[i].policyno+ "</td><td class='r-info-t-axa r-info-t-exright'>"+ currencyformat(policylist[i].grosspremium,"")+ "</td></tr></table></td></tr>");
        }
      }
    }
    else {
      $('#list').append("<tr><td colspan='3' style='text-align: center;'>No Records Found</td></tr>");
    }
    $('#list').append("</tbody>");
    var table = document.getElementById("list");
    if (table != null) {
      for (var i = 0; i < table.rows.length; i++) {
        for (var j = 0; j < table.rows[i].cells.length; j++)
        table.rows[i].cells[j].onclick = function () {
          if(checkOnline()){
          var policynofromlist = policylist[this.parentNode.rowIndex].policyno;
          setItem("renwalpolicyid",policylist[this.parentNode.rowIndex].renwalpolicyid);
      setItem("policynum", policynofromlist);
          setItem("lapsedstatus", policylist[this.parentNode.rowIndex].lapsedlastdateind);
      setItem("policytype", statusid);
      window.location.href = 'Renewal-detail.html';
      }
        };
      }
  }
  }

  function resizeElementHeight(element) {
   var height = 0;
   var body = window.document.body;
   if (window.innerHeight) {
       height = window.innerHeight;
   } else if (body.parentElement.clientHeight) {
       height = body.parentElement.clientHeight;
   } else if (body && body.clientHeight) {
       height = body.clientHeight;
   }
   if(height>800)
   {
     height=height-100;
   }
   else {
     height=height-80;
   }
   console.log("height===="+height);
   element.style.height = ((height - element.offsetTop) + "px");
  }
  //search list table
  function searchbycharacter() {
    var clearsearch = document.getElementById('clear-search');
    var valsearch = document.getElementById("myInput").value;
    clearsearch.style.visibility = (valsearch.length) ? "visible" : "hidden";
    policyListCopy = [];
    policyListsearch = [];
    pagecount = 1;
    searchredirect();
  }
  //search databinding function for search bar
  function searchredirect()
  {
    policyListCopy = [];
    var input = document.getElementById("myInput").value;
    scrollToTop();
    setItem("scrolllastdata",1);
    if(input.length!=0)
    {
      var request = {policystatusid:statusid, agentid:getItem("agentcode"),searchdata:input,pageno:pagecount,pagesize:policycount,expirydatesort:expirydatesort,policyholdersort:policyholdersort,duedatesort:duedatesort};
      search(request);
    }
    else
    {
      searchreset();
    }
  }
  // reseting search list when search data is 0
  function searchreset(){
      setItem("scrolllastdata",1);
      policyListCopy = [];
      policyListsearch = [];
      var request = {policystatusid:statusid, agentid:getItem("agentcode"),searchdata:"",pageno:pagecount,pagesize:policycount,expirydatesort:expirydatesort,policyholdersort:policyholdersort,duedatesort:duedatesort};
      search(request);
  }
  //search function for searchbycharacter
function search(request){
    if(checkOnline()){
  Apiservicecallpolicies(function(result)
  {
    if(result.status==1)
    {
      var response=result.response;
      if(response.status==1)
      {
        totalpolicycount = response.policycount;
        if(totalpolicycount==null || totalpolicycount==undefined){
          totalpolicycount = 0;
        }
        //setting policy count in header.
        document.getElementById('txttitle').innerHTML = renewaltitle + " (" + totalpolicycount + ")";
      }
      setItem("scrolllastdata",result.response.status);
      policylist = response.data;
      policyListsearch=[];
      if (policylist != null) {
        if( document.getElementById("myInput").value !=null || document.getElementById("myInput").value !=undefined || document.getElementById("myInput").value !=""){
        for(var i=0;i<policylist.length;i++){
          policyListsearch.push(policylist[i]);
          //appending policyListCopy to overcome pagination after search
          policyListCopy.push(policylist[i]);
          }
        }
        loadTable(policyListsearch);
          $("#loading").hide();
      }
      else if(response.status == 0){
        if(pagecount==1){
          $('#list').find('tbody').empty();
          scrollToTop();
          policyListsearch = [];
          $('#list').append("<tr><td colspan='3' align='center'>No Records Found</td></tr>");
          $("#loading").hide();
        }
        else{
          $("#loading").hide();
          // if page count increases table should not clear
        }
      }
      else{
          $("#loading").hide();
      }
    }
    else {
    }
  },renewalinfosearch,request);
}
}
  //search when scrolling
  function scrollsearch()
    {
    if(checkOnline()){
      policyListCopy = [];
      var input = document.getElementById("myInput").value;
      setItem("scrolllastdata",1);
      if(input.length!=0)
      {
        var request = {policystatusid:statusid, agentid:getItem("agentcode"),searchdata:input,pageno:pagecount,pagesize:policycount,expirydatesort:expirydatesort,policyholdersort:policyholdersort,duedatesort:duedatesort};
        scrollsearchservice(request);
      }
      else
      {
        searchreset();
      }
    }
    }
    // search scrolling service
    function scrollsearchservice(request){
      scrolllastdata = getItem("scrolllastdata");
      if(scrolllastdata==0){
        $("#loading").hide();
      }
      else
      {
      Apiservicecallpolicies(function(result)
      {
        if(result.status==1)
        {
          var response=result.response;
            setItem("scrolllastdata",result.response.status);
          policylist = response.data;
          if (policylist != null) {
            for(var i=0;i<policylist.length;i++){
              policyListsearch.push(policylist[i]);
            }
            loadTable(policyListsearch);
              $("#loading").hide();
          }
          else if(response.status == 0){
            if(pagecount==1){
              $('#list').find('tbody').empty();
              scrollToTop();
              policyListsearch = [];
              $('#list').append("<tr><td colspan='3' align='center'>No Records Found</td></tr>");
              $("#loading").hide();
            }
            else{
              $("#loading").hide();
              // if page count increases table should not clear
            }
          }
          else{
              $("#loading").hide();
          }
        }
        else {
        }
      },renewalinfosearch,request);
    }
    }

  //common popup
  function showAlert(message) {
    $('#showpop').empty();
    $('#showpop').append("<h5>Message</h5><p id='para_messageid'>" + message + "</p><button class='popup-btn' id='comm-dismiss' onclick=hide('showpop')>OK</button>");
    show('showpop');
  }
  //logout popup
  function exitAlert() {
    if(checkOnline()){
    $('#showpop').empty();
    $('#showpop').append("<h5>Message</h5><p>Are you sure want to logout?</p><button class='popup-btn' onclick='logout()'>OK</button><button class='popup-btn' onclick=hide('showpop')>CANCEL</button>");
    show('showpop');
  }
  }
  function headertag(isrenual)
  {
    if(isrenual)
    {
      $('#reheader').append('<tbody><tr><td colspan="3"><table width=100% id="resubheader" class="e-det-th"><tr><td id="releft" class="e-det-th-axa e-det-th-exleft">Expiry Date</td><td id="recenter" class="e-det-th-axa e-det-th-excenter">Policy No.</td><td class="e-det-th-axa e-det-th-exright" id="reright">Gross Premium (RM)</td></tr></table></td></tr></tbody>');
      $('#reheader').addClass('e-det-th');
    }
    else {
      $('#reheader').append('<tbody><tr><td colspan="3"><table width=100% id="resubheader" class="r-info-th" ><tr><td id="releft" class="r-info-th-axa r-info-th-exleft">Expiry Date</td><td id="recenter" class="r-info-th-axa r-info-th-excenter">Policy No.</td><td id="reright" class="r-info-th-axa r-info-th-exright">Gross Premium (RM)</td></tr></table></td></tr></tbody>');
      $('#reheader').addClass('r-info-th');
    }
  }
  //clear search input
  function clearSearch()
  {
    var searchinput = document.getElementById('myInput');
    var clearsearch = document.getElementById('clear-search');
    clearsearch.onclick = function() {
      searchinput.value="";
      clearsearch.style.visibility ="hidden";
      searchbycharacter();
    };
  }
  //backbutton function
  document.addEventListener("backbutton", onBackKeyDown, false);
  function onBackKeyDown() {
     passive: true
       if(checkOnline()){
    window.location.href="welcome.html"
  }
  }
  </script>
  <script type="text/javascript" src="js/modernizr.js"></script>
  <link rel="shortcut icon" type="image/x-icon" href="images/logoStandford32.ico">
  <link rel="apple-touch-icon" href="images/logoStandford32.ico">
  <link href="css/ionicons.min.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
  .toggle {
    color: #fff;
    float: left;
    height: 30px;
    line-height: 40px;
    text-align: center;
    width: 30px;
    position: relative;
    font-size: 21px;
    top: -23px;
    right: 0px;
  }
  .right {
    float: right
  }
  </style>
</head>
<body>
  <section class="axa-section mobile-wrapper">
    <div class="page-content" id="main-stack">
      <div class="axa-nav navbar" data-collapse="all" data-animation="over-left" data-duration="400" data-contain="1" data-easing="ease-out-quint" data-no-scroll="1">
        <div class="axa-container">
          <nav class="axa-nav-menu nav-menu" role="navigation">
            <a class="nav-menu-header" id="navi_welcomepage" onclick = "redirectionpage('dashboard.html');" >
              <div class="logo"><img alt="navlogo_img_icon" src="images/nav-logo.svg"></div>
            </a>
            <div id="health_div_header">
              <a class="axa-clearfix axa-inline-block nav-menu-link">
                <div class="icon-list-menu">
                  <div class="icon ion-ios-pulse"></div>
                </div>
                <div class="nav-menu-titles">Health</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link1" id="navi_renewalinfo" onclick = "redirectionpage('welcome.html');">
                <div class="sub-icon-list-menu">
                  <div class="icon ion-clipboard"></div>
                </div>
                <div class="nav-menu-titles">Renewal Info</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link1" id="navi_enquiry" onclick = "redirectionpage('Enquiry.html');">
                <div class="sub-icon-list-menu">
                  <div class="icon ion-ios-help-outline"></div>
                </div>
                <div class="nav-menu-titles">Enquiry</div>
              </a>
            </div>
            <div id="motor_div_header">
              <a class="axa-clearfix axa-inline-block nav-menu-link">
                <div class="icon-list-menu">
                  <div class="icon ion-android-car"></div>
                </div>
                <div class="nav-menu-titles">Motor</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link1" id="navi_vehicledet" onclick = "redirectionpage('vehicle-details.html');">
                <div class="sub-icon-list-menu">
                  <div class="icon ion-ios-calculator-outline"></div>
                </div>
                <div class="nav-menu-titles">New Quote</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link1" id="navi_retrivequote" onclick = "redirectionpage('retrieve-quote.html');">
                <div class="sub-icon-list-menu">
                  <div class="icon ion-document"></div>
                </div>
                <div class="nav-menu-titles">Retrieve Quote</div>
              </a>
              </div>
              <a class="axa-clearfix axa-inline-block nav-menu-link" id="navi_agenttools" onclick = "redirectionpage('Contact-us.html');">
                <div class="icon-list-menu">
                  <div class="icon ion-ios-telephone-outline"></div>
                </div>
                <div class="nav-menu-titles">Agent Tools</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link" id="switchuserclass" onclick="switchuser()">
                <div class="icon-list-menu">
                  <div class="icon ion-ios-personadd-outline"></div>
                </div>
                <div class="nav-menu-titles">Switch Agent</div>
              </a>
              <a class="axa-clearfix axa-inline-block nav-menu-link" id="nav_logoutid" onclick="exitAlert()">
                <div class="icon-list-menu">
                  <div class="icon ion-log-out"></div>
                </div>
                <div class="nav-menu-titles">Logout</div>
              </a>
            <div class="separator-bottom"></div>
            <div class="separator-bottom"></div>
            <div class="separator-bottom"></div>
          </nav>
          <div class="wrapper-mask" data-ix="menu-mask"></div>
          <div class="icon-logo-rgt"><img alt="navlogo4_img_icon" src="images/logo-4.svg"></div>
          <div class="navbar-title" id="navbartitle">Renewal Info</div>
          <div class="home-menuicon">
            <a id="icon_home" onclick = "redirectionpage('dashboard.html');"><img alt="homelogo_img_icon" class="hmeicon" src="images/home1.svg" /></a>
            <div class="axa-nav-button navbar-button left" id="menu-button" data-ix="hide-navbar-icons">
              <div class="navbar-button-icon home-icon">
                <div class="bar-home-icon"></div>
                <div class="bar-home-icon"></div>
                <div class="bar-home-icon"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="inner-body">
        <div class="hero-image">
          <div class="hero-image-title">
          </div>
          <div class="hero-image-img">
          </div>
        </div>
        <div class="axa-wrapper">
          <div id="clear-search" class="search-close"></div>
          <input type="text" id="myInput" onkeyup="searchbycharacter();"  style='text-transform:uppercase' placeholder="Search" maxlength="30" class="ion-ios-search-strong input-text-search input-text--search" />
          <div class="axa-content-sec">
            <div class="r-info-count-title">
              <div id="txttitle">Awaiting Renewal (<span id="policy_count">0</span>)</div>
              <div><a href="#" class="toggle right" id="menu-toggle1">
                <div class="navbar-button-icon-right"><img alt="sort_img_icon" class="sort-icon" src="images/sort-icon.svg" /></div>
              </a></div>
            </div>
            <ul class="menu" data-menu data-menu-toggle="#menu-toggle1">
              <li class="highlight">
                <a id = "sortfn" onclick="sortfn(policylist)">Sort by Exp. Date Nearest to Farthest</a>
              </li>
              <li class="menu-separator"></li>
              <li>
                <a id = "sortnf" onclick="sortnf(policylist)">Sort by Exp. Date Farthest to Nearest</a>
              </li>
              <li class="menu-separator"></li>
              <li>
                <a id = "sortaz" onclick="sortaz(policylist)">Sort by A to Z</a>
              </li>
              <li class="menu-separator"></li>
              <li>
                <a id = "sortza" onclick="sortza(policylist)">Sort by Z to A</a>
              </li>
              <li class="menu-separator" id = "sortduedayseperator" style="display: none;"></li>
                <li id = "sortdueday" style="display: none;">
                  <a onclick="sortduedaysaccending(policylist)">Sort by Due Date Nearest to Farthest</a>
                </li>
                <li class="menu-separator" id = "sortduedayseperator1" style="display: none;"></li>
                  <li id = "sortdueday1" style="display: none;">
                    <a onclick="sortduedaysdecending(policylist)">Sort by Due Date Farthest to Nearest</a>
                  </li>
              </ul>
              <h5>Policyholder</h5>
              <div>
              <table id="reheader">
              </table>
            </div>
              <div class="tbl-sec-scroll" id = "scrollTableDiv">
                <table class="r-info-t" id="list">
                </table>
                <div id="loading" class = "tableloading axa-clearfix" style="display: none;">
                  Loading...</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="page-content loading-mask" id="new-stack">
        <div class="loading-icon">
          <div class="navbar-button-icon icon ion-load-d"></div>
        </div>
      </div>
      <div class="shadow-layer"></div>
      <div id="showpop" class="popup"></div>
      <div id="showpop1" class="popup"></div>
    </section>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/framework.js"></script>
    <script type="text/javascript" src="js/menu.min.js"></script>
    <script>
    //scroll table
    $(document).ready(function() {
      $('#scrollTableDiv').on('scroll', function() {
          if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
            if(checkOnline()){
            pagecount+=1;
            var input = document.getElementById("myInput").value;
            if(input!=""){
                $("#loading").show();
                scrollsearch();
            }
            else{
              $("#loading").show();
              renewalinfotableload();
            }
          }
          }
      })
    });
    //sorting option highlighting
    $('[data-menu]').menu();
    $(function(){
      $('.menu li').click(function(){
        $('.highlight').removeClass('highlight');
        $(this).addClass('highlight');
      });
    })
    $(function() {
      $('body').on('keydown', '#myInput', function(e) {
        if (e.which === 32 &&  e.target.selectionStart === 0) {
          return false;
        }
      });
    });

    $(document).ready(function() {
      $(window).scroll(function() {
        var scroll = $(window).scrollTop();
        if (scroll > 10) {
          $(".axa-nav").css("background", "#C21B17");
        } else
          $(".axa-nav").css("background", "transparent");
      })
    });
    </script>
  </body>
  </html>
