function MeText( lang, strName, fAllowEmpty, num ){
    this.strName = strName    
    this.fAllowEmpty = fAllowEmpty
	this.num = num
    this.Validate = function( field ) {
        if ( (!this.fAllowEmpty) && (field.value=="")) {
            if(lang=='cz'){
            	alert('Vyplňte prosím hodnotu do pole "' + this.strName + '".')
            }
            if(lang=='en'){
            	alert('Please fill "' + this.strName + '".')
            }
            if(lang=='de'){
            	alert('Bitte füllen Sie Wert "' + this.strName + '".')
            }
            field.focus()
            return false     
        }
		if ( (this.num) && isNaN(field.value) ){
			if(lang=='cz'){
            	alert('Vyplňte prosím číselnou hodnotu do pole "' + this.strName + '".')
            }
            if(lang=='en'){
            	alert('Please insert a number in "' + this.strName + '".')
            }
            if(lang=='en'){
            	alert('Bitte füllen Sie den Zahlenwert "' + this.strName + '".')
            }
            field.focus()
            return false     
        }
        return true
    }
} 

function MeSelect( lang, strName, iFirstIndex ){
    this.strName = strName    
    this.iFirstIndex = iFirstIndex
    this.Validate = function( field ) {
        if (field.selectedIndex<this.iFirstIndex) {
        	if(lang=='cz'){
            	alert('Vyberte prosím hodnotu v poli "' + this.strName + '".');
            }
            if(lang=='en'){
            	alert('Please select value in "' + this.strName + '".');
            }
            field.focus()
            return false     
        }
        return true
    }
} 

function Validate(theForm,arr) {
    for( var i=0; i<theForm.length; i++ ) {
        if( arr[i] ) {
            if( !arr[i].Validate(theForm.elements[i]) )
                return false
        }
    }
    return true;
}