document.write ("<div id='children' style='position:absolute; left: 820px; top: 340px; width: 46px; height: 57px'>");
document.write ("<a href=http://auto.netge.com/filiale/nj_beauty_vip.php target=_blank>");
document.write ("<img src='index_images/vip.gif' border=0 ></a></div>");
if(!document.all)
	doc = document;
else
	doc = document.all;

if(!doc.children.style)
	doc.children.style = doc.children;

wMark = doc.children.style;
markW = wMark.width.replace('px','');
markH = wMark.height.replace('px','');

var XY = 30;	//高度 = 視窗高度(寬度) - 圖高度(寬度) - XY;
var XYtype = 1;	//1 -> 任意跑, 2-> 上下跑, 3-> 左右跑;
var xstep = 1;
var delay_time = 30;

var XX = 0;
var YY = 0;
var cw = 0;
var ow = 0;
var ch = 0;
var oh = 0;
var xon = 0;
var yon = 0;

var ns4 = document.layers?1:0
var ie = document.all?1:0
var ns6 = document.getElementById&&!document.all?1:0

if(ie) {
	XX = document.body.clientWidth - markW - XY;
	children.style.left = XX;
	YY = document.body.clientHeight - markH - XY;
	children.style.top = YY;
} else if(ns4){
	XX = window.innerWidth - markW - XY;
	document.children.pageX = XX
	YY = window.innerHeight;
	document.children.pageY = YY - markH - XY;
	document.children.visibility = "hidden";
} else if(ns6){
	XX = window.innerWidth - markW - XY
	document.getElementById('children').style.left = XX
	YY = window.innerHeight - markH - XY
	document.getElementById('children').style.top = YY
}

function reloc1() {
	if(XYtype != 2) {
		if(xon == 0) {XX = XX - xstep;}else{XX = XX + xstep;}
	}
	if(XYtype != 3) {
		if(yon == 0) {YY = YY - xstep;}else{YY = YY + xstep;}
	}

	if(ie) {
		cw = document.body.clientWidth;
		ow = children.offsetWidth;
		ch = document.body.clientHeight;
		oh = children.offsetHeight;
	} else if(ns4) {
		cw = window.innerWidth;
		ow = document.children.clip.width;
		ch = window.innerHeight;
		oh = document.children.clip.height;
	} else if(ns6) {
		cw = window.innerWidth
		ow = document.getElementById("children").offsetWidth
		ch = window.innerHeight
		oh = document.getElementById("children").offsetHeight
	}

	if(XX < 0) {xon = 1;XX = 0;}
	if(XX >=(cw-ow)) {xon = 0;XX = (cw-ow);}
	if(YY < 0) {yon = 1;YY = 0;}
	if(YY >=(ch-oh)) {yon = 0;YY = (ch-oh);}
	if(ie) {
		children.style.left = XX + document.body.scrollLeft;
		children.style.top = YY + document.body.scrollTop;
	} else if(ns4) {
		document.children.pageX = XX + window.pageXOffset;
		document.children.pageY = YY + window.pageYOffset;
	} else if(ns6) {
		document.getElementById("children").style.left = XX + window.pageXOffset
		document.getElementById("children").style.top = YY + window.pageYOffset
	}
}

function onad() {
	if(ns4)
		document.children.visibility = "visible";
	loopfunc();
}

function loopfunc() {
	reloc1();
	setTimeout('loopfunc()',delay_time);
}

if(ie||ns4||ns6){window.onload = onad;}

