if (get_cookie('showad')=='') {
	if (document.body.clientWidth>800) 
	iframeadok() ;
	var srcc = window.location;
	document.writeln("<DIV id=\"iframe_piao\" style=\"height: 60px; left: 200px; position: absolute; top: 200px; width: 200px\"><a href='javascript:;' onclick=close_ad() target=_self><img src='/file/frameweb/close.gif' border='0' /></a><br><iframe src='/file/frameweb/koo365.html' height=60 width=200 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe></DIV>");
}

function iframeadok() {setInterval('piaoPos()',30);}

function close_ad() {
	iframe_piao.style.visibility = "hidden";
	document.cookie="showad=yes" 
}

function get_cookie(Name) {
	var search = Name + "=" 
	var returnvalue = ""; 
	if (document.cookie.length>0) { 
		offset = document.cookie.indexOf(search) 
		if (offset != -1) { 
			offset += search.length 
			end = document.cookie.indexOf(";", offset); 
			if (end == -1) 
				end = document.cookie.length; 
			returnvalue=unescape(document.cookie.substring(offset,end))
		}
	}
	return returnvalue;
} 

var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30; 
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
if(typeof(iframe_piao) != "undefined") {iframe_piao.style.top = yPos;}

function piaoPos() {
	width = document.body.clientWidth;
	height = document.body.clientHeight;
	Hoffset = iframe_piao.offsetHeight;
	Woffset = iframe_piao.offsetWidth;
	iframe_piao.style.left = xPos + document.body.scrollLeft;
	iframe_piao.style.top = yPos + document.body.scrollTop;
	if (yon) {
		yPos = yPos + step;
	}
	else {
		yPos = yPos - step;
	}
	if (yPos < 30) {
		yon = 1;
		yPos = 30;
	}
	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() {
	if(typeof(iframe_piao) != "undefined") {
		iframe_piao.visibility = "visible";
		var interval = setInterval('piaoPos()', delay);
		iframe_piao.onmouseover=function(){clearInterval(interval)} 
		iframe_piao.onmouseout=function(){interval=setInterval("piaoPos()", delay)}
	}
}

function pause_resume() {
	if(pause) {
		clearInterval(interval);
		pause = false;
	}
	else {
		interval = setInterval('piaoPos()',delay);
		pause = true;
	}
}

start();
