ycn=window.ycn||{};ycn.Event={addEvent:function(obj,evType,fn){if(obj.addEventListener)
{obj.addEventListener(evType,fn,false);return true;}
else if(obj.attachEvent)
{var r=obj.attachEvent("on"+evType,fn);ycn.EventCache.add(obj,evType,fn);return r;}
else
{return false;}},removeEvent:function(obj,evType,fn){if(obj.removeEventListener){obj.removeEventListener(evType,fn,false);return true;}else if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}else{return false;}},getEvent:function(e)
{e=window.event||e;e.leftButton=false;if(e.srcElement==null&&e.target!=null)
{e.srcElement=e.target;e.leftButton=(e.button==1);}
else if(e.target==null&&e.srcElement!=null)
{e.target=e.srcElement;e.leftButton=(e.button==0);}
else if(e.srcElement!=null&&e.target!=null)
{}
else{return null}
if(document.body&&document.documentElement)
{e.mouseX=e.pageX||(e.clientX+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft));e.mouseY=e.pageY||(e.clientY+Math.max(document.body.scrollTop,document.documentElement.scrollTop));}
else
{e.mouseX=-1;e.mouseY=-1;}
return e;},stopEvent:function(e)
{if(e&&e.cancelBubble!=null)
{e.cancelBubble=true;e.returnValue=false;}
if(e&&e.stopPropagation&&e.preventDefault)
{e.stopPropagation();e.preventDefault();}
return false;}};ycn.EventCache=function()
{var listEvents=[];return{listEvents:listEvents,add:function(node,sEventName,fHandler,bCapture){listEvents[listEvents.length]=arguments;},flush:function(){var i,item;for(i=listEvents.length-1;i>=0;i=i-1)
{item=listEvents[i];if(item[0].removeEventListener){item[0].removeEventListener(item[1],item[2],item[3]);};if(item[1].substring(0,2)!="on"){item[1]="on"+item[1];};if(item[0].detachEvent){item[0].detachEvent(item[1],item[2]);};item[0][item[1]]=null;};}};}();ycn.Event.addEvent(window,"unload",ycn.EventCache.flush);function error_handler(a,b,c)
{window.status=(c+"\n"+b+"\n\n"+a+"\n\n"+error_handler.caller);return true;}

if(navigator.userAgent.toLowerCase().indexOf('msie')>0 ){
var css = document.createElement("link");
css.href = "fpmsg.css";
css.rel = "stylesheet";
css.type = "text/css";
var msg = document.createElement("div");
msg.id = "popupmsg";
msg.innerHTML = '<div class=\"popuptxt\" style="margin-left:0px;top:0px"><img height=\"330\" width=\"1005\" src=\"/Ad/url/20091.gif\" bordor=\"0\"></div><a href=\"\" onclick="return close_popupmsg();" class=\"popupmsgcl\" style="margin-top:12px">关闭</a>';
msg.style.display = "none";
document.body.insertBefore(css,document.getElementsByTagName('div')[0]);
var divlist = document.getElementsByTagName('div')
for(var i=0;i<divlist.length;i++){
 if(divlist[i].className == "yhd"){
  divlist[i].insertBefore(msg,ytop);
  break;
 }
}
msg.style.marginTop = "-330px";
msg.style.display = "block";
msg.style.height = "330px";


ycn.Event.addEvent(window,'load',function(){
var anim = function(){
n += 10;
if(n >= 330){
msg.style.marginTop = "0";
window.clearInterval(tt);
}else{
msg.style.marginTop = "-"+(330 - n)+"px";
}
},n=0;
var tt = window.setInterval(anim,1);
})
}


function close_popupmsg(){
try
{
var m = document.getElementById(popupmsg);
var anim = function(){
n += 10;
if(n >= 330){
msg.style.marginTop = "-330px";
msg.style.display = "none";
window.clearInterval(tt);
}else{
msg.style.marginTop = "-"+ n +"px";
}
},n=0;
var tt = window.setInterval(anim,3);
return false;
}
catch(e)
{
alert(e.message);
}
}
window.setTimeout("close_popupmsg()",8000);

 

posted on 2009-01-16 09:38  bestsaler  阅读(321)  评论(0编辑  收藏  举报