/** * »óǰ »ó¼¼ ÆäÀÌÁö¿¡¼­ »ç¿ëµÇ´Â ÀÚ¹Ù½ºÅ©¸³Æ® */ function chgOpt(){ if( $(opt1).value !="") { var s = $(opt1).value; var amount =$('order').order_amount.value; var size =$('order').order_size.value; if($('order').order_size2) { var size2 =$('order').order_size2.value; } var color =$('order').order_color.value; if(size == "") { alert('»çÀÌÁ ¼±ÅÃÇÏ¿© ÁֽʽÿÀ.'); $('opt1').value = ""; return false; } if(color == "") { alert('»ö»óÀ» ¼±ÅÃÇÏ¿© ÁֽʽÿÀ.'); $('opt1').value = ""; return false; } // ÇÏÀÇ »çÀÌÁî Ãß°¡ by jurisdoc 2009-04-03 if($('order').order_size2 && size2 !="") { size = size+ " //"+size2; } /** * ¿É¼Ç °Ë»ç½Ä Ãß°¡ÇÒ°Í */ if($('opt1').value !="") { if($('hTA').value !="") { var hTA = $('hTA').value; var strOpt = $('opt1').value+"||"+size+"||"+color; if(hTA.indexOf(strOpt) < 0) { $('hTA').value = $('hTA').value + $('opt1').value +"||"+size+"||"+color+"||"+amount+"$" ; }else { return false; } }else { $('hTA').value = $('hTA').value + $('opt1').value +"||"+size+"||"+color+"||"+amount+"$" ; } } } drawGoodsOption(); } function delGoodsOption(pos) { var tot_price,str ,amount,strAmount; var pirce ; var hta = $('hTA').value; var tmpArr = hta.split("$"); var oPrice = parseInt( $('order').price.value ); str = ""; for(i = 0; i< tmpArr.length -1 ; i++) { var a = tmpArr[i]; var tmp =a.split("||"); var opt = tmp[0]; var p = parseInt(tmp[1]); var size = tmp[2]; var color =tmp[3]; var amount = parseInt(tmp[4]); if(i !=pos) { str = str + opt +"||"+ p +"||"+size+"||"+color+"||"+amount+"$" ; } } $('hTA').value = str; drawGoodsOption(); } function upGoodsOption(pos) { var tot_price,str ,amount,strAmount; var pirce ; var hta = $('hTA').value; var tmpArr = hta.split("$"); var oPrice = parseInt( $('order').price.value ); str = ""; for(i = 0; i< tmpArr.length -1 ; i++) { var a = tmpArr[i]; var tmp =a.split("||"); var opt = tmp[0]; var p = parseInt(tmp[1]); var size = tmp[2]; var color =tmp[3]; if(i == pos) { var amount = parseInt(tmp[4])+1; }else { var amount = parseInt(tmp[4]); } str = str + opt +"||"+ p +"||"+size+"||"+color+"||"+amount+"$" ; } $('hTA').value = str; drawGoodsOption(); } function downGoodsOption(pos) { var tot_price,str ,amount,strAmount; var pirce ; var hta = $('hTA').value; var tmpArr = hta.split("$"); var oPrice = parseInt( $('order').price.value ); str = ""; for(i = 0; i< tmpArr.length -1 ; i++) { var a = tmpArr[i]; var tmp =a.split("||"); var opt = tmp[0]; var p = parseInt(tmp[1]); var size = tmp[2]; var color =tmp[3]; if(i == pos) { var amount = parseInt(tmp[4]); if(amount > 1) { var amount = parseInt(tmp[4])-1; } }else { var amount = parseInt(tmp[4]); } str = str + opt +"||"+ p +"||"+size+"||"+color+"||"+amount+"$" ; } $('hTA').value = str; drawGoodsOption(); } function drawGoodsOption() { var tot_price,str ,amount,strAmount; var pirce ; var hta = $('hTA').value; var tmpArr = hta.split("$"); var oPrice = parseInt( $('order').price.value ); tot_price = 0; str ="
"; for(i = 0; i< tmpArr.length -1 ; i++) { var a = tmpArr[i]; var tmp =a.split("||"); var opt = tmp[0]; var p = parseInt(tmp[1]); var size = tmp[2]; var color =tmp[3]; var amount = parseInt(tmp[4]); if(p > 0) { price =oPrice + p; }else { price =oPrice; } strAmount = ""; sum_price = price * amount; tot_price += sum_price; var str_sum_price = number_format(sum_price); str += "
"; str += "
"+opt+""+size+"/"+color+"
"; str += "
"+strAmount+"
"; str += "
"+str_sum_price+" ¿ø
"; str += "
"; } if(tmpArr.length > 1) { var str_tot_price = number_format(tot_price); str += "
ÃÑÇÕ°è : "+str_tot_price+" ¿ø
"; str +="
"; } if(tmpArr.length > 1) { $(optionShow).innerHTML=str; }else { $(optionShow).innerHTML=""; } } function number_format(s){ var str = new String(s); var Re = /[^0-9]/g; var ReN = /(-?[0-9]+)([0-9]{3})/; str = str.replace(Re,''); while (ReN.test(str)) { str = str.replace(ReN, "$1,$2"); } return str; } function detail_pic(mode,code) { var win = window.open('detail2.htm?rec=view_detail1&code='+code+'&mode='+mode,'pop_up','scrollbars=1,resizable=1,width=620,height=650'); win.focus(); } function go_orders(cmd) { if(document.order.order_color.value == '') { alert('»ö»óÀ» ¼±ÅÃÇϼ¼¿ä'); return; } if(document.order.order_size.value == '') { alert('»çÀÌÁ ¼±ÅÃÇϼ¼¿ä.'); return; } if(document.order.order_amount.value == 0) { alert('¼ö·®À» ÀÔ·ÂÇϼ¼¿ä.'); return; } document.order.submit(); } function go_direct(cmd) { document.order.cmd.value=cmd; if(document.order.order_color.value == '') { alert('»ö»óÀ» ¼±ÅÃÇϼ¼¿ä'); return; } if(document.order.order_size.value == '') { alert('»çÀÌÁ ¼±ÅÃÇϼ¼¿ä.'); return; } if(document.order.order_amount.value == 0) { alert('¼ö·®À» ÀÔ·ÂÇϼ¼¿ä.'); return; } document.order.submit(); } function changeImg(img){ FirstPic.style.display='block'; SecondPic.style.display='none'; } function changeImg2(img){ FirstPic.style.display='none'; document.largeimg.src = img; SecondPic.style.display='block'; }