//================================================================================//
//	check turkey hotels search form
//================================================================================//

function check_search_form1(obj_Form){
	var obj_Destination1;
	var n_SearchTourType  = obj_Form.country_type.value.Trim();
	if (n_SearchTourType == 2){
		obj_Destination1  = obj_Form.continent.options[obj_Form.continent.options.selectedIndex].value.Trim();
	}else{
		obj_Destination1  = obj_Form.pop_dest.options[obj_Form.pop_dest.options.selectedIndex].value.Trim();
	}
	var d_ArrDate         = obj_Form.arr_day1.value.Trim();
	var d_DepDate         = obj_Form.dep_day1.value.Trim();
	var n_SearchByChecked = 0;
	var str_ErrorMsg      = '';	
	
	
	//================================================================================//
	//	check required form fields
	//================================================================================//
	
	//for (i = 0; i < obj_SearchBy.length; i++){
	//	if (obj_SearchBy[i].checked == true){
	//		n_SearchByChecked++;
	//	}
	//}
	
	//if (n_SearchByChecked != 1){
	//	if (n_SearchTourType == 2){
	//		//str_ErrorMsg += '\n   - Lütfen arama kriteri seçiniz (Ülke veya Tur Tipi).\t';
	//		str_ErrorMsg += '\n   - Lütfen bir Ülke seçiniz.\t';
	//	}else{
	//		//str_ErrorMsg += '\n   - Lütfen arama kriteri seçiniz (Bölge veya Tur Tipi).\t';
	//		str_ErrorMsg += '\n   - Lütfen bir Bölge seçiniz.\t';
	//	}
	//}
	
	//if (obj_SearchBy.checked == false){
	//	str_ErrorMsg += '\n   - Lütfen arama kriteri seçiniz.\t';
	//}
	
	//if (obj_SearchBy.checked == true){
	//	if (obj_Destination1.options.length > 2){
	//		if (obj_Destination1.options[obj_Destination1.options.selectedIndex].value == ''){
	//			if (n_SearchTourType == 2){
	//				str_ErrorMsg += '\n   - Lütfen bir Ülke seçiniz.\t';
	//			}else{
	//				str_ErrorMsg += '\n   - Lütfen bir Bölge seçiniz.\t';
	//			}
	//		}		
	//	}
		//else{
		//	str_ErrorMsg += '\n   - Tur Tipine göre aramayı deneyiniz !!!.\t';
		//}
	//}
	
	if (obj_Destination1 == ''){
		if (n_SearchTourType == 2){
			str_ErrorMsg += '\n   - Lütfen bir Ülke seçiniz.\t';
		}else{
			str_ErrorMsg += '\n   - Lütfen bir Bölge seçiniz.\t';
		}
	}		
	
	if (check_date(d_ArrDate, '.') != 1){
		str_ErrorMsg += '\n   - Lütfen \'Başlangıç tarihi\' kontrol ediniz (ör: 01.01.2005).\t';
	}
		
	if (check_date(d_DepDate, '.') != 1){
		str_ErrorMsg += '\n   - Lütfen \'Bitiş tarihi\' kontrol ediniz (ör: 01.01.2005).\t';
	}
	
	if (check_date(d_ArrDate, '.') == 1 && check_date(d_DepDate, '.') == 1){
		if (date_ms(d_ArrDate, '.') <= date_ms(get_today_date('.'), '.')){
			str_ErrorMsg += '\n   - \'Başlangıç tarihi\' bugünkü tarihinden büyük olmalıdır.\t';
		}
			
		if (date_ms(d_ArrDate, '.') >= date_ms(d_DepDate, '.')){
			str_ErrorMsg += '\n   - \'Bitiş tarihi\', \'Başlangıç tarihi\'nden büyük olmalıdır.\t';
		}
	}
	if (str_ErrorMsg.Trim() != ''){
		alert('Lütfen aşağıda belirtilen alanları tekrar kontrol ediniz:\t\n' + str_ErrorMsg);
	}else{
		obj_Form.submit();
	}
}