/*
以後
*/
if (self != top) top.location.href = window.location.href;

var XMLHttpRequestObject = false;
if (window.XMLHttpRequest) {
	XMLHttpRequestObject = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
	XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
function logout(v) {
	if (confirm('是否確定登出 ?')) {
		window.location.href=v;
	}
}
function openurl(nurl) {
	if (confirm('本站不保證訪客所留下的網址內容安全性\n\n請自行斟酌考慮是否決定前往 謝謝\n')) {
		window.open(nurl,'q2_url_frame');
	}
}
/*
function set_tbar(t) {
	var tbarbox	=document.getElementById('tbar');
	var z=new Date();
	tbarbox.style.background='#fff url(http://images.cuteto.net/img3/68u.jpg?'+z.getTime()+') no-repeat center center;';
	setTimeout("get_tbar("+t+");",t);
}
function get_tbar(t) {
	var tbarbox	=document.getElementById('tbar');
	var z=new Date();
	tbarbox.style.background='#fff url(http://images.cuteto.net/img3/66u.jpg?'+z.getTime()+') no-repeat center center;';
	setTimeout("set_tbar("+t+");",t);
}
*/
/*
function set_reload(t) {
	setTimeout("get_online_users();get_reload("+t+");",t);
}
function get_reload(t) {
	setTimeout("get_online_users();set_reload("+t+");",t);
}
*/
function get_online_users() {
	var z			=new Date();
	var users		=document.getElementById('online_users');
	var onlineurl	=TheURL+'x.php?z='+z.getTime();
	if(XMLHttpRequestObject) {
		XMLHttpRequestObject.open("GET", onlineurl, true);
		XMLHttpRequestObject.onreadystatechange = function() {
			if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
				if (users) {
					users.innerHTML=XMLHttpRequestObject.responseText;
				}
			}
		}
	XMLHttpRequestObject.send(null);
	}
}
/*
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000));
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate);
}
*/
function Set_Cookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime(today.getTime());
	if (expires) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date(today.getTime()+(expires));

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}
function Get_Cookie(check_name) {
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false;
	
	for ( i = 0; i < a_all_cookies.length; i++ ) {
		a_temp_cookie = a_all_cookies[i].split( '=' );
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		if ( cookie_name == check_name ) {
			b_cookie_found = true;
			if ( a_temp_cookie.length > 1 ) {
				cookie_value = utf_8_decode(unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ));
			}
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if (!b_cookie_found) {
		return null;
	}
}
function Event(n,e){
	if(e == 1){
		document.getElementById(n).style.overflow="visible";
	}
	else{
		document.getElementById(n).style.overflow="hidden";
	}
}
function utf_8_decode (sin) {
	function octet_count (c) {
		var octet_counts = [
		/* c0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
		/* d0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
		/* e0 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
		/* f0 */ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0
		];

		return c < 128 ? 1 :
		c < 192 ? 0 : octet_counts [(c&255)-192];
	}

	var octet0_masks = [ 0x00,0x7f,0x1f,0x0f,0x07,0x03,0x01 ];
	var sout = "";
	var add;
	for (var si = 0; si < sin.length; si += add) {
		var c = sin.charCodeAt(si);
		add = octet_count(c);
		if (si+add <= sin.length) {
			var u = c & octet0_masks[add];
			var ci;
			for (ci = 1; (ci < add) && ((sin.charCodeAt(si+ci)&0xc0) == 0x80);ci++)
				u = (u<<6) | (sin.charCodeAt(si+ci) & 0x3f);
			if (ci == add) {
			sout += String.fromCharCode (u);
				} else {
				// Invalid UTF-8 sequence. Should probably throw() instead.
				sout += "\ufffd"; // Replacement character.
				add = 1;
			}
		}
		else {
			// Invalid UTF-8 sequence. Should probably throw() instead.
			sout += "\ufffd"; // Replacement character.
			add = 1;
		}
	}
	return sout;
}
var vtop10_num;
var ctop10_num;
var get_tag_num;
var cdtop10_num;
var hit10_num;
var hot10_num1,hot10_num2,hot10_num3,hot10_num4,hot10_num5,hot10_num6;