function AjaxSelectBox(v){
var dl = v.parentNode;
var dd = dl.getElementsByTagName("dd")[0];
var dt = dl.getElementsByTagName("dt")[0];
var lis = dl.getElementsByTagName("li");
var html = '';
for(var y=0; y<lis.length; y++){   
   html += '<li onclick="SetSelectInput(this,1);" onmouseout="SetSelectInput(this,2);" onmousemove="SetSelectInput(this,3);" value="'+lis[y].getAttribute("value")+'">' + lis[y].innerHTML + '</li>';
}
dl.getElementsByTagName("ul")[0].innerHTML = html;
(dd.style.display == "block")?dd.style.display = "none":dd.style.display = "block";
//dl.onmouseout = function() {dd.style.display = "none";}
dd.onmouseover = function() {dd.style.display = "block";}
}

function SetSelectInput(v,flag){
var dl = v.parentNode;
while(dl.nodeName != 'DL'){
   dl = dl.parentNode;
}
var input = dl.getElementsByTagName("input")[0];
var dd = dl.getElementsByTagName("dd")[0]; 
var dt = dl.getElementsByTagName("dt")[0]; 
dd.onmouseover = function() {dd.style.display = "block";}
v.onmouseover = function() {dd.style.display = "block";} 
dd.onmouseout = function() {dd.style.display = "none"} 
if(flag == 1){
   //input.value = v.attributes.getNamedItem("value").value;
   input.value = v.getAttribute("value");
   //alert(input.value);
   dt.innerHTML = v.innerHTML;
   dd.style.display = "none";
} else if(flag == 2){
   v.className = 'out'; return;
} else{
   v.className = 'move'; return; 
}  
}
//the following function is applied in top nav menu "Reservation"
function showRVform()
{
	$("#RV_detailFrame").attr("src","reservation_form_frame.php");
	showDiv('reservationFormWrapper');
}

function showRVDetailContent(divID){
				var CW = window.parent.document.documentElement.clientWidth;
				var CH = window.parent.document.documentElement.clientHeight;
				var SH = window.parent.document.documentElement.scrollTop;
				var SW = window.parent.document.documentElement.scrollWidth;
				//alert(SH);
				var RVDetailContentWrapper = window.parent.document.getElementById(divID);
				var RVFormWapper = window.parent.document.getElementById("reservationFormWrapper");
				(navigator.appVersion.indexOf("MSIE") != -1)? RVFormWapper.style.filter= "alpha(opacity = 20)" : RVFormWapper.style.opacity = 0.2;
				
				RVDetailContentWrapper.style.display = "block";
				RVDetailContentWrapper.style.top = SH + (CH - RVDetailContentWrapper.offsetHeight)/2 + "px";
				RVDetailContentWrapper.style.left = (SW - RVDetailContentWrapper.offsetWidth)/2 + "px";
}

var currentRadioID = null;
function radioSet(radioID){
	var FTDefault = document.getElementById("FTDefault").innerHTML;
	var FTFlight = document.getElementById("FTFlight").innerHTML;
	var FTTrain = document.getElementById("FTTrain").innerHTML;
	if(currentRadioID==radioID.id)
	{
		radioID.checked = false;
		currentRadioID = null;
	}
	else
	{
		radioID.checked = true;
		currentRadioID = radioID.id;
	}
	document.getElementById("FT").innerHTML = (currentRadioID == null) ? FTDefault:(radioID.id=="flight1"||radioID.id=="flight2"||radioID.id=="flight3") ? FTFlight : FTTrain;
	document.getElementById("FTNo").disabled = (currentRadioID == null) ? true : false;
	} 
//addEvent(window,"load",AjaxSelectBox);