//commonLSA
function doLoad(){
	document.getElementById('all_are_hidden').style.display = "none";
	//document.body.scrollHeight = "10000"
}
function clearInput(){
	document.getElementById('city_input').value="";
	doKeyDown();
}
function doFocus(){
	if(document.getElementById('city_input').value == "Your City") { clearInput(); }
	document.getElementById('city_input').style.backgroundColor = "#fff";
	document.getElementById('city_input').style.border = "1px solid #ccc";
}
function doBlur(){
	document.getElementById('city_input').style.backgroundColor = "#ffffff";
	document.getElementById('city_input').style.border = "1px solid #0C0D0F";
	//document.getElementById('city_input').blur();
}
function doKeyDown(){
	var string = document.getElementById('city_input').value.toLowerCase();
	var tr_tags = document.getElementById('tourList').getElementsByTagName('tr');
	var hidden_tr = 0;
	var bValidCity = false;		
	for(x = 0; x<tr_tags.length; x++) {
		if(tr_tags[x].className.indexOf("table_legend") == -1 && tr_tags[x].id.indexOf("all_are_hidden") == -1) {
			if(tr_tags[x].getElementsByTagName('STRONG').length >0)
			{
					
					if(tr_tags[x].getElementsByTagName('STRONG')[0].innerHTML.toLowerCase().indexOf(string) != -1){ 
						try { tr_tags[x].style.display = "table-row" }
						catch(error) { tr_tags[x].style.display = "block" } // for IE
						bValidCity = true;
					}
					else { 
						hidden_tr = hidden_tr + 1;
						tr_tags[x].style.display = "none"; 
						bValidCity = false;
					}
			}
			else // il s'agit d'une promo special lié a un show dans une ville, ex: pre-vente american express
			{
					if(bValidCity)//la ville lier a la promo est dans la recherche
					{ 
						try { tr_tags[x].style.display = "table-row" }
						catch(error) { tr_tags[x].style.display = "block" } // for IE
					}
					else { 
						hidden_tr = hidden_tr + 1;
						tr_tags[x].style.display = "none"; 
					}
			}
			
		}		
	}
	if(document.getElementById('city_input').value == "") { document.getElementById('clear_link').style.display = "none"; }
	else { document.getElementById('clear_link').style.display = "inline"; }
		
}

