function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function allblur() {
for (i = 0; i < document.links.length; i++)
document.links[i].onfocus = document.links[i].blur;
}

function ConfirmBox() {
   	if(confirm("µî·ÏµÈ Á¤º¸¸¦ »èÁ¦ÇÏ½Ã°ÚÀ¾´Ï±î?")) return true;
   	
   	return false;    
}

function admindelConfirmBox(community) {
   	if(confirm("°­Åð½ÃÅ°´Â °æ¿ì 3°³¿ù°£ " + community + " Å¬·´¿¡ Àç°¡ÀÔÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.\n°­Åð½ÃÅ°½Ã°Ú½À´Ï±î?")) return true;
   	
   	return false;    
}

function delConfirmBox(community) {
   	if(confirm("Å»ÅðÇÏ½Ã´Â °æ¿ì 3°³¿ù°£ " + community + " Å¬·´¿¡ Àç°¡ÀÔÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.\nÅ»ÅðÇÏ½Ã°Ú½À´Ï±î?")) return true;
   	
   	return false;    
}

function denyConfirmBox() {
   	alert("Å»ÅðÇÏ½Å ÈÄ 3°³¿ù°£Àº Å¬·´¿¡ Àç°¡ÀÔÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
   	return;    
}

function sysopConfirmBox() {
   	alert("Å¬·´¸¶½ºÅÍ´Â Å»ÅðÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.\n°í¾îÅØ½º °ü¸®ÀÚ¿¡°Ô ¸ÞÀÏ·Î Â÷±â ¸¶½ºÅÍ ¼±Á¤À» ÀÇ·ÚÇØÁÖ¼¼¿ä");
   	return;    
}

function CommunityMenu(){
   	alert("Ä¿¹Â´ÏÆ¼ °¡ÀÔÈÄ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");   	
   	return;    
}

function CommunityMenuWorker(){
   	alert("µî»êÈ­ Ã¼Çè´ã¸¸ ÀÛ¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù.");   	
   	return;    
}

function CommunityAMenuWorker(){
   	alert(" ºê·£µå ¾Ú¹ö¼­´õ¸¸ ÀÛ¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù.");   	
   	return;    
}

function PowerMenu(){
   	alert("±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");   	
   	return;    
}

function menuURL(strTop, strMain){
	if (strTop=="A"){
		if (strMain=="01"){
			location.href="../main/main.jsp";
		} else if (strMain=="02"){
			location.href="../main/search.jsp";
		} else if (strMain=="03"){
			location.href="../main/userfaq.jsp";
		} else if (strMain=="04"){
			location.href="../main/sitemap.jsp";
		} else if (strMain=="05"){
			location.href="../main/contactus.jsp";
		} else if (strMain=="06"){
			window.open("http://www.gore-tex.com/webapp/wcs/stores/servlet/ContentFView?storeId=10001&catalogId=10001&langId=-1&productId=10631", "", "");
		} else if (strMain=="07"){
			location.href="../main/policy.jsp";
		} else {
			location.href="../main/main.jsp";
		}
	} else if (strTop=="B")	{
		if (strMain=="01"){
			location.href="../member/login.jsp";
		} else if (strMain=="02"){
			location.href="../member/rule.jsp";
		} else if (strMain=="03"){
			location.href="../member/login_error.jsp";
		} else if (strMain=="04"){
			location.href="../member/logout.jsp";
		} else if (strMain=="05"){
			location.href="../member/mypage.jsp";
		} else if (strMain=="06"){
			location.href="../member/myregister.jsp";
		} else {
			location.href="../member/login.jsp";
		}
	} else if (strTop=="C")	{
		if (strMain=="01"){
			location.href="../tech/history.jsp";
		} else if (strMain=="02"){
			location.href="../tech/fabric.jsp";
		} else if (strMain=="03"){
			location.href="../tech/test.jsp";
		} else if (strMain=="04"){
			location.href="../tech/water.jsp";
		} else if (strMain=="05"){
			location.href="../tech/warrant.jsp";
		} else if (strMain=="06"){
			location.href="../tech/fab_2l.jsp";
		} else if (strMain=="07"){
			location.href="../tech/fab_3l.jsp";
		} else if (strMain=="08"){
			location.href="../tech/fab_pac.jsp";
		} else if (strMain=="09"){
			location.href="../tech/fab_xcro.jsp";
		} else if (strMain=="10"){
			location.href="../tech/fab_foot.jsp";
		} else if (strMain=="11"){
			location.href="../tech/fab_xcrf.jsp";
		} else {
			location.href="../tech/history.jsp";
		}
	} else if (strTop=="D")	{
		if (strMain=="01"){
			location.href="../product/new_list.jsp";
		} else if (strMain=="02"){
			location.href="../product/category.jsp";
		} else if (strMain=="03"){
			location.href="../product/brand.jsp";
		} else if (strMain=="04"){
			location.href="../product/2005_SS.jsp";
		} else {
			location.href="../product/new_list.jsp";
		}
	} else if (strTop=="E")	{
		if (strMain=="01"){
			location.href="../community/main.jsp";
		} else if (strMain=="02"){
			location.href="../ctrip/bbs_list.jsp?category=ca01";
		} else if (strMain=="03"){
			location.href="../ctrip/bbs_list.jsp?category=ca02";
		} else if (strMain=="04"){
			location.href="../ctrip/bbs_list.jsp?category=ca03";
		} else if (strMain=="05"){
			location.href="../ctrip/bbs_list.jsp?category=ca04";
		} else if (strMain=="06"){
			location.href="../ctrip/bbs_list.jsp?category=ca05";
		} else if (strMain=="07"){
			location.href="../ctrip/bbs_list.jsp?category=ca06";
		} else if (strMain=="08"){
			location.href="../ctrip/boots_eventMain.jsp?category=ca07";
		} else {
			location.href="../community/main.jsp";
		}
	} else if (strTop=="F")	{
		if (strMain=="01"){
			location.href="../enjoy/event_list.jsp";
		} else if (strMain=="02"){
			location.href="../enjoy/postscript_list.jsp";
		} else if (strMain=="03"){
			location.href="../enjoy/real.jsp";
		} else if (strMain=="04"){
			location.href="../enjoy/greatday.jsp";
		} else if (strMain=="05"){
			location.href="../enjoy/sponsor.jsp";
		} else if (strMain=="06"){
			location.href="../eventRegister/event.jsp";
		} else if (strMain=="07"){
			location.href="../enjoy/sponsor.jsp";
		} else if (strMain=="08"){
			location.href="../enjoy/sponsor02.jsp";
		} else if (strMain=="09"){
			location.href="../enjoy/sponsor03.jsp";
		} else if (strMain=="10"){
			location.href="../enjoy/sponsor04.jsp";
		////
		} else if (strMain=="11"){
			location.href="../enjoy/ev_list.jsp?ev_status=1";
		} else if (strMain=="12"){
			location.href="../enjoy/ev_list.jsp?ev_status=3";
		} else if (strMain=="13"){
			location.href="../enjoy/ev_list.jsp?ev_status=2";
		////
		} else {
			location.href="../enjoy/event_list.jsp";
		}
	} else if (strTop=="G")	{
		if (strMain=="01"){
			location.href="../center/guide.jsp";
		} else if (strMain=="02"){
			location.href="../center/howto.jsp";
		} else if (strMain=="03"){
			location.href="../center/carefaq.jsp";
		} else if (strMain=="04"){
			location.href="../qna/bbs_list.jsp";
		} else if (strMain=="05"){
			location.href="../center/register.jsp";
		} else if (strMain=="06"){
			location.href="../center/as.jsp";
		} else {
			location.href="../center/guide.jsp";
		}
	} else if (strTop=="H")	{
		if (strMain=="01"){
			location.href="../about/company.jsp";
		} else if (strMain=="02"){
			location.href="../about/product.jsp";
		} else if (strMain=="03"){
			location.href="../about/adgallery.jsp";
		} else if (strMain=="04"){
			location.href="../about/news_list.jsp";
		} else if (strMain=="05"){
			location.href="../about/storefinder.jsp";
		} else {
			location.href="../about/company.jsp";
		}
	} else if (strTop=="I")	{
		if (strMain=="01"){
			location.href="../product/category_list.jsp?ccode=c102&intTotal=0";	//¾¾Æ¼¿þ¾î
		} else if (strMain=="02"){
			location.href="../product/category_list.jsp?ccode=c1&intTotal=1";	//ÀÇ·ù
		} else if (strMain=="03"){
			location.href="../product/category_list.jsp?ccode=c2&intTotal=1";	//½Å¹ß
		} else if (strMain=="04"){
			location.href="../product/category_list.jsp?ccode=c3&intTotal=1";	//¾Ç¼¼¼­¸®
		} else {
			location.href="../product/category_list.jsp?ccode=c102&intTotal=0";
		}
	} else if (strTop=="J")	{
		if (strMain=="01"){
			location.href="../../retail/re_community/main.jsp";			//Retailer Ä¿¹Â´ÏÆ¼ ¸ÞÀÎ
		} else if (strMain=="02"){
			location.href="../../retail/re_notice/bbs_list.jsp";		//°øÁö»çÇ×
		} else if (strMain=="03"){
			location.href="../../retail/re_interview/bbs_list.jsp";		//Å©·ç ÀÎÅÍºä
		} else if (strMain=="04"){
			location.href="../../retail/re_shopintro/bbs_list.jsp";		//½Å±Ô ¿ÀÇÂ ¸ÅÀå
		} else if (strMain=="05"){
			location.href="../../retail/re_shopevent/bbs_list.jsp";		//¸ÅÀå ÀÌº¥Æ®
		} else if (strMain=="06"){
			location.href="../../retail/re_shop/bbs_list.jsp";			//¸ÅÀå ¼Ò°³
		} else if (strMain=="07"){
			location.href="../../retail/re_board/bbs_list.jsp";			//ÀÚÀ¯°Ô½ÃÆÇ
		} else if (strMain=="08"){
			location.href="../../retail/re_request/bbs_write_form.jsp";	//°ÇÀÇ»çÇ×
		} else if (strMain=="09"){
			window.open("../../retail/gfc_community/main.jsp", "gfc", "scrollbars=0,resizable=0,topmargin=0,leftmargin=0,width=848,height=628");
		} else {
			location.href="../../retail/re_community/main.jsp";			//Retailer Ä¿¹Â´ÏÆ¼ ¸ÞÀÎ
		}
	} else {
		location.href="../main/main.jsp";
	}
}

function CheckChar(str) {
	len=str.value.length;
	
	for(i=0;i<len;i++) {
		if(str.value.charAt(i)=='"' || str.value.charAt(i)=="%" || 
			str.value.charAt(i)=="\"" || str.value.charAt(i)=="&")  {
			alert("Æ¯¼ö¹®ÀÚ( \,%,&,...)´Â »ç¿ëÇÏÁö ¸¶¼¼¿ä!");
			str.focus();
			return false;
		}
	}
	return true;  
}
	
function CheckSpace(str) {
	var len;
	
	while(true) {
		if(str.value.charAt(0)!=" ") break;
		len=str.value.length;
		str.value = str.value.substring(1,len);
	}
	
	while(true) {
		len=str.value.length;
		if(str.value.charAt(len-1)!=" ") break;
		str.value = str.value.substring(0,len-1);
	}
}

// °ø¹éÀ» ¸ðµÎ ¾ø¾Ø´Ù.
function CheckSpaceAll(str){
	var index;
	var len;
	
	while(true) {
		index=str.value.indexOf(" ");
		if(index==-1) break;
		len=str.value.length;
		str.value = str.value.substring(0,index) + 
                str.value.substring((index+1),len);
	}	
	return str.value;
}

function CheckMail(email){	
	aIndex=email.value.indexOf("@");
	dotIndex=email.value.indexOf(".");
  	
	if(aIndex==-1 || dotIndex==-1 || aIndex >= (dotIndex-1)) {
		alert("¸ÞÀÏ ÀÔ·ÂÇü½ÄÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
		email.focus();
		return false;
	}
  	return true;
}

function isNum(inputStr) {
	for (var i = 0; i < inputStr.length; i++){
		var oneChar = inputStr.substring(i, i+1)
		if (oneChar < "0" || oneChar > "9"){
			return false
		}
	}
    return true;
}  

function isAllSpace(inputStr) {
	for (var i = 0; i < inputStr.length; i++){
		var oneChar = inputStr.substring(i, i+1)
		if (oneChar != " "){
			return (false)
		}
	}
	return (true);
}

function parseFloat(str) {
	var buf;
    buf="";
    for (var i=0; i<str.length; i++)
		if(str.charAt(i) >= "0"  && str.charAt(i) <= "9") {
			buf=buf+str.charAt(i);
		}
	return buf;
}

function isNum2(inputStr) {
	for (var i = 0; i < inputStr.length; i++){
		var oneChar = inputStr.substring(i, i+1)
		if (oneChar < "0" || oneChar > "9"){
			return false
		}
	}
    return (true);
}  

function ncheck(c){
        if( (c>='0' && c<='9') ) {
                return true
        }
        return false
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

// ÁÖ¹Î¹øÈ£¸¦ °Ë»çÇÕ´Ï´Ù.
function checkSSN(ssn) {   
	var ssn1 = new String(ssn);

	if (ssn1.length != 13) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ 13ÀÚ¸®ÀÎÁö È®ÀÎÇØÁÖ½Ê½Ã¿ä!");
		return false;
	}
	
	var a=ssn1.substring(0,1);
	var b=ssn1.substring(1,2);
	var c=ssn1.substring(2,3);
	var d=ssn1.substring(3,4);
	var e=ssn1.substring(4,5);
	var f=ssn1.substring(5,6);
	var g=ssn1.substring(6,7);
	var h=ssn1.substring(7,8);
	var i=ssn1.substring(8,9);
	var j=ssn1.substring(9,10);
	var k=ssn1.substring(10,11);
	var l=ssn1.substring(11,12);
	var m=ssn1.substring(12,13);
	
	var sum = 2*a + 3*b + 4*c+ 5*d + 6*e+ 7*f+ 8*g + 9*h+ 2*i+3*j+ 4*k+ 5*l;
	var r1 = sum%11;
	var temp = 11* ((sum-r1)/11) + 11 - sum;
	var r2 = temp%10;
	var temp1 = temp- 10*((temp-r2)/10);
	
	if (m != temp1) { 
		alert("¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}	
	return true;
}	

function input_value() {
	alert("ÁÖ¼ÒÃ£±â ±â´ÉÀ» ÀÌ¿ëÇÏ¼¼¿ä.");
}

//ÀÌ¹ÌÁö Å¬¸¯½Ã Å×Åõ¸® ¾Èº¸ÀÌ°Ô..
function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
  //document.onfocusin=autoBlur; 

function open_shop(){
	window.open("/retailer/re_shopintro/pop_shop.jsp","shopChk","width=518, height=440, menubar=0,toolbar=0,location=0,status=0,scrollbars=1,resizable=1");
}
function CheckLoginValues(form) {	

	CheckSpaceAll(form.memcode);

	if(form.memcode.value==""){
		alert("¾ÆÀÌµðÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		form.memcode.focus();
		return;
	}

	CheckSpaceAll(form.pass);
 
	if(form.pass.value==""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		form.pass.focus();
		return;
	}

	form.target = "_self";
	form.action = "/support/member/login_proc.jsp";
	form.submit();
}

function CheckMemberValues(form) {	

	if(form.wkshop.value==""){
		alert("±Ù¹«¸ÅÀåÀ» ¼±ÅÃÇÏ¼¼¿ä.");
		return;
	}

	CheckSpaceAll(form.wkyear); 

	if(form.wkyear.value=="" || !isNum(form.wkyear.value)){
		alert("±Ù¹«³â¼ö¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
		form.wkyear.focus();
		return;
	}

	form.target = "_self";
	form.action = "/retailer/re_community/re_member_write.jsp";
	form.submit();
}

function checkLimit(field) {
    var len = 0;
    var newtext = "";
    if(field.value == null) len = 0;
    
    for(var i = 0 ; i < field.value.length ; i++) {
      var c = escape(field.value.charAt(i));
    
      if(c.length == 1) len ++;
      else if ( c.indexOf("%u") != -1 ) len += 2;
      else if ( c.indexOf("%") != -1 ) len += c.length/3;
    
      if(len <= 3000) newtext += unescape(c);
    }
    
    if(len > 3000) {
      alert("³»¿ëÀº ¿µ¹® 3000ÀÚ, ÇÑ±Û 1500ÀÚ¸¦ ³ÑÀ» ¼ö ¾ø½À´Ï´Ù.");
      field.value = newtext;
      field.focus();
      return;
    }
}

function input_shop() {
	alert("¸ÅÀåÃ£±â ±â´ÉÀ» ÀÌ¿ëÇÏ¼¼¿ä.");
}

function RetailerMenu(IntroMent){
	alert(IntroMent);
	return;
}

function CommunityPantsMenuWorker(){
   	alert("¹ÙÁö Ã¼Çè´Ü¸¸ ÀÛ¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù.");   	
   	return;    
}

function CommunitySeedingMenuWorker(){
   	alert("À©µå½ºÅ¸ÆÛ ÀÇ·ù Ã¼Çè´Ü¸¸ ÀÀ´äÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");   	
   	return;    
}
