//===========================================================================
// URL (ÀÌºÎºÐÀº ·ÎÄÃ°ú ¼³Á¤ÀÌ ´Ù¸¨´Ï´Ù. ¾÷·Îµå½Ã Ç×»ó È®ÀÎÇÏ¼¼¿ä)
//===========================================================================
var NOR_URL = "http://www.brandlove.co.kr";
var SSL_URL = "https://www.brandlove.co.kr";

// ±Ý¾× Ç¥ÇöÀ¸·Î º¯°æ
function number_format(f) {
	var len;
	var str = "" + f;
	str = str.replace(/,/g,'');
	var str1 = '';
	len = str.length;
	if(len > 3) {
		for(var i=0; len-i-3>0; i+=3) {
			str1 = "," + str.substring(len-3-i, len-i) + str1;
		}
		str1 = str.substring(0, len-i) + str1;
		f = str1;
	}
	return f;
}

// ÀÚ¸®¼ö¸¸Å­ Àý»è
function numeber_floor(f, idx) {
	if(idx == 0) {
		return Math.floor(f);
	} else {
		return (Math.floor(parseFloat(f) * (0.1)*parseFloat(idx))) * 10*parseFloat(idx);
	}
}

//******************************************************************************************************/
// MethodName : windowopennew
// Parameter  : urlname(var), width(var), height(var), scroll(Boolean), toppix, leftpix, winname 
// Returnvalue: null
// Function   : window name open(¼­·Î °¢±â ´Ù¸¥ Ã¢À¸·Î ¶°¾ß ÇÒ¶§ ¾²ÀÎ´Ù.)
// topfix,leftfix ¿¡ null ¶Ç´Â 0ÀÌ µé¾î¿À¸é.. ÆäÀÌÁö´Â Áß¾ÓÁ¤·Ä..
//******************************************************************************************************/			
function windowopen(urlname, width, height, scroll, toppix, leftpix,  winname) {
	var status = "yes";
	if(!toppix)
		toppix	= (screen.height - height) / 2;
	if(!leftpix)
		leftpix	= (screen.width - width) / 2;
	var strscroll = "width=" + width + ", height=" + height + ",top=" + toppix + ",left=" + leftpix + ",status=" + status;
	if(scroll)
		strscroll = strscroll + ", scrollbars=yes";
	window.open(urlname, winname, strscroll);
}
function getObject(objectId) { 
	// checkW3C DOM, then MSIE 4, then NN 4. 
	if(document.getElementById && document.getElementById(objectId)) { 
		return document.getElementById(objectId); 
	} else if (document.all && document.all(objectId)) { 
		return document.all(objectId); 
	} else if (document.layers && document.layers[objectId]) { 
		return document.layers[objectId]; 
	} else { 
		return false; 
	} 
} 
function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
function doCheckAll(formname, checkbox, startidx){
	// check ½ÃÀÛ index
	if(!startidx) startidx = 0;
	var el = window.event.srcElement;
	if( el.type == 'checkbox' ){
		_checked = el.checked;
	} else { 
		if( el.getAttribute("checked") == null ) el.setAttribute("checked",false);
		el.setAttribute("checked", !el.getAttribute("checked"));
		_checked = el.getAttribute("checked");
	}
	
	if ($(formname)(checkbox) == null){
		return;
	} else if(typeof($(formname)(checkbox).length) == "undefined") {
		if(el.checked) {
			$(formname)(checkbox).checked = true;
		} else{
			$(formname)(checkbox).checked = false;
		}
	} else {
		if(el.checked) {
			for(i=0; i<$(formname)(checkbox).length; i++) {
				$(formname)(checkbox)[i].checked = true;
			}
		} else{
			for(i=0; i<$(formname)(checkbox).length; i++) {
				$(formname)(checkbox)[i].checked = false;
			}
		}
	}
}



/************************************************************************************************
' Procedure	: openIframe
' Description	: iframe ¿¡ ÆäÀÌÁöÈ£Ãâ
' Parameter	: name[iframe id], oURL[È£ÃâµÉ ÆäÀÌÁö ÁÖ¼Ò]
'************************************************************************************************/
function cfOpenIframe(name,oURL){
	try {
		var obj = getObject(name);
		obj.src=oURL;
		obj.style.display="";
		if( obj.getAttribute("resized") == null){
			cfResizeIframe(name);
			obj.setAttribute("resized","true");
		}
	} catch(e) { alert(e.message); }
}

/************************************************************************************************
' Procedure	: resizeIframe
' Description	: iframe »çÀÌÁî µ¿ÀûÁ¶Á¤
' Parameter	: frameid[iframe id]
'************************************************************************************************/
function cfResizeIframe(frameid){
	var currentfr=document.getElementById(frameid)
	if (currentfr && !window.opera){
			currentfr.style.display="block"
			if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
				currentfr.height = currentfr.contentDocument.body.offsetHeight;
			else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
				currentfr.height = currentfr.Document.body.scrollHeight;
			if (currentfr.addEventListener)
				currentfr.addEventListener("load", readjustIframe, false)
			else if (currentfr.attachEvent)
				currentfr.attachEvent("onload", readjustIframe)
	}
}

/************************************************************************************************
' Procedure	: readjustIframe
' Description	: iframe »çÀÌÁîº¯È­½Ã È£Ãâ
' Parameter	: loadevt
'************************************************************************************************/
function readjustIframe(loadevt) {
	var crossevt=(window.event)? event : loadevt
	var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
	if (iframeroot)
		cfResizeIframe(iframeroot.id);
}

/************************************************************************************************
' Procedure	: resizeInIframe
' Description	: iframe ³»ºÎ¿¡¼­ »çÀÌÁîº¯È­½Ã È£Ãâ
' Parameter	:
'************************************************************************************************/
function cfResizeInIframe() {
	var heightDoc = document.body.scrollHeight;
	var widthDoc = document.body.scrollWidth;
	document.body.style.width = widthDoc;
	document.body.style.Height = heightDoc;
}

/************************************************************************************************
' Procedure	:
' Description	: ¹Ì´Ï¼¥¿ë ¾ÆÀÌÇÁ·¹ÀÓ ¸®»çÀÌÁî
' Parameter	:
'************************************************************************************************/
// iframe resize
var IE = false ;
if (window.navigator.appName.indexOf("Explorer") !=-1)
{
	IE = true;
}

// Iframe ³»¿¡¼­ È£ÃâÇÏ¿© ÆäÀÌÁö ³ôÀÌ¸¦ ¸ÂÃá´Ù.
function cfPaperInit(minHeight)
{
	try
	{
		self.name="bodyfr";
		var timeArray = new Array(200, 500, 1500, 3500, 7000, 12000, 20000);
		//alert("1cfPaper3Init, timeArray.length="+timeArray.length);
		for(var i=0; i < timeArray.length; i++) {
			setTimeout('cfPaper3Init(\''+minHeight+'\')', timeArray[i]);
		}
		/*
		if(self.name!=null && self.name=="bodyfr")
		{
			parent.window.scrollTo(0,0);
		}*/
	}catch (e) {}
	// ¶óÀÎ¸Ê ÀÛ¼º
	try {
		var str =  "";
		if (lineMap != null) {
			str = lineMap;
		}
		parent.document.all.lineMapString.innerHTML = str;
	} catch (e) {}
}

// ¿ä¾à±Û¿¡¼­ È£Ãâ.
function cfPaperInitMore(minHeight)
{
	try
	{
		self.name="mainFrame";
		var timeArray = new Array(200, 500, 1500, 3500, 7000, 12000, 20000);
		//alert("1cfPaper3Init, timeArray.length="+timeArray.length);
		for(var i=0; i < timeArray.length; i++)
			setTimeout('cfPaper3Init(\''+minHeight+'\')', timeArray[i]);
	}catch (e) {}
}

// Iframe ³»¿¡¼­ È£ÃâÇÏ¿© ÆäÀÌÁö ³ôÀÌ¸¦ ¸ÂÃá´Ù.
// ÃÖ´ë ÇÏÀ§ 3´Ü±îÁö¸¸ ¸®»çÀÌÂ¡À» ÇÏµµ·Ï ÇÑ´Ù.
function cfPaper3Init(minHeight)
{
	try
	{
		//	alert("2cfPaper3Init");
		if(minHeight==null) minHeight = 0;

		if (self.name!=null && self.name!="" && parent!=null
	    	&& parent.cfResizeIframe!=null)
	    {
	        parent.cfResizeIframe(self.name, minHeight);
	    }

		if (parent.name!=null && parent.name!=""
			&& (parent.name=="bodyfr" || parent.name=="mainFrame")
	    	&& parent.parent!=null && parent.parent.cfResizeIframe!=null && parent.parent.cfPaper3Init!=null)
	    {
	        parent.parent.cfResizeIframe(parent.name, minHeight);
	    }

		if (parent.parent.name!=null && parent.parent.name!=""
			&& (parent.parent.name=="bodyfr" || parent.parent.name=="mainFrame")
	    	&& parent.parent.parent!=null && parent.parent.parent.cfResizeIframe!=null && parent.parent.parent.cfPaper3Init!=null)
	    {
	        parent.parent.parent.cfResizeIframe(parent.parent.name, minHeight);
	    }
	}catch (e) {}
}

// Á÷Á¢»ç¿ëÀº ±ÝÇÔ. cfPaperInit()¸¦ »ç¿ëÇÒ°Í.
function cfResizeIframe(name, minHeight)
{
	//alert("cm_resizeIframe, name="+name);
	if(minHeight==null) minHeight = 0;
    if(name==null || name=="") return;

    try
    {
        if (IE)
            var oBody = document.frames(name).document.body;
		else
            var oBody = document.getElementById(name).contentDocument.body;

		var oIFrame = document.getElementById(name);

        var frmWidth  = oBody.scrollWidth;// + (oBody.offsetWidth - oBody.clientWidth);
        var frmHeight = oBody.scrollHeight;// + (oBody.offsetHeight - oBody.clientHeight);

		if(name=="bodyfr" || name=="mainFrame")
		{
			if(frmHeight >= 300)
				oIFrame.style.height = frmHeight;
			else
				oIFrame.style.height = 300;

			var oOpacityDiv = document.getElementById("opacityDiv");
			if(oOpacityDiv!=null)
			{
				oOpacityDiv.style.height = parseInt(oIFrame.style.height) + 200;
			}
		}
		else
		{
			oIFrame.style.height = frmHeight;
		}

    }catch (e) {}
}
/************************************************************************************************
' Procedure	:
' Description	: ¹Ì´Ï¼¥¿ë ¾ÆÀÌÇÁ·¹ÀÓ ¸®»çÀÌÁî ³¡
' Parameter	:
'************************************************************************************************/


/************************************************************************************************
' Procedure	: popupInit
' Description	: ÆË¾÷Ã¢ ÃÊ±âÈ­
					  body ÀÇ Ã¹ table ÀÇ width ¸¦ ±âÁØÀ¸·Î ÆË¾÷Ã¢ÀÇ »çÀÌÁî¸¦ Á¶Á¤ÇÑ´Ù.
					  table id°¡ "popup"ÀÎ Å×ÀÌºíÀÌ ÇØ´çÆäÀÌÁö¿¡ ÀÖÀ» °æ¿ì popup Å×ÀÌºíÀÇ »çÀÌÁî¸¦ ±âÁØÀ¸·Î Á¶Á¤ÇÔ
					  dbg°¡ true ÀÏ°æ¿ì popup Å×ÀÌºíÀÇ »çÀÌÁî¸¦ alertÃ¢À¸·Î º¸¿©ÁÜ(µð¹ö±ë¿ë)
' Parameter	: dbg [boolean °ª]
'************************************************************************************************/
function cfPopupInit(dbg) {
	try {
		var tblEl = document.getElementsByTagName("TABLE")[0];
		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);
		window.resizeBy(tblEl.offsetWidth-divEl.offsetWidth, tblEl.offsetHeight-divEl.offsetHeight);
		if(dbg) { alert("width:"+(tblEl.offsetWidth)+", height:"+(tblEl.offsetHeight)) };
		document.body.removeChild(divEl);
	} catch(e) {
		alert(e.message);
	}
}

function cfPopupInitForDiv(dbg) {
	try {
		var tblEl = document.getElementsByTagName("DIV")[0];
		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);
		window.resizeBy(tblEl.offsetWidth-divEl.offsetWidth, tblEl.offsetHeight-divEl.offsetHeight);
		if(dbg) { alert("width:"+(tblEl.offsetWidth)+", height:"+(tblEl.offsetHeight)) };
		document.body.removeChild(divEl);
	} catch(e) {
		alert(e.message);
	}
}

function showImagePop(imgSrc) {
	windowopen("/admin/common/ShowImage.php?imgSrc=" + imgSrc, 400, 400, true, 50, 0, "ImageShow");
}


/*****************************************************************************

 * ¼³¸í   :ÁÖ¹Î¹øÈ£/¿Ü±¹ÀÎ/»ç¾÷ÀÚµî·Ï¹øÈ£ À¯È¿¼º Ã¤Å©

 * String strNo1 : ÁÖ¹Îµî·Ï¹øÈ£ ¶Ç´Â ¿Ü±¹ÀÎ ¹øÈ£ ¾Õ 6ÀÚ¸® ¶Ç´Â ÃÑ 13ÀÚ¸®

                   »ç¾÷ÀÚ µî·Ï¹øÈ£ 10ÀÚ¸®

 * String strNo2 : ÁÖ¹Îµî·Ï¹øÈ£ ¶Ç´Â ¿Ü±¹ÀÎ ¹üÈ£ µÞÀÚ¸® 7ÀÚ¸®

 * RETURN boolean: À¯È¿¼ºÀÌ ¸Â´Ù¸é true, Æ²·È´Ù¸é false

 * ¿¹) var bResult = checkIDNumber('7704111122334')

 *     var bResult = checkIDNumber('770411,1122816')

 *****************************************************************************/

function checkNumber(strNo1, strNo2)

{

    var retValue = false;
    var strTempNo;
    var strSex;

    if(strNo1.length == 13)
    {
        strTempNo = strNo1;
        strSex = strNo1.substring(6,7) ;
        alert(strSex);
        if(strSex  == '1' || strSex == '2' || strSex =='3' || strSex == '4')
        { 
            retValue = isJuminNo(strTempNo);
        }
        else // ¿Ü±¹ÀÎ 
        {
            retValue = isFgnNo(strTempNo);
        }
    }
    else
    {
        if(strNo1.length != 10)
        {
            strSex = strNo1.substring(1,2) ;
            alert(strSex);
            if(strSex  == '1' || strSex == '2' || strSex =='3' || strSex == '4')
            {
                retValue = isJuminNo(strNo1, strNo2);
            }
            else
            {
                retValue = isFgnNo(strNo1);
            }
        }
        else // »ç¾÷ÀÚµî·Ï¹øÈ£ À¯È¿¼º
        {
            retValue = check_busino(strNo1);
        }
    }
    return retValue;
}


// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å© 
function check_busino(vencod) 
{ 
    var sum = 0; 
    var getlist = new Array(10); 
    var chkvalue =new Array("1","3","7","1","3","7","1","3","5"); 

    try
    {
        for(var i=0; i<10; i++) 
        { 
            getlist[i] = vencod.substring(i, i+1); 
        } 
        for(var i=0; i<9; i++) 
        { 
            sum += getlist[i]*chkvalue[i]; 
        } 
        sum = sum + parseInt((getlist[8]*5)/10); 
        sidliy = sum % 10; 
        sidchk = 0; 

        if(sidliy != 0)
        { 
            sidchk = 10 - sidliy; 
        } 
        else 
        {
            sidchk = 0; 
        } 
        if(sidchk != getlist[9]) 
        { 
            return false; 
        } 
        return true; 
    }
    catch(e)
    {
        return false;
    }
} 

 

// Àç¿Ü±¹ÀÎ ¹øÈ£ Ã¼Å© 

function isFgnNo(fgnno) 
{ 
    var sum=0; 
    var odd=0; 
    buf = new Array(13); 
    try
    {
        for(i=0; i<13; i++) 
        { 
            buf[i]=parseInt(fgnno.charAt(i));   
        } 
        odd = buf[7]*10 + buf[8]; 
        if(odd%2 != 0) 
        { 
            return  false; 
        } 
        if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) 
        { 
                return false; 
        } 
        multipliers = [2,3,4,5,6,7,8,9,2,3,4,5]; 
        for(i=0, sum=0; i<12; i++)
        { 
            sum +=  (buf[i] *= multipliers[i]); 
        } 
        sum = 11 - (sum%11); 

        if(sum >= 10) 
        {   
            sum -= 10; 
        } 
        sum += 2; 
        if(sum >= 10)
        {
            sum -= 10; 
        } 
        if(sum != buf[12]) 
        { 
            return  false 
        }   
        return true; 
    }
    catch(e)
    {
        return false;
    }
} 

 

//ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©

function isJuminNo(strValue1, strValue2){

    var str_f_num;
    var str_l_num;
    try
    {
        if(strValue1.length == 13)
        {
            str_f_num = strValue1.substring(0,6);
            str_l_num = strValue1.substring(6);
        }
        else
        {
            str_f_num = strValue1;
            str_l_num = strValue2;
        }

        var i3=0
        for (var i=0;i<str_f_num.length;i++){
         var ch1 = str_f_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i3=i3+1;
        }
        if ((str_f_num == '') || ( i3 != 0 )) return false;
        var i4=0;
        for (var i=0;i<str_l_num.length;i++){
            var ch1 = str_l_num.substring(i,i+1);
            if (ch1<'0' || ch1>'9') i4=i4+1; 
        }
        if ((str_l_num == '') || ( i4 != 0 )) return false;
        if(str_f_num.substring(0,1) < 4) return false;
        if(str_l_num.substring(0,1) > 2) return false;
        if((str_f_num.length > 7) || (str_l_num.length > 8)) return false;
        if ((str_f_num == '72') || ( str_l_num == '18'))  return false;
               
        var f1=str_f_num.substring(0,1)
        var f2=str_f_num.substring(1,2)
        var f3=str_f_num.substring(2,3)
        var f4=str_f_num.substring(3,4)
        var f5=str_f_num.substring(4,5)
        var f6=str_f_num.substring(5,6)
        var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7
        var l1=str_l_num.substring(0,1)
        var l2=str_l_num.substring(1,2)
        var l3=str_l_num.substring(2,3)
        var l4=str_l_num.substring(3,4)
        var l5=str_l_num.substring(4,5)
        var l6=str_l_num.substring(5,6)
        var l7=str_l_num.substring(6,7)
        hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5
        hap=hap%11
        hap=11-hap
        hap=hap%10
        if (hap != l7) return false;
        return true; 
    }
    catch(e)
    {
        return false;
    }
}

 
// ¼¿·ºÆ®¹Ú½º(ÄÞº¸¹Ú½º)¿¡ ¼±ÅÃÇÏ±â
function selectComboBox(el,val) {
	for (var i=0; i<el.length; i++)
	{
		if (el[i].value == val)
		{
			el[i].selected = true;
		}
	}
}

// ¾Õ¿¡ 0 ºÙÀÌ±â
function addZero(val,num) {
	str = val+"";
	if (str.length < num)
	{
		for (var i=0; i<num-1; i++)
		{
			str = "0"+str;
		}
	}
	return str;
}
//***************************************************************************
//===========================================================================
// ¿À´Ãº» »óÇ° °ü·Ã ½ºÅ©¸³Æ®
//===========================================================================
//***************************************************************************
var todayPrd = new Object();
var todayPrdArray = new Array();

// ¸Ç¾ÕÀÇ ÇÑ°³ »èÁ¦
function delTodayPrdFirst(str) {
	if (str.indexOf("@e7@") <= 0)
	{
		str = "";
	} else {
		str = str.substring(str.indexOf("@e7@")+4,str.length);
	}
	return str;
}

// ¿À´Ãº»»óÇ° ¹è¿­À» ¹Þ¾Æ¼­ ½ºÆ®¸µÀ¸·Î ¹ÝÈ¯ (±¸ºÐÀÚ @e7@)
function todayArrayToStr(arr) {
	var str="";
	if (arr==null || arr.length==null) {
		return "";
	} else {
		for (var i=0; i<arr.length; i++)
		{
			if (i>0)
			{
				str+="@e7@";
			}
			str+=arr[i];
		}
	}
	return str;
}

// ¿À´Ãº» »óÇ° ÄíÅ°¿¡ ÀúÀå
function putTodayPrd(prdid,prdnm) {
	var str = Cookie.read("TODAYPRD");
	var today = new Date();
	if (prdnm.length>5)
	{
		prdnm = prdnm.substring(0,5);
	}
	if (str != null)
	{
		var _tmp = str.split("@e7@");
		if (_tmp.length!=null && _tmp.length>9)
		{
			// ¿­°³°¡ ³ÑÀ¸¸é ¸Ç¾ÕÀÇ ÇÑ°³ »èÁ¦
			str = delTodayPrdFirst(str);
		}
		var newarr = new Array();
		var newi = 0;
		for (var i=0;i<_tmp.length ;i++ )
		{
			_prd=_tmp[i].split("@p@");
			diff = today.getTime()-_prd[2];
			difference = Math.floor( diff / (1000 * 60 * 60 * 24) );
			if (difference >= 1)
			{
				// ³¯Â¥°¡ ÇÏ·çÀÌ»ó Áö³­ °ÍÀº »èÁ¦ÇÑ´Ù.
				//alert("ÇÏ·çÁö³ª¼­ »èÁ¦");
				//str = delTodayPrdFirst(str);
			} else if (_prd[0] == prdid) {
				// »õ·Î µî·ÏÇÏ·Á´Â °Í°ú °°Àº°Íµµ »èÁ¦ÇÑ´Ù.
				//alert("µ¿ÀÏÇÑ°Í »èÁ¦");
				//str = delTodayPrdFirst(str);
			} else {
				// »¬°Í»©°í ¾È»©µµ µÉ°Í¸¸ ´õÇØ¼­ ¸¸µç´Ù..
				newarr[newi] = _tmp[i];
				newi++;
			}
		}
	}
	str=todayArrayToStr(newarr);

	if (str == "" || str == null || str == 'null')
	{
		str = prdid+"@p@"+prdnm+"@p@"+today.getTime();
	} else {
		str += "@e7@"+prdid+"@p@"+prdnm+"@p@"+today.getTime();
	}
	Cookie.write("TODAYPRD",str,{duration:1});
}
//alert(Cookie.read("TODAYPRD"));
//***************************************************************************
//===========================================================================
// ¸µÅ© ÀÌµ¿ ½ºÅ©¸³Æ®
//===========================================================================
//***************************************************************************
function goPreLoginCheck(id) {
	if (id==null) {
		alert("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ¼¼¿ä.");
		return false;
	} else {
		return true;
	}
}
//===========================================================================
// °øÅë
//===========================================================================
// È¨
function goHome() {
	location.href=NOR_URL+"/";
}
// ·Î±×ÀÎ
function login() {
	location.href=NOR_URL+"/login.php";
}
// ·Î±×¾Æ¿ô
function logout() {
	location.replace(NOR_URL+"/login.php?method=logout");
}
// È¸¿ø°¡ÀÔ
function joinMember() {
	//location.href=NOR_URL+"/memberpre.php";
	location.href=NOR_URL+"/member01.php?jointype=01";
}
// ¿ìÆí¹øÈ£Ã£±â
// == ¸ðµç °ªÀº ÅØ½ºÆ®·Î ³Ñ±æ°Í (object°¡ ¾Æ´Ï¶ó... È¦µû¿ÈÇ¥ ÇÒ°Í)
// frmname : ÆûÀÌ¸§
// zip1 : ¿ìÆí¹øÈ£ Ã¹¹øÂ° ¿¤¸®¸ÕÆ®ÀÌ¸§
// zip2 : ¿ìÆí¹øÈ£ µÎ¹øÂ° ¿¤¸®¸ÕÆ®ÀÌ¸§
// addr1 : ÁÖ¼Ò Ã¹¹øÂ° ¿¤¸®¸ÕÆ®ÀÌ¸§
function goZipCode(frmname,zip1,zip2,addr1) {
	windowopen(NOR_URL+"/member_post.php?frmname="+frmname+"&zip1="+zip1+"&zip2="+zip2+"&addr1="+addr1, 500, 400, true, 50, 50,  "zipcodepop");
}
// ID/PWÃ£±â ÆË¾÷
function goIDPWSearch() {
	windowopen(NOR_URL+"/idpwsearch.php", 450, 475, false, 50, 50,  "idpwsearchpop");
}
//===========================================================================
// »óÇ°
//===========================================================================
// »óÇ°»ó¼¼·Î ÀÌµ¿
function goProductDtl(prdid) {
	location.href=NOR_URL+"/productdetail.php?productId="+prdid;
}
// À§½Ã¸®½ºÆ®¿¡ ´ã±â
function putWishList(id, prdId) {
	if (!goPreLoginCheck(id)) return;
	actionframe.location.href=NOR_URL+"/mypageproc.php?method=putwishlist&productid="+prdId;
}
// »óÇ°ÀÌ¹ÌÁö Å©°Ôº¸±â
function showImagePop(imgSrc) {
	windowopen(NOR_URL+"/zoomproduct.php?imgSrc=" + imgSrc,  520, 680, false, 10, 10, "ImageShow");
}
// ÄíÆù´Ù¿î·ÎµåÆË¾÷
function openGetCoupon(id) {
	windowopen(NOR_URL+"/popgetcoupon.php?productId=" + id,  600, 400, false, 10, 10, "couponget");
}
// »çÀÌÁîº¸±â ÆË¾÷
function showSizeSpec(productid,categoryid) {
	windowopen(NOR_URL+"/sizespec.php?productID=" + productid + "&categoryID=" + categoryid,  600, 400, false, 10, 10, "sizespec");
}
// »óÇ°¹®ÀÇ·ÎÀÌµ¿
function goProductQuestion(prdid) {
	location.href=NOR_URL+"/deskproductques.php?method=regform&productId="+prdid;
}

//===========================================================================
// ¸¶ÀÌÆäÀÌÁö
//===========================================================================
// ¸¶ÀÌÆäÀÌÁö·Î ÀÌµ¿
function goMypage(id) {
	//if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypage.php";
}
// ¸¶ÀÌÆäÀÌÁö ÁÖ¹®³»¿ª
function goMypageOrderList(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderlist.php";
}
// ¸¶ÀÌÆäÀÌÁö ÁÖ¹®³»¿ª»ó¼¼
function goMypageOrderDtl(id,ordernum) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderdtl.php?orderNum="+ordernum;
}
// ¸¶ÀÌÆäÀÌÁö Ãë¼Ò³»¿ª»ó¼¼
function goCancelOrderDtl(id,ordernum) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageordercancel.php?method=orderdtl&orderNum="+ordernum;
}
// ¸¶ÀÌÆäÀÌÁö ¹ÝÇ°³»¿ª»ó¼¼
function goReturnOrderDtl(id,ordernum) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderreturn.php?method=orderdtl&orderNum="+ordernum;
}
// ¸¶ÀÌÆäÀÌÁö ±³È¯³»¿ª»ó¼¼
function goExchangeOrderDtl(id,ordernum) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderexchange.php?method=orderdtl&orderNum="+ordernum;
}
// ¸¶ÀÌÆäÀÌÁö À§½Ã¸®½ºÆ®
function goMypageWishList(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagewishlist.php";
}
// ¸¶ÀÌÆäÀÌÁö ¿À´Ãº»»óÇ°
function todaysview() {
	goMypageTodaysView();
}
function goMypageTodaysView() {
	location.href=NOR_URL+"/mypagetodaysview.php";
}
// ¸¶ÀÌÆäÀÌÁö Ãë¼Ò¿äÃ»¸ñ·Ï
function goMypageCancelList(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageordercancel.php";
}
// ¸¶ÀÌÆäÀÌÁö ¹ÝÇ°¿äÃ»¸ñ·Ï
function goMypageReturnList(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderreturn.php";
}
// ¸¶ÀÌÆäÀÌÁö ±³È¯¿äÃ»¸ñ·Ï
function goMypageExchangeList(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageorderexchange.php";
}
// ¸¶ÀÌÆäÀÌÁö ¸¶ÀÏ¸®Áö³»¿ª
function goMypageMileage(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagemileage.php";
}
// ¸¶ÀÌÆäÀÌÁö ÄíÆù³»¿ª
function goMypageCoupon(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagecoupon.php";
}
// ¸¶ÀÌÆäÀÌÁö È¸¿øÁ¤º¸º¯°æ
function goMypageMemberInfo(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagememberinfo.php";
}
// ¸¶ÀÌÆäÀÌÁö È¸¿øÅ»Åð½ÅÃ»
function goMypageMemberSecede(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagemembersecede.php";
}
// ¸¶ÀÌÆäÀÌÁö È¯ºÒ°èÁÂ
function goMypageAccount(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypageaccount.php";
}
// ¸¶ÀÌÆäÀÌÁö ÀçÁÖ¹®
function goMypageReorder(id) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagereorderlist.php";
}
// ¸¶ÀÌÆäÀÌÁö ÀçÁÖ¹® °áÁ¦Æû
function goMypageResettle(id, ordernum) {
	if (!goPreLoginCheck(id)) return;
	location.href=NOR_URL+"/mypagesettleform.php?orderNum=" + ordernum;
}
// ¸¶ÀÌÆäÀÌÁö ÁÖ¹®/¹ÝÇ°/Ãë¼Ò ÀÐ¾îº¸±â
function goCancelReadPop() {
	windowopen(NOR_URL+"/mypageordercancelread.php",  585, 490, false, 10, 10, "cancelread");
}
// Àå¹Ù±¸´Ï
function goCart(id) {
	location.href=NOR_URL+"/cart.php";
}
// ÀÌº¥Æ®(±âÈ¹Àü)À¸·Î ÀÌµ¿
function goEvent(planID) {
	if (planID!=null && planID!='')
	{
		location.href=NOR_URL+"/event.php?planID="+planID;
	}
}
// ºñÈ¸¿øÁÖ¹®È®ÀÎ
function goNonMemberOrder() {
	location.href=NOR_URL+"/login.php?method=orderlogin";
}
// ¹è¼ÛÇöÈ²Á¶È¸ÆË¾÷
function goDeliveryPop(orderItemID) {
	windowopen(NOR_URL+"/mypagepopupdelivery.php?orderItemID="+orderItemID,  585, 490, false, 10, 10, "delivery");
}
//===========================================================================
// °í°´¼¾Å¸
//===========================================================================
// °í°´¼¾Å¸ °øÁö»çÇ×
function goDeskNotice() {
	location.href=NOR_URL+"/desknotice.php";
}
// °í°´¼¾Å¸ °øÁö»çÇ×
function goDeskNotice() {
	location.href=NOR_URL+"/desknotice.php";
}
// °í°´¼¾Å¸ 1:1¹®ÀÇ
function goDeskOneToOne() {
	location.href=NOR_URL+"/deskonetoone.php";
}
// °í°´¼¾Å¸ ÀÌ¸ÞÀÏ¹®ÀÇ
function goDeskEmail() {
	location.href=NOR_URL+"/deskemail.php";
}
// °í°´¼¾Å¸ ÀÚÁÖ¹¯´ÂÁú¹®
function goDeskFAQ() {
	location.href=NOR_URL+"/deskfaq.php";
}
// °í°´¼¾Å¸ Á¦ÈÞ¹®ÀÇ
function goDeskCoop() {
	location.href=NOR_URL+"/deskcoop.php";
}
// °í°´¼¾Å¸ »óÇ°¹®ÀÇ
function goDeskProd() {
	location.href=NOR_URL+"/deskproductques.php";
}
// °í°´¼¾Å¸ ÀÌº¥Æ®°Ô½ÃÆÇ
function goDeskEvent() {
	location.href=NOR_URL+"/deskevent.php";
}

