
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function update_totals()
{
	var	price1 = document.form1.price1_sub.value;
	var	country = document.form1.ship_to_country.options[document.form1.ship_to_country.selectedIndex].value;
	
	if (price1 != "")
	{	
		price1 = parseFloat(price1);
		price1 = price1.toFixed(2);
		document.form1.sub_total.value = price1;
		if (country == "Canada")
		{
			var gst = parseFloat((parseFloat(price1) * .07));
			gst = gst.toFixed(2);
			document.form1.gst.value = gst;
			
			var total = parseFloat(price1) + parseFloat(gst);
			total = total.toFixed(2);
			document.form1.total.value = total;
		}
		else
		{
			document.form1.gst.value = "0";
			document.form1.total.value = price1;
		}
	}
	else
	{
		document.form1.sub_total.value = "";
		document.form1.gst.value = "";
		document.form1.total.value = "";
	}
}

function update_price1_sub()
{
	var	qty = document.form1.qty1.value;
	var	price = document.form1.price1_each.value;
	
	if ((qty != "") && (price != ""))
	{
		document.form1.price1_sub.value = (qty * price);
	}
	update_totals()
}

function update_price1_each()
{
	var	product = document.form1.product1.options[document.form1.product1.selectedIndex].value;
	var	frame_size = document.form1.frame_size1.options[document.form1.frame_size1.selectedIndex].value;
	var	nitride_thickness = document.form1.nitride_thickness1.options[document.form1.nitride_thickness1.selectedIndex].value;
	var	window_size = document.form1.window_size1.options[document.form1.window_size1.selectedIndex].value;

	if ((product != " ") && (frame_size != " ") && (nitride_thickness != " ") && (window_size != " ")) {
		if (product == "Nitride-Xray") {
			if (frame_size == "5x5 mm") {
				if ((nitride_thickness == "50 nm") || (nitride_thickness == "75 nm")) {
					document.form1.price1_each.value = "20";
				}
				else {
					document.form1.price1_each.value = "14";
				}
			}
			else if (frame_size == "7.5x7.5 mm") {
				if ((nitride_thickness == "50 nm") || (nitride_thickness == "75 nm")) {
					document.form1.price1_each.value = "35";
				}
				else {
					document.form1.price1_each.value = "23";
				}
		    }
		}
		else {
			document.form1.price1_each.value = "12";
		}
	}
	else {
		document.form1.price1_each.value = "";
		document.form1.price1_sub.value = "";
	}
	update_price1_sub();
}

function line1_check()
{
	if (document.form1.check1.checked == true)
	{
		document.form1.qty1.disabled = false;
		document.form1.product1.disabled = false;
	}
	else
	{
		document.form1.qty1.value = "";
		document.form1.qty1.disabled = true;
		document.form1.product1.selectedIndex = 0;
		document.form1.product1.disabled = true;
		document.form1.frame_size1.selectedIndex = 0;
		document.form1.frame_size1.disabled = true;
		document.form1.nitride_thickness1.selectedIndex = 0;
		document.form1.nitride_thickness1.disabled = true;
		document.form1.window_size1.selectedIndex = 0;
		document.form1.window_size1.disabled = true;
	}
}

function product1_change()
{
	if (document.form1.product1.options[document.form1.product1.selectedIndex].value == "Nitride-Xray")
	{
		// FRAME SIZE
		document.form1.frame_size1.options.length = 1
		var optionName1 = new Option("5x5 mm", "5x5 mm", true, true)
		document.form1.frame_size1.options[1] = optionName1;
		var optionName1 = new Option("7.5x7.5 mm", "7.5x7.5 mm", true, true)
		document.form1.frame_size1.options[2] = optionName1;
		document.form1.frame_size1.disabled = false;
		document.form1.frame_size1.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness1.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness1.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness1.options[2] = optionName1;
		var optionName1 = new Option("100 nm", "100 nm", true, true)
		document.form1.nitride_thickness1.options[3] = optionName1;
		document.form1.nitride_thickness1.disabled = false;
		document.form1.nitride_thickness1.selectedIndex = 0;

		// WINDOW SIZE
		document.form1.window_size1.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size1.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size1.options[2] = optionName1;
		var optionName1 = new Option("1 mm square", "1 mm square", true, true)
		document.form1.window_size1.options[3] = optionName1;
		var optionName1 = new Option("1.5 mm square", "1.5 mm square", true, true)
		document.form1.window_size1.options[4] = optionName1;
		document.form1.window_size1.disabled = false;
		document.form1.window_size1.selectedIndex = 0;
	}
	else if (document.form1.product1.options[document.form1.product1.selectedIndex].value == "Nitride-TEM")
	{
		// FRAME SIZE
		document.form1.frame_size1.options.length = 1
		var optionName1 = new Option("2.65x2.65 mm", "2.65x2.65 mm", true, true)
		document.form1.frame_size1.options[1] = optionName1;
		document.form1.frame_size1.disabled = false;
		document.form1.frame_size1.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness1.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness1.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness1.options[2] = optionName1;
		document.form1.nitride_thickness1.disabled = false;
		document.form1.nitride_thickness1.selectedIndex = 0;
		
		// WINDOW SIZE
		document.form1.window_size1.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size1.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size1.options[2] = optionName1;
		document.form1.window_size1.disabled = false;
		document.form1.window_size1.selectedIndex = 0;
	}
	else
	{
		// FRAME SIZE
		document.form1.frame_size1.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.frame_size1.options[1] = optionName1;
		document.form1.frame_size1.disabled = true;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness1.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.nitride_thickness1.options[1] = optionName1;
		document.form1.nitride_thickness1.disabled = true;
		
		// WINDOW SIZE
		document.form1.window_size1.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.window_size1.options[1] = optionName1;
		document.form1.window_size1.disabled = true;
	}
	//update_price1_each();
}



function line2_check()
{
	if (document.form1.check2.checked == true)
	{
		document.form1.qty2.disabled = false;
		document.form1.product2.disabled = false;
	}
	else
	{
		document.form1.qty2.value = "";
		document.form1.qty2.disabled = true;
		document.form1.product2.selectedIndex = 0;
		document.form1.product2.disabled = true;
		document.form1.frame_size2.selectedIndex = 0;
		document.form1.frame_size2.disabled = true;
		document.form1.nitride_thickness2.selectedIndex = 0;
		document.form1.nitride_thickness2.disabled = true;
		document.form1.window_size2.selectedIndex = 0;
		document.form1.window_size2.disabled = true;
	}
}

function product2_change()
{
	if (document.form1.product2.options[document.form1.product2.selectedIndex].value == "Nitride-Xray")
	{
		// FRAME SIZE
		document.form1.frame_size2.options.length = 1
		var optionName1 = new Option("5x5 mm", "5x5 mm", true, true)
		document.form1.frame_size2.options[1] = optionName1;
		var optionName1 = new Option("7.5x7.5 mm", "7.5x7.5 mm", true, true)
		document.form1.frame_size2.options[2] = optionName1;
		document.form1.frame_size2.disabled = false;
		document.form1.frame_size2.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness2.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness2.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness2.options[2] = optionName1;
		var optionName1 = new Option("100 nm", "100 nm", true, true)
		document.form1.nitride_thickness2.options[3] = optionName1;
		document.form1.nitride_thickness2.disabled = false;
		document.form1.nitride_thickness2.selectedIndex = 0;

		// WINDOW SIZE
		document.form1.window_size2.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size2.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size2.options[2] = optionName1;
		var optionName1 = new Option("1 mm square", "1 mm square", true, true)
		document.form1.window_size2.options[3] = optionName1;
		var optionName1 = new Option("1.5 mm square", "1.5 mm square", true, true)
		document.form1.window_size2.options[4] = optionName1;
		document.form1.window_size2.disabled = false;
		document.form1.window_size2.selectedIndex = 0;
	}
	else if (document.form1.product2.options[document.form1.product2.selectedIndex].value == "Nitride-TEM")
	{
		// FRAME SIZE
		document.form1.frame_size2.options.length = 1
		var optionName1 = new Option("2.65x2.65 mm", "2.65x2.65 mm", true, true)
		document.form1.frame_size2.options[1] = optionName1;
		document.form1.frame_size2.disabled = false;
		document.form1.frame_size2.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness2.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness2.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness2.options[2] = optionName1;
		document.form1.nitride_thickness2.disabled = false;
		document.form1.nitride_thickness2.selectedIndex = 0;
		
		// WINDOW SIZE
		document.form1.window_size2.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size2.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size2.options[2] = optionName1;
		document.form1.window_size2.disabled = false;
		document.form1.window_size2.selectedIndex = 0;
	}
	else
	{
		// FRAME SIZE
		document.form1.frame_size2.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.frame_size2.options[1] = optionName1;
		document.form1.frame_size2.disabled = true;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness2.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.nitride_thickness2.options[1] = optionName1;
		document.form1.nitride_thickness2.disabled = true;
		
		// WINDOW SIZE
		document.form1.window_size2.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.window_size2.options[1] = optionName1;
		document.form1.window_size2.disabled = true;
	}
	//update_price2_each();
}



function line3_check()
{
	if (document.form1.check3.checked == true)
	{
		document.form1.qty3.disabled = false;
		document.form1.product3.disabled = false;
	}
	else
	{
		document.form1.qty3.value = "";
		document.form1.qty3.disabled = true;
		document.form1.product3.selectedIndex = 0;
		document.form1.product3.disabled = true;
		document.form1.frame_size3.selectedIndex = 0;
		document.form1.frame_size3.disabled = true;
		document.form1.nitride_thickness3.selectedIndex = 0;
		document.form1.nitride_thickness3.disabled = true;
		document.form1.window_size3.selectedIndex = 0;
		document.form1.window_size3.disabled = true;
	}
}

function product3_change()
{
	if (document.form1.product3.options[document.form1.product3.selectedIndex].value == "Nitride-Xray")
	{
		// FRAME SIZE
		document.form1.frame_size3.options.length = 1
		var optionName1 = new Option("5x5 mm", "5x5 mm", true, true)
		document.form1.frame_size3.options[1] = optionName1;
		var optionName1 = new Option("7.5x7.5 mm", "7.5x7.5 mm", true, true)
		document.form1.frame_size3.options[2] = optionName1;
		document.form1.frame_size3.disabled = false;
		document.form1.frame_size3.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness3.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness3.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness3.options[2] = optionName1;
		var optionName1 = new Option("100 nm", "100 nm", true, true)
		document.form1.nitride_thickness3.options[3] = optionName1;
		document.form1.nitride_thickness3.disabled = false;
		document.form1.nitride_thickness3.selectedIndex = 0;

		// WINDOW SIZE
		document.form1.window_size3.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size3.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size3.options[2] = optionName1;
		var optionName1 = new Option("1 mm square", "1 mm square", true, true)
		document.form1.window_size3.options[3] = optionName1;
		var optionName1 = new Option("1.5 mm square", "1.5 mm square", true, true)
		document.form1.window_size3.options[4] = optionName1;
		document.form1.window_size3.disabled = false;
		document.form1.window_size3.selectedIndex = 0;
	}
	else if (document.form1.product3.options[document.form1.product3.selectedIndex].value == "Nitride-TEM")
	{
		// FRAME SIZE
		document.form1.frame_size3.options.length = 1
		var optionName1 = new Option("2.65x2.65 mm", "2.65x2.65 mm", true, true)
		document.form1.frame_size3.options[1] = optionName1;
		document.form1.frame_size3.disabled = false;
		document.form1.frame_size3.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness3.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness3.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness3.options[2] = optionName1;
		document.form1.nitride_thickness3.disabled = false;
		document.form1.nitride_thickness3.selectedIndex = 0;
		
		// WINDOW SIZE
		document.form1.window_size3.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size3.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size3.options[2] = optionName1;
		document.form1.window_size3.disabled = false;
		document.form1.window_size3.selectedIndex = 0;
	}
	else
	{
		// FRAME SIZE
		document.form1.frame_size3.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.frame_size3.options[1] = optionName1;
		document.form1.frame_size3.disabled = true;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness3.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.nitride_thickness3.options[1] = optionName1;
		document.form1.nitride_thickness3.disabled = true;
		
		// WINDOW SIZE
		document.form1.window_size3.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.window_size3.options[1] = optionName1;
		document.form1.window_size3.disabled = true;
	}
	//update_price3_each();
}



function line4_check()
{
	if (document.form1.check4.checked == true)
	{
		document.form1.qty4.disabled = false;
		document.form1.product4.disabled = false;
	}
	else
	{
		document.form1.qty4.value = "";
		document.form1.qty4.disabled = true;
		document.form1.product4.selectedIndex = 0;
		document.form1.product4.disabled = true;
		document.form1.frame_size4.selectedIndex = 0;
		document.form1.frame_size4.disabled = true;
		document.form1.nitride_thickness4.selectedIndex = 0;
		document.form1.nitride_thickness4.disabled = true;
		document.form1.window_size4.selectedIndex = 0;
		document.form1.window_size4.disabled = true;
	}
}

function product4_change()
{
	if (document.form1.product4.options[document.form1.product4.selectedIndex].value == "Nitride-Xray")
	{
		// FRAME SIZE
		document.form1.frame_size4.options.length = 1
		var optionName1 = new Option("5x5 mm", "5x5 mm", true, true)
		document.form1.frame_size4.options[1] = optionName1;
		var optionName1 = new Option("7.5x7.5 mm", "7.5x7.5 mm", true, true)
		document.form1.frame_size4.options[2] = optionName1;
		document.form1.frame_size4.disabled = false;
		document.form1.frame_size4.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness4.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness4.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness4.options[2] = optionName1;
		var optionName1 = new Option("100 nm", "100 nm", true, true)
		document.form1.nitride_thickness4.options[3] = optionName1;
		document.form1.nitride_thickness4.disabled = false;
		document.form1.nitride_thickness4.selectedIndex = 0;

		// WINDOW SIZE
		document.form1.window_size4.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size4.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size4.options[2] = optionName1;
		var optionName1 = new Option("1 mm square", "1 mm square", true, true)
		document.form1.window_size4.options[3] = optionName1;
		var optionName1 = new Option("1.5 mm square", "1.5 mm square", true, true)
		document.form1.window_size4.options[4] = optionName1;
		document.form1.window_size4.disabled = false;
		document.form1.window_size4.selectedIndex = 0;
	}
	else if (document.form1.product4.options[document.form1.product4.selectedIndex].value == "Nitride-TEM")
	{
		// FRAME SIZE
		document.form1.frame_size4.options.length = 1
		var optionName1 = new Option("2.65x2.65 mm", "2.65x2.65 mm", true, true)
		document.form1.frame_size4.options[1] = optionName1;
		document.form1.frame_size4.disabled = false;
		document.form1.frame_size4.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness4.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness4.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness4.options[2] = optionName1;
		document.form1.nitride_thickness4.disabled = false;
		document.form1.nitride_thickness4.selectedIndex = 0;
		
		// WINDOW SIZE
		document.form1.window_size4.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size4.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size4.options[2] = optionName1;
		document.form1.window_size4.disabled = false;
		document.form1.window_size4.selectedIndex = 0;
	}
	else
	{
		// FRAME SIZE
		document.form1.frame_size4.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.frame_size4.options[1] = optionName1;
		document.form1.frame_size4.disabled = true;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness4.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.nitride_thickness4.options[1] = optionName1;
		document.form1.nitride_thickness4.disabled = true;
		
		// WINDOW SIZE
		document.form1.window_size4.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.window_size4.options[1] = optionName1;
		document.form1.window_size4.disabled = true;
	}
	//update_price4_each();
}



function line5_check()
{
	if (document.form1.check5.checked == true)
	{
		document.form1.qty5.disabled = false;
		document.form1.product5.disabled = false;
	}
	else
	{
		document.form1.qty5.value = "";
		document.form1.qty5.disabled = true;
		document.form1.product5.selectedIndex = 0;
		document.form1.product5.disabled = true;
		document.form1.frame_size5.selectedIndex = 0;
		document.form1.frame_size5.disabled = true;
		document.form1.nitride_thickness5.selectedIndex = 0;
		document.form1.nitride_thickness5.disabled = true;
		document.form1.window_size5.selectedIndex = 0;
		document.form1.window_size5.disabled = true;
	}
}

function product5_change()
{
	if (document.form1.product5.options[document.form1.product5.selectedIndex].value == "Nitride-Xray")
	{
		// FRAME SIZE
		document.form1.frame_size5.options.length = 1
		var optionName1 = new Option("5x5 mm", "5x5 mm", true, true)
		document.form1.frame_size5.options[1] = optionName1;
		var optionName1 = new Option("7.5x7.5 mm", "7.5x7.5 mm", true, true)
		document.form1.frame_size5.options[2] = optionName1;
		document.form1.frame_size5.disabled = false;
		document.form1.frame_size5.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness5.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness5.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness5.options[2] = optionName1;
		var optionName1 = new Option("100 nm", "100 nm", true, true)
		document.form1.nitride_thickness5.options[3] = optionName1;
		document.form1.nitride_thickness5.disabled = false;
		document.form1.nitride_thickness5.selectedIndex = 0;

		// WINDOW SIZE
		document.form1.window_size5.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size5.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size5.options[2] = optionName1;
		var optionName1 = new Option("1 mm square", "1 mm square", true, true)
		document.form1.window_size5.options[3] = optionName1;
		var optionName1 = new Option("1.5 mm square", "1.5 mm square", true, true)
		document.form1.window_size5.options[4] = optionName1;
		document.form1.window_size5.disabled = false;
		document.form1.window_size5.selectedIndex = 0;
	}
	else if (document.form1.product5.options[document.form1.product5.selectedIndex].value == "Nitride-TEM")
	{
		// FRAME SIZE
		document.form1.frame_size5.options.length = 1
		var optionName1 = new Option("2.65x2.65 mm", "2.65x2.65 mm", true, true)
		document.form1.frame_size5.options[1] = optionName1;
		document.form1.frame_size5.disabled = false;
		document.form1.frame_size5.selectedIndex = 0;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness5.options.length = 1
		var optionName1 = new Option("50 nm", "50 nm", true, true)
		document.form1.nitride_thickness5.options[1] = optionName1;
		var optionName1 = new Option("75 nm", "75 nm", true, true)
		document.form1.nitride_thickness5.options[2] = optionName1;
		document.form1.nitride_thickness5.disabled = false;
		document.form1.nitride_thickness5.selectedIndex = 0;
		
		// WINDOW SIZE
		document.form1.window_size5.options.length = 1
		var optionName1 = new Option(".25 mm square", ".25 mm square", true, true)
		document.form1.window_size5.options[1] = optionName1;
		var optionName1 = new Option(".5 mm square", ".5 mm square", true, true)
		document.form1.window_size5.options[2] = optionName1;
		document.form1.window_size5.disabled = false;
		document.form1.window_size5.selectedIndex = 0;
	}
	else
	{
		// FRAME SIZE
		document.form1.frame_size5.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.frame_size5.options[1] = optionName1;
		document.form1.frame_size5.disabled = true;

		// NITRIDE THICKNESS
		document.form1.nitride_thickness5.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.nitride_thickness5.options[1] = optionName1;
		document.form1.nitride_thickness5.disabled = true;
		
		// WINDOW SIZE
		document.form1.window_size5.options.length = 1
		var optionName1 = new Option("", "", true, true)
		document.form1.window_size5.options[1] = optionName1;
		document.form1.window_size5.disabled = true;
	}
	//update_price1_each();
}


function same_shipping()
{
	if (document.form1.same_as_shipping.checked == true)
	{
		document.form1.address1_bill.value = "";
		document.form1.address2_bill.value = "";
		document.form1.city_bill.value = "";
		document.form1.province_bill.value = "";
		document.form1.country_bill.value = "";
		document.form1.postcode_bill.value = "";
	
		document.form1.address1_bill.disabled = true;
		document.form1.address2_bill.disabled = true;
		document.form1.city_bill.disabled = true;
		document.form1.province_bill.disabled = true;
		document.form1.country_bill.disabled = true;
		document.form1.postcode_bill.disabled = true;
	}
	else
	{
		document.form1.address1_bill.disabled = false;
		document.form1.address2_bill.disabled = false;
		document.form1.city_bill.disabled = false;
		document.form1.province_bill.disabled = false;
		document.form1.country_bill.disabled = false;
		document.form1.postcode_bill.disabled = false;
	}
}

function check_for_errors()
{
	var problems = "";

	if (document.form1.full_name.value == "")
	{
		problems = problems+"\n- Please enter your full name";
	}
	if (document.form1.company.value == "")
	{
		problems = problems+"\n- Please enter a company or organization";
	}
	if (document.form1.phone.value == "")
	{
		problems = problems+"\n- Please enter a phone number";
	}
	if (document.form1.email.value == "")
	{
		problems = problems+"\n- Please enter an email address";
	}
	if (!(document.form1.email.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\.coop)|(\.info)|(\.name)|(\.pro)|(\.int)|(\.aero)|(\..{2,2}))$)\b/gi)))
	{
		problems = problems+"\n- Your Email Address does not appear to be valid";
	}
	if (problems != "")
	{
		alert ("The following problems were encountered:\n"+problems+"\n\nPlease update these fields and try again. Thanks!");
	}
	else
	{
		document.form1.submit();
	}
}
