document.write('<iframe style="position:absolute;width:300px;height:216px;z-index:9;display:none;" src="port_list.asp" name="divPortList" id="divPortList" frameborder="0" scrolling="no"></iframe>')
//document.write('<iframe style="position:absolute;width:300px;height:220px;z-index:9;display:none;" src="other/port_list2.asp" name="divPortList2" id="divPortList2" frameborder="0" scrolling="no"></iframe>')

var PortList_obj,hidetimeout,hidetimeout2,aaa;
var ObjID,objVal;

function PortKeyDown(str,ID)
{
	var obj=document.getElementById('divPortList');
//	if(obj.style.display==''){
		
		if(event.keyCode==13){SetFocus(ID);PortList_GetDate(objVal);return false;}

		if(event.keyCode==38||event.keyCode==40){
			divPortList.document.getElementById('PortSelect').focus();
			return false;
		}
		
		setTimeout('PortList("'+str+'","'+ID+'")',50);
//	}
}


function PortList(obj,ID)
{	
	ObjID=ID;
	aaa=1;
	var p=PortList_obj=document.getElementById(obj);
	var dF=document.getElementById('divPortList');
//	if(dF.style.display=='none'){
		var eT=0,eL=0,eH=0,dH=0,sT=0,eP=p
		while(p&&p.tagName!="BODY"){
		eT+=p.offsetTop;
		eL+=p.offsetLeft;
		p=p.offsetParent;
		}
		var eH=eP.offsetHeight;
		var dH=dF.style.pixelHeight;
		var sT=document.body.scrollTop;
		dF.style.left=eL;
		if(eT-dH>=sT&&eT+eH+dH>document.body.clientHeight+sT) dF.style.top=eT-dH;
		else dF.style.top=eT+eH;
		dF.style.display=''
//	}
	if(hidetimeout){clearTimeout(hidetimeout);}
	cTimeout();

	SetFocus(ID);
}
function SetFocus(ObjId){
var sel=divPortList.document.getElementById('PortSelect');
var SID=0;
for(i=0;i<sel.options.length;i++)
{
	if(sel.options[i].value.toUpperCase().indexOf(PortList_obj.value.toUpperCase())==0)
	{//(i+14<sel.options.length-1)?sel.options[i+14].selected=true:sel.options[sel.options.length-1].selected=true;
	sel.options[i].selected=true;
	objVal=sel.options[i].value;
	break;}
}
	
}


function PortList_GetDate(str)
{PortList_obj.value=str;
PortList_hide2();
aaa=0;}

function PortList_hide()
{
document.getElementById("divPortList").style.display="none";
}

function PortList_hide2()
{hidetimeout2=setTimeout("PortList_hide();",10);}
function cTimeout()
{if(hidetimeout2){clearTimeout(hidetimeout2);}}


function PortList_hide3()
{
Calendar_hide();
if(aaa==1){aaa=0;return false;}
PortList_hide2();}

document.body.onclick=PortList_hide3;