
function changeWorldMap(continent){
	if(continent != "")
		document["worldMap"].src = "images/map_"+continent+".gif";
	else
		document["worldMap"].src = "images/map.gif";	
}

function initAffiliate(){
	var subContents = new Array;
	subContents[0] = "airPlane"; subContents[1] = "accom"; subContents[2] = "package"; subContents[3] = "auto";
	var containers = document.getElementById("indexReservations").getElementsByTagName("div");
	var hrefs = containers[0].getElementsByTagName("a");
	var subMenus = containers[0].getElementsByTagName("div");						
	for(var i=0; i<hrefs.length; i++)
		hrefs[i].href = "javascript:showAffiliateBox("+i+");";
	document.getElementById(subContents[0]+"Box").style.display = "block";					
	subMenus[0].className = subContents[0]+"Choosed";	
}

function showAffiliateBox(subContent){
	var subContents = new Array;
	subContents[0] = "airPlane"; subContents[1] = "accom"; subContents[2] = "package"; subContents[3] = "auto"; subContents[4] = "accomHu"; subContents[5] = "accomForeign";
	var containers = document.getElementById("indexReservations").getElementsByTagName("div");				
	var subMenus = containers[0].getElementsByTagName("div");					
	for(var i=0; i<subContents.length; i++)		
		if(document.getElementById(subContents[i]+"Box").style.display == "block"){
			document.getElementById(subContents[i]+"Box").style.display = "none";
			if(i<4)
				subMenus[i].className = subContents[i];
		}
	document.getElementById(subContents[subContent]+"Box").style.display = "block";			
	if(subContent < 4)	
		subMenus[subContent].className = subContents[subContent]+"Choosed";
}

function showAccom(){
	var choosedAccom = document.affAccomChooserForm.accomChooser[document.affAccomChooserForm.accomChooser.selectedIndex].value;
	showAffiliateBox(choosedAccom);
}

function changeResultsDisplay(resultID){
	var countryElement = document.getElementById("group"+resultID);
	if(countryElement.className == "groupClosed")
		countryElement.className = "groupOpened";
	else
		countryElement.className = "groupClosed";
}

function initSearchForms(formID){
	var formTable = document.getElementById(formID+"SearchForm");		
	var button = document.getElementById(formID+"Button");				
	formTable.style.display = "block";
	button.className = "buttonContainerActive";		
}

function showSearchForm(formID){
	var searchForms = new Array;
	searchForms[0] = "blog"; searchForms[1] = "tip"; searchForms[2] = "image"; searchForms[3] = "user";	searchForms[4] = "advanced";	
	for(var i=0; i<searchForms.length; i++){
		var formTable = document.getElementById(searchForms[i]+"SearchForm");		
		var button = document.getElementById(searchForms[i]+"Button");				
		formTable.style.display = "none";
		button.className = "buttonContainer";		
		if(searchForms[i] == formID){
			formTable.style.display = "block";		
			button.className = "buttonContainerActive";					
		}
	}
}

