﻿<!--
	function chgTab(upId, upImg, showId, downId, downImg, hideId) {
		document.getElementById(downId).src = downImg;
		document.getElementById(upId).src = upImg;
	
		document.getElementById(hideId).style.visibility = 'hidden';
		document.getElementById(hideId).style.position = 'absolute';
		document.getElementById(showId).style.visibility = 'visible';
		document.getElementById(showId).style.position = '';
	}
	
	function populatePriceLevel(cCode) {
		var cSymbol = '$';
		if(cCode == 'USD') {
			cSymbol = '$';
		} else if(cCode == 'EUR') {
			cSymbol = '€';
		} else if(cCode == 'GBP') {
			cSymbol = '£';
		} else if(cCode == 'CAD') {
			cSymbol = 'CAD ';
		} else if(cCode == 'AUD') {
			cSymbol = 'AUD ';
		} else if(cCode == 'CHF') {
			cSymbol = 'CHF ';
		}
		document.getElementById('priceLevelDiv').innerHTML = '<select name="priceLevel" id="priceLevel" class="small-select">'
															+'<option value="all">Any price</option>'
															+'<option value="&lt; 100">Under '+cSymbol+'100</option>'
															+'<option value="&lt; 250">Under '+cSymbol+'250</option>'
															+'<option value="&lt; 400">Under '+cSymbol+'400</option>'
															+'<option value="&lt; 500">Under '+cSymbol+'500</option>'
															+'<option value="&gt; 500">Above '+cSymbol+'500</option>'
															+'</select>';
	}
	
	function validateForm(frmName) {
		var error = false;
		if(document.searchForm.region.value == '') {
			document.getElementById('regionLabel').innerHTML = '<font color="#FF0000">Region: </font>';
			alert('Select a region');
			error = true;
		}
		
		var fromDate = document.searchForm.startDate.value;
		var toDate = document.searchForm.endDate.value;
		
		if((fromDate != 'DD/MM/YYYY') && (toDate == 'DD/MM/YYYY')) {
			document.getElementById('eDateLabel').innerHTML = '<font color="#FF0000">Check Out: </font>';
			alert('Select Check Out date');
			error = true;
			return false;
		}
		
		if((fromDate == 'DD/MM/YYYY') && (toDate != 'DD/MM/YYYY')) {
			document.getElementById('sDateLabel').innerHTML = '<font color="#FF0000">Check In: </font>';
			alert('Select Check In date');
			error = true;
			return false;
		}
		
		var fromDateArray = fromDate.split("/") ;
		fromDate = fromDateArray[2]+fromDateArray[1]+fromDateArray[0];
		var toDateArray = toDate.split("/") ;
		toDate = toDateArray[2]+toDateArray[1]+toDateArray[0];
		
		if (fromDate > toDate) {
			document.getElementById('sDateLabel').innerHTML = '<font color="#FF0000">Check In: </font>';
			document.getElementById('eDateLabel').innerHTML = '<font color="#FF0000">Check Out: </font>';
			alert('Check Out date should be greater than Check In date');
			error = true;
		}
		
		if(error == true) {
			return false;
		} else {
			return true;
		}
	}
	
-->