﻿// TOP FLASH SHOW/HIDE
function click()
{
	FLASH_BANNER.style.display = 'none';
	FLASH_AD.style.display = 'block';
}
function closeFlash()
{
	var m;
	if (navigator.appName == "Microsoft Internet Explorer") {
	m = document.movie;
	} else {
	m = document.embeds[0];
	}
	m.GotoFrame(1);
	m.Play();
	FLASH_BANNER.style.display = 'block';
	FLASH_AD.style.display = 'none';
}

function GoTop() {
	window.scrollTo(0,0);
}

// Banner Scroll  
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

String.prototype.toInteger = function() {
	return this.replace(/[^0-9]/g, '') * 1;
}

function follow_banner(div_id, origin_top, limit_top, margin_top)
{
	var d, t, s, g, target_height;
	origin_top *= 1;
	limit_top *= 1;
	margin_top *= 1;
 
	d = document.getElementById(div_id);
	s = document.body.scrollTop + "";

	target_height = s.toInteger() + margin_top;
	if(target_height < limit_top) {
		target_height = origin_top;
	}
 
	t = d.style.top.toInteger();
 
	if(t != target_height) {
		g = Math.ceil((t - target_height) / 5);
		if(g > 50) {
			g = 50;
		} else if (g < -50) {
			g = -50;
		}
		d.style.top = (t - g) + "px";
	}

	setTimeout("follow_banner('" + div_id + "', " + origin_top + ", " + limit_top + ", " + margin_top + ");", 1);
}

function onLoad()
{
	b = document.getElementById("gotop");
	follow_banner("gotop", b.style.top.toInteger(), b.style.top.toInteger() + 100, 503);
}
// Banner Scroll Layer
document.writeln('<div id=gotop style="Z-INDEX: 1; LEFT: 730px; TOP: 519px; WIDTH: 11px; HEIGHT: 36px; POSITION: absolute; visibility: visible;"><a href="javascript:GoTop();"  onFocus="this.blur()"><img src="../images/btn_top.gif" border="0"></a></div>');
onLoad();