function vs_back() {
	history.back();
}
function vs_error(msg) {
	alert(msg);
	if(history.length > 0)
		history.back();
	else
		location.href = "/vs/";
}
function vs_go(url,index) {
	if(index == null || document.all.tags("base")[index] == null)
		location.href = url;
	else
		window.open(url,document.all.tags("base")[index].target);
}
function vs_load(obj) {
	for(var i = 0; i < obj.all.length; i++)
		with(obj.all[i]) {
			switch(tagName) {
				case "TBODY":
					if(parentElement.className.toLowerCase() == "list")
						for(var j = 0; j < rows.length; j++)
							with(rows[j]) {
								onmouseout = vs_onmouseout4highlight;
								onmouseover = vs_onmouseover4highlight;
							}
					break;
			}
			if(onclick != null)
				style.cursor = "hand";
		}
	if(exceptionmessage != "") {
		alert(exceptionmessage);
		vs_back();
	}
}
function vs_onmouseout4highlight() {
	this.className = "";
}
function vs_onmouseover4highlight() {
	this.className = "highlight";
}
function selectBox(obj, value) {
	for(i=0; i < obj.all.length; i++)
		if(obj[i].value == value)
			obj.selectedIndex = i;
}
function showReceipt(tid)
{
	var receiptUrl = "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + tid + "&noMethod=1";
	window.open(receiptUrl,"receipt","menubar=1,width=430,height=700, scrollbars=yes,resizable=yes,left=252,top=116");
}
function UseCoupon(obj,surtax)
{
	location.href = "?discount_no="+obj.value+"&surtax="+surtax;
}
////////////////////////////////////////////////////////////////////////////////
function check_reg(n) {
	sum = parseInt(n.charAt(0)) * 2 + parseInt(n.charAt(1)) * 3 + parseInt(n.charAt(2)) * 4 + parseInt(n.charAt(3)) * 5 + parseInt(n.charAt(4)) * 6 + parseInt(n.charAt(5)) * 7 + parseInt(n.charAt(7)) * 8 + parseInt(n.charAt(8)) * 9 + parseInt(n.charAt(9)) * 2 + parseInt(n.charAt(10)) * 3 + parseInt(n.charAt(11)) * 4 + parseInt(n.charAt(12)) * 5;
	return n.charAt(13) == (11 - (sum % 11)) % 10;
}
function regexp(s,exp) {
	m = s.match(exp);
	return (m != null) && (s == m[0]);
}
function trim(s){
s = s.replace(/^\s*/,'').replace(/\s*$/, '');
return s;
}
function submit_userdata(obj) {
	with(obj) {
		//address2.value = trim(address2.value);
		if(document.all.account == null || regexp(account.value,/[a-z0-9]{4,16}/))
			if(regexp(password.value,/[\u0000-\u00FF]{4,16}/))
				if(password.value == password2.value)
					if(document.all.fullname == null || regexp(fullname.value,/[^\u0000-\u00FF]{2,4}/))
						if(document.all.residence == null || regexp(residence.value,/\d{6}-\d{7}/))
							if(document.all.residence == null || check_reg(residence.value))
								if(document.all.birth == null || regexp(birth.value,/\d{2,4}-\d{1,2}-\d{1,2}/))
									if(document.all.calendar == null || calendar[0].checked || calendar[1].checked)
										if(regexp(email.value,/.+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+/))
											if(!(regexp(email.value,/.+(sayclub.com|orgio.net|funshop.co.kr|artworks.co.kr|simmani.com|cj.net|funshop.com|netian.com)/)))
												if(email.value == email2.value)
													if(document.all.phone == null || regexp(phone.value,/(02|031|032|033|041|042|043|051|052|053|054|055|061|062|063|064|0502|0504|0505|0506|070)-\d{3,4}-\d{4}/))
														if(document.all.mobile == null || regexp(mobile.value,/(010|011|016|017|018|019|0502|0504|0505|0506)-\d{3,4}-\d{4}/))
															if(document.all.zipcode_no == null || zipcode_no.value != "" && zipcode_no.value != "0")
																if(document.all.address2 == null || address2.value != "")
																	if(mailing[0].checked || mailing[1].checked)
																		obj.submit();
																	else
																		alert("¸ÞÀÏ¼ö½Å¿©ºÎ¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä");
																else {
																	alert("ÁÖ¼Ò#2¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
																	address2.focus();
																}
															else {
																alert("¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
																search.focus();
															}
														else {
															alert("Àß¸øµÈ ÈÞ´ëÆù¹øÈ£ÀÔ´Ï´Ù");
															mobile.focus();
														}
													else {
														alert("Àß¸øµÈ ÀüÈ­¹øÈ£ÀÔ´Ï´Ù");
														phone.focus();
													}
												else {
													alert("ÀÔ·ÂµÈ µÎ°³ÀÇ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù");
													email.focus();
												}
											else {
												alert("»ç¿ë ±ÝÁö ¸ÞÀÏ °èÁ¤\n\nartworks.co.kr\ncj.net\nnetian.com\nfunshop.co.kr\nfunshop.com\norgio.net\nsayclub.com\nsimmani.com\n");
												email.focus();
											}
										else {
											alert("ÀüÀÚ¿ìÆíÁÖ¼Ò´Â 32ÀÚ ÀÌÇÏÀÇ ¼Ò¹®ÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ¼¼¿ä\n¿¹) webmaster@funshop.co.kr ");
											email.focus();
										}
									else
										alert("¾ç·Â/À½·ÂÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä");
								else {
									alert("Àß¸øµÈ »ý³â¿ùÀÏÀÔ´Ï´Ù");
									birth.focus();
								}
							else {
								alert("Àß¸øµÈ ÁÖ¹Îµî·Ï¹øÈ£ÀÔ´Ï´Ù");
								residence.focus();
							}
						else {
							alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ±¸ºÐ±âÈ£(-)¸¦ Æ÷ÇÔÇÑ 14ÀÚ¸® ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù");
							residence.focus();
						}
					else {
						alert("¼º¸íÀº °ø¹é ¾øÀÌ 2ÀÚ ÀÌ»ó 4ÀÚ ÀÌÇÏÀÇ ÇÑ±Û¸¸ °¡´ÉÇÕ´Ï´Ù");
						fullname.focus();
					}
				else {
					alert("ÀÔ·ÂµÈ µÎ°³ÀÇ ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù");
					password.focus();
				}
			else {
				alert("ºñ¹Ð¹øÈ£´Â 4ÀÚ ÀÌ»ó 16ÀÚ ÀÌÇÏ¸¸ °¡´ÉÇÕ´Ï´Ù");
				password.focus();
			}
		else {
			alert("¾ÆÀÌµð´Â °ø¹é ¾øÀÌ 4ÀÚ ÀÌ»ó 16ÀÚ ÀÌÇÏÀÇ ¼Ò¹®ÀÚ, ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù");
			account.focus();
		}
	}
}
function flash_home()
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' height='364' width='416'><param name='movie' value='/vs/images/home.swf'></object>");
}
