var intIndex=0;arrList=new Array();function dearray(aa)
{arrList=aa.split(',');intIndex=arrList.length;}
function test(){init();dearray("asp,csdn,aaaa,bbbbc,afd,werwe,adfs,ertr,qwq,qwqwq,trt,uyus,dsfs,uere,add,234,2,1dr4,ae4564,adf4645,afa3543,sdfse5,ae345345,sdf4564,34346536");smanPromptList(arrList,"aspx","oooo");dearray("126.com,139.com,163.com,163.net,21cn.com,263.net,chinaren.com,eyou.com,foxmail.com,gmail.com,hotmail.com,live.cn,live.com,mail.china.com,msn.com,qq.com,sina.com,sina.com.cn,sogou.com,sohu.com,tom.com,vip.163.com,vip.qq.com,vip.sina.com,yahoo.cn,yahoo.com,yahoo.com.cn,yahoo.com.hk,yahoo.com.tw,yeah.net");smanPromptList(arrList,"useremail","email")}
function init(){if(arrList.constructor!=Array){alert('smanPromptList初始化失败:第一个参数非数组!');return;}
arrList.sort(function(a,b){if(a.length>b.length)return 1;else if(a.length==b.length)return a.localeCompare(b);else return-1;});}
function smanPromptList(arrList,objInputId,dropType){var objouter=document.getElementById("__smanDisp")
var objInput=document.getElementById(objInputId);var selectedIndex=-1;var intTmp;if(objInput==null){alert('smanPromptList初始化失败:没有找到"'+objInputId+'"文本框');return;}
function objouterClose(){objouter.style.display='none';}
objInput.attachEvent("onblur",objouterClose);objInput.onkeyup=e_checkKeyCode;objInput.onfocus=e_checkAndShow;function e_checkKeyCode(){checkKeyCode(dropType)}
function e_checkAndShow(){checkAndShow(dropType)}
function checkKeyCode(dropType){var ie=(document.all)?true:false
if(ie){var keyCode=event.keyCode;if(keyCode==40||keyCode==38){var isUp=false
if(keyCode==40)isUp=true;chageSelection(isUp);}else if(keyCode==13){outSelection(selectedIndex,dropType);}else{switch(dropType)
{case"email":{;if(objInput.value.indexOf("@")>2)
{checkAndShow(dropType);}
break;}
default:{checkAndShow(dropType);break;}}}}else{checkAndShow(dropType)}
divPosition(objInputId)}
function checkAndShow(dropType){var strInput="ss";switch(dropType)
{case"email":{strInput=objInput.value;if(strInput==""||strInput.indexOf("@")<2)
{return;}
strInput=strInput.split("@")[1];break;}
default:{strInput=objInput.value;break;}}
if(strInput!=""){divPosition(objInput.id);selectedIndex=-1;objouter.innerHTML="";for(intTmp=0;intTmp<arrList.length;intTmp++){if(arrList[intTmp].substr(0,strInput.length)==strInput){addOption(arrList[intTmp],dropType);}}
objouter.style.display='';}else{objouter.style.display='none';}
function addOption(value,dropType){objouter.innerHTML+="<div onmouseover=\"this.className='sman_selectedStyle'\" onmouseout=\"this.className=''\" onmousedown=\"oMdown('"+objInputId+"','"+value+"','"+dropType+"');\">"+value+"</div>";}}
function chageSelection(isUp){if(objouter.style.display=='none'){objouter.style.display='';}else{if(isUp)
selectedIndex++
else
selectedIndex--}
var maxIndex=objouter.children.length-1;if(selectedIndex<0){selectedIndex=0}
if(selectedIndex>maxIndex){selectedIndex=maxIndex}
for(intTmp=0;intTmp<=maxIndex;intTmp++){if(intTmp==selectedIndex){objouter.children[intTmp].className="sman_selectedStyle";}else{objouter.children[intTmp].className="";}}}
function outSelection(Index,dropType){switch(dropType)
{case"email":{;if(objouter.children[Index]!=null){objInput.value=objInput.value.split("@")[0]+"@"+objouter.children[Index].innerText;}
break;}
default:{objInput.value=objouter.children[Index].innerText;break;}}
objouter.style.display='none';}
function divPosition(objID){var clx,cly;var obj,objPos;obj=document.getElementById(objID);objPos=getElePos(obj);clx=getPositions(objInput,"offsetLeft");cly=getPositions(objInput,"offsetTop");var clientwidth=document.body.clientWidth;var clientheight=document.body.clientHeight;if((clientwidth-clx)<200)
{clx=clientwidth-200;};if((clientheight-cly)<150)
{cly=clientheight-150;};objouter.style.top=cly+obj.offsetHeight+2;objouter.style.left=clx+36;objouter.style.width=getAbsoluteWidth(objInput)}
function getElePos(e){var t=e.offsetTop;var l=e.offsetLeft;while(e=e.offsetParent){t+=e.offsetTop;l+=e.offsetLeft;}
var ElePos=new Object();ElePos.l=l
ElePos.t=t
return ElePos}
function getPositions(obj,pos){var t=eval("obj."+pos);while(obj=obj.offsetParent){t+=eval("obj."+pos);}
return t;}}
function oMdown(objInputId,v,dropType){var objInput=document.getElementById(objInputId)
switch(dropType)
{case"email":{;objInput.value=objInput.value.split("@")[0]+"@"+v;break;}
default:{objInput.value=v;break;}}}
document.write("<div id='__smanDisp' style='position:absolute;display:none;background:#E8F7EB;border: 1px solid #CCCCCC;font-size:14px;cursor: default;' onbulr> </div>");document.write("<style>.sman_selectedStyle{background-Color:#102681;color:#FFFFFF}</style>");function getAbsoluteHeight(ob){return ob.offsetHeight}
function getAbsoluteWidth(ob){return ob.offsetWidth}
function getAbsoluteLeft(ob){var mendingLeft=ob.offsetLeft;while(ob!=null&&ob.offsetParent!=null&&ob.offsetParent.tagName!="BODY"){mendingLeft+=ob.offsetParent.offsetLeft;mendingOb=ob.offsetParent;}
return mendingLeft;}
function getAbsoluteTop(ob){var mendingTop=ob.offsetTop;while(ob!=null&&ob.offsetParent!=null&&ob.offsetParent.tagName!="BODY"){mendingTop+=ob.offsetParent.offsetTop;ob=ob.offsetParent;}
return mendingTop;}