var icon_menu = 0;

$(function(){
  
  $("#icon_menu_open").click(function(){
    
    if (icon_menu == 0){       
      
      $(this).html("<i class='fa fa-close fa-lg' style='font-size: 28px; position: relative; top: 1px;'></i>");
      
      icon_menu = 1;
    
    }else{
      
      $(this).html("<i class='fa fa-bars fa-lg' style='font-size: 25px; position: relative; top: 1px;'></i>");
      icon_menu = 0;    
    
    }
    
    return true;
  
  });

});

var open_modal = 0;

function modal_open(element_id) {
  
  if (open_modal == 0){ 
    
    var modal = element_id;
    
    $(modal).parents(".overlay").addClass("open");
    
    open_modal = 1;
    
    setTimeout( function(){
      
      $(modal).addClass("open");
    
    }, 5);
    
  }else{
    
    var $this = $(this), modal = element_id;
    
    $(modal).removeClass("open");
    
    setTimeout( function(){	
      
      $(modal).parents(".overlay").removeClass("open");
    
    }, 5);
    
    open_modal = 0;
  
  }
  
}

function modal_close(element_id) {
  
  var modal = element_id;
  
  $(modal).removeClass("open");
  
  setTimeout( function(){	
    
    $(modal).parents(".overlay").removeClass("open");
    
    $('#upload-screensaver-show').html('');
    $('#upload-photo-show').html('');
    
    open_modal = 0;
  
  }, 5);
	
}