' + oProdInfo.invMsg;
strInputsOutput = strTemp;
strTemp = strInputsOutput + '' + oProdInfo.sku + ''
// Show case quantity text
if (bUseCaseQty && bUseChildCaseQty && oProdInfo.case_qty > 0) {
strTemp += "", oProdInfo.case_qty);
}
strInputsOutput = strTemp + '
';
if ( iColCount == iTotalCol ) {
strTemp = strInputsOutput + 'Available in cases of
' + "Available in cases of 0" + '
'; } sAtcHtml = 'Available Sizes
' + caseQtyText + '';
if ( bUseProductAliases ) {
if ( jQuery.trim(oProdInfo.pa_key) != '' ) {
sAtcHtml += '';
} //- if jQuery.trim(oProdInfo.pa_key) != '' )
} //- if ( bUseProductAliases )
if ( bShowAtc ) {
sAtcHtml += '';
} //- if ( bShowAtc )
sAtcHtml += '
';
jQuery('#detail_mx1_sizeinfo').html(sAtcHtml);
} catch ( oError ) {
alert(oError.message);
document.getElementById('detail_mx1_sizeinfo').innerHTML = 'Error loading sizes found in this color!';
HideLoading()
}
HideLoading();
} //- function fncDrawColorSizes()
/**
* Update Qty for "Select List" Addon Products
*/
function fncUpdateAddonsSelectQty(oSelect){
sPKey = jQuery(oSelect).val();
jQuery('#addon_qty_container').html('');
}//-function fncUpdateAddons
/**
* Ajax to process parent-child product nested drop list displays
*
* @author dand
* @internal refactored on 4/8/2010 - dand
*
* @param int vOpt int of the option to processed (1-4)
* @param bool vKeepGoing determines if function should recurse
* @param int vLast the total number of nested drop lists (1-4)
*/
function fncGetOptDroplist ( vOpt, vKeepGoing, vLast ) {
var oAjaxData = {
'opts': vOpt
, 'detailpageaction': 'ajaxcall'
, 'actiontype': 'getnestedopts'
, 'key': '436370EE366F4917B4D24FC4A4423155'
, 'parent_atc': '0'
, 'parent_price': '1'
, 'use_child_pics': 'false'
, 'use_child_docs': 'false'
, 'use_child_cart_opts': 'false'
, 'use_child_ds': 'false'
, 'parent_config_sections':''
};
switch ( vOpt ) {
/*
*Add mode case condition for 5 & 6 Droplist
*@author pijushb
*since 5/17/2012
**/
case 6:
var sOpt5Key = jQuery('#prod_opt5').val();
var oOpt5Info = window.oChildProds[sOpt5Key];
var sVal = escapeUriQueryParens(jQuery("#prod_opt5 option[value='" + sOpt5Key + "']").text());
oAjaxData.opt5 = sVal;
case 5:
var sOpt4Key = jQuery('#prod_opt4').val();
var oOpt4Info = window.oChildProds[sOpt4Key];
var sVal = escapeUriQueryParens(jQuery("#prod_opt4 option[value='" + sOpt4Key + "']").text());
oAjaxData.opt4 = sVal;
case 4:
var sOpt3Key = jQuery('#prod_opt3').val();
var oOpt3Info = window.oChildProds[sOpt3Key];
var sVal = escapeUriQueryParens(jQuery("#prod_opt3 option[value='" + sOpt3Key + "']").text());
oAjaxData.opt3 = sVal;
//Drop Through
case 3:
var sOpt2Key = jQuery('#prod_opt2').val();
var oOpt2Info = window.oChildProds[sOpt2Key];
var sVal = escapeUriQueryParens(jQuery("#prod_opt2 option[value='" + sOpt2Key + "']").text());
oAjaxData.opt2 = sVal;
//Drop Through
case 2:
var sVal = escapeUriQueryParens(jQuery('#prod_opt1').val());
oAjaxData.opt1 = sVal;
break;
default:
break;
}//- switch ( vOpt )
jQuery.ajax({
url: "/product/Risk1959.asp"
, data: oAjaxData
, cache: false
, type: "GET"
, dataType: "json"
, beforeSend: function() { ResizeLoadingBG(); }
, success: function(oData){ fncDrawOptDroplist( oData, vOpt, vKeepGoing, vLast ) }
});
} //- function fncGetOptDroplist ( vOpt, vKeepGoing, vLast )
// EVENT FUNCTIONS ==================================================
function fncDrawOptDroplist ( oData, vOpt, bKeepGoing, vLast ) {
var iOpt = parseInt(vOpt);
var iLastOpt = parseInt(vLast);
var aUsedValues = new Array();
window.oChildProds = oData;
if ( document.getElementById('prod_opt' + (iOpt - 1)) ){
document.getElementById('prod_opt' + (iOpt - 1)).disabled = false;
}
if ( bKeepGoing ) {
bKeepGoing = true;
} else {
bKeepGoing = false;
}
if ( iLastOpt == iOpt ) {
bKeepGoing = false;
}
try {
/*
* removes all previous options
*/
var oOptSelect = document.getElementById('prod_opt' + iOpt);
oOptSelect.options.length = 0;
try {
for ( strPKey in window.oChildProds ) {
oProdInfo = window.oChildProds[strPKey];
if ( ! InArray( aUsedValues, oProdInfo.opt ) ){
oOptSelect.options[oOptSelect.options.length] = new Option(oProdInfo.opt , strPKey);
aUsedValues[aUsedValues.length] = oProdInfo.opt;
} //-if( ! InArray(aUsedValues, oProdInfo.opt) )
} //-for(key in oChildProds)
/*
* Recursivly Call fncGetOptDroplist until
* we're done getting all the drop lists
*/
if ( bKeepGoing ) {
if ( iOpt == 5 ) {
fncGetOptDroplist( iOpt + 1, false, iLastOpt );
} else {
fncGetOptDroplist( iOpt + 1, true, iLastOpt );
}
} else {
fncProcessOptProduct( iOpt );
HideLoading();
} //- if ( bKeepGoing )
} catch ( err ){
alert(err.message);
HideLoading();
}
if ( oOptSelect.options.length < 1 ) {
oOptSelect.options[oOptSelect.options.length] = new Option('No Sub-Options Found', '');
oOptSelect.disabled = true;
} else {
oOptSelect.disabled = false;
}
} catch (err){
alert(err.message);
}
/*
* Add Code to show/hide review message and buttons.
* @author pijushb
* @since 1/24/2012
**/
if (bShowBackOrderMessage)
{
sPrevSku = jQuery("#previous_sku").val();
bReviewMessage = $("#review_message_"+sPrevSku).is(":visible")
if (bReviewMessage)
{
$("#review_message_"+sPrevSku).hide();
}
bSubmitButton = $("#submit_button").is(":visible")
if (!bSubmitButton)
{
$("#submit_button").show();
$("#check_stock_button").show();
$("#checkout_button").hide();
}
}
} //- function fncDrawOptDroplist
//================================================================
/**
* SearchString escape the parens in the uri query
*
* @param string sVal string containing the value to escape
* @return string string with properly escaped parens for searchstring
*/
function escapeUriQueryParens(sVal){
if(typeof sVal == 'undefined'){
return;
}
sValue = sVal;
sValue = sValue.replace(/%28/gi,"\(");
sValue = sValue.replace(/%29/gi,"\)");
sValue = sValue.replace(/\(/gi,"\\(");
sValue = sValue.replace(/\)/gi,"\\)");
return sValue;
}
function fncProcessOptProduct ( vOpt ) {
try {
var sPKey = jQuery('#prod_opt' + vOpt).val();
var oProdInfo = window.oChildProds[sPKey];
//Global scope the pkey
window.sChildPkey = sPKey;
/*
* Bail if no key or no product data
*/
if ( sPKey == '' || typeof oProdInfo == "undefined" ) {
hideProductContainer();
return false;
} //- if ( sPKey == '' )
if ( jQuery('#qty_box').length > 0 )
jQuery('#qty_box').attr('name', 'qty_' + sPKey);
jQuery('#keys').val(sPKey);
/*
* Update SKU
*/
jQuery('#sku_container').html('SKU: ' + oProdInfo.sku);
/*
* Cart
*/
if ( oProdInfo.showCart ) {
if ( jQuery('#child_cart_section').length > 0 )
jQuery('#child_cart_section').show();
/*
* Handle Cart Options defined on Child Product
*/
if ( bUseChildCartOpts ) {
if ( oProdInfo.cartOptions != '' && jQuery('#pc_cart_options_' + vOpt).length > 0 ) {
buildCartOption(sPKey, oProdInfo.cartOptions, vOpt);
} else {
jQuery('#pc_cart_options_' + vOpt).html('');
}
} //- if ( bUseChildCartOpts )
/*
* Cart Options defined on Parent (standard config)
* need to know if this is the "last" droplist being displayed...
*/
if ( jQuery('#pc_cart_options_' + vOpt).length > 0 ) {
jQuery('#pc_cart_options_' + vOpt).slideDown();
// change the name of the hidden input so it will post to the item in the cart
jQuery('#cart_option_436370EE366F4917B4D24FC4A4423155').attr("name","cart_option_" + sPKey);
} //- if ( jQuery('#pc_cart_options_' + vOpt).length > 0 )
} else {
hideChildProductInputs();
} //-if(oProdInfo.showCart)
/*
* Product Unit Display
*/
if ( 'productUnit' in oProdInfo ) {
if(oProdInfo.productUnit != '')
jQuery('#product_unit_container').html('Unit: ' + oProdInfo.productUnit);
} //- if ( 'productUnit' in oProdInfo )
/*
* Single Unit of Measure (products.unit)
*/
if ( 'uomHTML' in oProdInfo ) {
if ( oProdInfo.uomHTML != '' ) {
jQuery('#detail_atc_standalone').html(oProdInfo.uomHTML);
jQuery('#child_cart_section').html(oProdInfo.uomHTML);
}
} //- if ( 'uomHTML' in oProdInfo )
/*
* Parent Addon Products
*/
if ( bShowParentAddonProds ) {
jQuery('#addon_product_container').slideDown();
jQuery('#addon_products').attr('name','keys');
} else {
jQuery('#addon_product_container').slideUp();
jQuery('#addon_products').attr('name','keys_no_post');
} //- if ( bShowParentAddonProds )
/*
* Child Addon Products
*/
if ( bShowChildAddonProds && 'showChildAddonProds' in oProdInfo ) {
if ( ! oProdInfo.showChildAddonProds ) {
jQuery('#addon_product_container').slideUp();
jQuery('#addon_products').attr('name','keys_no_post');
} else {
jQuery('#addon_product_container').slideDown();
jQuery('#addon_products').attr('name','keys');
} //- if ( ! oProdInfo.showChildAddonProds )
} //- if ( 'showChildAddonProds' in oProdInfo )
/*
* Price
*/
/*
* Check for Price Display type
* @author pijushb
* @since 4/25/2011
*/
var bShowRegPrice = true;
var bShowATCQty = false;
var sShowMessage = '';
if ( sShowPriceDisplayTypeDropList ) {
switch ( sPriceDisplayType ) {
case 'hide':
bShowRegPrice = false;
bShowATCQty = true;
sShowMessage = '-';
break;
case 'show_message':
bShowRegPrice = false;
bShowATCQty = true;
sShowMessage = sPriceMessage;
break;
case 'require_atc':
bShowRegPrice = false;
bShowATCQty = true;
sShowMessage = sHelpText;
break;
case 'require_login_or_atc':
bShowRegPrice = false;
bShowATCQty = true;
sShowMessage = sHelpText
break;
case 'require_login_for_price_and_atc':
bShowRegPrice = false;
sShowMessage = sHelpTextLogin
break;
default:
bShowRegPrice = true;
break;
} //- switch ( sPriceDisplayType )
} // if ( sShowPriceDisplayTypeDropList )
if ( bShowRegPrice ) {
//Display standard
} else {
oProdInfo.showPrice=false;
jQuery('#price_display_type_message').html('' + sShowMessage + '
');
if ( ! bShowATCQty ) {
jQuery('#child_cart_section').hide();
} //- if ( ! bShowATCQty )
} //- if ( bShowRegPrice )
/*
* Set Dangerous Price Ratio
* @author vinayakj
* @since 4/25/2011
*/
if ( bShowHazmatRatio ) {
if ( oProdInfo.dangerous_price_ratio > 0 ) {
jQuery('#dangerous_price_ratio').show();
jQuery('#dangerous_price_ratio_value').html(oProdInfo.dangerous_price_ratio);
} else {
jQuery('#dangerous_price_ratio').hide();
} //- if ( oProdInfo.dangerous_price_ratio > 0 )
} //- if ( bShowHazmatRatio )
if ( oProdInfo.showPrice ) {
/*
* Draw full UOM section (products.uom_std, products.uom_sales,
* products.uom_sales_conversion and additional unit of measure
* conversions from the unit_of_measure table)
*/
sUomView = '';
if ( bShowSalesUOM || bOnlyShowSalesUOM || bShowAdditionalSalesUOM ) {
sUomView = fncDrawUOM ( sPKey, oProdInfo );
}
if ( sUomView != '' ) {
jQuery('#child_cart_section').html( sUomView );
jQuery('#child_cart_section').show();
} else {
if ( jQuery('#price_container').length > 0 ) {
/*
* Add Qty Pricing Link for Child Product
*/
var sPriceBreakHTML = '';
if ( bShowChildQtyPricing ) {
if ( 'showPriceBreaks' in oProdInfo ) {
sPriceBreakHTML = '- ' + cPrice + ' ' + sPriceBreakHTML + '
- List Price: ' + cRetailPrice + '
- You Save: ' + Math.round(iPercentSaved * 100) / 100 + '%
- ' + FormatCurrency(oProdInfo.price, true) + ' ' + sPriceBreakHTML + '
');*/ jQuery('#detail_photo_container img#prodpicthumb').attr('src', 'images/' + oProdInfo.pic); } //- if ( oProdInfo.lg_pic != '' ) /* * Hide Parent & Show Child */ /*//parent images jQuery("#prodpicthumb").hide(); jQuery("#detail_enlarge").hide(); //no image jQuery(".detail_photo p:contains('sorry, no image')").hide(); //child image jQuery(".child_prod_img_link").fadeIn( 1000 );*/ } else { jQuery('#detail_photo_container a.thickbox').attr('href', sLargePic); jQuery('#detail_photo_container img#prodpicthumb').attr('src', sDetailPic); /* * Hide Child Image & Show Parent Image */ /*//parent images jQuery("#prodpicthumb").fadeIn( 1000 ); jQuery("#detail_enlarge").show(); //no image jQuery(".detail_photo p:contains('sorry, no image')").show(); //child image jQuery(".child_prod_img_link").hide(); jQuery("#child_detail_enlarge").hide();*/ } //- if ( oProdInfo.pic && oProdInfo.pic != '' ) /* * Additional Images */ if ( oProdInfo.additionalPics && oProdInfo.additionalPics.length > 0 ) { /* * Clear Child Additional Images */ if ( jQuery('.detail_multipic ul.child_prods').length > 0 ) { jQuery('.detail_multipic ul.child_prods li').remove(); } else { jQuery('.detail_multipic').append(' '); } //- if ( jQuery('.detail_multipic ul.child_prods').length > 0 ) /* * Build Child Additional Images */ for ( var iCounter = 0, goTo = oProdInfo.additionalPics.length - 1; iCounter <= goTo; iCounter++ ) { oPics = oProdInfo.additionalPics[iCounter]; jQuery('.detail_multipic ul.child_prods').append('
'); } //- for ( var iCounter = 0, goTo = oProdInfo.documents.length - 1; iCounter <= goTo; iCounter++ ) /* * Hide Parent Docs & Show Child Docs */ jQuery('#doc_download').hide(); jQuery('#child_doc_download').show(); } else { /* * Hide Child Docs */ jQuery('#child_doc_download').hide(); /* * Show Parent Docs - If there are any */ if ( jQuery('#doc_download').find('span').eq(1).html() == '' ) { jQuery('doc_download').hide(); } else { jQuery('#doc_download').show(); } //- if ( jQuery("#doc_download").find('span').eq(1).html() == '' ) } //- if( oProdInfo.documents.length > 0 ) } //- if ( bUseChildDocs ) /* * Child Product Qty Pricing * * @author johns * @since 11/6/2010 */ if ( bShowChildQtyPricing ) { if ( 'showPriceBreaks' in oProdInfo ) { if (oProdInfo.showPriceBreaks) { jQuery('#qtypricing').html('' + sQtyPricingLinkLabel + ''); tb_init('#qtypricing a'); /* jonr - 11/12/10 - We have to reinitialize Thickbox after modifying the DOM */ } // -if (oProdInfo.showPriceBreaks) } //- if ( 'showPriceBreaks' in oProdInfo ) } //- if ( bShowChildQtyPricing ) /* * Use Child Product Description * * @author johns * @since 11/6/2010 */ if ( bUseChildDescription ) { if ( 'desription' in oProdInfo ) { if ( oProdInfo.desription ) { jQuery('#detail_desc_content_0').html(oProdInfo.desription); } //- if ( oProdInfo.desription ) } //- if ( 'ds' in oProdInfo ) } //- if ( bUseChildDescription ) /* * Add Code to show/hide review message and buttons. * * @author pijushb * @since 1/24/2012 */ if ( bShowBackOrderMessage ) { sPrevSku = jQuery('#previous_sku').val(); bReviewMessage = jQuery('#review_message_' + sPrevSku).is(':visible') if ( bReviewMessage ) { jQuery("#review_message_"+sPrevSku).hide(); } //- if ( bReviewMessage ) bSubmitButton = jQuery('#submit_button').is(':visible') if ( ! bSubmitButton ) { jQuery('#submit_button').show(); jQuery('#check_stock_button').show(); jQuery('#checkout_button').hide(); } //- if ( ! bSubmitButton ) } //- if ( bShowBackOrderMessage ) if ( bUseProductAliases ) { if ( 'pa_key' in oProdInfo ) { if ( oProdInfo.pa_key ) { jQuery('#pa_id').html(oProdInfo.pa_key); } //- if ( oProdInfo.pa_key ) } //- if ( 'pa_key' in oProdInfo ) } //- if ( bUseProductAliases ) /* * Displaying Config Data * @auther - vinayakj * @since - 5/2/2012 */ if ( bShowProdConfig ) { if ('prod_config_droplist' in oProdInfo) { jQuery('#config_sections_container').html(htmlDecode(oProdInfo.prod_config_droplist)); } else { jQuery('#config_sections_container').html(''); } /* * Put Config Keys */ if ( 'config_keys' in oProdInfo) { jQuery('#config_keys').val(oProdInfo.config_keys); if ( jQuery('#qty_box').length > 0 ) jQuery('#qty_box').attr('name', 'qty_' + oProdInfo.config_keys); } /* * Put use_parent_key */ if ( 'use_parent_key' in oProdInfo) { jQuery('#use_parent_key').val(oProdInfo.use_parent_key); } /* * Put show_config_sections */ if ('show_config_sections' in oProdInfo) { jQuery('#show_config_sections').val(oProdInfo.show_config_sections); if (oProdInfo.show_config_sections == "1") { jQuery.ajax({ url: '?pageaction=getconfigdata&config_key=' + jQuery('#config_keys').val() + '&key=' , cache: false , dataType: "html" , success: function(sResponse){ jQuery('#config_sections_container').html(htmlDecode(sResponse)); } }); } else { jQuery('#config_sections_container').html(''); } } } } catch ( oError ) { alert('fncProcessOptProduct(' + vOpt + '): ' + oError.message); hideProductContainer(); } } //- function fncProcessOptProduct ( vOpt ) function htmlDecode(value) { if (value) { return $('').html(value).text(); } else { return ''; } } /** * Draw UOM Table * * @author johns * @since 3/17/2011 * @param sPKey string - the key of the product we are looking at * oData object - object containing the data from the ajax call * * @return UOM Table HTML */ function fncDrawUOM( sPKey, oData ) { try { /* * if the product price is blank, then exit the function */ if ( oData.price == ' ' ) { sUOMHtml = ''; return sUOMHtml; } /* * var containing html table structure to displayed containing the data */ var sUOMHtml = ''; var sQtyPerUnitColumn = ''; /* * make sure at least one of the show uom booleans is true */ if ( bShowSalesUOM || bOnlyShowSalesUOM || bShowAdditionalSalesUOM ) { /* * display title and hidden fields for the product */ sUOMHtml += '
Add to Cart
'; if ( 'uomStd' in oData ) { sUOMHtml += ''; } if ( 'uomSales' in oData ) { sUOMHtml += ''; sUOMHtml += ''; } sUOMHtml += ''; /* * determine whether or not to show the Qty Per Unit column */ if ( bShowQtyPerUnitColumn ) { sQtyPerUnitColumn = 'Unit | ' + sQtyPerUnitColumn + '' + sUnitPriceColumnLabel + ' | Qty | 1 | '; } //- if ( bShowQtyPerUnitColumn ) /* * draw Standard UOM row */ if ( 'uomStd' in oData ) { sUOMHtml += '
' + oData.uomStd + ' | ' + sQtyPerUnitColumn + '' + oData.price + ' | '; sUOMHtml += fncDrawQtyBox( sPKey, oData.qtyDisplayType, oData.uomStd, '' ); sUOMHtml += ' | ' + oData.uomSalesConversion + ' | '; } //- if ( bShowQtyPerUnitColumn ) if ( typeof oData.uomSalesUnitPrice == 'undefined' ) { iUnitPrice = 0; } else { iUnitPrice = oData.uomSalesUnitPrice } //- if ( typeof oUomConfig.uomSalesUnitPrice == 'undefined' ) /* * draw UOM Sales row */ sUOMHtml += '
' + oData.uomSales + ' | ' + sQtyPerUnitColumn + '$' + parseFloat(iUnitPrice).toFixed(2) + ' | '; sUOMHtml += fncDrawQtyBox( sPKey, oData.qtyDisplayType, oData.uomSales, 'sales_' ); sUOMHtml += ' | ' + iQty.toFixed() + ' | '; } else { sQtyPerHTML = '' } //- if ( bShowQtyPerUnitColumn ) if ( typeof oUomConfig.unitPrice == 'undefined' ) { iUnitPrice = 0; } else { iUnitPrice = oUomConfig.unitPrice; } //- if ( typeof oUomConfig.unitPrice == 'undefined' ) /* * build the html w/ hidden inputs */ sUnitHTML = oUomConfig.unit + ''; sPriceHTML = '$' + parseFloat(iUnitPrice).toFixed(2) + ''; sUOMHtml += '
' + sUnitHTML + ' | ' + sQtyPerHTML + '' + sPriceHTML + ' | '; sUOMHtml += fncDrawQtyBox( sPKey, oData.qtyDisplayType, oUomConfig.conversion, 'uom' + sThisUom + '_' ); sUOMHtml += ' | |
' + oData.uomSales + ' | 1 | $' + parseFloat(oData.uomSalesUnitPrice).toFixed(2) + ' | '; sUOMHtml += fncDrawQtyBox( sPKey, oData.qtyDisplayType, oData.uomSales ); sUOMHtml += ' |
' + err.message); return ''; } } //- function fncDrawQtyBox( sPKey, oData, sEachField ) /* * This will build out the Cart Options with comments * @auther - vinayakj * @since - 8/28/2012 */ function buildCartOptWithComments(rowkey,sCartOptions,RowID){ if (jQuery('#parent_p_key').val() != '') { rowkey = jQuery('#parent_p_key').val(); } else { rowkey = jQuery('#keys').val(); } buildCartOpt(rowkey); } function buildCartOption ( PKey, sOptions, Num ) { /* * Get the cart options */ aCartOpts = sOptions.split("|"); /* * Clear the cart option container and start building it * with the new cart options */ jQuery('#pc_cart_options_' + Num).remove('.atc').html(''); var aOptInputs = Array(); var aLimitIds = Array(); /* * Loop all the cart options, and append each to the cart * option container. */ for ( var iOpt = 0, goTo = aCartOpts.length; iOpt < goTo; iOpt++ ) { aCartOpt = aCartOpts[iOpt].split('~'); sDisplay = aCartOpt[0]; sLabel = aCartOpt[1]; sType = aCartOpt[2]; sAnswers = aCartOpt[3]; if ( aCartOpt.length >= 4 ) { sCharLimit = aCartOpt[4]; } //- if ( aCartOpt.length >= 4 ) /* * Character Limit Logic */ bUseLimit = (sCharLimit != '0' && sCharLimit != '' ? true : false); /* * Input Id */ sOptId = 'cart_opt_' + iOpt + '_' + PKey; /* * Begin building this option */ sHtml = ''; /* * Append the option to the container */ jQuery('#pc_cart_options_' + Num).append(sHtml); /* * Register char counter event listener */ if(bUseLimit){ jQuery('#' + sOptId).live('keyup', {optId: sOptId, optLimit: sCharLimit}, function(event){ limitChars(event.data.optId, event.data.optLimit, event.data.optId + '_limit'); }); }//-if(bUseLimit) /* * Register input event listener */ jQuery('#' + sOptId).live(sJsEvent, {optId: sOptId, pkey: PKey}, function(event){ buildCartOpt(event.data.pkey); }); } //- for ( var iOpt = 0, goTo = aCartOpts.length; iOpt < goTo; iOpt++ ) jQuery('#pc_cart_options_' + Num).append(''); } //- function buildCartOption ( PKey, sOptions, Num ) function getCartOptOptions(sAnswers){ aAnswers = sAnswers.split(";"); sHtml = ''; for(i = 0, goTo = aAnswers.length; i < goTo; i++){ sHtml += ''; } return sHtml; }//-getCartOptOptions function limitChars(textid, limit, infodiv){ var text = jQuery('#' + textid).val(); var textlength = text.length; if (textlength > limit) { jQuery('#' + infodiv).html('You cannot write more then '+limit+' characters!'); jQuery('#' + textid).val(text.substr(0,limit)); return false; } else { jQuery('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.'); return true; } }//-function limitChars function fncProcessSizeProduct(){ try{ var sPKey = jQuery('#prod_opt2').val(); var bUseChildDescription = false; var oProdInfo = window.oChildProds[sPKey]; if ( sPKey == '' ) { hideProductContainer(); return false; } jQuery('#qty_box').attr( 'name', 'qty_' + sPKey ); jQuery('#keys').val( sPKey ); /* * Test if this is the "last" droplist being displayed */ if ( jQuery('#pc_cart_options_2').length > 0 ) { jQuery('#pc_cart_options_2').slideDown(); /* * Change name to post item to the cart */ jQuery('#cart_option_436370EE366F4917B4D24FC4A4423155').attr('name','cart_option_' + sPKey); } //- if ( jQuery('#pc_cart_options_2').length > 0 ) /* * SKU */ jQuery('#sku_container').html( 'SKU: ' + oProdInfo.sku ); /* * Cart */ if ( oProdInfo.showCart ) { jQuery('#atc_container').show(); } else { jQuery('#atc_container').hide(); } //- if ( oProdInfo.showCart ) /* * Unit of Measure */ if ( 'uomHTML' in oProdInfo ) { if ( oProdInfo.uomHTML != '' ) jQuery('#detail_atc_standalone').html(oProdInfo.uomHTML); } //- if ( 'uomHTML' in oProdInfo ) /* * Price */ if ( oProdInfo.showPrice ) { iRetailPrice = parseFloat(oProdInfo.retail_price.replace('$','')); iPrice = parseFloat(oProdInfo.price.replace('$','')); if ( iPrice < iRetailPrice ) { iPercent = (iRetailPrice - iPrice) / iRetailPrice; iPercentSaved = iPercent * 100; jQuery('#price_container').html('
- ' + oProdInfo.price + '
- List Price: ' + oProdInfo.retail_price + '
- You Save: ' + Math.round(iPercentSaved*100)/100 + '%
- ' + FormatCurrency(oProdInfo.price, true) + '