//http://www.shuziren.com
//网警执勤，卡通形象每15分钟显示一次，显示60秒后自动关闭

document.write("<div id=img style=position:absolute;z-index:255;DISPLAY:none;><a href=http://218.57.19.118/ target=_blank onFocus=this.blur()><img border=0 src=qdwj.jpg width=116 height=120></a></div>")

var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30; 
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;}
else {
yPos = yPos - step;}
if (yPos < 0) {
yon = 1;
yPos = 0;}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);}
if (xon) {
xPos = xPos + step;}
else {
xPos = xPos - step;}
if (xPos < 0) {
xon = 1;
xPos = 0;}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);}}
function start() {
img.style.display = "";
img.visibility = "visible";
interval = setInterval('changePos()', delay);}

function setCookie(name, value, expire) {   
  window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function getCookie(Name) {   
   var search = Name + "=";
   if (window.document.cookie.length > 0) { // if there are any cookies
     offset = window.document.cookie.indexOf(search);
	 if (offset != -1) { // if cookie exists
       offset += search.length;          // set index of beginning of value
	   end = window.document.cookie.indexOf(";", offset)          // set index of end of cookie value
	   if (end == -1)
	     end = window.document.cookie.length;
	   return unescape(window.document.cookie.substring(offset, end));
     }
   }
   return null;
}
function gb(){ 
img.style.display = "none";
}
function register(name) {
  var today = new Date();
  var expires = new Date();
  expires.setTime(today.getTime() + 1000*15*60); //每15钟显示一次
  setCookie("shuziren", name, expires);
setTimeout("gb()",60000);  //显示60秒自动关闭
}

function openWin() {
  var c = getCookie("shuziren");
  if (c != null) {
    return;
  }
  register("szr");
  self.focus(); 
start(); 
}
openWin();
window.focus()
