/*************************************
*** ┌┈┈┈┈┈┈┈┈┈┈┈┈┈┐ ***
*** ┊  Powered By Ma.Hong.Tao  ┊ ***
*** ┊  Last Modify 2008-04-24  ┊ ***
*** └┈┈┈┈┈┈┈┈┈┈┈┈┈┘ ***
*** ┌┈┈┈┈┈┈┈┈┈┈┈┈┈┐ ***
*** ┊mahongtao_2000@hotmail.com┊ ***
*** └┈┈┈┈┈┈┈┈┈┈┈┈┈┘ ***
*************************************/

function hideElement_(elmID)
{
	for(i = 0; i < document.all.tags( elmID ).length; i++ )
	{
		obj = document.all.tags( elmID )[i];
		if( !obj || !obj.offsetParent )
		{
			continue;
		}
		obj.style.visibility = "hidden";
	}
}
 
function showElement_(elmID)
{
	for( i = 0; i < document.all.tags(elmID).length; i++ )
	{
		obj = document.all.tags( elmID )[i];
		
		if( !obj || !obj.offsetParent )
		{
			continue;
		}
		obj.style.visibility = "";
	}
}
function showBox(_target)
{
	if($('SubjectId').value=='')
	{
		alert('请先选择考试语言/版本/科目！');
		return false;
	}
	
	if(_target=='Region')
		clearValue('Region','ATC','Date','Time');
	if(_target=='ATC')
		clearValue('ATC','Date','Time');
	if(_target=='Date')
		clearValue('Date','Time');
	if(_target=='Time')
		clearValue('Time');
	
	if($('DateId').value=='')
		_target='Date';
	if($('ATCId').value=='')
		_target='ATC';
	if($('RegionId').value=='')
		_target='Region';
		
	hideElement_("SELECT");
	
	var _y=document.body.scrollTop;
	$('parentBox').style.left=280;
	$('parentBox').style.top=_y+100;
	$('parentBox').style.display='block';
	
	runAJAX('/AJAX/ExamInfo.aspx?Target='+_target+'&SubjectId='+$('SubjectId').value+'&RegionId='+$('RegionId').value+'&ATCId='+$('ATCId').value+'&DateId='+$('DateId').value,$('box'));
}
function closeBox()
{
	showElement_("SELECT");
	$('parentBox').style.display='none';
}
function returnInfo(_id,_title,_target)
{
	$(_target+'Id').value=_id;
	$(_target+'Title').value=_title;
	closeBox();
}
function clearValue()
{
	for(i=0;i<clearValue.arguments.length;i++)
	{
		$(clearValue.arguments[i]+'Id').value='';
		$(clearValue.arguments[i]+'Title').value='';
	}
}