//the values APPVER and APPLANG are set up in 'htdocs/cartV?/config.inc.asp' var APPVER = 'V7'; var APPLANG = 'EN'; var errMsg_XMLissue = 'Problem retrieving XML data:'; var errMsg_SelectAllOption = 'You have not selected all options.\n Please choose an option for:\n'; var errMsg_NotCompleteCode = 'This is not a complete Product code.\n'; var errMsg_NoQuantity = 'You did not filled product quantity.'; var errMsg_OutOfRange = 'The value is out of Maximum range!'; var ShopCode = '42521'; if (APPLANG == 'DE') { errMsg_XMLissue = 'Problem Abrufen von XML-Daten:'; errMsg_SelectAllOption = 'Sie haben nicht alle Optionen ausgewählt\n Bitte wählen Sie eine Option für:\n'; errMsg_NotCompleteCode = 'Dies ist keine vollständige Produkt-Code.\n'; errMsg_NoQuantity = 'Sie haben nicht die Menge der Produkte.'; errMsg_OutOfRange = 'Der Wert wird aus Maximale Reichweite!'; ShopCode = '26739'; } else { if (APPLANG == 'FR') { errMsg_XMLissue = 'Problème de récupération des données XML:'; errMsg_SelectAllOption = 'Vous n'+"'"+'avez pas sélectionné toutes les options.\n Veuillez choisir une option pour:\n'; errMsg_NotCompleteCode = 'Ceci n' + "'" + 'est pas un code produit complet.\n'; errMsg_NoQuantity = 'Vous n' + "'" + 'avez pas saisi la quantité de produits.'; errMsg_OutOfRange = 'La valeur est hors de la plage maximum !'; ShopCode = '54306'; } } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } function setCookie(c_name,value,expirehours) { var exdate=new Date(); exdate.setTime(exdate.getTime() + expirehours*60*60*1000); document.cookie=c_name+ "=" +escape(value)+((expirehours==null) ? "" : ";expires="+exdate.toGMTString()); } function stopEnter(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } // JScript File var Products; var ProductVariantLine; var xmlProductsHttp; var xmlProductsVariantsHttp; var xmlClientCodeHttp; var ProductCode = new Array(); var SetUpCode = new Array(); var NoPrice = ' ......'; var DataFolder = '/cart' + APPVER + '/' + APPLANG + '/'; var ProductsXMLFile = '/cart' + APPVER + '/' + 'getdata.asp?type=products&code='; var ProductVariantsXMLFile = '/cart' + APPVER + '/' + 'getdata.asp?type=product_variants&code='; var clientCodesXMLFile = '/cart' + APPVER + '/' + 'getdata.asp?type=clients_codes&code='; var ShopLinkTemplateNormalFile = DataFolder + 'shoplink-normal.htm'; var XMLTblIdentif = "Table";//Table var XMLRowIdentif = "row";//row var XMLCellIdentif = "cell";//cell var showVariantTable = true; var cCodeID = 'ccode'; var cNameID = 'cname'; var cookieExp = 1; //hour var cCode = getCookie(cCodeID); var cName = getCookie(cNameID); var cProduct_ID = ''; var cRangeMinID = '[MIN]'; var cRangeMaxID = '[MAX]'; var lcRangeMinID = ''; var lcRangeMaxID = ''; //window.onload = set_default(ProductCode, SetUpCode); function clientCodeChanged(cCodeVal, product_ID) { if (cCode != cCodeVal) { cCode = cCodeVal; cProduct_ID = product_ID; //alert(cCode + '/' + cProduct_ID); //FillClientCodeVal(); setCookie(cCodeID, cCode, cookieExp); setCookie(cNameID, cName, cookieExp); FillProductsVariantsArrOnly(); } } function FillProductsArr(product_id, product_default) { ProductCode[ProductCode.length] = product_id; SetUpCode[SetUpCode.length] = product_default; document.write('

'); xmlProductsHttp=GetXmlHttpObject(); if (xmlProductsHttp==null) { alert ("Your browser does not support XML!"); return; } xmlProductsHttp.onreadystatechange=stateProductsChanged2; xmlProductsHttp.open("GET",ProductsXMLFile + cCode,true); xmlProductsHttp.send(null); } function FillProductsVariantsArr() { xmlProductsVariantsHttp=GetXmlHttpObject(); if (xmlProductsVariantsHttp==null) { alert ("Your browser does not support XML!"); return; } xmlProductsVariantsHttp.onreadystatechange=stateProductsVariantsChanged2; xmlProductsVariantsHttp.open("GET",ProductVariantsXMLFile + cCode,true); xmlProductsVariantsHttp.send(null); } function FillProductsVariantsArrOnly() { xmlProductsVariantsHttp=GetXmlHttpObject(); if (xmlProductsVariantsHttp==null) { alert ("Your browser does not support XML!"); return; } xmlProductsVariantsHttp.onreadystatechange=stateProductsVariantsOnlyChanged; xmlProductsVariantsHttp.open("GET",ProductVariantsXMLFile + cCode,true); xmlProductsVariantsHttp.send(null); } function FillClientCodeVal() { xmlClientCodeHttp=GetXmlHttpObject(); if (xmlClientCodeHttp==null) { alert ("Your browser does not support XML!"); return; } xmlClientCodeHttp.onreadystatechange=stateClientCodeChanged; xmlClientCodeHttp.open("GET",clientCodesXMLFile,true); xmlClientCodeHttp.send(null); } function stateClientCodeChanged() { if (xmlClientCodeHttp.readyState==4) { if (xmlClientCodeHttp.status==200) { var xmlDoc=xmlClientCodeHttp.responseXML; var xmlTbl = xmlDoc.getElementsByTagName("Clients")[0]; RowCount = xmlTbl.childNodes.length; for (var i=0;i0) { html_tbl='0) html_tbl+=' class="'+css+'"' html_tbl+='>'; } var index_col = 0; var index_row = -1; for (var ind in tbl_arr) { index_col++; if (index_col==1) { if (index_row==-1) { html_tbl+=""; } else { if (index_row>1) { index_row=0; html_tbl+=''; } else { html_tbl+=''; } } } if (index_col==cols) { index_col=0; if (index_row==-1) { html_tbl+=''+tbl_arr[ind]+''; index_row = 1; } else { html_tbl=html_tbl.replace(/%%%/g,tbl_arr[ind]); html_tbl+=''+tbl_arr[ind]+''; index_row++; } } else { if (index_row==-1) { if (index_col==1) html_tbl+=''+tbl_arr[ind]+'' else html_tbl+=''+tbl_arr[ind]+'' } else if (index_col==1) //html_tbl+=''+tbl_arr[ind]+'' html_tbl+=''+tbl_arr[ind]+'' else html_tbl+=''+tbl_arr[ind]+'' } } if (index_col>0) { for (i=0;i0) html_tbl+=''; return html_tbl; } function create_variant_table2(product_id, css) { var tbl_head = ''; var tbl_body = ''; var tbl_footer = ''; var alter_bool = false; var ind = ''; var isRangeIn = false; var lRangeMinMaxLenght; //var test = ''; for (var ind in ProductVariantLine) { //test += product_id + ' = ' + ProductVariantLine[ind][0].replace(/\$/g,"#") + '\r\n'; //if (product_id==ProductVariantLine[ind][0].replace(/\$/g,"#")) if (product_id==ProductVariantLine[ind][0]) { var lDesc = ProductVariantLine[ind][1]?ProductVariantLine[ind][1]:''; //Description lDesc = lDesc.replace(/ /g,' '); lDesc = lDesc.replace(/\[br\]/,'
'); var lCode = ProductVariantLine[ind][2]?ProductVariantLine[ind][2]:''; //Code var lRange = ProductVariantLine[ind][5]?ProductVariantLine[ind][5]:''; //Range var lRangeMin = ProductVariantLine[ind][6]?ProductVariantLine[ind][6]:'0'; //RangeMin var lRangeMax = ProductVariantLine[ind][7]?ProductVariantLine[ind][7]:'0'; //RangeMax var lOnSelect = ProductVariantLine[ind][8]?ProductVariantLine[ind][8] + ';':''; //onSelect if (!((lDesc == lCode) && (lCode == ''))) { if (tbl_head == '') { tbl_head = lDesc + '$$$' + lCode; } else { tbl_body += (alter_bool)?'':''; alter_bool = !alter_bool; tbl_body += ''; tbl_body += ''+lDesc+''; tbl_body += ''+lCode+''; if (!((lRangeMin == lRangeMax) && (lRangeMin == '0')) || isRangeIn || lRange.replace(/ /,'') != '') { isRangeIn = true; lRangeMinMaxLenght = (lRangeMin.length > lRangeMax.length)?lRangeMin.length:lRangeMax.length; tbl_body += ' '; lRange = lRange.replace(/deg. C/, '°C'); lRange = lRange.replace(/deg.C/, '°C'); lRange = lRange.replace(/deg. F/, '°F'); lRange = lRange.replace(/deg.F/, '°F'); lRange = lRange.replace(/\[br\]/,'
'); lRange = lRange.replace(cRangeMinID, lcRangeMinID); lRange = lRange.replace(cRangeMaxID, lcRangeMaxID); if (lRange.indexOf(lcRangeMinID)>=0) { lRange = lRange.replace(lcRangeMinID, ''); } else { lRange += ''; } if (lRange.indexOf(lcRangeMaxID)>=0) { lRange = lRange.replace(lcRangeMaxID, ''); } else { lRange += '' } if (lRange.indexOf('
')>=0) { tbl_body += '' + lRange +''; } else { tbl_body += '' + lRange +''; } } tbl_body += "" } } } } //alert(test); tbl_head = (tbl_head != '')?''+ tbl_head.replace(/\$\$\$/g,"") + ((isRangeIn)?' Maximum Range':'') + '':''; tbl_body = (tbl_body != '')?''+tbl_body+'':''; tbl_footer = (tbl_footer != '')?''+tbl_footer+'':''; return ((tbl_head != '') || (tbl_body != '') || (tbl_footer != ''))?'0)?' class="'+css+'"':'') + '>' + tbl_head + tbl_body + tbl_footer + '':''; } function write_table(product_ID, product_default, shop_ID) { var return_txt; if (showVariantTable) { var header_line = ''; var first_line = ''; var second_line = ''; //var header_line_arr = product_ID.replace(cRangeMinID, lcRangeMinID).replace(cRangeMaxID, lcRangeMaxID).replace(/_/,lcMiddleDotID ).split(''); var header_line_arr = product_ID.replace(cRangeMinID, lcRangeMinID).replace(cRangeMaxID, lcRangeMaxID).split(''); for(var ind in header_line_arr) { if (header_line_arr[ind]=='#') { header_line_arr[ind] = '?'; } } var col_number = 0; for(var ind in Products) { if (Products[ind][0]==product_ID) { for(var ind2 in Products[ind][1][0]) { var from_start = Products[ind][1][0][ind2].indexOf('$'); var from_end = Products[ind][1][0][ind2].lastIndexOf('$'); if (from_start!=from_end) { header_line_arr[from_start] = ''; } first_line += ' '; //second_line += ''+create_variant_table(Products[ind][1][0][ind2],Products[ind][1][1][ind2],2,'variant')+''; second_line += ''+create_variant_table2(Products[ind][1][0][ind2],'variant')+''; col_number++; } } } header_line = header_line_arr.join(''); header_line = header_line.replace(lcRangeMinID+'_'+lcRangeMaxID,lcRangeMinID+'·'+lcRangeMaxID); header_line = header_line.replace(lcRangeMinID, ''); header_line = header_line.replace(lcRangeMaxID, ''); //alert(header_line); return_txt = ''+first_line+''+second_line+''; return_txt += '
'+header_line+'
'+write_shop_link(product_ID, product_default, shop_ID)+'
'; } else { return_txt = ''; return_txt += '
'+write_shop_link(product_ID, product_default, shop_ID)+'
'; } return return_txt; } function write_shop_link(product_ID, product_default, shop_ID) { var product_discount_from = 10; var product_name = ''; var html_txt = ''; for(var ind in Products) { if (Products[ind][0]==product_ID) { if (Products[ind].length>2) product_name = Products[ind][2]; if (Products[ind].length>4) product_discount_from = parseInt(Products[ind][4],10); if (Products[ind].length>5) html_txt = Products[ind][5][1]; } } html_txt = html_txt.replace(/{\$product_ID}/g, product_ID); html_txt = html_txt.replace(/{\$product_name}/g, product_name); html_txt = html_txt.replace(/{\$location}/g, window.location.href); html_txt = html_txt.replace(/{\$shop_ID}/g, shop_ID); html_txt = html_txt.replace(/{\$product_discount_from}/g, product_discount_from); html_txt = html_txt.replace(/{\$product_default}/g, product_default); html_txt = html_txt.replace(/{\$NoPrice}/g, NoPrice); html_txt = html_txt.replace(/{\$ccode}/g, cCode); return html_txt; } function btn_cancel_click(product_ID, product_default) { var quantity_val = document.getElementById('quantity'+product_ID) if (quantity_val != undefined) quantity_val.value = 1; set_default(product_ID, product_default, true); } function set_default(product_ID, product_default, boolDefault) { //set default radio buttons and spans for(var ind in ProductVariantLine) { if ((ProductVariantLine[ind][0].replace(/\$/g,"#")==product_ID) && (ProductVariantLine[ind].length>3)) { var from_start = ProductVariantLine[ind][0].indexOf('$'); var from_end = ProductVariantLine[ind][0].lastIndexOf('$'); var default_value = product_default.substring(from_start,from_end+1); radio_btn = document.getElementById(ProductVariantLine[ind][0]+'_'+ProductVariantLine[ind][2]); span_val = document.getElementById(ProductVariantLine[ind][0]); if (radio_btn != undefined) { radio_btn.checked = default_value==radio_btn.value; if (default_value==radio_btn.value) { radio_btn.checked = true; //alert(ProductVariantLine[ind][0]+','+product_ID + ', '+default_value); change_code(ProductVariantLine[ind][0],default_value); } } if (boolDefault) { if (span_val != undefined) { if (default_value.indexOf('#')>=0) span_val.value = '' else span_val.value = default_value } } } } if (boolDefault) { //set up to start product item code var product_id_input = document.getElementById('itemcode'+product_ID); if (product_id_input!=undefined) { if (product_id_input.innerHTML) { product_id_input.innerHTML = product_default; } else { product_id_input.value = product_default; } } var product_id_input_bckp = document.getElementById('bckpcode'+product_ID); if (product_id_input_bckp!=undefined) { if (product_id_input_bckp.innerHTML) { product_id_input_bckp.innerHTML = product_default; } else { product_id_input_bckp.value = product_default; } } } var quantity_val = document.getElementById('quantity'+product_ID) if (quantity_val != undefined) quantity_val.value = 1; set_price(product_ID); } function getVariantCode(lProductIDCode, lCurrentProductID) { var lStart = lProductIDCode.indexOf('['); var lEnd = lProductIDCode.lastIndexOf(']'); //alert('lProductIDCode=(' + lProductIDCode + '),lCurrentProductID=(' + lCurrentProductID + ')'); if ((lStart < lEnd) && (lStart >= 0) && (lEnd >= 0)) { lCurrentProductID = lCurrentProductID.substring(0, lStart) + lCurrentProductID.substring(lCurrentProductID.length - (lProductIDCode.length - lEnd) + 1); lProductIDCode = lProductIDCode.substring(0, lStart) + lProductIDCode.substring(lEnd + 1); //alert('lProductIDCode=(' + lProductIDCode + '),lCurrentProductID=(' + lCurrentProductID + ')'); } lStart = lProductIDCode.indexOf('$'); lEnd = lProductIDCode.lastIndexOf('$'); return lCurrentProductID.substring(lStart, lEnd + 1); } function set_price(product_ID) { var current_product_ID = '###################'; //var product_id_input = document.getElementById('bckpcode'+product_ID); var product_id_input = document.getElementById('itemcode'+product_ID); if (product_id_input!=undefined) { if (product_id_input.innerHTML) { current_product_ID = product_id_input.innerHTML; } else { current_product_ID = product_id_input.value; } } var product_discount = 0.0; var product_discount_from = 0; var product_name = ''; var product_price = 0; var product_weight = 0; var price1qty = 0; var price2qty = 0; var price3qty = 0; for(var ind in Products) { if ((Products[ind][0]==product_ID) && Products[ind].length>4) { product_name = Products[ind][2]; if (!isNaN(Products[ind][3])) product_discount = parseFloat(Products[ind][3])/100; if (!isNaN(Products[ind][4])) product_discount_from = parseInt(Products[ind][4],10); } if ((Products[ind][0] == product_ID) && Products[ind].length > 4) { price1qty = parseInt(Products[ind][6]); price2qty = parseInt(Products[ind][7]); price3qty = parseInt(Products[ind][8]); } } if (current_product_ID.indexOf('#')>=0) { //not fully identified product -> delete unit price and price together var product_unit_price = NoPrice; var product_discount_price = NoPrice; var product_total_price = NoPrice; } else { // sum unit price and together price and show them var product_unit_price = 0.0; var product_discount_price = 0.0; var product_total_price = 0.0; var product_weight = 0; var price1 = 0.0; var price2 = 0.0; var price3 = 0.0; for (var ind in ProductVariantLine) { if (ProductVariantLine[ind][0].replace(/\$/g, "#") == product_ID) { var partial_value = getVariantCode(ProductVariantLine[ind][0], current_product_ID) if (ProductVariantLine[ind].length > 3) { //var from_start = ProductVariantLine[ind][0].indexOf('$'); //var from_end = ProductVariantLine[ind][0].lastIndexOf('$'); //var partial_value = current_product_ID.substring(from_start,from_end+1); // alert('current_product_ID = [' + current_product_ID + ']' + from_start + ',' + from_end); if (ProductVariantLine[ind][2] == partial_value) { if (!isNaN(ProductVariantLine[ind][3])) product_unit_price = product_unit_price + parseFloat(ProductVariantLine[ind][3]); } } if (ProductVariantLine[ind].length > 11) { //alert(ProductVariantLine[ind]); //alert('[' + ProductVariantLine[ind][2] + '] == [' + partial_value + '] -> [' + (ProductVariantLine[ind][2] == partial_value) + ']'); if (ProductVariantLine[ind][2] == partial_value) { price1 = price1 + parseFloat(ProductVariantLine[ind][9]); price2 = price2 + parseFloat(ProductVariantLine[ind][10]); price3 = price3 + parseFloat(ProductVariantLine[ind][11]); } //alert('price1:[' + price1 + ']' + 'price2:[' + price2 + ']' + 'price3:[' + price3 + ']'); } if (ProductVariantLine[ind].length > 4) { if (ProductVariantLine[ind][2] == partial_value) { if (!isNaN(ProductVariantLine[ind][4])) product_weight = product_weight + parseFloat(ProductVariantLine[ind][4]); } } } } var product_quantity = 1; var quantity_val = document.getElementById('quantity'+product_ID) if (quantity_val != undefined) { product_quantity = check_valid_number(quantity_val.value); quantity_val.value = product_quantity; } product_discount_price = product_unit_price*(1-product_discount); if (product_discount_from<=product_quantity) { product_total_price = product_discount_price*product_quantity; product_price = product_discount_price; } else { product_total_price = product_unit_price*product_quantity; product_price = product_unit_price; } } if ((product_quantity >= price3qty) && (price3qty > 0) && (price3 > 0)) { if (product_price > price3) { product_price = price3; product_unit_price = price3; product_total_price = product_unit_price * product_quantity; } } else if ((product_quantity >= price2qty) && (price2qty > 0) && (price2 > 0)) { if (product_price > price2) { product_price = price2; product_unit_price = price2; product_total_price = product_unit_price * product_quantity; } } else if ((product_quantity >= price1qty) && (price1qty > 0) && (price1 > 0)) { if (product_price > price1) { product_price = price1; product_unit_price = price1; product_total_price = product_unit_price * product_quantity; } } var price_val = document.getElementById('price'+product_ID+'_span'); if (price_val != undefined) price_val.innerHTML = convert_to_money(product_unit_price); var discount_price_val = document.getElementById('discount_price'+product_ID+'_span'); if (discount_price_val != undefined) discount_price_val.innerHTML = convert_to_money(product_discount_price); var total_price_val = document.getElementById('total_price'+product_ID+'_span'); if (total_price_val != undefined) total_price_val.innerHTML = convert_to_money(product_total_price); var price_inp_val = document.getElementById('price'+product_ID); if (price_inp_val != undefined) price_inp_val.value = product_price; var itemname_val = document.getElementById('itemname'+product_ID); if (itemname_val != undefined) itemname_val.value = product_name+' '+current_product_ID; var weight_val = document.getElementById('weight'+product_ID); if (weight_val != undefined) weight_val.value = product_weight; } function convert_to_money(convert_price) { if ((convert_price+""==NoPrice) || isNaN(convert_price)) return NoPrice; var local_price = ""+(Math.round(convert_price*100)/100); if (local_price.indexOf('.')>=0) { if (local_price.slice(local_price.indexOf('.')).length==2) local_price += '0'; } else { local_price += '.00'; } return local_price; } function find_missing(product_ID, product_ID_value) { var missed_list=''; for(var ind in Products) { if (Products[ind][0]==product_ID) { for(var ind2 in Products[ind][1][0]) { var from_start = Products[ind][1][0][ind2].indexOf('$'); var from_end = Products[ind][1][0][ind2].lastIndexOf('$'); if (product_ID_value.substring(from_start,from_end+1).indexOf('#')>=0) { var th_val=document.getElementById(Products[ind][1][0][ind2]+'_name'); if (th_val!=undefined) missed_list += ' - '+th_val.innerHTML +'\n'; } } } } return missed_list; } function check_valid_number(number) { if ((!(parseInt(number,10)>0)) || isNaN(number)) { //alert('Not correct value!'); number = ''; } //return parseInt(number,10); return number; } function check_all(formObj, product_ID) { var product_id_input = document.getElementById('itemcode'+product_ID); if (product_id_input!=undefined) { var from_start; var product_id_val; if (typeof(product_id_input.value) != 'undefined') { product_id_val = product_id_input.value; } else { product_id_val = product_id_input.innerHTML; } from_start = product_id_val.indexOf('#'); if (from_start>=0) { alert(errMsg_SelectAllOption + find_missing(product_ID, product_id_val)); } else { if (!((product_ID.indexOf('[MIN]')>0 || product_ID.indexOf('[MAX]') > 0)) && (product_ID.length != product_id_val.length)) { alert(errMsg_NotCompleteCode); //alert('This is not a complete Product code.\n' + '['+ product_ID + '](' + product_ID.length+') = ['+ product_id_val + '](' + product_id_val.length+')'); } else { product_id_input = document.getElementById('quantity'+product_ID); if (product_id_input!=undefined) { if (product_id_input.innerHTML) { product_id_val = product_id_input.innerHTML; } else { product_id_val = product_id_input.value; } if ((!(parseInt(product_id_val,10)>0)) || isNaN(product_id_val)) { alert(errMsg_NoQuantity) ; } else { return true; } } } } } return false; } function change_code(radio_name, radio_value) { var span_val=document.getElementById(radio_name); if (span_val!=undefined) span_val.value = radio_value; var from_start = radio_name.indexOf('$'); var from_end = radio_name.lastIndexOf('$'); var product_id_input = document.getElementById('itemcode'+radio_name.replace(/\$/g,'#')); var product_id_bckp = document.getElementById('bckpcode'+radio_name.replace(/\$/g,'#')); var minRangeVal = ' '; var maxRangeVal = ' '; var productID = radio_name.replace(/\$/g,'#'); if (document.getElementById(productID+'_'+cRangeMinID)) { if (document.getElementById(radio_name+'_'+radio_value+'_MIN')) { minRangeVal = document.getElementById(radio_name+'_'+radio_value+'_MIN').value; document.getElementById(productID+'_'+cRangeMinID).value = minRangeVal; } else { minRangeVal = document.getElementById(productID+'_'+cRangeMinID).value; } } if (document.getElementById(productID+'_'+cRangeMaxID)) { if (document.getElementById(radio_name+'_'+radio_value+'_MAX')) { maxRangeVal = document.getElementById(radio_name+'_'+radio_value+'_MAX').value; document.getElementById(productID+'_'+cRangeMaxID).value = maxRangeVal; } else { maxRangeVal = document.getElementById(productID+'_'+cRangeMaxID).value; } } if ((product_id_input!=undefined) && (product_id_bckp!=undefined)) { var newCode = product_id_bckp.value.substring(0,from_start)+radio_value+product_id_bckp.value.substring(from_end+1); product_id_bckp.value = newCode; newCode = newCode.replace(cRangeMinID+'_'+cRangeMaxID, cRangeMinID+'·'+cRangeMaxID);; newCode = newCode.replace(cRangeMinID, minRangeVal); newCode = newCode.replace(cRangeMaxID, maxRangeVal); if (product_id_input.innerHTML) { product_id_input.innerHTML = newCode; } else { product_id_input.value = newCode; } } set_price(productID); } function changeMinMax(lProductID, lCode, lValue, lType, lRangeVal) { if (((lType == cRangeMinID) && (lValue < lRangeVal)) || ((lType == cRangeMaxID) && (lValue > lRangeVal))) { alert(errMsg_OutOfRange); var input_obj = document.getElementById(lProductID+'_'+lCode+'_'+lType.replace(/\]/,'').replace(/\[/,'')); if (input_obj!=undefined) { if (input_obj.type == 'text') { input_obj.value = lRangeVal; } } } else { if (document.getElementById(lProductID+'_'+lCode)) { document.getElementById(lProductID+'_'+lCode).checked = true; } change_code(lProductID, lCode); } } function unCheckCheckOtherAndMsg(unCheckID, checkID, variantName, code, msgTxt) { //unCheckCheckOtherAndMsg('IST-H$-#[MIN]_[MAX]-#_Y','IST-H$-#[MIN]_[MAX]-#_N', 'IST-H$-#[MIN]_[MAX]-#', 'N', 'Intrinsically safe option is currently not available and still under review.\r\n Please contact us via email and tell us your requirement.') var unCheckObj = document.getElementById(unCheckID); if (unCheckObj!=undefined) { unCheckObj.checked = false; } var checkObj = document.getElementById(checkID); if (checkObj!=undefined) { checkObj.checked = true; } change_code(variantName, code); alert(msgTxt); } function forcedSelect() { //forcedSelect(true, 'ISC-#-#[MIN]_[MAX]-#$_N', 'ISC-#-#[MIN]_[MAX]-#$_M', 'ISC-#-#[MIN]_[MAX]-#$_B', 'ISC-#-#[MIN]_[MAX]-#$_V', 'ISC-#-#[MIN]_[MAX]-#$_W', 'ISC-#-#[MIN]_[MAX]-#$_O', 'ISC-#-#[MIN]_[MAX]-#$_C') //forcedSelect(false, 'ISC-#-#[MIN]_[MAX]-#$_M', 'ISC-#-#[MIN]_[MAX]-#$_N', 'ISC-#-#[MIN]_[MAX]-#$_B', 'ISC-#-#[MIN]_[MAX]-#$_V', 'ISC-#-#[MIN]_[MAX]-#$_W', 'ISC-#-#[MIN]_[MAX]-#$_O', 'ISC-#-#[MIN]_[MAX]-#$_C') //forcedSelect(true, 'ISC-#-#[MIN]_[MAX]-#$_C', 'ISC-#-#[MIN]_[MAX]-#$_N', 'ISC-#-#[MIN]_[MAX]-#$_M', 'ISC-#-#[MIN]_[MAX]-#$_B', 'ISC-#-#[MIN]_[MAX]-#$_V', 'ISC-#-#[MIN]_[MAX]-#$_W', 'ISC-#-#[MIN]_[MAX]-#$_O') var disableOption = (arguments.length > 0)?arguments[0]:false; var checkObj = (arguments.length > 1)?document.getElementById(arguments[1]):undefined; if (checkObj!=undefined) { checkObj.disabled = false; checkObj.checked = true; change_code(checkObj.name, checkObj.value); } for(var i=2; i