var isIe=(document.all)?true:false;
//设置select的可见状态
function setSelectState(state)
{
var objl=document.getElementsByTagName('select');
for(var i=0;i<objl.length;i++)
{
objl[i].style.visibility=state;
}
}
function mousePosition(ev)
{
if(ev.pageX || ev.pageY)
{
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
//弹出方法
function showMessageBox(wTitle,content,pos,wWidth)
{
closeWindow();
var bWidth=parseInt(document.body.scrollWidth);
var bHeight=parseInt(document.body.scrollHeight);
if(isIe){
setSelectState('hidden');}
var back=document.createElement("div");
back.id="back";
var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
styleStr+=(isIe)?"filter:alpha(opacity=0);":"opacity:0;";
back.style.cssText=styleStr;
document.body.appendChild(back);
showBackground(back,20);
var mesW=document.createElement("div");
mesW.id="mesWindow";
mesW.className="mesWindow";
mesW.innerHTML="<div class='mesWindowTop'><table width='100%' height='100%'><tr><td>"+wTitle+"</td><td style='width:1px;'><input type='button' onclick='closeWindow();' title='关闭窗口' class='close' value='关闭' /></td></tr></table></div><div class='mesWindowContent' id='mesWindowContent'>"+content+"</div><div class='mesWindowBottom'></div>";
styleStr="left:25%;bottom:20%;position:absolute;width:"+wWidth+"px;";
mesW.style.cssText=styleStr;
document.body.appendChild(mesW);
}
//让背景渐渐变暗
function showBackground(obj,endInt)
{
if(isIe)
{
obj.filters.alpha.opacity+=1;
if(obj.filters.alpha.opacity<endInt)
{
setTimeout(function(){showBackground(obj,endInt)},5);
}
}else{
var al=parseFloat(obj.style.opacity);al+=0.01;
obj.style.opacity=al;
if(al<(endInt/100))
{setTimeout(function(){showBackground(obj,endInt)},5);}
}
}
//关闭窗口
function closeWindow()
{
if(document.getElementById('back')!=null)
{
document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
}
if(document.getElementById('mesWindow')!=null)
{
document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
}
if(isIe){
setSelectState('');}
}
//测试弹出
function testMessageBox(ev)
{
var objPos = mousePosition(ev);
messContent="<div style='padding:20px 0 20px 0;text-align:center'><img src=../template/images/face/00.jpg width=40 height=40 onClick=document.myform.face.value='00';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/01.jpg width=40 height=40 onClick=document.myform.face.value='01';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/02.jpg width=40 height=40 onClick=document.myform.face.value='02';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/03.jpg width=40 height=40 onClick=document.myform.face.value='03';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/04.jpg width=40 height=40 onClick=document.myform.face.value='04';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/05.jpg width=40 height=40 onClick=document.myform.face.value='05';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/06.jpg width=40 height=40 onClick=document.myform.face.value='06';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/07.jpg width=40 height=40 onClick=document.myform.face.value='07';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/08.jpg width=40 height=40 onClick=document.myform.face.value='08';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/09.jpg width=40 height=40 onClick=document.myform.face.value='09';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/10.jpg width=40 height=40 onClick=document.myform.face.value='10';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/11.jpg width=40 height=40 onClick=document.myform.face.value='11';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/12.jpg width=40 height=40 onClick=document.myform.face.value='12';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/13.jpg width=40 height=40 onClick=document.myform.face.value='13';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/14.jpg width=40 height=40 onClick=document.myform.face.value='14';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/15.jpg width=40 height=40 onClick=document.myform.face.value='15';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/16.jpg width=40 height=40 onClick=document.myform.face.value='16';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/17.jpg width=40 height=40 onClick=document.myform.face.value='17';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/18.jpg width=40 height=40 onClick=document.myform.face.value='18';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/19.jpg width=40 height=40 onClick=document.myform.face.value='19';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/20.jpg width=40 height=40 onClick=document.myform.face.value='20';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/21.jpg width=40 height=40 onClick=document.myform.face.value='21';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/22.jpg width=40 height=40 onClick=document.myform.face.value='22';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/23.jpg width=40 height=40 onClick=document.myform.face.value='23';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/24.jpg width=40 height=40 onClick=document.myform.face.value='24';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/25.jpg width=40 height=40 onClick=document.myform.face.value='25';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/26.jpg width=40 height=40 onClick=document.myform.face.value='26';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/27.jpg width=40 height=40 onClick=document.myform.face.value='27';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/28.jpg width=40 height=40 onClick=document.myform.face.value='28';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/29.jpg width=40 height=40 onClick=document.myform.face.value='29';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/30.jpg width=40 height=40 onClick=document.myform.face.value='30';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/31.jpg width=40 height=40 onClick=document.myform.face.value='31';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/32.jpg width=40 height=40 onClick=document.myform.face.value='32';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/33.jpg width=40 height=40 onClick=document.myform.face.value='33';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/34.jpg width=40 height=40 onClick=document.myform.face.value='34';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/35.jpg width=40 height=40 onClick=document.myform.face.value='35';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/36.jpg width=40 height=40 onClick=document.myform.face.value='36';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/37.jpg width=40 height=40 onClick=document.myform.face.value='37';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/38.jpg width=40 height=40 onClick=document.myform.face.value='38';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/39.jpg width=40 height=40 onClick=document.myform.face.value='39';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/40.jpg width=40 height=40 onClick=document.myform.face.value='40';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/41.jpg width=40 height=40 onClick=document.myform.face.value='41';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/42.jpg width=40 height=40 onClick=document.myform.face.value='42';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/43.jpg width=40 height=40 onClick=document.myform.face.value='43';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/44.jpg width=40 height=40 onClick=document.myform.face.value='44';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/45.jpg width=40 height=40 onClick=document.myform.face.value='45';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/46.jpg width=40 height=40 onClick=document.myform.face.value='46';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/47.jpg width=40 height=40 onClick=document.myform.face.value='47';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/48.jpg width=40 height=40 onClick=document.myform.face.value='48';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/49.jpg width=40 height=40 onClick=document.myform.face.value='49';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/50.jpg width=40 height=40 onClick=document.myform.face.value='50';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/51.jpg width=40 height=40 onClick=document.myform.face.value='51';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/52.jpg width=40 height=40 onClick=document.myform.face.value='52';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/53.jpg width=40 height=40 onClick=document.myform.face.value='53';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/54.jpg width=40 height=40 onClick=document.myform.face.value='54';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/55.jpg width=40 height=40 onClick=document.myform.face.value='55';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/56.jpg width=40 height=40 onClick=document.myform.face.value='56';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/57.jpg width=40 height=40 onClick=document.myform.face.value='57';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/58.jpg width=40 height=40 onClick=document.myform.face.value='58';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/59.jpg width=40 height=40 onClick=document.myform.face.value='59';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/60.jpg width=40 height=40 onClick=document.myform.face.value='60';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/61.jpg width=40 height=40 onClick=document.myform.face.value='61';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/62.jpg width=40 height=40 onClick=document.myform.face.value='62';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/63.jpg width=40 height=40 onClick=document.myform.face.value='63';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/64.jpg width=40 height=40 onClick=document.myform.face.value='64';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/65.jpg width=40 height=40 onClick=document.myform.face.value='65';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/66.jpg width=40 height=40 onClick=document.myform.face.value='66';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/67.jpg width=40 height=40 onClick=document.myform.face.value='67';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/68.jpg width=40 height=40 onClick=document.myform.face.value='68';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/69.jpg width=40 height=40 onClick=document.myform.face.value='69';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/70.jpg width=40 height=40 onClick=document.myform.face.value='70';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/71.jpg width=40 height=40 onClick=document.myform.face.value='71';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/72.jpg width=40 height=40 onClick=document.myform.face.value='72';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/73.jpg width=40 height=40 onClick=document.myform.face.value='73';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/74.jpg width=40 height=40 onClick=document.myform.face.value='74';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/75.jpg width=40 height=40 onClick=document.myform.face.value='75';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/76.jpg width=40 height=40 onClick=document.myform.face.value='76';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/77.jpg width=40 height=40 onClick=document.myform.face.value='77';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/78.jpg width=40 height=40 onClick=document.myform.face.value='78';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/79.jpg width=40 height=40 onClick=document.myform.face.value='79';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/80.jpg width=40 height=40 onClick=document.myform.face.value='80';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/81.jpg width=40 height=40 onClick=document.myform.face.value='81';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/82.jpg width=40 height=40 onClick=document.myform.face.value='82';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/83.jpg width=40 height=40 onClick=document.myform.face.value='83';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/84.jpg width=40 height=40 onClick=document.myform.face.value='84';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/85.jpg width=40 height=40 onClick=document.myform.face.value='85';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/86.jpg width=40 height=40 onClick=document.myform.face.value='86';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/87.jpg width=40 height=40 onClick=document.myform.face.value='87';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/88.jpg width=40 height=40 onClick=document.myform.face.value='88';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/89.jpg width=40 height=40 onClick=document.myform.face.value='89';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/90.jpg width=40 height=40 onClick=document.myform.face.value='90';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/91.jpg width=40 height=40 onClick=document.myform.face.value='91';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/92.jpg width=40 height=40 onClick=document.myform.face.value='92';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/93.jpg width=40 height=40 onClick=document.myform.face.value='93';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/94.jpg width=40 height=40 onClick=document.myform.face.value='94';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/95.jpg width=40 height=40 onClick=document.myform.face.value='95';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/96.jpg width=40 height=40 onClick=document.myform.face.value='96';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/97.jpg width=40 height=40 onClick=document.myform.face.value='97';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/98.jpg width=40 height=40 onClick=document.myform.face.value='98';closeWindow();showimage() style=cursor:hand>&nbsp;<img src=../template/images/face/99.jpg width=40 height=40 onClick=document.myform.face.value='99';closeWindow();showimage() style=cursor:hand>&nbsp;</div>";
showMessageBox('选择头像',messContent,objPos,600);
}
function showimage() { document.images.wrimg.src = "../template/images/face/"+document.myform.face.value+".jpg"; }
//测试弹出
function loginBox(ev)
{
var objPos = mousePosition(ev);
messContent="<div style='padding:20px 0 20px 0;text-align:center;BACKGROUND: url(../template/images/login_bg.gif) no-repeat top right; background-color:#F0FCFD'><FORM name=UserLogin onsubmit='return CheckForm();' action='../login.asp?action=chk' method=post><table width='300' border='0' cellspacing='0' cellpadding='0'><tr><td width='80' height='30' align='right'>登陆帐号:</td><td width='240' height='30' align=left><input class='text'id=UserName name='UserName' type='text' size='20' maxlength='16'></td></tr><tr><td width='80' height='30' align='right'>密码:</td><td height='30' align=left><input class='text'id=Password name='PassWord' type='PassWord' size='20' maxlength='16'></td></tr><tr><td width='80' height='21' align='right' valign='bottom'>验证码:</td><td height='21' align=left><input type='text' name='codestr' size='4'>&nbsp;<iframe name='I1' style='background-color:#E6FFFF' marginheight='0' frameborder='0' width='60' height='30' scrolling='no' src='../logincode.asp'></iframe></td></tr><tr><td height='30' colspan='2' align='center'><input type='submit' value='登 陆' class='btn' onClick='javascript:return CheckFormLogin();' ></td></tr><tr><td height='30' colspan='2' align='center'><a href='../reg.asp?action=apply'>没有帐号?<img src='../template/images/reg.gif' border='0' style='margin:2px 0px -5px 0px'/></a>&nbsp;&nbsp;<a href='../lostpass.asp'>忘记密码?<img src='../template/images/pass.gif' border='0' height='22' style='margin:2px 0px -5px 0px'/></a></td></tr></table></form></div>";
showMessageBox('会员登陆',messContent,objPos,340);
}

function MapBox(ev)
{
var objPos = mousePosition(ev);
messContent="<iframe name='I1' style='background-color:#E6FFFF' marginheight='0' frameborder='0' width='520' height='400' scrolling='no' src='../include/BigMap.asp'></iframe>";
showMessageBox('查看地址',messContent,objPos,520);
}
function WeatherBox(ev)
{
var objPos = mousePosition(ev);
messContent="<iframe name='I1' style='background-color:#E6FFFF' marginheight='0' frameborder='0' width='600' height='400' scrolling='yes' src='http://www.weather.com.cn/html/weather/101091101.shtml'></iframe>";
showMessageBox('查看天气',messContent,objPos,600);
}
