/*function show(id) {
    element = document.getElementById(id);
    
    if (element.style.display == 'block')
        element.style.display = 'none';
    else
        element.style.display = 'block';
}

function dialogSave(message) {
    if (confirm(message)) {
        document.forms['article_form'].submit();
    } else {
        
    }
}

function dialogDelete(url) {
    if (confirm('Вы уверены, что хотите удалить эту запись?')) {
        window.location = url;
    } else {

    }
}

function addCategory(add_link) {
    if (document.getElementById("category").selectedIndex == 1) window.location = add_link;
}*/

function changeCategory() {
    window.location = document.getElementById("category")[document.getElementById("category").selectedIndex].value;
}

function clearSearch() {
    document.getElementById("search").value = '';
}

function goSearch() {
    //window.location = "http://mpg/search/" + document.getElementById("search").value;
    //alert("Временно не работает...");
    document.getElementById('search_form').submit(); return false;
}

function preloadImages(urls) {
    var images = new Array();

    for (var i = 0; i < images.length; i++) {
        images[images.length] = new Image();
        images[images.length - 1].src = urls[i];
    }
}

window.onload = function() {
    var images = new Array("http://mpg.ru/public/images/index_hover.gif", "../images/newspaper_hover.gif", "../images/archive_hover.gif", "../images/gallery_hover.gif", "../images/prom_tv_hover.gif", "../images/advertisers_hover.gif", "../images/contacts_hover.gif");
    this.preloadImages(images);
}
/*function go(link) {
    window.location = link;
}*/