<%
action = Request.QueryString("pic")
gid = Request.QueryString("g")
sid = Request.QueryString("m")
If gid <> ""  Then lianjie = "g="&gid
If sid <> ""  Then lianjie = "m="&sid
select case action
	case "pay1"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay1.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case "pay2"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay2.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case "pay3"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay3.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case "pay4"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay4.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case "pay5"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay5.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case "pay6"
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay6.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
	case else
	%>
document.write('<div id=\'floatAdv\' onmouseover=\'javascript:stopMove();\' onmouseout=\'javascript:startMove();\' style=\'position:absolute !important; left:100px; top:200px; z-index:1000\'><div style=\'text-align:right\'><a href=\'javascript:closeAdv();\'>Close [x]</a></div><a id=\'advLink\' href=\'http://<%=Request.ServerVariables("SERVER_NAME")%>/?<%=lianjie%>\' target=\'_blank\'><img id=\'advImage\' src=\'http://pay.6046.com/images/adv/pay7.gif\' alt=\'\' border=\'0\' /></a></div>');
	<%
end select
%>



var fa = document.getElementById('floatAdv');
var rnd = parseInt(Math.random() * 1000);
var direction = { down: (rnd % 2 == 0), right: (rnd % 3 == 0) };
var p = { x: parseInt(fa.style.left), y: parseInt(fa.style.top) };

var size = { w: parseInt(fa.clientWidth), h: parseInt(fa.clientHeight) };
fa.style.display = 'none';

var body = document.compatMode != 'CSS1Compat' ? document.body : document.documentElement;
var boxHeight = parseInt(screen.height) - 120;

var interval = 20;
var inCase = false;
var moving = false;
var func = null;

function startMove() {
	if (inCase) {
		return;
	}
	func = setInterval(function () {
		if (moving) {
			if (p.x == 0) {
				direction.right = true;
			} else if (p.x == parseInt(body.clientWidth) - size.w) {
				direction.right = false;
			}
			if (p.y == 0) {
				direction.down = true;
			} else if (p.y == boxHeight - size.h) {
				direction.down = false;
			}
		}

		inCase = true;
		moving = true;
		p.x += (direction.right ? 1 : -1);
		p.y += (direction.down ? 1 : -1);

		fa.style.left = p.x + 'px';
		fa.style.top = p.y + parseInt(body.scrollTop) + 'px';
	}, interval);
}

function stopMove() {
	clearInterval(func);
	inCase = false;
}

function closeAdv() {
	stopMove();
	fa.style.display = 'none';
	inCase = false;
}

if (typeof _preventAdv == 'undefined') {
	startMove();
	fa.style.display = '';
}