function resetValues(form, values){
for(var i = 0; i < values.length; i++){
		eval("document.forms."+form+"."+values[i]+".value = ''");
	}
}

function showLoadingPage(){
	document.getElementById('mainTpl').style.display = 'none';
	document.getElementById('iframeLoadCont').style.display = 'block';
	setTimeout("submitSearchPage()",500);
	return false;
}
function submitSearchPage(){
	document.forms['searchForm'].submit();
}

/*
* Checking if the search form is properly filled
*/
function checkSearch(){
	var roomNr = 4;
	var errorMsg = '';
	var focusField = '';
	initFieldID();
	//destination field
	if(document.forms['searchForm'].location_f.value == '' || document.forms['searchForm'].location__f.value == ''){
		errorMsg += searchTranslate[0]+'\n';
		focusField = document.forms['searchForm'].location__f;
	}
	if(errorMsg != ''){
		focusField.focus();
		alert(errorMsg);
		return false;
	}
	return true;
}//end function checkSearch
function initFieldID(){
	document.forms['searchForm'].location_f.value = document.forms['searchFlag'].locationFlag_f.value;
	document.forms['searchForm'].locationNamePathIDs_f.value = document.forms['searchFlag'].locationFlagNamePathIDs_f.value;
}
function checkKey(id, pathIDs){
	document.forms['searchFlag'].locationFlag_f.value = id;
	document.forms['searchFlag'].locationFlagNamePathIDs_f.value = pathIDs;
}

/*--selection tab for details on location and unit areas--*/
function selectTab(listName, area){
	var obj = document.getElementById('tabLink_'+area);
	for(var i = 0; i < document.getElementById(listName).getElementsByTagName('a').length; i++){
			document.getElementById(listName).getElementsByTagName('a')[i].className = '';
			document.getElementById('tab_'+parseInt((i+1), 10)).style.display='none';
	}
	obj.className = 'selected';
	document.getElementById('tab_'+parseInt(area, 10)).style.display='block';
	return true;
}
/*
* Loading the weather for the right location
*/
function loadWeather(location){
	document.getElementById('weatherFrame').src = '/modcomp/weather/index.php?location_f='+location;
}//end function loadWeather(location) 
