var fc_search = new Array();
var psc_search = new Array();
var regpsc = new RegExp("^([0-9]{5})$");
//var hodnota = document.getElementById("s");
//alert(document.getElementById('searchInput').value);
fc_search[fc_search.length] = new Array("searchstring", "checkSearch()", "Délka hledaného řetězce musí být nejméně 3 znaky a nelze hledat slovo \'vyhledat\'!");
psc_search[psc_search.length] = new Array("searchpsc", "value.length > 4", "Délka PSČ musí být 5 znaků!");
psc_search[psc_search.length] = new Array("searchpsc", "regpsc.test(value)", "PSČ musí obsahovat pouze číslice!");

function checkSearch(){
    var search = document.getElementById('searchInput').value;
    if(search.length>2 && search!="vyhledat") return true;
    else return false;
}

function imageRotate()  {
    
    document.getElementById(objectNameId).src = imagesList[imageIndex];

    imageIndex++;
    if (imagesList.length == imageIndex) {
        imageIndex = 0;
    }

    if( typeof objectNameIdBottom != 'undefined') {
        document.getElementById(objectNameIdBottom).src = imageListBottom[imageIndexBottom];
        
        imageIndexBottom++;
        if (imageListBottom.length == imageIndexBottom) {
            imageIndexBottom = 0;
        }
    }

    window.setTimeout('imageRotate()', 5000);       
}