

function ChangeClass(type, params)
{
	if (type == "Flight")
	{
		FLTCallTFW(defaultParams + '&' + params);
		
	}else
	{
		if (type == "Package")
		{		
			PCKCallTFW(defaultParams + '&' + params);
		}
	}
	
}

function Change(TFWType, params, level, sel, Type)
{
	if (level == 0)
	{
		FlushTxtBoxValue()
		if (TFWType == "Flight")
		{
			FLTCallTFW(defaultParams + '&' + params.replace(/&amp;/g, '&'));
			
		}else
		{
			if (TFWType == "Package")
			{		
				PCKCallTFW(defaultParams + '&' + params.replace(/&amp;/g, '&'));
			}
		}
	}
	else
	{
		//filter the multilevel choice by stripping what is left of :
		if(Type=='FROM' && document.getElementById("FromTxtFld").value.indexOf(':') > 0)
			FromTxtValue = FilterLevel(document.getElementById("FromTxtFld"))
		if(Type=='TO' && document.getElementById("ToTxtFld").value.indexOf(':') > 0) 
			ToTxtValue = FilterLevel(document.getElementById("ToTxtFld"))
		
		if (TFWType == "Flight")
		{
			FLTCallTFW(defaultParams + '&' + params.replace(/&amp;/g, '&') + '&' + Type + 'LEVEL=' + level + '&' + Type + 'SELECTED=' + sel);
			
		}else
		{
			if (TFWType == "Package")
			{		
				PCKCallTFW(defaultParams + '&' + params.replace(/&amp;/g, '&') + '&' + Type + 'LEVEL=' + level + '&' + Type + 'SELECTED=' + sel);
			}
		}
	}
}


function FilterLevel(elem)
{
	val = Right(elem.value, elem.value.length - elem.value.indexOf(':') - 2)
	if(val.indexOf(':') > 0)
		val = Right(val, val.length - val.indexOf(':') - 2)
	return(val)
}



function SaveTxtBoxValue()
{
	FromTxtValue = document.getElementById("FromTxtFld").value
	ToTxtValue = document.getElementById("ToTxtFld").value
}

function FlushTxtBoxValue()
{
	FromTxtValue = ''
	ToTxtValue = ''
}
