function XHR_START() { var XML_HTTP_OBJ = false; if( ! XML_HTTP_OBJ && typeof XMLHttpRequest != 'undefined' ) { XML_HTTP_OBJ = new XMLHttpRequest(); } else { try { XML_HTTP_OBJ = new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch( e ) { try { XML_HTTP_OBJ = new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch( e2 ) { XML_HTTP_OBJ = false; } } } // if( ! XML_HTTP_OBJ ) { alert( 'XMLHttpRequest can not start !!' ); } return XML_HTTP_OBJ; } function XHR_CHECK( XHR_OBJ ) { if( XHR_OBJ.readyState == 4 ) { if( XHR_OBJ.status == 200 ) { return true; } else { return false; } } } function NO_TO_MONEY( CHG_NO ) { var NOR = eval( CHG_NO.length ) % 3; var NOC = Math.floor( CHG_NO.length / 3 ); var c = 0; SNO_ARY = new Array(); if( NOR > 0 ) { var NIS = 1; SNO_ARY[0] = CHG_NO.substr( 0, NOR ); } else { var NIS = 0; NOC = NOC - 1; } for( var ni=NIS; ni<=NOC; ni++ ) { var START = ( 3 * c ) + NOR; SNO_ARY[ni] = CHG_NO.substr( START, 3 ); c++; } CHG_NO = SNO_ARY.join( ',' ); return CHG_NO; } function MENU_EVENT( OBJ, EVENT_KW, IMG_ID ) { switch( EVENT_KW ) { case 'MOUT': OBJ.className = 'menu_mout'; OBJ.style.background = ''; document.getElementById(IMG_ID).src = '../_images/micon_mout.gif'; break; case 'MOVER': OBJ.className = 'menu_mover'; OBJ.style.background = 'url( ../_images/menu_bg.jpg )'; OBJ.style.cursor = 'hand'; document.getElementById(IMG_ID).src = '../_images/micon_mover.gif'; break; } } function CLOSE_PRODUCT_DETAILS() { document.getElementsByTagName('body')[0].onscroll = function() {} for( var SI=0; SI 0 ) { var THIS_PRICE = ''+ D_PRICE +' '+ D_ONSALE_PRICE; } else { var THIS_PRICE = D_PRICE; } var PRODUCT_DETAILS_DIV_BG = document.createElement('div'); PRODUCT_DETAILS_DIV_BG.id = 'PRODUCT_DETAILS_DIV_BG'; PRODUCT_DETAILS_DIV_BG.className = 'product_div_bg'; PRODUCT_DETAILS_DIV_BG.style.top = document.body.scrollTop; document.getElementsByTagName('body')[0].appendChild( PRODUCT_DETAILS_DIV_BG ); var PRODUCT_DETAILS_DIV_MAIN = document.createElement('div'); PRODUCT_DETAILS_DIV_MAIN.id = 'PRODUCT_DETAILS_DIV_MAIN'; PRODUCT_DETAILS_DIV_MAIN.className = 'product_div_main'; PRODUCT_DETAILS_DIV_MAIN.style.top = document.body.scrollTop; document.getElementsByTagName('body')[0].appendChild( PRODUCT_DETAILS_DIV_MAIN ); document.getElementById('PRODUCT_DETAILS_DIV_MAIN').innerHTML = '' + '
' + '' + ' ' + ' ' + '' + '' + '
' + '
' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + '
關閉
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' '+ X_CHINESE_NAME +'
' + ' '+ X_ENGLISH_NAME +'
' + ' '+ X_CAPACITY +'

' + ' 售價: '+ THIS_PRICE +'

' + '

'+ X_EXPLANATION +'

'+ X_DIRECTIONS +'

' + '
 
' + ' ' + ' ' + ' ' + '
完整成份
'+ X_INGREDIENT_LIST +'
' + '
' + '
' + '
' + '
'; } } } for( var SI=0; SI 0 ) { var REPORT_C = '00' + REPORT; document.getElementById('SBAG_DIV').className = 'sbag_ne'; document.getElementById('SBAG_C').innerHTML = REPORT_C.substr( REPORT_C.length-2, 2 ); OBJ.options[OBJ.selectedIndex].style.color = '#FFFFFF'; OBJ.options[OBJ.selectedIndex].style.background = '#FF9000'; document.getElementById('SBAG_DIV').onclick = function() { location.href='sbag_list.php'; } document.getElementById('SBAG_DIV').onmouseover = function() { this.style.cursor='hand'; this.className='sbag_mover'; } document.getElementById('SBAG_DIV').onmouseout = function() { this.className='sbag_ne'; } } else { document.getElementById('SBAG_DIV').className = 'sbag_empty'; document.getElementById('SBAG_C').innerHTML = '00'; document.getElementById('SBAG_DIV').onclick = function() {} document.getElementById('SBAG_DIV').onmouseover = function() { this.style.cursor=''; } document.getElementById('SBAG_DIV').onmouseout = function() {} } if( PRODUCT_QTY == 0 ) { SBAG_C_CLEAN( OBJ ); } } } } } function SBAG_ADD2( OBJ, PRODUCT_PRICE ) { SBAG_ADD( OBJ ); var PRODUCT_SN = OBJ.name.replace( 'PQTY_', '' ); var PRODUCT_QTY = OBJ.options[OBJ.selectedIndex].value; var NEW_SUBTOTAL = eval( PRODUCT_QTY ) * eval( PRODUCT_PRICE.replace( ',', '' ) ); var SUBTOTAL_NAME = 'SUBTOTAL_' + PRODUCT_SN; document.getElementById(SUBTOTAL_NAME).innerHTML = NEW_SUBTOTAL; NEW_SUBTOTAL = document.getElementById(SUBTOTAL_NAME).innerHTML; document.getElementById(SUBTOTAL_NAME).innerHTML = NO_TO_MONEY( NEW_SUBTOTAL ); var ALL_SUBTOTAL = 0; for( var SI=0; SI