function CheckAll(selector)
{
	for (var i=0;i<document.checkForm.elements.length;i++)
	{
		var e = document.checkForm.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox'))
		e.checked = document.checkForm.allbox.checked;
	}
}

function checkCHK(obj)
{
	var ch = eval("document.checkForm."+obj)
	if(ch.checked == false){ch.checked = true;}
	else{ch.checked = false;}
}

function SpecialMouseOver(num)
{
	var img = eval("document.specialForm.img_"+num);
	var name = eval("document.specialForm.name_"+num);
	var price = eval("document.specialForm.price_"+num);
	var note2 = eval("document.specialForm.note2_"+num);
	var rootID = eval("document.specialForm.rootID_"+num);
	var menuIDx = eval("document.specialForm.menuIDx_"+num);
	document.specialIMGSel.src = img.value;
	
	var n = "<a href=\"javascript:PageVIEW('view.asp',"+rootID.value+","+menuIDx.value+","+num+",3);\" onfocus=\"blur(this);\"><b>"+name.value
		+"</b><br><font color=\"#FF6600\">"+price.value+"</font> ¿ø</a>";
	specialNAMESel.innerHTML = n;
//	recomPRICESel.innerHTML = price.value;
	specialNOTE2Sel.innerHTML = note2.value;
	return;
}
function DiyrecomMouseOver(num)
{
	var img = eval("document.diyForm.img_"+num);
	var name = eval("document.diyForm.name_"+num);
	var price = eval("document.diyForm.price_"+num);
	var note2 = eval("document.diyForm.note2_"+num);
	var rootID = eval("document.diyForm.rootID_"+num);
	var menuIDx = eval("document.diyForm.menuIDx_"+num);
	document.diyIMGSel.src = img.value;
	
	var n = "<a href=\"javascript:PageVIEW('view.asp',"+rootID.value+","+menuIDx.value+","+num+",3);\" onfocus=\"blur(this);\"><b>"+name.value
		+"</b><br><font color=\"#FF6600\">"+price.value+"</font> ¿ø</a>";
	diyNAMESel.innerHTML = n;
//	recomPRICESel.innerHTML = price.value;
	diyNOTE2Sel.innerHTML = note2.value;
	return;
}

// ¸Þ´º »óÇ° ¸µÅ©
function PageVIEW(name,root,sub,pid,key)
{
	document.P_Form.rootID.value=root;
	document.P_Form.subID.value=sub;
	document.P_Form.productID.value=pid;
	document.P_Form.keyID.value=key;
	document.P_Form.action=name;
	document.P_Form.submit();
}
// ¸Þ´º ±âÅ¸ ¸µÅ©
function MenuVIEW(name,one,two,three,four,five,pid,key)
{
	document.M_Form.OneID.value=one;
	document.M_Form.TwoID.value=two;
	document.M_Form.ThreeID.value=three;
	document.M_Form.FourID.value=four;
	document.M_Form.FiveID.value=five;
	document.M_Form.PID.value=pid;
	document.M_Form.keyID.value=key;
	document.M_Form.action=name;
	document.M_Form.submit();
}

// ±¸¸Å ¹öÆ° ´­·¶¾î..
function CartPUT(obj,key,id,num)
{
	if(obj == 0){
		alert("Ç°Àý »óÇ°ÀÔ´Ï´Ù.\n\n±¸¸ÅÇÏ½Ã·Á¸é °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ê½Ã¿À.");
		return;
	}
	if(key == "b"){
		Login_P("buy","/main/buy_put.asp",id,num,key);
		return;
	}
	if(key == "bb")
	{	key = "b"; }
	document.productForm.IDx.value = id;
	document.productForm.key.value = key;
	document.productForm.action = "./buy_put.asp";
	document.productForm.submit();
//	MenuVIEW('./buy.asp','Àå¹Ù±¸´Ï','','','','','cart',1); c
//	MenuVIEW('./buy.asp','','ÁÖ¹®Á¤º¸','','','','info',2); b
}


// ÆË¾÷ »óÇ° Á¤º¸º¸±â
function ProductView(pid)
{
	if(pid==0)
	{
		alert("»óÇ°Á¤º¸¸¦ º¼¼ö ¾ø½À´Ï´Ù.\n\n´Ù½Ã ½Ãµµ ÇÏ½Ê½Ã¿À.");
		return;
	}
	var Addr = "/main/include/popup/product_detail.asp?productID="+pid;
	var Tip = "width=400,height=600,top=180,left=180"
	+",scrollbars=1,resizable=0";
	var ProductP = window.open(Addr,"ProductP",Tip);
	ProductP.focus();
}
// ÆË¾÷ ·Î±×ÀÎ
function Login_P(key,url,id,num,str)
{
	var Addr = "/main/include/popup/login.asp?key="+key+"&url="+url+"&id="+id+"&num="+num+"&str="+str;
	var Tip = "width=500,height=300,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var LoginP = window.open(Addr,"LoginP",Tip);
	LoginP.focus();
}
// ÆË¾÷ È¸¿ø Å»Åð
function MemOut_P()
{
	var Addr = "/main/include/popup/member_out.asp";
	var Tip = "width=400,height=250,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var MemoutP = window.open(Addr,"MemoutP",Tip);
	MemoutP.focus();
}
// ÆË¾÷ ÀÔÁ¡ ½ÅÃ»
function Enter_P()
{
	var Addr = "/main/include/popup/enter.asp";
	var Tip = "width=600,height=490,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var EnterP = window.open(Addr,"EnterP",Tip);
	EnterP.focus();
}
// idserch
function idsearch_P()
{
	var Addr = "/main/include/popup/idsearch.asp";
	var Tip = "width=410,height=300,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var idsearch_P = window.open(Addr,"idsearch_P",Tip);
	idsearch_P.focus();
}
// ÆË¾÷ °øÁö »çÇ×
function Notice_P(idx,R,key)
{
	if (key=="list")
	{var Addr = "/main/include/popup/notice_list.asp";}
	else
	{var Addr = "/main/include/popup/notice.asp?IDx="+idx+"&Rcount="+R;}
	var Tip = "width=600,height=410,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var NoticeP = window.open(Addr,"NoticeP",Tip);
	NoticeP.focus();
}
// ÆË¾÷ ´º½º
function News_P(idx,R,key)
{
	if (key=="list")
	{var Addr = "/main/include/popup/news_list.asp";}
	else
	{var Addr = "/main/include/popup/news.asp?IDx="+idx+"&Rcount="+R;}
	var Tip = "width=600,height=410,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var NewsP = window.open(Addr,"NewsP",Tip);
	NewsP.focus();
}
// ÆË¾÷ ¾àµµ ÇÁ¸°Æ®
function MapPrint(img)
{
	if (img=="")
	{
		alert("ÀÌ¹ÌÁö°¡ ¾ø½À´Ï´Ù.");
		return;
	}
	var Addr = "/main/include/popup/map_print.asp?Img="+img;
	var Tip = "width=670,height=500,top=180,left=180"
	+",scrollbars=0,resizable=0";
	var mapP = window.open(Addr,"mapP",Tip);
	mapP.focus();
}
function Online_bill(obj,x)
{
	if(x=="0"){
		alert("°ßÀû½ÅÃ» Á¦Ç°¸ñ·ÏÀÌ ¾ø½À´Ï´Ù.\nÁ¦Ç°À» ¸ÕÀú ¼±ÅÃ ÇÏ½Ê½Ã¿À.");
		return;
	}else{
		if(obj=="0"){
			var url = "/main/include/popup/online_01.asp";
			var tip = "width=670,height=500,top=180,left=180"
			+",scrollbars=0,resizable=0";
			var online_popup = window.open(url,"online_popup",tip);
			online_popup.focus();
		}else{
			alert("°ßÀû¼­ ½ÅÃ»ÀÌ Á¤»óÀûÀ¸·Î Ã³¸® µÇ¾ú½À´Ï´Ù.\n\nÀÌ¸ÞÀÏ·Î ºü¸¥½ÃÀÏ³»¿¡ ´äº¯µå¸®°Ú½À´Ï´Ù.");
			document.OnlineCart.action="./include/body/support_onlineOk.asp";
			document.OnlineCart.submit();
		}
	}
}

// È¸¿ø ·Î±×¾Æ¿ô
function Logout(url)
{
	location.href="./include/popup/login_ok.asp?sqlkey=logout&ReUrl="+url;
}
//¼ýÀÚ Ã¼Å©
function NumCHK(obj)
{
	var str = obj.value;
	var len = obj.value.length;
	for (var i = 0; i < len ; i++)
	{
		ch = str.charAt(i);
		if (ch >= '0' && ch <= '9'){continue;}
		else{
			obj.value = str.substring(0,i)+str.substring(i+1,len);
			if (str == "")
				str.value = "0";
			return;
		}		
	}
}

//top ·Î±×ÀÎ Ã¼Å©
function memLOGIN(obj)
{
	if(obj.id.value.length == 0)
	{
		alert("È¸¿ø ¾ÆÀÌµð¸¦ ÀûÀ¸½Ê½Ã¿À.");
		obj.id.focus();
		return false;
	}
	if(obj.pwd.value.length == 0)
	{
		alert("È¸¿ø ºñ¹Ð¹øÈ£¸¦ ÀûÀ¸½Ê½Ã¿À.");
		obj.pwd.focus();
		return false;
	}
	return true;
}
//top »óÇ°°Ë»ö Ã¼Å©
function searchKEY(obj)
{
	if (obj.keyword.value.length == 0)
	{
		alert("°Ë»ö ½ÇÆÐ !! \n\n°Ë»ö Å°¿öµå¸¦ Àû¾îÁÖ½Ê½Ã¿À.\t");
		obj.keyword.focus();
		return false;
	}
	if (obj.keyword.value.charAt(0) == " ")
	{
		alert("°Ë»ö ½ÇÆÐ !! \n\n°Ë»ö Å°¿öµå Ã¹¹øÂ° ¹®ÀÚ´Â\t\n\n°ø¹éÀ» Çã¿ëÇÏÁö ¾Ê½À´Ï´Ù.");
		obj.keyword.focus();
		obj.keyword.select();
		return false;
	}
	return true;
}

function zipopen(obj,frm)
{
	var Addr = "/main/include/popup/zipsearch.asp?key="+obj+"&frm="+frm;
	var Tip = "width=367,height=250,top=245,left=180"
	+",scrollbars=1,resizable=0";
	var zipP = window.open(Addr,"zipP",Tip);
	zipP.focus();
}














function Combo(str,max,num,border,bg,color,size,family)
{
	var BgColor = bg;
	var FontColor = color;
	var FontSize = size;
	var FontFamily = family;
	var BorderStyle = "1px solid "+border;
	var SelectWidth = max-2;
	var SelectW = max-num;
	var Width = SelectW-1;
	var ComboDisplay;
	var strINT = str.indexOf('select');
	var strSTR1 = str.substr(0,7);
	var strSTR2 = str.substr(7,str.length);
	var strSTR = " style='width:"+max+";background-color:"+BgColor+";color:"+FontColor+";font-size:"+FontSize+";font-family:"+FontFamily+";' "
	var NameSTR = "";
	//" name="+name+" ";
	var SelectSTR = strSTR1 + strSTR + NameSTR + strSTR2; 
	
	ComboDisplay = "<DIV style='background-color:"+BgColor+";border:"+BorderStyle+";position:relative; height:17; width:"+SelectW+"'>"
	+"<DIV style='CLIP:rect(2 "+SelectW+" 17 2); position:absolute; left:-1;top:-2; height:17;width:"+SelectW+"'>"+SelectSTR+"</DIV>"
	+"</DIV>";
	
	document.write(ComboDisplay);
}
