	var refpage,stitle = "";

	refpage = document.referrer;

	sustidx = refpage.indexOf('sustainability.baxter.com');
	lastidx = refpage.lastIndexOf('/');
   	slastidx = refpage.lastIndexOf('/', lastidx - 1);

	subject = getQueryVariable("subject").toLowerCase();
	if (subject == "training")
	{
		message = getQueryVariable("message");
		subject = 11 * 1;
	}
	else
	{
		message = "";
		subject = 0 * 1;
	}

   	if(lastidx > 0 && slastidx > 0)
      		{
      			stitle = refpage.substring(slastidx+1, lastidx);
      			stitle = stitle.substring(0,1).toUpperCase() + stitle.substring(1,stitle.length);

      			while(stitle.indexOf('_') > 0)
         		{
         			casechar = stitle.indexOf('_');
         			ucaseb = stitle.substring(casechar, casechar+2);
         			ucasea = ucaseb.toUpperCase();
         			ucasea = ucasea.replace("_", " ");
         			stitle = stitle.replace(ucaseb, ucasea);
         		}

      			if ((stitle == "www.baxter.com") || (stitle == "Contact Us") || (stitle == "10.77.95.50"))
         		{
         			stitle = "";
         		}
      			else if(stitle == "TG")
         		{
         			stitle = "- Careers";
         		}
      			else if(stitle == "Ceq.baxter.com")
         		{
         			stitle = "- Professional Education Post-test";
         		}   
      			else if(stitle == "InvestorRelations")
         		{
         			stitle = "- Investor Relations";
         		}
      			else if(stitle == "welcome")
         		{
         			stitle = "- Supplier Diversity";
         		}
      			else
         		{
         			stitle = "- " + stitle;
         		}

			if (sustidx > 0)
				{
					stitle = "- Sustainability";
				}	
		}

		//h1_title = "Contact Us " + stitle;
		document.write ("<h1>Contact Us " + stitle + "</h1>");


	if(sustidx > 0)
   	{
   		requiredvar = "<font color='red'>*</font>";
   	}
	else
   	{
   		requiredvar = "";
   	}



	function getQueryVariable(variable)
	{ 
  		var query = window.location.search.substring(1); 
  		var vars = query.split("&"); 
  		for (var i=0;i<vars.length;i++)
			{ 
    				var pair = vars[i].split("="); 
    				if (pair[0] == variable)
				{ 
					pair[1] = pair[1].replace(/%20/g," ");
     					return pair[1]; 
    				}	 
			}

		return "";
	}


	function checkcust()
   	{
   		var cust=(document.comment.Customer_Type.options[document.comment.Customer_Type.selectedIndex].value);
   		if (cust == "Home Patient/Family Member")
      		{
      			alert("Please note that we cannot provide answers to personal medical questions, for these you should contact your physician."); 
      		}
   	}


	function makerequired()
   	{

   		if(sustidx < 0)
      		{
      			return true;
      		}

		var errormsg, error;
		errormsg = "The following fields are required:\n";
   		error = 0;

   		if(document.comment.First_Name.value == '')
      		{
      			errormsg += "First Name\n";
      			error = 1;
      		}

		if(document.comment.Last_Name.value == '')
      		{
      			errormsg += "Last Name\n";
      			error = 1;
      		}

   		if(document.comment.Organization.value == '')
      		{
      			errormsg += "Organization\n";
      			error = 1;
      		}

   		if(document.comment.Address_1.value == '')
      		{
      			errormsg += "Address\n";
      			error = 1;
      		}

		if(document.comment.Primary_Phone.value == '')
      		{
      			errormsg += "Phone\n";
      			error = 1;
      		}

		if(error > 0)
      		{
      			alert(errormsg);
      			return false;
      		}
   		else
      		{
      			return true;
      		}
	}


	function writeoption()
   	{

   		if(sustidx > 0)
      		{
      			document.write('<table  border="0">')
      			document.write('  <tr>')
      			document.write('    <td width="24">&nbsp;</td>')
      			document.write('    <td width="345"><font size="2" face="Arial, Helvetica, sans-serif"><a href="/images/about_baxter/sustainability/2004/sustainability_report_2004.pdf"  target="_blank">Click here</a> to download a PDF of the current Sustainability Report.  Visit the <a href="http://www.adobe.com/reader" target="_blank">Adobe Acrobat Reader</a> web site to download a free copy of Acrobat Reader and for information on installing and using Acrobat.</font></td><p><p>')
      			document.write('  </tr>')
      			document.write('  <tr>')
      			document.write('    <td width="24">&nbsp;</td>')
      			document.write('    <td width="345">&nbsp;</td>')
      			document.write('  </tr>') 
      			document.write('  <tr>')
      			document.write('    <td width="24"><font size="2" face="Arial, Helvetica, sans-serif"><input type="checkbox" name="Send Sustainability PDF" value="checkbox"></font></td>')
      			document.write('    <td width="345"><font size="2" face="Arial, Helvetica, sans-serif">Yes, I would like to receive a print summary of the current sustainability report.</font></td>')
      			document.write('  </tr>')
      			document.write('  <tr>')
      			document.write('    <td width="24"><font size="2" face="Arial, Helvetica, sans-serif"><input type="checkbox" name="Add to mailing list" value="checkbox"></font></td>')
      			document.write('    <td width="345"><font size="2" face="Arial, Helvetica, sans-serif">Yes, please add me to your mailing list to receive future updates regarding Sustainability activites.')
      			document.write('</font></td>')
      			document.write('  </tr>')
      			document.write('  <tr>')
      			document.write('    <td width="24"><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>')
      			document.write('    <td width="345"><font size="2" face="Arial, Helvetica, sans-serif">      <p>&nbsp;</p></font></td>')
      			document.write('  </tr>')
      			document.write('  <tr>')
      			document.write('    <td width="24"><font size="2" face="Arial, Helvetica, sans-serif"><input type="checkbox" name="checkbox" value="checkbox"></font></td>')
      			document.write('    <td width="345"><font size="2" face="Arial, Helvetica, sans-serif">Please remove me from the Sustainability mailing list. I am no longer interested in receiving Sustainability updates.</font></td>')
      			document.write('  </tr>')
      			document.write('</table>')
      		}
   	}


	function checknature()
   	{
   		var nature=(document.comment.Nature.options[document.comment.Nature.selectedIndex].value);

   		if ((nature == "Product Complaint") || (nature == "Quality Assurance"))
      			{
      				alert("Please note this system is not designed to respond to product complaints. For any product performance issues, please contact The Center for One Baxter at 800-422-9837 for quality assurance contact information.");
      			}
	}
   
   function checkshipment()
   	{
   		var nature=(document.comment.Nature.options[document.comment.Nature.selectedIndex].value);
		var start_message="Please provide your Order #, PO #, Item #, Quantity"
		var end_message=" within the comments section below."

   		if (nature == "Shipment Tracking")
      			{
				alert(start_message + end_message);
			}

		if (nature == "Shipment Discrepancy")
      			{
				alert(start_message + " Ordered, Item # and Code Received" + end_message);
			}
	}




