function openPop(filename, name, width, height) { 
	var windowops=eval("'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+"'"); 

	var newWindow = window.open(filename, name, windowops); 
	newWindow = ''; 
	return; 
} 

function getCookie(name){
	var arg=name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg ) return getCookieVal(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if ( i == 0 ) break;
	}
	return 0;
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf(";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function setCookie(n) {
		document.cookie = "menuLayerIndex=" + n;
}

function showimage(url) {
if (!document.images) return 
document.images.avatar.src='http://qaos.com/images/forum/avatar/' + document.Register.user_avatar.options[document.Register.user_avatar.selectedIndex].value;
}

function printDate() {
var month;
var now = new Date();
thisYear = now.getYear();
month = now.getMonth() + 1;
if(thisYear < 1900) {thisYear += 1900};
document.write(thisYear + '³â ' + month +'¿ù '+ now.getDate()+'ÀÏ');
}

function changeUrl(parm) {
	if(parm == 'bbs') {
		document.search.action = '/searchbb.php';
		document.search.elements[2].name = 'term';
		document.search.elements[3].name = 'addterm';
		document.search.elements[3].value = 'any';
		document.search.elements[4].name = 'sortby';
		document.search.elements[4].value = 'p.post_time';
	}else {
		document.search.action = '/search.php';
		document.search.elements[2].name = 'query';
	}
}

function onTr(trstyle, bool)
{
	if (bool){

		trstyle.style.border = '1 solid black';
		trstyle.style.backgroundColor = "#EFF7FF";
	}else{
		trstyle.style.border = "";
		trstyle.style.backgroundColor = "";
	}
}

function viewmenu(name, _x) {
//	image.style.posLeft=_x;
	document.all[name].style.posLeft=_x;
	document.all[name].style.posTop=25;
	if(document.all[name].style.visibility=='visible') document.all[name].style.visibility='hidden';
	else document.all[name].style.visibility='visible';
}

function hidemenu() {
	image.style.visibility='hidden';
}