function ButtonOver(BtnObj){
BtnObj.style.backgroundColor='#cc3300'
}
function ButtonOut(BtnObj){
BtnObj.style.backgroundColor='#993300'
}
function MouseClick(Index,trObj){
with(GetObj(CoolSelect[Index][1])){
value=trObj.innerText;
style.backgroundColor='#993300'
style.color='#FFFFFF'
focus()
}
DropDown(Index)
}
function GoURL(trObj){
var url=trObj.getAttribute("url")
if(url&&url!="")window.open(url)
}
function BoxBlur(InputBox){
with(InputBox.style){backgroundColor="";color=''}
}
function DropDown(Index){
event.cancelBubble=true
ContainerReset(Index)
var show=GetObj(CoolSelect[Index][2]).style.visibility=='visible'
GetObj(CoolSelect[Index][2]).style.visibility=show?'hidden':'visible'
setPosition(Index)
}
function document::onclick(){
for(i=0;i<CoolSelect.length;i++){
GetObj(CoolSelect[i][2]).style.visibility='hidden'
with(GetObj(CoolSelect[i][2]))for(j=0;j<rows.length;j++)rows[j].style.display=""
}
}
function window::onresize(){
for(i=0;i<CoolSelect.length;i++)setPosition(i)
}
function showTip(Index){
var inputbox=GetObj(CoolSelect[Index][1])
var container=GetObj(CoolSelect[Index][2])
var num=0
container.style.visibility="visible"
for(i=0;i<container.rows.length;i++){
if(container.rows[i].cells[0].innerText.indexOf(inputbox.value)!=0)container.rows[i].style.display="none"
else {container.rows[i].style.display="";num++}
}
if(num==0)container.style.visibility='hidden'
}
function ContainerReset(Index){
var container=GetObj(CoolSelect[Index][2])
for(i=0;i<container.rows.length;i++)container.rows[i].style.display=""
if(CurrentTR)CurrentTR.className=""
}
function setPosition(Index){
var s=GetObj(CoolSelect[Index][0])
var container=GetObj(CoolSelect[Index][2])
var l=s.offsetLeft;
var t=s.offsetTop;
while(s=s.offsetParent){l+=s.offsetLeft;t+=s.offsetTop}
with(container.style){left=l+1;top=t+GetObj(CoolSelect[Index][0]).offsetHeight}
}
function Init(){
CoolSelect[0]=["ConTainer1","txt1","select1"]
CoolSelect[1]=["ConTainer2","txt2","select2"]
for(i=0;i<CoolSelect.length;i++){
var s=GetObj(CoolSelect[i][0])
var container=GetObj(CoolSelect[i][2])
container.style.width=s.offsetWidth>container.offsetWidth?s.offsetWidth:container.offsetWidth
setPosition(i)
}
}
function GetObj(id){return document.getElementById(id)}
</script>
</head>