 (function ($) {
 $.fn.vAlign = function() {
 return this.each(function(i){
 var h = $(this).height();
 var oh = $(this).outerHeight();
 var mt = (h + (oh - h)) / 2;
 $(this).css("margin-top", "-" + mt + "px");
 $(this).css("top", "50%");
 $(this).css("position", "absolute");
 });
 };
 })(jQuery);

 (function ($) {
 $.fn.hAlign = function() {
 return this.each(function(i){
 var w = $(this).width();
 var ow = $(this).outerWidth();
 var ml = (w + (ow - w)) / 2;
 $(this).css("margin-left", "-" + ml + "px");
 $(this).css("left", "50%");
 $(this).css("position", "absolute");
 });
 };
 })(jQuery);
 
function sizediv(){
    
    var divheight=816;
    var divwidth=1024;
    
    //if window height is less than 816, then set the div to the window height, else set it to 816. then set the div width.
    var wh=$(window).height();
    if(wh>divheight){
        $('#allcontainer').css("height", divheight);
        $('#allcontainer').css("width", divwidth);
        $('#myId').attr("height", divheight);
        $('#myId').attr("width", divwidth);
        $('#myInnerId').attr("height", divheight);
        $('#myInnerId').attr("width", divwidth);
        $('#information').css("position", "absolute");
        $('#information').css("left", "50%");
        $('#information').css("margin-left", "-512px");
        
      
        
    }else{
        wh=wh-25;
        $('#allcontainer').css("height", wh);
        var ww=wh*1.254901960784314;
        $('#allcontainer').css("width", ww);
        $('#myId').attr("height", wh);
        $('#myId').attr("width", ww);
        $('#myInnerId').attr("height", wh);
        $('#myInnerId').attr("width", ww);

        
    }
    
    
}

function movefooter(){
    
        var divheight=816;
    var divwidth=1024;
    
    //if window height is less than 816, then set the div to the window height, else set it to 816. then set the div width.
    var wh=$(window).height();
    if(wh>divheight){
        
             $('#information').css("position", "absolute");
        $('#information').css("left", "50%");
        $('#information').css("margin-left", "-512px");
        var positioning=$('#allcontainer').position();
        $('#information').css("top", (positioning.top+415)+"px");
    }else{
        
        $('#information').css("position", "absolute");
        $('#information').css("left", "50%");
        $('#information').css("margin-left", "-512px");
        var positioning=$('#allcontainer').position();
        $('#information').css("top", (positioning.top+(wh/2))+"px");
        
        
    }
    
}

 $(document).ready(function() {
 sizediv();
 $("#allcontainer").vAlign();
 $("#allcontainer").hAlign();
 movefooter();
 $(window).resize(function(){
     sizediv();
$("#allcontainer").vAlign();
 $("#allcontainer").hAlign();
 movefooter();

});


 });
