/**
 * @author Simon Schürpf
 * 
 * this file includes all functions that ar needed to guarantee a high browser compability
 * 
 * fixes IE6 position: fixed bug for the footer, resource: http://gregwolejko.com/positionfixed-in-ie6/  
 */

function getClientHeight(){
    return typeof( window.innerHeight) !== "undefined" ?
    window.innerHeight :
    document.documentElement.clientHeight;
} 

function fixFloatElement() {
    // get client height
    var offset = getClientHeight();
    // get the element you want to change position to
    var footer = document.getElementById('footer');
    // get the element right above the previous element
    var main = document.getElementById('container');
    // set styles to the element to emulate position:fixed
    footer.style.position = 'absolute';
    footer.style.top = (document.documentElement.scrollTop + offset - footer.offsetHeight) + 'px';
    // add margin to the element above to remove overlapping
    main.style.marginBottom = footer.offsetHeight + 'px';
}

/* if ie6 */
var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
if (isIE6) {
    window.onload = fixFloatElement;
    window.onresize = fixFloatElement;
    window.onscroll = fixFloatElement;
}
