<script type="text/javascript">
function getDOM(id) {
return document.getElementById(id);
}
var timer=null;
newTimer=null,
pn=getDOM("pn");
window.onload=function () {
startMove(600);
newTimer=setTimeout(function () {
startMove(0);
},5000)
}
//个人方法--------------
function startMove(iTarget) {
if (timer){
clearInterval(timer);
}
timer=setInterval(function () {
var speed=0;
pn.offsetWidth<iTarget?speed=10:speed=-10;
if (pn.offsetWidth==iTarget){
clearInterval(timer);
if (pn.style.width==0+'px'){
pn.style.display='none';
}
}else {
pn.style.display='block';
pn.style.width=pn.offsetWidth+speed+'px';
}
},30)
}