

/* welcome
----------------------------------------------- */
function welcomeClose() {
	var welcome = document.getElementById("welcome");
	welcome.style.display = "none";
}
function welcomeOpen() {
	var visitor = getCookie("visitor");
	if (visitor != "reading") {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="600" height="500" id="welcome" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="home/welcome.swf" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="home/welcome.swf" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="600" height="500" name="welcome" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
		setCookie('visitor','reading');
	}
	else { welcomeClose(); }
}


/* Cookie
----------------------------------------------- */
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) { return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1))); }
		xx1 = xx2 + 1;
	}
	return("");
}
function setCookie(key, val, tmp) {
	tmp = key + "=" + escape(val) + "; ";
	// tmp += "path=" + location.pathname + "; ";
	//tmp += "expires=Fri, 31-Dec-2030 23:59:59; ";
	document.cookie = tmp;
}
function clearCookie(key) { document.cookie = key + "=" + "xx; expires=1-Jan-1997 00:00:00;"; }
