function SearchProduct()
{
	var select;
	var input;
	var url;
		
	// get id city
	select = document.getElementById('sltcities');
	var idCity = select.options[select.selectedIndex].value;
	//alert(idCity);
	
	// get id category
	select = document.getElementById('header_HotelCategories');
	var idCategory = select.options[select.selectedIndex].value;
	//alert(idCategory);
	
	// get id theme
	select = document.getElementById('header_HotelThemes');
	var idTheme = select.options[select.selectedIndex].value;
	//alert(idTheme);
	
	// get keyword
	input = document.getElementById('hotelKeyword');
	var keyword = input.value;
	//alert(keyword);
	
	// get from date
	input = document.getElementById('hotelFromDate');
	var fromDate = input.value;
	//alert(fromDate);
	
	input = document.getElementById('hotelDuration');
	var duration = input.value;

	input = document.getElementById('header_Detinations');
	if(input)
	   idDestination = input.value;
	//alert(duration);
	
	// calculate to date
	var toDate = AddDays(fromDate, duration);
	// compose url
	url = applicationPath + "/cr.resa/ui/aba/Hotel_Search.aspx?"
		+ "iddestination=" + idDestination
		+ "&idcity=" + idCity 
		+ "&idcategory=" + idCategory 
		+ "&fromdate=" + fromDate 
		+ "&keyword=" + keyword 
		+ "&idtheme=" + idTheme 
		+ "&todate=" + toDate 
		+ "&curr=4&ilng=1&user=1208";
	
	//alert(url);
	location.href = url;
}

///---------------------------------add To Newsletter -------------------------------------///

function isMail(str)
{
 var filter=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/
 return (filter.test(str))
}

function addToNewsletter()
{
	var input = document.getElementById('textfield_newletter');
	var email = input.value;

	if (isMail(email))
	{	
		var url = applicationPath + "/info/Newsletter.aspx?m=0&email=" + email 
				+ "&q=1&k=1";
		location.href = url;
	}
	else
		alert('Mail invalide');	
}
