// script loading & type script
var preloader = document.getElementById("loading");
// function reloader
function reloader()
{
    preloader.style.display = 'none';
}

var typed = new Typed('#loadingText', {
    strings: ['جمعية خذ فرصة الخيرية'],
    typeSpeed: 90,
    loop : true,
  });
  

// script upload main image

function readURL(input) {
    if (input.files && input.files[0]) {
  
      var reader = new FileReader();
  
      reader.onload = function(e) {
        $('.image-upload-wrap').hide();
  
        $('.file-upload-image').attr('src', e.target.result);
        $('.file-upload-content').show();
  
        $('.image-title').html(input.files[0].name);
      };
  
      reader.readAsDataURL(input.files[0]);
  
    } else {
      removeUpload();
    }
  }
  
  function removeUpload() {
    $('.file-upload-input').replaceWith($('.file-upload-input').clone());
    $('.file-upload-content').hide();
    $('.image-upload-wrap').show();
  }
  $('.image-upload-wrap').bind('dragover', function () {
          $('.image-upload-wrap').addClass('image-dropping');
      });
      $('.image-upload-wrap').bind('dragleave', function () {
          $('.image-upload-wrap').removeClass('image-dropping');
  });


  function readURL2(input) {
    if (input.files && input.files[0]) {
  
      var reader = new FileReader();
  
      reader.onload = function(e) {
        $('.image-upload-wrap2').hide();
  
        $('.file-upload-image2').attr('src', e.target.result);
        $('.file-upload-content2').show();
  
        $('.image-title').html(input.files[0].name);
      };
  
      reader.readAsDataURL(input.files[0]);
  
    } else {
      removeUpload2();
    }
  }
  
  function removeUpload2() {
    $('.file-upload-input2').replaceWith($('.file-upload-input2').clone());
    $('.file-upload-content2').hide();
    $('.image-upload-wrap2').show();
  }
  $('.image-upload-wrap2').bind('dragover', function () {
          $('.image-upload-wrap2').addClass('image-dropping');
      });
      $('.image-upload-wrap2').bind('dragleave', function () {
          $('.image-upload-wrap2').removeClass('image-dropping');
  });