function FormatCurrency (value) { var Precision = 2; var valStr = "" + value; var valInt = Math.floor(value); var valFrac = value - valInt; var multiplier = " 1000000000000000000".substring(1,Precision+2); var valRoundedFrac = Math.floor (valFrac*multiplier + 0.5); valInt = Math.floor (Math.floor (value*multiplier + 0.5) / multiplier); var valFracStr = "000000000000000000" + valRoundedFrac; valFracStr = valFracStr.substring (valFracStr.length-Precision, valFracStr.length); valStr = "$" + valInt + "." + valFracStr; return valStr; } function FormatEuro (value) { var Precision = 2; var valStr = "" + value; var valInt = Math.floor(value); var valFrac = value - valInt; var multiplier = " 1000000000000000000".substring(1,Precision+2); var valRoundedFrac = Math.floor (valFrac*multiplier + 0.5); valInt = Math.floor (Math.floor (value*multiplier + 0.5) / multiplier); var valFracStr = "000000000000000000" + valRoundedFrac; valFracStr = valFracStr.substring (valFracStr.length-Precision, valFracStr.length); valStr = "" + valInt + "." + valFracStr + " EU"; return valStr; } function openWindow(url, name) { popupWin = window.open(url,name,'width=300,height=360,left=25,top=25'); } var GoodOptions40X70MI = new Array(2); GoodOptions40X70MI[0] = 0; GoodOptions40X70MI[1] = 0; function CheckLockedOptions40X70MI(CatalogForm) { var FlagContinue=0; var FlagFound=0; var x=0; var OptionMatrix = new Array(100) ; while ((x<0) && (!FlagFound)) { FlagContinue=1 ; if (((CatalogForm.opt0.options[CatalogForm.opt0.selectedIndex].text==OptionMatrix[x]) ||(OptionMatrix[x]=="Don't Care")) && (FlagContinue)) FlagContinue=1; else FlagContinue=0; x++ ; if (((CatalogForm.opt1.options[CatalogForm.opt1.selectedIndex].text==OptionMatrix[x]) ||(OptionMatrix[x]=="Don't Care")) && (FlagContinue)) FlagContinue=1; else FlagContinue=0; x++ ; if (FlagContinue) FlagFound = 1 ; } if (FlagFound) { alert("This option is invalid. Please check your selection.") ; CatalogForm.opt0.selectedIndex=GoodOptions40X70MI[0]; CatalogForm.opt1.selectedIndex=GoodOptions40X70MI[1]; } else { GoodOptions40X70MI[0]=CatalogForm.opt0.selectedIndex; GoodOptions40X70MI[1]=CatalogForm.opt1.selectedIndex; } } function RecalcPrice40X70MI (CatalogForm) { var price = 288.000000; if (CatalogForm.opt1.options[CatalogForm.opt1.selectedIndex].value == 1) price += -107.400002; if (CatalogForm.opt1.options[CatalogForm.opt1.selectedIndex].value == 2) price += -84.000000; CatalogForm.realtimeprice.value = FormatCurrency (price); } function CheckOptions40X70MI (CatalogForm) { CheckLockedOptions40X70MI (CatalogForm); RecalcPrice40X70MI (CatalogForm); }