Showing source for: https://www.manyzone.com/member/sign-up.aspx?action=profile;u=606461
Duration: 0.657518s
Server: Microsoft-IIS/10.0


<!DOCTYPE html>
<noscript><div style="text-align:center; background:#eeeeee; padding-top:5px; padding-bottom:5px; font-size:1.2em; "><label style="font-weight:bold;">Note</label> - For full functionality of this site it is necessary to enable JavaScript. Enable javascript in your web browser to access all features.
</div>
 
</noscript>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <style type="text/css">
        /*.page{ background-color:#fff ;}*/
        /*.pageUmastro{background-color:#f0f1f9 !important;}*/
        /*.pageUmastro{background-color:#f0f1f9 !important;}*/
        .erroron { color: Red;}
        #divMyStatCounter{display:none;}
    </style>
      
    <title></title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />   
    <meta property="og:type" content="" />
    <meta property="og:title" content="" />
    <meta property="og:description" content="" />
    <meta name="twitter:title" content="" />
    <meta name="twitter:description" content="" />
    <meta property="og:image" content="" />
    <meta name="twitter:image:src" content="" />
    <meta property="og:url" content="" />    
    <link id="canonical" rel="canonical" href="" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="mobile-web-app-capable" content="yes" />
    
    <link rel="manifest" href="https://www.manyzone.com/masterpage/manifest/manifesta.json" />
    <link href="https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
    
    <script>
        //oldCons.log(text);
        //return;
        //var consoleA = (function (oldCons) {
        var console = (function (oldCons) {
            return {
                log: function (text) {                   
                    if ('' == "80644" || '' == "80005" || '' == "81254") {
                        oldCons.log(text);
                    }
                    else { }
                    //oldCons.log(text);
                    // Your code
                },
                info: function (text) {
                    oldCons.info(text);
                    // Your code
                },
                warn: function (text) {
                    oldCons.warn(text);
                    // Your code
                },
                error: function (text) {
                    oldCons.error(text);
                    // Your code
                }
            };
        }(window.console));

        //Then redefine the old console
        window.console = console;
        var appHost = 'https://www.manyzone.com';//https://www.abc.com
       
        var blnIsDeviceMobile = 'False'.toLowerCase();
        /*alert(blnIsDeviceMobile);*/
       /* alert(appHost);*/
    </script>
  
    <script src='/scripts/general.js' type="text/javascript"></script>
    <script type="text/javascript" src='/scripts/jquery-1.11.3.min.js'></script>
  
   <script type="text/javascript" src='/MasterPage/SiteJsB.js?v=6'></script>
        <script type="text/javascript" src='/MasterPage/js/pwa.js?v=3'></script>
    
    

 
          
    
     

    <link rel="stylesheet" href="/masterpage/css/site/a/Site.css"  />
       <link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 780px)"
      href="/masterpage/css/site/a/SiteMobilePortrait.css"  /> 
    <link rel="stylesheet" media="all and (min-device-width: 781px) and (max-device-width: 1024px)"
        href="/masterpage/css/site/a/SiteNormal.css" />
    <link rel="stylesheet" media="all and (min-device-width: 1025px)" 
        href="/masterpage/css/site/a/SiteNormal.css"/>

    
    <link rel="stylesheet" href="/masterpage/css/Siteempty.css?v=1"  />


    
   

   

    
   
    
     


    


     <style>
          div.app{width:100%;height:100%;}
     </style>
    
<title>

</title></head>
<body>
    <form method="post" action="./sign-up.aspx?action=profile%3bu%3d606461" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="UY1UlDc8RSGNzmH54oKKBn73J933ylnI+jNvGh/fAUoMxd8KFT+VekuREB2NN1Ibw0lZ01Ees/0cLZAqgBPVX+U6ABKH9nKNtSBVKCmNWRfn1utdwphPT4RYmFiFXkijkcEJCZ+zUhmnTMroOneVNGjwJ8t4e78LL7Lt6POPfeXJeEj9nHb2iwfacOP4K/e7Ja0sDNmuSrfgQsCKd2YbptMSSKd9Il8fAW/5PceDFqrdeaOEErSGY31f2bX20UK06hQTkwoo30Wpm8YGBQyTDqiBCvDwGutHxkT+k8Kx+GfPkE+LjxKDEIIaBQWOKiGDXcv5DqUQU3j8m5ByNhpuLvqpPVERyHwTz/H9JGaV9GF1iMkrJD7rHmTodktxfXrcHWji6DV0NIng2CjNNO8Xv0xHu2ju8TFTweT2z2Gqff4v7BNj0QNcVRnEsj2KKm/KRcM2Nn7j0szhMZqGYMmxY5saq2ZJaYQOuxY4lt3X/U8HqyZPJfuVNZ8KMKJkr8PJ/ZYjMFUowPJPrE2pbJF8mzG2i9F3ApUjsXY0ezAmwh8USe3mfrBNzYA1no2XPzQwiTfsOpauyn5HcoH5SJDpOpHkIzANX8sQhmZE1NrfszCE4Gv208Y5WnkBnLnPV+kV2wZqfuNOfHsaEQ1IymZl6wpS1qJR2B2GYbbcTleQs8UU2C1U7B4xL9J6/2JeMKO6d5SzSD/0okTd/p6KZOLxM7o84LmacQP9PeYJnWCeUi3Bno8nd6xkMqaNH3CXGD5HjMFHGEo7aCOPujwFsMd9zCZZIzPCuvRXHETfIsoTDm0Ra9eGzzddzd9AA+bl7QC9lkrJFAXtSyA1LjuSkAbafSUiA3/Z4s1j3u+O2hso9BmQAIEAnrH5uhHijTdciaRVZVSNpK2s845XAhiLmPKB9zfSs2yHF+in92WqP3X0qUHzaJh0fYQT/jrOgAxvHfZJAkIHbM4Pdp88ww9uu2mtSw484ufN1W4UJ30oPAKdIXmGMEYKIvx4LM+zTiZnZ2NuJlH6dxP9pTYQsDyjvJUhAEJWSbrHP14xJhkfu5ZlT+cuH/hTqGKNJHr+3atD/FBv5uBP1JH3Yl3kGgN+yvf2VS8u8h2GCGr6XU+clF94fOHew2hp+XH2mdK26/4lGEMSoVGQnry+YBgIkiDqBfLOwemMafdh4Z4ybQODBEVoa5kS+YusB14BspqWsf71QIwxwJkxoO4LMOGQqobM0w7FudrMiqoR3FvAWxaUT5XORc36KBrIEx2e+kPWnNrN5ZyVyXy62tCV0CE5mWBRUcGvNR2TBcA+DPejun0//NBye12q/7v/v5bkgsuCpwiDHqNp7/wtNTQeFb7Ckr36OYQacM7O9v2Fufn5XRPgfBodaU0bhWQTlRUeXSTF3BzUKfKK6HNu4XkpBrCC3eJEGXzj1EfadLrFTN/gdxOXuObvrf6U4JXJEhUx4AjC7iCG2HzwCecNpPRJM+Q8DMbXP10DUg7V54vwozebx2kEYVeTqDOS56eLV5Y6uwtU0G34tiFHL2Y5/bkkrZXs/Cf6pOYSI33qbsq7du8+oSZLeoyJN1Cd2MT+7GOgkrtikiqxguAcmfKgaZECL56lwkMg/bwrMF8lioaTsdnG0sXhh1ER1yMnS3Y3fya/Cb1CoomEvEO6brvoTFDBvMr0Rs8b7MGShkAD6RncC3fzeNZZDOiidGouEFVxS+ojk3kpwMOKYcMa7H3EdjH7bGUt4Nyz6xGcu3GCUIFhKddafFKuB6Ie8RWJHALCU4RyDvzwb0HDZVYzmHeABtLVfhYU3bs5nWFAsgsRUFnfVOeykPo25zDjWqYabyf3VsxKs2DMpWdVtsdqGUSxwdukNEdOQqgaAcXktA8GJSELOKhudKpyRdbUT3z2Zt2DNrPpsdGNXF2vU5E8GbtG5SR7QihGZJcqj675Ot0g0xrQwuhGY5YocOyGMzZgn2Gc7uPLlpj7aP9tK9HOoNIkAHbMhjB7/qQTEdt1z45JFjTC4LlHi0yV7l2llysAVga3MI1vZofBfyO9mHz5k0E1qR2fzgfaTsOsRnbb+PBgsxdb7WHIcrlriKL2csm8ew4MkveLRsMUamNIJGCq8qbVLq1zSLjU7cIqcif3YS/C0C/5o5hhdst744SAwUzxLPUG7j5bkPTfpd0++xf5YoeSZ2eP9judHNijAB5FeD0T1flzA/1cBDhUhScTE4ibdS6QEOjarcCt9AUGxU1GFLb1T2+veUPqL0N3zQZvh1Dy2DxdxxAKvC39NsfpgRIbYIhF6XAnx2cK7cVMWedXD8ZBl3DCYtgZxPfU5sh2QKQ+m8qgxGHMnseun2ON+wvZepfFyXgj8VEVZLg4egG7eyt27OgbYtwMYSTOTlFy1ZOywIa2Y98+7SVmUpZMjdVkjTQK/+SWuZmmb//a7W+jijlGyHXMxQSLy2N6rsnX7iXiKXwAN0DDjZuEmQoKGhxlUBeJ9XpyRHEL364SnTWzlvC+KBdytKbFIeuOe+j8AM8JiKdUDlUgfDsNUpXwqJKGRoZj9UMR/AMLEaqYWP7eoNo7H2iafjKnRKyE/PZQ+wmD0WAD1umOk87ML20/U+4WFl/Q4tjrI15l6UzpW9bTbCed+BsoFupHgd1k0N/J9uGA19lDLXZyFPj8fzmzitphOtrQtDnQi/F/cSAk4u8PPUXV2rMRissp6y2jOitR1JbEb1MKkW+JF0jUKhbpejxGLOR7x1McYr8T6dvHZ2bJXkBjM9JGwDo4EpM8nBpRGcs60ZDmLCkrEBrWTdgefwLdvZhvt1UTplwnutOi74nLbhzuj91JI54XBlC3zfB7YUgEOOzyMfLiinuq2MgPNCM72zmU5uojv0yvSxCwgI19Fmx3VC/0Fll3jrnvw77ILXQQKeV0Uwa28Q0qCJSAOWZIAFwN9ju5wWph69V07za899QYgOyr3F9uG4klJuLDPPlDvT2PXcldPe8M/McHGYFEdgG+/zhsKOMx5DBH4ch60TS9q1woO1H1/STbLdVsIBQ4hChY9e12/6jpbG0BJSUky+ULQVpjKAgmNEDgEVawtB5x1NY9kWo0tcDptyi9BSNaQjoPZLin7a7k40gDaIpK2h8gG4Q5+7lP8r4b3EnaTY4UZ/wR4DKJP8FMaPnEtcXXkflUqCK9tDXVPC92bcjDw+QV//CWSzLHw0QgpABbCxcOkXQMJLo3782PnTy4Lmn95WeGwlq7mTua6pMuAdoUqxD0u8wV6DD1PlFqY98mhjctW8m5ESc6XVJU+/bPkp005zdadH0TYwjkt62XljKXp7WLTQaDQDIOo9yxYLmxZmQLXHem1z0lNqZkNIAml8HI/XSR1R3fDICCr/t0LcmZDbejd9rhvkwbWIvMADfXY98IBv3/UdGHj1W2J1nriKdRq+RDMFkAHq8JonUahFbVa8XJ2r4M27/YmBlSea7HS9RPBiXy4fWcyhwVorV4wlfIm5ry4D/JsgRoXJZX5ZXCdCnCL9PT/rJPNG2aZeWm0HPhDg3pmW9dG0F4r7D7mVQfuALdDoBsDVJub/gSGXJpx/Y1zDQTdX9UbbltyXXiCqm4pveW62QqEho6qW2wCLargHSGFNASJRGgVM8COZlAE9JTdhf0KdrlY81QM5i5LO9wqyx0NnMknNp9C578f6Ta2PsYXQ4S1bedXIP73ICU9IkwEe8j7wsdvAE7Di8YIdMo6HkEseaVUq/G96SYRUNvth89lUJn+Xyl0JVkrrWa3qPeTC4EaXfYaxxzLGysi5IsP1jObN3H/ACG+58RPHjU7yab+YA2U1Ez7e9cIv5JbAEPw+M8idSK0tVyXEuevfDLwWYqfd6TXTDEmuOK0M0qDB4b+PMUyojRkJkWYd8FeKXqXGSjEqzYvfVdEdsPUIH+XTgHex+DYolghzNQWxtwlJksNA8vRVeo/bKn3tQfp4bz1kX7nFq1lgJVCkItxz+4MXWrpb21NvbZFXv7FZTR5HysP9wZxt+hs3W7MWn9JYZSUVjwU0o9cFo3FV7spctCjzb0ansK+HW9d9xSkrfWekxV7+nKCufSjUAPBPze85tR1qWrV3jg/D7Uc4vJ58ggClaCl40TKzmue1rrpPLjnvVvtbDi9aPkw77Lju1mLoOnfv1GnWEzg49v5tm/IpEKNn9hAFhMnX740SLB/pSGpIjfnYiVu3FNo8VK7KJ17B/63cbuC+lfWN826cUa7NChmxs6K9BDvNQymOv6OZGFPaLJ+Pbetw2vgMnt73J3VLdkMpBtNOKooAZDI790RGqlyH9s2geMj+XQXa54yGwRV5IB2BK8VNO3962ne3xdfpZITu4HDY5tRuFX4NUNX/3AHnbESxsD5mKzh9h7oGTiQtMgAfrglPrv9jDOa3bBgaPRSW2ndtCCBe9wbaIAu3ZWT0T8wsRijCwURsSwAv6AJD0T/1WffiP2MSNy1lDcVXoLV3FUm8wT+t/W0xdTN4BlU3WhVwq1oOQlNSm9pJe+cUgx0SajPulX5i2zcMTUg/Gk1FirNNB0ZDnVCybOrOPM91CnjJnAMzgzidgz9O7jmbqgIfAP+qAGDrF/Yhb1PVf2x1w64s8N0Y+SV3y9licDy2nnsPzp+z5JiKp7+ueLWHOfivYTAABW8U+O7Gk3+lUEVIkGATGUbA7AzXf7BXuEfY6w6R2spNGh1/W08HNSfBwJTGErnUONDV3SJJD33q34mAZ5luVUCW+36mSfa3QK/72bG+CubFJFtJb07VzOMf7wDI42KAgPkiKRaT6flr1a+dsPdMXtJd+HEyaQRuYtnDrB+ktfrr6zcR5UeVfX3PtVFIT65+L1G8qYKj6nKsHK4kzW+xnRLCrwFyvIOR6Mh11Lq2K6yhOZs1RugJbXesUJvJCh2eqAphSWxOSGjVzxaXoXO+CAnwAdGmSC0kRMoNaiF00yINH7/y7Vvj5eUE49VTvZdx6VncVGXWWQr26Q3jCObrcNvRVctaw6NFTpb2AWIxjF2s9f2+rWaO2HAXZ6PqX8L01EdBM6tJpQVdykfxlYCd68WvphQpSoVxFtFAvybsYN3kmr5C6RREbEZRxwvNxwqo082UpJLbmwzwp3dl0xAn85iychgQAS22atnPedczH7EDWbXonycJjLLPruflqZSXZpnAYXnmIDNjlcE3uNjeQoyKVBBfoZukLR4MbJmS4wTniHDgoSTB9CWhHww0Vs/lQ6HcrjPojEwCOrBiDsdihlc3dYTCDYKe1ewhwxVK94ZOieM9Xa/mHzsakoTAE8Jy11Hvuup9pCJw+TsGtdEkkeuc7YNkcJlY/Lw5mu+KeoPhluDaQ2oztH1VJ0TMG3Km5NjIo4Yagy1YiGtRQpYn8FxE1H+763ZAZRGWrXT1BeAyqSQfRWcJYvU5v042XmBsDq+k1UUjzV6FvcOdeAv7BA0V9sNztVOhO70AcO+j05VvYGiqEt9vqLVBl0rCuImxRcGJHUYD4UQWwUxa6LuVp2s/dchJLRjSdVNKQN7K1csIIA6jg9sIPttNQGywoknA6uZwnWeUKVko+XZXi7vciAYskiOg2TLKN/66448d6Nfz5XWxj+6tr8wgjvCYmxU17BGnGcCBdcuo8mpR+n4O2hmVJ4t2Oy/squQoo9lBcKjEsh8NUGO1sWezKsFP+wC6VepHYFJ5is7rtKI1N3fajVgyVFxMhqjBi0NMyyGMJgyFbWQZyHSAh8q+X7nZpRMkx+H8/UUBYkShCg5PtEo2ADWJ2IraYmKO+iFU0KoH0LPQOIiE8pZ9bewSVT59Ib/ynbwnECok9Npzk0R8RRcfjzv4E1arYWyrjdAA72dzFMwTl5EiJTssbEYRFDGIVdj6QdVVui116cykRoEbFty9ZKvLUoUyQWWigWsc5PzCNjBZ5FI1Sngti3rfS009qLzy6mGexN4ZjnWtFtVSWZApC16qnapl/DvjT0+/aUOVMrUDdl2SQdBFzsjVYc4jXWDEx3z3tnRk+C8v89cQvInya8Q5wthF2ThqwTUBTFyaZivgIiHb/GHAwaRR5JNP6ltY41P49RXV/690/yj11vWphcNN5WFUcq8Gdgl8d7EBMlb3UDbGQg6IFOlGbsDGDGnJfIN/Wvve9Ei8EtsTBDUxJHB0WXZrVDgiqX4u2xzXZ+IJ+rfOBN9hRFPJIW4afHlfTtg7mKXyGlMW/H6VTFFkQ5XFeU9a6wmxQNLIE0OMBskMt2/oI1DF1spER5vbmpaX7LNhMqx7lBfmD1n8lQ+BSMJm+lnuLz/TZvt+qheJNbUB+Ztb3O0BMFW9woWhLA/R81m2fQmecIOn2LNQ2cS2KmI0tsfgsmG0azkhmp7usirxMVDk4/1ttYqGAh+FQSXiOLfaspJiP4+LNNNBCAzIaOz0K94SJPYpsoHNIN8TTXdENliPJ1et13bHbyGAPmWC1vB1LC9Y8B+YMdunful4aWdF4ZWxwpYRywO1YNzLq6GavJUEgvUVqX3fuAjHYRuISgPvRt0fpV+536a+QI+CUlmslIhNAmsNr0iUmxyNFbqwWHuQRfB7b4BESjESTAZyy2J00+LwGTWRmaqwy4N1PyRbrieDLPvSv8LgXH4/WunWeH0RLp3XcZG6PtL4etwQ6aUovb7ctG856dB2507EVZE6UAsUENMiHBZ6uwiY/x5tKf3rkapni9sMUR4Fpw+7vdo15sZXJgPMo9UP+ayyPmh2yVxTxHnGr3TL8edpbu84WpN4blqigejVybr20DVnAv7WO24f5Dpt3k1gALJOHEmp3TuP7QnPsbSuHS5kqwur33F3ozuvk+c7cb/VHUESFofatPKQQc/wqBkPew0k08iSHzRZM3zxgTy1zxL3L5r0xtqoEMTbmTSRQ549mRhVSqgfubx5ZpUXRLexZTil4Du37A9TTmpRnBiiKSXy6s9OPGQFT7KLwgUBM41f+luXUh2B2fE5RcVNxNcVgrbnqRFn2l624NBt4OsWFPMxRewmYvDX2tS3ubIQNtv5LHQ/OSeyKW8uGnJd1p6/qj7mtMslQd10bOHatQgX2y6cVy286a4gCpIfA4qA8tYb7gKEjSal8/b9iImqD1S6vVbFKihj30e3TDoXJUKKABEutP+Oy+gxZ/ZwZ9KHlwQd+7uXgbFev+OIfDgZKUcARnIOTK+Tvupws4J4/lLTdstQpLcpB0hRxhz46MTrpRFL5gQh/TgglzQaw5aaR9N4HIKmRmQyLwTrERIDNC/3Sv5zRffS+bP8Qrilwx/ZMkhsEQC49OXHGaMeonFW5PEjEAL+p737X9zT20r/AHmMxLcYX6P6DTZHkIQ8Fnm2AEcA1ZTnNyoe1bWdJpv3uOMhEwEBnFgIpIIKR5Vh7abqPVbgSM9rHoovUxePTfSuZ2SbvkSGj/o96fsI08fBWgjfOgPqLy/aLf5D7+ZvVvZjC1BsLA/0EXbP4h+UP+ZF4K+CfIuXaw18wiqR41tLOD0SufJLOKesXhO7lX8ZG/DkRvnT6rA4uZpQvG+FxXm4yBtwK+9JCAmAwkCv8xCR0PDA+iZCz507HFSuZgAQ2cOxQRhh+mv7c1FkN+jNzRU2hgEH2M3e2aZgWbhFE5BeMEIN1i9QOGwHj+25iCnnW0LnPfXb8e+GswrMNfmKKK+HHsDEmGKe8UbMETaMp6p/UUUNFNx91UjABkfvjCDl7+tkNM8jZZAO9AsZvCSqKcssEW9FNojryCEjBYqivZol7w5ph3HVn2q98sufLz26FKOpPY02Q5T7GiIWIIyekBue6Ovcx846lB1OM36Iy21ThH3G8cU1sKBala6VWcFdh8DK53NTdw2LrpxyqU1On300DtoAFkPV/RIAMNJSFw7oJeaCj0P0KAxU4syKUy9D/C4NvQBt5UUUQvmYuCAtHJuXeaBII1cvAF41E/qo4=" />
</div>

<div class="aspNetHidden">

	<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="26CA4A02" />
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="ddUH4/QOPqZIb1bN4PqFmSJvNfTq7yso8AlNRmva81OYT2qKy7WKaAy3WgDy/ctMsiIggWNqcbDqenXlxKWn8paDxb8KubgiHHQEeOFmY9+YG/He/VgXdCZN7oA1piJdJxImXkLQeUf/F+XwGZ+G7RbSXoJEn5nayS3gJDemuhgvVYh8K/seQDCoevAWUJNmpc2eUxOD0KVGFX88CqLusMaEDTeQLHgCn7eQ356qXfSA3DGCxxRzJgYXZiDxK9hcg1xHF2Lk90b3I8Nr9tdEexfLHmaqpjZZ7q+C2+dnnDq/CeC8byYkDBEVMnKFxe4kppTvyKKCy0yg/ccldLjHwMrIgYJFKD0D7Gfb8qu65f8=" />
</div>
        <div class="app SiteThemeA ">
     <div class="page SiteThemeA" id="divPage">   
        
            <div id="divPageHeader">
 <style type="text/css">
    
     #header .expertmenu {display:none;} 
     #header .logoutdisplay {display:none;} 
            
  </style>   
 <style type="text/css">
             #header .fa{ color:#dddddd !important; font-size:1.2em !important;}
        </style>
 
  <script>
      $(document).on("click", '.categoriesSelectorHeaderJs', function (e) {
          var holdertemp = $('.dropdownHolderHeaderJs');
          $(holdertemp).find('.optionsContainerHeaderJs').hide();
          $(document).bind('click  categoriesHolderHd', dropdownHandlerHd);

//          ev.stopPropagation();

          var holder = $(this).closest('.dropdownHolderHeaderJs');
          $(holder).addClass('open');


          $(holder).find('.optionsContainerHeaderJs').css("visibility", "visible");
          $(holder).find('.optionsContainerHeaderJs').show();
//          alert("hello");
          //          .css('visibility', 'visible');
          document.getElementById('divPage').style.cursor = 'pointer';
          e.stopPropagation();
          function dropdownHandlerHd(event) {

              if ($(event.target).parents().index(this) == -1) {
//                  alert("1");
                  if ($(holder).hasClass('open')) {
                      $(holder).removeClass('open');
                      $(holder).find('.optionsContainerHeaderJs').hide();
                      $(document).unbind('click categoriesHolderHd', dropdownHandlerHd);
                      document.getElementById('divPage').style.cursor = 'default';
                  }
              }
          }
      });
  
  </script>

  
<style>
    .badge {
  padding-left: 9px;
  padding-right: 9px;
  -webkit-border-radius: 9px;
  -moz-border-radius: 9px;
  border-radius: 9px;
}

.label-warning[href],
.badge-warning[href] {
  background-color: #c67605;
}
#lblCartCount {
    font-size: 12px;
    background: #ff0000;
    background-color:#dd2424;
    background-color:#e71a1a;
    background-color:#ed1313;
    color: #fff;
    padding: 0 5px;
    vertical-align: top;
    margin-left: -7px; 
    margin-top:-25px;
}
.badgeCount {
    font-size: 12px;
    background: #ff0000;
    background-color:#dd2424;
    background-color:#e71a1a;
    background-color:#ed1313;
    color: #fff;
    padding: 0 5px;
    vertical-align: top;
    margin-left: -7px; 
    margin-top:-25px;
}
    /*div#header .divIcon {
        display: table-cell;
        vertical-align: middle;
        text-align: center;
        padding-left: 1em;
    }

   div#header .divIcon .fa{ color:#808080 !important; color:#666666 !important;font-size:1.3em !important;}
    div#header .divIcon .fa-envelope{  font-size:1.1em !important;}
   div#header .divIcon .iconText{ color:#555555 !important; color:#9f5ee1 !important; color:#8a5692 !important;font-size:0.8em !important;}
    div#header .divIcon .arrow-down-hd{border-top: 5px solid #555555 !important;}*/

</style>

<div id="header" >
    <div >  
        <div class="SlideCatContainer headerHeight" style=" padding-left:10px;">
            <div class="SlideMe IDoSlideDiv headerHeight" style=" vertical-align:middle;">
                <span class="headerhelper"></span><label style="color: #0077b5;
                    text-decoration: none;"></label>
               
            </div>
        </div>
        <div class="title headerHeight">
            <div class="titleUpper">
                <span class="headerhelper"></span><a href='/' style="color: #0077b5;color:#007fd6; text-decoration: none;">Manyzone</a>
               
                   
                
            </div>
            
        </div>
         <div class="afLogin headerHeight" style=" float: right; color:#dddddd;">
            <div style="display: table; height: 100%;">
                  
                <div class="divIcon">
                    <a class="aMemberWRed aMyNotifications" href='/mynotifications/'>
                        <span class="icon"><i class="fa fa-bell" aria-hidden="true"></i>
                        </span>
                         <span class="badge badge-warning badgeCount hide " >&nbsp;0&nbsp;</span>
                        
                        <div class="iconDesc">
                            <span style="width: 100%; font-size: 0.82em; color: #cccccc;" class="iconText">Notifications</span>
                        </div>
                    </a>
                </div>
                <div class="divIcon" >
                    <a href='/messages/'>
                        <span class="icon"><i class="fa fa-envelope" aria-hidden="true"></i>
                        </span>
                       
                        <div  class="iconDesc">
                        <span style="width:100%;font-size:0.82em; color:#cccccc;">Messages</span></div>
                    </a>
                </div>
               <div class="divIcon" >
                    <a href='/cart/view' >
                        <span class="icon"><i class="fa fa-shopping-cart" aria-hidden="true"></i>
                        </span>
                        <span class="badge badge-warning hide " id='lblCartCount'>&nbsp;0&nbsp;</span>
                        <div class="iconDesc">
                            <span style="width: 100%; font-size: 0.82em; color: #cccccc;" class="iconText">&nbsp;&nbsp;Cart&nbsp;&nbsp;</span>
                             
                        </div>

                    </a>
                </div>
                 <div class="divIcon" style="display:none;" >
                    <a href='/messages/'>
                        <span class="icon"><i class="fa fa-bell-o" aria-hidden="true"></i>
                        </span>
                        <div class="iconDesc">
                        <span style="width:100%;font-size:0.82em; color:#cccccc;">Notifications</span></div>
                    </a>
                </div>
                 <div class="divIcon" style="display:none;">
                    <a href='/messages/'>
                        <span class="icon"><i class="fa fa-user" aria-hidden="true"></i>
                        </span>
                       
                        <div class="iconDesc">
                            <span style="width: 100%; font-size: 0.82em; color: #cccccc;">User </span>
                            <div class="arrow-down-hd" style="border-left: 5px solid transparent; border-top: 5px solid #dddddd; border-right: 5px solid transparent;">
                            </div>
                        </div>
                    </a>
                </div>
                <div class="divIcon" >
                    <a  class="aMyZone" style="cursor:pointer;"> 
                        <span class="icon"><i class="fa fa-gear" aria-hidden="true"></i>
                        </span>
                        <div class="iconDesc">
                            <span style="width: 100%; font-size: 0.82em; color: #cccccc;">My Zone </span>
                            <div class="arrow-down-hd" style="border-left: 5px solid transparent; border-top: 5px solid #dddddd; border-right: 5px solid transparent;">
                            </div>
                        </div>

                    </a>
                </div>
                
            </div>
            
        </div>
        <div><input type="hidden" value="0" id="hdIsPointerClassAdded"/></div>
        <div class="divBrowseByZoneHd dropdownHolderHeaderJs headerHeight">
            <div class="dropdownSelectorHd categoriesSelectorHeaderJs">
                <span class="headerhelper"></span><a class="browseZones">Browse Zones</a>
                <div class="arrow-down-hd">
                </div>
            </div>
            <div id="divCategoriesSideBarLeft" class="optionsContainerHeaderJs tooltipinner close" >  
                <ul>
                    <li><a href='/experts/computers-programming/'
                        class="teach">Technology</a> </li>
                    <li><a href='/experts/education-tutoring/'
                        class="learn">Education</a> </li>
                    <li><a href='/experts/professional-counseling/'
                        class="Mylibrary">Counselling</a> </li>
                    <li><a href='/experts/health-medicine/'
                        class="Mylibrary">Health & Medicine</a> </li>
                    <li><a href='/experts/coaching-personal-development/'
                        class="Mylibrary">Coaching</a> </li>
                    <li><a href='/experts/arts-creative-services/'
                        class="learn">Design</a> </li>
                    <li><a href='/experts/business-finance/'
                        class="teach">Business & Finance</a> </li>
                    <li><a href='/experts/social-media/'
                        class="Mylibrary">Social Media</a> </li>
                    <li><a href='/experts/shopping-style/'
                        class="learn">Shopping</a> </li>
                    <li><a href='/experts/legal-services/'
                        class="teach">Legal</a> </li>
                    <li><a href='/experts/home-leisure/'
                        class="Mylibrary">Home & Leisure</a> </li>
                    <li><a href='/experts/spirituality-religion/'
                        class="Mylibrary">Spirituality</a> </li>
                     
                   
                </ul>
            </div>
        </div>
        
        <div class="loginDisplay headerHeight" style="display:none;">
            <div id="ctl05_pnlLogIn" class="pnlLogIn">
	
                <div>
                    <span class="headerhelper"></span><a href="/network/sign-in.aspx?returnURL=member/sign-up.aspx?action=profile;u=606461" id="ctl05_a_SignIn">Sign In</a>&nbsp;<label
                        class="separatorJoinNow">|</label>&nbsp; <a href="/registration/sign-up.aspx?returnURL=member/sign-up.aspx?action=profile;u=606461" id="ctl05_a_Register" class="aJoinNow">
                            Join Now</a></div>
            
</div>
            
        </div>
       
       
        
       <div class="headerSearchContainer headerHeight headerSearchHeightMob " >  
           
            <div class="headerSearchBox headerHeight headerSearchHeightMob">
                

<script language="javascript" src='/Scripts/gen_ajax.js' type="text/javascript"></script>

<script language="javascript" src='/search/searchsuggest.js' type="text/javascript"></script>

    <style type="text/css" media="screen">	
      
	   .suggest_link 
	   {
	   background-color: #FFFFFF;
	   padding: 2px 6px 2px 6px;
	   }	
	   .suggest_link_over
	   {
	   background-color: #3366CC;
	   padding: 2px 6px 2px 6px;	
	   }	
	   #search_suggest 
	   {
	   position: absolute;
	   background-color: #FFFFFF;
	   text-align: left;
	   border: 1px solid #000000;			
	   }
       .searchContainer  input[type="text"]{border:none;}
       .searchContainer input:focus ,textarea:focus {outline: none; }
	</style>

<div class="searchContainer" >
    <div class="searchInputDiv headerHeight headerSearchHeightMob">
        <span class="headerhelper"></span>
        <div style="display: inline-block; background-color: #f7f7f7; border-radius: 2px; padding-top:4px; padding-bottom:4px;">
            <input type="text" id="txtSearch" name="txtSearch" alt="Search Criteria" onkeyup="searchSuggest(event);"
                autocomplete="off" class="searchText" placeholder="Search for Experts .." value="" />
            
           
            <a >
                        <span class="icon"><i class="fa fa-search" aria-hidden="true" style="margin-top:0px; color:#aaaaaa !important;"></i>
                        </span>
                    </a>
           
        </div>

    </div>
    
    <div class="searchResult" style="clear: both; width: 100%;visibility: hidden; ">
        <div id="search_suggest" class="search_suggest" style="z-index: 2;  ">   
        </div>
        
    </div>
</div>
<script type="text/javascript">
    $('#txtSearch').keypress(function (e) {
//        alert("h");
        if (e.which == 13) {
            if ($('#txtSearch').val().length > 0) {
                $('input[name = cmdSearch]').click();
                return false;
            }
            else {
                return false;
            }
        }
    });
</script>

            </div>
        </div>
    </div>
</div>
<div style="display: none">
    <input id="hdUserId" name="hdUserId" type="hidden" value="" />
    <input id="hdScreenName" name="hdScreenName" type="hidden" value="" />
    <input id="hdUserType" name="hdUserType" type="hidden" value="" />
</div>
<div>
    

<style>
     div#leftSideBar .hide{display:none !important;}
    .icon-user:before {
        /*content: "\F157";*/
        content: "\f007";
    }

    #leftSideBar {
        background: White;
    }

        #leftSideBar a {
            display: block;
            color: #151515 !important;
            text-decoration: none;
            padding: 0 12px;
            line-height: 3.0em;
            text-overflow: ellipsis;
            white-space: nowrap;
            width: 250px;
            overflow: hidden;
        }

        #leftSideBar span.icon {
            font-size: 20px;
            color: #9c9c9c;
            display: inline-block;
            margin-right: 20px;
            position: relative;
            top: 2px;
            min-width:30px;
        }

        #leftSideBar .fa {
            font-size: 0.9em !important;
            color: #9c9c9c;
        }
</style>

   
<div id="divUcMyZone" data-slideright="1" class="IAmSlideDiv">   

    <div id="leftSideBar" class="IAmSlideDivLeft IAmSlideDiv" data-slideleft="1" style="padding-top:20px;">
       
        <a href='/member/sign-in.aspx' class="aLogin ">
            <span class="icon"><i class="fa fa-user" aria-hidden="true"></i>
            </span><span id="spnLogin">Login / Sign Up</span>
        </a>
        <a href="javascript:void(0);" class="aScreenName hide">
            <span class="icon"><i class="fa fa-user" aria-hidden="true"></i>
            </span><span class="spnScreenName"></span>
        </a>
        <a class="hide">
            <span class="icon"><i class="fa fa-search" aria-hidden="true"></i>
            </span><span>Search Advisors</span>
        </a>
      
        <a href='/myorders/view'>
            <span class="icon"><i class="fa fa-shopping-bag" aria-hidden="true"></i>
            </span><span>My Orders</span>
        </a>
        <a href='/billing/client'>
            
             <span class="icon"><i class="fa fa-credit-card" aria-hidden="true"></i></span><span>Billing Summary</span>            
        </a>
        <a class="aAddFundsJs" href='/shopping/addfunds'>
            <span class="icon"><i class="fa fa-briefcase" aria-hidden="true"></i>
            </span><span>Add Funds</span>
        </a>
        
        <a class='hide' href='/billing/expertEarnings'>
            <span class="icon"><i class="fa fa-suitcase" aria-hidden="true"></i>
            </span><span>Expert Earnings</span>
        </a>
         
        <a  class='hide' href='/my-expertzone/profile/my-expert-profiles'>
            <span class="icon"><i class="fa fa-user-circle-o" aria-hidden="true"></i>
            </span><span>My Expert Profiles</span>
        </a>
        
        <hr>
         <a href='/support/contactus'>
            <span class="icon"><i class="fa fa-support" aria-hidden="true"></i>
            </span><span>Contact Support</span>
        </a>

       
        <a href='/member/sign-out' class="hide">
            <span class="icon"><i class="fa fa-pencil-square-o" aria-hidden="true"></i>
            </span><span>Sign out</span>
        </a>
     
    </div>
    <div>
                <input type="hidden" value="0" id="hdIsPointerClassAdded" /></div>
</div>
<script>
    $(document).ready(function () {
        if ($('#hdScreenName').val() != "") {
            $('.spnScreenName').html($('#hdScreenName').val());
            //$('.aScreenName').show();
            $('#divUcMyZone .aScreenName').show();
            $('.aLogin').hide();
            return;
        }
        else {
            $('.spnScreenName').html("");
            //$('.aScreenName').hide();
            $('#divUcMyZone .aScreenName').hide();
            $('.aLogin').show();
        }
       
    });
</script>
<script type="text/javascript">
    $(document).on('click', function (e) {
        if ($('#hdIsPointerClassAdded').val() == "1") {
            $('#hdIsPointerClassAdded').val('0');
            $('#divPage').removeClass('cursorPointerMob');
            $('.IAmSlideDiv').each(function (index, obj) {
                if ($(this).attr("data-slideleft") == "1") {
                    $(this).animate({
                        left: '-5000px'
                    });
                }
                else if ($(this).attr("data-slideright") == "1") {
                    $(this).animate({
                        right: '-5000px'
                    });
                }

            });
        }
        e.stopPropagation();
        return;
    });   
</script>

<script type="text/javascript">
    $(document).ready(function () {
        $('.SlideMe').on('click', function (e) {
            
            $('#divCategoriesSideBar').animate({
                left: '0px'
            });
          
            $('#hdIsPointerClassAdded').val('1');
            $('#divPage').addClass('cursorPointerMob');
            e.stopPropagation();
        });
    });
</script>
</div>
 

<script type="text/javascript">
    $(document).on('click', function (e) {
        if ($('#hdIsPointerClassAdded').val() == "1") {
            $('#hdIsPointerClassAdded').val('0');
            $('.divPagePointer').removeClass('cursorPointerMob');
            $('.IAmSlideDiv').each(function (index, obj) {
                if ($(this).attr("data-slideleft") == "1") {
                    $(this).animate({
                        left: '-5000px'
                    });
                }
                else if ($(this).attr("data-slideright") == "1") {
                    $(this).animate({
                        right: '-5000px'
                    });
                }

            });
        }
        e.stopPropagation();
        return;
    });
    $(document).on("click", 'a', function (e) {
        if ($('#hdIsPointerClassAdded').val() == "1") {
            $('#hdIsPointerClassAdded').val('0');
            $('.divPagePointer').removeClass('cursorPointerMob');
            $('.IAmSlideDiv').each(function (index, obj) {
                if ($(this).attr("data-slideleft") == "1") {
                    $(this).animate({
                        left: '-5000px'
                    });
                }
                else if ($(this).attr("data-slideright") == "1") {
                    $(this).animate({
                        right: '-5000px'
                    });
                }

            });
        }
    });
</script>

<script type="text/javascript">
    $(document).ready(function () {
        $('.aMyZone').on('click', function (e) {
            
            $("#divCategoriesSideBar").animate({
                left: '-5000px'
            });
            //              $("#divTwoColLeftColumnServices").animate({
            //                  left: '-1100px'
            //              });
            $('#divUcMyZone').animate({
                'right': $('#divUcMyZone').css('right') == '0px' ? '-5000px' : '0px'
            }, 0);
           
            $('#hdIsPointerClassAdded').val('1');
          
            $('.divPagePointer').addClass('cursorPointerMob');
            //alert("1");
            e.stopPropagation();
        });

        $('#header .divIcon .aMyNotifications').on('click', function (e) {
            //alert("hello");
            $('#header .divIcon .aMyNotifications .badgeCount').hide();
        })
    });
</script>

</div>
          <div id="divSiteCategoriesTopBar" style="clear:both;"></div>
          
            <div style="clear: both;"></div>
            <div class="main">
                    
                
    
<style>
    .ucSignUp{ text-align:center; padding-top:1em; padding-bottom:2em; max-width:400px;margin: 0 auto;}
    .ucSignUp .formRow{padding-top:5px;}
    .ucSignUp div.email, div.password,div.firstName,div.lastName, div.mobileNo{border:1px solid #cccccc;  display:table; width:100%; background-color:#ffffff; }
    /*div.ucSignUp input[type="text"], input[type="password"] {
            height: 30px;
        }*/
    .ucSignUp input[type="text"],input[type="password"],input[type=submit]{width:calc(100% - 14px); border:none; } /*width:calc(100% - 14px)*/
    .ucSignUp input[type="text"].firstName,input[type="text"].lastName{width:calc(50% - 14px);}  /*width:calc(50% - 14px);*/
    .ucSignUp input[type="text"],input[type="password"]{padding-left:7px; padding-right:7px; padding-top:9px; padding-bottom:6px;font-size: 0.9em;}
    .ucSignUp input[type=submit]{ width:100%;
    /*background: #cccccc;
    background: #957c99;*/
    /*background:inherit;*/
    min-width: 70px;
    text-align: center;
    padding:10px;
    color: #444444;
     color: #ffffff;
    font-size: 0.9em;
    font-weight: bold;
    border-radius: 3px;
    border: 1px solid #aaaaaa;
    border: 1px solid #8a5692;
    text-decoration: none !important;}
    .ucSignUp a{ text-decoration:none; color:#8a5692;}
    .ucSignUp input[type=submit], input[type=button]{
-webkit-appearance: none;
}
 div.SiteThemeMz  input[type=submit], input[type=button],button{ background: #3d79b5;  border: 1px solid #3d79b5;}
 div.SiteThemeMz  a{ color: #3d79b5; }
</style>

     <div id="divSignInContainer" class="ucSignUp paddingPage SiteThemeMz">
    <div id="divSignIn" class="divForm">
       
        <div style="display:none;" > 
            
<style>
   
   
   .fbconnect
    {
        background-image: url(/images/buttons/Facebook_button.png);
        width: 386px;
        height: 50px;
        margin: 0 auto;
    }
       .fbconnect1
    {
       
        width: 4em;
        height: 50px;
        margin: 0 auto; 
    }
    .fb-btn
    { background-color:rgb(59, 90, 154);border: 1px solid rgb(0, 45, 112);
    border-style: solid;
    cursor: pointer;
    margin: 0; border-radius:3px; height:34px;text-align: center; vertical-align:middle; width:100%;overflow:hidden;
    font-size:1em; font-family:sans-serif,Verdana,Arial;
    }
    
    .fb-btn-content{color:rgb(255, 255, 255); display:inline; vertical-align:middle; 
                    line-height:32px;text-shadow: 0 1px 1px rgba(0,0,0,0.35);padding: 0 15px; overflow:hidden; }
    
    .fb-btn-content:before
    {content: "";
    display: block;
    width: 40px;
    height: 40px;
    background: url('/images/buttons/spriteSocialAuthBtns.png') 0 -764px no-repeat;
    float: left;
    margin-top: -4px;
    margin-left: 0px;
    
    }
</style>

<script>

    //window.fbAsyncInit = function () {
    //    FB.init({
    //        appId: '927776573982311', // App ID        
    //        channelUrl: 'http://www.manyzone.com/JS/SocialNetworks/Facebook/channel.aspx', // Channel File
    //        status: true, // check login status
    //        cookie: true, // enable cookies to allow the server to access the session
    //        xfbml: true,  // parse XFBML
    //        version: 'v2.0'
    //    });
    //};

    

    window.fbAsyncInit = function () {
        FB.init({
            appId: '927776573982311',
            cookie: true,
            xfbml: true,
            version: 'v3.1'
        });

       // FB.AppEvents.logPageView();

    };

    // Load the SDK asynchronously
    //(function (d, s, id) {
    //    var js, fjs = d.getElementsByTagName(s)[0];
    //    if (d.getElementById(id)) return;
    //    js = d.createElement(s); js.id = id; js.async = true;
    //    js.src = "//connect.facebook.net/en_US/sdk.js";
    //    fjs.parentNode.insertBefore(js, fjs);
    //} (document, 'script', 'facebook-jssdk'));
   

    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) { return; }
        js = d.createElement(s); js.id = id;
        js.src = 'https://connect.facebook.net/en_US/sdk.js';
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));

    // For regular Facebook Login
    function FBLogin(redirectURL) {       

        var transPageModal = $('#divTransPageModal');
        transPageModal.show();
        $('#divLoadingImage').show();

        FB.login(function (response) {

            if (response.authResponse) {
                var fbToken = response.authResponse.accessToken;               
                var fbDetails = new Object();
                fbDetails.AccessToken = fbToken;
                fbDetails.ReturnUrl = redirectURL;
                //alert('fbToken' + fbToken);
                //alert(redirectURL);             
                $.ajax({
                    type: "POST",
                    url: "/WebServices/Ajax/FacebookRegistrationService.svc/FacebookConnect",
                    data: JSON.stringify(fbDetails),
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: FacebookSDK.OnComplete,
                    error: FacebookSDK.OnFail
                });
            }
            else {               
                console.log('User cancelled login or did not fully authorize.');
                transPageModal.hide();
                $('#divLoadingImage').hide();
            }
        }
        ,
        {
            scope: 'public_profile,email'
        }
        );
    }


    var FacebookSDK = {

        ReturnUrl: ''
            ,
        RegistrationStatus: {
            Success: 1,
            InvalidUsername: 2,
            InvalidPassword: 3,
            InvalidScreenName: 4,
            CountryEmbargo: 5,
            Failure: 100,
            AlreadySignedIn: 6,
            IsNotConnectedWithFacebook: 7,
            FailureInReceivingFBUserDetailsTest : 98,
            FailureInReceivingFBUserDetails: 99
        }
            ,
        OnComplete: function (result) {
           //alert("OnComplete");
            var transPageModal = $('#divTransPageModal');
            transPageModal.hide();
            $('#divLoadingImage').hide();
       
            var obj = JSON.parse(result);
            //alert("returnurl:" + obj.ReturnUrl);
          
            var resultCode = obj.ReturnStatus;
        
            if (resultCode == FacebookSDK.RegistrationStatus.Success) {
               
                window.location.href = obj.ReturnUrl;
            }
            else if (resultCode == FacebookSDK.RegistrationStatus.IsNotConnectedWithFacebook) {

                window.location.href = obj.ReturnUrl;
            }
            else if (resultCode == FacebookSDK.RegistrationStatus.AlreadySignedIn) {
                //                window.location.href = '';
            }

            else {
                //                SignUpSDK.EnableSubmit();
            }
        }
            ,
        OnFail: function (result) {
            //alert("OnFail");
            //alert(result.d);
            //alert(JSON.stringify(result))
            var obj = JSON.parse(result.d);
            //alert(obj.ReturnStatus);
            var transPageModal = $('#divTransPageModal');
            transPageModal.hide();
            $('#divLoadingImage').hide();

            Logger.Error("FacebookConnect error | (data = " + JSON.stringify(result) + ")");
           
        }
            ,
        PixelFired: function () {
            //            window.location.href = '/';
        }
            ,
        doPostBack: function (parameter) {
            var pageId = '__Page';
            __doPostBack(pageId, parameter);
        }
    }



</script>


<div id="auth-status">
    <div id="auth-loggedout">
        
        
    </div>
    <div id="auth-loggedin" style="display: none">
        Hi, <span id="auth-displayname"></span>(<a href="#" id="auth-logoutlink">logout</a>)
    </div>
    
    <div id="status">
    </div>
    <div id="authResponse">
    </div>
    <div id="accessToken">
    </div>
    <div style="clear: both; padding-top: 20px;">
        <div id="divLoadingImage" style="display: none;">
            <img src='/images/icon/loading.gif' style="max-width: 30px;
                max-height: 30px;" alt="" />
            Connecting to facebook..</div>
        <button type="button" class="fb-btn" onclick="FBLogin('https://www.manyzone.com/');">
            <span class="fb-btn-content">Continue with Facebook</span></button>
    </div>
</div>


        </div>
        <div style="padding-top:1em; padding-bottom:1em; display:none;" class="hide" >
            <b>OR</b>
        </div>
         
        <div>
            <span id="MainContent_ucSignUp_lblErrorOn" class="lblErrorOn erroron" style="color:Red;"></span></div>
        <div>
            <span id="MainContent_ucSignUp_lblMessage" class="mandatory"></span></div>
        <div class="formRow">
            <div>
                <!--[if lt IE 10]>Email:<![endif]-->
            </div>
            <div class="email">
                <input name="ctl00$MainContent$ucSignUp$txtEmailId" type="text" id="MainContent_ucSignUp_txtEmailId" class="em" onblur="validate_EmailId();" placeholder="Email Address" /></div>
            <div id="errmsg_EmailId">
            </div>
        </div>
        <div class="formRow">
            <div>
                <!--[if lt IE 13]>Password:<![endif]-->
            </div>
            <div class="password">
                <input name="ctl00$MainContent$ucSignUp$txtPassword" type="password" id="MainContent_ucSignUp_txtPassword" class="pw" onblur="validate_Password();" placeholder="Password" /></div>
            <div id="errmsg_Password">
            </div>
        </div>
        <div class="formRow">          
            <div class="mobileNo" >
                <div style="width: 40%; display: table-cell; border-right:1px solid #dddddd; padding-right:5px;">
                    <div style="display: table; width:90%;">
                        <select name="ctl00$MainContent$ucSignUp$selCountryCode" id="MainContent_ucSignUp_selCountryCode" class="selCountryCode" style=" font-size: 0.9em; padding-left: 5px; padding-top: 9px; padding-bottom: 6px; border: none; float: left; margin-top: 0px; -webkit-appearance: none; display: table-cell; outline: none;">
	<option value="AF (+93)">Afghanistan (+93)</option>
	<option value="AL (+355)">Albania (+355)</option>
	<option value="DZ (+213)">Algeria (+213)</option>
	<option value="AS (+1)">American Samoa (+1)</option>
	<option value="AD (+376)">Andorra (+376)</option>
	<option value="AO (+244)">Angola (+244)</option>
	<option value="AI (+1)">Anguilla (+1)</option>
	<option value="AG (+1)">Antigua and Barbuda (+1)</option>
	<option value="AR (+54)">Argentina (+54)</option>
	<option value="AM (+374)">Armenia (+374)</option>
	<option value="AW (+297)">Aruba (+297)</option>
	<option value="AU (+61)">Australia (+61)</option>
	<option value="AT (+43)">Austria (+43)</option>
	<option value="AZ (+994)">Azerbaijan (+994)</option>
	<option value="BS (+1)">Bahamas (+1)</option>
	<option value="BH (+973)">Bahrain (+973)</option>
	<option value="BD (+880)">Bangladesh (+880)</option>
	<option value="BB (+1)">Barbados (+1)</option>
	<option value="BY (+375)">Belarus (+375)</option>
	<option value="BE (+32)">Belgium (+32)</option>
	<option value="BZ (+501)">Belize (+501)</option>
	<option value="BJ (+229)">Benin (+229)</option>
	<option value="BM (+1)">Bermuda (+1)</option>
	<option value="BT (+975)">Bhutan (+975)</option>
	<option value="BO (+591)">Bolivia (+591)</option>
	<option value="BA (+387)">Bosnia and Herzegovina (+387)</option>
	<option value="BW (+267)">Botswana (+267)</option>
	<option value="BR (+55)">Brazil (+55)</option>
	<option value="BG (+359)">Bulgaria (+359)</option>
	<option value="BF (+226)">Burkina Faso (+226)</option>
	<option value="BI (+257)">Burundi (+257)</option>
	<option value="KH (+855)">Cambodia (+855)</option>
	<option value="CM (+237)">Cameroon (+237)</option>
	<option value="CA (+1)">Canada (+1)</option>
	<option value="CV (+238)">Cape Verde (+238)</option>
	<option value="KY (+1)">Cayman Islands (+1)</option>
	<option value="CF (+236)">Central African Republic (+236)</option>
	<option value="TD (+235)">Chad (+235)</option>
	<option value="CL (+56)">Chile (+56)</option>
	<option value="CN (+86)">China (+86)</option>
	<option value="CX (+61)">Christmas Island (+61)</option>
	<option value="CO (+57)">Colombia (+57)</option>
	<option value="KM (+269)">Comoros (+269)</option>
	<option value="CK (+682)">Cook Islands (+682)</option>
	<option value="CR (+506)">Costa Rica (+506)</option>
	<option value="HR (+385)">Croatia (+385)</option>
	<option value="CU (+53)">Cuba (+53)</option>
	<option value="CZ (+420)">Czech Republic (+420)</option>
	<option value="DK (+45)">Denmark (+45)</option>
	<option value="DJ (+253)">Djibouti (+253)</option>
	<option value="DM (+1)">Dominica (+1)</option>
	<option value="DO (+1)">Dominican Republic (+1)</option>
	<option value="EC (+593)">Ecuador (+593)</option>
	<option value="EG (+20)">Egypt (+20)</option>
	<option value="SV (+503)">El Salvador (+503)</option>
	<option value="GQ (+240)">Equatorial Guinea (+240)</option>
	<option value="ER (+291)">Eritrea (+291)</option>
	<option value="EE (+372)">Estonia (+372)</option>
	<option value="ET (+251)">Ethiopia (+251)</option>
	<option value="FK (+500)">Falkland Islands (+500)</option>
	<option value="FO (+298)">Faroe Islands (+298)</option>
	<option value="FJ (+679)">Fiji (+679)</option>
	<option value="FI (+358)">Finland (+358)</option>
	<option value="FR (+33)">France (+33)</option>
	<option value="PF (+689)">French Polynesia (+689)</option>
	<option value="GA (+241)">Gabon (+241)</option>
	<option value="GM (+220)">Gambia (+220)</option>
	<option value="GE (+995)">Georgia (+995)</option>
	<option value="DE (+49)">Germany (+49)</option>
	<option value="GH (+233)">Ghana (+233)</option>
	<option value="GI (+350)">Gibraltar (+350)</option>
	<option value="GR (+30)">Greece (+30)</option>
	<option value="GL (+299)">Greenland (+299)</option>
	<option value="GD (+1)">Grenada (+1)</option>
	<option value="GU (+1)">Guam (+1)</option>
	<option value="GT (+502)">Guatemala (+502)</option>
	<option value="GN (+224)">Guinea (+224)</option>
	<option value="GY (+592)">Guyana (+592)</option>
	<option value="HT (+509)">Haiti (+509)</option>
	<option value="HN (+504)">Honduras (+504)</option>
	<option value="HK (+852)">Hong Kong (+852)</option>
	<option value="HU (+36)">Hungary (+36)</option>
	<option value="IS (+354)">Iceland (+354)</option>
	<option selected="selected" value="IN (+91)">India (+91)</option>
	<option value="ID (+62)">Indonesia (+62)</option>
	<option value="IR (+98)">Iran (+98)</option>
	<option value="IQ (+964)">Iraq (+964)</option>
	<option value="IE (+353)">Ireland (+353)</option>
	<option value="IL (+972)">Israel (+972)</option>
	<option value="IT (+39)">Italy (+39)</option>
	<option value="JM (+1)">Jamaica (+1)</option>
	<option value="JP (+81)">Japan (+81)</option>
	<option value="JO (+962)">Jordan (+962)</option>
	<option value="KZ (+7)">Kazakhstan (+7)</option>
	<option value="KE (+254)">Kenya (+254)</option>
	<option value="KI (+686)">Kiribati (+686)</option>
	<option value="KW (+965)">Kuwait (+965)</option>
	<option value="LA (+856)">Laos (+856)</option>
	<option value="LV (+371)">Latvia (+371)</option>
	<option value="LB (+961)">Lebanon (+961)</option>
	<option value="LS (+266)">Lesotho (+266)</option>
	<option value="LR (+231)">Liberia (+231)</option>
	<option value="LY (+218)">Libya (+218)</option>
	<option value="LI (+423)">Liechtenstein (+423)</option>
	<option value="LT (+370)">Lithuania (+370)</option>
	<option value="LU (+352)">Luxembourg (+352)</option>
	<option value=" (+853)">Macao (+853)</option>
	<option value="MK (+389)">Macedonia (+389)</option>
	<option value="MG (+261)">Madagascar (+261)</option>
	<option value="MW (+265)">Malawi (+265)</option>
	<option value="MY (+60)">Malaysia (+60)</option>
	<option value="MV (+960)">Maldives (+960)</option>
	<option value="ML (+223)">Mali (+223)</option>
	<option value="MT (+356)">Malta (+356)</option>
	<option value="MH (+692)">Marshall Islands (+692)</option>
	<option value="MQ (+596)">Martinique (+596)</option>
	<option value="MR (+222)">Mauritania (+222)</option>
	<option value="MU (+230)">Mauritius (+230)</option>
	<option value="MX (+52)">Mexico (+52)</option>
	<option value="FM (+691)">Micronesia (+691)</option>
	<option value="MD (+373)">Moldova (+373)</option>
	<option value="MC (+377)">Monaco (+377)</option>
	<option value="MN (+976)">Mongolia (+976)</option>
	<option value="MS (+1)">Montserrat (+1)</option>
	<option value="MA (+212)">Morocco (+212)</option>
	<option value="MZ (+258)">Mozambique (+258)</option>
	<option value="MM (+95)">Myanmar (+95)</option>
	<option value="NA (+264)">Namibia (+264)</option>
	<option value="NR (+674)">Nauru (+674)</option>
	<option value="NP (+977)">Nepal (+977)</option>
	<option value="NL (+31)">Netherlands (+31)</option>
	<option value=" (+599)">Netherlands Antilles (+599)</option>
	<option value="NZ (+64)">New Zealand (+64)</option>
	<option value="NI (+505)">Nicaragua (+505)</option>
	<option value="NE (+227)">Niger (+227)</option>
	<option value="NG (+234)">Nigeria (+234)</option>
	<option value="NU (+683)">Niue (+683)</option>
	<option value="NF (+672)">Norfolk Island (+672)</option>
	<option value="NO (+47)">Norway (+47)</option>
	<option value="OM (+968)">Oman (+968)</option>
	<option value="PK (+92)">Pakistan (+92)</option>
	<option value="PW (+680)">Palau (+680)</option>
	<option value="PA (+507)">Panama (+507)</option>
	<option value="PG (+675)">Papua New Guinea (+675)</option>
	<option value="PY (+595)">Paraguay (+595)</option>
	<option value="PE (+51)">Peru (+51)</option>
	<option value="PH (+63)">Philippines (+63)</option>
	<option value="PL (+48)">Poland (+48)</option>
	<option value="PT (+351)">Portugal (+351)</option>
	<option value="PR (+1)">Puerto Rico (+1)</option>
	<option value="QA (+974)">Qatar (+974)</option>
	<option value="RO (+40)">Romania (+40)</option>
	<option value="RU (+7)">Russian Federation (+7)</option>
	<option value="RW (+250)">Rwanda (+250)</option>
	<option value="KN (+1)">Saint Kitts and Nevis (+1)</option>
	<option value="LC (+1)">Saint Lucia (+1)</option>
	<option value="WS (+685)">Samoa (+685)</option>
	<option value="SM (+378)">San Marino (+378)</option>
	<option value="SA (+966)">Saudi Arabia (+966)</option>
	<option value="SN (+221)">Senegal (+221)</option>
	<option value="SC (+248)">Seychelles (+248)</option>
	<option value="SL (+232)">Sierra Leone (+232)</option>
	<option value="SG (+65)">Singapore (+65)</option>
	<option value="SK (+421)">Slovakia (+421)</option>
	<option value="SI (+386)">Slovenia (+386)</option>
	<option value="SO (+252)">Somalia (+252)</option>
	<option value="ZA (+27)">South Africa (+27)</option>
	<option value="KR (+82)">South Korea (+82)</option>
	<option value="ES (+34)">Spain (+34)</option>
	<option value="LK (+94)">Sri Lanka (+94)</option>
	<option value="SD (+249)">Sudan (+249)</option>
	<option value="SR (+597)">Suriname (+597)</option>
	<option value="SZ (+268)">Swaziland (+268)</option>
	<option value="SE (+46)">Sweden (+46)</option>
	<option value="CH (+41)">Switzerland (+41)</option>
	<option value="SY (+963)">Syria (+963)</option>
	<option value="TW (+886)">Taiwan (+886)</option>
	<option value="TJ (+992)">Tajikistan (+992)</option>
	<option value="TZ (+255)">Tanzania (+255)</option>
	<option value="TH (+66)">Thailand (+66)</option>
	<option value="TL (+670)">Timor-Leste (+670)</option>
	<option value="TG (+228)">Togo (+228)</option>
	<option value="TO (+676)">Tonga (+676)</option>
	<option value="TT (+1)">Trinidad and Tobago (+1)</option>
	<option value="TN (+216)">Tunisia (+216)</option>
	<option value="TR (+90)">Turkey (+90)</option>
	<option value="TM (+993)">Turkmenistan (+993)</option>
	<option value="TC (+1)">Turks and Caicos Islands (+1)</option>
	<option value="TV (+688)">Tuvalu (+688)</option>
	<option value="UG (+256)">Uganda (+256)</option>
	<option value="UA (+380)">Ukraine (+380)</option>
	<option value="AE (+971)">United Arab Emirates (+971)</option>
	<option value="GB (+44)">United Kingdom (+44)</option>
	<option value="US (+1)">United States (+1)</option>
	<option value="UY (+598)">Uruguay (+598)</option>
	<option value="UZ (+998)">Uzbekistan (+998)</option>
	<option value="VU (+678)">Vanuatu (+678)</option>
	<option value="VE (+58)">Venezuela (+58)</option>
	<option value="VN (+84)">Vietnam (+84)</option>
	<option value="YE (+967)">Yemen (+967)</option>
	<option value="ZM (+260)">Zambia (+260)</option>
	<option value="ZW (+263)">Zimbabwe (+263)</option>
</select>
                        <div style="display: table-cell; vertical-align:bottom; ">
                            <div class="arrow-down-hd  arrCountryCode" style="vertical-align: top; "></div>
                        </div>
                    </div>                  
                </div>
               <div style="width:50%;  display:table-cell;">
                    <input name="ctl00$MainContent$ucSignUp$txtPhoneNo" type="text" id="MainContent_ucSignUp_txtPhoneNo" class="ph" onblur="validate_PhoneNoNe();" placeholder="Mobile No" style="float:right; margin-top:1px;" />
               </div>             
            </div>
            <div id="errmsg_PhoneNo">
            </div>
        </div>
        <div class="formRow">
            
            <div class="firstName">
                <input name="ctl00$MainContent$ucSignUp$txtFirstName" type="text" id="MainContent_ucSignUp_txtFirstName" class="fn firstName" onblur="validate_FirstName();" placeholder="First Name" /><input name="ctl00$MainContent$ucSignUp$txtLastName" type="text" id="MainContent_ucSignUp_txtLastName" class="ln lastName" onblur="validate_LastName();" placeholder="Last Name" /></div>
            <div id="errmsg_FirstName">
            </div>
        </div>
       
       
         <div class="formRow">
            
           <div class="lastName">
                <input name="ctl00$MainContent$ucSignUp$txtDOB" type="text" id="MainContent_ucSignUp_txtDOB" class="db" placeholder="Date of birth (dd/mm/yyyy)" /></div>
        </div>
        <div class="formRow">
           
            <div>
                
                <table id="MainContent_ucSignUp_rdoGender">
	<tr>
		<td><input id="MainContent_ucSignUp_rdoGender_0" type="radio" name="ctl00$MainContent$ucSignUp$rdoGender" value="M" checked="checked" /><label for="MainContent_ucSignUp_rdoGender_0">Male</label></td><td><input id="MainContent_ucSignUp_rdoGender_1" type="radio" name="ctl00$MainContent$ucSignUp$rdoGender" value="F" /><label for="MainContent_ucSignUp_rdoGender_1">Female</label></td>
	</tr>
</table>
            </div>
            <div id="errmsg_Gender">
            </div>
        </div>
        <div style="padding-top:1em;">
            <input type="submit" name="ctl00$MainContent$ucSignUp$btnSubmit" value="Join Now" id="MainContent_ucSignUp_btnSubmit" class="btnSubmit" />
        </div>
         <div style="padding-top: 30px; padding-bottom:1.2em; font-size:0.85em;">
            By clicking Join now, you agree to all <a class="footermenusimplebigger"               
                href="/pg/termsofservice/" target="_blank">Member's Terms and Conditions</a>
             </div>

        <div> <div style="display:inline-block; border-top:1px solid #aaaaaa; padding-top:1.2em;"> Already on Manyzone ?&nbsp;<a id="MainContent_ucSignUp_hypSignin" class="footermenusimplebigger aSignIn" href="/member/sign-in.aspx?action=profile%3bu%3d606461">Sign in.</a></div>
           </div>
        <div style="display: none;">
            <input id="hdDate" type="hidden" size="1" name="hdDate" /><input name="ctl00$MainContent$ucSignUp$chkTermsMember" type="checkbox" id="MainContent_ucSignUp_chkTermsMember" onblur="validate_TermsMember();" />&nbsp;&nbsp;I
            have read and agreed to all Manyzone's <a class="footermenusimplebigger" onclick="window.open('termsandconditions.html','Window1','left=400,top=70,scrollbars=yes,width=527,height=600,resizable=1');"
                href="#">Member's Terms and Conditions</a></div>
       
        <div>
            
            </div>

        <div style="display:none;" ><a class="aNextPage" href="/">Return URL</a></div>
      
    </div>
</div>
   
<script type="text/javascript">
    //$('#divModalSingle div.ucSignUp a.aSignIn').click(function (e) {
    //    e.preventDefault();
    //    GoToSignInPageMod();
    //});
    $('#divModalSingle div.ucSignUp a.aSignIn').click(function (e) {
        e.preventDefault();
        GoToSignInPageMod();
    });

    
    //$('#divModalSingle div.ucSignUp div.arrCountryCode').click(function (e) {
    //    alert("click");
    //    $('div.ucSignUp .selCountryCode').click();
    //});

    $(function () {
        $('div.ucSignUp div.arrCountryCode').click(function (e) {
           // alert("click");
            //$('div.ucSignUp div.selCountryCode').click();
            document.getElementById('MainContent_ucSignUp_selCountryCode').focus();
            document.getElementById('MainContent_ucSignUp_selCountryCode').click();
        });
    });

    //$(function () {
    //    $('div.ucSignUp .selCountryCode').change(function () {
    //        //alert($('option:selected', this).text());
    //        selText = $('option:selected', this).text();
    //        selText = selText.split("(")[1];
    //        selText = selText.split(")")[0];
    //        //alert(selText);
    //        //$('div.ucSignUp .selCountryCode').val(selText);
    //    });
    //});

    //$('div.ucSignUp .selCountryCode').click(function (e) {
       
    //    selCountryCode.val("click");
    //});

    function GoToSignInPageMod() {
        var propagatedEmail = $('#divModalSingle div.ucSignUp .em').val();
        var transShield = $('#divModalSingleTransShield');
        var modaldiv = $('#divModalSingle');
        if (modaldiv.length) {
            //var href = $(this).attr('href');
            // var href = "http://localhost:14021/member/sign-in.aspx";
            var href = 'https://www.manyzone.com' + "/member/sign-in.aspx";
            var newhref = href;
            if (href.indexOf("?") >= 0) {
                newhref = newhref + '&umod=true'
            }
            else {
                newhref = newhref + '?umod=true'
            }

            $('.divLoadingImage').show();
            modaldiv.load(newhref,
 function (responseText, textStatus, XMLHttpRequest) {
     if (textStatus == "success") {
         // all good!
         if (propagatedEmail != null) {
             $('#divModalSingle div.ucSignIn .em').val(propagatedEmail);
         }

         modaldiv.show();
         transShield.show();
         $('.divLoadingImage').hide();
         //pushWindowHistory(newhref, href);
         //alert($('#divSignIn').height());
         modaldiv.height($('#divSignIn').height() + 200);
         modaldiv.width($('#divSignIn').width() + 200);
     }
     if (textStatus == "error") {
         // oh noes!

         $('.divLoadingImage').hide();
         if (XMLHttpRequest.readyState == 4) {
             // HTTP error (can be checked by XMLHttpRequest.status and XMLHttpRequest.statusText)
             //alert("error in loading" + XMLHttpRequest.readyState);
             //alert(XMLHttpRequest.statusText);
         }
         else if (XMLHttpRequest.readyState == 0) {
             // Network error (i.e. connection refused, access denied due to CORS, etc.)
             alert("check your internet ")
         }
         else {
             // something weird is happening
             //alert("error in loading" + XMLHttpRequest.readyState);
         }
     }
 });

        }
        else {
            //alert("Div not There"); 
        }


        return false;

    }

  
</script>


    <script type="text/javascript">
       
        $(document).ready(function () {
            $('div.ucSignUp .aSignIn').click(function (e) {
               // //$("#SiteDynamicJs").hide();
               // e.preventDefault();
               // var closestdynamicdiv = $(this).closest('.SiteDynamicJs');
                
               //// alert(closestdynamicdiv);
               // var href = $(this).attr('href');
              
               // closestdynamicdiv.load(href);
               
               // return false;
                var closestdynamicdiv = $(this).closest('.SiteDynamicJs');
                if (closestdynamicdiv.length) {
                    e.preventDefault();
                    var href = $(this).attr('href');
                    closestdynamicdiv.load(href);
                    return false;
                }
                else {
                    //alert("Div not There"); 
                }
            });
            $('div.ucSignUp .aNextPage').click(function (e) {
                //e.preventDefault();
                //var closestdynamicdiv = $(this).closest('.SiteDynamicJs');
                //var href = $(this).attr('href');
                ////alert("href" + href);
                //closestdynamicdiv.load(href);
                //return false;

                var closestdynamicdiv = $(this).closest('.SiteDynamicJs');
                if (closestdynamicdiv.length) {
                    e.preventDefault();
                    var href = $(this).attr('href');
                    closestdynamicdiv.load(href);
                    return false;
                }
                else {
                    //alert("Div not There"); 
                }
            });
        });
        //$(document).on("click", 'a', function (e) {
        //    e.stopPropagation();
        //});
    </script>
    <script type="text/javascript"  src='/pages/signin/scripts/gin.js?v=1'></script>
               
            </div>
        
            <div id="divFooter" style="clear: both;">
<style type="text/css">
#divFooter { background-color:#473b45; min-height:250px; color:#ccc; width:100%; padding-top:30px; }
#divFooter h4{ color:#f7f7f7;color:#aaa; padding-bottom:7px;}
#divFooter a{ line-height:1.7em; color:#eee;}



.page-footer__section {
    margin-bottom: 0px;
    padding-bottom:50px;
}


#divFooter .fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0);
     /*margin-top:6px;*/ 
     color:#ffffff;
}

/*
.fa-facebook
{-webkit-font-smoothing: antialiased;
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: auto;
display: inline-block;
font-family: FontAwesome;
font-size: 20px;
font-stretch: normal;
font-style: normal;
font-variant: normal;
font-weight: normal;
height: 20px;
line-height: 20px;
text-align: center;
text-rendering: auto;
transform: matrix(1, 0, 0, 1, 0, 0);
width: 11.4375px;
 vertical-align:middle; 
}*/
#divFooter .fa-facebook-f:before, .fa-facebook:before {
    content: "\f09a";
}
/*.page-footer__social-link
{-webkit-font-smoothing: antialiased;
background-attachment: scroll;
background-clip: border-box;
background-color: rgb(59, 89, 152);
background-image: none;
background-origin: padding-box;
background-size: auto;
border-bottom-color: rgb(255, 255, 255);
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-style: none;
border-bottom-width: 0px;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(255, 255, 255);
border-left-style: none;
border-left-width: 0px;
border-right-color: rgb(255, 255, 255);
border-right-style: none;
border-right-width: 0px;
border-top-color: rgb(255, 255, 255);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-style: none;
border-top-width: 0px;
box-sizing: border-box;
color: rgb(255, 255, 255);
cursor: auto;
display: inline-block;
font-family: Arial, sans-serif;
font-size: 20px;
font-style: normal;
font-variant: normal;
font-weight: normal;
height: 32px;
line-height: 32px !important;
margin-right: 10px;
outline-color: rgb(255, 255, 255);
outline-style: none;
outline-width: 0px;
text-align: center;
text-decoration: none;
width: 32px; vertical-align:middle;
}*/
#divFooter  .page-footer__social-link {
    width: 32px;
    height: 32px;
    display: inline-block;
    background: tomato;
    color: white;
    text-align: center;
    font-size: 20px;
    line-height: 32px;
    margin-right: 5px;
    border-radius: 4px;
}

#divFooter .page-footer__twitter-link 
{
    
    background: #00aced;
}
#divFooter .page-footer__facebook-link {
    background: #3b5998;
}
#divFooter .page-footer__googleplus-link {
    background: #dd4b39;
}
#divFooter .page-footer__pinterest-link {
    background: #cb2027;
}


#divFooter .page-footer__heading {
    color: white;
    font-weight: bold;
    line-height: 1.2em;
    margin-bottom: 10px;
}
</style>
<div id="divFooter">
    <div>
        <div class="wrap">
            <div class="aboutus" style="font-size: 15px; text-align: left; width: 20%; float: left;">
                <h4 style="color: #ffffff; font-size: 16px;">
                    Help & Support</h4>
                <a href='/help/about-us.aspx'>About Us</a><br />              
                
                <a class="a_FooterMenu" href='/support/contactus'>Contact Us</a><br />
                <a class="a_FooterMenu" href='/site-map/'>Site Map</a>
            </div>
            <div id="ctl06_divJoinAsAnAdvisor" class="aboutus" style="font-size: 15px; text-align: left;
                width: 35%; float: left;">
                <div style="width: 100%;">
                    <font style="color: #ffffff; font-size: 16px;"><b>Join as an Expert</b></font></div>
                <div style="width: 100%; padding-top: 5px;">
                    Join Manyzone Experts today to connect with new clients via Chat, Phone and other
                    communication modes..
                </div>
                <div style="width: 100%; padding-top: 10px; text-align: left;">
                    <a href='/registration/signup-expert.aspx'>Join Now..</a></div>
            </div>
            <div class="aboutus" style="font-size: 15px; text-align: left; width: 25%; float: right;
                display: none;">
                <div class="page-footer__section page-footer__section--first">
                    <div class="page-footer__heading">
                        Follow Us</div>
                    <a class="page-footer__social-link page-footer__facebook-link" href="https://www.facebook.com/UmastroGlobal"
                        target="_blank"><i class="fa fa-facebook"></i></a><a class="page-footer__social-link page-footer__twitter-link"
                            href="https://twitter.com/UmastroGlobal" target="_blank"><i class="fa fa-twitter">
                            </i></a><a class="page-footer__social-link page-footer__googleplus-link" target="_blank">
                                <i class="fa fa-google-plus"></i></a><a class="page-footer__social-link page-footer__pinterest-link"
                                    href="http://www.pinterest.com/umastro/" target="_blank"><i class="fa fa-pinterest">
                                    </i></a>
                    
                </div>
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
    <div class="wrap" style="padding-top: 35px; padding-bottom: 60px; text-align: left;
        line-height: 20px;">
        Experts are not employees or representatives of Manyzone.<br />
       
         Use of this site is subject to the <a href='/pg/termsofservice'>Terms of Use</a> | <a href='/pg/termsofservice?gotohash=refund-policy'>Refund & Cancellation Policy</a> | <a href='/pg/privacypolicy'>Privacy Policy</a> | <a href='/pg/disclaimer'>Disclaimer</a>
    </div>
</div></div>
        </div>
        <div id="divTransPageModal" style="height: 100%; width: 100%; position: fixed; display: block; top: 0px; margin: 0px; background-color: #747474; overflow-y: hidden; margin: 0px auto 0px auto; top: 0; bottom: 0; left: 0; right: 0; filter: alpha(opacity = 10); opacity: 0.3; display: none;"></div>
         <div id="divMyStatCounter" style="clear: both;">
<!-- Default Statcounter code for Online Astrology and
Shopping http://www.manyzone.com -->
<script type="text/javascript">
var sc_project=2127859; 
var sc_invisible=0; 
var sc_security="579a55d5"; 
var scJsHost = "https://";
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="Web Analytics"
href="https://statcounter.com/" target="_blank"><img
class="statcounter"
src="https://c.statcounter.com/2127859/0/579a55d5/0/"
alt="Web Analytics"
referrerPolicy="no-referrer-when-downgrade"></a></div></noscript>
<!-- End of Statcounter Code --></div>
        
        <div class="divMessageBoxSite" style="display:none;">
            

<style type="text/css">
    #divMessageBox {
        BORDER-RIGHT: #960400 2px solid;
        PADDING-RIGHT: 0px;
        BORDER-TOP: #960400 2px solid;
        PADDING-LEFT: 0px;
        RIGHT: 50px;
        PADDING-BOTTOM: 5px;
        BORDER-LEFT: #960400 2px solid;
        WIDTH: 300px;
        BOTTOM: 0px;
        PADDING-TOP: 0px;
        BORDER-BOTTOM: #960400 2px solid;
        position: fixed;
        *POSITION: absolute;
        HEIGHT: 350px;
        BACKGROUND-COLOR: #ffffff;
        BORDER: #bbbbbb 1px solid;
        border:0px;
        box-shadow: -1px -1px 2px 2px #eeeeee;
    }
    #divMessageBox .divHeader{
          display: -ms-flexbox;
    display: -webkit-flex;  display: flex; -webkit-flex: 0 0 auto;
    -ms-flex: 0 0 auto;flex:0 0 auto; webkit-flex-direction: column;
    -ms-flex-direction: column;flex-direction: column; background-color:#8a5692; background-color:#007fd6;  BORDER: #007fd6 1px solid; border-top-left-radius: 4px;
    border-top-right-radius: 4px; color:#ffffff;
        }

    @media only screen and (max-device-width: 780px) {
         #divMessageBox {
            width: 100%;
            margin: 0 auto;
            height: 100%;
            RIGHT: 0px;
            border: 0px;
        }
        #divMessageBox .divHeader{
            height:50px;border:0px;border-radius:0px;
        }
    }

    
   

   
</style>
<!--[if gte IE 5.5]><![if lt IE 7]>
<STYLE type=text/css>DIV#divMessageBox {
	 DISPLAY: none;RIGHT: auto; ; LEFT: expression( ( -20 - divChat.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); BOTTOM: auto; ; TOP: expression( ( -10 - divChat.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' )
}
</STYLE>
<![endif]><![endif]-->

<style>
     #divMessageBox textarea{line-height:1.4em !important;}
   #divMessageBox textarea:focus {
    outline: none !important;
   
}
   #divMessageBox .imgContactUser{width:30px;height:30px;}
   #divMessageBox .divThreadMessageContainer{
       width:100%;clear: both;float:left;
   }
   #divMessageBox  .divThreadMessageContainer .threadMsgByOther .thMessageOuter
   {float: left;
    margin-left: 5px;
    width: calc(100% - 40px);
                       }

   #divMessageBox .divThreadMessageContainer .threadMsgByMe
        {
            max-width: 80%;
            clear: both;
            float: right;
        }
#divMessageBox .divThreadMessageContainer .threadMsgByMe .thMessage
        {
            /*width: 100%;*/
            /*background-color: #f7f7f7;
            background-color: #9bccee;
            background-color: #f7f7f7;
            background-color: #9bccee;
            background-color: #ba90c6;
            background-color:#eee2f1;
            background-color:#c6d5ef;*/
            background-color:#c6d5ef;
            color:#000000;
            border: 1px solid #f7f7f7;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            font-size:0.9em !important; float:right;
            display: inline-block; padding:0.9em;padding-top:0.4em;padding-bottom:0.5em;
        }
 #divMessageBox .divThreadMessageContainer .threadMsgByMe .thMessage > div
        {
            /*margin-left: 1em; margin-right:1em;  margin-top:0.5em;*/
        }
       #divMessageBox .divThreadMessageContainer .threadMsgByMe .thTime
        {
            text-align: right;
             margin-top:0px;
             margin-right:5px;
            margin-bottom: 1em;
            font-size: 0.7em;
        }

       #divMessageBox .divThreadMessageContainer .threadMsgByMe .imgContactUser{visibility:hidden; display:none;}
        
       #divMessageBox .divThreadMessageContainer .threadMsgByOther
        {
           width:100%;
            max-width: 100%;
            clear: both;
            float: left;
        }
      #divMessageBox  .divThreadMessageContainer .threadMsgByOther .thMessageOuter
        {
           float:left;margin-left:5px; width:calc(100% - 40px);
             
        }

     #divMessageBox   .divThreadMessageContainer .threadMsgByOther .thMessage
        {
            /*width: 100%;*/
            /*max-width:80%;*/
            /*max-width:calc(100% - 1.8em - 35px);*/
            background-color: #f6f7f8;
            background-color: #9bccee;
            background-color: #f7f7f7;
             background-color: rgb(242,242,242);
         
            border: 1px solid #f7f7f7;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
             font-size:0.9em !important;
             display: inline-block; 
             padding:0.9em; padding-top:0.4em;padding-bottom:0.5em;
             
        }
       #divMessageBox .divThreadMessageContainer .threadMsgByOther .thMessage > div
        {
            /*margin-left: 1em; margin-right:1em;  margin-top:0.5em;*/
        }
       #divMessageBox .divThreadMessageContainer .threadMsgByOther .thTime
        {
            text-align: left;
            width: 100%;
            margin-top:0px;
             margin-left:5px;
            margin-bottom: 1em;
            font-size: 0.7em;
        }

       #divMessageBox .divThreadMessageContainer .thMessage div.OfferPrice
        {
           clear: both; text-align: right; /*padding-top: 10px;*/
        }

       #divMessageBox  .divThreadMessageContainer .isPriceOfferedByMe0
        {display:none;
        }
      #divMessageBox   .divThreadMessageContainer .isPriceOfferedByContactUser0
        {display:none;
        }

         

        #divMessageBox .divThreadMessageContainer .isPriceOfferedByMe1 label
        {font-weight:bold;
        }

         #divMessageBox .divThreadMessageContainer .isPriceOfferedByMe1 a
        {font-weight:bold;
        }

         #divMessageBox .divThreadMessageContainer .isPriceOfferedByContactUser1 
        {text-align:left;
        }

        #divMessageBox .divThreadMessageContainer .isPriceOfferedByContactUser1 label
        {font-weight:bold;
        }

        #divMessageBox .divThreadMessageContainer .isPriceOfferedByContactUser1 a
        {font-weight:bold;
        }
</style>

<div id="divMessageBox" class="divMessageBox" style="display: flex;display: -ms-flexbox;
    display: -webkit-flex; flex:1 1 auto;-webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto; flex-direction: column;webkit-flex-direction: column;
    -ms-flex-direction: column;" > 
   <div id="divMessageBoxInner" style="display: flex; display: -ms-flexbox;
    display: -webkit-flex;flex:1 1 auto;-webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto; flex-direction: column; webkit-flex-direction: column;
    -ms-flex-direction: column; height:100%;">
        <div class="divHeader" >
            <div style="padding-left: 8px; padding-top: 2px;">
                <div style="float: left; padding-top:4px; font-size:0.95em;" class="divScreenName">Swami Shree Ram Sharma</div>
                <div style="float: right;" class="divCloseMessageBox">
                     <svg viewBox="0 0 24 24" width="24px" height="24px" x="0" y="0" preserveAspectRatio="xMinYMin meet" class="artdeco-icon" focusable="false">
                            <path d="M13,4.32L9.31,8,13,11.69,11.69,13,8,9.31,4.31,13,3,11.69,6.69,8,3,4.31,4.31,3,8,6.69,11.68,3Z" class="small-icon" style="fill-opacity: 1; fill:#fafafa;"></path></svg>
                   
                </div>
            </div>           
        </div>       
     
       <div style="display: -ms-flexbox;
    display: -webkit-flex;display:flex;-webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;flex:1 1 auto;webkit-flex-direction: column;
    -ms-flex-direction: column;flex-direction: column; overflow: hidden;border-top:#cccccc 1px solid;"><div class="divMessageThreadsContainer" style="height:100%;padding-left: 8px; padding-right: 8px; padding-top:5px;overflow-y: scroll; overflow-x:hidden;"></div>
           <div class="divLoadingImageThreadMessages" style="display: none; margin: 100 auto;
                    position: absolute; width: 100%; background-color: transparent; height: 30px;
                    text-align: center; overflow: hidden; z-index: 2; opacity: 1.0; top: 40px;">
                    <img src='/images/icon/loading.gif' style="max-width: 20px;
                        max-height: 20px;" alt="" />
                </div>
       </div>
       <div style="height: 90px; display: -ms-flexbox;
    display: -webkit-flex;display: flex;-webkit-flex: 0 0 auto;
    -ms-flex: 0 0 auto; flex: 0 0 auto; webkit-flex-direction: column;
    -ms-flex-direction: column;flex-direction: column; width: 100%; border-top: #eeeeee 1px solid;">
           <div style="width: 100%; height: 55px; padding-left: 8px; padding-right: 8px;">
               <textarea class="msgboxtxtarea" style="width: 98%; height: 50px; border: 0px;" placeholder="Write a message.."></textarea>
           </div>
           <div style="width: 100%; height: calc(100% - 55px); padding-top: 5px; border-top: #eeeeee 1px solid; vertical-align: middle; display: table;">
               <div style="padding-left: 8px; padding-right: 8px;">
                   <div style="float: left;">&nbsp;</div>
                   <div style="float: right; vertical-align: middle; display: table-cell; height: 100%;">
                       <input type="button" class="btnSendMessage" value="Send" style="display: block; position: relative; margin: auto; display: inline-block; vertical-align: baseline; background:#892a88; background:#8a5692;background:#007fd6; color:#ffffff;color:#fafafa; border-radius: 3px; font-size:0.9em; border:0px; padding:5px; padding-left:10px; padding-right:10px;" />
                   </div>
               </div>
           </div>
       </div>
  </div>
    <div class="msgboxmbcuid" style="display:none;"></div>
    <div class="msgboxmbid" style="display:none;"></div>
    <div style="display: none;">
        <input type="text" class="hdIsRequestSentForOldData" value="0" />
            <input type="text" class="hdIsMoreOldDataExist" value="1" />   
        
<div id="divThreadMessageTemplate" class="divThreadMessageTemplate">
    <div class="divThreadMessageContainer" data-success="0"> 
        <div class="threadMsgByMe">
            <div class="thMessageContainer">
                <div class="thMessage" >
                    <div style="word-wrap: break-word; " ><span><p style="white-space: pre-wrap;"></p></span></div>
                </div>
                
                <div class="thMyOffer">
                    <label class="thMyCurr">
                    </label>
                    <label class="thMyOfferPrice">
                    </label>
                </div>
            </div>
            <div style="clear: both;">
            </div>
            <div style="padding-bottom: 20px;">
                <div class="thError" style="color: Red; float: left; font-size: 0.9em; display:none;">
                    <div class="msgno" style="display: none;">
                        <label class="lblmsgno randommsgno" style="display: none;">
                        </label>
                    </div>
                    <a class="a_RetryToSend" style="cursor: pointer; color: Red;">
                        Not able to send data. Click to resend</a></div>
                <div class="thTime" style="float: right;">
                    
                    
                </div>
            </div>
            <div style="clear:both; height:1em;"></div>
           
           
        </div>
    </div>
</div>

    </div>
</div>

<script type="text/javascript">
    var scrollerThreadsList = '.divMessageThreadsContainer';

    jQuery(
             function ($) {
                 $(scrollerThreadsList).bind('scroll', function () {
                   //alert("scrollPercent0")
                     var scrollTop = $(this).scrollTop();
                     var scrollAmount = $(this).scrollTop(); // +$(this).innerHeight();
                     var scrollHeight = $(this)[0].scrollHeight;
                     var scrollPercent = (scrollAmount / scrollHeight) * 100;
                    // $('#divMessageBox' + ' .hdScrollValues').val(scrollAmount + ':' + scrollHeight + ':' + scrollPercent)
                     if ((scrollTop == 0) && ($('#divMessageBox' + ' .hdIsMoreOldDataExist').val() == "1")) {
                         $(this).scrollTop(1);//10
                     }
                     if ((scrollPercent < 1) && ($('#divMessageBox' + ' .hdIsMoreOldDataExist').val() == "1") && ($('#divMessageBox' + ' .hdIsRequestSentForOldData').val() == "0")) {
                         //                alert("scroll");

                         $('#divMessageBox' + ' .hdIsRequestSentForOldData').val("1");
                         
                         var lastmsgid = $('#divMessageBox' + ' .divThreadMessageContainer .MBMsgId').first().html().trim();
                         var latestmsgid = "0";
                         var a = "oldThreadMessages";
                         //getThreadMessagesOnly(selectedThreadId, "oldThreadMessages", msgid);
                         var mbid = $('#divMessageBox' + ' .msgboxmbid').html().trim();
                         //alert(lastmsgid);
                         var uid = $('#hdUserId').val();
                         var mbcuid = $('#divMessageBox' + ' .msgboxmbcuid').html();
                         getMailBoxMessagesForMessageBox(mbid, uid, mbcuid, a, lastmsgid, latestmsgid);
                     }
                 })
             }
        );


</script>
<script type="text/javascript">
    var msgBoxEnums = {        
        msgboxactions: {
            None: 0,
            gmb: 1,
            amb: 2,
            gmbm: 3           
        }
    };
    $(document).ready(function () {
        $('div.divMessageBox .btnCloseMessageBox').click(function (e) {
            e.preventDefault();          
            hideMessageBox();
            return false;
        });
    });
    $(document).ready(function () {
        $('div.divMessageBox .divCloseMessageBox').click(function (e) {
            e.preventDefault();
            hideMessageBox();
            return false;
        });
    });
    $(document).ready(function () {
        $('div.divMessageBox .btnSendMessage').click(function (e) {
            e.preventDefault();
            var uid = $('#hdUserId').val();
            var mbid = $('div.msgboxmbid').html();
            var mbcuid = $('div.msgboxmbcuid').html();
           
            var a = "a";
            var msg = $('.msgboxtxtarea').val().trim();
            //alert(msg);
            var myoffer = "";
            if (msg == null || msg == "") {
                return false;
            }
                
            appendThreadMessageOnSubmitMsgBox(mbid, msg, myoffer);
            //pushScrollerThreadMessagesToBottomMessageBox();
            var regData = getDataForMessageBox(mbid, uid, mbcuid, a, msg, "0", "0");
            //alert(JSON.stringify(regData));
            sendMessageRequestForMessageBox(regData);
            // sendMessageFromMessageBox();
            $('#divMessageBox textarea').val('');
            //$('#divMBBody .txtOfferPrice').val('');
            return false;
        });
    });

    function showMessageBox(screenname,euid) {       
        $('.divMessageBoxSite .divScreenName').html(screenname);
        var prevmbcuid = $('div.msgboxmbcuid').html(euid);
        if (prevmbcuid != null && prevmbcuid != "") {
            if (prevmbcuid != euid) {
                $('div.divMessageThreadsContainer').html('');
                $('#divMessageBox .hdIsRequestSentForOldData').val('0');
                $('#divMessageBox .hdIsMoreOldDataExist').val('1');
            }
        }
        $('div.msgboxmbcuid').html(euid);
        //$('.divMessageBoxSite .divScreenName').te.innerText = screenname;
        $('.divMessageBoxSite').show();
        var uid = $('#hdUserId').val();
        var mbid = ""; 
        var mbcuid = euid;
        var a = "gmb";
        fetchMBID(mbid, uid, mbcuid,a)
    }

    function hideMessageBox() {
        $('.divMessageBoxSite').hide();
    }

    function fetchMBID(mbid, uid, mbcuid, a) {
        //alert("fetchMBID");
        var regData = getDataForMessageBox(mbid, uid, mbcuid, a, "0", "0");
       //alert( JSON.stringify(regData));
       sendMessageRequestForMessageBox(regData);
    }

    function sendMessageFromMessageBox() {
        var regData = getDataForMessageBox(mbid, uid, mbcuid, a, "0", "0");
       sendMessageRequest(regData);
    }

    function getMailBoxMessagesForMessageBox(mbid, uid, mbcuid, a,lastmsgid,latestmsgid) {
        if (mbid == null) return false;
        if (mbid == "0") return false;
        if (mbid == "") return false;
        var msg = "";
        showLoadingImageThreadMessagesMsgBox("", "1");
        var regData = getDataForMessageBox(mbid, uid, mbcuid, a, msg, lastmsgid,latestmsgid);
        //alert(mbid + ':' + uid + ':' + mbcuid + ':' + a + ':' + 'm');
        sendMessageRequestForMessageBox(regData);
    }

   
    function getDataForMessageBox(mbid, uid, mbcuid, a,msg,lastmsgid, latestmsgid) {

        //var mbdetails = new Object();
        //mbdetails.mbid = mbid;
        //mbdetails.uid = uid;
        //mbdetails.mbcuid = mbcuid;
        //mbdetails.act = a;
        //return mbdetails;

        //alert("getDataForMessageBox");
        //var ele;
        //alert("getDataForMessageBox");
        //var sname = '';
        //var usertype = '';      
       
        //var csname='';
        //var mbini='';
        var msg = msg;
        var latestmsgid = latestmsgid;
        var lastmsgid = lastmsgid;
        var ps = "10";
        var sname = $('#hdScreenName').val();
        var  csname= $('.divMessageBoxSite .divScreenName').html();
      
        //var echarge = '';
        //var epc = '';
        //var mbstatus = '';
        //var mypc = '';
        //var myoffer = '';
        //var latestmsgid = '';
        //var lastmsgid = '';
        //alert("getDataForMessageBox");
        var regData = {
            mbdetails: {
                mbid: mbid,
                uid: uid,             
                mbcuid: mbcuid,              
                msg: msg,              
                act: a,
                latestmsgid: latestmsgid,
                lastmsgid: lastmsgid,
                ps: ps,
                msgno: gmsgnombox,
                sname: sname,
                csname: csname,
            }
        };
        return regData;
    }


    function sendMessageRequestForMessageBox(regData) {
        //alert("sendMessageRequestForMessageBox");
        $.ajax({
            type: "POST",
            url: "/mailbox/getMessages.aspx/manageMessages",
            data: JSON.stringify(regData),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (r) {
                //alert(r.d);
                var obj = JSON.parse(r.d);
                OnSuccessMessageResponseMessageBox(obj, regData);
                return false;
            },
            error: function (statusCode, errorThrown, r) {
                
                OnErrorMessageResponseMessageBox(regData);
                return false;
            }
        });
        return false;
    }

    function OnSuccessMessageResponseMessageBox(obj, regData) {
        //alert("OnSuccessMessageResponseMessageBox");
        //alert(obj.mbid);
        //alert(regData.mbdetails.uid);
        //alert(obj.returnStatus);
        if (regData.mbdetails.act == "gmb") {
            if (obj.returnStatus == "1") {
                if (obj.uid = regData.mbdetails.uid) {
                    var msgboxmbcuid=$('div.msgboxmbcuid').html();
                    if (obj.mbcuid == msgboxmbcuid) {
                        $('div.msgboxmbid').html(obj.mbid);
                        //alert(obj.mbid);
                        setTimeout(getMailBoxMessagesForMessageBox(obj.mbid, obj.uid, obj.mbcuid, "oldThreadMessages"), 2000);
                       
                    }
                }
            }
            //AddNewMessagesInList(obj);
            //updateDisplaySelectedThread();
        }
        else if (obj.act == "oldThreadMessages") {
            if (obj.returnStatus == "1") {
                if (obj.ismoredataexist == "0") {
                    $('#divMessageBox' + ' .hdIsMoreOldDataExist').val("0");     

                }
                else {
                    var isthreadsalreadyexist = true;
                    if ($('#divMessageBox  .divMessageThreadsContainer').html() == null) {
                        isthreadsalreadyexist = false;
                    }
                    if ($('#divMessageBox  .divMessageThreadsContainer').html() == "") {
                        isthreadsalreadyexist = false;
                    }
                    var rethtm = obj.rethtm;
                    $('div.divMessageThreadsContainer').prepend(rethtm);
                    $('#divMessageBox' + ' .hdIsRequestSentForOldData').val("0");
                   
                    //alert($('#divMessageBox  .divMessageThreadsContainer').html());
                    if (isthreadsalreadyexist == false) {
                        pushScrollerThreadMessagesToBottomMessageBox();
                    }
                    //syncDatesOfThreadMessages(obj.mbid);
                    //ToggleVisibilityThreadMessagesDates(obj.mbid);

                }
              
                showLoadingImageThreadMessagesMsgBox("", "0")
                return false;
            }
        }
        else if (obj.act == "a") {
            if ((obj.returnStatus == "1") || (obj.returnStatus == "2")) {
                //alert("addition successful");
                appendThreadMessageTimeMsgBox(regData.mbdetails.mbid, regData.mbdetails.msgno, obj.posttime);
               // startFetchingData();
                return true;
            }
            else {
                if (selectedThreadId == obj.mbid) {
                    $('#divMBBody .msgno' + regData.mbdetails.msgno + '').closest('.thError').show();
                    pushScrollerThreadMessagesToBottom(obj.mbid);
                    return true;
                }
                else {
                    $('.divMBBody' + obj.mbid + ' .msgno' + regData.mbdetails.msgno + '').closest('.thError').show();
                    return true;
                }
            }
        }
        else if (regData.mbdetails.act == "mbmsgs") {
            //alert("getMailBoxMessagesForMessageBox1");
            $.each(obj, function (i, currObj) {
                if (i == 0) {
                    $.each(currObj, function (key, val) {
                        //alert(key + val);
                    });
                }               
            });

            //if (obj.returnStatus == "1") {
            //    var control = obj.control;
            //    $('div.divMessageThreadsContainer').append(control);
            //    //showThreadMessages();
            //    //if (obj.mbid == selectedThreadId) {
            //    //    rollOverBodyToTrim(selectedThreadId);
            //    //    updateReadStatus(selectedThreadId, 1);
            //    //}
            //    //pushWindowHistory(obj.mbid);
            //    //pushScrollerThreadMessagesToBottom(obj.mbid);
            //    //showLoadingImagePage("0");
            //    //return false;
            //}
        }       

        return false;
    }

    function OnErrorMessageResponseMessageBox(regData) {
       // alert("OnErrorMessageResponseMessageBox");
    }

    var gmsgnombox = 0;
    function appendThreadMessageOnSubmitMsgBox(mbid, msg, myoffer) {
        gmsgnombox = gmsgnombox + 1;
        var cmsgno = gmsgnombox;
        //$('.divThreadMessageTemplate .divThreadMessageContainer .thMessage p').html(msg);
        $('#divMessageBox .divThreadMessageTemplate .divThreadMessageContainer .thMessage').html(msg);
        if (myoffer != null && myoffer != "") {
            if (myoffer > 0) {
                var mycurr = $("#hdMyPrimaryCurrency").val();
                //            $('#divThreadMessageTemplate .divThreadMessageContainer .thMyOffer').html("My Offer: " + mycurr + " " + myoffer);
                $('#divMessageBox .divThreadMessageTemplate .divThreadMessageContainer .thMyOffer .thMyCurr').html(mycurr);
                $('#divMessageBox .divThreadMessageTemplate .divThreadMessageContainer .thMyOffer .thMyOfferPrice').html(myoffer);
                var temphtml = "My Offer: " + $('#divThreadMessageTemplate .divThreadMessageContainer .thMyOffer').html()
                $('.divThreadMessageTemplate .divThreadMessageContainer .thMyOffer').html(temphtml);
            }
        }
       

        $('#divMessageBox .divThreadMessageTemplate .divThreadMessageContainer .thError .msgno').html('<label class="msgno' + cmsgno + '"></label>');

        //        $('#divThreadMessageTemplate .divThreadMessageContainer .thTime').html(time);
        var temp = $('#divMessageBox .divThreadMessageTemplate').html();
        $('#divMessageBox .divMessageThreadsContainer').append(temp);
        pushScrollerThreadMessagesToBottomMessageBox();
        //if (selectedThreadId == mbid) {
        //    pushScrollerThreadMessagesToBottom();
        //}
    }

    function pushScrollerThreadMessagesToBottomMessageBox() {
        //       alert("push");
        //        var scrollerThreadMsgs1 = $('#divMBBody' + mbid + ' .mb-body-messages-wrapper');
        var scrollerThreadMsgs2 = $('#divMessageBox' + ' .divMessageThreadsContainer');
        //        scrollerThreadMsgs1.scrollTop($(scrollerThreadMsgs1)[0].scrollHeight);
        scrollerThreadMsgs2.scrollTop($(scrollerThreadMsgs2)[0].scrollHeight);
        return false;
    }

    function appendThreadMessageTimeMsgBox(mbid, msgno, time) {
        //alert(mbid + "," + msgno + "," + time)
        var ele = $('#divMessageBox' + ' .msgno' + msgno).closest('.threadMsgByMe').find('.thTime');
        ele.html(time);
        $('#divMessageBox' + ' .msgno' + msgno).closest('.divThreadMessageContainer').attr('data-success', '1');

        //if (mbid == selectedThreadId) {
        //    var ele = $('#divMessageBox' + ' .msgno' + msgno).closest('.threadMsgByMe').find('.thTime');
        //    ele.html(time);

        //    var nxtele = $('#divMessageBox' + mbid + ' .msgno' + msgno).closest('.threadMsgByMe').find('.thTime');
        //    nxtele.html(time);

        //    $('#divMessageBox' + ' .msgno' + msgno).closest('.divThreadMessageContainer').attr('data-success', '1');
        //    $('#divMessageBox' + mbid + ' .msgno' + msgno).closest('.divThreadMessageContainer').attr('data-success', '1');
        //}
        //else {
        //    var ele = $('#divMessageBox' + mbid + ' .msgno' + msgno).closest('.threadMsgByMe').find('.thTime');
        //    ele.html(time);
        //    $('#divMessageBox' + mbid + ' .msgno' + msgno).closest('.divThreadMessageContainer').attr('data-success', '1');
        //}

    }

    function showLoadingImageThreadMessagesMsgBox(mbid, v) {
        var ele = $('#divMessageBox' + ' .divLoadingImageThreadMessages');
        if (v == "1") {
            ele.show();
            //            isLoadingImageThreadMessagesVisible = "1";
        }
        else if (v == "0") {
            ele.hide();
            //            isLoadingImageThreadMessagesVisible = "0";
        }
        return true;
    }

</script>
<style></style>
        </div>
         <div>
            
<style>
    /*#divModalSingleTransShield{height: 100%; width: 100%; position: fixed; display: block; top: 0; margin: 0px; background-color: #bbbbbb; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0px auto 0px auto;  bottom: 0; left: 0; right: 0; filter: alpha(opacity = 10); opacity:0.7; display: none;}*/
    /*#divModalSingle{height: 60%; width: 50%; position: fixed; display: block; 
                      margin:auto; background-color: #ffffff; overflow-y: auto; -webkit-overflow-scrolling: touch;  top: 0; bottom: 0; left: 0; right: 0; filter: alpha(opacity = 10); opacity:1; display: none; border:1px solid #bbbbbb;}*/
    #divModalSingleTransShieldN{height: 100%; width: 100%; position: fixed; display: block; top: 0; margin: 0px; background-color: #bbbbbb; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0px auto 0px auto;  bottom: 0; left: 0; right: 0;  background-color: rgba(100,100,100,0.7); display: none;}
   
     #divModalSingleTransShield{height: 100%; width: 100%; position: fixed; display: block; top: 0; margin: 0px; background-color: #bbbbbb; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0px auto 0px auto;  bottom: 0; left: 0; right: 0;  background-color: rgba(100,100,100,0.7); display: none;}
   
     #divModalSingle{ text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    /*left: 50%;
    top: 50%;*/
    transform: translate(-50%, -50%);
    width: 80%;
    /*width: 100%;*/
    max-height: 95%;
    /*height:100%;*/
    background-color: rgb(255, 255, 255);
     background-color: rgb(255, 255, 255);
     /*background-color: transparent;*/
    border-radius: 8px;
    /*padding: 30px;*/
    overflow: auto;}
    div.divModalSingleMob{height: 100% !important; width: 100% !important; max-height: 100% !important; /*top:0px !important;*/border:0px;}
    /* For mobileheight:100%; width:100%,top: 0px*/
    
    /*#divModalSingle .pageContainer{height: 100%; width: 70%; position: fixed; display: block; top: 0; margin: 0px; background-color: #ffffff; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0px auto 0px auto; top: 0px; bottom: 0; left: 0; right: 0; filter: alpha(opacity = 10); opacity:1; }*/
</style>
<div id="divModalSingleTransShield">
<div id="divModalSingle" class="">
    
    
</div>
   
    </div>
<div id="divModalSingleTransShieldN"></div>
<script>
    
    function closeModalSingle() {
        //alert("closeModalSingle");
        $('#divModalSingle').hide();
        $('#divModalSingleTransShield').hide();
    }
    function showModalSingleHeading(inval) {
        $('#divModalSingle').hide();
        $('#divModalSingleTransShield').hide();
    }    

    function GoToPageModal(url) {
        
        var transShield = $('#divModalSingleTransShield');
        var modaldiv = $('#divModalSingle');     
          if (modaldiv.length) {           
            //var href = $(this).attr('href');
           // var href = "http://localhost:14021/member/sign-in.aspx";
           // var href = 'https://www.manyzone.com' + "/member/sign-in.aspx";
            var href = url;
            var newhref = href;
            if (href.indexOf("?") >= 0) {
                newhref = newhref + '&umod=true'
            }
            else {
                newhref = newhref + '?umod=true'
            }
         
            $('.divLoadingImage').show();
            modaldiv.load(newhref, function (responseText, textStatus, XMLHttpRequest) {
                if (textStatus == "success") {
                    // all good!
                    modaldiv.show();
                    transShield.show();
                    $('.divLoadingImage').hide();
                    //pushWindowHistory(newhref, href);     
                    //alert("hello");
                    modaldiv.height($('#divSignIn').height() + 200);
                    modaldiv.width($('#divSignIn').width() + 200);
                }
                if (textStatus == "error") {
                    // oh noes!

                    $('.divLoadingImage').hide();
                    if (XMLHttpRequest.readyState == 4) {
                        // HTTP error (can be checked by XMLHttpRequest.status and XMLHttpRequest.statusText)
                        //alert("error in loading" + XMLHttpRequest.readyState);
                        //alert(XMLHttpRequest.statusText);
                    }
                    else if (XMLHttpRequest.readyState == 0) {
                        // Network error (i.e. connection refused, access denied due to CORS, etc.)
                        alert("check your internet ")
                    }
                    else {
                        // something weird is happening
                        //alert("error in loading" + XMLHttpRequest.readyState);
                    }
                }
            });
            
        }
        else {
            //alert("Div not There"); 
        }

        return false;

    }

</script>
        </div>
        <div id="divLoadingImageOnMs" class="divLoadingImage hide" style="height: 100%; width: 100%; position: fixed;   background-color: #ffffff; overflow-y: hidden; margin: 0px auto 0px auto; top: 0; bottom: 0; left: 0; right: 0; filter: alpha(opacity = 10); opacity: 0.7; text-align:center; vertical-align:middle;">
           <span style="display:inline-block;height: 100%;
    vertical-align: middle;"></span> <img id="imgLoading" class="imgLoading" alt="Loading..." style="width: 2em; height: 2em; margin: 0px; vertical-align:middle; display:inline-block;"
                src="/images/icon/loading.gif" />
           
          
        </div>
        <div  class="divFreeMinutesPopUp hide">
                 <div class="divFreeMinutesPopUpContent">
            <div class="divFreeMinutesPopUpCloseBtn" style="position: absolute; right: 18px; top: 18px; display: table-cell; vertical-align: middle; cursor:pointer;">
                <div style="position: relative; display: inline-block; width: 2.5em; height: 2.5em;">
                    <svg class="svg-icon" viewBox="0 0 20 20">
                        <path fill="#a0a0a0" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
                    </svg>
                </div>
            </div>           
            <div class="FreeMinutesPopUpTitle">You Have 3 Free Minutes!</div>
            <div class="FreeMinutesPopUpText"><b>Chat:</b>&nbsp;&nbsp;Avail our offer of First 3 Minutes free with each new advisor for the first chat.</div>
            <div class="FreeMinutesPopUpText"><b>Phone:</b>&nbsp;&nbsp;Enjoy 1 FREE minute on your first voice call!</div>
            <div class="FreeMinutesPopUpText FreeMinutesHideSmallScreen">Consult with your preferred advisor and get answers to your pressing questions.</div>
            <div style="padding-top: 25px;"></div>
            <a class="FreeMinutesPopUpStartbtn" >Get your Free Minutes!</a>  
        </div>            
        </div>
      
            
 <script type="module" src="https://www.gstatic.com/firebasejs/9.2.0/firebase-app-compat.js"></script>
        <script type="module" src="https://www.gstatic.com/firebasejs/9.2.0/firebase-messaging-compat.js"></script>
       
<style>
    .divWbPushNtPermissionContainer {
        position: fixed;
        bottom: 0;
        width: 100%;
        background-color: rgba(200,200,200,1);
        z-index: 10;
        font-family: Verdana, Geneva, Tahoma, sans-serif;
        color: #000000;
        border-top: 1px solid rgba(0,0,0,0.2);
    }
    .divWbPushNtPermissionContainer .divWbPushNtPermissionSubContainer {   
            position:relative;        
            text-align: left;
            background-color: rgb(255, 255, 255);
            max-width: 80%;
            transform: translate(12% , 10px);
            border-top: 1px solid rgba(0,0,0,0.2);
            border-radius: 10px;
            padding: 15px; /*overflow:hidden; display:inline-block;*/
     }
   .divWbPushNtPermissionSubContainer input[type=button]{border-radius: 4px;    float:right; 
    font-size: 15px;
    font-weight: normal;
    color: #fff !important;
    text-shadow: none;
    /*width: 100%;*/
    display: block;
    padding: 5px 8px;}
</style>
<div class="divWbPushNtPermissionContainer hide" >  
    <div class="divWbPushNtPermissionCloseBtn" style="position: absolute; right: 5px; top: 5px; display: table-cell; vertical-align: middle; cursor: pointer;">
        <div style="position: relative; display: inline-block; width: 2.0em; height: 2.0em;">
            <svg class="svg-icon" viewBox="0 0 20 20">
                <path fill="#a0a0a0" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
            </svg>
        </div>
    </div>
    <div class="divWbPushNtPermissionSubContainer">          
       
       <div style="font-size:0.9em;" class="expertPermissionContent hide">Your settings for receiving Notifications for Client Requests, Orders, Billing Notifications etc are not configured yet. You need to configure your web notification settings.</div>
        <div style="font-size:0.9em;" class="clientPermissionContent hide">Manage your Notification Settings for getting notified about Expert Replies, Order Status, Billing Notifications etc. You are suggested to configure your web notification settings.</div>
       <div style="clear:both;"></div>
        <div style="width:100%;  ">
           <a href="/my-expertzone/notificationManager/notification-manager.aspx"><input type="button" class="btnWbPushNtPermissionConfigure" style="cursor:pointer;" value="Proceed to configure" /></a></div>
         <div style="clear:both;"></div>
    </div>
</div>
<script>
    $(document).on("click", ('div.divWbPushNtPermissionContainer div.divWbPushNtPermissionCloseBtn'), function (e) {
        e.preventDefault();
        $('.divWbPushNtPermissionContainer').hide();
        var nbr_ls = null;
        var obnbr_ls = null;
        var nbr_srvr = '{"dvgui":"","tkgui":"","jsts":null,"rugui":null,"rui":0,"rusbs":null,"jtspop":null,"idbau":0}';
        var obnbr_srvr = $.parseJSON(nbr_srvr);
        nbr_ls = window.localStorage.getItem('nbr');
        if (nbr_ls != null) {            
            obnbr_ls = $.parseJSON(nbr_ls);
            obnbr_ls.jtspop = timestamp;            
            window.localStorage.setItem("nbr", JSON.stringify(obnbr_ls));
        }
        else {
            obnbr_srvr.jtspop = timestamp;
            window.localStorage.setItem("nbr", JSON.stringify(obnbr_srvr));
        }
        return false;
    });
    
</script>
 <script type="text/javascript" title="JSCD">
        /**
 * JavaScript Client Detection
 * (C) viazenetti GmbH (Christian Ludwig)
 */
        var gWinTen = false;
        var gAndroid = false;
     (function (window) {
         {
             var unknown = '-';

             // screen
             var screenSize = '';
             if (screen.width) {
                 width = (screen.width) ? screen.width : '';
                 height = (screen.height) ? screen.height : '';
                 screenSize += '' + width + " x " + height;
             }

             // browser
             var nVer = navigator.appVersion;
             var nAgt = navigator.userAgent;
             var browser = navigator.appName;
             var version = '' + parseFloat(nVer);
             var nameOffset, verOffset, ix;

             // Yandex Browser
             if ((verOffset = nAgt.indexOf('YaBrowser')) != -1) {
                 browser = 'Yandex';
                 version = nAgt.substring(verOffset + 10);
             }
             // Samsung Browser
             else if ((verOffset = nAgt.indexOf('SamsungBrowser')) != -1) {
                 browser = 'Samsung';
                 version = nAgt.substring(verOffset + 15);
             }
             // UC Browser
             else if ((verOffset = nAgt.indexOf('UCBrowser')) != -1) {
                 browser = 'UC Browser';
                 version = nAgt.substring(verOffset + 10);
             }
             // Opera Next
             else if ((verOffset = nAgt.indexOf('OPR')) != -1) {
                 browser = 'Opera';
                 version = nAgt.substring(verOffset + 4);
             }
             // Opera
             else if ((verOffset = nAgt.indexOf('Opera')) != -1) {
                 browser = 'Opera';
                 version = nAgt.substring(verOffset + 6);
                 if ((verOffset = nAgt.indexOf('Version')) != -1) {
                     version = nAgt.substring(verOffset + 8);
                 }
             }
             // Legacy Edge
             else if ((verOffset = nAgt.indexOf('Edge')) != -1) {
                 browser = 'Microsoft Legacy Edge';
                 version = nAgt.substring(verOffset + 5);
             }
             // Edge (Chromium)
             else if ((verOffset = nAgt.indexOf('Edg')) != -1) {
                 browser = 'Microsoft Edge';
                 version = nAgt.substring(verOffset + 4);
             }
             // MSIE
             else if ((verOffset = nAgt.indexOf('MSIE')) != -1) {
                 browser = 'Microsoft Internet Explorer';
                 version = nAgt.substring(verOffset + 5);
             }
             // Chrome
             else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
                 browser = 'Chrome';
                 version = nAgt.substring(verOffset + 7);
             }
             // Safari
             else if ((verOffset = nAgt.indexOf('Safari')) != -1) {
                 browser = 'Safari';
                 version = nAgt.substring(verOffset + 7);
                 if ((verOffset = nAgt.indexOf('Version')) != -1) {
                     version = nAgt.substring(verOffset + 8);
                 }
             }
             // Firefox
             else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
                 browser = 'Firefox';
                 version = nAgt.substring(verOffset + 8);
             }
             // MSIE 11+
             else if (nAgt.indexOf('Trident/') != -1) {
                 browser = 'Microsoft Internet Explorer';
                 version = nAgt.substring(nAgt.indexOf('rv:') + 3);
             }
             // Other browsers
             else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
                 browser = nAgt.substring(nameOffset, verOffset);
                 version = nAgt.substring(verOffset + 1);
                 if (browser.toLowerCase() == browser.toUpperCase()) {
                     browser = navigator.appName;
                 }
             }
             // trim the version string
             if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix);
             if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix);
             if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix);

             majorVersion = parseInt('' + version, 10);
             if (isNaN(majorVersion)) {
                 version = '' + parseFloat(nVer);
                 majorVersion = parseInt(nVer, 10);
             }

             // mobile version
             var mobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer);

             // cookie
             var cookieEnabled = (navigator.cookieEnabled) ? true : false;

             if (typeof navigator.cookieEnabled == 'undefined' && !cookieEnabled) {
                 document.cookie = 'testcookie';
                 cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false;
             }

             // system
             var os = unknown;
             var clientStrings = [
                 { s: 'Windows 10', r: /(Windows 10.0|Windows NT 10.0)/ },
                 { s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ },
                 { s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ },
                 { s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ },
                 { s: 'Windows Vista', r: /Windows NT 6.0/ },
                 { s: 'Windows Server 2003', r: /Windows NT 5.2/ },
                 { s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ },
                 { s: 'Windows 2000', r: /(Windows NT 5.0|Windows 2000)/ },
                 { s: 'Windows ME', r: /(Win 9x 4.90|Windows ME)/ },
                 { s: 'Windows 98', r: /(Windows 98|Win98)/ },
                 { s: 'Windows 95', r: /(Windows 95|Win95|Windows_95)/ },
                 { s: 'Windows NT 4.0', r: /(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/ },
                 { s: 'Windows CE', r: /Windows CE/ },
                 { s: 'Windows 3.11', r: /Win16/ },
                 { s: 'Android', r: /Android/ },
                 { s: 'Open BSD', r: /OpenBSD/ },
                 { s: 'Sun OS', r: /SunOS/ },
                 { s: 'Chrome OS', r: /CrOS/ },
                 { s: 'Linux', r: /(Linux|X11(?!.*CrOS))/ },
                 { s: 'iOS', r: /(iPhone|iPad|iPod)/ },
                 { s: 'Mac OS X', r: /Mac OS X/ },
                 { s: 'Mac OS', r: /(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ },
                 { s: 'QNX', r: /QNX/ },
                 { s: 'UNIX', r: /UNIX/ },
                 { s: 'BeOS', r: /BeOS/ },
                 { s: 'OS/2', r: /OS\/2/ },
                 { s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ }
             ];
             for (var id in clientStrings) {
                 var cs = clientStrings[id];
                 if (cs.r.test(nAgt)) {
                     os = cs.s;
                     break;
                 }
             }

             var osVersion = unknown;

             if (/Windows/.test(os)) {
                 osVersion = /Windows (.*)/.exec(os)[1];
                 os = 'Windows';
             }

             switch (os) {
                 case 'Mac OS':
                 case 'Mac OS X':
                 case 'Android':
                     osVersion = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([\.\_\d]+)/.exec(nAgt)[1];
                     break;

                 case 'iOS':
                     osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer);
                     osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0);
                     break;
             }

             // flash (you'll need to include swfobject)
             /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */
             var flashVersion = 'no check';
             if (typeof swfobject != 'undefined') {
                 var fv = swfobject.getFlashPlayerVersion();
                 if (fv.major > 0) {
                     flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release;
                 }
                 else {
                     flashVersion = unknown;
                 }
             }
         }

         window.jscd = {
             screen: screenSize,
             browser: browser,
             browserVersion: version,
             browserMajorVersion: majorVersion,
             mobile: mobile,
             os: os,
             osVersion: osVersion,
             cookies: cookieEnabled,
             flashVersion: flashVersion
         };
     }(this));

     //alert(
     //    'OS: ' + jscd.os + ' ' + jscd.osVersion + '\n' +
     //    'Browser: ' + jscd.browser + ' ' + jscd.browserMajorVersion +
     //    ' (' + jscd.browserVersion + ')\n' +
     //    'Mobile: ' + jscd.mobile + '\n' +
     //    'Flash: ' + jscd.flashVersion + '\n' +
     //    'Cookies: ' + jscd.cookies + '\n' +
     //    'Screen Size: ' + jscd.screen + '\n\n' +
     //    'Full User Agent: ' + navigator.userAgent
     //);

     
        if (jscd.os == "Windows" && jscd.osVersion == "10") {
            //alert("redirect to windowsstore");
            // window.location.href = 'https://www.microsoft.com/store/apps/9PPH2B6Z5VSW';
            //window.location.href = 'ms-windows-store://pdp/?ProductId=9PPH2B6Z5VSW';
            //$('div.divWinTen a.aWinTen').trigger('click');
            gWinTen = true;
            
        }
        else if (navigator.userAgent.match(/Android/i)) {
            //alert("android matched");
            gAndroid = true;
        };
        //else if (nAgt.toLowerCase().indexOf("android") > -1) {
        //    alert("android matchedn");
        //    gAndroid = true;
        //}
       
 </script>

<script >  
    var wbpshut = '';
    var wbpuserid='';
    var wbpugui='';
    var supportsNotification=false;
    var cmTokenJson = '{"uid":0,"ugui":"","msngrid":0,"guid":null,"tkn":null,"tkgui":null,"tct":0,"dvid":null,"dvgui":null,"tkp":1,"jscd":{"os":"","osv":"","brw":"","bmv":"","brv":"","mbl":false,"flv":"","ck":false,"ssz":"","uag":""},"wsg":"B3893F24-33E8-46E2-AA68-906D0993986B","sbcrst":false,"obnbls":null,"sdmid":0,"dvcos":null,"Id":null,"CreatedOn":null,"UpdatedOn":null,"Deleted":false,"Version":null,"vsnn":null,"ExMsg":null,"ErrMsg":null,"SiteId":null,"MessengerType":0,"rs":0,"msng":null,"rtag":null,"msid":0,"msgui":null,"tags":{}}';     
    var obCMToken = $.parseJSON(cmTokenJson); 
    const currentDate = new Date();
    const timestamp = currentDate.getTime();
    var permPopUpAfterElapsedTime = 30; //30 minutes
     var Enums = {          
            rs: {
                None: -1,
                Unsuccessful: 0,
                Successful: 1,
                AlreadyExists: 2
            },
            dataserviceactions: {
                None: 0,
                sendInvite: 1                
            },
            ls:{               
               nbr_dvgui:'nbr_dvgui',
               nbr_tkgui:'nbr_tkgui',              
               nbr_tksnt:'nbr_tksnt',// nbr_ugui:'nbr_ugui'ugui is not reqd.              
               nbr_lusubs:'nbr_lusubs',//last user subscribed status. So this is the status oflast LoggedinUser
            },
            supportedBrowsers:{
               Chrome: 'Chrome',
               Firefox: 'Firefox',
               Safari: 'Safari',
               Opera: 'Opera',  
               Microsoft_Edge: 'Microsoft_Edge',
               Microsoft_Internet_Explorer: 'Microsoft_Internet_Explorer',  
           },
           supportedOS:{
               Windows: 'Windows',
               Android: 'Android',
               Mac_OS_X: 'Mac_OS_X',
               iOS: 'iOS',                
           },
        };
       

    $(document).ready(function () {  
       var nbr_ls = null;
       var obnbr_ls = null;
       nbr_ls = window.localStorage.getItem('nbr');
       if (nbr_ls != null) {           
           obnbr_ls = $.parseJSON(nbr_ls);
       }
       var transShield = $('#divModalSingleTransShield');
       var modaldiv = $('#divModalSingle');     
       var loadingimage= $('.divLoadingImage');
       firebase.initializeApp({
           apiKey: "AIzaSyAbuZPqbyQUvPK00jNjnerwEHP2vAUaJEU",
           authDomain: "umastro-39798.firebaseapp.com",
           databaseURL: "https://umastro-39798.firebaseio.com",
           projectId: "umastro-39798",
           storageBucket: "umastro-39798.appspot.com",
           messagingSenderId: "884361479586",
           appId: "1:884361479586:web:9a7488b3b5a17091ae5efb"
       });

       var messaging;
       var messagingdef = false;
        try {
            // Retrieve an instance of Firebase Messaging so that it can handle background
            // messages.
            messaging = firebase.messaging();
            messagingdef = true;
        }
        catch (err) {
            //alert("error in defining messaging");            
        }
        finally {

        }


        // Retrieve an instance of Firebase Messaging so that it can handle background messages.
        //const messaging = firebase.messaging();
        //alert(messaging);
       if (messagingdef) {
           messaging.onMessage((payload) => {
               console.log('Message received. ', payload);
               // Update the UI to include the received message.
               //appendMessage(payload);
           });
       }
        ManagePermissionPopUpDisplayOnLoad();
        function ManagePermissionPopUpDisplayOnLoad() {
            //if (!(wbpuserid == ""  || wbpuserid == "" || wbpuserid == "")) return;
            //alert("ManagePermissionPopUpDisplayOnLoad"  + wbpuserid);
            if (wbpuserid == null) return;
            if (wbpuserid == "") return;
    
            if (!("Notification" in window)) {
                //alert("This browser does not support desktop notification");            
                return;
            }   
            supportsNotification = true;

            
           
            $('.divWbPushNtPermissionContainer').hide();


            if (Notification.permission === "granted") {
              
                console.log("Notification.permission:" + Notification.permission);
                if (obnbr_ls == null){
                    RequestPermissionWhenAlreadyGranted();
                    return;
                }
               
                 if ((obnbr_ls.dvgui == null || obnbr_ls.dvgui == "") ||
                    (obnbr_ls.tkgui == null || obnbr_ls.tkgui == "") ||
                    (obnbr_ls.rugui == null || obnbr_ls.rugui == "") ||
                    (obnbr_ls.rusbs == null || !(obnbr_ls.rusbs == "0" || obnbr_ls.rusbs == "1")) ||
                     (obnbr_ls.rugui != wbpugui)) {
                    RequestPermissionWhenAlreadyGranted();
                    return;
                 }
                //is Not a Number
                 if (obnbr_ls.jsts == null || obnbr_ls.jsts == "" || isNaN(obnbr_ls.jsts)) {
                     RequestPermissionWhenAlreadyGranted();
                     return;
                 }
                
                 //alert("obnbr_ls.jtspop:" + obnbr_ls.jtspop);
                 //alert("timestamp:" + timestamp);
                 if (obnbr_ls != null && obnbr_ls.jtspop != null && obnbr_ls.jtspop != "" && obnbr_ls.jtspop > 0) {
                     if (timestamp - obnbr_ls.jtspop <= permPopUpAfterElapsedTime * 60 * 1000) {
                         $('.divWbPushNtPermissionContainer').hide();
                         return;
                     }
                 }
                 if (obnbr_ls.rusbs == "0") {
                     //$('.divWbPushNtPermissionContainer').show();
                     ShowWebPushPermissionContainer(true);
                 }
                //if ( (obnbr_ls.dvgui != null && obnbr_ls.dvgui != "") &&
                //    (obnbr_ls.tkgui != null && obnbr_ls.tkgui != "")) {
                //    if ((obnbr_ls.rugui == null || obnbr_ls.rugui == "")
                //    || (obnbr_ls.rusbs == null || (obnbr_ls.rusbs != "0" || obnbr_ls.rusbs != "1"))) {
                //        //ReadCurrentUserSubscribeStatus and UpdateinLocalDB. On Page Reload it will start functioning alright
                //       // alert("ReadCurrentUserSubscribeStatus");
                //         UpdateUserSubscribeStatus(true);
                //        return;
                //    }

                //    if (obnbr_ls.rugui != wbpugui) {
                //        //ReadCurrentUserSubscribeStatus and UpdateinLocalDB. On Page Reload it will start functioning alright
                //        UpdateUserSubscribeStatus(true);
                //        return;
                //    }
                //    if (obnbr_ls.rusbs == "0") $('.divWbPushNtPermissionContainer').show();
                //}                

            }
            else if (Notification.permission !== "denied" || Notification.permission === "default") {
                console.log("Notification.permission:" + Notification.permission);
                if (obnbr_ls != null && obnbr_ls.jtspop != null && obnbr_ls.jtspop != "" && obnbr_ls.jtspop > 0) {
                    if (timestamp - obnbr_ls.jtspop <= permPopUpAfterElapsedTime * 60 * 1000) {
                        $('.divWbPushNtPermissionContainer').hide();
                        return;
                    }
                }
                //$('.divWbPushNtPermissionContainer').show();
                ShowWebPushPermissionContainer(true);
            }
            else {
                console.log("Notification.permission:" + Notification.permission);
                //alert(Notification.permission);
                //denied
                //if (wbpshut == "2") { }
                    if (obnbr_ls != null && obnbr_ls.jtspop != null && obnbr_ls.jtspop != "" && obnbr_ls.jtspop > 0) {
                        if (timestamp - obnbr_ls.jtspop <= permPopUpAfterElapsedTime * 60 * 1000) {
                            $('.divWbPushNtPermissionContainer').hide();
                            return;
                        }
                    }
                    //$('.divWbPushNtPermissionContainer').show();
                    ShowWebPushPermissionContainer(true);
                
            }

        }

        function ShowWebPushPermissionContainer(show){
            if (!show) { $('.divWbPushNtPermissionContainer').hide; }
            if (show) {
                $('.divWbPushNtPermissionContainer').show();
                if (wbpshut == "2" || wbpshut == "Expert") {
                    $('.expertPermissionContent').show();
                    $('.clientPermissionContent').hide();
                }
                else {
                    $('.expertPermissionContent').hide();
                    $('.clientPermissionContent').show();
                }
                
            }
        }

        function RequestPermissionWhenAlreadyGranted() {
            //alert("onRequestPermission");
            Notification.requestPermission().then((permission) => {
                if (permission === 'granted') {
                     //alert("permission");
                    //modaldiv.show();
                    //transShield.show();
                    //loadingimage.show();
                    messaging.getToken({ vapidKey: 'BArnIi5IKVfv5S85FBdUiuY_p2AErTUO4CaHx2-GDdJjvqQBsiEV15WX5Aw0vTFm1mFMFOSWsom1n1Lmpf87NOw' }).then((currentToken) => {
                        if (currentToken) {
                            //alert("currentToken");
                            setTokenSentToServer(false);
                            SendTokenToWeb(currentToken);
                        } else {
                            //modaldiv.hide();
                            //transShield.hide();
                            //loadingimage.hide();
                            setTokenSentToServer(false);
                        }
                    }).catch((err) => {
                        //console.log('An error occurred while retrieving token. ', err);                       
                        setTokenSentToServer(false);
                        //modaldiv.hide();
                        //transShield.hide();
                        //loadingimage.hide();
                    });
                } else {
                    //console.log('Unable to get permission to notify.');
                }
            });

        }

        function setTokenSentToServer(sent) {
            if (sent == false && obnbr_ls != null) {
                obnbr_ls.tkgui = "";
                window.localStorage.setItem('nbr', JSON.stringify(obnbr_ls));
            }
        }
        function UpdateUserSubscribeStatus(subst) {
            return; //This procedure should not be called on this page.
           if (obnbr_ls==null) return; //please generate deviceandtoken   
                  
           if(obCMToken.ugui !== null && obCMToken.ugui !== '')
            {
                obCMToken.sbcrst=subst;
                if (obnbr_ls!=null  ){
                    obCMToken.obnbls=obnbr_ls;
                    if(obnbr_ls.dvgui!=null && obnbr_ls.dvgui!="") obCMToken.dvgui = obnbr_ls.dvgui;
                    else  obCMToken.dvgui = "";
                }
                 else {obCMToken.dvgui = "";}  

                var act="subscribestatus";
                SendDataToWebCM(obCMToken,'subscribestatus',subst);
            }
        }
        function SendTokenToWeb(currentToken) {
            //alert("SendTokenToWeb0");              
            obCMToken.tkn = currentToken;
            //alert("obCMToken.tkn:" + obCMToken.tkn);          
            if (obnbr_ls != null) {
                if (obnbr_ls.dvgui != null && obnbr_ls.dvgui != "") obCMToken.dvgui = obnbr_ls.dvgui;
                else obCMToken.dvgui = "";
            }
            else { obCMToken.dvgui = ""; }
          
            obCMToken.sbcrst=true;
            obCMToken.jscd.os = jscd.os;
            obCMToken.jscd.osv = jscd.osVersion;
            obCMToken.jscd.brw = jscd.browser;
            obCMToken.jscd.bmv = jscd.browserMajorVersion;
            obCMToken.jscd.brv = jscd.browserVersion;
            obCMToken.jscd.mbl = jscd.mobile;
            obCMToken.jscd.flv = jscd.flashVersion;
            obCMToken.jscd.ck = jscd.cookies;
            obCMToken.jscd.ssz = jscd.screen;
            obCMToken.jscd.uag = navigator.userAgent;
            SendDataToWebCM(obCMToken, 'token', '');
        }
        function SendDataToWebCM(inobCMToken, tag, tag2) {
            try {
                //alert("SendDataToWebCM: Entered");           
                var url = "/my-expertzone/notificationmanager/wbNotificationManager.aspx/SendData";

                var retobj = null;
                var regData = {
                    obdata: {
                        data: JSON.stringify(inobCMToken),
                        tag: tag
                    }
                };
                $.ajax({
                    type: 'POST',
                    url: url,
                    data: JSON.stringify(regData),
                    dataType: 'json',
                    contentType: "application/json; charset=utf-8",
                    success: function (r) {
                        // alert(r);
                        // alert(r.d);
                        retobj = JSON.parse(r.d);
                        //alert(retobj.rs);
                        if (retobj.rs == Enums.rs.Successful) {
                            //alert("success");
                            if (tag == "subscribestatus") {
                                
                               //if (tag2 == false) $(".chkSwitch").attr("checked", false);
                              //  else if (tag2 == true) $(".chkSwitch").attr("checked", true);
                               
                            }
                            if (tag == "token") {
                                //$(".chkSwitch").attr("checked", true);
                                // $(".lblSwitch").click();
                                // setTokenSentToServer(true);
                                // window.localStorage.setItem('brwTkn', currentToken);
                                // window.localStorage.setItem(Enums.ls.nbr_dvgui, retobj.Data);
                                window.localStorage.setItem("nbr", retobj.Data);
                                nbr_ls = retobj.Data;
                                obnbr_ls = $.parseJSON(nbr_ls);
                            }



                        }
                        else {
                            //alert("unsuccess");
                            if (tag == "subscribestatus") {
                               // if (tag2 == false) $(".chkSwitch").attr("checked", true);
                               // else if (tag2 == true) $(".chkSwitch").attr("checked", false);
                                
                            }
                            if (tag == "token") {
                            }

                        }

                    },
                    error: function (xhr, textStatus, errorThrown) {
                        //alert("error");               
                        retobj = null;

                    }

                });

            } catch (err) {

            }
            finally {
                //if (IsSessionEnded)SendDataToWeb(sro,"isratingreqd");
                //modaldiv.hide();
                //transShield.hide();
                //loadingimage.hide();
            }
        }
        
       
       
      

    });
</script>


             

<style>
    .divUcInstallPwa {
        position: fixed;
       /* top: 0;*/ /*left:25%;*/
         /*transform: translate(-50% , 0);*/
       /* width: 100%;*/
       /* background-color: rgba(200,200,200,1);*/
         background-color: transparent;
       /* z-index: 10;*/
        font-family: Verdana, Geneva, Tahoma, sans-serif;
        color: #000000;
        border-top: 1px solid rgba(0,0,0,0.2); border:1px solid rgba(0,0,0,0.1);
        left: 50%; min-width:250px; max-width:450px;
    top: 0%;
    transform: translateX(-50%); display:none;
    }
    .divUcInstallPwa .divUcInstallPwaSub, .divViewInPwa{   
            position:relative;        
            text-align: left;
            background-color: rgb(255, 255, 255); /*left:50%;*/
           /* max-width: 80%;*/
           /* transform: translate(-50% , 0);*/
           /* border-top: 1px solid rgba(0,0,0,0.2);
            border-radius: 10px;*/
            padding: 10px; /*overflow:hidden; display:inline-block;*/
     }
   .divUcInstallPwa input[type=button]{border-radius: 4px;  text-align:center;   float:right; 
    font-size: 14px;
    font-weight: normal;
    color: #fff !important;
    text-shadow: none;
    /*width: 100%;*/
    display: block;
    padding: 5px 8px;}

   .divUcInstallPwa .aOpenPwaAndroid{
       /*background: #ffffff !important;*/
       background: #b420b3 ; color:white;
   /* border: 1px solid #b420b3 !important;*/
     border: 1px solid #b420b3 ; font-size:0.9em;
   /* color: #b420b3 !important;*/
    font-weight: normal !important;  padding:10px;
    padding-top: 5px !important;
    padding-bottom: 5px !important; border-radius:3px; text-decoration:none;
   }

    .SiteThemeMz .divUcInstallPwa .aOpenPwaAndroid {
         background: #0026ff; color:white;
          border: 1px solid #0026ff ;
    }

</style>

    <div id="divUcInstallPwa" class="divUcInstallPwa">
        <div id="divUcInstallPwaSub" class="divUcInstallPwaSub" style="font-size:0.9em;">
            For receiving Session Requests (Chat/Phone Requests) from clients, install "Manyzone Lite" web app.
        <div style="clear: both; padding-top:10px;"></div>
            <input id="btnInstallPwa" type="button" class="btnInstallPwa" style="cursor: pointer;" value="Install Manyzone Lite" />
            <div style="clear: both;"></div>
        </div>
        <div id="divViewInPwa" class="divViewInPwa" style="display:none;"> 
            You can view this page in webapp "Umastro Lite"
            <div style="clear: both; padding-top:10px;"></div>
            <div style="text-align:right; "><a id="aOpenPwaAndroid" class="aOpenPwaAndroid" href='https://www.umastro.com' target='_blank'>Open Umastro Lite</a></div>
            <div style="clear: both; padding-top:7px;"></div>
        </div>
       
    </div>
<script>
    //var pwamanifesturl = "https://expert.manyzone.com/manifest.json";
    var pwamanifesturl = "";
    //var webapiurl = "http://localhost/mnwebapin";
    //var webapiurl = "https://ptr.wpi.manyzone.com";
    var webapiurl = "https://wpi.manyzone.com";
    let deferredPrompt;
    var isDeferredPromptUsed = false;
    //let deferredPromptA;
    var specificUserUsage = false;
    var userids = ["80644", "81254", "111618"];
    //var uid = document.getElementById("hdUserId").value;
    //var ut = document.getElementById("hdUserType").value;
    //var sname = document.getElementById("hdScreenName").value;
    var uid = '';
    var ut = '';
    var sname = '';
    //var nbr_ls = "";
    var expStatusId = "";
    console.log(window.jscd);
    window.addEventListener('load', function () {
        var siteid =1;
        //var utlocal = document.getElementById("hdUserType").value;
        //ut = utlocal;
        if (siteid == "1") {
            specificUserUsage = true; //coz icons are still not there. Also Check the button colors
        }
        nbr_ls = window.localStorage.getItem('nbr');
        window.addEventListener('beforeinstallprompt', (e) => {
            console.log("beforeinstallprompt1");
           //https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent
            // Only when PWA is not installed, the event beforeinstallprompt will be raised
            // Prevent Chrome 67 and earlier from automatically showing the prompt
            e.preventDefault();
            /*if (isDeferredPromptInitiated == true) return;*/
            // Stash the event so it can be triggered later.
            deferredPrompt = e;
           /* isDeferredPromptInitiated = true;*/
            //deferredPromptA = e;
            console.log("beforeinstallprompt");
            window.localStorage.removeItem("pwai");//This means PWA is not installed. Only then beforeinstallprompt will be raised
           // var ele = document.getElementById('btnInstallApp');
            var ele = document.getElementById('divUcInstallPwa');  
            if (ele == undefined || ele == null) {

            }
            else {
                if (specificUserUsage) {
                    if (userids.includes(uid)) {
                        console.log("User Exists in array");
                        //document.getElementById('btnInstallApp').style.display = "block";
                        document.getElementById('divUcInstallPwa').style.display = "block";
                    }
                }
                else {
                    if ((ut == "2" || ut == "Expert") && (expStatusId=="1")) {
                        console.log("ut is 2");
                        //document.getElementById('btnInstallApp').style.display = "block";
                        document.getElementById('divUcInstallPwa').style.display = "block";
                    }
                   
                }
            }
            if (specificUserUsage) {
                if (userids.includes(uid)) {
                   UpdatePWAInstallStatus("notinstalled");
                }
            }
            else {
                UpdatePWAInstallStatus("notinstalled");
            }

        });
    });

    async function UpdatePWAInstallStatusTest(strAppInstalled) {

    }

    async function UpdatePWAInstallStatus(strAppInstalled) {
        if (strAppInstalled == undefined) strAppInstalled = "";
        if (strAppInstalled == null) strAppInstalled = "";
        //if  value is changed in ls for IsPWAExist
        //As this is device centric, we have to do it on page load 
        console.log("UpdatePWAInstallStatus");
        var nbr_ls = window.localStorage.getItem('nbr');
        if (!Is_Nbr_Ls_OK(nbr_ls)) {
            console.log("nbr_ls is not ok");
            return;
        }

        //if (nbr_ls == undefined || nbr_ls == null || nbr_ls == "") {
        //    console.log("nbr_ls is null");
        //    return;
        //}
        //console.log("nbr_ls is not null");

        console.log("nbr_ls is OK");
        var obnbr_ls = null;
        obnbr_ls = JSON.parse(nbr_ls);

        //var isPwaAppInstalled = false;
        //var displayMode = GetPWADisplayMode();
        //var isPWAExist = false;
        //if (displayMode == "standalone") {
        //    isPwaAppInstalled = true;        
        //}
        //console.log("isPWAExist:" + isPWAExist);

        var isPwaAppInstalled = false;
        var displayMode = GetPWADisplayMode();
        if (strAppInstalled == "installed") isPwaAppInstalled = true;
        else if (strAppInstalled == "notinstalled") isPwaAppInstalled = false;
        else {
            
            if (displayMode == "standalone") {
                isPwaAppInstalled = true;
            }
            else {
                var strRet = await IsAppInstalledByNavigator("webapp", pwamanifesturl, "");
                console.log("strRet: " + strRet.toString());
                var tostringRet = strRet.toString().toLowerCase();
                console.log("tostringRet: " + tostringRet);

                if (strRet.toString() == "NotSupported") {
                    return;
                }
                else {
                    isPwaAppInstalled = (strRet.toString().toLowerCase() == 'true');
                }
            }
        }
        console.log("Start Reading pwa_ls");
        var pwa_ls = window.localStorage.getItem('pwai');
        if (pwa_ls !== undefined && pwa_ls !== null) {
            if (!Is_Pwa_Ls_OK(pwa_ls)) {
                console.log("Pwa_ls is not ok");
                window.localStorage.removeItem('pwai');
                pwa_ls = null;
            }
        }
      
        var newobpwa_ls = new Object();
        var oldobpwa_ls = null;

        if (pwa_ls == undefined || pwa_ls == null || pwa_ls == "") {
            console.log("pwa_ls is null");
            oldobpwa_ls = null;
            newobpwa_ls.ipwi = isPwaAppInstalled;
            newobpwa_ls.dvgui = obnbr_ls.dvgui;
            newobpwa_ls.ugui = obnbr_ls.rugui;
            newobpwa_ls.ui = obnbr_ls.rui;
            if (displayMode == "standalone") {
                newobpwa_ls.ipwo = "1";
                newobpwa_ls.pwouonl = 0; 
                //newobpwa_ls.pwoistd = "1";
            }
            else {
            //NO need to do anything is not in standalone mode
                newobpwa_ls.ipwo = "0";
                newobpwa_ls.pwouonl = 0;                
            }
            newobpwa_ls.pwodtyp = "1";
            //go ahead for webapi
        }
        else {
            console.log("pwa_ls is not null");
            oldobpwa_ls = JSON.parse(pwa_ls);
            newobpwa_ls.ipwi = isPwaAppInstalled;
            newobpwa_ls.dvgui = obnbr_ls.dvgui;
            newobpwa_ls.ugui = obnbr_ls.rugui;
            newobpwa_ls.ui = obnbr_ls.rui;
           // newobpwa_ls.ipwo = oldobpwa_ls.ipwo;
            if (displayMode == "standalone") {
                newobpwa_ls.pwodtyp = "1";
                newobpwa_ls.ipwo = "1";
                //newobpwa_ls.pwoistd = "1";
                //var now = new Date();
                //var nowTS = now.getTime();
                //newobpwa_ls.pwouonl = nowTS;
                if (oldobpwa_ls.pwouonl == undefined || oldobpwa_ls.pwouonl == null) {
                    newobpwa_ls.pwouonl = 0;
                }
                else {
                    if (oldobpwa_ls.ipwo == newobpwa_ls.ipwo) {
                        newobpwa_ls.pwouonl = oldobpwa_ls.pwouonl;
                    }
                    else { newobpwa_ls.pwouonl = 0; }                   
                }
            }
            else {
                if (isPwaAppInstalled == true) {
                    if (oldobpwa_ls.ipwo == undefined || oldobpwa_ls.ipwo == null ) {
                        newobpwa_ls.ipwo = "0";
                        newobpwa_ls.pwouonl = 0;
                        newobpwa_ls.pwodtyp = "1";
                    }
                    else {
                        if (oldobpwa_ls.ipwo == "") oldobpwa_ls.ipwo = "0";
                        newobpwa_ls.ipwo = oldobpwa_ls.ipwo;
                        newobpwa_ls.pwodtyp = "2";
                        if (oldobpwa_ls.pwouonl == undefined || oldobpwa_ls.pwouonl == null) {
                            newobpwa_ls.pwouonl = 0;
                        }
                        else { newobpwa_ls.pwouonl = oldobpwa_ls.pwouonl; }

                    }
                }
                else {
                    newobpwa_ls.ipwo = "0";
                    newobpwa_ls.pwouonl = 0;   
                    newobpwa_ls.pwodtyp = "1";
                }
                //NO need to do anything is not in standalone mode
                //if (oldobpwa_ls.ipwo == undefined || oldobpwa_ls.ipwo==null) {
                //    newobpwa_ls.ipwo = "";
                //    newobpwa_ls.pwouonl = 0;     
                //}
                //else {
                //    newobpwa_ls.ipwo = oldobpwa_ls.ipwo;
                //    if (oldobpwa_ls.pwouonl == undefined || oldobpwa_ls.pwouonl == null) {
                //        newobpwa_ls.pwouonl = 0;
                //    }
                //    else newobpwa_ls.pwouonl = oldobpwa_ls.pwouonl;
                //    //newobpwa_ls.pwouonl = oldobpwa_ls.pwouonl;
                //}
                
            }
            var checkForPWO = false;
            if (oldobpwa_ls.ipwi == newobpwa_ls.ipwi)//if installed status has not changed then check if the elpsed time is more than 24 hours
            {
                var now = new Date();
                var nowTS = now.getTime();
                var diff = Math.abs(nowTS - oldobpwa_ls.pwiuonl);
                if (diff > 2 * 24 * 60 * 60 * 1000) {//if checkedon is more than 24 hours, then uodate it again
                    //go ahead for webapi
                }
                else {
                    checkForPWO = true;
                    //var goahead = false;
                    //if (displayMode == "standalone") {
                    //    if (newobpwa_ls.ipwo == "1") {
                    //        var ndiff = Math.abs(nowTS - newobpwa_ls.pwouonl);
                    //        if (ndiff > 2 * 24 * 60 * 60 * 1000) {//if checkedon is more than 24 hours, then uodate it again
                    //            //go ahead for webapi
                    //            goahead = true;
                    //        }
                    //    }
                    //}    
                    //if (!goahead) return;                    
                }
            }
            else {
                //go ahead for updation through webapi
            }
            if (checkForPWO == true) {
                if (oldobpwa_ls.ipwo == undefined || oldobpwa_ls.ipwo == null) oldobpwa_ls.ipwo = "";
                
                if (oldobpwa_ls.ipwo == newobpwa_ls.ipwo)//if installed status has not changed then check if the elpsed time is more than 24 hours
                {
                    var now = new Date();
                    var nowTS = now.getTime();
                    var diff = Math.abs(nowTS - oldobpwa_ls.pwouonl);
                    if (diff > 1 * 24 * 60 * 60 * 1000) {//if checkedon is more than 24 hours, then uodate it again
                        //go ahead for webapi
                    }
                    else {
                        return;
                    }
                }
                else {
                    //go ahead;
                }
            }
        }



        var obdata = new Object();
        obdata.data = JSON.stringify(newobpwa_ls);
        console.log("obdata.data:" + obdata.data);
        console.log("obdata.data:" + JSON.stringify(obdata));

        var tmpurl = webapiurl + "/pwa/existence/update/j";
        console.log(tmpurl);
        /*return;*/
        fetch(tmpurl,
            {
                method: "POST",
                headers: {
                    'Accept': 'application/json',
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify(obdata)
            })
            .then(function (response) {
                return response.json();
            })
            .then(function (result) {
                console.log(result);
                if (result == "True") {
                    var now = new Date();
                    var nowTS = now.getTime();
                    newobpwa_ls.pwiuonl = nowTS;
                    //if (displayMode == "standalone") {
                        
                    //}
                    newobpwa_ls.pwouonl = nowTS;
                    window.localStorage.setItem("pwai", JSON.stringify(newobpwa_ls));
                }
            })
            .catch(function (error) {
                console.log(error);
            });

    }
   
    function Is_Nbr_Ls_OK(nbrls_child) {
        //console.log("IsTokenRegenerationReqd: nbrls_child:" + nbrls_child);
       
        console.log("IsNBRLSOK");
        /*var nbrls_child = nbr_ls;*/
        if (nbrls_child == undefined || nbrls_child == null || nbrls_child == "") return false;
        var obnbrls_child = JSON.parse(nbrls_child);
        if ((obnbrls_child.dvgui == null || obnbrls_child.dvgui == "") ||
            (obnbrls_child.tkgui == null || obnbrls_child.tkgui == "") ||
            (obnbrls_child.rugui == null || obnbrls_child.rugui == "") ||
            (obnbrls_child.rusbs == null || !(obnbrls_child.rusbs == "0" || obnbrls_child.rusbs == "1")) ||
            (obnbrls_child.rugui != wbpugui)) {
            return false;
        }
        //is Not a Number
        if (obnbrls_child.jsts == null || obnbrls_child.jsts == "" || isNaN(obnbrls_child.jsts)) {
            return false;
        }

        if (obnbrls_child.rusbs == "0") {
            return false;
        }
        var ckname = "msgr"
        if (obnbrls_child.idbau != "1") {
            if (getCookie(ckname) != undefined && getCookie(ckname) != null && getCookie(ckname) != "") {
                console.log("msngrid exists but not updated in db");
                return false;
            }
        }
        return true;
    }
    function Is_Pwa_Ls_OK(pwals) {
        //console.log("IsTokenRegenerationReqd: nbrls_child:" + nbrls_child);

        console.log("Is_Pwa_Ls_OK");
        /*var nbrls_child = nbr_ls;*/
        if (pwals == undefined || pwals == null || pwals == "") return false;
        var obpwals = JSON.parse(pwals);
        if ((obpwals.dvgui == null || obpwals.dvgui == "") ||
            (obpwals.ugui == null || obpwals.ugui == "") ||           
            (obpwals.ugui != wbpugui)) {
            return false;
        }
        
        return true;
    }

    function getCookie(cname) {
        let name = cname + "=";
        let decodedCookie = decodeURIComponent(document.cookie);
        let ca = decodedCookie.split(';');
        for (let i = 0; i < ca.length; i++) {
            let c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1);
            }
            if (c.indexOf(name) == 0) {
                return c.substring(name.length, c.length);
            }
        }
        return "";
    }


    function GetPWADisplayMode() {
        // Check if device supports service workers
        if (!('serviceWorker' in window.navigator)) return 'nosupport';
        // Check for Android
        const isStandalone = window.matchMedia('(display-mode: standalone)').matches;
        if (document.referrer.startsWith('android-app://')) {
            return 'twa';
        } else if (navigator.standalone || isStandalone) {
            //navigator.standalone  is for IOS
            return 'standalone';
        }
        return 'browser';
    }


   
    async function IsAppInstalledOld(platform, url, id) {
        if ("getInstalledRelatedApps" in navigator) {
            //will work only on  Android
            //https://web.dev/get-installed-related-apps/
            if (!gAndroid) {
                console.log("Is PWA App installed not supported on this browser");
                return "NotSupported";
            }
            const relatedApps = await navigator.getInstalledRelatedApps();

            //const fun = navigator['getInstalledRelatedApps'];
            //const relatedApps = await fun.call(navigator);


            /*alert(relatedApps);*/
            //console.log(relatedApps);
            //if (relatedApps.length == 0) {
            //    console.log("PWA App Not installed");
            //}
            //else {
            //    console.log("PWA App Already installed");
            //    //alert("PWA App Already installed")
            //}
            relatedApps.forEach((app) => {
                console.log(app.id, app.platform, app.url);
                if (app.platform == platform) {
                    if (app.url == url || app.id == id) {
                        return "True";
                    }
                }
            });
            return "False";
        }
        else {
            return "NotSupported";
        }
    } 



    document.addEventListener("DOMContentLoaded", HandleVisibilityOfInstallAppButtonOnLoad);

    async function HandleVisibilityOfInstallAppButtonOnLoad() {
      
        var appInstallStatus = await ReturnAppInstallStatus();
        if (appInstallStatus == 1) {
            console.log("PWA app is installed on page load");
            //document.getElementById('btnInstallApp').style.display = "none";
            //var ele = document.getElementById('btnInstallApp');
            //if (ele == undefined || ele == null) {

            //}
            //else {
            //    document.getElementById('btnInstallApp').style.display = "none";
            //}
            var showopenpwaatload = true;
            if (showopenpwaatload) {
                if (GetPWADisplayMode() == "standalone") {
                    document.getElementById('divUcInstallPwa').style.display = "none";                }
                else {
                    var askToOpenPwa = true;
                    var pwa_ls = window.localStorage.getItem('pwai');
                    if (pwa_ls !== undefined && pwa_ls !== null) {
                        var obpwa_ls = JSON.parse(pwa_ls);
                        if (obpwa_ls.ipwo !== undefined && obpwa_ls.ipwo !== null) {
                            if (obpwa_ls.ipwo == "1") {                       
                                
                                if (obpwa_ls.pwouonl !== undefined && obpwa_ls.pwouonl !== null) {
                                    var now = new Date();
                                    var nowTS = now.getTime();
                                    var diff = Math.abs(nowTS - obpwa_ls.pwouonl);
                                    if (diff < 2 * 24 * 60 * 60 * 1000) {//if checkedon is more than 24 hours, then uodate it again
                                        askToOpenPwa = false;
                                    }                                    
                                }
                                
                            }
                        }
                    }                   
                    if (askToOpenPwa) {
                        document.getElementById('divUcInstallPwa').style.display = "block";
                        document.getElementById('divUcInstallPwaSub').style.display = "none";
                        document.getElementById('divViewInPwa').style.display = "block";
                    }                     
                }               
            }
            else {
                document.getElementById('divUcInstallPwa').style.display = "none";
            }
            //document.getElementById('divUcInstallPwa').style.display = "none";

            //installApp.style.visibility = 'hidden';
            //if (GetPWADisplayMode() == "browser") {
            //    window.open("/wbap/index.html", "_blank");//don't do this as it will go in loop if new tab opens up in browser
            //}
            UpdatePWAInstallStatus("installed");
        }
        else if (appInstallStatus == 2) {
            console.log("PWA app is not installed on page load");
            //if (!gAndroid) {
            //    console.log("Is PWA App installed not supported on this browser");
            //    return "NotSupported";
            //}
           /* document.getElementById('divUcInstallPwa').style.display = "block";*/
            if (specificUserUsage) {
                if (userids.includes(uid)) {
                    console.log("User Exists in array");
                    //document.getElementById('btnInstallApp').style.display = "block";
                    document.getElementById('divUcInstallPwa').style.display = "block";
                }
            }
            else {
                //document.getElementById('btnInstallApp').style.display = "block";
                if ((ut == "2" || ut == "Expert") && (expStatusId == "1")) {
                    document.getElementById('divUcInstallPwa').style.display = "block";
                }               
            }
            UpdatePWAInstallStatus("notinstalled");
        }
        else if (appInstallStatus == 3) {
            console.log("PWA app install status is not supported  on page load");
            UpdatePWAInstallStatus("");

        }
        else if (appInstallStatus == 0) {
            console.log("PWA app install status on page load Error");
            UpdatePWAInstallStatus("");
        }
    }

    async function ReturnAppInstallStatus() {
        var appInstallStatus = 0;//0 - None;1-Installed,2-NotInstalled,3-NotKnown
        var isPwaAppInstalled = false;

        var strRet = await IsAppInstalledByNavigator("webapp", pwamanifesturl, "");//This works only on adndroid    
        console.log("ReturnAppInstallStatus Data: " + strRet.toString());
        if (strRet.toString() == "NotSupported") {
            //Go Ahead to find out
        }
        else {
            if (strRet.toString().toLowerCase() == 'true') { return 1; }
            if (strRet.toString().toLowerCase() == 'false') { return 2; }
            else {
                //go ahead;
            }
            //if (isPwaAppInstalled) return 1;
            //else return 2;
        }
        if (isPwaAppInstalled == false) {
            if (GetPWADisplayMode() == "standalone") {
                isPwaAppInstalled = true;
                return 1;
            }
        }
        if (isPwaAppInstalled == false) {
            //sometimes beforeinstallprompt event is not getting raised. So we can not infer from the deferred prompt if App is installed. 
            var useDeferredPrompt = false;
            if (useDeferredPrompt) {
                if (deferredPrompt == undefined || deferredPrompt == null) {
                    isPwaAppInstalled = true;
                    return 1;
                }
            }
           
        }
        return 3;
    }

    //IsAppInstalledByNavigator("webapp", pwamanifesturl, "");
    async function IsAppInstalledByNavigator(platform, url, id) {
        console.log("IsAppInstalledByNavigator");
        console.log("IsAppInstalledByNavigator platform:" + platform);
        console.log("IsAppInstalledByNavigator url:" + url);
        if ("getInstalledRelatedApps" in navigator) {
            console.log("IsAppInstalledByNavigatorA");
            //will work only on  Android
            //https://web.dev/get-installed-related-apps/
            if (!gAndroid) {
                console.log("Is PWA App installed not supported on this browser");
                //checked on windows chrome, related apps length is always zero even when pwa is installed. So use it only for android
                return "NotSupported";
            }
            const relatedApps = await navigator.getInstalledRelatedApps();

            //const fun = navigator['getInstalledRelatedApps'];
            //const relatedApps = await fun.call(navigator);


            /*alert(relatedApps);*/
            //console.log(relatedApps);

            if (relatedApps.length == 0) {
                console.log("relatedApps.length is zero");
            }
            else {
                console.log("relatedApps.length is not zero" + relatedApps.length);
                //alert("PWA App Already installed")
            }
            var isappexist = false;
           // var matchOnlyWebAppPlatform = true;
            relatedApps.forEach((app) => {
                console.log(app.id, app.platform, app.url);
                if (app.platform == platform) {
                    if (app.url == url || app.id == id) {
                        isappexist = true;
                        console.log("app platform  and url match:" + isappexist)
                        return "True";//this is not returning value
                    }
                }
            });
            if (isappexist == false) return "False";
            else if (isappexist == true) return "True";

        }
        else {
            return "NotSupported";
        }
    }


</script>
<script>
    document.getElementById('btnInstallPwa').addEventListener("click", OnInstallPwaAppClick);
    async function OnInstallPwaAppClick() {
        if (GetPWADisplayMode() == "standalone") {
            console.log("GetPWADisplayMode:standalone");
            document.getElementById('divUcInstallPwa').style.display = "none";
            return;
        }
        var appInstallStatus = await ReturnAppInstallStatus();
        if (appInstallStatus == 1) {
            console.log("PWA app is installed on button click");           
            document.getElementById('divUcInstallPwa').style.display = "none";
            return;
            //alert("App is already installed");
            //No need to open PWA on android. Clicking on anchor will ask user to selected from related apps. So no use.
            //Or we should remove deep linking with normal urls of umastro. Then OS will ask t select between Chrome and UmastroLite which seems OK
            if (gAndroid) {
                document.getElementById("aOpenPwaAndroid").click();
            }          
            return;
        }
        if (deferredPrompt == undefined || deferredPrompt == null) {
            console.log("deferredPrompt is  null");
            if (gAndroid) {
                alert("Press the 'three dot' icon in the upper right to open the menu. Select 'Install App' to install ");
            }
            else {
                alert("Please reload the page");
            }
            
            
        }
        else {
            console.log("deferredPrompt is not null");
            if (isDeferredPromptUsed == true) {
                //PWa is already instaled
                //document.getElementById("aOpenPwa").click();
                //return;
                //console.log("deferredPrompt is not  null and isDeferredPromptUsed=true");
                //alert("Press the 'three dot' icon in the upper right to open the menu. Select 'Install App' to install ");
                if (gAndroid) {
                    alert("Press the 'three dot' icon in the upper right to open the menu. Select 'Install App' to install ");
                }
                else {
                    /*alert("Please reload the page");*/
                    alert("Press the 'three dot' icon in the upper right to open the menu. Select 'Install App' to install ");
                }
            }
            else {
               /* installApp();*/


                console.log("installApp");
                isDeferredPromptUsed = true;
                // Show the prompt
                deferredPrompt.prompt();
                //installButton.disabled = true;
                /*document.getElementById('divUcInstallPwa').style.display = "none";*/

                // Wait for the user to respond to the prompt
                deferredPrompt.userChoice.then(choiceResult => {
                    if (choiceResult.outcome === "accepted") {
                        console.log("PWA setup accepted");
                        /*installButton.hidden = true;*/
                        //document.getElementById('divUcInstallPwa').style.display = "none";
                        document.getElementById('divUcInstallPwa').style.display = "none";
                    } else {
                        console.log("PWA setup rejected");
                        document.getElementById('divUcInstallPwa').style.display = "block";
                    }
                    /*installButton.disabled = false;*/
                    deferredPrompt = null;
                });
            }
          
            //return;
            //console.log("deferredPrompt is not null");
            //document.getElementById('divUcInstallPwa').style.display = "none";
            //deferredPrompt.prompt();
            //const { outcome } = await deferredPrompt.userChoice;
            //console.log("outcome:" + outcome);
            //if (outcome === 'accepted') {
            //    deferredPrompt = null;
            //    //installed = true;
            //    console.log("deferredPrompt.userChoice is  accepted");
            //    //installApp.style.visibility = 'hidden';
            //    /*document.getElementById('divUcInstallPwa').style.display = "none";*/
            //    UpdatePWAInstallStatus("installed");
            //}
            //else{
            //    deferredPrompt = null;
            //}
        }
    }

    async function installApp() {
        console.log("installApp");
        isDeferredPromptUsed = true;
        // Show the prompt
        deferredPrompt.prompt();
        //installButton.disabled = true;
        document.getElementById('divUcInstallPwa').style.display = "none";

        // Wait for the user to respond to the prompt
        deferredPrompt.userChoice.then(choiceResult => {
            if (choiceResult.outcome === "accepted") {
                console.log("PWA setup accepted");
                /*installButton.hidden = true;*/
                //document.getElementById('divUcInstallPwa').style.display = "none";
            } else {
                console.log("PWA setup rejected");
                document.getElementById('divUcInstallPwa').style.display = "block";
            }
            /*installButton.disabled = false;*/
            deferredPrompt = null;
        });
    }
    window.addEventListener('appinstalled', function (e) {
        console.log('onappinstalled', e)
        //localStorage.setItem('APP_INSTALLED', '1')
        console.log("Event - appinstalled");
        //As app is still not installed and clicking on Open PWA link does not show umastro lite . Donot show Open PWA.
        //WE can show open PWA after some time or next page refresh/load
        var showopenpwaatappinstaled = false;
        if (showopenpwaatappinstaled) {
            document.getElementById('divUcInstallPwa').style.display = "block";
            document.getElementById('divUcInstallPwaSub').style.display = "none";
            document.getElementById('divViewInPwa').style.display = "block";
        }
        else {
            document.getElementById('divUcInstallPwa').style.display = "none";
        }
        
       
       
        
        UpdatePWAInstallStatus("installed");
    })
    document.getElementById("aOpenPwaAndroid").addEventListener('click', function (e) {
        e.stopPropagation();
        var link = document.getElementById("aOpenPwaAndroid");
        link.setAttribute("href", window.location.href);
        return false;
        
    })

    //document.getElementById("myLink").onclick = function () {
    //    var link = document.getElementById("abc");
    //    link.setAttribute("href", "xyz.php");
    //    return false;
    //}
    
</script>
<script>
    window.addEventListener('load', function () {
        console.log("noBackExitsApp: load");
        /*return;*/
        if (gAndroid) {
            if (GetPWADisplayMode() == "standalone") {
                var href = window.location.href;
                var newhref = href;
                if (href.indexOf("?") > -1) {
                    newhref = href.split('?')[0];
                }

                var baseurl = base_url();
                var baseurls = [baseurl, baseurl + "/", baseurl + "/m", baseurl + "/m/", baseurl + "/index.aspx", baseurl + "/m/index.aspx"];
                //if (newhref == base_url || newhref == base_url + "/" || newhref == base_url + "/m" ||  newhref == base_url + "/m/")
                if (baseurls.includes(newhref)) {
                    console.log("Base URL");
                    window.history.pushState({ noBackExitsApp: true }, '');
                }
            }      
        }       
       
    })

    function base_url() {
        var pathparts = location.pathname.split('/');
        if (location.host == 'localhost') {
            var url = location.origin + '/' + pathparts[1].trim('/') + '/'; // http://localhost/myproject/
        } else {
            var url = location.origin; // http://stackoverflow.com
        }
        return url;
    }

    //window.addEventListener('popstate', function (event) {
    //    return;
    //    console.log("event.state:" + event.state);
    //    /*console.log("event.state.noBackExitsApp:" + event.state.noBackExitsApp);*/
    //    //if (event.state && event.state.noBackExitsApp) {
    //    //    window.history.pushState({ noBackExitsApp: true }, '')
    //    //}
    //    if (event.state != null) {
    //        console.log('event.state.noBackExitsApp:' + event.state.noBackExitsApp);
    //        if (event.state[2] === undefined || event.state[2] === null) {
    //            if (event.state.noBackExitsApp) {
    //                //alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //                if (GetPWADisplayMode() == "standalone") {
    //                    alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //                    window.history.pushState({ noBackExitsApp: true }, '');
    //                }                   
    //            }
    //        }
    //        else {
    //            //if (event.state.noBackExitsApp) {
    //            //    //alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //            //    if (GetPWADisplayMode() == "standalone") {
    //            //        window.history.pushState({ noBackExitsApp: true }, '');
    //            //    }
    //            //}

    //        }

    //        //if (GetPWADisplayMode() == "standalone") {
    //        //    if (event.state.noBackExitsApp) {
    //        //        //alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //        //        window.history.pushState({ noBackExitsApp: true }, '');
    //        //    }
    //        //}           
    //    }
    //    else {
    //       /* window.history.pushState({ noBackExitsApp: true }, '');*/
    //        if (GetPWADisplayMode() == "standalone") {
    //            //if (event.state.noBackExitsApp) {
    //            //    alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //            //    window.history.pushState({ noBackExitsApp: true }, '')
    //            //}
    //            alert("Notifications will stop woking properly if you close the app. Do you want to close the app? ");
    //            window.history.pushState({ noBackExitsApp: true }, '');
    //        }
    //    }
    //})
</script>


       <div>
           <audio id="notification" src="/messaging/sessreqring.mp3"  muted ></audio>
       </div>

        
      
      
        <div>
<style type="text/css" >/*title="sessionRequestNotification"*/
         div.ucInvReqUI{text-align: center;
    /*position: absolute;*/ position:fixed;width:80%; max-width:500px;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -120%);
    /*width: 80%; max-width:600px;*/
    /* width: 100%; */
    /*height: 110px;*/
    /* height: 100%; */
    /*background-color: rgb(255, 255, 255); background-color:#aa59aa ; */
    background-color:#eef3f8;  background-color:white;box-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 10px; /*border:1px solid aqua;*/
    /*overflow: auto;*/ display:none;}

              @media (max-width: 500px) {
      div.ucInvReqUI{width:90%; }
        }    
      
       div.ucInvReqUI div.sessionRequestNotification{ text-align: center;
    /*position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -120%);*/
    /*width: 80%; max-width:600px;*/
    /* width: 100%; */
    /*height: 110px;*/
    /* height: 100%; */
    /*background-color: rgb(200, 200, 200);*/
    border-radius: 8px;
    padding: 10px; width:100%;
    /*overflow: auto;*/ 
        }
        
       div.ucInvReqUI div.sessionRequestNotification .divA,.divB,.divC{float:left;}
       div.ucInvReqUI  div.sessionRequestNotification .divB { width: 60%; padding-left:20px;       text-align: left;}
       
         div.ucInvReqUI  div.sessionRequestNotification div.divC {float:left;width:20%;/*padding-left:15px;*/}
       div.ucInvReqUI div.sessionRequestNotification .lblEScreenName{ font-weight:bold; color:#000000;  }
       div.ucInvReqUI  div.sessionRequestNotification .lblStatusMsg{font-size:0.85em; }
         div.ucInvReqUI div.sessionRequestNotification .btnInviteReqStatus{  font-size:0.9em; padding:5px; padding-left:20px; padding-right:20px; font-weight: 600;
    line-height: 1.4;
    letter-spacing: .05em; border-radius:2px;} 
         div.SiteThemeA div.ucInvReqUI div.sessionRequestNotification .btnInviteReqStatus{ background-color:blue; color:white;border-color: cornflowerblue; } 

        div.SiteThemeB div.ucInvReqUI div.sessionRequestNotification .btnInviteReqStatus{ background-color:#892778; color:white;border-color: #892778; } 

       div.ucInvReqUI .lblSessionCommMode{font-weight:600; font-size:0.9em;}
    </style>
<style>
      .loader-line {
         
            width: 200px;
            width:100%;
            height: 3px;
            /*position: relative;*/position:absolute;bottom:0;left:0;
            overflow: hidden;
            background-color: #ddd;
            /*margin: 100px auto;*/
            -webkit-border-radius: 20px;
            -moz-border-radius: 20px;
            border-radius: 20px;
        }

        .loader-line:before {
            content: "";
            position: absolute;
            left: -50%;
            height: 3px;
            width: 40%;
            background-color: coral;
            -webkit-animation: lineAnim 1s linear infinite;
            -moz-animation: lineAnim 1s linear infinite;
            animation: lineAnim 1s linear infinite;
            -webkit-border-radius: 20px;
            -moz-border-radius: 20px;
            border-radius: 20px;
        }

        @keyframes lineAnim {
            0% {
                left: -40%;
            }
            50% {
                left: 20%;
                width: 80%;
            }
            100% {
                left: 100%;
                width: 100%;
            }
        }
  </style>
<style>
    div.divSessionRoomContainerPg{
            text-align: center;display:none;
    position: absolute; position:fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); padding-left:20px; padding-right:20px;
    /*width:65%;*/
    /*height:85%;*/
 
    background-color: rgb(200, 200, 200);
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
   
    overflow: hidden;z-index:999;
        }
    div.divSessionRoomContainerPg div.divCloseModalMain {
        position: absolute;
        right: 5px;
        top: 5px;
        display: table-cell;
        vertical-align: middle;
        cursor: pointer;
    }
    div.divSessionRoomContainerPg div.divCloseModalMain {
      
        display: none;
       
    }
    div.dynamicSessionRoomContainerPg{
        width:65%;
    height:85%; padding:0px;
    }
    div.dynamicSessionRoomContainerPg div.divCloseModalMain{display:none;}

     div.divCloseModalMain{display:none;}
 
    @media only screen  and (max-width: 780px){ 
           div.divSessionRoomContainerPg {width:90%;/*height:90%;*/}
}
     @media only screen  and (max-width: 400px){ 
           div.divSessionRoomContainerPg {width:100%;height:100%; border-radius:0px;}
}
         /*div.divSessionRoomContainerPg .framSessionRoom{
             width:calc(100% - 20px);
              height:calc(100% - 20px); width:100%;
              height:100%;
         }*/

        div.dynamicSessionRoomContainerPg .framSessionRoom{
             width:calc(100% - 20px);
              height:calc(100% - 20px); width:100%;
              height:100%;
         }

</style>
<script>
    //https://stackoverflow.com/questions/29859048/updating-an-iframe-history-and-url-then-making-it-work-with-back-button
    //iframe pop state
    //https://stackoverflow.com/questions/19452427/handling-history-navigation-inside-iframe
    //https://stackoverflow.com/questions/3700440/html5-onpopstate-on-page-load
    /*var isPageMod = false;*/
    //Note: Keep this on the top of this Usercontrol otherwise, console log will generate error
    //onload = "this.style.height=(this.contentWindow.document.body.scrollHeight+20)+'px';"
    function ResizeIframe(obj) {
       /* alert("ResizeIframe:" + app.isPageMod);*/
        if (app.isPageMod && app.resizeIFrameOnLoad) {
            obj.style.height = 0;
            obj.style.height = (obj.contentWindow.document.body.scrollHeight + 60) + 'px';
            obj.style.width = 0;
            obj.style.width = (obj.contentWindow.document.body.scrollWidth + 30) + 'px';
            console.log("ResizeIframe:" + obj.contentWindow.document.body.scrollWidth);
            //if (obj.contentWindow.document.body.scrollWidth > 0) {
            //    $("#divSessionRoomContainerPg").show();
            //}
            //
        }
        else {
            obj.style.height='';
            obj.style.width='';
            //obj.style.height = 0;
            //obj.style.width = 0;
            ////obj.hide();
            //obj.style.display = "none";
        }

    }

    function SetSizeIframe(obj) {
       
            obj.style.height = 0;
            obj.style.height = (obj.contentWindow.document.body.scrollHeight + 60) + 'px';
            obj.style.width = 0;
        obj.style.width = (obj.contentWindow.document.body.scrollWidth + 30) + 'px';
        obj.style.display = "block";
        console.log("SetSizeIframe:" + obj.contentWindow.document.body.scrollWidth);
          

    }
</script>

<div id="ucInvReqUI" class="ucInvReqUI">
    <div class="sessionRequestNotification">
        <div class="divA">
            <img class="imgExpert" src="" style="height: 60px; border-radius: 50%;" /><br />
            <label class="lblSessionCommMode"></label>
            <label id="lblIsSignalCoreConnected" style="display:none;"></label><br />
            
        </div>
        <div class="divB">
            <label class="lblEScreenName"></label>
            <br />
            <i class="fa fa-inr" aria-hidden='true' style="font-size: 0.8em;"></i>
            <label class="lblDisplayOfferPriceINR"></label>
            <label class="permin ccpm">/min</label><label class="duration ccpc">Duration</label><label class="duration ccpc lblcct"></label><br />
            <label class="lblStatusMsg">Processing your request..</label>
        </div>
        <div class="divC">
            <input type="button" value="Waiting" class="btnInviteReqStatus" id="btnInviteReqStatus" />
        </div>
        
        <div class="divCloseBtnInvReq" style="position: absolute; right: 5px; top: 5px; /*display: table-cell;*/ display:none; vertical-align: middle; cursor: pointer;">
            <div style="position: relative; display: inline-block; width: 2.0em; height: 2.0em;">
                <svg class="svg-icon" viewBox="0 0 20 20">
                    <path fill="#a0a0a0" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
                </svg>
            </div>
        </div>

    </div>
    <div class="loader-line"></div>
    <div style="display: none;" ><iframe id="frameInviteReqStatusN" style="display: none;"></iframe></div>
    <div style="display:none;"><a class="aAddFundsOnUcInvReq" href="/shopping/addFunds"></a></div>
</div>

<div id="divSessionRoomContainerPg" class="divSessionRoomContainerPg divModalPageMain">
    <div id="divCloseModalMain" class="divCloseModalMain" >
        
        <div style="position: relative; display: inline-block; width: 2.0em; height: 2.0em;">
            <svg class="svg-icon" viewBox="0 0 20 20">
                <path fill="#000000" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
            </svg>
        </div>
    </div>
    <iframe id="framSessionRoom" class="framSessionRoom" onload="ResizeIframe(this)" >        
        
    </iframe>
</div>
<script>
    //document.getElementsByClassName('divCloseModalMain')[0]
    document.getElementById('divCloseModalMain')
        .addEventListener('click', function (event) {
            //event.preventDefault();
            //HideKeyInIFrame();
            // do something
            HideModalPageNew();
            
        });
    //function HideKeyOnIFramePage() {
    //    document.activeElement.blur();
    //    $("input").blur();
    //    $("select").blur();
    //};
    function HideKeyInIFrame() {
        console.log("HideKeyInIFrame");

        var theFrame = document.getElementById("framSessionRoom");
        var theFrameDocument = theFrame.contentDocument || theFrame.contentWindow.document;
        //theFrameDocument.activeElement.blur();
        console.log("HideKeyInIFrame1");
        //var button = theFrameDocument.getElementById("mybutton");
        //HandleDataReceivedFromSignalOnChatPg
        if (typeof theFrame.contentWindow.HideKeyOnIFramePage === "function") {
            //alert("function exists");
            //console.log("Function HandleDataReceivedFromSignalOnChatPg -EXIST");
            // safe to use the function
            theFrame.contentWindow.HideKeyOnIFramePage();
            console.log("HideKeyInIFrame2");
        }
        else {
            //console.log("Function HandleDataReceivedFromSignalOnChatPg - Does Not Exist");
        }
    }
</script>
<script>

    var varUcInvReq = {
        obExpert:null, strSessionCommMode:"", strSessionChargeType:"", pageurl:""
    }
    var framvar = {
        lstPhoneNosJson: "",        
    }
    var strWebApiURL = 'https://wpi.manyzone.com/';
   
    var isSignalCoreConnected = false;
    //var isFirstInviteReqSent = false;//This is risky as everytime we come on this page (when inv req is on landing page) after clicking back and then forward it becomes false. So start using FirstInviteRequest To be sent
    var firstInviteReqToBeSent = 0;
    var sro = null;
    var isBusySendingInvReq = false;
    var isBusyCancellingInvReq = false;
    //var invReqStages = { 0: 'none', 1: 'initiating', 2: 'generated', 3: 'received', 4: 'noresponse', 5: 'declined', 6: 'accepted', 7: 'timeout', 8: 'ended' };
    var sessEndStages = { 0: 'none', 1: 'ended', 2: 'closed' };
    //var invReqStages = { None: 0, Initiating1: '', 2: 'generated', 3: 'received', 4: 'noresponse', 5: 'declined', 6: 'accepted', 7: 'timeout', 8: 'ended' };


    //start-done timer variabes//
    //const timeIntervalOnUcInvReq = 5000;
    //const timeOutInvReqInSec = 180;
    //const timeToResendInvReqInSec = 45;
    //const maxInvReqResends = 3;
    //var nextResendAfterTimeInSec = timeToResendInvReqInSec;
    //var elapsedTimeAfterInvReqInSec = 0;
    // var countInvReqResends = 0;
   //End-done timer variabes//

    
    var invReqResendInitiated = false;  
    
    var isSessionRoomOpened = false;
    var lstCallSessionRoomMsgsQueue = new Array();
    var initiateCallWInvReq = true;
    initiateCallWInvReq = true;


    //var intervalVarOnInvReq; //Replaced with timerInvReq
    var timerInvReq;
    var invReqTimerObj = {        
        timeIntervalOnUcInvReq: 0,
        timeOutInvReqInSec: 0,
        timeToResendInvReqInSec: 0,
        maxInvReqResends: 0,   
        nextResendAfterTimeInSec: 0,  
        elapsedTimeAfterInvReqInSec: 0,
        invReqInitiatedAt: null,
        initializedAt: new Date(),
        countInvReqResends: 0,
        init: function () {
            invReqTimerObj.timeIntervalOnUcInvReq = 5000;
            invReqTimerObj.timeOutInvReqInSec= 180;
            invReqTimerObj.timeToResendInvReqInSec = 45;
            invReqTimerObj.maxInvReqResends = 3;
            invReqTimerObj.nextResendAfterTimeInSec = this.timeToResendInvReqInSec;
            invReqTimerObj.elapsedTimeAfterInvReqInSec = 0;
            invReqTimerObj.initializedAt = new Date();
            invReqTimerObj.invReqInitiatedAt = null;
            invReqTimerObj.countInvReqResends = 0;
        }
    }

    var EnumsInvReq = {
        invreqs: {
            None: 0,
            InviteReqInitiatedByInitiator: 1,
            InviteReqGeneratedByServer: 2,
            InviteReqNotGeneratedByServer: 3,
            InviteReqForwardedByServer: 4,
            InviteReqNotForwardedByServerAsUserNotExists: 5,
            InviteReqRecdByContactUser: 6
        },
        reqresp: {
            None: 0,
            Accept: 1,
            Decline: 2,
            NoResponse: 3
        },
        sroat: {
            None: 0,
            InviteRequest: 1,
            InviteReqNotGeneratedByServer: 2,
            InviteReqGeneratedByServer: 3,
            RequestReceived: 4,
            ReqRecdNotProcessedByServer: 5,
            ReqRecdProcessed: 6,
            Accept: 7,
            AcceptingNotProcessedByServer: 8,
            Accepted: 9,
            Decline: 10,
            DecliningNotProcessedByServer: 11,
            Declined: 12,
            NoResponse: 13,
            NoResponseNotProcessedByServer: 14,
            NoResponseProcessed: 15,
            HireExpert: 16,
            HiringExpertNotProcessedByServer: 17,
            HiredExpert: 18,
            EndSession: 19,
            EndingSessionNotProcessedByServer: 20,
            EndSessionDone: 21,
            ExtendFreeDuration: 22,
            DoNotExtendFreeDurationInitiated: 23,
            DoNotExtendFreeDurationProcessedByServer: 24,
            DoNotExtendFreeDurationReceivedByUser: 25,
            RedeemFreeDurationInitiated: 26,
            RedeemFreeDurationProcessed: 27,
            RedeemFreeDurationReceived: 28,
            DoNotRedeemFreeDurationInitiated: 29,
            DoNotRedeemFreeDurationProcessed: 30,
            DoNotRedeemFreeDurationReceived: 31,
            CloseSession: 32,
            UpdateClientAccountDebitInitiated: 33,
            UpdateClientAccountDebitProcessed: 34,
            UpdateClientAccountDebitReceived: 35,

            UpdateExpertAccountCreditInitiated: 36,
            UpdateExpertAccountCreditProcessed: 37,
            UpdateExpertAccountCreditReceived: 38,


            PhoneCallFirstLegInitiated: 46,
            PhoneCallSecondLegInitiated: 47,
            PhoneCallCompleted: 48,
            PhoneCallInitiateFailed: 49
        },
        paidtype: {
            Paid: 1,
            Free: 2
        },
        sem: {
            None: 0,
            ButtonClick: 1,
            PaidDurationEnded: 2
        },
        scm: {
            None: 0,
            ExtensionNotGranted: 1,
            ExtensionNotRedeemed: 2,
            SessionEndedByButtonClick: 3,
            NoResponseToExtendDuration: 4,
            CloseScreen: 5,
        },
        sqt: {
            None: 0,
            InviteReqInitiatedByUser: 1,
            InviteReqRecdByContactUser: 2,
            InviteReqAcceptedByMeAsContactUser: 3,
            InviteReqDeclinedByMeAsContactUser: 4,
            EndChat: 5
        },
        cmat: {
            None: 0,
            ChatMessage: 1,
            ChatMessageStatus: 2
        },
        cms: {
            None: 0,
            ReceivedByServer: 1,
            ReceivedByOtherUser: 2
        },
        rs: {
            None: -1,
            Unsuccessful: 0,
            Successful: 1,
            AlreadyExists: 2
        },
        blreftype: {
            None: 0,
            Chat: 3,
            Session: 6
        },
        dtype: {
            None: 0,
            Live_Chat_Session_with_Expert: 2
        },
        ctype: {
            None: 0,
            Live_Chat_Session_with_Client: 4
        },
        dataserviceactions: {
            None: 0,
            endsession: 1,
            closesession: 2,
            insertcadebit: 3,
            inserteacredit: 4,
            updatesessioncastatus: 5,
            updatesessioneastatus: 6,
            calcexearningsforsession: 7,
            sendchatmsg: 8,
            chatmsgrcd: 9
        },
        invreqstages: {
            None: 0,
            initiating: 1,
            generated: 2,
            received: 3,
            noresponse: 4,
            declined: 5,
            accepted: 6,
            timeout: 7,
            cancelled: 8
        }
    };
    
    var EnumsIni = {       
        dataserviceactions: {
            None: 0,
            sendInvite: 1,
            cancelInvite: 2
        }
    };

    var invReqStage = EnumsInvReq.invreqstages.None;
</script>
<script>    
    function SetLocalStorageForInProcessSession() {
        localStorage.setItem("inProcSess", sro.sessionid);
    }
    function GetLocalStorageForInProcessSession() {
        //console.log("GetLocalStorageForInProcessSession");
        var inProcessSession = localStorage.getItem("inProcSess");
        //alert(inProcessSession);
        if (inProcessSession != null) {

        }
    }
    OnLoadInvReqUC();
    function OnLoadInvReqUC() {
       // alert("OnLoadInvReqUC");
        //GetLocalStorageForInProcessSession();
        //if SessionInvRequest is ON, the show InviteRequest
        //If SessionChatOrCall is On, then show ChatRoom
    }
    var sessPgUrl = "";
    function OnChatCallButtonClick_26062023(obLocalExpert, strSessionCommMode, strSessionChargeType, pageurl) {
      
        //console.log(strSessionCommMode);
        //console.log(obLocalExpert.Expert.Id);
        //console.log(JSON.stringify(obLocalExpert));
        console.log(obLocalExpert.Expert.UserId);
        if (strSessionCommMode == "Chat") {

        }
        else if (strSessionCommMode == "Phone") {
        }
        //let uri = "my test.asp?name=ståle&car=saab";
        //let encoded = encodeURI(uri);
        //alert(encoded);

        //let uri = "http://manyzone-local.com/expertsop/astrology?pmoflow=3_vp2doZdL";
        //let encoded = encodeURI(uri);
        //alert(encoded);

        //alert(encodeURI(window.location.href));
        //return;
        var uid = document.getElementById("hdUserId").value;       
        if (uid === undefined || uid === null || uid === "") {
            //alert("no uid");
            // RedirectToSignInPage();
            //$('div#divCategoriesSideBar a.aLogin').prop("href", "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href));
            //$("div#divCategoriesSideBar  a.aLogin")[0].click();
            RedirectToSignInPageUcInvReq(obLocalExpert);
            $("div#ucInvReqUI").hide();
            return;
        }

        if (uid === obLocalExpert.Expert.UserId) {
            return;
        }       
        /*alert(obLocalExpert.Expert.isbz);*/
        if (obLocalExpert.Expert.isbz) { return; }
        if (IsAllowedToSendNewInviteRequest()===false) {
            return;
        }
        if (uid == "80644" || uid != "80644" ) { initiateCallWInvReq = false; }
        sro = null;
       /* var date = Date.now();*/

        //var _initializedAt = new Date();
        /*alert(_initializedAt);*/
        invReqTimerObj.init();
        //console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);
        //invReqTimerObj.initializedAt = _initializedAt; //This is MUST. invReqTimerObj Init Function doesnot changethe value of initializedAt
        //console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);

       /* console.log("date:" + date);*/
        /*return;*/
        console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);
        invReqResendInitiated = false;
        isSessionRoomOpened = false;
        lstCallSessionRoomMsgsQueue = new Array();
       
        countInvReqResends = 0;
        //Moved into invReqTimerObj.init()
        //nextResendAfterTimeInSec = timeToResendInvReqInSec;
        //Moved into invReqTimerObj.init()
       
        invReqStage = EnumsInvReq.invreqstages.None
        isBusySendingInvReq = false;
        isBusyCancellingInvReq = false;
        //document.getElementById("lblInviteReqStatus").innerText = "";

        //************************
        //Comented on 26062023 
        //UpdateInvReqUIOnChatCallClick(obLocalExpert, strSessionCommMode, strSessionChargeType);
        UpdateInvReqUIOnChatCallClick(obLocalExpert.Expert, strSessionCommMode, strSessionChargeType);
        //***************************
       
        self.clearInterval(timerInvReq)
        timerInvReq = self.setInterval(function () { ManageInviteReqStateChangeByTimer() }, invReqTimerObj.timeIntervalOnUcInvReq);
        //elapsedTimeAfterInvReqInSec = 0;
        sessPgUrl = pageurl;
        console.log("start SendSessionProviderRequest");
       
        SendSessionProviderRequest(pageurl);
    }

    function OnChatCallButtonClick(obExpert, strSessionCommMode, strSessionChargeType, pageurl) {
        $("div.ucFundsPopUp").hide();
        $("div#divTransPageModal").hide();
        //console.log(strSessionCommMode);
        //console.log(obLocalExpert.Expert.Id);
        //console.log(JSON.stringify(obLocalExpert));
        console.log(obExpert.UserId);
        if (strSessionCommMode == "Chat") {

        }
        else if (strSessionCommMode == "Phone") {
        }
        //let uri = "my test.asp?name=ståle&car=saab";
        //let encoded = encodeURI(uri);
        //alert(encoded);

        //let uri = "http://manyzone-local.com/expertsop/astrology?pmoflow=3_vp2doZdL";
        //let encoded = encodeURI(uri);
        //alert(encoded);

        //alert(encodeURI(window.location.href));
        //return;
        var uid = document.getElementById("hdUserId").value;
        if (uid === undefined || uid === null || uid === "") {
            //alert("no uid");
            // RedirectToSignInPage();
            //$('div#divCategoriesSideBar a.aLogin').prop("href", "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href));
            //$("div#divCategoriesSideBar  a.aLogin")[0].click();
            RedirectToSignInPageUcInvReq(obExpert);
            $("div#ucInvReqUI").hide();
            return;
        }

        if (uid === obExpert.UserId) {
            return;
        }
        /*alert(obLocalExpert.Expert.isbz);*/
        if (obExpert.isbz) { return; }
        if (IsAllowedToSendNewInviteRequest() === false) {
            return;
        }
        if (uid == "80644" || uid != "80644") { initiateCallWInvReq = false; }
        sro = null;
        /* var date = Date.now();*/

        //var _initializedAt = new Date();
        /*alert(_initializedAt);*/
        invReqTimerObj.init();
        //console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);
        //invReqTimerObj.initializedAt = _initializedAt; //This is MUST. invReqTimerObj Init Function doesnot changethe value of initializedAt
        //console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);

        /* console.log("date:" + date);*/
        /*return;*/
        console.log("invReqTimerObj.initializedAt:" + invReqTimerObj.initializedAt);
        invReqResendInitiated = false;
        isSessionRoomOpened = false;
        lstCallSessionRoomMsgsQueue = new Array();

        countInvReqResends = 0;
        //Moved into invReqTimerObj.init()
        //nextResendAfterTimeInSec = timeToResendInvReqInSec;
        //Moved into invReqTimerObj.init()

        invReqStage = EnumsInvReq.invreqstages.None
        isBusySendingInvReq = false;
        isBusyCancellingInvReq = false;
        //document.getElementById("lblInviteReqStatus").innerText = "";

        //************************
        //Comented on 26062023 
        //UpdateInvReqUIOnChatCallClick(obLocalExpert, strSessionCommMode, strSessionChargeType);
        UpdateInvReqUIOnChatCallClick(obExpert, strSessionCommMode, strSessionChargeType);
        //***************************

        self.clearInterval(timerInvReq)
        timerInvReq = self.setInterval(function () { ManageInviteReqStateChangeByTimer() }, invReqTimerObj.timeIntervalOnUcInvReq);
        //elapsedTimeAfterInvReqInSec = 0;
        sessPgUrl = pageurl;
        console.log("start SendSessionProviderRequest");
        varUcInvReq.obExpert = obExpert;
        varUcInvReq.strSessionCommMode = strSessionCommMode;
        varUcInvReq.strSessionChargeType = strSessionChargeType;
        varUcInvReq.pageurl = pageurl;
        
        SendSessionProviderRequest(pageurl, "", obExpert);
    }

    $(document).on("click", "div#ucInvReqUI  div.divCloseBtnInvReq", function (e) {
        if (spuid == undefined || spuid == null || spuid == "") {
            sro = null;
            $("div#ucInvReqUI").hide();
        }
        else {
            if (sro.isse == true || sro.issc == true) {
                sro = null;
                $("div#ucInvReqUI").hide();
            }
            else {
                sro.obyd = spuid;
                SendDataToWebApi(sro, EnumsIni.dataserviceactions.cancelInvite);
                $("div#ucInvReqUI").hide();
            }
           
        }
      
    });
    function RedirectToSignInPageUcInvReq_26062023(obLocalExpert) {        

        //**************************************************
        //Donot use the following. As we are not using the concept of Single Page Application when UserIs not SIgnedin
        //$('div#divCategoriesSideBar a.aLogin').prop("href", "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href));
        //$("div#divCategoriesSideBar  a.aLogin")[0].click();
        //// Simulate a mouse click:
        //window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href);
        if (obLocalExpert == undefined || obLocalExpert == null) {
            window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href);
        }
        else {
            //we can attach euid but that will be bit complicated. Rather we can use local storage for displaying Experts on top of Experts List
            //if(window.location.href.indexOf("?"))
            window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href) ;
        }
       // window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href);
        //**************************************************
    }

    function RedirectToSignInPageUcInvReq(obExpert) {

        //**************************************************
        //Donot use the following. As we are not using the concept of Single Page Application when UserIs not SIgnedin
        //$('div#divCategoriesSideBar a.aLogin').prop("href", "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href));
        //$("div#divCategoriesSideBar  a.aLogin")[0].click();
        //// Simulate a mouse click:
        //window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href);
        if (obExpert == undefined || obExpert == null) {
            window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href);
        }
        else {
            //we can attach euid but that will be bit complicated. Rather we can use local storage for displaying Experts on top of Experts List
            //if(window.location.href.indexOf("?"))
            window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href);
        }
        // window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURIComponent(window.location.href);
        //**************************************************
    }


    function RedirectToAddFundsPage() {
       // return;// for testing
        //**************************************************
        //Donot use the following. As we are not using the concept of Single Page Application when UserIs not SIgnedin
        //$('div#divCategoriesSideBar a.aAddFundsJs').prop("href", "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href));
        //Works
        //$("div#divCategoriesSideBar  a.aAddFundsJs")[0].click();
        $("div#ucInvReqUI  a.aAddFundsOnUcInvReq")[0].click(); 
        //// Simulate a mouse click:
        //window.location.href = "/member/sign-in.aspx?returnURL=" + encodeURI(window.location.href);
        //**************************************************
    }
    function ShowConfirmPhoneNoUIOldOld() {
       
        var transShield = $('#divModalSingleTransShield');      
        transShield.show();      
        $("#divSessionRoomContainerPg").show();
        //Start-Following Works
        document.getElementById("framSessionRoom").src = "/pages/call/confirmmobileno.aspx?smastr=empty";
        //document.getElementById("framSessionRoom").width = $("#divSessionRoomContainerPg").width() - 20;
        //document.getElementById("framSessionRoom").height = $("#divSessionRoomContainerPg").height() - 20;
        document.getElementById("framSessionRoom").frameBorder = 0;
    }
    function ShowConfirmPhoneNoUIOld() {      
        var transShield = $('#divModalSingleTransShield');
        var modaldiv = $('#divModalSingle');
        var href = "/pages/call/confirmmobilenon.aspx";
        if (modaldiv.length) {
            //e.preventDefault();
            //var href = $(this).attr('href');
            var newhref = href;
            if (href.indexOf("?") >= 0) {
                newhref = newhref + '&umod=true'
            }
            else {
                newhref = newhref + '?umod=true'
            }
      
            $('.divLoadingImage').show();
            modaldiv.load(newhref,
 function (responseText, textStatus, XMLHttpRequest) {
     if (textStatus == "success") {
         // all good!
         modaldiv.show();
         transShield.show();
         $('.divLoadingImage').hide();     
     }
     if (textStatus == "error") {
         // oh noes!
         //alert("error");
         $('.divLoadingImage').hide();
         if (XMLHttpRequest.readyState == 4) {
             // HTTP error (can be checked by XMLHttpRequest.status and XMLHttpRequest.statusText)
             //alert("error in loading" + XMLHttpRequest.readyState);
             //alert(XMLHttpRequest.statusText);
         }
         else if (XMLHttpRequest.readyState == 0) {
             // Network error (i.e. connection refused, access denied due to CORS, etc.)
             //alert("check your internet ");
         }
         else {
             // something weird is happening
             //alert("error in loading" + XMLHttpRequest.readyState);
         }
     }
 });
    
        }
        else {
            //alert("Div not There"); 
        }
     
    }

    function ShowConfirmPhoneNoUI() {
        var resizeIFrameAsPerChild = true;
        ShowModalPage(resizeIFrameAsPerChild);
       /* SetSizeIframe(document.getElementById("framSessionRoom"));*/
       // app.isPageMod = true;       
       // originalUrl = window.location.href;
       var currentURL = window.location.href;
        //var url="https://www.umastro.com/pages/call/confirmmobileno.aspx"
       // window.history.pushState({ path: originalUrl }, '', originalUrl);
        //window.history.pushState({ path: currentURL }, '', currentURL);
        window.parent.history.pushState({ path: currentURL }, '', currentURL);

        //var transShield = $('#divModalSingleTransShield');
        //transShield.show();

        //Start-Following Works
        document.getElementById("framSessionRoom").frameBorder = 0;

        //********************************************
        //Following Works onPopState: Option1
        //changeIframeSrc(document.getElementById("framSessionRoom"), "/pages/call/confirmmobilenon.aspx?smastr=empty");
        //Following Works onPopState: Option2: We are using Option 2 as it is mor simple
        var newUrl = "/pages/call/confirmmobilenon.aspx?smastr=empty";
        document.getElementById("framSessionRoom").contentWindow.location.replace(newUrl);
        //DoesNotWork on PopState
         //document.getElementById("framSessionRoom").src = "/pages/call/confirmmobilenon.aspx?smastr=empty";
        //********************************************

        //document.getElementById("framSessionRoom").width = $("#divSessionRoomContainerPg").width() - 20;
        //document.getElementById("framSessionRoom").height = $("#divSessionRoomContainerPg").height() - 20;

        //$("#divSessionRoomContainerPg").show();
        /* disableScroll();*/
       /* SetSizeIframe(document.getElementById("framSessionRoom"));*/
        /* disableScroll();*/
        
    }

    function ShowVerifyPhoneNoUI() {
        //console.log("ShowVerifyPhoneNoUI");
        var resizeIFrameAsPerChild = true;
        ShowModalPage(resizeIFrameAsPerChild);
        /* SetSizeIframe(document.getElementById("framSessionRoom"));*/
        // app.isPageMod = true;       
        // originalUrl = window.location.href;
        var currentURL = window.location.href;
        //var url="https://www.umastro.com/pages/call/confirmmobileno.aspx"
        // window.history.pushState({ path: originalUrl }, '', originalUrl);
        //window.history.pushState({ path: currentURL }, '', currentURL);
        window.parent.history.pushState({ path: currentURL }, '', currentURL);

        //var transShield = $('#divModalSingleTransShield');
        //transShield.show();

        //Start-Following Works
        document.getElementById("framSessionRoom").frameBorder = 0;
        //console.log("ShowVerifyPhoneNoUI1");
        //********************************************
        //Following Works onPopState: Option1
        //changeIframeSrc(document.getElementById("framSessionRoom"), "/pages/call/confirmmobilenon.aspx?smastr=empty");
        //Following Works onPopState: Option2: We are using Option 2 as it is mor simple
        var newUrl = "/pages/call/verifyphonenonn.aspx?smastr=empty&verifyno=true";
        document.getElementById("framSessionRoom").contentWindow.location.replace(newUrl);        
        //DoesNotWork on PopState
        //document.getElementById("framSessionRoom").src = "/pages/call/confirmmobilenon.aspx?smastr=empty";
        //********************************************

        //document.getElementById("framSessionRoom").width = $("#divSessionRoomContainerPg").width() - 20;
        //document.getElementById("framSessionRoom").height = $("#divSessionRoomContainerPg").height() - 20;

        //$("#divSessionRoomContainerPg").show();
        /* disableScroll();*/
        /* SetSizeIframe(document.getElementById("framSessionRoom"));*/
        /* disableScroll();*/

    }

    var changeIframeSrc = function (iframe, src) {
        var frame = iframe.cloneNode();
        frame.src = src;
        iframe.parentNode.replaceChild(frame, iframe);
        //https://stackoverflow.com/questions/29859048/updating-an-iframe-history-and-url-then-making-it-work-with-back-button
    };
    //$('#framSessionRoom').load(function () {
    //    //$(".loading").remove();
    //    //alert("iframe is done loading");
    //    $("#divSessionRoomContainerPg").show();
    //    this.style.height = 0;
    //    this.style.height = (this.contentWindow.document.body.scrollHeight + 60) + 'px';
    //    this.style.width = 0;
    //    this.style.width = (this.contentWindow.document.body.scrollWidth + 30) + 'px';
    //});//.show();

    function HideConfirmPhoneNoUI() {
        var transShield = $('#divModalSingleTransShield');
        transShield.hide();
        $("#divSessionRoomContainerPg").hide();
      
    }
    function HideVerifyPhoneNoUI() {
        var transShield = $('#divModalSingleTransShield');
        transShield.hide();
        $("#divSessionRoomContainerPg").hide();

    }
    function HideInvReqUI() {
       // return;// for testing
        $("div#ucInvReqUI").hide();
    }
    function ShowInvReqUI() {
        $("div#ucInvReqUI").show();
    }
   
    function IsAllowedToSendNewInviteRequest() {
        if (sro == null) return true;
        //if (invRequestStage == 1 || invRequestStage == 2 || invRequestStage == 3) {
        //    //alert("Your previous request is already under process");
        //    return false;
        //}
        //console.log("IsAllowedToSendNewInviteRequest");
        //console.log("IsAllowedToSendNewInviteRequest");
        // console.log("IsAllowedToSendNewInviteRequest:" + invReqStage)
        if (invReqStage == EnumsInvReq.invreqstages.initiating ||
            invReqStage == EnumsInvReq.invreqstages.generated ||
            invReqStage == EnumsInvReq.invreqstages.received) {
            //alert("Your previous request is already under process");
            return false;
        }
        if (invReqStage == EnumsInvReq.invreqstages.None ||
            invReqStage == EnumsInvReq.invreqstages.declined ||
            invReqStage == EnumsInvReq.invreqstages.timeout ||
            invReqStage == EnumsInvReq.invreqstages.cancelled) {
            return true;
        }
        if (invReqStage == EnumsInvReq.invreqstages.accepted) {
            if (IsSessionEnded() === true) return true;
            else return false;
        }
        return true;
    }
    function UpdateInvReqUIOnChatCallClick(obExpert, strSessionCommMode, strSessionChargeType) {
        //TEMP COMMENTED
        $("div#ucInvReqUI  div.divCloseBtnInvReq").hide();

        //alert(obLocalExpert.Expert.ThumbnailImageUrl);
        $("div#ucInvReqUI  .imgExpert").attr("src", obExpert.ThumbnailImageUrl);
        //alert(strSessionCommMode);
        $("div#ucInvReqUI  .lblSessionCommMode").text(strSessionCommMode);
        $("div#ucInvReqUI  .lblEScreenName").text(obExpert.ScreenName);
       // $("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(obLocalExpert.DisplayOfferPriceINR);
        $("div#ucInvReqUI  .lblCCT").text(obExpert.CCT);
        $("div#ucInvReqUI  .lblStatusMsg").text("Processing your request...");

        var exsessioncharges = ReturnExpertSessionCharges(obExpert.esch, strSessionCommMode, strSessionChargeType);
        if (strSessionChargeType == "ccpm") {
            $("div#ucInvReqUI  .ccpm").show();
            $("div#ucInvReqUI  .ccpc").hide();
            //$("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(obExpert.CCPMINRFinal);
            
            //$("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(exsessioncharges.OfferPriceINR);
            $("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(exsessioncharges.PriceINRFinal);
        }
        if (strSessionChargeType == "ccpc") {
            $("div#ucInvReqUI  .ccpm").hide();
            $("div#ucInvReqUI  .ccpc").show();
            //$("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(obExpert.CCPCINRFinal);
            //$("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(exsessioncharges.OfferPriceINR);
            $("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(exsessioncharges.PriceINRFinal);
        }
        $("div#ucInvReqUI").show();
        $("div#ucInvReqUI div.sessionRequestNotification div.divC .btnInviteReqStatus").show();
        $("div#ucInvReqUI  div.loader-line").show();
    }

    function UpdateInvReqUIOnChatCallClick_26062023(obLocalExpert, strSessionCommMode, strSessionChargeType) {
        //TEMP COMMENTED
        $("div#ucInvReqUI  div.divCloseBtnInvReq").hide();

        //alert(obLocalExpert.Expert.ThumbnailImageUrl);
        $("div#ucInvReqUI  .imgExpert").attr("src", obLocalExpert.Expert.ThumbnailImageUrl);
        //alert(strSessionCommMode);
        $("div#ucInvReqUI  .lblSessionCommMode").text(strSessionCommMode);
        $("div#ucInvReqUI  .lblEScreenName").text(obLocalExpert.Expert.ScreenName);
        $("div#ucInvReqUI  .lblDisplayOfferPriceINR").text(obLocalExpert.DisplayOfferPriceINR);
        $("div#ucInvReqUI  .lblCCT").text(obLocalExpert.Expert.CCT);
        $("div#ucInvReqUI  .lblStatusMsg").text("Processing your request...");
        if (strSessionChargeType == "ccpm") {
            $("div#ucInvReqUI  .ccpm").show();
            $("div#ucInvReqUI  .ccpc").hide();
        }
        if (strSessionChargeType == "ccpc") {
            $("div#ucInvReqUI  .ccpm").hide();
            $("div#ucInvReqUI  .ccpc").show();
        }
        $("div#ucInvReqUI").show();
        $("div#ucInvReqUI div.sessionRequestNotification div.divC .btnInviteReqStatus").show();
        $("div#ucInvReqUI  div.loader-line").show();
    }

    function ReturnExpertSessionCharges(lstesc, strSessionCommMode, strSessionChargeType) {
        var bytSessionCommMode = 0;
        var bytSessionChargeType = 0;
        if (strSessionCommMode == "Chat") {
            bytSessionCommMode = 1;
        }
        else if (strSessionCommMode == "Phone") {
            bytSessionCommMode = 2;
        }
        if (strSessionChargeType == "ccpm") {
            bytSessionChargeType = 1;
        }
        else if (strSessionChargeType == "ccpc") {
            bytSessionChargeType = 5;
        }
        //alert(JSON.stringify(lstesc));
        //alert("strSessionCommMode" + strSessionCommMode);
        //alert(strSessionChargeType);
        var isFound = false;
        if (lstesc.length > 0) {
            for (let i = 0; i < lstesc.length; i++) {
                if (lstesc[i].SessionCommMode == bytSessionCommMode && lstesc[i].SessionChargeType == bytSessionChargeType) {
                    isFound = true;
                    console.log("isFound" + isFound);
                    return lstesc[i];
                }
            }
        }
        else {
            return null;
        }
        if (isFound == false) return null;


    }
    
    //var invRequestStage = 0;
    var qseChatPage = "";
    function InitiateSignalCoreConnection(qse) {
       // console.log("InitiateSignalCoreConnection");
        //invRequestStateOnExpertPage = 1;
        qseChatPage = qse;
        //$("#divInviteReqStatusContainer").show();
        //document.getElementById("frameInviteReqStatusN").src = "/live-session/signalRAuth.aspx?e=" + qse;
        document.getElementById("frameInviteReqStatusN").src = "/live-session/signal/signalRAuth.aspx?e=" + qse;
        //document.getElementById("frameInviteReqStatus").width = $("#divInviteReqStatusContainer").width() - 20;
        //document.getElementById("frameInviteReqStatus").height = $("#divInviteReqStatusContainer").height() - 20;
        document.getElementById("frameInviteReqStatusN").width = 0;
        document.getElementById("frameInviteReqStatusN").height = 0;
        document.getElementById("frameInviteReqStatusN").frameBorder = 0;
    }
    
    function IsSessionEnded() {
        //We have to add logic to this
        if (sro.isse == true) return true;
        return false;
    }
</script>



 
    <script>
        function HandleDataReceivedFromSignalCore(data) {
           
            var initialbundle;
            var datawobundle;
           
            //SendDataReceivedFromSignalCoreToSessionRoom(data);
            if (data.startsWith("@sessd:")) {
                initialbundle = "@sessd:";
                datawobundle = data.substring(initialbundle.length);
                ManageReceivedSessionDataFromSignalCore(initialbundle, datawobundle,data);
                //return;
            }
            //Keep the following line after the above line otherwise the second consecutice chat request will stop working in iphone 12.0
            SendDataReceivedFromSignalCoreToSessionRoom(data);
        }

        function ManageReceivedSessionDataFromSignalCore(initialbundle, datawobundle, data) {
           // document.getElementById("lblInviteReqStatus").innerText = "Received";
            var obj = JSON.parse(datawobundle);
            if (!IsReceivedDataValid(obj.sessid)) {
                //document.getElementById("lblInviteReqStatus").innerText = "Not Valid";
                return false;
            }
            console.log("ManageReceivedSessionDataAtUCInvReq: " + obj.sessid + " : " + sro.sessid);
            //console.log("ManageReceivedSessionDataFromSignalCore" + obj.sroat);
            //alert(obj.sroat);
            if (obj.sroat == EnumsInvReq.sroat.InviteReqGeneratedByServer) {
                //HandleInviteRequestGeneratedByServer(obj);
                //if (invReqStage <= 2) {
                //    invReqStage = 2;   
                //    var msg = "Request initiated. Advisor gets 3 minutes to accept your request.";
                //    UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                //}
                if (invReqStage == EnumsInvReq.invreqstages.None || invReqStage == EnumsInvReq.invreqstages.initiating ||  invReqStage == EnumsInvReq.invreqstages.generated) {
                    invReqStage = EnumsInvReq.invreqstages.generated;
                    var msg = "Request initiated. Advisor gets 3 minutes to accept your request.";
                    UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                }
            }
            else if (obj.sroat == EnumsInvReq.sroat.ReqRecdProcessed) {
                //HandleInviteRequestReceivedByExpert(obj);
                //if (invReqStage <= 3) invReqStage = 3;
                //var msg = "Waiting";
                //updateInviteReqUI(msg);
                if (invReqStage == EnumsInvReq.invreqstages.None || invReqStage == EnumsInvReq.invreqstages.initiating || invReqStage == EnumsInvReq.invreqstages.generated || invReqStage == EnumsInvReq.invreqstages.received) {
                    invReqStage = EnumsInvReq.invreqstages.received;
                }
            }
            else if (obj.sroat == EnumsInvReq.sroat.NoResponseProcessed) {
                //HandleInviteRequestResponseNoResponseProcessed(obj);
                //if (invReqStage <= 4) invReqStage = 4;
                //var msg = "Waiting";
                //updateInviteReqUI(msg);
                //console.log("NoResponseProcessed");
                if (invReqStage === EnumsInvReq.invreqstages.None || invReqStage === EnumsInvReq.invreqstages.initiating || invReqStage === EnumsInvReq.invreqstages.generated || invReqStage === EnumsInvReq.invreqstages.received || invReqStage === EnumsInvReq.invreqstages.noresponse) {
                    invReqStage = EnumsInvReq.invreqstages.noresponse;
                }
            }
            else if (obj.sroat == EnumsInvReq.sroat.Declined) {
                //document.getElementById("lblInviteReqStatus").innerText = "declined";
                //document.getElementById("lblInviteReqStatus").innerText += invReqStage;
                //HandleInviteRequestResponseDeclined(obj);
                //invReqStage = 4;
               // if (invReqStage !== 6 && invReqStage !== 7 && invReqStage !== 8) invReqStage = 5;//if already accepted then can't get declined.Then initiator can only end session after entering chatroom or end session without enetreing room.
                if (invReqStage !== EnumsInvReq.invreqstages.accepted && invReqStage !== EnumsInvReq.invreqstages.timeout && invReqStage !== EnumsInvReq.invreqstages.cancelled ) {
                    invReqStage = EnumsInvReq.invreqstages.declined;
                    var msg = "Oops!! Request declined. Try to contact some other expert";
                    //UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                    UpdateInviteReqUIOnStatusChange(msg, EnumsInvReq.invreqstages.declined);
                    
                }
               
             
            }
            else if (obj.sroat == EnumsInvReq.sroat.Accepted) {
                if (invReqStage == EnumsInvReq.invreqstages.accepted) return;
                //HandleInviteRequestResponseAccepted(obj);
                //if (invReqStage !== 5 && invReqStage !== 7 && invReqStage !== 8) invReqStage = 6;//if already declined, timedout or ended then can't accept.Then you can only start newsession
                if (invReqStage !== EnumsInvReq.invreqstages.declined && invReqStage !== EnumsInvReq.invreqstages.timeout && invReqStage !== EnumsInvReq.invreqstages.cancelled) {
                    invReqStage = EnumsInvReq.invreqstages.accepted;
                    var msg = "Request accepted by expert. Click to enter chat room";
                    msg = "Request accepted by expert.";
                    console.log(msg);
                    UpdateInviteReqUIOnStatusChange(msg, EnumsInvReq.invreqstages.accepted);
                    
                    //$("div#ucInvReqUI").hide();
                    HideInvReqUI();
                    
                    if (sro.comm_mode == "1") {
                        AutoOpenChatRoomOnInvReqAcceptance();
                    }
                    else if (sro.comm_mode == "2") {
                        ShowCallSessionRoom(sro.tg);
                    }                 
                }              
            }           

            if (obj.sroat == EnumsInvReq.sroat.EndSession) {
                sro.isse = true;
            }           
            else if (obj.sroat == EnumsInvReq.sroat.CloseSession) {
                sro.isse = true;
            }
            else if (obj.sroat == EnumsInvReq.sroat.PhoneCallInitiateFailed) {
                //HandlePhoneInitiateFailed(obj);
                console.log("PhoneCallInitiateFailed");
                if (isSessionRoomOpened) {
                    //SendDataReceivedFromSignalCoreToSessionRoom();                
                }
                else {
                    //lstCallSessionRoomMsgsQueue.push(data);//push appends  data
                    lstCallSessionRoomMsgsQueue.unshift(data);//unshift prepends data 
                }
            }
            

        }
        function SendDataReceivedFromSignalCoreToSessionRoom(data) {
            //console.log("HandleDataReceivedFromSignalFrm on MainPage");

            var theFrame = document.getElementById("framSessionRoom");
            var theFrameDocument = theFrame.contentDocument || theFrame.contentWindow.document;
            //var button = theFrameDocument.getElementById("mybutton");
            //HandleDataReceivedFromSignalOnChatPg
            if (typeof theFrame.contentWindow.HandleDataReceivedFromSignalCoreOnChatPg === "function") {
                //alert("function exists");
                //console.log("Function HandleDataReceivedFromSignalOnChatPg -EXIST");
                // safe to use the function
                theFrame.contentWindow.HandleDataReceivedFromSignalCoreOnChatPg(data);
            }
            else {
                //console.log("Function HandleDataReceivedFromSignalOnChatPg - Does Not Exist");
            }           
        }

        function OnReviewSubmittedPg(){
            // alert("OnReviewSubmittedPg");
            document.getElementById("divSessionRoomContainerPg").style.display = "none";
            document.getElementById("divModalSingleTransShield").style.display = "none";
            document.getElementById("divModalSingle").style.display = "none";           
        }
        function UpdateInviteReqUIOnStatusChange(msg, invReqStageIn) {
            //alert("update Invite Request UI");
            // document.getElementById("lblstatusmsg").innerHTML = msg;
            $("div.ucInvReqUI div.sessionRequestNotification div.divB .lblStatusMsg").html(msg);
            //lblstatusmsg.inner
            //if (invReqStage == 7) {
            //    ////timedout
            //    $("div.ucInvReqUI div.sessionRequestNotification div.divC .btnInviteReqStatus").hide();
            //    $("div.ucInvReqUI div.sessionRequestNotification  div.loader-line").hide();
            //}
            if (invReqStageIn == EnumsInvReq.invreqstages.timeout) {
                ////timedout
                $("div.ucInvReqUI div.sessionRequestNotification div.divC .btnInviteReqStatus").hide();
                //$("div.ucInvReqUI div.sessionRequestNotification  div.loader-line").hide();
                $("div#ucInvReqUI  div.loader-line").hide();
                $("div#ucInvReqUI  div.divCloseBtnInvReq").show();
               // invReqStage = EnumsInvReq.invreqstages.timeout;
            }
            if (invReqStageIn == EnumsInvReq.invreqstages.declined) {
                //console.log("declined");
                $("div.ucInvReqUI div.sessionRequestNotification div.divC .btnInviteReqStatus").hide();
                //$("div.ucInvReqUI div.sessionRequestNotification  div.loader-line").hide();
                $("div#ucInvReqUI  div.loader-line").hide();                
                $("div#ucInvReqUI  div.divCloseBtnInvReq").show();
               // invReqStage = EnumsInvReq.invreqstages.declined;
                //console.log("declined" + invReqStage);
               
            }

        }
        
    </script>
 
    <script  type="text/javascript">
        function AutoOpenChatRoomOnInvReqAcceptance() {
            //app.isPageMod = true;
            var resizeIFrameAsPerChild = false;
            ShowModalPage(resizeIFrameAsPerChild);
            ////var transShield = $('#divModalSingleTransShield');
            //var transShield = $('#divModalSingleTransShield');
            ////var modaldiv = $('#divModalSingle');
            //transShield.show();
            ////modaldiv.show();
            //$("#divSessionRoomContainerPg").show();
            //Start-Following Works
           /* document.getElementById("framSessionRoom").src = "/live-session/chat/chat-session.aspx?e=" + qseChatPage;*/
            document.getElementById("framSessionRoom").src = "/live-session/chat/chat-session.aspx?e=" + qseToSessionPageRandom;
            
            //document.getElementById("framSessionRoom").width = $("#divSessionRoomContainerPg").width() - 20;
            //document.getElementById("framSessionRoom").height = $("#divSessionRoomContainerPg").height() - 20;
            document.getElementById("framSessionRoom").frameBorder = 0;
           /* SetSizeIframe(document.getElementById("framSessionRoom"));*/
        }
        function ShowCallSessionRoom(qse) {
            /*document.getElementById("framSessionRoom").src = "about:blank";*/
            //var frame = document.getElementById("framSessionRoom"),
            //    frameDoc = frame.contentDocument || frame.contentWindow.document;
            //frameDoc.removeChild(frameDoc.documentElement);

            console.log("qseChatPage: " + qseChatPage);
            var resizeIFrameAsPerChild = false;
            ShowModalPage(resizeIFrameAsPerChild);
            ////var transShield = $('#divModalSingleTransShield');
            //var transShield = $('#divModalSingleTransShield');
            ////var modaldiv = $('#divModalSingle');
            //transShield.show();
            ////modaldiv.show();
            //$("#divSessionRoomContainerPg").show();
            //Start-Following Works
            //document.getElementById("framSessionRoom").src = "/live-session/phone/call-session.aspx?e=" + qseChatPage + "&initiateCall=" + initiateCallWInvReq;
            document.getElementById("framSessionRoom").src = "/live-session/phone/call-session.aspx?e=" + qse + "&initiateCall=" + initiateCallWInvReq;


            //document.getElementById("framSessionRoom").width = $("#divSessionRoomContainerPg").width() - 20;
            //document.getElementById("framSessionRoom").height = $("#divSessionRoomContainerPg").height() - 20;
            document.getElementById("framSessionRoom").frameBorder = 0;
        }
    </script>
<script>
    var qseToSessionPageRandom = "";
    function SendSessionProviderRequest(pageurl, rtag, obExpert) {
        //alert("SendSessionProviderRequest");
        var uid = document.getElementById("hdUserId").value;
        var uscreenname=  document.getElementById("hdScreenName").value;
        //alert(uid);
        var regData = {
            obdata: {
                data: pageurl,
                userid: uid,
                RandomTag: rtag
            }
        };
        // alert(JSON.stringify(regData));
        console.log(JSON.stringify(regData));
        //contentType: "application/json; charset=utf-8",
        //var localsessionproviderurl = "/session/wbsessionprovider.aspx/ManageSessionProvider";
        var localsessionproviderurl = "/session/wbsessionproviderv1.aspx/ManageSessionProvider";
        if (typeof gSessionProviderURL === 'undefined') { }
        else {
            if (gSessionProviderURL == null || gSessionProviderURL == "") { }
            else { localsessionproviderurl = gSessionProviderURL; }
        }
        //alert(localsessionproviderurl);
        //console.log("localsessionproviderurl:" + localsessionproviderurl);
        //return;
        $.ajax({
            type: "POST",
            url: localsessionproviderurl,
            data: JSON.stringify(regData),
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (r) {
                console.log("success");
                console.log(r);
                console.log(r.d)
                //var obj = JSON.parse(r.d);                 
                retobj = JSON.parse(r.d);

                if (retobj.rs == EnumsInvReq.rs.Successful) {
                    if (sro == null) sro = retobj;
                    sro.isnm = uscreenname;
                    var qse = retobj.tg;
                   
                    SetLocalStorageForInProcessSession();
                    //InitiateInviteRequestUsingSignalCore(retobj.tg);
                    //showInviteRequestStatusContainer(retobj.tg);
                    console.log("isSignalCoreConnected" + isSignalCoreConnected);
                    if (isSignalCoreConnected == false) {
                        //firstInviteReqToBeSent = 1;
                        InitiateSignalCoreConnection(retobj.tg);
                    }
                    //else {
                    //    firstInviteReqToBeSent = 0;
                    //    var uid = document.getElementById("hdUserId").value;
                    //    if (sro != null)//sro becomes null sometimes on going back and coming again on this page. So please keep the check
                    //    {
                    //        sro.obyd = uid;
                    //        SendDataToWebApi(sro, EnumsIni.dataserviceactions.sendInvite);
                    //    }
                    //}

                    var uid = document.getElementById("hdUserId").value;
                    if (sro != null)//sro becomes null sometimes on going back and coming again on this page. So please keep the check
                    {
                        sro.obyd = uid;
                        //isBusySendingInvReq = true;
                        if (sro.comm_mode == "1") {
                            qseToSessionPageRandom = qse;
                            console.log("sro.comm_mode:1");
                            SendDataToWebApi(sro, EnumsIni.dataserviceactions.sendInvite);
                            return;
                        }
                        if (sro.comm_mode == "2") {
                            if (initiateCallWInvReq == true) {

                                SendDataToWebApi(sro, EnumsIni.dataserviceactions.sendInvite);
                                return;
                            }
                            else {
                                //Open Call Session Room   
                                HideInvReqUI();
                                ShowCallSessionRoom(qse);
                            }
                        }                        
                    }
                    
                }
                else if (retobj.rs == EnumsInvReq.rs.Unsuccessful) {
                    console.log(retobj.rtag);
                    if (retobj.rtag == "UserDetailsMissing") {
                        RedirectToSignInPageUcInvReq();
                        return;
                    }
                    else if (retobj.rtag == "InitiatorContactSame") {
                        HideInvReqUI();
                    }
                    else if (retobj.rtag == "ClientPhoneNoMissing") {
                        ShowConfirmPhoneNoUI();
                        HideInvReqUI();
                        return;
                    }
                    else if (retobj.rtag == "VerifyYourPhoneNo") {
                        // console.log("Tag-VerifyYourPhoneNo");
                        ShowVerifyPhoneNoUI();
                        HideInvReqUI();
                        return;
                    }
                    else if (retobj.rtag == "InsufficientClientBalance") {
                        HideInvReqUI();
                        //RedirectToAddFundsPage();
                        ShowUcFundsPopUpOnSessionProviderResp(retobj.rtag, obExpert.ScreenName, retobj.tags);
                        return;//
                    }
                    else if (retobj.rtag == "InsufficientClientBalance|CanStartFreeWith1Unit") {
                        HideInvReqUI();
                        //$("div.ucFundsPopUp").show();
                        //$("div.ucFundsPopUp  a.aAddFundsOnFundsPopUpPg")[0].href = "/shopping/addFunds?e=" + retobj.tg;
                        ShowUcFundsPopUpOnSessionProviderResp(retobj.rtag, obExpert.ScreenName, retobj.tags);
                        return;
                    }
                    else if (retobj.rtag == "InsufficientClientBalance|FreeMinutesAvailed") {
                        HideInvReqUI();
                        //$("div.ucFundsPopUp").show();
                        //$("div.ucFundsPopUp  a.aAddFundsOnFundsPopUpPg")[0].href = "/shopping/addFunds?e=" + retobj.tg;
                        ShowUcFundsPopUpOnSessionProviderResp(retobj.rtag, obExpert.ScreenName, retobj.tags);
                        return;
                    }
                    else if (retobj.rtag == "InsufficientClientBalance|AvailFreeMinutes") {
                        HideInvReqUI();
                        //$("div.ucFundsPopUp").show();
                        //$("div.ucFundsPopUp  a.aAddFundsOnFundsPopUpPg")[0].href = "/shopping/addFunds?e=" + retobj.tg;
                        ShowUcFundsPopUpOnSessionProviderResp(retobj.rtag, obExpert.ScreenName, retobj.tags);
                        return;
                    }
                    else if (retobj.rtag == "SufficientClientBalance|FreeMinutesAvailed") {
                        HideInvReqUI();
                        //$("div.ucFundsPopUp").show();
                        //$("div.ucFundsPopUp  a.aAddFundsOnFundsPopUpPg")[0].href = "/shopping/addFunds?e=" + retobj.tg;
                        ShowUcFundsPopUpOnSessionProviderResp(retobj.rtag, obExpert.ScreenName, pageurl, retobj.tags);
                        return;
                    }
                    else if (retobj.rtag == "InitiatorContactPhoneSame") {
                        HideInvReqUI();
                        /*RedirectToAddFundsPage();*/
                        return;
                    }
                    else if (retobj.rtag == "ExpertPhoneNosMissing") {
                        HideInvReqUI();
                        /*RedirectToAddFundsPage();*/
                        return;
                    }
                    else {
                        HideInvReqUI();
                        /*RedirectToAddFundsPage();*/
                        return;
                    }
                }               
            },
            error: function (xhr, textStatus, errorThrown) {
                alert("error: SendSessionProviderRequest");
                //alert("error");
                ////alert("error");
                //alert(xhr.status);
                //alert(xhr.responseText);
                //alert(textStatus);
                //alert(errorThrown);
               
            }
        });

    }                

   
    function SendDataToWebApi(obj, action) {
        var url = "";
           console.log("SendDataToWebApi");
        if (action == EnumsIni.dataserviceactions.sendInvite) {
             url = strWebApiURL + 'session/invite/request/send/j';
            //url = "https://ptr.wpi.manyzone.com/" + 'session/invite/request/send/j';
            if (isBusySendingInvReq) return;
            isBusySendingInvReq = true;
        }
        else if (action == EnumsIni.dataserviceactions.cancelInvite) {
             url = strWebApiURL + 'session/end/jn';            
            if (isBusyCancellingInvReq) return;
            isBusyCancellingInvReq = true;
        }
           
            var retobj = null;
            var obdata = new Object();
            obdata.data = JSON.stringify(obj);
            //console.log(obdata.data);
            $.ajax({
                type: 'POST',
                url: url,
                data: obdata,
                contentType: "application/x-www-form-urlencoded; charset=UTF-8", // this is the default value, so it's optional
                dataType: 'json',
                success: function (data) {
                    console.log("data:" + data);
                    if (data == null || data=="") { 
                        if (action == EnumsIni.dataserviceactions.sendInvite) {
                            isBusySendingInvReq = false;
                            invReqTimerObj.nextResendAfterTimeInSec = invReqTimerObj.elapsedTimeAfterInvReqInSec + 5;
                        }
                        if (action == EnumsIni.dataserviceactions.cancelInvite) {
                            isBusyCancellingInvReq = false;
                            sro = null;
                            $("div#ucInvReqUI").hide();
                        }
                        return;
                    }
                    retobj = JSON.parse(data);
                    if (action == EnumsIni.dataserviceactions.sendInvite) {
                        if (retobj.rs == EnumsInvReq.rs.Successful) {
                            invReqTimerObj.nextResendAfterTimeInSec = invReqTimerObj.elapsedTimeAfterInvReqInSec + invReqTimerObj.timeToResendInvReqInSec;
                            /*if (invReqTimerObj.invReqInitiatedAt == null) invReqTimerObj.invReqInitiatedAt = Date.now();*/
                            console.log("EnumsIni.dataserviceactions.sendInvite" + invReqTimerObj.elapsedTimeAfterInvReqInSec)
                            //if (invReqStage <= 2) {
                            //    invReqStage = 2;//request generated
                            //    var msg = "Request initiated. Advisor gets 3 minutes to accept your request.";
                            //    UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                            //    isBusySendingInvReq = false;
                            //}
                            if (invReqStage == EnumsInvReq.invreqstages.None || invReqStage == EnumsInvReq.invreqstages.initiating || invReqStage == EnumsInvReq.invreqstages.generated) {
                                invReqStage = EnumsInvReq.invreqstages.generated;
                                var msg = "Request initiated. Advisor gets 3 minutes to accept your request.";
                                UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                                //$("div#ucInvReqUI  div.divCloseBtnInvReq").show();
                            }                           
                        }
                        isBusySendingInvReq = false;
                    }


                    if (action == EnumsIni.dataserviceactions.cancelInvite) {
                        if (retobj.rs == EnumsInvReq.rs.Successful) {
                            sro.isse = true;
                            console.log("succesfully cancelled invite request");
                        }
                        else {

                        }
                        sro = null;
                        isBusyCancellingInvReq = false;
                        console.log("succesfully cancelled invite request: sro null");
                        $("div#ucInvReqUI").hide();
                    }
                    //alert("successful")
                    return;

                },
                error: function (xhr, textStatus, errorThrown) {
                   // alert("error: SendDataToWebApi");
                    ////alert(xhr.status);
                    //alert(xhr.responseText);
                    ////alert(textStatus);
                    //alert(errorThrown);
                    retobj = null;
                    if (action == EnumsIni.dataserviceactions.sendInvite) {
                        isBusySendingInvReq = false;
                    }
                }
            });
                   
    }
   
    function HandleConnectionStateChangedFromSignalCore(connectionState) {
        console.log("HandleConnectionStateChangedFromSignalCore: " + connectionState);
        //connectionState == "1"  -- "connected"
        if (connectionState == "1") {
            isSignalCoreConnected = true;
            document.getElementById("lblIsSignalCoreConnected").innerText = isSignalCoreConnected;
            //if (firstInviteReqToBeSent = 1)// if (!isFirstInviteReqSent)
            //{
            //    //isFirstInviteReqSent = true;
            //    firstInviteReqToBeSent = 0;
            //    var uid = document.getElementById("hdUserId").value;
            //    if (sro != null)//sro becomes null sometimes on going back and coming again on this page. So please keep the check
            //    {
            //        sro.obyd = uid;
            //        SendDataToWebApi(sro, EnumsIni.dataserviceactions.sendInvite);
            //    }               
            //}
            
        }
        else {
            isSignalCoreConnected = false;
            document.getElementById("lblIsSignalCoreConnected").innerText = isSignalCoreConnected;
        }
    }

    function IsReceivedDataValid(sessid) {

        if (sro === undefined) return false;
        if (sro === null) return false;// in multidevice cases, two different devices other than THIS are interacting. When they will send some mssage, THIS will also receive msg but SRO is null on this device.

        if (sessid == sro.sessid) {
            return true;
        }
        else {
            return false;
        }
    }

    

    
    function ManageInviteReqStateChangeByTimer() {
        if (sro === undefined || sro === null) {
            //self.clearInterval(timerInvReq);// Donot uncomment this as sro is not initiated on div load
            return;
        }
        //if (invReqTimerObj.invReqInitiatedAt == null) return;
        //console.log("ManageInviteReqStateChange");
       // elapsedTimeAfterInvReqInSec += 5; //here we donot need very accurate time so let us go on adding 5seconds with every ieration
        //elapsedTimeAfterInvReqInSec += Date.now() - invReqTimerObj.invReqInitiatedAt; //here we donot need very accurate time so let us go on adding 5seconds with every ieration

        //invReqTimerObj.elapsedTimeAfterInvReqInSec += Date.now() - invReqTimerObj.initializedAt;
        var now = new Date();
        var timeDiffms = Math.abs(new Date(now.getTime()) - new Date(invReqTimerObj.initializedAt.getTime()));
        var z = parseInt((timeDiffms) / 1000);//Number of seconds elapsed after the _startDate
        invReqTimerObj.elapsedTimeAfterInvReqInSec = z;
        /*invReqTimerObj.elapsedTimeAfterInvReqInSec = Date.now() - invReqTimerObj.initializedAt;*/
        console.log("invReqTimerObj.elapsedTimeAfterInvReqInSec" + invReqTimerObj.elapsedTimeAfterInvReqInSec);
        //var x = Math.abs(Date.now() - invReqTimerObj.initializedAt);
        //var xa = parseInt((x) / 1000);
        //console.log(xa);
        //return;
        //if (elapsedTimeInvReqInSec > 180) {
        //        if (invReqStage !== 5 && invReqStage !== 6 && invReqStage !== 8 && invReqStage!==7) {
        //            var msg = "Notification Timed Out";
        //            invReqStage = 7;//if already declined, accepted or ended then there is no meaning of  timedout.
        //            updateInviteReqUI(msg);
        //        }
        //}
        //if (chatHubUndefined == 1) { startSignalR("https://websi.manyzone.com"); }
        console.log("sro.comm_mode" + sro.comm_mode);
        if (sro.comm_mode == "2" && initiateCallWInvReq == false) {
            self.clearInterval(timerInvReq);
            return;
        }
        console.log("sro.comm_modeNXT" + sro.comm_mode);
        if (invReqTimerObj.elapsedTimeAfterInvReqInSec > invReqTimerObj.timeOutInvReqInSec) {
            if (invReqStage !== EnumsInvReq.invreqstages.accepted &&
                invReqStage !== EnumsInvReq.invreqstages.declined &&
                invReqStage !== EnumsInvReq.invreqstages.timeout &&
                 invReqStage !== EnumsInvReq.invreqstages.cancelled) {
                var msg = "Notification Timed Out";
                msg = "Not able to connect. ";
                msg="Oops! Advisor seems to be offline. We will inform you when he is online."
                invReqStage = EnumsInvReq.invreqstages.timeout;//if already declined, accepted or ended then there is no meaning of  timedout. 
                UpdateInviteReqUIOnStatusChange(msg, invReqStage);
                self.clearInterval(timerInvReq);
            }
        }

        if (isSessionRoomOpened) {
            if (lstCallSessionRoomMsgsQueue.length >= 1) {
                for (var i = lstCallSessionRoomMsgsQueue.length - 1; i >= 0; i--) {
                    //console.log(arr[i]);
                    var data = lstCallSessionRoomMsgsQueue[i];
                    SendDataReceivedFromSignalCoreToSessionRoom(data);
                    //lstCallSessionRoomMsgsQueue.shift(); // removes first element
                    lstCallSessionRoomMsgsQueue.pop();//Removes from the End of an Array
                }               
            }           
        }
       

        ResendInviteRequestIfReqd();

        if (invReqStage === EnumsInvReq.invreqstages.accepted ||
                invReqStage === EnumsInvReq.invreqstages.declined ||
                invReqStage === EnumsInvReq.invreqstages.timeout ||
                 invReqStage === EnumsInvReq.invreqstages.cancelled) {
            self.clearInterval(timerInvReq);

        }
        if (invReqTimerObj.elapsedTimeAfterInvReqInSec >= 65) {
            $("div#ucInvReqUI div.divCloseBtnInvReq").show();
        }       
       
    }
  
    function ResendInviteRequestIfReqd() {
        //if (invReqResendInitiated) return;
        //console.log("ResendInviteRequestIfReqd: elapsedTimeAfterInvReqInSec" + elapsedTimeAfterInvReqInSec + " nextResendAfterTimeInSec: " + nextResendAfterTimeInSec + " invReqStage:" + invReqStage);
        if (invReqTimerObj.countInvReqResends >= invReqTimerObj.maxInvReqResends) return;
        if (invReqTimerObj.elapsedTimeAfterInvReqInSec < invReqTimerObj.nextResendAfterTimeInSec) return;
        if (invReqStage === EnumsInvReq.invreqstages.accepted ||
                invReqStage === EnumsInvReq.invreqstages.declined ||
                invReqStage === EnumsInvReq.invreqstages.timeout ||
                 invReqStage === EnumsInvReq.invreqstages.cancelled) {
            return;
        }
        //console.log("isBusySendingInvReq:" + isBusySendingInvReq + "sro.sessid: " + sro.sessid)
        if (isBusySendingInvReq) return;
        if (sro==undefined || sro == null) return;
        if (sro.sessid == null || sro.sessid == "") return;
        //invReqResendInitiated = true;
        //console.log("timeToResendInvReqInSec:" + timeToResendInvReqInSec);
        //console.log("resend inviterequest");
        //ResendInviteRequest(sro, EnumsIni.dataserviceactions.resendInvReq);
       invReqTimerObj.countInvReqResends += 1;
        // isBusySendingInvReq = true;



        //return; //JUST FOR TESTING ON 27092023
        SendDataToWebApi(sro, EnumsIni.dataserviceactions.sendInvite);
        
    }


   
  
</script>
<script>

    
   
    function HandlePhoneNoConfirmed(ctrycode, phwoc) {
        //alert("Received Phone no:" + ctrycode + "|" + phwoc);
        
        HideConfirmPhoneNoUI();
       // return;
        ShowInvReqUI();
       
        
        SendSessionProviderRequest(sessPgUrl, ctrycode + "|" + phwoc);
        
    }
    //HandlePhoneNoConfirmed
    function HandlePhoneNoVerified(ctrycode, phwoc) {
        //alert("Received Phone no:" + ctrycode + "|" + phwoc);
        HideVerifyPhoneNoUI();        
        //ShowInvReqUI();
        //SendSessionProviderRequest(sessPgUrl, ctrycode + "|" + phwoc);

    }
    function HandleSessionRoomOpenedMessage() {
        isSessionRoomOpened = true;
    }

    
    
</script>
<script title="Can be Delted">
    function LastInProcessSession() {

    }

    function RemoveDynamicClassFromMasterSessionRoomContainer() {
       
        $("#divSessionRoomContainerPg").removeClass(function (index, className) {
            return (className.match(/(^|\s)dynamic\S+/g) || []).join(' ');
        });
    }

    function RaiseAlertFromIFrame(txt) {
        //alert(txt);
    }
    
</script></div>
            <div>
<style>
    div.ucFundsPopUp {
    text-align: center;   
    position: fixed;
    width: 80%;
    max-width: 500px;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -120%);
    /* width: 100%; */
    /* height: 110px; */
    /* height: 100%; */
    background-color: #eef3f8;
    background-color: white;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 5px;
    /* border: 1px solid aqua; */
    /* overflow: auto; */
    display: none;
}
   div.ucFundsPopUp .fundsPopUpContent{
        text-align: center;
        padding:10px; padding-right:20px;
    }
   div.ucFundsPopUp .sessionProviderRespText{
        text-align: center;
        padding:10px; 
        /*padding-right:20px;*/
    }
   div.ucFundsPopUp  .btnAddFunds,.btnContinueWithChat{  font-size:0.9em; padding:5px; padding-left:20px; padding-right:20px; font-weight: 600;
    line-height: 1.4;
    letter-spacing: .05em; border-radius:2px;} 
        div.SiteThemeA div.ucFundsPopUp  .btnAddFunds,.btnContinueWithChat{background-color:blue; color:white;border-color: cornflowerblue;}
    div.SiteThemeB div.ucFundsPopUp  .btnAddFunds,.btnContinueWithChat{background-color:#892778; color:white;border-color: #892778;}
  
        div.ucFundsPopUp div.sessionProviderRespButtons{padding-bottom:10px;}

</style>
<div class="ucFundsPopUp">
    <div class="fundsPopUpContent">
       
        <div style="display:none;"><a class="aAddFundsOnFundsPopUpPg" href="/shopping/addFunds"></a></div>
         <div class="divCloseBtnFundsPopUp" id="divCloseBtnFundsPopUp" style="position: absolute; right: 5px; top: 5px; /*display: table-cell;*/  vertical-align: middle; cursor: pointer;">
            <div style="position: relative; display: inline-block; width: 1.7em; height: 1.7em;">
                <svg class="svg-icon" viewBox="0 0 20 20">
                    <path fill="#a0a0a0" d="M15.898,4.045c-0.271-0.272-0.713-0.272-0.986,0l-4.71,4.711L5.493,4.045c-0.272-0.272-0.714-0.272-0.986,0s-0.272,0.714,0,0.986l4.709,4.711l-4.71,4.711c-0.272,0.271-0.272,0.713,0,0.986c0.136,0.136,0.314,0.203,0.492,0.203c0.179,0,0.357-0.067,0.493-0.203l4.711-4.711l4.71,4.711c0.137,0.136,0.314,0.203,0.494,0.203c0.178,0,0.355-0.067,0.492-0.203c0.273-0.273,0.273-0.715,0-0.986l-4.711-4.711l4.711-4.711C16.172,4.759,16.172,4.317,15.898,4.045z"></path>
                </svg>
            </div>
        </div>
    </div>
   
    <div class="sessionProviderRespText"></div>
    <div class="sessionProviderRespButtons"><input type="button" value="Add Funds" class="btnAddFunds" id="btnAddFundsOnFundsPopUpPg" />
            <input type="button" value="OK, Chat" class="btnContinueWithChat" id="btnContinueWihChat" /></div>
</div>

<script type="text/javascript">
    document.getElementById('btnAddFundsOnFundsPopUpPg')
        .addEventListener('click', function (event) {          
            RedirectToAddFundsPageOnFundsPopUpPg();
        });
    document.getElementById('divCloseBtnFundsPopUp')
        .addEventListener('click', function (event) {
            $("div.ucFundsPopUp").hide();
            $("div#divTransPageModal").hide();
        });
    document.getElementById('btnContinueWihChat')
        .addEventListener('click', function (event) {
            /*alert("confirm");*/
            ConfirmContinueWithChat();
        });
    function RedirectToAddFundsPageOnFundsPopUpPg() {
        $("div.ucFundsPopUp  a.aAddFundsOnFundsPopUpPg")[0].click();
        $("div.ucFundsPopUp").hide();
        $("div#divTransPageModal").hide();
    }
    function ConfirmContinueWithChat() {
        $("div.ucFundsPopUp").hide();
        $("div#divTransPageModal").hide();
        OnChatCallButtonClick(varUcInvReq.obExpert, varUcInvReq.strSessionCommMode, varUcInvReq.strSessionChargeType, varUcInvReq.pageurl + "&confirm=true");
    }
    function ShowUcFundsPopUpOnSessionProviderResp(sessiontag, escreenname ,tags) {
        var displaytext = "";
        var minBalanceINR = 0.00;
        var minBalanceUSD = 0.00;
        var countRet = 0;
        if (retobj.tags != null) {
            for (var k in retobj.tags) {
                countRet += 1;
                console.log(k, retobj.tags[k]);
                if (k = "MinBalanceINR") {
                    minBalanceINR = retobj.tags[k];
                }
                if (k = "MinBalanceUSD") {
                    minBalanceUSD = retobj.tags[k];
                }
            }
        }
      
        if (sessiontag == "InsufficientClientBalance|FreeMinutesAvailed") {
            displaytext = 'You have already availed Free Minutes with "' + escreenname + '". Minimum balance required for 5 minutes of Chat with ' + escreenname + ' is INR ' + minBalanceINR + ' ($ ' + minBalanceUSD + ')';
            $("div.ucFundsPopUp #btnAddFundsOnFundsPopUpPg").show();
            $("div.ucFundsPopUp #btnContinueWihChat").hide();
        }
        if (sessiontag == "InsufficientClientBalance|CanStartFreeWith1Unit") {
            displaytext = 'Start your free chat with multple experts. Minimum wallet balance required is INR ' + minBalanceINR + ' ($ ' + minBalanceUSD + ')';
            $("div.ucFundsPopUp #btnAddFundsOnFundsPopUpPg").show();
            $("div.ucFundsPopUp #btnContinueWihChat").hide();
        }
        if (sessiontag == "InsufficientClientBalance") {
            displaytext = 'Minimum balance required for 5 minutes of Chat with "' + escreenname + '" is INR ' + minBalanceINR + ' ($ ' + minBalanceUSD + ')';
            $("div.ucFundsPopUp #btnAddFundsOnFundsPopUpPg").show();
            $("div.ucFundsPopUp #btnContinueWihChat").hide();
        }
        if (sessiontag == "InsufficientClientBalance|AvailFreeMinutes") {
            displaytext = 'Avail 3 Free Minutes. Minimum balance required for 3 Free + 5 minutes of Paid Chat with "' + escreenname + '" is INR ' +  minBalanceINR +  ' ($ ' + minBalanceUSD + ')';
            $("div.ucFundsPopUp #btnAddFundsOnFundsPopUpPg").show();
            $("div.ucFundsPopUp #btnContinueWihChat").hide();
        }
        if (sessiontag == "SufficientClientBalance|FreeMinutesAvailed") {
            displaytext = 'You have already availed Free Minutes with "' + escreenname + '". You can continue with paid chat.';
            $("div.ucFundsPopUp #btnAddFundsOnFundsPopUpPg").hide();
            $("div.ucFundsPopUp #btnContinueWihChat").show();
           
        }
        $("div.ucFundsPopUp div.sessionProviderRespText").text(displaytext);
        $("div.ucFundsPopUp").show();        
        $("div#divTransPageModal").show();

    }
   
</script></div>
            <div style="display:none;"><a style="display:none;" id="aApp_NavigateTo" herf="#" class="aApp_NavigateTo"></a></div>
            </div>
        <style>
    .divFreeMinutesPopUp {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 10; font-family:Verdana, Geneva, Tahoma, sans-serif;
}
    .divFreeMinutesPopUp .FreeMinutesPopUpText{
        padding-top:15px;
    }
   .divFreeMinutesPopUp svg-icon {
    position: absolute;
    top: 0;
    right: 0;
    /*bottom: 0;
    left: 0;
    margin: auto;*/
    width: 1.25em;
    height: 1.25em;
}

.divFreeMinutesPopUp .divFreeMinutesPopUpContent {
    text-align: center;
    position: absolute;
    left: 50%;
    top: 50%;
    /*left: 50%;
    top: 50%;*/
    transform: translate(-50%, -50%);
    width: 80%;
    /*width: 100%;*/
    max-height: 80%;
    /*height:100%;*/
    background-color: rgb(255, 255, 255);
    border-radius: 8px;
    padding: 30px;
    overflow: auto;
}
.divFreeMinutesPopUp div.FreeMinutesPopUpTitle {
    font-size: 25px;
    /*font-family: Roboto;*/
    font-weight: bold;
    font-stretch: normal;
    font-style: normal;
    line-height: normal;
    letter-spacing: normal;
    color: #17bacd;
    margin-top: 33px;
    margin-bottom: 11px;
}
.divFreeMinutesPopUp a.FreeMinutesPopUpStartbtn {
    /*font-family: Roboto;*/
    border-radius: 4px;
    background-color: #f78f06;
    font-size: 20px;
    font-weight: bold;
    color: #fff !important;
    text-shadow: none;
    width: 100%;
    display: block;
    padding: 10px 0;
    cursor:pointer;
}

.divFreeMinutesPopUp a {
    text-decoration: none;
}
</style>
    </form>
   <!-- Go to www.addthis.com/dashboard to customize your tools --> 
   
    <script>
        //const channel4Broadcast = new BroadcastChannel('channel4');
        //channel4Broadcast.onmessage = (e) => {
        //    value = e.data.key;

        //    console.log("Broadcast msg received at Client");
        //    //var obj = JSON.parse(e.data);
        //    var typ = e.data.type;
        //    if (typ == undefined || typ == null || typ == "") {
        //        console.log(" typ is null");
        //    }
        //    else {
        //        console.log(" type :" + typ);
        //        if (typ == "StopNotificationSound") {
        //            countAudioLoops = maxAudioLoops + 1;
        //            document.getElementById('btnOpenNativeApp').click();
        //        }
        //        else {
        //            countAudioLoops = 0;
        //            //document.getElementById('notification').muted = false;
        //            document.getElementById('notification').muted = false;
        //            document.getElementById('notification').play();
        //            console.log('Broadcast msg ended');
        //        }
        //    }


        //    //countAudioLoops = 0;
        //    ////document.getElementById('notification').muted = false;
        //    //document.getElementById('notification').muted = false;
        //    //document.getElementById('notification').play();
        //    //console.log('Broadcast msg ended');
        //}

        //var useOldMethodPopPush=false;
        //if (useOldMethodPopPush) {
        //    //function pushWindowHistory(pageurlA, pageurlB) {
        //    //    console.log("Site: pushWindowHistory");
        //    //    window.history.pushState({ path: pageurlA, mytag: 'tag' }, '', pageurlB);

        //    //}
        //    //function popWindowHistory() {
        //    //    // alert("popWindowHistory");
        //    //    //window.history.back(-1);
        //    //    console.log("Site: onpopstate");
        //    //    window.history.go(-1);
        //    //}
        //    //window.onpopstate = function (event) {

        //    //    // "event" object seems to contain value only when the back button is clicked
        //    //    // and if the pop state event fires due to clicks on a button
        //    //    // or a link it comes up as "undefined"
        //    //    console.log("Site: onpopstate");
        //    //    if (event) {
        //    //        // Code to handle back button or prevent from navigation
        //    //        closeModalSingle();
        //    //    }
        //    //    else {
        //    //        // Continue user action through link or button
        //    //    }
        //    //}
        //}


        //if ('serviceWorker' in navigator) {
        //    navigator.serviceWorker.register('/firebase-messaging-sw.js').then(function (reg) {
        //        // registration worked
        //        console.log('Registration succeeded. Scope is ' + reg.scope);
        //    }).catch(function (error) {
        //        // registration failed
        //        console.log('Registration failed with ' + error);
        //    });

        //    // navigator.serviceWorker.addEventListener('message', ... ) should work too
        //    navigator.serviceWorker.onmessage = function (e) {
        //        // messages from service worker.
        //        console.log('e.data', e.data);
        //        //if (e.data == "FirebasePushNotificationTest") {
        //        //    alert("FirebasePushNotificationTest");
        //        //}
        //        //alert("FirebasePushNotificationTest");
        //        //var myAudio = new Audio('messaging/ringin.wav');
        //        //myAudio.play();
        //        countAudioLoops = 0;
        //        document.getElementById('notification').muted = false;
        //        document.getElementById('notification').play();
        //        //alert("Push Notification");
        //    };


        //};
    </script>
    
    <script>
        //var maxAudioLoops = 7;
        //var countAudioLoops = 0;
        //document.getElementById("notification").onended = function () { onAudioEnded() };
        //function onAudioEnded() {
        //    if (countAudioLoops <= maxAudioLoops) {
        //        countAudioLoops++;
        //        document.getElementById("notification").play();
        //    }
        //}
    </script>

    <script>
        //const channel4Broadcast = new BroadcastChannel('channel4');
        //var maxAudioLoops = 7;
        //var countAudioLoops = 0;
        //document.addEventListener("DOMContentLoaded", HandleServiceWorkerOnLoad);
        //function HandleServiceWorkerOnLoad() {
        //    channel4Broadcast.onmessage = (e) => {
        //        value = e.data.key;

        //        console.log("Broadcast msg received at Client");
        //        //var obj = JSON.parse(e.data);
        //        var typ = e.data.type;
        //        if (typ == undefined || typ == null || typ == "") {
        //            console.log(" typ is null");
        //        }
        //        else {
        //            console.log(" type :" + typ);
        //            if (typ == "StopNotificationSound") {
        //                countAudioLoops = maxAudioLoops + 1;
        //                document.getElementById('btnOpenNativeApp').click();
        //            }
        //            else {
        //                countAudioLoops = 0;
        //                //document.getElementById('notification').muted = false;
        //                document.getElementById('notification').muted = false;
        //                //document.getElementById('notification').play();
        //                var playPromise = document.getElementById('notification').play();
        //                // In browsers that don’t yet support this functionality,
        //                // playPromise won’t be defined.
        //                if (playPromise !== undefined) {
        //                    playPromise.then(function () {
        //                        // Automatic playback started!
        //                        console.log("Automatic playback started.");
        //                    }).catch(function (error) {
        //                        console.log("Automatic playback failed.");
        //                        // Automatic playback failed.
        //                        // Show a UI element to let the user manually start playback.
        //                    });
        //                }
        //                console.log('Broadcast msg ended');
        //            }
        //        }


        //        //countAudioLoops = 0;
        //        ////document.getElementById('notification').muted = false;
        //        //document.getElementById('notification').muted = false;
        //        //document.getElementById('notification').play();
        //        //console.log('Broadcast msg ended');
        //    }

        //    if ('serviceWorker' in navigator) {
        //        navigator.serviceWorker.register('/firebase-messaging-sw.js').then(function (reg) {
        //            // registration worked
        //            console.log('Registration succeeded. Scope is ' + reg.scope);
        //        }).catch(function (error) {
        //            // registration failed
        //            console.log('Registration failed with ' + error);
        //        });

        //        // navigator.serviceWorker.addEventListener('message', ... ) should work too
        //        navigator.serviceWorker.onmessage = function (e) {
        //            // messages from service worker.
        //            console.log('e.data', e.data);
        //            //if (e.data == "FirebasePushNotificationTest") {
        //            //    alert("FirebasePushNotificationTest");
        //            //}
        //            //alert("FirebasePushNotificationTest");
        //            //var myAudio = new Audio('messaging/ringin.wav');
        //            //myAudio.play();
        //            countAudioLoops = 0;
        //            document.getElementById('notification').muted = false;
        //            //document.getElementById('notification').play();
        //            var playPromise = document.getElementById('notification').play();
        //            // In browsers that don’t yet support this functionality,
        //            // playPromise won’t be defined.
        //            if (playPromise !== undefined) {
        //                playPromise.then(function () {
        //                    // Automatic playback started!
        //                    console.log("Automatic playback started.");
        //                }).catch(function (error) {
        //                    console.log("Automatic playback failed.");
        //                    // Automatic playback failed.
        //                    // Show a UI element to let the user manually start playback.
        //                });
        //            }
        //            //alert("Push Notification");
        //        };

        //    };


        //    document.getElementById("notification").onended = function () { onAudioEnded() };
        //}

        //function onAudioEnded() {
        //    if (countAudioLoops <= maxAudioLoops) {
        //        countAudioLoops++;
        //        document.getElementById("notification").play();
        //    }
        //}




    </script>

       <script>

         // console.log = function () { };
           // var strhostMpg = 'https://www.manyzone.com';
        //if (strhostMpg = "http://www.manyzone.com") {

        //}
        //else {
        //    console.log = function () { };
        //}
           
           
           var originalUrl = 'https://www.manyzone.com/member/sign-up.aspx?action=profile;u=606461';
           //var spuid = document.getElementById("hdUserId").value;
           var spuid = document.getElementById("hdUserId").value;

        var myHistory = [];
        //var originalUrl = window.location.href;
        myHistory.push(originalUrl);
       
        //console.log(window.location.href);
        //console.log(window.location.href);
           //|| spuid != "80644"
        var usePushSPA = true;
        if ((spuid == "80644" || spuid != "80644") && usePushSPA == true) {
            function change(state) {
                if (typeof HandlePopStateOnPage === 'function') {
                    //alert("HandlePopStateOnPage");
                    console.log("HandlePopStateOnPage");
                    if (HandlePopStateOnPage(state)) {
                        return;
                    }
                    else {
                        //go ahead;
                    }
                }
                if (state === null) { // initial page
                    console.log("state NULL");
                    //console.log("window.location.href:" + window.location.href);
                    //originalUrl = myHistory[0];
                    originalUrl = window.location.href;
                    originalUrl = originalUrl.replace(/#/g, "");
                    var base_url = window.location.origin;
                    var host = window.location.host;
                    var pathArray = window.location.pathname.split('/');
                    var pathName = window.location.pathname;
                    //if (pathName == "/messages/" || pathName == "/messages" || pathName == "/m/messages/" || pathName == "/m/messages") {
                    //    return;//return on pop state
                    //}
                    console.log("originalUrl:" + originalUrl);
                    console.log("base_url:" + base_url);
                    console.log("host:" + host);
                    console.log("pathName:" + pathName);
                    console.log("pathArray:" + pathArray);

                    //if (originalUrl.indexOf(""))
                    //var urlchk = "";
                    //if (originalUrl.indexOf('?') > -1) {
                    //    urlchk = href.split('?')[0];
                    //}
                    //else {
                    //    urlchk = originalUrl;
                    //}
               
                    //if (urlchk.indexOf("/messages") > -1 || urlchk.indexOf("/m/messages") > -1) {
                    
                    //console.log(originalUrl);
                    //$("div").text("Original");
                    //var href = "http://manyzone-local.com/expertsop/astrology?pmoflow=3_vp2doZdL" + "&smastr=empty";
                    var href = "";
                    //console.log(originalUrl.indexOf('?'));
                    //console.log(originalUrl.indexOf('smastr=empty'));
                    if (originalUrl.indexOf('?') != -1) {
                        if (originalUrl.indexOf('smastr=empty') >= 0) {
                            href = originalUrl;
                        }
                        else {
                            href = originalUrl + "&smastr=empty"
                        }
                    }
                    else {
                        href = originalUrl + "?smastr=empty"
                    }
                    //console.log("href:" + href);
                    //var href=originalUrl + "&smastr=empty";;
                    //$("div.main").html(null);
                    //<img id="imgLoading" class="imgLoading" alt="Loading..." style="width: 2em; height: 2em; margin: 0px; vertical-align:middle; display:inline-block;"
                    //       src="/images/icon/loading.gif" />
                    $("div.main").html(null);
                    $("div.main").prepend('<img id="theImg" src="/images/icon/loading.gif" style="width: 2em; height: 2em; margin: 0px; vertical-align:middle; display:inline-block;"/>');

                    $("div.main").load(href);
                    //$("div.main").text(original);

                    console.log("state: NULL");
                    console.log("href:" + href);
                    BodyScrollToTop();
                } else { // page added with pushState
                    //$("div").text(state.url);
                    //console.log("state.url:" + state.url);

                    if (state.url === undefined || state.url === null) {
                        //console.log("location:" + location);
                        //$("div.main").load(location.toString());
                        console.log("state.url undefined:" );
                    }
                    else {
                        console.log("state.url NOT undefined:");
                        $("div.main").html(null);
                        $("div.main").prepend('<img id="theImg" src="/images/icon/loading.gif" style="width: 2em; height: 2em; margin: 0px; vertical-align:middle; display:inline-block;"/>');
                        $("div.main").load(state.url);
                    }
                    BodyScrollToTop();

                }
            }

            //$(window).on("popstate", function (e) {
            //    //console.log("e.originalEvent.state:" + e.originalEvent.state);
            //    alert("original:" + original);
            //    alert("popstate:" + "location: " + document.location + ", state: " + JSON.stringify(e.originalEvent.state));
            //    change(e.originalEvent.state);
            //});

            //$("a").click(function (e) {
            //    e.preventDefault();
            //    console.log("anchor click");
            //    //history.pushState({ url: "/page2" }, "/page2", "page 2");
            //    var href = $(this).attr('href');
            //    console.log(href);
            //    $("div.main").load(href + "&smastr=empty");
            //    window.history.pushState({ path: href }, '', href);
            //});

            //$("a").on("click", function (e) {
            //    e.preventDefault();
            //    //console.log($(this).text());
            //    console.log("anchor click");
            //    //history.pushState({ url: "/page2" }, "/page2", "page 2");
            //    var href = $(this).attr('href');
            //    console.log(href);
            //    $("div.main").load(href + "&smastr=empty");
            //    window.history.pushState({ path: href }, '', href);
            //});

            $(document).on("click", 'a', function (e) {
                /*alert("Anchor click");*/
                console.log("SiteMasterClick -1");
                //return false;
                var href = $(this).attr('href');
                var stopropm = $(this).attr('data-stoppropm');
                //alert(stopropm);
                if (stopropm == "true") {
                    e.stopPropagation();
                    return false;
                }
                //Newly added ***************
                var currentloc = window.location.href;
                var currlocchk="";
                if (currentloc.indexOf('?') > -1) {
                    currlocchk = currentloc.split('?')[0];
                }
                else {
                    currlocchk = currentloc;
                }
                //|| currlocchk.indexOf("/notifications/push/") > -1
                if (currlocchk.indexOf("/member/sign-in") > -1 || currlocchk.indexOf("/member/sign-up") > -1 || currlocchk.indexOf("/signup/expert") > -1 || currlocchk.indexOf("/registration/") > -1 || currlocchk.indexOf("/member/forgotPass") > -1 || currlocchk.indexOf("/my-expertzone/") > -1 ) {
                    //alert("dodo");
                    //var target = $(event.data);
                    //alert(target.toString());
                    window.location.href = href;
                    e.stopPropagation();
                    return false;
                }
                //Newly added ***************
                
                
                var uid = document.getElementById("hdUserId").value;
                //if (uid === undefined || uid === null || uid === "") {
                //}
                //else if (uid=="81254") {
                //    alert("uid");
                //}
                console.log("clickonSiteMaster:"+href);
                if (href === undefined || href === null || href === "") return false;
                /*if (href.indexOf("/page-") > -1) return false;*/
               
                e.preventDefault();
               // e.stopPropagation();
               
                var isMemberWRed;
                var urlchk = "";
                if (href.indexOf('?') > -1) {
                    urlchk = href.split('?')[0];
                    //if (urlchk.indexOf("index.aspx")>-1) {
                    //    if (href.split('?')[1].indexOf("page=") > -1) return false; //So for paging pages, we are return false.
                    //}
                    if (urlchk.indexOf("/page-") > -1) return false;//So for paging pages, we are return false.
                    
                }
                else {
                    urlchk = href;
                    if (urlchk.indexOf("/page-") > -1) return false;//So for paging pages, we are return false.
                }
                //alert(urlchk);
                console.log("SiteMasterClick -2");
                //return false;
                if (urlchk.indexOf("/messages") > -1 || urlchk.indexOf("/m/messages") > -1 || urlchk.indexOf("/mynotifications") > -1 || urlchk.indexOf("/m/mynotifications") > -1) {
                    if (uid === undefined || uid === null || uid === "") {
                        window.location.href = href;
                        e.stopPropagation();
                        return false;
                    }
                    else {
                       
                    }
                    //alert("doe");
                    //window.location.href = href;
                    //e.stopPropagation();
                    //return false;

                    
                }
                if (urlchk.indexOf("/session/sessionprovider") >= 0 || urlchk.indexOf("/m/session/sessionprovider") >= 0) {
                    window.location.href = href;
                    e.stopPropagation();
                    return false;
                }
                if (urlchk.indexOf("/cart/view") >= 0 || urlchk.indexOf("/m/cart/view") >= 0) {
                    if (uid === undefined || uid === null || uid === "") {
                        window.location.href = href;
                        e.stopPropagation();
                        return false;
                    }
                }
                if (urlchk.indexOf("/pages/submit/message") > -1) {
                    //window.location.href = href;
                    //e.stopPropagation();
                    //return false;
                    if (uid === undefined || uid === null || uid === "") {
                        window.location.href = href;
                        e.stopPropagation();
                        return false;
                    }
                }
                if (urlchk.indexOf("/member/sign-in") > -1 || urlchk.indexOf("/member/sign-up") > -1 || urlchk.indexOf("/signup/expert") > -1 || urlchk.indexOf("/registration/") > -1 || urlchk.indexOf("/member/forgotPass") > -1) {
                    //if (uid === undefined || uid === null || uid === "") {
                       
                    //}
                    window.location.href = href;
                    e.stopPropagation();
                    return false;
                }
                if (urlchk.indexOf("/my-expertzone/upload-photo.aspx") > -1 || urlchk.indexOf("/my-expertzone/") > -1 ) {
                    //if (uid === undefined || uid === null || uid === "") {

                    //}
                    window.location.href = href;
                    e.stopPropagation();
                    return false;
                }
                //if (urlchk.indexOf("/post/article") > -1 ) {
                //    //if (uid === undefined || uid === null || uid === "") {

                //    //}
                //    //window.location.href = href;
                //    e.stopPropagation();
                //    return false;
                //}

                console.log("SiteMasterClick -3");
                //return false;

               // alert("dodo");
                //console.log($(this).text());
                //console.log("anchor click");
                //history.pushState({ url: "/page2" }, "/page2", "page 2");
                
                //console.log(href);
                var newhref = "";
                if (href.indexOf('?') != -1) {
                    if (href.indexOf('smastr=empty') >= 0) {
                        newhref = href;
                    }
                    else {
                        newhref = href + "&smastr=empty"
                    }
                }
                else {
                    newhref = href + "?smastr=empty"
                }
                if (href.indexOf('smastr=empty') >= 0) {
                    href = href.replace("smastr=empty", "");
                }
                if (href.indexOf('&&') >= 0) {
                    href = href.replace("&&", "&");
                }
                $("div.main").html(null);
                $("div.main").prepend('<img id="theImg" src="/images/icon/loading.gif" style="width: 2em; height: 2em; margin: 0px; vertical-align:middle; display:inline-block;"/>');
               
                $("div.main").load(newhref);
                console.log("SiteMasterClick -4");
                //return false;
                //if (href != window.location) {
                //    //window.history.pushState({ path: pageurl }, '', pageurl);
                //    //window.history.replaceState({ path: pageurl }, '', pageurl);
                //    window.history.pushState({ url: newhref }, '', href);
                //    //console.log("pushedstate:" + href);
                //    console.log("new url:" + newhref);
                //}
               
                var originalUrlA = window.location.href;
                //if (originalUrl.indexOf('member/sign-in') >= 0) {
                //    window.history.replaceState({ url: newhref }, '', href);
                //}
                //else { window.history.pushState({ url: newhref }, '', href); }

                if (originalUrlA.indexOf('member/sign-in') >= 0) {
                    if (newhref.indexOf('member/sign-in') >= 0) {
                        window.history.replaceState({ path: newhref }, '', href);
                    }
                    else {
                        window.history.pushState({ path: newhref }, '', href);
                    }
                }
                else { window.history.pushState({ path: newhref }, '', href); }

               
                //console.log("pushedstate:" + href);
                console.log("new url:" + newhref);
                BodyScrollToTop();
                e.stopPropagation();

            });

            //(function (original) { // overwrite history.pushState so that it also calls
            //    // the change function when called
            //    history.pushState = function (state) {
            //        change(state);
            //        //console.log('this: ' + this);
            //        //console.log('arguments: ' + arguments);
            //        return original.apply(this, arguments);
            //    };
            //})(history.pushState);

            function BodyScrollToTop() {
                document.body.scrollTop = document.documentElement.scrollTop = 0;
            }

            //$('div.ucExpertsList .aEScreenNameJs').click(function (e) {

            //    e.preventDefault();
            //    alert("click");
            //    var href = $(this).attr('href');
            //    $("div.main").load(href + "&smastr=empty");
            //    if (href != window.location) {
            //        //window.history.pushState({ path: pageurl }, '', pageurl);
            //        window.history.pushState({ path: href }, '', href);
            //    }
            //    return false;
            //});


            var DonotUseUnload = true;
            //WORks:
            if (!DonotUseUnload) {
                $(window).on('beforeunload', function () {
                    return 'Your own message goes here...';
                });
            }
            //WORks:
            if (!DonotUseUnload) {
                window.onbeforeunload = askUser;
                function askUser() {
                    return "The changes you made will be loast if you navigate away from this page";
                }
            }
        }
       

       </script>

    <script>
        function ShowLoadingIfBusy(bln) {
            if (bln) $('.divLoadingImage').show();
            else $('.divLoadingImage').hide();
            
        }
       
    </script>
    <script>
        document.addEventListener("DOMContentLoaded", RemoveEmptySiteMasterParamFromURL);
        function RemoveEmptySiteMasterParamFromURL() {
            var originalurl = window.location.href;
            if (originalurl.indexOf("?") == -1) return;
            var originalurlfirstpart = originalurl.split("?")[0];
          
            let url = new URL(originalurl);           
            let params = new URLSearchParams(url.search);       
            
            params.delete('smastr');            
            //let newUrl = url.origin + '/' + params.toString();
            let newUrl = originalurlfirstpart + "?" + params.toString();
            window.history.replaceState({ path: originalUrl }, '', newUrl);
        }
    </script>
   
</body>
</html>

<script>
    //Commented on 20092022. Check if we actually need it . Commenred coz in modal popup on clicking CALL button of expert, the page gets reloaded in frame.
    //IsSmastrEmptyOnWindowLoc();
    //End-Commented on 20092022
    function IsSmastrEmptyOnWindowLoc(){
        originalUrl = window.location.href;
        originalUrl = originalUrl.replace(/#/g, "");
      
        var newhref = "";       
        if (originalUrl.indexOf('?') != -1) {
            if (originalUrl.indexOf('smastr=empty') >-1) {
                newhref = originalUrl.replace('smastr=empty', "");
                if (newhref.split('?')[1] === undefined || newhref.split('?')[1] === null || newhref.split('?')[1] === "") {
                    newhref=newhref.replace('?', "");
                }
               window.location.href = newhref;
            }        
        }       
    }

    var uidPgCmn = '';
    //document.addEventListener("DOMContentLoaded", HandlePageCommonLoad);
    HandlePageCommonLoad();
    function HandlePageCommonLoad() {
        //alert(uidPgCmn);
        var ele = document.getElementById("hdUserId");
        if (ele === undefined || ele === null) return;
        var uid=document.getElementById("hdUserId").value;
        if (uid === undefined || uid === null || uid === ""){
            if (uidPgCmn === undefined || uidPgCmn === null || uidPgCmn === "") {
                //OK
                console.log("uid is not defined. ");
                return;
            }
            else {               
                //alert("UserSignedIn");
                console.log("uid is not defined. But User is SignedIn");
                ReloadPageAsPerPgCommon();              
                return;
            }
        }
        if (uidPgCmn === undefined || uidPgCmn === null || uidPgCmn === "") {            
            //alert("SignedOut");
            console.log("User is signed out");
            ReloadPageAsPerPgCommon();
            return;
        }
        else {
            if (uidPgCmn === uid) {
                //OK
                console.log("uidPgCmn =uid ");
            }
            else {               
                //alert("SignedInAsNewUser");
                console.log("User is signed in as new user");
                ReloadPageAsPerPgCommon();
                return;
            }
        }
    }
    function ReloadPageAsPerPgCommon() {
        console.log("ReloadPageAsPerPgCommon");        
        window.location.reload();
    }
</script>
<script>
       function CheckMasterDuplicacy() {
           //alert("CheckMasterDuplicacy");
           //var uids = document.getElementById("leftSideBar").getElementsByClassName("memberIn");
           //let uids = document.querySelectorAll('hdUserId');
           let uids = document.getElementsByName("hdUserId");
           var count = 0;
           for (let elem of uids) {
               //alert("elem");
           //alert(elem.innerHTML); // "test", "passed"
               count += 1;
           }
           console.log("count" + count);
           if (count > 1) {
               console.log("master duplicity");
               ReloadPageAsPerPgCommon();
           }
       }
      // document.addEventListener("DOMContentLoaded", CheckMasterDuplicacy);//This won't work in some cases.
       CheckMasterDuplicacy();//Thisis working in most of the cases
   </script>
<div class="PageCommon"></div>

Latest requests

# Url Url Source Date
1 https://www.manyzone.com/member/si… 2024-05-16 01:26:49
2 https://thebolditalic.com/?gi=3e53… 2024-05-16 01:26:46
3 https://www.mandalaywoods.com/mand… 2024-05-16 01:26:45
4 https://thebolditalic.com/?gi=79d0… 2024-05-16 01:26:45
5 https://thebolditalic.com/?gi=77a5… 2024-05-16 01:26:39
6 https://www.maewellness.co.uk/ 2024-05-16 01:26:38
7 https://thebolditalic.com/?gi=2483… 2024-05-16 01:26:38
8 https://www.lureanglersonline.co.u… 2024-05-16 01:26:37
9 https://thebolditalic.com/?gi=c989… 2024-05-16 01:26:35
10 https://thebolditalic.com/?gi=fb15… 2024-05-16 01:26:33
11 https://thebolditalic.com/?gi=3184… 2024-05-16 01:26:33
12 https://www.lottofight.com/ 2024-05-16 01:26:30
13 https://www.lhm.org/emailpg.asp?Pa… 2024-05-16 01:26:28
14 https://thebolditalic.com/?gi=8e9b… 2024-05-16 01:26:26
15 https://www.lh.co.th/th 2024-05-16 01:26:25
16 https://www.indianweekender.co.nz/ 2024-05-16 01:26:25
17 https://www.lespritjardin.be/ 2024-05-16 01:26:23
18 https://www.lasdonosas.com.ar/ 2024-05-16 01:26:20
19 https://www.kst-serviceportal.de/ 2024-05-16 01:26:17
20 https://thebolditalic.com/?gi=3123… 2024-05-16 01:26:15