/**
 * common.js
 * 전 페이지 공통 스크립트
 *
 *
 * @author  MIJIN KIM (hasa00)
 * 			hasa00_AT_skcomms_DOT_co_DOT_kr
 * @date    2009-04-11
 *  
***/


/**
* 브라우저 타입 변수 
*/
var IE = (navigator.userAgent.indexOf('MSIE') != -1) ? true : false;		// IE Check
var IE7 = (navigator.userAgent.indexOf('MSIE 7.0') != -1) ? true : false;	// IE7 Check
var FF = (navigator.userAgent.indexOf('Firefox') != -1) ? true : false;		// FF Check

/**
if(IE)
{
	var loc = ""+document.location;
	if(loc.indexOf("forum") > 0 )
	{
		if(document.charset != "utf-8")
			document.location.reload();
	}
}
**/

function setDomain()
{
	document.domain = "nate.com";
	return;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// START : COOKIE SCRIPT 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getCookie(name) 
{ 
	var Found = false; 
	var start, end ;
	var i = 0 ;
	
	while(i <= document.cookie.length) 
	{ 
		start = i; 
		end = start + name.length; 
	
		if(document.cookie.substring(start, end) == name) 
		{ 
			Found = true; 
			break; 
		} 
		i++ ;
	} 

	if(Found == true) 
	{ 
		start = end + 1; 
		end = document.cookie.indexOf(";", start); 
		
		if(end < start) 
			end = document.cookie.length; 
	
		return document.cookie.substring(start, end); 
	} 
	else
		return "" 
} 


function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// END : COOKIE SCRIPT 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////START  : QA관련 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
* 공백제거 함수
*
* ex> if(document.form.title.trim()=='') ...
*/
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}

/**
* 엔터무효화.
* 텍스트박스에서 엔터 입력시 submit 되지 않도록 함
*
* ex> onkeypress="EnterCheck(event);"
*/
function EnterCheck(e) {
var event = window.event?window.event:e;
var evtCode = window.event?event.keyCode:e.which;

if(evtCode==13){
if(event.preventDefault)
event.preventDefault();
else
event.returnValue = false;
return;
}
}

/**
* 클립보드로 복사
* '주소복사' 같은 경우 사용
*/
function CopyClipBoard(url) {
if (IE) {
window.clipboardData.setData("Text", url);
alert("복사되었습니다.\n\n필요한 곳에 붙여넣기(Ctrl+V) 하세요.");
} else {
prompt("이 글의 주소입니다. Ctrl+C를 눌러 복사하세요", url);
}
}

/**
* Iframe 높이 자동조절
* iframe_id - iframe 의 id 값
*
* ex> <iframe src='xxx.php' id='aiframe' onload="calcHeight('aiframe')"></iframe>
*/
function calcHeight(iframe_id){
try {
var objIframeBody = document.getElementById(iframe_id);
var innerBody = objIframeBody.contentWindow.document.body;

var the_height = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
if(FF) the_height += 2;
document.getElementById(iframe_id).height = (the_height+50) + 'px';

if (typeof(parent.MovePage) == 'function') {
parent.resizeCurrentFrame(null);
}
} catch(e) {
}
}

/*
* 화폐단위 처리
*/
function number_fomat(v) {
v = v.toString();
if (v.length > 3) {
var mod = v.length % 3;
var retval = (mod > 0 ? (v.substring(0,mod)) : "");
for (i=0 ; i < Math.floor(v.length / 3); i++) {
if ((mod == 0) && (i == 0)) {
retval += v.substring(mod+ 3 * i, mod + 3 * i + 3);
} else {
retval+= "," + v.substring(mod + 3 * i, mod + 3 * i + 3);
}
}
return retval;
} else {
return v;
}
}

/*
* 영문/한글 글자수 체크
* 총 Byte 수 리턴
*/
function byteCheck(code){
var code_byte = 0;
for (var inx = 0; inx < code.value.length; inx++) {
var oneChar = escape(code.value.charAt(inx));
if ( oneChar.length == 1 ) {
code_byte ++;
} else if (oneChar.indexOf("%u") != -1) {
code_byte += 2;
} else if (oneChar.indexOf("%") != -1) {
code_byte += oneChar.length/3;
}
}
return code_byte;
}

/*
* 영문/한글 글자수 체크후 넘는 값 제거
* 제한 Byte 를 넘는지 안넘는지를 체크후 넘는 글자 제거후 true/false 리턴
*
* ex> if(textLenCheck(document.form.content, 1000)) { return; }
*
* true - 제한길이 넘었음
* false - 제한길이 넘지 않았음
*/
function checkContentLength(content, max_length){
var i;
var string = content.value;
var one_char;
var str_byte = 0;
var str_length = 0;
var isbreak = false;

for(i = 0 ; i < string.length ; i++){
one_char = string.charAt(i);
if (escape(one_char).length > 4){
str_byte = str_byte+2;
}
else{
str_byte++;
}

if(str_byte <= max_length){
str_length = i + 1;
}
}

// 전체길이를 초과하면
if(str_byte > max_length){
alert(max_length+"byte 를 초과 입력할 수 없습니다.\n초과된 내용은 자동으로 삭제 됩니다. ");
content.value = string.substr(0, str_length);
isbreak = true;
}

return isbreak;
}

/**
* 텍스트 길이를 체크해서 해당 길이값을 원하는 영역에 innerHTML 형태로 넣어줌
* 
* ex>
* <textarea id="reply" rows="4" cols="100" OnKeyUp="textLenCheck(this, 1000, 'commentLen')"></textarea>
* <span id='commentLen'>0</span>
*/
function textLenCheck(code, limit, targetE){
checkContentLength(code, limit);

if(targetE!=''){
var len = byteCheck(code);
$(targetE).innerHTML = len;
}
}

/**
* '즐겨찾기 추가' 기능
* FF 에서는 작동안하므로 얼럿 처리
*/
function addFavor(){
if(!FF)
window.external.AddFavorite('http://URL','즐겨찾기 문구');
else {
alert("'즐겨찾기 추가' 기능을 지원하지 않는 브라우저입니다"); 
}
}



//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////END : QA관련 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/**
* @create hasa00
 * Check HTML태그 제거 
 * @param field form.element
* ex> if(document.form.title.value.trim()=='') ...
*/

function removeHTMLTags(string)
{
   var objStrip = new RegExp(); 
   objStrip = /[<][^>]*[>]/gi; 
   return string.replace(objStrip, ""); 
}


/**
* @create hasa00
 * Check 공백/태그 제거 
 * @param field form.element
* ex> if(document.form.title.value.trim()=='') ...
*/
String.prototype.trim = function() 
{
	regexp=RegExp(/&nbsp;/ig);
	var val = this.replace(regexp," ");
	regexp=RegExp(/　/ig);
	val = val.replace(regexp,"");
	regexp=RegExp(/[<][^>]*[>]/gi);
	val = val.replace(regexp,"");
	val = val.replace(/^\s+|\s+$/g,"");
	return val;
}



/**
* 영문/한글 글자수 체크
* 총 Byte 수 리턴
*/
function textByteCheck(code_text){
var code_byte = 0;
for (var inx = 0; inx < code_text.length; inx++) {
var oneChar = escape(code_text.charAt(inx));
if ( oneChar.length == 1 ) {
code_byte ++;
} else if (oneChar.indexOf("%u") != -1) {
code_byte += 2;
} else if (oneChar.indexOf("%") != -1) {
code_byte += oneChar.length/3;
}
}
return code_byte;
}

/**
* F5 확인 
* 텍스트박스에서 엔터 입력시 submit 되지 않도록 함
*
* ex> onkeypress="EnterCheck(event);"
*
function EnterCheck(e) 
{
	var event = window.event?window.event:e;
	var evtCode = window.event?event.keyCode:e.which;
//alert(evtCode);
	if(evtCode==13)
	{
		if(event.preventDefault)
			event.preventDefault();
		else
			event.returnValue = false;
		return;
	}
}

/**
 * @create hasa00
 * Check Box가 체크 되었는지를 알려준다
 * @param field form.element
 */
function isChecked(field) {

	if(isEmpty(field.checked))
		return false;
	else if(field.checked == 'checked')
		return true;
	else
		return field.checked;
}


/**
 * @create hasa00
 * Radio Button의 선택된 값을 가져온다
 * @param field form.element
 */
function getRadioVal(field) {

	if(typeof(field.length) == 'undefined')
	{
		return field.value;
	}
	else
	{
		for(i = 0; i < field.length; i++) {
			if(field[i].checked == true)
				return field[i].value;
		}
	}

	return "";
}

/**
 * @create hasa00
 * Radio Button의 선택된 값을 가져온다
 * @param field form.element
 */
function getSelectVal(field) {
	if(typeof(field) == 'undefined')
		return null;
	else
		return field.options[field.selectedIndex].value;
}



/**
 * @create hasa00
 * 
 * 라디오 버튼, 체크박스를 원하는 값으로 셋팅하는 함수
 *
 * @param objFrm document.프레임명.라디오 버튼 이름
 * @param val 셋팅할 값
 */
function setRadioVal (objFrm, val) {
	var len = objFrm.length;
	if (!len) {
		objFrm.checked = true;
	} else {
		for (var n = 0; n < len; n++) {
			if (objFrm[n].value == val)
				objFrm[n].checked = true;
		}
	}
}


/**
 * @create hasa00
 * 
 * 숫자만 입력가능하게 하기  
 *
 * @sample   
 */
function checkNumber(field, nick) 
{
	var str = field.value;
    var flag = true; 
    if (str.length > 0) 
    { 
        for(var i = 0; i < str.length; i++) 
        {  
            if(str.charAt(i) < '0' || str.charAt(i) > '9') 
                flag = false; 
        } 
    } 
    
    if(!flag)
    {
    	if(isEmpty(nick))
    		alert('숫자로만 입력 해주세요.');
    	else
    		alert(nick + ' 숫자로만 입력 해주세요.');
    		
    }
    return flag; 
} 

// str은 모두 소문자여야하고 첫글자는 영문이어야 한다. 영문과 0~9, -, _, ^는 허용한다. 
function CheckChar(str) { 
    strarr = new Array(str.length); 
    var flag = true; 
    for (i=0; i<str.length; i++) { 
        strarr[i] = str.charAt(i) 
        if (i==0) { 
            if (!((strarr[i]>='a')&&(strarr[i]<='z'))) { 
                flag = false; 
            } 
        } else { 
            if (!((strarr[i]>='a')&&(strarr[i]<='z')||(strarr[i]>='0')&&(strarr[i]<='9')||(strarr[i]=='-')||(strarr[i]=='_')||(strarr[i]=='^'))) { 
                flag = false; 
            } 
        } 
    } 
    if (flag) { 
        return true; 
    } else { 
        return false; 
    } 
} 

// str은 모두 영문소문자여야 한다. 
function CheckChar2(str) { 
    strarr = new Array(str.length); 
    var flag = true; 
    for (i=0; i<str.length; i++) { 
        strarr[i] = str.charAt(i) 
        if (!((strarr[i]>='a')&&(strarr[i]<='z'))) { 
            flag = false; 
        } 
    } 
    if (flag) { 
        return true; 
    } else { 
        return false; 
    } 
} 

// 이메일 체크 
function CheckMail(strMail) { 
   /** 체크사항 
     - @가 2개이상일 경우 
     - .이 붙어서 나오는 경우 
     -  @.나  .@이 존재하는 경우 
     - 맨처음이.인 경우 
     - @이전에 하나이상의 문자가 있어야 함 
     - @가 하나있어야 함 
     - Domain명에 .이 하나 이상 있어야 함 
     - Domain명의 마지막 문자는 영문자 2~4개이어야 함 **/ 

    var check1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;  

    var check2 = /^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4})$/; 
     
    if ( !check1.test(strMail) && check2.test(strMail) ) { 
        return true; 
    } else { 
        return false; 
    } 
} 

// str은 한글이어야만 한다. 
function CheckHangul(str) { 
    strarr = new Array(str.length); 
    schar = new Array('/','.','>','<',',','?','}','{',' ','\\','|','(',')','+','='); 
    flag = true; 
    for (i=0; i<str.length; i++) { 
        for (j=0; j<schar.length; j++) { 
            if (schar[j] ==str.charAt(i)) { 
                flag = false; 
            } 
        } 
        strarr[i] = str.charAt(i) 
        if ((strarr[i] >=0) && (strarr[i] <=9)) { 
            flag = false; 
        } else if ((strarr[i] >='a') && (strarr[i] <='z')) { 
            flag = false; 
        } else if ((strarr[i] >='A') && (strarr[i] <='Z')) { 
            flag = false; 
        } else if ((escape(strarr[i]) > '%60') && (escape(strarr[i]) <'%80') ) { 
            flag = false; 
        } 
    } 
    if (flag) { 
        return true; 
    } else { 
        return false; 
    } 
     
}


/**
 * @create hasa00
 * @method return object or arrayObject
 * @call get('odj_name');
 */
function g(obj_key)
{
	return get(obj_key);
}

function get(obj_key)
{
	if(eval(document.getElementById(obj_key))) //******************
		return document.getElementById(obj_key);
	else if(eval(document.getElementsByTagName(obj_key)))
	{
		var tmp = document.getElementsByTagName(obj_key);
		if(tmp.length == 1)
			return tmp[0];
		else
			return tmp;
	}
	else
	{
		alert('NONE');
		return null;
	}
}


/**
 * @create hasa00
 * @method return 'validation'
 * @call isEmpty(param);
 */
function isEmpty( param )
{
	if(param == null || param == '' || param == 'undefind' )
		return true;
	else
		return false;
}

function isSet( field, nick )
{
	if(field.value == null || field.value == '' || field.value == 'undefind' )
	{
		alert(nick+' 입력해주세요.');
		field.focus();
		return true;
	}
	else
		return false;
}




/**
 * @create hasa00
 * 윈도우 자동 리사이징. 브라우져 관계없이 자동으로 맞춰 동작하며 , 파라미터 값 주지 않아도 자동으로 된다.
 * 
 */
function winResize(w_width, w_height)
{
    var Dwidth = null;
    var Dheight = null;
  	//alert(document.body.scrollWidth+','+document.body.scrollHeight);
    if(w_width == null ||  w_width == '')
      Dwidth = parseInt(document.body.scrollWidth);
    else
      Dwidth = parseInt(w_width);

    if(w_height == null ||  w_height == '')
    	Dheight = parseInt(document.body.scrollHeight);
    else
    	Dheight = parseInt(w_height);

      var divEl = document.createElement("div");
      divEl.style.position = "absolute";
      divEl.style.left = "0px";
      divEl.style.top = "0px";
      divEl.style.width = "100%";
      divEl.style.height = "100%";

      document.body.appendChild(divEl);
//alert(Dheight);
//alert(divEl.offsetHeight);
      window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);

      document.body.removeChild(divEl);
}
  
function resizePopup(p_width,p_height) 
{
    //if(p_width == null ||  p_width == '')
	//	p_width = 350;


	//if(p_height == null ||  p_height == '')
	//	p_height = 471;

	var listBody =  document.body;
        
	// 사이즈가 지정되지 않은 경우(0)는 body 사이즈로
	if(p_width == null ||  p_width == '')
		p_width = listBody.scrollWidth;

    if(p_height == null ||  p_height == '')
		p_height = listBody.scrollHeight + 45;

	var h=0;
	if (navigator.userAgent.indexOf("SV1") > 0){  h=14; } 
	else if(navigator.userAgent.indexOf("MSIE 7") > 0) { h=35; }
	else if(navigator.userAgent.indexOf("Gecko") > 0 && navigator.userAgent.indexOf("Firefox") <= 0 && navigator.userAgent.indexOf("Netscape") <= 0 ){ h=22; } 
	else if(navigator.userAgent.indexOf("Firefox") > 0 ){  h=18; } 
	else if(navigator.userAgent.indexOf("Netscape") > 0 ){ h=-2; }
	else { h=0;} 
	  
	p_height = p_height + h;

	window.resizeTo(p_width,p_height);
}
  
function popup_resize(w,h) {
        var listBody =  document.body;
        
        var nWidth = w;
        var nHeight = h;
        var nHeightXP = 0;



        // XP인 경우 height 26 추가
        if( window.navigator.userAgent.indexOf("SV1") != -1 ) {
                nHeightXP = 28;
        }
        
        // IE7인 경우 height 50 추가
        if( window.navigator.userAgent.indexOf("MSIE 7.0") != -1 ) {
                nHeightXP = 52;
        }
        if(nHeight <= 800) {
                self.resizeTo(nWidth, nHeight + nHeightXP);
        }
} 

  
  
/**
 * @create hasa00
 * 
 * 기간 및 쿠키 값 판단해서 팝업을 띄워주는 함수
 *  
 * @param s_date 	: 팝업을 띄워줄 기간 시작일 00시 00분
 * @param e_date 	: 팝업을 띄워줄 기간 종료일 00시00분
 * @param url 		: 팝업 url
 * @param t_win 	: 셋팅할 값
 * @param ck_name 	: 체킹할 쿠키 이름(오늘은 그만 보기)
 */

function termPopupOpen(s_date, e_date, url, ck_name, s_w, s_h)
{
	var startDate = new Date(s_date.substring(0,4),s_date.substring(4,6)-1,s_date.substring(6,8));
	var today = new Date();
	var endDate = new Date(e_date.substring(0,4),e_date.substring(4,6)-1,e_date.substring(6,8));

	if(isEmpty(ck_name))
		ck_name = '_new';
	var wd = (isEmpty(s_w) ? '250' : s_w);
	var hg = (isEmpty(s_h) ? '250' : s_h);
	var param = 'toolbar=no, left=0, top=20, width='+ wd +'px, height='+ hg +'px';
	
	if (startDate < today && today < endDate) 
	{
		if(isEmpty(ck_name))
			window.open(url, ck_name, param);
		else
		{
			var eventCookie3 = getCookie(ck_name); 
			if (eventCookie3 != "no")
				window.open(url, ck_name, param);
		}
	}
	
	return;
}



/**
 * @create hasa00
 * 
 * 쿠키 값 설정하면서 창 닫기 
 *  
 * @param ck_name 	: 체킹할 쿠키 이름(오늘은 그만 보기)
 */
function popupClose(ck_name) 
{
	if(!isEmpty(ck_name))
	{
		if ( isChecked(g("noMoreToday")) )  // 체크박스 클릭시
			setCookie(ck_name, "no" , 1); // 1일간 쿠키적용
	}
    this.close();
}




/**
 * @create hasa00
 * 
 * 새창 띄우기  
 *  
 * @param ck_name 	: 체킹할 쿠키 이름(오늘은 그만 보기)
 */
function winOpen(url, t_win) 
{
	window.open(url, t_win, 'toolbar=no, left=0, top=20');
	return;
}





/**
 * @create hasa00
 * 
 * @method return object or arrayObject
 * @param name 	: 매개변수이름
 * @call getParameter('매개변수이름');
 */

function getParameter(name, tg_url)
{
	var search = tg_url;
	if(isEmpty(tg_url))
		search = window.location.search;

	if(!search)
		return "";
  
	search=search.split("?");
	
	if(search[1].indexOf(name)==(-1))
		return "";
	
	if(search[1].indexOf("&")==(-1))
	{
	    var data=search[1].split("=");
	    return data[1];
	}
	else
	{
	    data=search[1].split("&");
	    for(i=0;i<=data.length-1;i++)
	    {
	        l_data=data[i].split("=");
	        if(l_data[0]==name)
	        	return l_data[1];
	     }
	}
}


function sysCheck(s_date, e_date, msg)
{
	var startDate = new Date(s_date.substring(0,4),s_date.substring(4,6)-1,s_date.substring(6,8),s_date.substring(8,10),s_date.substring(10,12));
	var today = new Date();
	var endDate = new Date(e_date.substring(0,4),e_date.substring(4,6)-1,e_date.substring(6,8),e_date.substring(8,10),e_date.substring(10,12));
	
	if (startDate < today && today < endDate) 
	{
		alert(msg);
		return true;
	}
	else
		return false;
}

function ndrhome(pndrregionid, rurl, target)
{
	if(pndrregionid == 'RSB02')//벨소리 
		if(sysCheck('200910230100', '200910230600', '벨소리시스템 점검중입니다')) return;
	
	if(target == "new")
		ndrclick('npm1', pndrregionid, rurl, 'Y')
	else	
		ndrclick('npm1', pndrregionid, rurl, 'N')
}

function ndrclick(pndrpageid, pndrregionid, rurl, popfg)
{
	i = new Image();
	i.src =  "http://statclick.nate.com/stat/statclick.tiff?cp_url=[click_ndr.nate.com/??ndrpageid="+pndrpageid+"&ndrregionid="+pndrregionid+"]";

	if (popfg == "Y" ||popfg == "y")
		window.open(rurl);
	else
		document.location.href = rurl;
	
	i.src="";
}

function goTo(url, tg)
{
	if(tg == 'opener')
	{
		window.close(this);
		if(eval(opener))
			opener.location.href = url;
		else
			window.open(url, '', '');
	}
	else if(tg == 'parent')
	{
		window.close(this);
		if(eval(parent))
			parent.location.href = url;
		else
			window.open(url, '', '');
	}
	else if(tg == 'new')
	{
		window.open(url, '', '');
		//window.close(this);
	}
	else
	{
		//document.charset = "utf-8";
		document.location.href = url;
	}
		
}

function confirmCancel()
{
	if(!confirm("취소 하시겠습니까?"))
		return;
	window.history.back();
}

function reqLogin()
{
	alert("로그인 후 이용 가능합니다.");
	var crnt_url = get("crnt_url").value;
	document.location.href='http://xo.nate.com/login.jsp?redirect='+crnt_url;
}


/*
//ord
function goEventDtl(evnt_id)
{
	var url = "http://mobile.nate.com/board/e_view.html";
	var param = "?code="+evnt_id;
	goTo(url+param, null);
	return;
}
	
function goEventList()
{
	var url = "http://mobile.nate.com/board/e_list.html";
	goTo(url);
	return;
}

function goNoticeDtl(noti_id)
{
	var url = "http://mobile.nate.com/board/en_view.html";
	var param = "?artid="+noti_id+"&page=1&type=2";
	goTo(url+param, null);
	return;
}

function goNoticeList()
{
	var url = "http://mobile.nate.com/board/en_list.html";
	goTo(url);
	return;
}
*/
//new
function goEventDtl(code, type, page)
{
	var url = "http://mobile.nate.com/notice/eventView";
	var param = "?type="+type+"&code="+code+"&page="+page;
	goTo(url+param, null);
	return;
}
function goNoticeDtl(artid, page)
{
	var url = "http://mobile.nate.com/notice/noticeView";
	var param = "?artid="+artid+"&page="+page;
	goTo(url+param, null);
	return;
}

function goEventView(type, code, page)
{
	var url = "http://mobile.nate.com/notice/eventView";
	var param = "?type="+type+"&code="+code+"&page="+page;
	goTo(url+param, null);
	return;
}

function goEventList(type, page)
{
	var url = "http://mobile.nate.com/notice/eventList";
	var param = "?type="+type+"&page="+page;
	goTo(url+param, null);
	return;
}

function goNoticeView(artid, page)
{
	var url = "http://mobile.nate.com/notice/noticeView";
	var param = "?artid="+artid+"&page="+page;
	goTo(url+param, null);
	return;
}

function goNoticeList(page)
{
	var url = "http://mobile.nate.com/notice/noticeList";
	var param = "?page="+page;
	goTo(url+param, null);
	return;
}








function blogin(){
	self.close();
	opener.location.href='http://xso.nate.com/login.jsp?redirect=http://mobile.nate.com';
}
function loginnauth(){
    alert('유무선 인증을 받아야 합니다');	
    window.open('http://member.nate.com/sccustomer/join/nate/modify/AddMobile.jsp?ispop=Y&succURL=http://mobile.nate.com/event/pop/mpop_080602.html','a','width=10,height=10,toolbar=0,scrollbars=no');
	self.close();
	//location.href='/';
}

function popupFreeItem(item_id){
	window.open('/freeItem/apply?item_id=' + item_id,'popup_free_item_apply','width=450,height=600,scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no');	
}

