function check_workbook(chislo_propuskov){     
function isEmpty(str) {       
  for (var i = 0; i < str.length; i++){
     if (" " != str.charAt(i)){
         return false;
     }    
  }    
  return true;
}
//-------------------------------
function isLetter(str){        

//----// 
	function trim(s){
     return rtrim(ltrim(s));
    }

	function ltrim(s){
	 return s.replace(/^\s+/, '');    
	}

	function rtrim(s){
  	 return s.replace(/\s+$/, ''); 
	}
//----//
	
	var reg = /^[a-zA-Zą-’Ą-ß]+$/;     
	str = trim(str);
	var result = reg.test(str);

		if (result) {  
			    return false;
		} 
		else { 
			   return true;
		} 
} 

function isEnglish(str){       

//----// 
	function trim(s){
     return rtrim(ltrim(s));
    }

	function ltrim(s){
	 return s.replace(/^\s+/, '');    
	}

	function rtrim(s){
  	 return s.replace(/\s+$/, ''); 
	}
//----//
	
	var reg = /^[a-zA-Z]+$/;      
	str = trim(str);
	var result = reg.test(str); 

		if (result) {  
			    return false;
		} 
		else { 
			   return true;
		} 
} 

input_id= new Array(chislo_propuskov);  
for (k=0;k<=chislo_propuskov-1;k++){
 input_id[k]='id'+k; 
}

 count_full=0;                          
for (i=0;i<=chislo_propuskov-1;i++){
	if (isEmpty(document.getElementById(input_id[i]).value)){             
	 window.alert("Please give all the answers");
	  return false;
	  break;
	} 
	else {
	  count_full+=1;	
	}

}

if (count_full==chislo_propuskov){
count_isLetter=0;      
for (i=0;i<=chislo_propuskov-1;i++){
	if (isLetter(document.getElementById(input_id[i]).value)){            
	 			window.alert("Please use letters only");
				  return false;
				  break;
			} 

	    	else{ 	
	     		count_isLetter+=1;
			}
}
}

if (count_isLetter==chislo_propuskov){  
count_isEnglish=0;    
for (i=0;i<=chislo_propuskov-1;i++){
	if (isEnglish(document.getElementById(input_id[i]).value)){            
	 			window.alert("Please write in English");
				  return false;
				  break;
			} 

	    	else{ 	
	     		count_isEnglish+=1;
			}
}
}

if (count_isEnglish==chislo_propuskov){ 
return true;
}	
} 