// JavaScript Document

function j_module_hotel2_public_search_validate ( formOBJ , detPage , alertMessage ) {
	
	// Check detail
	
	var regID = 0;
	var hotID = 0;
	
	if ( formOBJ.modHotel2Search_reg ) {
		regID = formOBJ.modHotel2Search_reg.value;
	}
	
	if ( formOBJ.modHotel2Det ) {
		hotID = formOBJ.modHotel2Det.value;
	}
	
	if ( hotID > 0 ) {			
		window.location.href = "index.php?p="+detPage+"&modHotel2Search_reg="+regID+"&modHotel2Det="+hotID;
		return false;
	}	
		
	if ( regID < 1 ) {			
		alert (alertMessage);
		return false;
	}
		
	return true;
}

function j_module_hotel2_public_search_validate_str ( formOBJ , hintStr , alertMessage ) {
	
	j_module_hotel2_public_search_removeHint ( formOBJ , hintStr );
	
	if ( ! formOBJ.modHotel2Search_str.value.length ) {			
		alert (alertMessage);
		return false;
	}
		
	return true;
	
}

function j_module_hotel2_public_search_removeHint ( formOBJ , hintStr ) {
	
	if ( formOBJ.modHotel2Search_str.value === hintStr ) {
		formOBJ.modHotel2Search_str.value = '';
	}
}

function j_module_hotel2_public_search_restoreHint ( formOBJ , hintStr ) {
	
	if ( formOBJ.modHotel2Search_str.value === '' ) {
		formOBJ.modHotel2Search_str.value = hintStr;
	}
}

