﻿// JScript 檔


//滚动广告，图片的ID为img1
var xPos = 0;
var yPos = 0; 
var step = 1;
var delay = 10; //速度
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var interval;
function changePos() 
{
	width = document.body.clientWidth;
	height = document.body.clientHeight;
	Hoffset = img1.offsetHeight;
	Woffset = img1.offsetWidth;
	img1.style.left = xPos + document.body.scrollLeft;
	img1.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()
{
		interval = setInterval('changePos()', delay);
}
function pause_resume(pause) 
{
		if(pause) 
		{
			clearInterval(interval);}
		else 
		{
			interval = setInterval('changePos()',delay);
		}
}
function hideAd()
{
    img1.style.visibility='hidden';
}
var img1=document.all["SunlikeAdimg"];
if(img1)
{
    img1.onmouseover=function(){pause_resume(true);}
    img1.onmouseout=function(){pause_resume(false);}
    start();
}

function Show()
{
    var url = "../Single/Empbonus.htm";
    window.open(url, '課程明細', 'top=0, left=0, width=610, height=842, scrollbars=yes');
}