function more_put(search_place) {
var tmpUrl="/wayntravels.html?wci=search&search_type=hint_search&hint_type=TW";
tmpUrl+="&what=" + search_place + "&whatkey=" + search_place;
tmpUrl+="&where=";
var TownAndCountry = '';
var obj=$("town_name");
if (obj!=null){
TownAndCountry=obj.value;
}
var obj=$("country_name");
if (obj!=null){
if (TownAndCountry!='')	{
TownAndCountry+=", "+obj.value;
}else{
TownAndCountry = obj.value;
}
}
TownAndCountry = encodeURIComponent(TownAndCountry);
tmpUrl = tmpUrl + TownAndCountry;
document.location.href=tmpUrl+'&searchBoxTracker=more';
}
function do_nothing(){}
function go_travel_bar_go(){
var mygo = $('searchbar_goto_key').value;
if (mygo.length>3){
var url;
var arr_mygo=mygo.split(",");
url = '';
url = url + '&country_code=' + arr_mygo[0];
url = url + '&city_key=' + arr_mygo[1];
if (arr_mygo[2]>0) {
url = url + '&town_key=' + arr_mygo[2];
}
document.travel_bar_go.action = document.travel_bar_go.action + url;
document.travel_bar_go.submit();
}else{
msgBox('warning','Sorry, we cannot find this location. Please try again.',function(){
document.getElementById('searchbar_goto').select;
document.getElementById('searchbar_goto').focus();
});
}
}
function go_travel_bar_search(){
var OldPic = $('btn_search').src;
var OldPicOnClick = $('btn_search').onclick;
$('btn_search').src = $('btn_search_progress').src;
$('btn_search').onclick = '';
var what = $('searchbar_find_what').value.strip();
if (what=='e.g. Hotels, W bar, Skydiving') what='';
var where = $('searchbar_where').value.strip();
if (where=='e.g. New York, W1, The Ritz') where='';
//var whatKEY = $('searchbar_find_what_key').value;
var whereKey = $('searchbar_where_key').value;
var whatKey = $('searchbar_find_what_key').value;
if (what.length > 0 && where.length == 0 )
window.location='/wayntravels.html?wci=search&search_type=hint_search&where='+encodeURIComponent(where.replace('/','~'))+'&what='+encodeURIComponent(what.replace('/','~'));
else if (what.length == 0 && where.length > 0){
window.location='/wayntravels.html?wci=search&wce=enter&submittype=hint_search&where='+encodeURIComponent(where.replace('/','~'))+'&what='+encodeURIComponent(what.replace('/','~'))+'&hint_type='+whereKey + '&whatkey=' + whatKey;}
else if (what.length > 0 && where.length > 0)
window.location='/wayntravels.html?wci=search&search_type=hint_search&where='+encodeURIComponent(where.replace('/','~'))+'&what='+encodeURIComponent(what.replace('/','~'))+'&hint_type='+whereKey + '&whatkey=' + whatKey;
else{
msgBox('warning','Please let us know what you are looking for, using the What or Where fields.');
document.getElementById('btn_search').setAttribute('src',OldPic);
document.getElementById('btn_search').onclick = OldPicOnClick;
}
}
function ElementOnBlur (obj, value, width) {
if ( obj.value == '') {
obj.value = value;
obj.style.cssText = 'color:#000000';
obj.style.width = width + "px";
}
}
function ElementOnFocus (obj, value, width) {
obj.style.width = width + "px";
if ( obj.value == value ) {
obj.value = "";
} else {
obj.select();
}
}
function isEnter(event, myinput){
var mydiv ='';
if (myinput==1 || myinput==2){ // what & where
if(event.keyCode==13){
if (myinput==1) mydiv = $('searchbar_find_what_o').innerHTML;
if (myinput==2) mydiv = $('searchbar_where_o').innerHTML;
if (mydiv ==""){
go_travel_bar_search();
}
}
}else if (myinput==3){
if(event.keyCode==13 || event.keyCode==9 ){
go_travel_bar_go();
}
}else if (myinput==4){
if(event.keyCode==13 || event.keyCode==9 ){
mydiv = $('searchbar_where_o').innerHTML;
if (mydiv ==""){
go_home_bar_search();
}
}
}
}
function NiceView(str){
var strArr = str.split(" ");
var i = 0;
var atrArrL = strArr.length;
for (i=0; i<atrArrL; i++){
strArr[i] = strArr[i].strip();
}
str = "";
for (i=0; i<atrArrL; i++){
if (strArr[i] != "") {
if (strArr[i].length>1){
var first = strArr[i].substring(0,1);
first = first.toUpperCase();
var last = strArr[i].substring(1,strArr[i].length);
last = last.toLowerCase();
strArr[i] = first + last;
}
str = str + " " + strArr[i]
}
}
str = str.strip();
return (str);
}
