addOnloadEvent(init);

function init() {
    if (document.getElementById("reg_log_popup") == null) return;
	document.getElementById("reg_log_popup").className = "hidden";
	var el = document.getElementById("register_login");
	set_events(el);
	
    if (document.getElementById("lang_popup") == null) return;
	document.getElementById("lang_popup").className = "hidden";
	el = document.getElementById("lang_button");
	set_events(el);
}

function set_events(el) {
	el.onclick = swap;
	el.onmouseover = show_hand;
	el.onmouseout = hide_hand;
}

function swap() {
	var el = this;
	if (el == null) return;
	do {
		el = el.nextSibling;
	} while (el.nodeName != 'DIV');
	if (el.className == "hidden") {
		el.className = "visible";
	} else {
		el.className = "hidden";
	}
}

function show_hand() {
	this.style.cursor = "pointer";
}

function hide_hand() {
	this.style.cursor = "default";
}