﻿
function getWindowHeight() {
    var windowHeight = 0;
    if (typeof (window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
        else {
            if (document.body && document.body.clientHeight) {
                windowHeight = document.body.clientHeight;
            }
        }
    }
    return windowHeight;
}



function setFooterPos() {
    if (document.getElementById) {
        var windowHeight = getWindowHeight();
        if (windowHeight > 0) {
            var contentHeight = document.getElementById('content').offsetHeight;
            var footerElement = document.getElementById('footer');
            var footerHeight = footerElement.offsetHeight;
            var headerHeight = document.getElementById('header').offsetHeight;
            if (windowHeight - (headerHeight + contentHeight + footerHeight) >= 0) {
                footerElement.style.position = 'absolute';
                footerElement.style.top = (windowHeight - footerHeight) + 'px';
            }
            else {
                footerElement.style.position = 'static';
            }
        }
    }
}

       

window.onload = function(e) {
    setFooterPos();
    
}
window.onresize = function(e) {
    setFooterPos();
}


$(function() {
    $("#1, #2, #3, #nav").lavaLamp({
        fx: "backout",
        speed: 700
    });
});
$(document).ready(function() {
    lastBlock = $("#a1");
    maxWidth = 373;
    minWidth = 60;
    $("#services ul li a").hover(
		  function() {
		      $(lastBlock).animate({ width: minWidth + "px" }, { queue: false, duration: 200 });
		      $(this).animate({ width: maxWidth + "px" }, { queue: false, duration: 200 });
		      lastBlock = this;
		  }
		);
});