﻿
if (window.attachEvent) {
    window.attachEvent("onload", winload)
}
else {
    window.addEventListener("load", winload, true)
}

function winload() {
    var tex
    var h1 = document.getElementsByTagName('h1')[0]
    if (h1.innerText) {
        tex = h1.innerText
    }
    else {
        tex = h1.textContent
    }

    if (tex.length > 0) {
        if (h1.innerText) {
            tex = h1.innerText.length
        }
        else {
            tex = h1.textContent.length - 27
        }

        if (tex > 30) {
            h1.style.fontSize = "2.8em"
            h1.style.whiteSpace = "normal"
            h1.style.lineHeight = "30px"
        }
        else if (tex > 25) {
            h1.style.fontSize = "3.2em"
            h1.style.whiteSpace = "normal"
            h1.style.lineHeight = "30px"
        }
        else if (tex > 15) {
            h1.style.fontSize = "4.5em"
        }
        else {
            h1.style.whiteSpace = "normal"
            h1.style.margin = "25px"
        }
    }
}
