function init(){
    resizeBoxes();
    setTimeout("vidShow();",100);
   // preSetImage();
   // setTimeout("setImage();",1000);
    }
    
function resizeBoxes(){   
    var max;
    var acheH = $(ache).height();
    var mainH = $(main).height();    
    max = acheH;
    if (mainH >= acheH)
        max = mainH;
    $(ache).height(max);
    $(main).height(max);
    num = $(main).height()+40;
    console.log(num);
    $(ache).show();
    $(main).show();
    $(".footer").css("top",num+"px");
    $(".footer").show();
}
    
function vidShow () {
   $('.vid').show();
   $("p:contains('No one has commented yet. Be the first!')").remove();
   //$(img).css("display", "block");
};


function preSetImage() {
    rot = Math.floor(Math.random()*6)-3;
    num = Math.floor(Math.random()*4);
    string = "img/me"+num+".jpg";
    newImg = new Image();
    newImg.src = string;
}

function setImage() {
    var curHeight = newImg.height;
    var curWidth = newImg.width;
    $(img).css("background-image", "url("+string+")");
    $(img).css("height", curHeight);
    $(img).css("width", curWidth);
    $(img).css("-webkit-transform", "rotate("+rot+"deg)");
    $(img).css("-moz-transform", "rotate("+rot+"deg)");
}
