/* ¿À´Ã º» »óǰ-> Àå¹Ù±¸´Ï À̵¿ ÇÔ¼ö(´ÜÀÏ) */ function mvTodayproduct2Cart(product_no, product_price){ window.ProductHistoryAjax = new Ajax(); ProductHistoryAjax.Method = "POST"; ProductHistoryAjax.Action = "/cart/ajax.cart.php"; ProductHistoryAjax.addParam("Mode", "addCart"); ProductHistoryAjax.addParam("product_no", product_no); ProductHistoryAjax.addParam("product_price", product_price); ProductHistoryAjax.addParam("product_cnt", 1); ProductHistoryAjax.addParam("option_text", ''); ProductHistoryAjax.addParam("option_code", ''); ProductHistoryAjax.addParam("Ajax", 'Y'); ProductHistoryAjax.onError = function(errno, error){alert("´ÙÀ½°ú °°Àº ¿À·ù°¡ ¹ß»ýÇÏ¿© ¿äûÇϽŠÀÛ¾÷À» ¼öÇàÇÒ ¼ö ¾ø½À´Ï´Ù.\nERR-" + errno + " : " + error );} ProductHistoryAjax.onComplete = function(strText){ if(strText.indexOf("Error:") == 0){alert(strText.replace(/Error:/, ''));}else{ rmTodayproduct( ProductHistoryAjax.getParam('product_no') ); alert("Àå¹Ù±¸´Ï¿¡ ÇØ´ç »óǰÀ» Ãß°¡ÇÏ¿´½À´Ï´Ù."); window.parent.location.reload(); } } ProductHistoryAjax.submit(); } /* ¿À´Ã º» »óǰ-> Àå¹Ù±¸´Ï À̵¿ ÇÔ¼ö */ function mvTodaysToCarts(sType){ /* var elements= document.getElementsByName(elementName); var List = getCookie('ProductHistory').split(','); var Checks = new Array(0); var NewList = new Array(0); var nIndex = 0, n = 0; var isDeleted= false;*/ } /* ¿À´Ã º» »óǰ ´ÜÀÏ »èÁ¦ */ function rmTodayproduct(product_no, cell){ var ProductHistoryList = getCookie('TodayProductHistory').split(','); var ArrTemp = new Array(0); var nCount = 0; for(var i = 0; i < ProductHistoryList.length; i++){ var sLine = ProductHistoryList[i]; if(sLine == '') continue; var Row = sLine.split('|'); if(Row[0] != product_no){ nCount++; ArrTemp.push(ProductHistoryList[i]); } } ProductHistoryList = ""; ProductHistoryList = ArrTemp.toString() ProductHistoryList = ProductHistoryList.replace(/^([,]+)/, ''); ProductHistoryList = ProductHistoryList.replace(/([,]+)$/, ''); setCookie('TodayProductHistory',ProductHistoryList, 1); if(cell != null){ if(typeof(cell) == 'string'){ if(document.getElementById(cell) !== null) cell = document.getElementById(cell); } if(typeof(cell) == 'object'){ if(cell.tagName.toLowerCase() == 'img') cell.parentNode.parentNode.removeNode(true); if(cell.tagName.toLowerCase() == 'td') cell.parentNode.removeNode(true); } if(document.getElementById('xwzTodayFrameCount') != null){ document.getElementById('xwzTodayFrameCount').innerText = nCount; } } } function rmTodayproductNew(product_no, cell){ var ProductHistoryList = getCookie('TodayProductHistory').split(','); var ArrTemp = new Array(0); var nCount = 0; for(var i = 0; i < ProductHistoryList.length; i++){ var sLine = ProductHistoryList[i]; if(sLine == '') continue; var Row = sLine.split('|'); if(Row[0] != product_no){ ArrTemp[nCount] = ProductHistoryList[i]; nCount++; } } ProductHistoryList = ArrTemp.toString() ProductHistoryList = ProductHistoryList.replace(/^([,]+)/, ''); ProductHistoryList = ProductHistoryList.replace(/([,]+)$/, ''); setCookie('TodayProductHistory',ProductHistoryList, 1); if(cell != null){ if(typeof(cell) == 'string'){ if(document.getElementById(cell) !== null) cell = document.getElementById(cell); } if(typeof(cell) == 'object'){ if(cell.tagName.toLowerCase() == 'img') cell.parentNode.parentNode.removeNode(true); if(cell.tagName.toLowerCase() == 'td') cell.parentNode.removeNode(true); if(cell.tagName.toLowerCase() == 'span') { cell.parentNode.parentNode.parentNode.removeNode(true); } } if(document.getElementById('xwzTodayFrameCount') != null){ document.getElementById('xwzTodayFrameCount').innerText = nCount; } } } /* ¿À´Ã º» »óǰ »èÁ¦(üũ¹Ú½º) */ function rmTodayProducts(elementName){ var elements= document.getElementsByName(elementName); var List = getCookie('TodayProductHistory').split(','); var Checks = new Array(0); var NewList = new Array(0); var nIndex = 0, n = 0; var isDeleted= false; if(elements.length == 0){ alert("»èÁ¦ÇÒ ¿À´Ã º» »óǰÀÌ ¾ø½À´Ï´Ù.");return false; } for(var i = 0; i < elements.length; i++){ if(elements[i].getAttribute('type') !='checkbox' ) continue; if(elements[i].getAttribute('disabled') == true) continue; if(elements[i].checked != true) continue; Checks[nIndex] = elements[i];nIndex++; } if(Checks.length == 0){alert("»èÁ¦ÇÒ ´ë»óÀ» Çϳª ÀÌ»ó ¼±ÅÃÇϼ¼¿ä");return false;} for(var i = 0; i < List.length; i++){ if(List[i] == '') continue; isDeleted = false; for(nIndex = 0; nIndex < Checks.length; nIndex++){ if(Checks[nIndex].value != List[i].split('|').shift()) continue; Checks[nIndex].parentNode.parentNode.removeNode(true); if( document.getElementById("IDS_TPD_LIST_" + Checks[nIndex].value) != null){ document.getElementById("IDS_TPD_LIST_" + Checks[nIndex].value).parentNode.removeNode(true); } isDeleted = true; break; } //== »èÁ¦ ´ë»óÀÌ ¾Æ´Ñ °æ¿ì if(isDeleted != true){ NewList[n] = List[i]; n++; } } if(document.getElementById('xwzTodayFrameCount') != null){ document.getElementById('xwzTodayFrameCount').innerText = NewList.length; } NewList = NewList.toString(); NewList = NewList.replace(/^([,]+)/, ''); NewList = NewList.replace(/([,]+)$/, ''); setCookie('TodayProductHistory',NewList, 1); } function selTodayAdditems(sType) { var form = document.forms['frmToday']; var elements = document.getElementsByName('ProductNo'); var nIndex = 0; var Codes = new Array(0); if(elements.length == 0){ alert("Àå¹Ù±¸´Ï¿¡ ´ãÀ» ¼ö ÀÖ´Â Âò »óǰÀÌ ¾ø½À´Ï´Ù."); return; } for(var i = 0; i < elements.length; i++){ if(elements[i].disabled == true) continue; if(elements[i].checked != true && String(sType).toLowerCase() != 'All' ) continue; Codes[nIndex] = elements[i].value; nIndex++; } if(Codes.length == 0){ alert("Àå¹Ù±¸´Ï¿¡ ´ãÀ» »óǰÀ» ¼±ÅÃÇϼ¼¿ä. "); return; } var win1 = window.open("/mypage/mypage.sub.popAddItems.php?productList="+Codes,"popAddItems","width=10,height=10,top=0,left=0,scrollbars=yes"); }