
/**
 	current ID 	= the id you want to display
	parentID	= the parent id

	The parent ID is used to determine which array of ID's to use
	
	The function flips through the array and set display to none
	
	Then it set the display to block for the current ID
	
*/
function changeDisplay(currentID, parentID)
{
	// Figure out which array to use for items.
	switch(parentID)
	{
		case 'fareFinderMenu':
			var items = new Array('fareFinderCruises', 'fareFinderHotels', 'fareFinderAirlines', 'fareFinderCarRental', 'fareFinderTourOperator', 'fareFinderTourRailroads');
		break;
		
	}
	
	// Flip through the array and set all displays to none
	for(var i = 0; i < items.length; i++)
	{
		document.getElementById(items[i]).style.display = "none";
	}

	// set the display for the current ID to block
	document.getElementById(currentID).style.display = "block";

	return true;
}

//JIM FUNCTION TO SHOW/HIDE A DIV

function hide_selected_wysiwyg(d) {
	var divCollection = document.getElementsByTagName("div");
	for (var i=0; i<divCollection.length; i++) 
	{
		if(divCollection[i].className == "selectedwysiwyg") 
		{
			divCollection[i].className = "wysiwyg";
		}
	}
}

function change_div_class(id) {
		
	hide_selected_wysiwyg();
	
	document.getElementById(id).className = "selectedwysiwyg";
}

function brightenBackground(id, color) 
{
	document.getElementById(id).style.backgroundColor = color;
} 

function highlightMenu(id) 
{
	if(document.getElementById(id).className == "mainNavSelected") 
	{
		document.getElementById(id).className = "mainNav";
	} else {
		document.getElementById(id).className = "mainNavSelected";
	}
	
} 

function change_div_visibility(id) {
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	} else {
		document.getElementById(id).style.display = "block";
	}
}


function SetChecked(val, chkName, formName)
{
        dml = document.forms[formName];
        len = dml.elements.length;
        for( var i = 0; i < len; i++)
        {
                if (dml.elements[i].name!=chkName)
                {
                        dml.elements[i].checked=val;
                }
        }
}

function sendData(url, id)
{
	var str = '';
	var newurl = '';
	
	str = document.getElementById(id).value;
	
	newurl = url + '?country=' + str;
		
	window.open(newurl);
	
	return true;
}