导航栏: 首页 评论列表

window.open弹广告

默认分类 2011-03-06 18:58:26

  1. (function(){  
  2.     var shop = document.createElement("DIV");  
  3.     //shop.className = 'popup';  
  4.     shop.id = 'pay_activity1';  
  5.     shop.style.display = 'block';  
  6.     shop.style.zIndex = '999999';  
  7.     shop.innerHTML = '<div style="position: fixed; right: 0px; bottom: 0px; _position: absolute; _top:expression(documentElement.scrollTop + documentElement.clientHeight - 300);_left:expression(documentElement.scrollLeft + documentElement.clientWidth - 300);z-index: 500;"><a href="#" class="close" style="position: absolute;z-index:100; width: 22px; height: 22px; left: 0px;margin-left: 280px;text-decoration: none;background-image:url(\'https://pay.sdo.com/style/css/img/blank.png\');" title="close" onclick=" document.getElementById(\'pay_activity1\').style.display=\'none\'"> </a><iframe src="https://ebinfo.sdo.com/esales/pay_sdo_com/shop_sdo_com.htm" width="300" height="300" scrolling="no" border="0" frameborder="0" allowtransparency="true" style="background:transparent;"></iframe></div>';  
  8.     document.getElementsByTagName("BODY")[0].appendChild(shop);  
  9.       
  10.     //window.setTimeout(function() { document.getElementById('pay_activity1').style.display = 'none'; }, 5000);  
  11.   
  12.     function getCookie( name ) {   
  13.         var start = document.cookie.indexOf( name + "=" );   
  14.         var len = start + name.length + 1;   
  15.         if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {   
  16.             return null;   
  17.         }   
  18.         if ( start == -1 ) return null;   
  19.         var end = document.cookie.indexOf( ';', len );   
  20.         if ( end == -1 ) end = document.cookie.length;   
  21.         return unescape( document.cookie.substring( len, end ) );   
  22.     }   
  23.        
  24.     function setCookie( name, value, expires, path, domain, secure ) {   
  25.         var today = new Date();   
  26.         today.setTime( today.getTime() );   
  27.         if ( expires ) {   
  28.             expires = expires * 1000 * 60 * 60 * 24;   
  29.         }   
  30.         var expires_date = new Date( today.getTime() + (expires) );   
  31.         document.cookie = name+'='+escape( value ) +   
  32.             ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()   
  33.             ( ( path ) ? ';path=' + path : '' ) +   
  34.             ( ( domain ) ? ';domain=' + domain : '' ) +   
  35.             ( ( secure ) ? ';secure' : '' );   
  36.     }  
  37.     function deleteCookie( name, path, domain ) {   
  38.         if ( getCookie( name ) ) document.cookie = name + '=' +   
  39.                 ( ( path ) ? ';path=' + path : '') +   
  40.                 ( ( domain ) ? ';domain=' + domain : '' ) +   
  41.                 ';expires=Thu, 01-Jan-1970 00:00:01 GMT';   
  42.     }   
  43.       
  44.     function showShopActivity(){  
  45.         if(!getCookie("shop_activity"))  
  46.         {  
  47.             var openURL = window.open ("http://adrs.sdo.com/ADRefererSystem/adjump.aspx?SndaADID=sdo-shangcheng-110217-22-1&RedirectUrl=http%3a%2f%2fshop.sdo.com%2findex.htm","openURL","height="+window.screen.height+",width=" +window.screen.width+ ",left=0,top=0,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes, status=yes");  
  48.             openURL.window.blur();  
  49.             openURL.window.opener.focus();  
  50.             setCookie("shop_activity","1",1);  
  51.         }  
  52.         if(document.addEventListener){  
  53.             document.removeEventListener("click",showShopActivity,false);  
  54.         }  
  55.         else{  
  56.             document.detachEvent("onclick", showShopActivity);  
  57.         }  
  58.     }  
  59.       
  60.     if(document.addEventListener){  
  61.         document.addEventListener('click', showShopActivity, false);  
  62.     }else {  
  63.         document.attachEvent('onclick', showShopActivity);  
  64.     }  
  65.   
  66. })()  


>> 留言评论