function pop_buy(sino) {
	var obj = open("pop_buy.html?sino=" + sino, "pop_buy", "width=420,height=300");
}

function exec_buy() {
	obj = gE("sino_sub");
	if (obj) {
		if (obj.selectedIndex == 0) {
			alert("select options.");
			obj.focus();
			return;
		}
	}
	
	var cname = gE("charname").options[gE("charname").selectedIndex].value;	
	if (confirm("Item : " + gE("divitemname").innerHTML + "\nCharacter : " + cname + "\n\nok?")) {
		gE("character").value = cname;
		gE("frmBUY").submit();
	}
}

function pop_present(sino) {
	var obj = open("pop_present.html?sino=" + sino, "pop_present", "width=420,height=300");
}

function exec_present() {
	obj = gE("sino_sub");
	if (obj) {
		if (obj.selectedIndex == 0) {
			alert("select options.");
			obj.focus();
			return;
		}
	}
	
	if (gE("to_character").value == "") {
		alert("select family or friend");
		gE("familyname").focus();
		return;	
	}
	
	var cname = gE("charname").options[gE("charname").selectedIndex].value;	
	if (confirm("Item : " + gE("divitemname").innerHTML + "\nMy character : " + cname + "\nReceive character : " + gE("to_character").value + "\n\nok?")) {
		gE("character").value = cname;
		gE("frmPRESENT").submit();
	}
}

function sel_friend(tochar) {
	if (tochar == "") {
		gE("to_name").innerHTML = "...";
	} else {
		gE("to_name").innerHTML = tochar;
	}
	gE("to_character").value = tochar;
	gE("to_hidden_receiver").value = tochar;
}

/////////////help
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}