function chk_reserv_validity(theForm){
	
	tf = 'true';
	message = 'Please check no of adults and no of children\n';
	var noofadults = theForm.noofadults.value;
	var noofchildren = theForm.noofchildren.value;
	var noofroom = theForm.noofroom.value;	
	var noofperson = parseInt(noofadults) + parseInt(noofchildren);
	
	if(noofchildren == 0){
		maxofadults = parseInt(noofroom*2) + parseInt(noofroom);
		maxofchildren = 0;
	}
	if(noofchildren > 0){
		if(noofchildren <=  noofroom){
			maxofadults = (parseInt(noofroom*2) + parseInt(noofroom)) - Math.round(noofchildren/2);
			maxofchildren = noofchildren;
		}
		else{
			maxofadults = parseInt(noofroom*2);
			maxofchildren = maxofadults;
		}
	}
	
	maxofperson = parseInt(maxofadults) + parseInt(maxofchildren);
	
	if(noofperson > maxofperson){
		if(maxofchildren == 0){
			message += 'Maximun of Adults = ' + maxofadults + ' person\n';
		}
		else{
			message += 'Maximun of Adults = ' + maxofadults + ' person\n';
			message += 'Maximun of Children = ' + maxofchildren + ' person\n';
		}
		tf = 'false';		
	}
	else{
	 	if(noofadults > maxofadults){
			message += 'Maximun of Adults = ' + maxofadults + ' person\n';
			message += 'Maximun of Children = ' + maxofchildren + ' person\n';
			tf = 'false';
		}
		if(noofchildren > maxofchildren){
			message += 'Maximun of Adults = ' + maxofadults + ' person\n';
			message += 'Maximun of Children = ' + maxofchildren + ' person\n';
			tf = 'false';
		}
	}
	if(tf == 'false'){
		message += '\n*** Must to add more room ***\n';
		alert(message);
		//theForm.noofadults.value = maxofadults;
		//theForm.noofchildren.value = maxofchildren;
		theForm.noofroom.focus();
		return false;
	}
	if(tf == 'true'){
		return true;
	}
	
}
