function news_signed(xmlhttp) {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            alert(xmlhttp.responseText);
            if (xmlhttp.responseText.indexOf('Email') == 0)
                document.getElementById('newsEmail').value = '';
        }
    }
}

function news_sign() {
    sign = document.getElementById('newsSignOut').checked ? 'out' : 'in';
    email = encodeURIComponent(document.getElementById('newsEmail').value);
    return !send_xmlhttprequest(news_signed, 'post', '/zasilani-novinek/', 'sign='+sign+'&email='+email+'&response=1');
}

function trackCatalogDownload() {
    document.getElementById('katalogDl1').onclick = document.getElementById('katalogDl2').onclick = document.getElementById('katalogDl3').onclick = function() {
        pageTracker._trackPageview('/data/soubory-ke-stazeni/STUDYLINE-katalog-studium-v-australii.pdf');
    };
}

function renderSearchBackground() {
    var input = document.getElementById("searchQuery");
    input.style.backgroundImage = "url('/images/search-bg.png')";
    input.onfocus = function() {
        this.style.backgroundImage = "none";
    };
    input.onblur = function() {
        if (this.value == "") {
            this.style.backgroundImage = "url('/images/search-bg.png')";
        }
    }
}
