﻿//movePic
document.write("<span id='superball' style='position:absolute;left:0;top:0;display:none;z-index:10;'><a href='http://www.38card.com/Member/Reg.asp' ><img name='superballImage' src='pic/242.gif' width='171' height='41' style='z-index:10;border:0px solid #000000;'></a></span>");
var ballWidth=173;
var ballHeight=47;
var BallSpeed=1;
var maxBallSpeed = 40;
var xMax;
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = "right";
var yDir = "down";
var superballRunning = true;
var tempBallSpeed;
var currentBallSrc;
var newXDir;
var newYDir;

function movePic() {
if (superballRunning == true) {
calculatePosition();
document.all('superball').style.left = xPos + document.body.offsetLeft;
document.all('superball').style.top = yPos + document.body.scrollTop;
setTimeout('movePic()',30);
}
}
function InitmovePic() {
xMax = document.body.clientWidth;
yMax = document.body.offsetHeight;
document.all('superball').style.display = "";
setTimeout('movePic()',500);
}
function calculatePosition() {
if (xDir == 'right') {if (xPos > (xMax - ballWidth - BallSpeed)) {xDir = 'left';}}
else if (xDir == 'left') {if (xPos < (0 + BallSpeed)) {xDir = 'right';}}
if (yDir == 'down') {if (yPos > (yMax - ballHeight - BallSpeed)) {yDir = 'up';}}
else if (yDir == 'up') {if (yPos < (0 + BallSpeed)) {yDir = 'down';}}
if (xDir == 'right') {xPos = xPos + BallSpeed;}
else if (xDir == 'left') {xPos = xPos - BallSpeed;}
else {xPos = xPos;}
if (yDir == 'down') {yPos = yPos + BallSpeed;}
else if (yDir == 'up') {yPos = yPos - BallSpeed;}
else {yPos = yPos;}
}
window.onresize = new Function('xMax = document.body.clientWidth; yMax = document.body.offsetHeight;');
setTimeout('InitmovePic()', 100);
//End:movePic

//popUpWin
//End:popUpWin
