$(document).ready(function() { document.getElementById('hl').style.left="-725px"; document.getElementById('hl').style.top="123px"; document.getElementById('menu').style.left="-715px"; document.getElementById('menu').style.top="175px"; var bodyHeight = findDimVal($('.body').css('height')); var bodyTop = findDimVal($('.body').css('top')); var contentHeight = bodyHeight + bodyTop + 35; $('.content').css('height', contentHeight + 'px'); if(document.title.search('Home')>0) { $('.headline').animate({left:'-10px', top:'50'}, 1500, 'easeOutCirc'); $('.menu').delay(1750).animate({left:'-50px', top:'150'}, 1500, 'easeOutCirc'); } else { document.getElementById('hl').style.left="-10px"; document.getElementById('hl').style.top="50px"; document.getElementById('menu').style.left="-50px"; document.getElementById('menu').style.top="150px"; } makePopup(); moveFooter(); adjustEdges(); makeCopyright(); function makePopup() { //temporary $('.container').prepend(''); var placePopup = (findDimVal($('.content').css('width')) - findDimVal($('#popup').css('width'))) / 2 ; $('#popup').css('left', placePopup); $('#popup').hide(); var timer = setTimeout(function(){popupTimer()},4000); var popupTimes=0; function popupTimer() { if(popupTimes<2) { $('#popup').slideToggle("slow"); popupTimes++; setTimeout(function(){popupTimer()},20000); } else { clearTimeout(timer); } } $('#popup .close').click(function() { popupTimer() }); } $(window).scroll( function() { moveFooter(true); }); $(window).resize( function() { moveFooter(false); }); function moveFooter(scrolled) { $('.footer').css("top", $(document).scrollTop() + 25); if(scrolled) { $('.footer').css("left", $(document).scrollLeft() + $(window).width() - 100); } else { $('.footer').css("left", $(window).width() - 100); } } function getCH() { var height = $('.content').css('height'); return findDimVal(height); } function adjustEdges() { $('.edge').css("height", (getCH() + 2) + "px"); $('.bottom').css("top", getCH() + 2); $('.bottomcorner').css("top", getCH() + 2); } function makeCopyright() { $(".bottom").append(""); } }) function findDimVal(dim) { return parseInt(dim.substr(0,dim.length-2)); }