
var lstCustoms	= new Array();
var lstTables	= new Array();

		
function Extract()
{
	lstCustoms	= strCustoms.split( ";" );
	lstTables	= strTables.split( ";" );
	
	for (indCustom=1; indCustom<=parseInt( lstCustoms[0] ); indCustom++)
	{
		lstCustoms[indCustom] = lstCustoms[indCustom].split( ":" );
	}
	
	for (indTable=1; indTable<=parseInt( lstTables[0] ); indTable++)
	{
		lstTables[indTable] = lstTables[indTable].split( "," );
		
		if (parseInt( lstTables[indTable][1] ) <= lstCustoms[0])// && parseInt( lstTables[indTable][2] ) > 1)
		{
			for (indX=0; indX<lstTables[indTable][2]; indX++)
				lstTables[indTable][4 + indX] = lstTables[indTable][4 + indX].split( ":" );
			
			if (parseInt( lstTables[indTable][1] ))
				for (indY=0; indY<lstTables[indTable][3]; indY++)
					lstTables[indTable][4 + parseInt( lstTables[indTable][2] ) + indY] = lstTables[indTable][4 + parseInt( lstTables[indTable][2] ) + indY].split( ":" );
		}
	}
}


function Refresh()
{
	fltTotal = parseFloat( 0 );
	
	for (indTable=1; indTable<=parseInt( lstTables[0] ); indTable++)
	{
		indNamesX	= 4;
		indNamesY	= indNamesX + parseInt( lstTables[indTable][2] );
		indData		= indNamesY + parseInt( lstTables[indTable][3] );
		
		if (parseInt( lstTables[indTable][1] ) > parseInt( lstCustoms[0] ))
		{
			if (lstTables[indTable][4].length)
				indX = parseInt( eval( "document.frmProduct.selCustom" + lstTables[indTable][4] + ".selectedIndex" ) ) - 1;
			else
				indX = 0;
			
			if (parseInt( lstTables[indTable][3] ) > 1)
				indY = parseInt( eval( "document.frmProduct.selCustom" + lstTables[indTable][4 + parseInt( lstTables[indTable][2] )] + ".selectedIndex" ) ) - 1;
			else
				indY = 0;
			
			// ISO : THIS IS UGLY //
			if (lstCustoms[parseInt( lstTables[indTable][0] )][0] == "Custom Range");
			else
			{
				txtCustom		= eval( "document.frmProduct.txtCustom"		+ lstTables[indTable][0] );
				txtCustomView	= eval( "document.frmProduct.txtCustomView"	+ lstTables[indTable][0] );
				
				if ((txtCustom != null) && txtCustom.value.length && !isNaN( txtCustom.value )) // && intLength > minimum && intLength < maximum)
				{
					if (txtCustomView != null)
						txtCustomView.value = txtCustom.value;
					
					fltTotal += (indX < 0) || (indY < 0) ? 0.00 : parseFloat( txtCustom.value ) * parseFloat( lstTables[indTable][indY * parseInt( lstTables[indTable][2] ) + indX + indData] );
				}
				else
					if (txtCustomView != null)
						txtCustomView.value = "---";
			}
		}
		else
		{
			if (parseInt( lstTables[indTable][2] ) <= 1)
				fltTotal += parseFloat( lstTables[indTable][indData] );	
			else
			{
				selCustomX		= eval( "document.frmProduct.selCustom"		+ lstTables[indTable][0] );
				txtCustomViewX	= eval( "document.frmProduct.txtCustomView"	+ lstTables[indTable][0] );
				
				if (selCustomX != null)
					indX = selCustomX.selectedIndex - 1;
				else
					indX = -1;
				
				// ISO : THIS IS UGLY //
				if ((parseInt( lstTables[indTable][0] ) < lstCustoms[0]) && (lstCustoms[parseInt( lstTables[indTable][0] ) + 1][0] == "Custom Range"))
				{
					var objSpanC, objSpanF, objSpanNA, objSpanView, objSpanViewNA;
					var strUnits = "";
					
					if (document.all)
					{
						objSpanC		= document.all["spanCustomC"		+ (parseInt(lstTables[indTable][0]) + 1)];
						objSpanF		= document.all["spanCustomF"		+ (parseInt(lstTables[indTable][0]) + 1)];
						objSpanNA		= document.all["spanCustomNA"		+ (parseInt(lstTables[indTable][0]) + 1)];
						objSpanView		= document.all["spanCustomView"		+ (parseInt(lstTables[indTable][0]) + 1)];
						objSpanViewNA	= document.all["spanCustomViewNA"	+ (parseInt(lstTables[indTable][0]) + 1)];
					}
					else if(document.getElementById)
					{
						objSpanC		= document.getElementById( "spanCustomC"		+ (parseInt(lstTables[indTable][0]) + 1) );
						objSpanF		= document.getElementById( "spanCustomF"		+ (parseInt(lstTables[indTable][0]) + 1) );
						objSpanNA		= document.getElementById( "spanCustomNA"		+ (parseInt(lstTables[indTable][0]) + 1) );
						objSpanView		= document.getElementById( "spanCustomView"		+ (parseInt(lstTables[indTable][0]) + 1) );
						objSpanViewNA	= document.getElementById( "spanCustomViewNA"	+ (parseInt(lstTables[indTable][0]) + 1) );
					}
					
					if (indX >= 0)
					{
						if (lstTables[indTable][4+indX][0] == "YC")
						{
							strUnits					= "C";
							objSpanC.style.display		= "inline";
							objSpanF.style.display		= "none";
							objSpanNA.style.display		= "none";
							objSpanView.style.display	= "inline";
							objSpanViewNA.style.display	= "none";
						}
						else if (lstTables[indTable][4+indX][0] == "YF")
						{
							strUnits					= "F";
							objSpanC.style.display		= "none";
							objSpanF.style.display		= "inline";
							objSpanNA.style.display		= "none";
							objSpanView.style.display	= "inline";
							objSpanViewNA.style.display	= "none";
						}
						else
						{
							strUnits					= "";
							objSpanC.style.display		= "none";
							objSpanF.style.display		= "none";
							objSpanNA.style.display		= "inline";
							objSpanView.style.display	= "none";
							objSpanViewNA.style.display	= "inline";
						}
					}
					else
					{
						strUnits					= "";
						objSpanC.style.display		= "none";
						objSpanF.style.display		= "none";
						objSpanNA.style.display		= "inline";
						objSpanView.style.display	= "none";
						objSpanViewNA.style.display	= "inline";
					}
					
					txtCustomView	= eval( "document.frmProduct.txtCustomView"		+ (parseInt(lstTables[indTable][0]) + 1) );
					
					if (strUnits.length)
					{
						txtCustomFrom	= eval( "document.frmProduct.txtCustomFrom"		+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomTo		= eval( "document.frmProduct.txtCustomTo"		+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomFromC	= eval( "document.frmProduct.txtCustomFromC"	+ (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomToC	= eval( "document.frmProduct.txtCustomToC"		+ (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomFromF	= eval( "document.frmProduct.txtCustomFromF"	+ (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomToF	= eval( "document.frmProduct.txtCustomToF"		+ (parseInt(lstTables[indTable][0]) + 1) );
						
						if ((txtCustomFromC != null) && (txtCustomToC != null) && (txtCustomFromF != null) && (txtCustomToF != null))
						{
							if (strUnits == "C")
							{
								txtCustomFromF.value	= Math.round( CelsiusToFahrenheit( txtCustomFromC.value ) );
								txtCustomToF.value		= Math.round( CelsiusToFahrenheit( txtCustomToC.value ) );
							}
							else if (strUnits == "F")
							{
								txtCustomFromC.value	= Math.round( FahrenheitToCelsius( txtCustomFromF.value ) );
								txtCustomToC.value		= Math.round( FahrenheitToCelsius( txtCustomToF.value ) );
							}
						}
						
						if ((txtCustomView != null) && (txtCustomFrom != null) && (txtCustomTo != null))
						{
							txtCustomView.value  = (((txtCustomFrom != null) && txtCustomFrom.value.length && !isNaN( txtCustomFrom.value )) ? txtCustomFrom.value : "---") + " / ";
							txtCustomView.value += (((txtCustomTo != null) && txtCustomTo.value.length && !isNaN( txtCustomTo.value )) ? txtCustomTo.value : "---") + " " + strUnits;
						}
					}
					else
						if (txtCustomView != null)
							txtCustomView.value = "-----------";
				}
				
				if (indX >= 0)
				{
					if (txtCustomViewX != null)
						txtCustomViewX.value = selCustomX.options[selCustomX.selectedIndex].text.split( " : " )[0];
					
					if (parseInt( lstTables[indTable][1] ))
					{
						selCustomY		= eval( "document.frmProduct.selCustom"		+ lstTables[indTable][1] );
						txtCustomViewY	= eval( "document.frmProduct.txtCustomView"	+ lstTables[indTable][1] );
						
						if (selCustomY != null)
							indY = selCustomY.selectedIndex - 1;
						else
							indY = -1;
						
						if (indY >=0)
						{
							if (txtCustomViewY != null)
								txtCustomViewY.value = selCustomY.options[selCustomY.selectedIndex].text.split( " : " )[0];
							
							fltTotal += parseFloat( lstTables[indTable][indY * parseInt( lstTables[indTable][2] ) + indX + indData] );
						}
						else
							if (txtCustomViewY != null)
								txtCustomViewY.value = "---";
					}
					else
					{
						fltTotal += parseFloat( lstTables[indTable][indX + indData] );
					}
				}
				else
					if (txtCustomViewX != null)
						txtCustomViewX.value = "---";
			}
		}
	}
	
	var fltTotal_usa	= (fltTotal * g_fltCurrency_usa)	+ fltPrice_usa;
	var fltTotal_can	= (fltTotal * g_fltCurrency_can)	+ fltPrice_can;
		fltTotal		= (fltTotal * g_fltCurrency)		+ fltPrice;
	
	if (g_blnRefresh)
	{
		window.document.frmProduct.hidTotal_usa.value	= RoundPrice( fltTotal_usa	);
		window.document.frmProduct.hidTotal_can.value	= RoundPrice( fltTotal_can	);
		window.document.frmProduct.txtTotal.value		= RoundPrice( fltTotal		);
		
		var txtQuantity = window.document.frmProduct.txtQuantity;
		
		if (txtQuantity.value.length && !isNaN( txtQuantity.value ) && (parseInt( txtQuantity.value ) > 0))
		{
			window.document.frmProduct.hidNetTotal.value	= RoundPrice( fltTotal * parseFloat( document.frmProduct.txtQuantity.value ) );
			window.document.frmProduct.txtNetTotal.value	= RoundPrice( fltTotal * parseFloat( document.frmProduct.txtQuantity.value ) );
		}
		else
		{
			window.document.frmProduct.hidNetTotal.value	= RoundPrice( 0 );
			window.document.frmProduct.txtNetTotal.value	= "-----";
		}
	}
	
	return( true );
}

function Validate( _frmTarget )
{
	for (indTable=1; indTable<=parseInt( lstTables[0] ); indTable++)
	{
		indData =  4 + parseInt( lstTables[indTable][2] ) + parseInt( lstTables[indTable][3] );
		
		if (parseInt( lstTables[indTable][1] ) > parseInt( lstCustoms[0] ))
		{
			txtCustom		= eval( "document.frmProduct.txtCustom"		+ lstTables[indTable][0] );
			hidCustomMin	= eval( "document.frmProduct.hidCustomMin"	+ parseInt(lstTables[indTable][0]) );
			hidCustomMax	= eval( "document.frmProduct.hidCustomMax"	+ parseInt(lstTables[indTable][0]) );
			
			intMin = (hidCustomMin == null) ? -99999 : hidCustomMin.value;
			intMax = (hidCustomMax == null) ?  99999 : hidCustomMax.value;
			
			if (txtCustom != null)
			{
				if (!txtCustom.value.length || isNaN( txtCustom.value ) || (parseInt( txtCustom.value ) < intMin) || (parseInt( txtCustom.value ) > intMax))
				{
					alert( "Customization #" + lstTables[indTable][0] + " value is invalid" );
					txtCustom.focus();
					return( false );
				}
			}
		}
		else
		{
			if (parseInt( lstTables[indTable][2] ) > 1)
			{
				selCustomX		= eval( "document.frmProduct.selCustom"		+ lstTables[indTable][0] );
				selCustomY		= eval( "document.frmProduct.selCustom"		+ lstTables[indTable][1] );
				
				if (selCustomX != null)
				{
					if (selCustomX.selectedIndex < 1)
					{
						alert( "Customization #" + lstTables[indTable][0] + " has no selection" );
						selCustomX.focus();
						return( false );
					}
					
					indX = selCustomX.selectedIndex - 1;
				}
				else
					indX = -1;
				
				if (selCustomY != null)
				{
					if (selCustomY.selectedIndex < 1)
					{
						alert( "Customization #" + lstTables[indTable][0] + " has no selection" );
						selCustomY.focus();
						return( false );
					}
				}
				
				// ISO : THIS IS UGLY //
				if ((parseInt( lstTables[indTable][0] ) < lstCustoms[0]) && (lstCustoms[parseInt( lstTables[indTable][0] ) + 1][0] == "Custom Range") && (indX >= 0))
				{
					var strUnits = "";
					
					if (lstTables[indTable][4+indX][0] == "YC")
						strUnits = "C";
					else if (lstTables[indTable][4+indX][0] == "YF")
						strUnits = "F";
					
					if (strUnits.length)
					{
						txtCustomFrom	= eval( "document.frmProduct.txtCustomFrom"	+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						txtCustomTo		= eval( "document.frmProduct.txtCustomTo"	+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						hidCustomMin	= eval( "document.frmProduct.hidCustomMin"	+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						hidCustomMax	= eval( "document.frmProduct.hidCustomMax"	+ strUnits + (parseInt(lstTables[indTable][0]) + 1) );
						
						intMin = (hidCustomMin == null) ? -99999 : hidCustomMin.value;
						intMax = (hidCustomMax == null) ?  99999 : hidCustomMax.value;
						
						if (txtCustomFrom != null)
						{
							if (!txtCustomFrom.value.length || isNaN( txtCustomFrom.value ) || (parseInt( txtCustomFrom.value ) < intMin) || (parseInt( txtCustomFrom.value ) > intMax) || (parseInt( txtCustomFrom.value ) > parseInt( txtCustomTo.value )))
							{
								alert( "Customization #" + (parseInt( lstTables[indTable][0] ) + 1) + " minimum value is invalid" );
								txtCustomFrom.focus();
								return( false );
							}
						}
						
						if (txtCustomTo != null)
						{
							if (!txtCustomTo.value.length || isNaN( txtCustomTo.value ) || (parseInt( txtCustomTo.value ) > intMax) || (parseInt( txtCustomTo.value ) < intMin) || (parseInt( txtCustomTo.value ) < parseInt( txtCustomFrom.value )))
							{
								alert( "Customization #" + (parseInt( lstTables[indTable][0] ) + 1) + " maximum value is invalid" );
								txtCustomTo.focus();
								return( false );
							}
						}
					}
				}
			}
		}
	}
	
	var txtQuantity = _frmTarget.txtQuantity;
	
	if ((txtQuantity != null) && (!txtQuantity.value.length || isNaN( txtQuantity.value ) || (parseInt( txtQuantity.value ) < 1)))
	{
		alert( "Quantity is invalid" );
		txtQuantity.focus();
		return( false );
	}
	
	return( true );
}

function Compile( _objOutput )
{
	lstTweak = new Array( window.document.frmProduct.txtTotal.value );
	
	for (indCustom=1; indCustom<=parseInt( lstCustoms[0] ); indCustom++)
	{
		for (indTable=1; indTable<=parseInt( lstTables[0] ); indTable++)
		{
			if (parseInt( lstTables[indTable][0] ) == indCustom)
			{
				indAxis		= 0;
				indNames	= 4;
				break;
			}
			else if (parseInt( lstTables[indTable][1] ) == indCustom)
			{
				indAxis		= 1;
				indNames	= 4 + parseInt( lstTables[indTable][2] );
				break;
			}
		}
		
		if (indTable > parseInt( lstTables[0] ))
			;//lstTweak[lstTweak.length] = "";
		else
		{
			if (parseInt( lstTables[indTable][1] ) > parseInt( lstCustoms[0] ))
			{
				// ISO : THIS IS UGLY //
				if (lstCustoms[parseInt( lstTables[indTable][0] )][0] == "Custom Range")
				{
					objSelect = eval( "document.frmProduct.selCustom" + (parseInt(lstTables[indTable][0])-1) );
					
					if (objSelect.selectedIndex > 0)
						strValue = objSelect.options[objSelect.selectedIndex].text.substring( 0, 2 );
					else
						strValue = "";
					
					if (strValue == "YC")
						lstTweak[lstTweak.length] = eval( "document.frmProduct.txtCustomFromC" + lstTables[indTable][0] + ".value" ) + "/" + eval( "document.frmProduct.txtCustomToC" + lstTables[indTable][0] + ".value" ) + "/C";
					if (strValue == "YF")
						lstTweak[lstTweak.length] = eval( "document.frmProduct.txtCustomFromF" + lstTables[indTable][0] + ".value" ) + "/" + eval( "document.frmProduct.txtCustomToF" + lstTables[indTable][0] + ".value" ) + "/F";
					else
						lstTweak[lstTweak.length] = "";
				}
				else
					lstTweak[lstTweak.length] =  eval( "document.frmProduct.txtCustom" + indCustom + ".value" );
			}
			else
			{
				if (parseInt( lstTables[indTable][2 + indAxis] ) <= 1)
					lstTweak[lstTweak.length] = "";
				else
				{
					lstTweak[lstTweak.length] = eval( "document.frmProduct.selCustom" + indCustom + ".selectedIndex" ) - 1;
				}
			}
		}
	}
	
	if (_objOutput != null)
		_objOutput.value = lstTweak.join( "@" );
	else
		return( lstTweak.join( "@" ) );
}

function Serialize( _objOutput )
{
	lstSerial = new Array();
	
	for (indCustom=1; indCustom<=parseInt( lstCustoms[0] ); indCustom++)
	{
		for (indTable=1; indTable<=parseInt( lstTables[0] ); indTable++)
		{
			if (parseInt( lstTables[indTable][0] ) == indCustom)
			{
				indAxis		= 0;
				indNames	= 4;
				break;
			}
			else if (parseInt( lstTables[indTable][1] ) == indCustom)
			{
				indAxis		= 1;
				indNames	= 4 + parseInt( lstTables[indTable][2] );
				break;
			}
		}
		
		if (indTable > parseInt( lstTables[0] ))
			;//lstSerial[lstSerial.length] = "";
		else
		{	
			if (parseInt( lstTables[indTable][1] ) > parseInt(lstCustoms[0] ))
			{
				// ISO : THIS IS UGLY //
				if (lstCustoms[parseInt( lstTables[indTable][0] )][0] == "Custom Range")
				{
					objSelect = eval( "document.frmProduct.selCustom" + (parseInt(lstTables[indTable][0])-1) );
					
					if (objSelect.selectedIndex > 0)
						strValue = objSelect.options[objSelect.selectedIndex].text.substring( 0, 2 );
					else
						strValue = "";
						
					if (strValue == "YC")
						lstSerial[lstSerial.length] = eval( "document.frmProduct.txtCustomFromC" + lstTables[indTable][0] + ".value" ) + "/" + eval( "document.frmProduct.txtCustomToC" + lstTables[indTable][0] + ".value" ) + "C";
					else if (strValue == "YF")
						lstSerial[lstSerial.length] = eval( "document.frmProduct.txtCustomFromF" + lstTables[indTable][0] + ".value" ) + "/" + eval( "document.frmProduct.txtCustomToF" + lstTables[indTable][0] + ".value" ) + "F";
				}
				else
					lstSerial[lstSerial.length] =  eval( "document.frmProduct.txtCustom" + indCustom + ".value" );
			}
			else
			{
				if (parseInt( lstTables[indTable][2 + indAxis] ) <= 1)
					lstSerial[lstSerial.length] = lstTables[indTable][indNames][0];
				else
				{
					indSelected = eval( "document.frmProduct.selCustom" + indCustom + ".selectedIndex" ) - 1;
					lstSerial[lstSerial.length] = indSelected < 0 ? "n/a" : lstTables[indTable][indNames + indSelected][0];
				}
			}
		}
	}
	
	if (_objOutput != null)
		_objOutput.value = lstSerial.join( "@" );
	else
		return( lstSerial.join( "@" ) );
}

function SetEvents()
{
	for (indCustom=1; indCustom<=parseInt( lstCustoms[0] ); indCustom++)
	{
		txtCustom		= eval( "document.frmProduct.txtCustom"			+ indCustom );
		txtCustomFromC	= eval( "document.frmProduct.txtCustomFromC"	+ indCustom );
		txtCustomToC	= eval( "document.frmProduct.txtCustomToC"		+ indCustom );
		txtCustomFromF	= eval( "document.frmProduct.txtCustomFromF"	+ indCustom );
		txtCustomToF	= eval( "document.frmProduct.txtCustomToF"		+ indCustom );
		txtCustomView	= eval( "document.frmProduct.txtCustomView"		+ indCustom );
		
		if (txtCustom != null)
		{
			txtCustom.onkeydown		= function() { Refresh(); }
			txtCustom.onkeypress	= function() { Refresh(); }
			txtCustom.onkeyup		= function() { Refresh(); }
		}
		
		if (txtCustomFromC != null)
		{
			txtCustomFromC.onkeydown	= function() { Refresh(); }
			txtCustomFromC.onkeypress	= function() { Refresh(); }
			txtCustomFromC.onkeyup		= function() { Refresh(); }
		}
		
		if (txtCustomToC != null)
		{
			txtCustomToC.onkeydown	= function() { Refresh(); }
			txtCustomToC.onkeypress	= function() { Refresh(); }
			txtCustomToC.onkeyup	= function() { Refresh(); }
		}
		
		if (txtCustomFromF != null)
		{
			txtCustomFromF.onkeydown	= function() { Refresh(); }
			txtCustomFromF.onkeypress	= function() { Refresh(); }
			txtCustomFromF.onkeyup		= function() { Refresh(); }
		}
		
		if (txtCustomToF != null)
		{
			txtCustomToF.onkeydown	= function() { Refresh(); }
			txtCustomToF.onkeypress	= function() { Refresh(); }
			txtCustomToF.onkeyup	= function() { Refresh(); }
		}
		
		if (txtCustomView != null)
		{
			txtCustomView.onkeydown		= function() { return( false ); }
			txtCustomView.onkeypress	= function() { return( false ); }
			txtCustomView.onkeyup		= function() { return( false ); }
		}
	}
	
	if (window.document.frmProduct.txtTotal != null)
	{
		window.document.frmProduct.txtTotal.onchange	= function() { this.value = this.form.hidTotal.value; return( false ); }
		window.document.frmProduct.txtTotal.onkeydown	= function() { this.value = this.form.hidTotal.value; return( false ); }
		window.document.frmProduct.txtTotal.onkeypress	= function() { this.value = this.form.hidTotal.value; return( false ); }
		window.document.frmProduct.txtTotal.onkeyup		= function() { this.value = this.form.hidTotal.value; return( false ); }
	}
	
	if (window.document.frmProduct.txtNetTotal != null)
	{
		window.document.frmProduct.txtNetTotal.onchange		= function() { this.value = this.form.hidNetTotal.value; return( false ); }
		window.document.frmProduct.txtNetTotal.onkeydown	= function() { this.value = this.form.hidNetTotal.value; return( false ); }
		window.document.frmProduct.txtNetTotal.onkeypress	= function() { this.value = this.form.hidNetTotal.value; return( false ); }
		window.document.frmProduct.txtNetTotal.onkeyup		= function() { this.value = this.form.hidNetTotal.value; return( false ); }
	}
	
	if (window.document.frmProduct.txtQuantity != null)
	{
		window.document.frmProduct.txtQuantity.onchange		= function() { Refresh(); }
		window.document.frmProduct.txtQuantity.onkeydown	= function() { window.setTimeout( "window.document.frmProduct.txtQuantity.onchange()", 1 ); }
		window.document.frmProduct.txtQuantity.onkeypress	= function() { window.setTimeout( "window.document.frmProduct.txtQuantity.onchange()", 1 ); }
		window.document.frmProduct.txtQuantity.onkeyup		= function() { window.setTimeout( "window.document.frmProduct.txtQuantity.onchange()", 1 ); }
	}
}

function SetLayerStyle( strID, strStyle, varValue )
{
	if (document.all)
		pLayer = document.all[strID];
	else if (document.getElementById)
		pLayer = document.getElementById( strID );
	
	if (pLayer)
		eval( "pLayer.style." + strStyle + "=" + (isNaN(varValue)?"'":"") + varValue + (isNaN(varValue)?"'":"") );
}

function CelsiusToFahrenheit( _fltDegrees ) { return( (parseFloat( _fltDegrees ) * 1.8) + 32.0 ); }
function FahrenheitToCelsius( _fltDegrees ) { return( (parseFloat( _fltDegrees ) - 32.0) / 1.8 ); }
