 function buildOpt(values,texts) {
	var valuesT = values.split("|");
	var textsT = texts.split("|");
	for (var i=0;i<valuesT.length;i++) {
		document.writeln('<option value="' + valuesT[i] + '">' + textsT[i] + '<\/option>');
	}
}

function   strFormat(str,iLen)   {   
  if(str.length<iLen) {   
  for(iIndex=0;iIndex<iLen-str.length;iIndex++)   
      str="0"+str;  
  return   str;}   
  else   {return   str;}   
}

function   set_latest_arrival_time(time){ 
var t1=[];
t1=time.split(":");
document.myForm.ltime.value=strFormat((Number(t1[0])+3)%24+":"+t1[1],5) ;
} 

function   checktime(time2){ 
var t1=[],t2=[];
var inthour2,inthour1;
t1=document.myForm.etime.value.split(":");
t2=time2.split(":");
inthour2=Number(t2[0]);
inthour1=Number(t1[0]);
if(inthour2<inthour1)
inthour2=inthour2+24;
if(inthour2-inthour1>6)
{alert("Sorry,time interval during the earliest time and the latest time you arrival should not more than six hours.");
set_latest_arrival_time(document.myForm.etime.value);}
} 