/*---------------------------------------------------------------------------------------------------------*/
// #  ¹ÙÀÌÆ® Ä«¿îÅÍ 
// str :name
// str2 : byte count name
// max_char ÃÖ´ë ¹®ÀÚ¼ö
/*---------------------------------------------------------------------------------------------------------*/

/////****************** ¹ÙÀÌÆ® Ä«¿îÅÍ...
function char_count(str,str2,max_char)
{
	var col_name = "document.form1."+str;
	if (str2 != "")
	{
			var ren_col_name = "document.form1."+str2;
	}
	
	if (max_char == "")
	{
		max_char = 0;
	}
	var str_character;
	var int_char_count, rast_char;
	var int_contents_length;
	var max_ovar = ""
	int_char_count = 0;
	rast_char = 0;
	int_contents_length = eval(col_name).value.length;
	
	for(k=0; k < int_contents_length; k++)
	{
		str_character = eval(col_name).value.charAt(k);

		if(escape(str_character).length > 4)
		{
			int_char_count += 2;
		}
		else
		{
			int_char_count++;
		}
		if (str2 != "")
		{
				eval(ren_col_name).value = int_char_count;
		}
		
		if (int_char_count > Number(max_char)) 
		{
			//alert(k);
			alert(max_char+"¹ÙÀÌÆ® ÀÌ»óÀº ÀÔ·Â ÇÏ½Ç¼ö ¾ø½À´Ï´Ù.\r\nÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
			var str = eval(col_name).value.substr(0, k);
			eval(col_name).value = str;
			if (str2 != "")
			{
					eval(ren_col_name).value = max_char;
			}
			
			max_ovar = "yes"
			break;
		}
	}
	
	return;
	
}
/////****************** ¹ÙÀÌÆ® Ä«¿îÅÍ...

/*---------------------------------------------------------------------------------------------------------*/
// # ÀÌ¹ÌÁöÅ©±â·Î ÆË¾÷¶ç¿ì±â...½ÃÀÛ
/*---------------------------------------------------------------------------------------------------------*/
var oWin;
function viewPic(img)
{
  foto1= new Image();
  foto1.src=(img);
  contImg(img);
}
function contImg(img)
{
  if((foto1.width!=0)&&(foto1.height!=0))
  {
    viewImg(img);
  }
  else{
    funzione="contImg('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewImg(img)
{
  checkWin();
  largh=foto1.width;
  altez=foto1.height;
  var winl = 0;
  var wint = 0;
  stringa="width="+largh+",height="+altez+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
  oWin=window.open("/share/popup_image.asp?src="+img,"big001",stringa);
}

function checkWin()
{
	if (oWin != null)
	{
		if(oWin.closed == true)
		{
			//alert('ÆË¾÷Ã¢ÀÌ ´ÝÇû½À´Ï´Ù.');
			oWin.close();
		}
		else
		{
			//alert('ÆË¾÷Ã¢ÀÌ ¿­·ÁÀÖ½À´Ï´Ù.');
			oWin.close();
		}
	}
}


/*---------------------------------------------------------------------------------------------------------*/
// # ¾ÆÀÌµð ÆË¾÷ °Ë»ö
/*---------------------------------------------------------------------------------------------------------*/

function id_search_it()
{
	var w=350;
	var h=330;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
	open("Pop_idsearch.asp","Pop_idsearch",winprops);
}

/*---------------------------------------------------------------------------------------------------------*/
// # ºñ¹Ð¹øÈ£ ÆË¾÷ °Ë»ö
/*---------------------------------------------------------------------------------------------------------*/

function pwd_search_it()
{
	var w=350;
	var h=330;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
	open("Pop_pwsearch.asp","Pop_idsearch",winprops);
}

/*---------------------------------------------------------------------------------------------------------*/
// # ¸¶¿ì½º IN OUT ·¹ÀÌ¾î
/*---------------------------------------------------------------------------------------------------------*/

function div_mouse_it(div_chk,check_div)
{
	if (div_chk == "open")
	{
		if (check_div == "mouse_div" )
		{
				document.form1.all['mouse_div'].style.display="";
				document.form1.all['mouse1_div'].style.display="none";
		}
		if (check_div == "mouse1_div" )
		{
				document.form1.all['mouse_div'].style.display="none";
				document.form1.all['mouse1_div'].style.display="";
		}
		
	}
	else
	{
		document.form1.all['mouse_div'].style.display="none";
		document.form1.all['mouse1_div'].style.display="none";
	}
}	

function div_mouse_it1(div_chk,check_div)
{
	if (div_chk == "open")
	{
		if (check_div == "mouse_div" )
		{
				document.form1.all['mouse_div'].style.display="";
		}
		if (check_div == "mouse1_div" )
		{
				document.form1.all['mouse_div'].style.display="none";
		}
		
	}
	else
	{
		document.form1.all['mouse_div'].style.display="none";
	}
}	

function div_mouse_it2(div_chk,check_div) {
	if (div_chk == "open") {
		eval("document.form1.all['" + check_div + "']").style.display="";
	} else {
		eval("document.form1.all['" + check_div + "']").style.display="none";
	}
}	


/*---------------------------------------------------------------------------------------------------------*/
// # ¿ìÆí¹øÈ£ Ã£±â
// # rtn_code :  Áý = '' , È¸»ç = 'co' 
/*---------------------------------------------------------------------------------------------------------*/

function pop_checkAddress(rtn_code)
{
	var w=360;
	var h=350;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
	window.open("/Common/Pop_ZipCode.asp?rtn_code="+rtn_code, "_blank",winprops);
	return;
}

/*---------------------------------------------------------------------------------------------------------*/
// # ÀÌ¸ÞÀÏ¹«´Ü¼öÁý°ÅºÎ
//*---------------------------------------------------------------------------------------------------------*/
function Pop_EmailReject_it()
{
	var w=350;
	var h=260;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
	open("/Common/Pop_EmailReject.asp","pat_doc",winprops);
}


/*---------------------------------------------------------------------------------------------------------*/
// # ÀÌº¥Æ® ·Î°í Ã£±â ÇÔ¼ö 
//*---------------------------------------------------------------------------------------------------------*/
function event_logo_check_it(user_Event_num, Return_Event_logo)
{
	/*var i = 0;
	var f = document.form1;
	f.event_num.value = "";
	var event_chk=new Array(0,0,0,0,0,0,0,0,0,0,0); // 30%
	while(i<3)
	{
		var j=Math.floor(Math.random()*10);
		if (event_chk[j] == 0)
		{
			event_chk[j]++;
			var event_num = f.event_num.value;
			f.event_num.value = event_num + j + ",";
			i++;
		}
	}
	
	var event_num = f.event_num.value;
	for (i=0; i < event_num.length; i++)
	{
		if (event_num.charAt(i) == user_Event_num) 
		{ 
			f.all['event_logo_div'].style.display="";

			var w=10;
			var h=10;
			var winl = 5000;//(screen.width - w) / 2;
			var wint = 5000;//(screen.height - h) / 2;
			winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
			open("/Event/Pop_Event01_Cookies.asp", "Pop_Event01_Cookies",winprops);
			//setTimeout("event_logo_check_out_it()",5000); //½Ã°£Ã¼Å© ÈÄ ÀÌ¹ÌÁö °¨Ãß±â ÇöÀç 5ÃÊ
		}
	}
	
	if (Return_Event_logo == "Yes")
	{
		var w=460;
		var h=421;
		var winl = 0; //(screen.width - w) / 2;
		var wint = 0; //(screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
		open("/Event/Pop_Event01.asp?logo_ok=Yes","Pop_Event01",winprops);
	}
	return;
	*/
	
}

function event_logo_check_out_it()
{
	var f = document.form1;
	f.all['event_logo_div'].style.display="none";
	return;
}

function event_logo_ok_it(m_id)
{
	//var m_id = "<%=GetCookies_M_id%>";
	if (m_id == "")
	{
		if (confirm("±³ÃÌ È¸¿ø¸¸ µî·Ï °¡´ÉÇÕ´Ï´Ù.\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?"))
		{
			//È¸¿ø°¡ÀÔ ÆûÀ¸·Î ÀÌµ¿
			location.href="/Member/Login.asp";
			return;
		}
		return;
	}
	
	var w=460;
	var h=421;
	var winl = 0; //(screen.width - w) / 2;
	var wint = 0; //(screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,resizable=no';
	open("/Event/Pop_Event01.asp","Pop_Event01",winprops);

	document.form1.all['event_logo_div'].style.display="none";
	return;
}
