// this function will default a value for a field, based on another field
// (if the target field has not been populated yet)
function setDefaultBasedOnOtherField(evt,targetId)
{
	targetForDefault = document.getElementById(targetId);
	// if no target control or already populated, exit
	if (!targetForDefault || targetForDefault.value) return;
	
	// find clicked control IE/Firefox
	if (evt.srcElement) { clickedControl = evt.srcElement; } 
	else { clickedControl = evt.target; }
	
	// if value match, do nothing
	if (targetForDefault.value == clickedControl.value) { return; }
	
	// setting the default value
	targetForDefault.value = clickedControl.value;
}

function setDefaultMulti(evt, targetIds)
{
	var mySplitResult = targetIds.split(",");
	for(i = 0; i < mySplitResult.length; i++){
		//document.write("<br /> Element " + i + " = " + mySplitResult[i]); 
		setDefaultBasedOnOtherField(evt,mySplitResult[i])
	}
	
}