version = navigator.appVersion.toLowerCase();
agent = navigator.userAgent.toLowerCase();
ie = (version.indexOf('msie')>-1);
win = (version.indexOf('windows')>-1);
opera = (agent.indexOf('opera')>-1);

function fav() {
if ((opera) && (win)) return false;
else if ((ie) && (win)) document.write('\074a class="fav" href=\"javascript:gofav();\"\076Přidat k oblíbeným\074/a\076');
}
function gofav() {
window.external.addFavorite('http://www.acacentrum.cz/','Autocentrála - prodej vozů Hyundai');
}
function checkForm(whichOne) {

    var vypln = "";
    var pocet = 0;
    
    if (whichOne) {
        
        if (whichOne == 'poslat') { // Poslat URL
        
            if (document.getElementById('name').value == "") { vypln += "'Jméno, příjmení', "; pocet++; }
            if (document.getElementById('email').value == "") { vypln += "'Emailová adresa', "; pocet++; }


            
        }
            
        if (vypln != "") {
            vypln = vypln.substr(0, vypln.length - 2);
            pocet > 1 ? mlCislo = "y" : mlCislo = "u";
            
            lastPos = vypln.lastIndexOf(', ');
            if (lastPos != -1) {
                str1 = vypln.substring(0, lastPos);
                str2 = vypln.substring(lastPos + 2, vypln.length);
                vypln = str1 + " a " + str2;
            }
            
            alert("Zapomněli jste vyplnit položk" + mlCislo + " " + vypln);
            return false;
        }
        
    }
    
    return true;

}

