<!--

/******************************************************************************
	ÆÄÀÏ¸í : common.js - °øÅë Javascript
	ÀÛ¼ºÀÚ : PortfolioAD
	ÀÛ¼ºÀÏ : 2006-07-13
******************************************************************************/

var sendit;
var win;

//=================================================================================================================================
//Ã¼Å©¹Ú½º¿¡ ¸ðµÎ ¼±ÅÃ ÇØÁ¦
//=================================================================================================================================

var selectChkFlag;
selectChkFlag = 'F';
function ChkAllSelect(){  
    if( document.all['delIdx'] == '[object]'){
		if (selectChkFlag == 'F') {
			selectChkFlag = 'T';
			if (document.frm.delIdx.length) {
				for ( var i = 0 ; i < document.frm.delIdx.length ; i++ )
					document.frm.delIdx[i].checked = true;
			} else {
				document.frm.delIdx.checked = true;
			}
		} else {
            selectChkFlag = 'F';
			if (document.frm.delIdx.length) {
				for ( var i = 0 ; i < document.frm.delIdx.length ; i++ )
					document.frm.delIdx[i].checked = false;
			} else {
				document.frm.delIdx.checked = false;
			}
		}
        return false;
    } else {
        alert("¼±ÅÃÇÏ°íÀÚ ÇÏ´Â ¸ñ·ÏÀÌ ¾ø½À´Ï´Ù.");
        return false;
    }
}

//=================================================================================================================================
// ·Î±×ÀÎÈÄ ÀÌ¿ë °¡´É
//=================================================================================================================================
function loginAction()
{
	if(confirm("·Î±×ÀÎ ÈÄ ÀÌ¿ë°¡´É ÇÕ´Ï´Ù.\n\n\n·Î±×ÀÎ ÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã·Á¸é \"È®ÀÎ\"À» ´©¸£¼¼¿ä"))
	{
		document.footerLoginForm.submit();
	}
}

//=================================================================================================================================
// iFrame ÄÁÅÙÃ÷ ³ôÀÌ ±¸ÇÏ±â, ¸®»çÀÌÁî
//=================================================================================================================================
function IframeResize(id){
    var ifrm = document.getElementById(id);
    var the_height = ifrm.contentWindow.document.body.scrollHeight;
	if(the_height < 1)
		time_id = window.setTimeout("IframeResize('"+id+"')",10);
    ifrm.height = the_height;
	window.scrollTo (0,0);	
}

//=================================================================================================================================
// IE ¼³°è º¯°æ¿¡ µû¸¥ À¥ ¾îÇÃ¸®ÄÉÀÌ¼Ç ·Îµå º¯°æ
//=================================================================================================================================

var EmbedStr = "";
function GetFlash(url,x,y) { 
	EmbedStr = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='always' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='menu' value='false' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<embed src='" + url + "' quality='high' menu='flase' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	return;
}

function printcode(s, d, m, w, h){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+w+" height="+h+" id="+d+">");
	document.write("<param name='allowScriptAccess' value='always' />");
	document.write("<param name=wmode value="+m+" />");
	document.write("<param name=movie value="+s+" />");
	document.write("<param name=quality value=high />");
	document.write("<param name=menu value=false />");
	document.write("<embed src="+s+" quality=high wmode="+m+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+">");
	document.write("</embed>");
	document.write("</object>");
}               

function GetMPlayer(movie, x,y) { 
	document.write("<OBJECT ID=WMPlayer Name=WMPlayer classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' bgcolor='#FF0000' width='"  + x + "' height='" + y + "'>");
	document.write("<PARAM NAME='Filename' value='" + movie + "'>");
	document.write("<PARAM NAME='AutoStart' VALUE='1'>");
	document.write("<PARAM NAME='AnimationAtStart' VALUE='1'>");
	document.write("<PARAM NAME='ShowPositionControls' VALUE='0'> ");
	document.write("<PARAM NAME='ShowControls' VALUE='0'>  ");
	document.write("<PARAM NAME='ShowDisplay' VALUE='0'> ");
	document.write("<PARAM NAME='ShowStatusBar' VALUE='0'>  ");
	document.write("<PARAM NAME='TransparentAtStart' VALUE='1'> ");
	document.write("<EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' ;id='WMPlayer' Name='WMPlayer' AutoStart = '1' AnimationAtStart = '0' ShowPositionControls='0' ShowControls='0' ShowDisplay='0' ShowStatusBar='0' TransparentAtStart = '1' width='" + x + "'  height='" + y + "' ");
	document.write("src='" + movie + "'>");
	document.write("</EMBED> ");
	document.write("</OBJECT>");
}

function MusicPlayer(music) { 
	document.write("<OBJECT ID=MusicPlayer Name=MusicPlayer classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' bgcolor='#FF0000' width='0' height='0'>");
	document.write("<PARAM NAME='Filename' value='" + music + "'>");
	document.write("<PARAM NAME='AutoStart' VALUE='0'>");
	document.write("<EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' ;id='MusicPlayer' Name='MusicPlayer' AutoStart = '1' AnimationAtStart = '0' ShowPositionControls='0' ShowControls='0' ShowDisplay='0' ShowStatusBar='0' TransparentAtStart = '0' width='0'  height='0' ");
	document.write("src='" + music + "'>");
	document.write("</EMBED> ");
	document.write("</OBJECT>");
}


//=================================================================================================================================
// ÀÌ¹ÌÁö ·Ñ¿À¹ö
//=================================================================================================================================
function imgChange(obj, imgSrc) {
  obj.src = imgSrc;
}

//=================================================================================================================================
// ÆË¾÷ °¡¿îµ¥ ¶ç¿ì±â
//=================================================================================================================================
	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings);
	win.focus();
	} 

//=================================================================================================================================
// ¿ÞÂÊ °í½ºÆ® ¸Þ´º
//=================================================================================================================================
/*
var min = 200;
var min2 = min - 50;
var max = 0;

function left_move_init() {
	itm = document.getElementById('QuickLinks');
	itm.set_pos = function(y){itm.style.top=y;};
	itm.y = min;
	itm.set_pos(itm.y);

	max = document.body.scrollHeight - itm.scrollHeight - min;
	setTimeout('left_move_func()', 10);
}

function left_move_func() {
	tmp = document.body.scrollTop + min;
	itm.y += Math.floor((tmp-itm.y)/10);

	if( itm.y>max ) itm.y = max;
	if( itm.y<min ) itm.y = min;
	itm.set_pos(itm.y);
	setTimeout('left_move_func()', 10);
}

	setTimeout('left_move_init()', 500);
*/

//=================================================================================================================================
// FAQ ¾Æ·¡·Î ÆîÃÄÁö´Â Åä±Û ¸Þ´º
//=================================================================================================================================

var old_menu = '';
var old_arrow ='';
var old_link = '';
function menuclick(num) {
	var submenu = eval('prdPar_' + num);
	var arrowImg = 'img_' + num;
	var linkId = 'link_' + num;
	
	if (old_link != '')	{
		document.getElementById(old_link).style.color = "#666666";
	}
	old_link = linkId;

	if(old_menu != submenu) {
		if(old_menu != '') old_menu.style.display = 'none';
		submenu.style.display = 'block';
		old_menu = submenu;
/*		
		if (old_arrow != '') 	{
			document.getElementById(old_arrow).src='images/faq_arr.gif';
		} 
		old_arrow = arrowImg;

		document.getElementById(arrowImg).src ='images/faq_arr_on.gif';
*/
		document.getElementById(linkId).style.color = "#6189C7";

	} else {
		submenu.style.display = 'none';
		old_menu = '';
/*
		if (old_arrow != '') 	{
			document.getElementById(old_arrow).src='images/faq_arr.gif';
		}
*/
	}
}

//=================================================================================================================================
// Æ÷ÅÍ½º ÀÚµ¿ ÀÌµ¿
//=================================================================================================================================

function focusMove(obj,len,nxtObj)
{
	if(obj.value.length >= len)
		eval(nxtObj).focus();
}

//=================================================================================================================================
// ¸ðµç ÀÌ¹ÌÁö Å©°Ô º¸±â ÆË¾÷
//=================================================================================================================================

function pop_Viewimg(imgName)
{
	win = window.open ("/include/pop_Viewimg.asp?viewImg=" + imgName,"pop_Viewbimg","width=100,height=100,left=10000,top=10000");
	win.focus();
}

//=================================================================================================================================
// Lay Display Ã³¸® Ã¼Å©
//=================================================================================================================================

function infoView(obj){
	obj.style.display = "";
}

function infoHidden(obj){
	obj.style.display = "none";
}

//=================================================================================================================================
// ¸Þ´º ¿À¹ö ·¹ÀÌ¾î
//=================================================================================================================================
function on_layer(layer_name) {
	document.all[layer_name].style.visibility="visible";
}
function off_layer(layer_name) {
	document.all[layer_name].style.visibility="hidden";
}
//=================================================================================================================================
// ³»¿ë Á¤º¸ ·¹ÀÌ¾î Ãâ·Â
//=================================================================================================================================

function InfoFaqView(obj){
	infoHidden2();
	document.all.popLayer[obj].style.display = "";
}

function infoHidden2(obj){
	for(k=0;k<document.all.obj.length;k++)
	{
		document.all.obj[k].style.display = "none";
	}
}

function infoshow(obj){
	if(obj.style.display == 'none')
		obj.style.display = "";
	else
		obj.style.display = "none";
}
function infomove(obj){
	obj.style.posLeft = event.clientX - 15;
	obj.style.posTop = event.clientY + 20 + document.body.scrollTop;
} 
//=================================================================================================================================
// ¸ðµç ¸µÅ©¿¡ ¸µÅ© Å×µÎ¸® ¾ø¾Ö±â
//=================================================================================================================================
function allblur() {
	for (i = 0; i < document.links.length; i++)
		document.links[i].onfocus = document.links[i].blur;
}


//=================================================================================================================================
// ·Ñ¿À¹ö ½ºÅ©¸³Æ®
//=================================================================================================================================
function overColor(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#FAFAFA";
		td.style.cursor="hand";
	}
}

function outColor(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#ffffff";//¸¶¿ì½º°¡ ³»·Á¿ÔÀ»¶§ÀÇ »ö»ó ¼³Á¤
		td.style.cursor="hand";
	}
}

//=================================================================================================================================
// ÄíÅ° »ý¼º
//=================================================================================================================================

function SetCookie( name, value, expiredays ){
	var todayDate = new Date();
	todayDate.setTime(todayDate.getTime() + 3600000*24*expiredays);
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}


//=================================================================================================================================
// ÄíÅ° °¡Á®¿À±â
//=================================================================================================================================
function GetCookie( name ){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ){
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
	return "";
}

function fnGetCookie(name){
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length ) {
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) {
				endOfCookie = document.cookie.length;
			}
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 ) {
			break;
		}
	}
	return "";
}
//=================================================================================================================================
// ÆË¾÷Ã¢ ´Ý°í ¸µÅ©ÆäÀÌÁö ÀÌµ¿
//=================================================================================================================================
function PopCloseLink(linkPage){
	var linkPage
	opener.location.href = linkPage;
   	self.close();
}

//=================================================================================================================================
// ÀÔ·Â¹®ÀÚ¿­ ¹ÙÀÌÆ® Ã¼Å©
//=================================================================================================================================
function CheckLen(obj) { 
	var t;
	var msglen;
	msglen = 0;
	l = obj.length;
	for( k = 0; k < l; k++ ) {
		t = obj.charAt( k );
		if ( escape( t ).length > 4 ) {
		msglen += 2;
		}
		else {
			msglen++;
		}
	} 
	return msglen; 
}

//=================================================================================================================================
// ÅØ½ºÆ®ÀÇ ¹ÙÀÌÆ®¼ö ÀÚµ¿Ã¼Å©
//=================================================================================================================================
function byte_check(obj,length_limit){
	var length = calculate_msglen(obj.value);
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		obj.value = obj.value.replace(/\r\n$/, "");
		obj.value = assert_msglen(obj.value, length_limit);
		document.all.viewcount.innerHTML = calculate_msglen(obj.value);
		obj.focus();
	}
}

function calculate_msglen(message){
	var nbytes = 0;
	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}
	document.all.viewcount.innerHTML = nbytes;
	return nbytes;
}

function assert_msglen(message, maximum){
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	return msg;
}


//=================================================================================================================================
// ÆË¾÷À¸·Î Post¹æ½Ä °ª Àü´Þ
//=================================================================================================================================
function postpopup(url,wWidth,wHeight){
	var wLeft = (screen.width - wWidth) / 2;
	var wTop = (screen.height - wheight) / 2;
	win = window.open ('', 'postpopup','scrollbars=yes,resizable=no,width='+wWidth+',height='+wHeight+',top='+wTop+',left='+wLeft);
	document.frm.method = "post";
	document.frm.action = url;
	document.frm.submit();
	win.focus();
}





//=================================================================================================================================
// µ¥ÀÌÅ¸ Àü¼ÛÁß ¸Þ¼¼Áö
//=================================================================================================================================
function connecting(){
	alert("µ¥ÀÌÅ¸¸¦ Àü¼ÛÁß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä");
}


//=================================================================================================================================
// °Ë»ö Ã¼Å©
//=================================================================================================================================
function search_check(frm){
	if(sendit)
	{
		connecting();
		return false;
	}
	if(!frm.keyword.value)
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
		frm.keyword.focus();
		return false;
	}
	sendit = true;
	return true;
}


//=================================================================================================================================
// ÀÌ¹ÌÁö Resize
//=================================================================================================================================
function imgResize(img_id,maxWidth)
{
	var w=document.getElementById(img_id).width;
	var h=document.getElementById(img_id).height;
	if (w<=0) 
		window.setTimeout("imgResize('"+img_id+"'," + maxWidth + ")",10);
	else 
	{
		if (w > maxWidth)
			document.getElementById(img_id).width = maxWidth;
	}
}

//=================================================================================================================================
// ÆË¾÷ ¸®»çÀÌÁî ¹× °¡¿îµ¥ Á¤·Ä
//=================================================================================================================================
function imgPopResize(img_id)
{
	var w=document.getElementById(img_id).width;
	var h=document.getElementById(img_id).height;
	if (w<=0) 
		time_id = window.setTimeout("imgPopResize('"+img_id+"')",10);
	w += 10;
	h += 30;
	var wl = (screen.width - w) / 2;
	var wt = (screen.height - h) / 2;
	window.resizeTo (w,h);
	if(w > 1024)
		wl = 0;
	if(h > 768)
		wt = 0;
	window.moveTo(wl,wt);
}

//=================================================================================================================================
// µ¥ÀÌÅ¸ Àü¼ÛÁß ¸Þ¼¼Áö
//=================================================================================================================================

function connecting(){
	alert("µ¥ÀÌÅ¸¸¦ Àü¼ÛÁß ÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä");
}

//=================================================================================================================================
// ¿ìÆí¹øÈ£ Ã£±â
//=================================================================================================================================
function zipcode()
{
	var wl = (screen.width - 400) / 2;
	var wh = (screen.height - 300) / 2;
	win = window.open ("http://www.lynn.co.kr/member/zipcode.asp","zipcode","width=344,height=313,left=" + wl + ",top=" + wh);
	win.focus();
}

//=================================================================================================================================
// È¸¿ø°¡ÀÔ sslÀû¿ë ¿ìÆí¹øÈ£ Ã£±â
//

function zipcodes()
{
	var wl = (screen.width - 400) / 2;
	var wh = (screen.height - 300) / 2;
	win = window.open ("https://www.lynn.co.kr/member/zipcode.asp","zipcode","width=344,height=313,left=" + wl + ",top=" + wh);
	win.focus();
}



//=================================================================================================================================
// ÇÊ¼ö Ç×¸ñ NULL Ã¼Å©
//=================================================================================================================================
function f_nul_chk(obj,lbl)
{
	if( obj.value == '' )
	{
		alert('ÇÊ¼öÇ×¸ñ ' + lbl + ' ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	else if (obj.value == 'null')
	{
		alert('ÇÊ¼öÇ×¸ñ ' + lbl + ' ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// SMS ¼ö½Å µ¿ÀÇ½Ã ÇÚµåÆù Ç×¸ñ NULL Ã¼Å©
//=================================================================================================================================

function f_nul_smschk(obj,lbl)
{
	if( obj.value == '' )
	{
		alert('SMS ¼ö½Å µ¿ÀÇ½Ã ' + lbl + ' ²À ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		obj.focus(); 
		return true;   
	}
	else if (obj.value == 'null')
	{
		alert('SMS ¼ö½Å µ¿ÀÇ½Ã ' + lbl + ' ²À ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¼ýÀÚ¸¸ ÀÔ·Â °¡´É
//=================================================================================================================================
function f_is_num(obj,lbl)
{
	var nLen = obj.value.length; 
	for( i = 0 ; i < nLen ; i++)
	{
		temp = obj.value.substring(i,i+1);
		if( temp < '0' || temp > '9' )
		{
			alert(lbl + ' ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.');
			obj.select();
			return true;
		}     
	}
	return false;
}



//=================================================================================================================================
// ID Ã¼Å© (¼ýÀÚ ¹× ¿µ¹®ÀÚ¸¸ ÀÔ·Â °¡´É)
//=================================================================================================================================

function f_is_id(obj)
{
   var sTemp;

	for(var i = 0; i < obj.value.length; i++)
	{
	   sTemp = obj.value.substring(i, i+1);   
		if((sTemp <= '9') && (sTemp >= '0'))
		   continue;
		if((sTemp <= 'z') && (sTemp >= 'a'))
		   continue;
		if((sTemp <= 'Z') && (sTemp >= 'A'))
		   continue;
	   return true;
	}
   return false;
}


//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌ»ó ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_date_chk(obj,lbl, num)
{
	if( obj.value.length != num)
	{
		alert(lbl + ' ³¯Â¥ Çü½ÄÀ» ¸ÂÃç ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌ»ó ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_s_chk(obj,lbl, num)
{
	if( obj.value.length < num)
	{
		alert(lbl + ' '  + num + '¹®ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ¹®ÀÚ ±æÀÌ Ã¼Å© (X¹®ÀÚ ÀÌÇÏ ÀÔ·Â °¡´É)
//=================================================================================================================================
function f_len_l_chk(obj,lbl, num)
{
	if( obj.value.length > num)
	{
		alert(lbl + ' '  + num + '¹®ÀÚ ÀÌÇÏ ÀÔ·ÂÇÏ½Ê½Ã¿À.');
		obj.focus(); 
		return true;   
	}
	return false; 
}

//=================================================================================================================================
// ID Áßº¹ Ã¼Å©
//=================================================================================================================================
function f_popup_id() 
{

	var w_id_chk;
	if (f_nul_chk(document.frm.id, '[¾ÆÀÌµð]¸¦'))			return; 
	if (f_len_s_chk(document.frm.id, '[¾ÆÀÌµð]´Â',4))		return;
	if (f_len_l_chk(document.frm.id, '[¾ÆÀÌµð]´Â',16))		return;
	if (f_is_id(document.frm.id))
	{
	   alert("¾ÆÀÌµð´Â ¿µ¹®/¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.");
		frm.id.focus();
		return;
	}
	window.open('/member/pop_id_check.asp?id=' + document.frm.id.value,'w_id_chk', 
			'resizable=no,scrollbars=0,x=100,y=200,width=400,height=210');
	
}
		
//=================================================================================================================================
// ÁÖ¹Îµî·Ï ¹øÈ£ Ã¼Å©
//=================================================================================================================================
function JuminNumberCheck(s) {
	if( s.charAt(6) == 1 || s.charAt(6) == 2 || s.charAt(6) == 3 || s.charAt(6) == 4)
	{
		if( s.charAt(12) == 
			(( 11 - ((s.charAt(0)*2+s.charAt(1)*3+s.charAt(2)*4
						+s.charAt(3)*5+s.charAt(4)*6+s.charAt(5)*7
						+s.charAt(6)*8+s.charAt(7)*9+s.charAt(8)*2
						+s.charAt(9)*3+s.charAt(10)*4+s.charAt(11)*5)
						% 11)))%10)
			return true; 
	} 
	return false; 
}


//=================================================================================================================================
// ¸¸ 20¼¼ ÀÌ»ó Ã¼Å©
//=================================================================================================================================
function f_ManAge(obj1,obj2)
{
	today			= new Date();
	var obj1YMD		= parseInt(obj1.value);
	var obj2YMD		= parseInt(obj2.value);
	var nowYear		= parseInt(today.getYear());
	var nowMonth	= today.getMonth()+1;
	var nowDate		= today.getDate();
	
	if (nowMonth < 10)
	{
		nowMonth = "0" + nowMonth;
	}

	if (nowDate < 10)
	{
		nowDate	= "0" + nowDate;
	}

	tmpYear	= nowYear - 1920;
	tmpYMD  = parseInt("" + tmpYear + nowMonth + nowDate);

	if (obj2YMD >= 1000000 && obj2YMD <= 2999999)
	{
		if (obj1YMD > tmpYMD)
		{
			alert("´ç»ç´Â ¸¸ 20¼¼ ÀÌÇÏÀÇ ¹Ì¼º³âÀÚÀÇ È¸¿ø°¡ÀÔÀº Çã¿ëÇÏÁö ¾Ê°í ÀÖ½À´Ï´Ù.");
			return true;
		}
	}
	else
	{
		alert("´ç»ç´Â ¸¸ 20¼¼ ÀÌÇÏÀÇ ¹Ì¼º³âÀÚÀÇ È¸¿ø°¡ÀÔÀº Çã¿ëÇÏÁö ¾Ê°í ÀÖ½À´Ï´Ù.");
		return true;
	}
	return false;
}

//=================================================================================================================================
// ÀÌ¸ÞÀÏ ÀÚµ¿ ¼ÂÆÃ
//=================================================================================================================================
function email_set() 
{
	frm.email2.value = frm.email3.value;
}

function pemail_set() 
{
	frm.pemail2.value = frm.pemail3.value;
}

function email1_set() 
{
	frm.email1_02.value = frm.email1_03.value;
}

function email2_set() 
{
	frm.email2_02.value = frm.email2_03.value;
}

function email3_set() 
{
	frm.email3_02.value = frm.email3_03.value;
}

function email4_set() 
{
	frm.email4_02.value = frm.email4_03.value;
}

function email5_set() 
{
	frm.email5_02.value = frm.email5_03.value;
}

//=================================================================================================================================
// Checkbox ¼±ÅÃ Ã¼Å©
//=================================================================================================================================

function f_chknul_chk(obj,lbl)
{
	var chklen = 0;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked == true)
			chklen++;
	}
	if(chklen == 0)
	{
		alert("ÇÊ¼öÇ×¸ñ " + lbl + " Ã¼Å©ÇÏ½Ê½Ã¿À.");
		return true;   
	}

	return false; 
}

function f_chknul2_chk(obj,obj2,lbl)
{
	var chklen = 0;
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].checked == true)
			chklen++;
	}
	if(chklen == 0)
	{
		if( obj2.value == '' )
		{
			alert("ÇÊ¼öÇ×¸ñ " + lbl + " Ã¼Å©ÇÏ½Ê½Ã¿À.");
			return true;   
		}
		
	}

	return false; 
}


//=================================================================================================================================
// Checkbox ¼±ÅÃ Á¦ÇÑ
//=================================================================================================================================

function chkBox(obj,cnt)
{
	var cnt;
	var chklen = 0;
	objlen = eval("document.frm." + obj).length;
	for(i=0;i<objlen;i++)
	{
		if(eval("document.frm." + obj + "[" + i + "]").checked == true)
		{
			chklen++;
			if(chklen > cnt)
			{
				alert("Ç×¸ñÀº " + cnt + "°³±îÁö ¼±ÅÃÀÌ °¡´ÉÇÕ´Ï´Ù.");
				eval("document.frm." + obj + "[" + i + "]").checked = false;
			}
		}
	}
}

//=================================================================================================================================
// »ý³â¿ùÀÏ ÀÚµ¿ ¼ÂÆÃ
//=================================================================================================================================
function birth_set() 
{
	var tmpbirth1;
	var tmpbirth2;
	var tmpbirth_y;
	var tmpbirth_m;
	var tmpbirth_d;
	var tmpbirth_x;
	
	tmpbirth1 = frm.ss_id1.value;
	tmpbirth2 = frm.ss_id2.value;
	tmpbirth_x = tmpbirth2.substring(0,1);
	
	if (tmpbirth_x >= 3)
		tmpbirth_y = "20"
	else
		tmpbirth_y = "19"
	tmpbirth_y = tmpbirth_y + tmpbirth1.substring(0, 2);
	tmpbirth_m = tmpbirth1.substring(2, 4);
	tmpbirth_d = tmpbirth1.substring(4, 6);

	if (tmpbirth2.length == 7)
	{
		frm.birth_y.value = tmpbirth_y;
		frm.birth_m.value = tmpbirth_m;
		frm.birth_d.value = tmpbirth_d;
//		f_ManAge(tmpbirth1,tmpbirth2);
	}

}


//=================================================================================================================================
// °Ô½ÃÆÇ ÄÚ¸àÆ® »èÁ¦
//=================================================================================================================================
function cmtdel(val) {
	if(confirm("ÄÚ¸àÆ®¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?\n\n\"È®ÀÎ\"À» ´©¸£½Ã¸é »èÁ¦µË´Ï´Ù.") == true){
		document.frm.mode.value = "COMDEL";
		document.frm.cmtnum.value = val;
		document.frm.submit();

	}
}

//=================================================================================================================================
// ÆÄÀÏ »èÁ¦
//=================================================================================================================================
function filedel(val) {
	if(confirm("ÆÄÀÏÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?\n\n\"È®ÀÎ\"À» ´©¸£½Ã¸é »èÁ¦µË´Ï´Ù.") == true)
	{
		document.frm.mode.value = "FILEDEL";
		document.frm.recordname.value = val;
		document.frm.submit();

	}
}

//------------------------------------------------------------------------------
// ¼ýÀÚ¸¸ ÀÔ·Â ¹Þ±â
//------------------------------------------------------------------------------
function onlyNum() {
	if ((event.keyCode < 48)||(event.keyCode > 57)) {
		if (event.keyCode == 13) {
			event.returnValue;
		}
		else {
			event.returnValue = false;
		}
	}
}

function IsDate(strDate){
	var arrDate;
	var chkDate;
	if (strDate.indexOf("-") == -1) {
		return (false);
	}
	arrDate = strDate.split("-");
	if (arrDate.length != 3) {
		return(false);
	}
	if (arrDate[0].length != 4 ) {
		return(false);
	}
	if (arrDate[1].length > 12 ) {
		return(false);
	}
	if (arrDate[2].length > 31 ) {
		return(false);
	}
	chkDate = new Date(arrDate[0] + "/" + arrDate[1] + "/" + arrDate[2]);
	if (isNaN(chkDate) == true || (arrDate[1] != chkDate.getMonth() + 1 || arrDate[2] != chkDate.getDate())) {
		return(false);
	}
	
	return(true);
}

//=================================================================================================================================
// ÇÊµå°ªÀ¸·Î ¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
//=================================================================================================================================
function NumberKeyOnly(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj.value;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ¼ö ÀÖ½À´Ï´Ù.");
		obj.value = obj.defaultValue;
		obj.focus();
		return;
	}
}


// ÇÊµå°ª¿¡ ¼ýÀÚ¸¸ ¹ÞÀ½
function onlyNumber(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "0123456789";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}

function onlyEnglish(obj) {
	// obj : ÇÊµå¸í (ex. document.form.title)
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var checkStr = obj;
	var allValid = true;
	var decPoints = 0;
	var allNum = "";
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
		allNum += ch;
	}
	if (!allValid){
		return false;
	} else {
		return true;
	}
}


function titleAllView(obj,bool)
{
	eval("document.all.originalTitle"+obj).style.display = bool;
	eval("document.all.originalTitle"+obj).style.posTop = event.clientY + document.body.scrollTop + 10;

}


function isHangul(obj)
{
	if(obj.match(/^[°¡-ÆR]+$/))
	{
		return true;
	}
	else 
	{
		return false;
	}
}

function paletteToggle() {
	window.cancelBubble = true;
	var oBtn = window.event.srcElement;
	if (oBtn.LinkType == "MINICALENDAR") {
		document.all.minicalendar.style.posLeft = event.clientX - 75;
		document.all.minicalendar.style.posTop = event.clientY + document.body.scrollTop + 10;
		document.all.minicalendar.style.visibility = "visible";
	} else {
		document.all.minicalendar.style.visibility = "hidden";
	}
	oLastBtn = oBtn;
}

function setDate(year,month,day) {
	eval("document.all."+oLastBtn.Item+".value = '"+year+"-"+month+"-"+day+"';");
	document.all.minicalendar.style.visibility = "hidden";
	return;
}

function minical()
{
	var html = "<object data=\"/Include/minicalendar.htm\" id=minicalendar name='minicalendar' height=177 style=\"background-color: #ffffff;filter: revealtrans(duration=0); left: 0px; top: 0px; visibility: hidden; z-index: 30; position: absolute;\" type=text/x-scriptlet width=154 viewastext></object>";
	document.write (html);
	//<input type='text' name='boxname' LinkType='MINICALENDAR' Item='boxname'>
}

function doBlink() {
 var blink = document.all.tags("BLINK")
 for (var i=0; i<blink.length; i++)
	blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
 if (document.all)
	setInterval("doBlink()",600)
}

//-----------------------------------------------------------------------------
// ÀüÈ­¹øÈ£ Çü½Ä Ã¼Å© XXX-XXXX-XXXX ÇüÅÂ·Î Ã¼Å©
//-----------------------------------------------------------------------------
String.prototype.phone = function() {
	var num = this.trim();
	if(num.substring(1,2) == "2") {
		num = num.substring(0, 2) + "-" + num.substring(2, num.length - 4) + "-" + num.substring(num.length - 4, num.length);
	}
	else {
		num = num.substring(0, 3) + "-" + num.substring(3, num.length - 4) + "-" + num.substring(num.length - 4, num.length);
	}
	num = num.match(/^0[0-9]{1,2}-[1-9]{1}[0-9]{2,3}-[0-9]{4}$/);
	return (num) ? true : false;
}

//-----------------------------------------------------------------------------
// ÇÚµåÆù Ã¼Å© XXX-XXXX-XXXX ÇüÅÂ·Î Ã¼Å©
//-----------------------------------------------------------------------------
String.prototype.mobile = function() {
	var num = this.trim();
	num = num.substring(0, 3) + "-" + num.substring(3, num.length - 4) + "-" + num.substring(num.length - 4, num.length);
	num = num.trim().match(/^01[016789]{1}-[1-9]{1}[0-9]{2,3}-[0-9]{4}$/);
	return (num) ? true : false;
}

//-----------------------------------------------------------------------------
// °ø¹é Á¦°Å
//-----------------------------------------------------------------------------
String.prototype.trim = function() { 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
}

//-----------------------------------------------------------------------------
// ÀÌ¸ÞÀÏ Çü½Ä Ã¼Å©
//-----------------------------------------------------------------------------
String.prototype.email = function() {
	var em = this.trim().match(/^[_\-\.0-9a-zA-Z]{3,}@[-.0-9a-zA-z]{2,}\.[a-zA-Z]{2,4}$/);
	return (em) ? true : false;
}

/////////////////////////////// png ÀÌ¹ÌÁöÃ³¸®
function setPng24(obj) {
 obj.width=obj.height=1;
 obj.className=obj.className.replace(/\bpng24\b/i,""); 
 obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+ obj.src +"\",sizingMethod=\"image\");"
 obj.src ="/images/common/blank.gif";
 return "";
}

// -->