//flowjs1
var Layer1S='\'document.\'+_all+\'moveAnywhere\'+_style';
var layer1=eval('document.'+_all+'moveAnywhere'+_style);
var isNS = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
var _all = '';
var _style = '';
var wwidth, wheight;
var ydir = '++';
var xdir = '++';
var id1, id2, id3;
var x = 300;
var y = 120;
var x1, y1;
if(!isNS) {
_all='all.';
_style='.style';
}
function getwindowsize() {
	clearTimeout(id1);
	clearTimeout(id2);
	clearTimeout(id3);
	if (isNS) {
		wwidth = window.innerWidth - 55;
		wheight = window.innerHeight - 50;
	} else {
		wwidth = document.body.clientWidth - 55;
		wheight = document.body.clientHeight - 50;
	}
	id3 = setTimeout('randomdir()', 20000);
	animate();
}

function randomdir() {
	if (Math.floor(Math.random()*2)) {
		(Math.floor(Math.random()*5)) ? xdir='--': xdir='++';
	} else {
		(Math.floor(Math.random()*5)) ? ydir='--': ydir='++';
	}
	id2 = setTimeout('randomdir()', 20000);
}

function animate() {
	eval('x'+xdir);
	eval('y'+ydir);
	if (isNS) {
		eval(eval(Layer1S)).moveTo((x+pageXOffset),(y+pageYOffset))
	}
	else {
		eval(eval(Layer1S)).pixelLeft = x+document.body.scrollLeft;
		eval(eval(Layer1S)).pixelTop = y+document.body.scrollTop;
	}
	if (isNS) {
		if (eval(eval(Layer1S)).top <= 1+pageYOffset) ydir = '++';
		if (eval(eval(Layer1S)).top >= wheight+pageYOffset) ydir = '--';
		if (eval(eval(Layer1S)).left >= wwidth+pageXOffset) xdir = '--';
		if (eval(eval(Layer1S)).left <= 1+pageXOffset) xdir = '++';
	}
	else {
		if (eval(eval(Layer1S)).pixelTop <= 1+document.body.scrollTop) ydir = '++';
		if (eval(eval(Layer1S)).pixelTop >= wheight+document.body.scrollTop) ydir = '--';
		if (eval(eval(Layer1S)).pixelLeft >= wwidth+document.body.scrollLeft) xdir = '--';
		if (eval(eval(Layer1S)).pixelLeft <= 1+document.body.scrollLeft) xdir = '++';
	}
	id1 = setTimeout('animate()',15);
}

function startMove()
{
	animate();
}

function stopMove()
{
	clearTimeout(id1);
}

var imageSrc,imageWidth,imageHeight,imageLink;

imageSrc = "/happynewyear.gif";
imageWidth = 150;
imageHeight = 130;
imageLink = "#";
document.write('<div id=moveAnywhere style="visibility:hidden; position:absolute; left:118px; top:255px; width:'+imageWidth+'px; height:'+imageHeight+'px; z-index:1">');
//document.write('<a href="'+imageLink+'" target="_blank">');
document.write('<img src="'+imageSrc+'"  border=0 style="cursor:hand" usemap="#movePicAnywhere" onMouseOver="stopMove()" onMouseOut="startMove()">');
//document.write('</a>');
document.write('</div>');
document.write('<map name="movePicAnywhere"><area shape="rect" coords="1,1,35,20" href="#" onclick="hide()"><area shape="rect" coords="35,20,'+imageWidth+','+imageHeight+'" href="'+imageLink+'" target="_blank"></map>');


function hide(){
	var obj = document.getElementById("moveAnywhere");
	obj.style.visibility="hidden";
}


function startMovePicAnywhere(){
	
	var obj = document.getElementById("moveAnywhere");
	
	//È¥µô×¢ÊÍ¼´¿É£ºÏÔÊ¾
	/*obj.style.visibility="visible";
	getwindowsize();*/
	
}

