// <script type="text/javascript">
<!--  to hide script contents from old browsers

window.onload = init;

function init()
{
	display_urhere();
	setup_email();
}

/**************************************************************************************************
This function sets up a link for classes "emailRHSystems" and "emailMBW" to send email. 
Email address cannot be read by spambots.
**************************************************************************************************/

var name1 = "info";
var name2 = "RHSystems";
var name3 = "net";
var rh_systems_email = name1 + "@" + name2 + "." + name3;

var name1 = "info";
var name2 = "mbw";
var name3 = "ch";
var mbw_email = name1 + "@" + name2 + "." + name3;

function setup_email()
{
	var full;
	var anchors = document.getElementsByTagName("a");
	if (anchors == null)
		return;

	for (var i = 0; i < anchors.length; i++)
	{
		switch(anchors[i].className)
		{
			case "emailRHSystems":
			{
				anchors[i].onclick = function()
				{
					document.location.href = "mail" + "to:" + rh_systems_email;
					return(false);
				}
				anchors[i].onmouseover = function()
				{
					this.firstChild.nodeValue = rh_systems_email;
				}
				break;
			}
			case "emailMBW":
			{
				anchors[i].onclick = function()
				{
					document.location.href = "mail" + "to:" + mbw_email;
					return(false);
				}
				anchors[i].onmouseover = function()
				{
					this.firstChild.nodeValue = mbw_email;
				}
				break;
			}
		}
	}
}

/**************************************************************************************************
This function alters the style of the navigation bar to indicate urhere. I added code from the 
original to shorten the href string so that it does not include any bookmarks (....#bookmark). 
Otherwise, the strings would not match and the urhere formatting would not be applied.

The urhere for the subnavigation bar for Products, Services, and Support are also set in this 
routine.
**************************************************************************************************/

function display_urhere()
{	
	var href;
	
	if (!document.getElementById)
		return;

	var list = document.getElementById("navbar");
	var page = list.getElementsByTagName("a");
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);
	
	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.backgroundColor = "#fff";
			page[i].style.color = "#a83243";
			break;
		}
	}
	
	// Set urhere for Products subnavigation sidebar
	var list = document.getElementById("productsSidebar");
	if (list != null)
	{
		display_sidebar_urhere("sidebar-content");
		
		// This if statement is to handle exceptions to setting the urhere of the navigation bar.
		// If the current page is solutions_industries.php, don't set urhere of "Productx" in the 
		//  navigation bar.
		if (currentHref != 'solutions_industries.php')
		{
			var id = document.getElementById("productsID");
			id.style.backgroundColor = "#fff";
			id.style.color = "#a83243";
		}
	}

	// Set urhere for Support subnavigation sidebar
	var list = document.getElementById("supportSidebar");
	if (list != null)
	{
		display_sidebar_urhere("sidebar-content");
			
		var currentHref = document.location.href;
		var anchorPosition = currentHref.indexOf("#");
		if (anchorPosition >= 0)
		{	currentHref = currentHref.substring(0, anchorPosition);
		}
		currentHref = getSimpleHref(currentHref);
	
		if (currentHref != 'contact.php')
		{
			var id = document.getElementById("supportID");
			id.style.backgroundColor = "#fff";
			id.style.color = "#a83243";
		}
	}

	// Set urhere for Services subnavigation sidebar
	var list = document.getElementById("servicesSidebar");
	if (list != null)
	{
		display_sidebar_urhere("sidebar-content");
	}
}

/**************************************************************************************************
This function was added because Mac Safari does not include the directory structure
before the href, so there was never a match. This function strips the beginning directory structure
away and just leaves the end part--such as about_us.htm
**************************************************************************************************/

function getSimpleHref(s)
{	var length;
	var anchorPosition = 0;	

	while (anchorPosition >= 0)
	{	anchorPosition = s.indexOf('/');
		length = s.length;

		if (anchorPosition >= 0)
		{	s = s.substring(anchorPosition + 1, length);
		}		
	}
	
	return(s);
}

/*******************************************************************************
This function sets the urhere for the subnavigation sidebar.  
*******************************************************************************/

function display_sidebar_urhere(id)
{	
	var href;
	var list = document.getElementById(id);
	var page = list.getElementsByTagName("a");
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);

	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.textDecoration = "none";	
			page[i].style.backgroundImage = "none";	
			page[i].style.color = "#800";
			page[i].style.fontWeight = "bold";

			page[i].parentNode.style.background = "#fff";		// Parent node is <li>
			page[i].parentNode.style.width = "150px";			// Parent node is <li>

			break;
		}
	}
}

/**************************************************************************************************
The following functions and arrays display product information and image when the user performs a
mouseOver on a link to the particular product.
**************************************************************************************************/

var text_373 = new Array(1);
text_373[0] = 'The 373 Dew Point Mirror is a precision hygrometer exploiting advances in digital technology to satisfy the highest requirements in the measurement of humidity. As a true laboratory reference instrument, the 373 relies on proven optically detected chilled mirror techniques.';

var text_973 = new Array(1);
text_973[0] = 'The Model 973 Dew Point Mirror is a portable instrument equipped with an integral measuring head for both spot and continuous measurement of Dew/Frost point and temperature in air and gas mixtures. Based on the chilled mirror principle, the 973 ensures direct and accurate humidity measurement.';

var text_473 = new Array(1);
text_473[0] = 'The Model 473 Dew Point Mirror is a portable instrument equipped with a separate measuring head for both spot and continuous measurement of Dew/Frost point and temperature in air and gas mixtures. Based on the chilled mirror principle, the 473 ensures direct and accurate humidity measurement.';

var text_973_sf6 = new Array(1);
text_973_sf6[0] = 'The RH Systems Model 973-SF6 Analyzer was specifically designed for measurement of humidity and SF6 purity in gas insulated switchgear systems. Humidity measurement data is displayed in ppmv, ppmw and dew/frost point at either system pressure or standard pressure. Purity measurement is displayed directly in % volume SF6. Both the humidity and purity measurements utilize accurate and reliable condensation techniques.';

var text_973_a = new Array(1);
text_973_a[0] = 'The RH Systems Model 973-A dew point mirror was specifically designed for measurement of humidity in gas insulated switchgear (GIS) systems. Humidity measurement data is displayed in PPMv, PPMw and dew/frost point at either GIS pressure or standard pressure. Based on the chilled mirror principle, the 973-A ensures direct and accurate humidity measurement with minimal gas loss. For %Volume SF6 purity measurement and built-in gas recovery system, see the RH Systems 973-SF6.';

var text_dp19 = new Array(1);
text_dp19[0] = 'The model DP19 is a robust, easy to carry dew point hygrometer, specially designed for field use. A typical application of this instrument is the spot measurement in sulphurhexafluoride (SF6). Measurements are made at pressures between 10 mbar and 10 bar (1 kPa to 1 Mpa). Sample gas flow is effected by pressure difference between gas inlet and outlet, with a minimum of 10 mbar (1 kPa). If sample gas pressure is too low or the gas has to be measured in a closed circuit, an optional gas pump is available.';

var text_273 = new Array(1);
text_273[0] = 'The 2-channel digital thermometer is designed for stable, high precision temperature measurement over the range of -200 to +660°C. To further enhance stability, the measurement electronics are encapsulated in a constant temperature oven.';

var text_9000 = new Array(1);
text_9000[0] = 'The Model 9000 Humidity Generator produces extremely accurate humidity values using the fundamental, NIST proven, “two-pressure” principle. The 9000 will automatically supply relative humidity, dew point, frost point, ppm, or other calculated values for instrument calibration and evaluation as well as precision environmental testing. This system will automatically generate multipoint profiles as well as manually entered humidity levels, while continuously storing and printing system data.';

var text_4500 = new Array(1);
text_4500[0] = 'The Model 4500 automated low humidity generating system is based on the fundamental, NIST proven, “two temperature” and “two pressure” principles. This system is capable of continuously supplying extremely accurate humidity values for instrument calibration and evaluation. When used within the specified frost/dew point range of -95 °C to 10 °C, this system will automatically generate multipoint profiles as well as manually entered setpoints for days or even weeks.';

var text_3900 = new Array(1);
text_3900[0] = 'The Model 3900 Low Humidity Generator is an extremely accurate means of producing known humidity values for calibrating and verifying humidity instrumentation. Based on the combined, NIST proven, fundamental “two-pressure” and “two-temperature” principles, this system will automatically supply a continuous humidified gas stream, within the frost/dew point range of -95.0 °C to 10.0 °C, for days or even weeks unattended. Simply apply power to the system, and the 3900 will power-up ready to purge and/or generate. Humidity setpoint values are input by the operator from the front panel keypad and are limited only by the operational range of the 3900 humidity generator.';

var text_2500 = new Array(1);
text_2500[0] = 'The Model 2500 Benchtop Humidity Generator is a self contained system capable of producing atmospheres of known humidities using the fundamental, NIST proven, "two-pressure" principle. This system is capable of continuously supplying accurately known humidity values for instrument calibration, evaluation, and verification, as well as for environmental testing. Simply apply power and the 2500 will power-up ready to generate. Humidity setpoint values are input by the operator from the front panel keypad and are limited only by the range of the 2500 humidity generator.';

var text_1200 = new Array(1);
text_1200[0] = 'The Model 1200 Mini Humidity Generator produces accurate humidity values using the fundamental, NIST proven, “two-pressure” principle. The 1200 will automatically supply relative humidity, dew point, frost point, and other calculated values for instrument calibration and evaluation as well as precision environmental testing. This system automatically generates multipoint profiles as well as manually entered humidity levels, while continuously storing and printing system data.';

function display_product_info(product_id)
{	
	var newText;
	
	if (product_id == '373')
	{	newText = document.createTextNode(text_373);
	}
	else if (product_id == '973')
	{	newText = document.createTextNode(text_973);
	}
	else if (product_id == '473')
	{	newText = document.createTextNode(text_473);
	}
	else if (product_id == 'dp_19')
	{	newText = document.createTextNode(text_dp19);
	}
	else if (product_id == '273')
	{	newText = document.createTextNode(text_273);
	}
	else if (product_id == '973_sf6')
	{	newText = document.createTextNode(text_973_sf6);
	}
	else if (product_id == '973_a')
	{	newText = document.createTextNode(text_973_a);
	}

	else if (product_id == '9000')
	{	newText = document.createTextNode(text_9000);
	}
	else if (product_id == '4500')
	{	newText = document.createTextNode(text_4500);
	}
	else if (product_id == '3900')
	{	newText = document.createTextNode(text_3900);
	}
	else if (product_id == '2500')
	{	newText = document.createTextNode(text_2500);
	}
	else if (product_id == '1200')
	{	newText = document.createTextNode(text_1200);
	}

	var newElem = document.createElement("p");
	var oldChild = document.getElementById("productDescription").childNodes[0];
	document.getElementById('productDescription').replaceChild(newText, oldChild);
	
	display_product_image(product_id);
}

/*******************************************************************************
The following function displays an image in the location specified by 
productImage. There is some unused code setting pic1 = to a new Image and
assigning the image to pic1.src. This is usually used to preload images, but not
sure if I need it here. Should probably be done when page is first loaded.
*******************************************************************************/

function display_product_image(product_id)
{	if (document.images)
	{
		/* If Safari loads another image and both height and with are not different, then Safari 
		stretches the image to the same width as the previous image. The following code checks if
		Safari browser, and if true, loads a 1px x 1px image before loading the new image.
		******************************************************************************************/
		var safari = (navigator.userAgent.indexOf('Safari') != -1);	
		if (safari)
		{	document.images.targetImage.src = 'images/MsSpacer.gif';
		}
		
		var image_name;
		var folder = 'images/';		// Folder where all images are kept
		var pic1 = new Image();
		
		if (product_id == '373')
		{	image_name = '373_ExhibitPic_thumb'; 
		}
		else if (product_id == '973')
		{	image_name = '973_ExhibitPic_thumb';
		}
		else if (product_id == '473')
		{	image_name = '473_100px_wide';
		}
		else if (product_id == '973_sf6')
		{	image_name = '973sf6_100px_wide';
		}
		else if (product_id == '973_a')
		{	image_name = '973_ExhibitPic_thumb';
		}
		else if (product_id == 'dp_19')
		{	image_name = 'DP19_ExhibitPic_thumb';
		}
		else if (product_id == '273')
		{	image_name = '273_100px_wide';
		}
		else if (product_id == '9000')
		{	image_name = '9000_100px_wide';
		}
		else if (product_id == '4500')
		{	image_name = '4500_100px_wide';
		}
		else if (product_id == '3900')
		{	image_name = '3900_100px_wide';
		}
		else if (product_id == '2500')
		{	image_name = '2500_100px_wide';
		}
		else if (product_id == '1200')
		{	image_name = '1200_100px_wide';
		}

		pic1.src = folder + image_name + '.jpg'; 
		image_name = folder + image_name + '.jpg'; 

		document.images.productImage.src = image_name;
	}
}

/*******************************************************************************
The following arrays are for product specifications.
The 1st element and every 3rd element is set to 1 if that table entry is a subset
of the last entry that was set to 0.
*******************************************************************************/

specs_273_array = new Array
(

0, 'Display:', '4 Line, Numeric/Graph, User Selectable',
0, 'Probe Channels:', '2',
0, 'Connection Modes:', '2, 3, 4 Wire (User Selectable)',

0, 'Measuring Ranges per Channel:', '2',
1, '100 ohm max range', '1mA, switching DC ( -200 to +670 C)',
1, '400 ohm max range', '300 uA, switching DC ( -200 to +670 C)',

0, 'Units:', '°C, °F, K, ohms',
0, 'Display Values:', 'R1, R2, T1, T2, T1-T2',
0, 'Statistics Display:', 'min, max, mean, StdDev',
0, 'Data Logging:', 'time/date stamped more than 10,000 points',
0, 'Probe Configuration Options:', 'ITS-90, ITS-90 SubRange 5, CVD (ABC or AlphaDeltaBeta), DIN 385',
0, 'Coefficient Entry:',  'User entry via touch panel or RS-232',
0, 'Basic Accuracy:', '+/- 0.006°C',
0, 'Measuring Electronics:', 'Temperature controlled and stabilized',
0, 'Width:', '265 mm (600 mm with transport case)',
0, 'Height:', '155 mm (310 mm with transport case)',
0, 'Depth:', '285 mm (480 mm with transport case)',
0, 'Weight:', '4.7 Kg (14.7 Kg with transport case)'
)

specs_473_array = new Array
(
0, 'Measuring range:', '', 
1, 'Frost/Dew Point', '-20…+70°C',
1, '% RH', '5…100%',
1, 'Temperature', '-50...+150°C',

0, 'Accuracy:', '',
1, 'Frost/Dew point', '±0.2°C',
1, 'Temperature', '±0.1°C',

0, 'Reproducibility:', '', 
1, 'Frost/Dew Point', '± 0.05°C',
1, 'Temperature', '± 0.05°C',

0, 'Thermoelectric Mirror cooling:', '1-stage, 40°C depression',
0, 'Cooling:', 'Air',
0, 'Display:', 'Active Matrix Color Graphic LCD',
0, 'Digital I/O:', 'RS-232',
0, 'Mirror temperature sensor:', 'PRT-100', 

0, 'Operation temperature:', '',
1, 'Instrument', '-10…+40°C',
1, 'Measuring head', '-20…+80°C',

0, 'Storage temperature:', '-10…+50°C',
0, 'Ambient humidity: Instrument:', '90% RH max., non condensing in operation',
0, 'Voltage:', '100…240 VAC, 50/60 Hz (Battery operation optional)',
0, 'Power consumption:', '100 Watt',
0, 'Width:', '310 mm (600 mm with transport case)',
0, 'Height:', '155 mm (310 mm with transport case)',
0, 'Depth:',  '265 mm (450 mm with transport case)',
0, 'Weight:', '7 kg (17 kg with transport case)'
)

specs_973_array = new Array
(

0, 'Measuring range:', '',
1, 'Frost/Dew Point', '-50…+20°C',
1, '% RH', '5…100%',
1, 'Temperature', '-50…+150°C',

0, 'Accuracy:', '',
1, 'Frost/Dew point', '±0.1°C',
1, 'Temperature', '±0.1°C', 

0, 'Reproducibility:', '',
1, 'Frost/Dew Point', '± 0.05°C',
1, 'Temperature', '± 0.05°C',

0, 'Thermoelectric Mirror cooling:', '3-stage, 80°C depression',
0, 'Cooling:', 'Air',
0, 'Display:', 'Active Matrix Color Graphic LCD',
0, 'Digital I/O:', 'RS-232',
0, 'Gas couplings:', '¼” Swagelok',
0, 'Mirror temperature sensor:', 'PRT-100',
0, 'Sample gas flow rate:', '0.2…1.0 l/min',
0, 'Sample gas circuit:', 'PTFE (Teflon)', 
0, 'Operation temperature:', '-10…+40°C', 
0, 'Storage temperature:', '-10…+40°C', 
0, 'Ambient humidity:', 'Instrument 90% RH max., non condensing', 
0, 'Voltage:', '100…240 VAC, 50/60 Hz', 
0, 'Power consumption:', '200 Watt', 
0, 'Width:', '440 mm (600 mm with transport case)',

0, 'Height:', '155 mm (310 mm with transport case', 

0, 'Depth:', '410 mm (450 mm with transport case)',

0, 'Weight:', '12 kg (22 kg with transport case)'

)

specs_973_sf6_array = new Array
(

0, 'Measuring range:', '',
1, 'Frost/Dew Point', '-55…+20°C at atmospheric pressure',
1, 'Humidity content by volume', '20…20,000 ppmv',
1, 'Humidity content by weight', '2.5…2500 ppmw',
1, '% Volume SF6', '80…100%',
1, 'Pressure', '0.1…30 bar abs.',

0, 'Accuracy:', '',
1, 'Frost/Dew point', '±0.5°C',
1, 'ppmv/ppmw', '±6% of reading',
1, '% Volume SF6', '±0.5%',
1, 'Pressure', '0.2% FS',

0, 'Reproducibility:', '',
1, 'Frost/Dew Point', '± 0.2°C',
1, '% Volume SF6', '± 0.3%',
1, 'Pressure', '0.1% FS',

0, 'Thermoelectric Mirror cooling:', '3-stage',
0, 'Cooling:', 'Air',
0, 'Display:', 'Active Matrix Color Graphic LCD',
0, 'Digital I/O:', 'RS-232',
0, 'Gas couplings:', 'Quick connect fitting',
0, 'Mirror temperature sensor:', 'PRT-100',
0, 'Sample gas pressure:', '1…30 bar',
0, 'Sample gas flow rate:', '0.5…1 l/min',
0, 'Operation temperature:', '-10…+40°C',
0, 'Storage temperature:', '-20…+50°C',
0, 'Ambient humidity:', '90% RH max., non condensing in operation',
0, 'Voltage:', '100…240 VAC, 50/60 Hz',
0, 'Power consumption:', '200 Watt',

0, 'Width:', '440 mm (490 mm with transport case)',

0, 'Height:', '155 mm (360 mm with transport case', 

0, 'Depth:', '410 mm (650 mm with transport case)',

0, 'Weight:', '15 kg (27 kg with transport case)'

)


specs_973_a_array = new Array
(

0, 'Measuring range:', '',
1, 'Frost/Dew Point', '-55…+20°C at atmospheric pressure',
1, 'PPMv Range', '10 ...20,000',

0, 'Accuracy:', '',
1, 'Frost/Dew point', '±0.5°C',
1, 'PPMv', '±6% of reading',

0, 'Reproducibility:', '',
1, 'Frost/Dew Point', '± 0.2°C',
1, 'PPMv', '± 3% of reading',

0, 'Measuring Mode:', 'Automatic, with gas shutoff',
0, 'Thermoelectric Mirror cooling:', '3-stage, 80°C depression',
0, 'Cooling:', 'Air',
0, 'Display:', 'Active Matrix Color Graphic LCD',
0, 'Digital I/O:', 'RS-232',
0, 'Gas couplings:', 'Quick connect fitting',
0, 'Mirror temperature sensor:', 'PRT-100',
0, 'Sample gas flow rate:', '0.5 l/min',
0, 'Sample gas circuit:', 'PTFE (Teflon) and Stainless Steel',
0, 'Operation temperature:', '-10…+40°C',
0, 'Storage temperature:', '-10…+40°C',
0, 'Ambient humidity:', 'Instrument 90% RH max., non condensing in use',
0, 'Voltage:', '100…240 VAC, 50/60 Hz',
0, 'Power consumption:', '200 Watt',

0, 'Width:', '440 mm (600 mm with transport case)',

0, 'Height:', '155 mm (310 mm with transport case', 

0, 'Depth:', '410 mm (450 mm with transport case)',

0, 'Weight:', '13 kg (23 kg with transport case)'

)

/*******************************************************************************
The following functions build tables of product specs.
*******************************************************************************/

function build_273_specs_table()
{	build_specs_table(specs_273_array);
}

function build_473_specs_table()
{	build_specs_table(specs_473_array);
}

function build_973_specs_table()
{	
	build_specs_table(specs_973_array);
}

function build_973_sf6_specs_table()
{	build_specs_table(specs_973_sf6_array);
}

function build_973_a_specs_table()
{	build_specs_table(specs_973_a_array);
}

/*******************************************************************************
Note that the following <table> is wrapped in a <div> of width 100%. This is due
to a bug in IE5 and IE6 in quirks mode where the browser cannot correctly 
calculate the percentage width of a table when the parent container doesn't have a 
width specified. This seems to fix the problem.
*******************************************************************************/
function build_specs_table(specs_array)
{	var n = 0;
	var color = 0;
	
	document.writeln('<div style="width: 100%">');
	document.writeln('<table class="product-specs-table">');

	for (var i = 0; i < specs_array.length/3; i++)
	{

		if (specs_array[n++] == 1)
		{	if (color == 0)
			{	document.writeln('<tr>');	
			}
			else		
			{	document.writeln('<tr class="alt">');	
			}
			
			document.writeln('<th class="sub">' + specs_array[n++] + '</th>');
		}
		else
		{	if (color == 0)
			{	color = 1;
				document.writeln('<tr class="alt">');	
			}
			else
			{	color = 0;		
				document.writeln('<tr>');	
			}
			
			document.writeln('<th>' + specs_array[n++] + '</th>');
		}

		document.writeln('<td>' + specs_array[n++] + '</td>');

		document.writeln('</tr>');
	}
	
	document.writeln('</table>');
	document.writeln('</div>');
}

/*******************************************************************************
The following function will validate the form for requesting literature.
*******************************************************************************/

function validate_contact_form(form)
{
	var i, n, checked;
	var why = "";

	//Test for radio buttons
	for (i = 0, checked = 0; i < form.literature.length; i++) 
	{
		if (form.literature[i].checked) 
		{
			checked = 1;
		}
	}
	if (checked == 0)
    {	why += "Please select a product. \n";
    }

	if (form.name.value == '')
    {	why += "Please fill in your name. \n";
    }
	if (form.company.value == '')
    {	why += "Please fill in Company. \n";
    }
	if (form.country.value == '')
    {	why += "Please fill in Country. \n";
    }
	if (form.email.value == '')
    {	why += "Please fill in Email. \n";
    }

	if (why == "")
	{	return(true);
	}
	else
	{	alert(why);
		return(false);
	}
}

/*******************************************************************************
The following function will change the Product Serial Number values depending
on whether the user selects an RH Systems product or a Thunder Scientific 
product. If TS product, then another digit is added to the serial number.

RH serial number is: xx-yyzz
xx = year
yy = month
zz = day

TS serial number is: xx-yyzzz
xx = year
yy = month
zz = sequence number
*******************************************************************************/

function test_click(value, form)
{	var id, p;
	
	if ((value == '1200') ||
	(value == '2500') ||
	(value == '3900') ||
	(value == '4500') ||
	(value == '9000'))
	{
		form.product_serial_number_month_day.size="4";
		form.product_serial_number_month_day.maxLength="5";
		
		id = document.getElementById('dash');
		if (id.hasChildNodes())
		{
			id.removeChild(id.firstChild);
		}
	}
	else
	{
		form.product_serial_number_month_day.size="3";
		form.product_serial_number_month_day.maxLength="4";

		id = document.getElementById('dash');
		if (id.hasChildNodes())
		{
			id.removeChild(id.firstChild);
		}
		var newText = document.createTextNode('-');
		id.appendChild(newText);		
	}

	form.product_serial_number_month_day.value = "";
	form.product_serial_number_year.value = "";
}

/*******************************************************************************
The following function will validate the form for registering a product.

RH serial number is: xx-yyzz
xx = year
yy = month
zz = day

TS serial number is: xx-yyzzz
xx = year
yy = month
zz = sequence number
*******************************************************************************/

function validate_registration_form(form)
{
	var why = "";
	var model, thunder_product, month_day_size, day_size, day_range_min, day_range_max;
	
/***
	Test for radio buttons
	for (i = 0, checked = 0; i < form.product_registration.length; i++) 
	{
		if (form.product_registration[i].checked) 
		{
			checked = 1;
		}
	}
***/    
	
	model = form.product_model.value;
    if (model == 'not_selected')
	{
		why += 'Please select a model number. \n';
		form.product_serial_number_month_day.value="";
		form.product_serial_number_year.value="";
	}    
	else
	{
		if ((model == '1200') ||
		(model == '2500') ||
		(model == '3900') ||
		(model == '4500') ||
		(model == '9000'))
		{
			thunder_product = 1;
			month_day_size = 5;
			day_size = 3;
			day_range_min = 0;
			day_range_max = 999;
		}
		else
		{
			thunder_product = 0;
			month_day_size = 4;
			day_size = 2;
			day_range_min = 1;
			day_range_max = 31;
		}
	}
		
    var year = form.product_serial_number_year.value;
    var month_day = form.product_serial_number_month_day.value;
	var month = month_day.substring(0, 2);
	var day = month_day.substring(2, month_day_size);
	
    if ((year.length < 2) || (year.length > 2))
    {	why += "Serial Number: Please enter 2 numbers in the 1st column for the product serial number. \n";
    }
    if ((month_day.length < month_day_size) || (month_day.length > month_day_size))
    {	why += 'Serial Number: Please enter ' + month_day_size + ' numbers in the 2nd column for the product serial number. \n';
    }
    if (!(year >= 0 && year <= 99))
    {	why += "Serial Number: Value for 1st column of serial number must be numbers. \n";
    }
	if ((month < 1) || (month > 12))
    {	why += "Serial Number: The 1st 2 numbers in the 2nd column must be between 1 and 12. \n";
	}
	
	if ((day < day_range_min) || (day > day_range_max))
	{	why += 'Serial Number: The last ' + day_size + ' numbers in the 2nd column must be between ' + day_range_min + ' and ' + day_range_max + '. \n';
	}

	if (form.realname.value == '')
    {	why += "Please Fill in your name. \n";
    }

	if (form.company.value == '')
    {	why += "Please fill in Company. \n";
    }
	if (form.country.value == '')
    {	why += "Please fill in Country. \n";
    }
	if (form.email.value == '')
    {	why += "Please fill in Email. \n";
    }

	if (why == "")
	{	return(true);
	}
	else
	{	alert(why);
		return(false);	
	}
}


// end hiding contents from old browsers  -->
// </script>




