// JavaScript Document
var time = [ 
'7' , '7点' , 
'9' , '9点' , 
'11' , '11点' , 
'13' , '13点' , 
'15' , '15点' , 
'17' , '17点' , 
'19' , '19点' , 
'21' , '21点' , 
'23' , '23点'
] ; 

function time_cell ( code , value , pull_id) { 
	document.write ( "<tr><td style='font-size:9pt;'" + 
	" onmouseover=\"this.style.color='white';this.style.backgroundColor='navy';\" " +
	" onmouseout=\"this.style.color='black';this.style.backgroundColor='white';\" " + 
	" onclick='set_time(\"" + code + "\" , \"" + value + "\", \"" + pull_id + "\");'>" +
	value + 
	"</td></tr>" ) ; 
}

function time_panel_setup ( pos , left_pos , layer_id , pull_id) { 	
	document.write ( 
	"<div id='" + layer_id + 
	"' style='position: absolute; left:" + left_pos + 
	"; top: " + pos + 
	"; visibility: hidden; background-color:white; z-index:9999; '>" + 
	"<table width=60 style='border-style:solid; border-width:1; border-color:black'>" ) ; 
	var ai = 0 ; 
	for ( var ai=0; ai < time.length/2; ai++ ) { 
		time_cell ( time[ai*2] , time[ai*2+1] , pull_id) ; 
	}
	document.write ( "</table></div>" ) ; 
}

function set_time ( code , vl , pull_id) { 
	if(pull_id == "start_pull"){
	document.getElementById ( "start" ) . value  = code ;  
	document.getElementById ( "startTime" ) . value  = vl ;  
	}
	else if(pull_id == "arr_pull"){
	document.getElementById ( "arrive" ) . value  = code ;  
	document.getElementById ( "arrTime" ) . value  = vl ; 
	}
}