  
<!-- To be called in head section -->

	function noAppy(){ 
		document.contactform.appy.options.length=0;
	}

	$(document).ready(function() {
  		$("#mercado").change (function () {
			var str = "";
         		$("#mercado option:selected").each(function () {
                		str += $(this).val();
             		});
			
          		if (str == "Building and Construction") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Paint and coatings", "Paint and coatings", true, false);
				document.contactform.appy.options[1]=new Option("Window", "Window", true, false);
				document.contactform.appy.options[2]=new Option("Door", "Door", true, false);
				document.contactform.appy.options[3]=new Option("Flooring adhesives", "Flooring adhesives", true, false);//modified the name
				document.contactform.appy.options[4]=new Option("Flooring installation materials", "Flooring installation materials", true, false);
				// added newly on 28th October
				document.contactform.appy.options[4]=new Option("Caulks, Sealants and Construction Adhesives", "Caulks, Sealants and Construction Adhesives", true, false);

			}
		
         		if (str == "Consumer Products") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Consumer - Paint and coatings", "Consumer - Paint and coatings", true, false); // modified the name
				document.contactform.appy.options[1]=new Option("Consumers -Flooring installation materials", "Consumers -Flooring installation materials", true, false); // modified the name
				document.contactform.appy.options[2]=new Option("Consumer - Caulks, Sealants and Construction Adhesives", "Consumer - Caulks, Sealants and Construction Adhesives", true, false);//modified the name
			}	
	
         		if (str == "General Assembly") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Appliance", "Appliance", true, false);
				document.contactform.appy.options[1]=new Option("Air filter", "Air filter", true, false);
				document.contactform.appy.options[2]=new Option("Liquid separation filter", "Liquid separation filter", true, false);
				document.contactform.appy.options[3]=new Option("Engine, oil and, air filter", "Engine, oil and, air filter", true, false);
				document.contactform.appy.options[4]=new Option("Textile", "Textile", true, false);
				document.contactform.appy.options[5]=new Option("Footwear", "Footwear", true, false);
				document.contactform.appy.options[6]=new Option("Solar panel", "Solar panel", true, false);
				// document.contactform.appy.options[7]=new Option("Tubewinding", "Tubewinding", true, false); //removed since not present in website sections
				document.contactform.appy.options[7]=new Option("Foam and mattress", "Foam and mattress", true, false);
			}
			
         		if (str == "Packaging") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Case and Carton", "Case and Carton", true, false); //modified name
				document.contactform.appy.options[1]=new Option("Labeling", "Labeling", true, false);
				document.contactform.appy.options[2]=new Option("Flexible packaging", "Flexible packaging", true, false);
				document.contactform.appy.options[3]=new Option("Specialty packaging", "Specialty packaging", true, false);
				//document.contactform.appy.options[4]=new Option("Packaging engineering solutions", "Packaging engineering solutions", true, false);
				//document.contactform.appy.options[5]=new Option("Packaging reinforcement and opening systems", "Packaging reinforcement and opening systems", true, false);
				// newly added
				document.contactform.appy.options[4]=new Option("Packaging Engineering, Reinforcement and Opening Solutions", "Packaging Engineering, Reinforcement and Opening Solutions", true, false);

			}
			
         		if (str == "Paper Converting") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Tissue and towel", "Tissue and towel", true, false);
				document.contactform.appy.options[1]=new Option("Graphic arts and Bookbinding ", "Graphic arts and Bookbinding ", true, false); //modified name
				document.contactform.appy.options[2]=new Option("Envelope", "Envelope", true, false);
				document.contactform.appy.options[3]=new Option("Tape and label", "Tape and label", true, false);
				document.contactform.appy.options[4]=new Option("Corrugated", "Corrugated", true, false);
				document.contactform.appy.options[5]=new Option("Multi-wall bag", "Multi-wall bag", true, false);
				document.contactform.appy.options[6]=new Option("Paper napkin and facial tissue", "Paper napkin and facial tissue", true, false);
				// news added
				document.contactform.appy.options[7]=new Option("Paper Laminating Adhesives", "Paper Laminating Adhesives", true, false);
				document.contactform.appy.options[8]=new Option("Tubewinding Adhesives", "Tubewinding Adhesives", true, false);
			}
			
         		if (str == "Personal Hygiene and Nonwovens") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Diaper", "Diaper", true, false);
				document.contactform.appy.options[1]=new Option("Feminine care", "Feminine care ", true, false);
				document.contactform.appy.options[2]=new Option("Adult Incontinence", "Adult Incontinence", true, false); // name modified
				document.contactform.appy.options[3]=new Option("Pet and Medical pad", "Pet and Medical pad", true, false); // name modified
				document.contactform.appy.options[4]=new Option("Personal - Tissue and towel", "Personal - Tissue and towel", true, false);
				document.contactform.appy.options[5]=new Option("Paper Napkin and Facial Tissue", "Paper Napkin and Facial Tissue", true, false); // name modified
			} 
			
          		//if (str == "Specialty Materials") {
          		if (str == "Specialty Polymers") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Polymers for paint and coatings", "Polymers for paint and coatings", true, false);
				document.contactform.appy.options[1]=new Option("Polymers for adhesives", "Polymers for adhesives", true, false);
				document.contactform.appy.options[2]=new Option("Polymers for fiberglass", "Polymers for fiberglass", true, false);
				document.contactform.appy.options[3]=new Option("Polymers for building and construction", "Polymers for building and construction", true, false);
				document.contactform.appy.options[4]=new Option("Polymers for nonwovens, paper and textiles", "Polymers for nonwovens, paper and textiles", true, false);
			} 
			
         		//if (str == "Woodworking") {
         		if (str == "Woodworking Adhesives") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Cabinet and countertop", "Cabinet and countertop", true, false);
				document.contactform.appy.options[1]=new Option("Furniture", "Furniture", true, false);
				document.contactform.appy.options[2]=new Option("Millwork and profile wrap", "Millwork and profile wrap", true, false);
				document.contactform.appy.options[3]=new Option("Composite panel", "Composite panel", true, false);
				document.contactform.appy.options[4]=new Option("Transportation", "Transportation", true, false);
			}		
			
         		if (str == "Other") {
				$("#appy").hide();
			}			
        	}).change();

		//
  		$("#mercado").keypress (function () {
			var str = "";
         		$("#mercado option:selected").each(function () {
                		str += $(this).val();
             		});
			
          		if (str == "Building and Construction") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Paint and coatings", "Paint and coatings", true, false);
				document.contactform.appy.options[1]=new Option("Window", "Window", true, false);
				document.contactform.appy.options[2]=new Option("Door", "Door", true, false);
				document.contactform.appy.options[3]=new Option("Flooring adhesives", "Flooring adhesives", true, false);//modified the name
				document.contactform.appy.options[4]=new Option("Flooring installation materials", "Flooring installation materials", true, false);
				// added newly on 28th October
				document.contactform.appy.options[4]=new Option("Caulks, Sealants and Construction Adhesives", "Caulks, Sealants and Construction Adhesives", true, false);
			}
		
         		if (str == "Consumer Products") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Consumer - Paint and coatings", "Consumer - Paint and coatings", true, false); // modified the name
				document.contactform.appy.options[1]=new Option("Consumers -Flooring installation materials", "Consumers -Flooring installation materials", true, false); // modified the name
				document.contactform.appy.options[2]=new Option("Consumer - Caulks, Sealants and Construction Adhesives", "Consumer - Caulks, Sealants and Construction Adhesives", true, false);//modified the name
			}	
	
         		if (str == "General Assembly") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Appliance", "Appliance", true, false);
				document.contactform.appy.options[1]=new Option("Air filter", "Air filter", true, false);
				document.contactform.appy.options[2]=new Option("Liquid separation filter", "Liquid separation filter", true, false);
				document.contactform.appy.options[3]=new Option("Engine, oil and, air filter", "Engine, oil and, air filter", true, false);
				document.contactform.appy.options[4]=new Option("Textile", "Textile", true, false);
				document.contactform.appy.options[5]=new Option("Footwear", "Footwear", true, false);
				document.contactform.appy.options[6]=new Option("Solar panel", "Solar panel", true, false);
				// document.contactform.appy.options[7]=new Option("Tubewinding", "Tubewinding", true, false); //removed since not present in website sections
				document.contactform.appy.options[7]=new Option("Foam and mattress", "Foam and mattress", true, false);

			}
			
         		if (str == "Packaging") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Case and Carton", "Case and Carton", true, false); //modified name
				document.contactform.appy.options[1]=new Option("Labeling", "Labeling", true, false);
				document.contactform.appy.options[2]=new Option("Flexible packaging", "Flexible packaging", true, false);
				document.contactform.appy.options[3]=new Option("Specialty packaging", "Specialty packaging", true, false);
				//document.contactform.appy.options[4]=new Option("Packaging engineering solutions", "Packaging engineering solutions", true, false);
				//document.contactform.appy.options[5]=new Option("Packaging reinforcement and opening systems", "Packaging reinforcement and opening systems", true, false);
				// newly added
				document.contactform.appy.options[4]=new Option("Packaging Engineering, Reinforcement and Opening Solutions", "Packaging Engineering, Reinforcement and Opening Solutions", true, false);
			}
			
         		if (str == "Paper Converting") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Tissue and towel", "Tissue and towel", true, false);
				document.contactform.appy.options[1]=new Option("Graphic arts and Bookbinding ", "Graphic arts and Bookbinding ", true, false); //modified name
				document.contactform.appy.options[2]=new Option("Envelope", "Envelope", true, false);
				document.contactform.appy.options[3]=new Option("Tape and label", "Tape and label", true, false);
				document.contactform.appy.options[4]=new Option("Corrugated", "Corrugated", true, false);
				document.contactform.appy.options[5]=new Option("Multi-wall bag", "Multi-wall bag", true, false);
				document.contactform.appy.options[6]=new Option("Paper napkin and facial tissue", "Paper napkin and facial tissue", true, false);
				// news added
				document.contactform.appy.options[7]=new Option("Paper Laminating Adhesives", "Paper Laminating Adhesives", true, false);
				document.contactform.appy.options[8]=new Option("Tubewinding Adhesives", "Tubewinding Adhesives", true, false);

			} 
			
         		if (str == "Personal Hygiene and Nonwovens") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Diaper", "Diaper", true, false);
				document.contactform.appy.options[1]=new Option("Feminine care", "Feminine care ", true, false);
				document.contactform.appy.options[2]=new Option("Adult Incontinence", "Adult Incontinence", true, false); // name modified
				document.contactform.appy.options[3]=new Option("Pet and Medical pad", "Pet and Medical pad", true, false); // name modified
				document.contactform.appy.options[4]=new Option("Personal - Tissue and towel", "Personal - Tissue and towel", true, false);
				document.contactform.appy.options[5]=new Option("Paper Napkin and Facial Tissue", "Paper Napkin and Facial Tissue", true, false); // name modified
			} 
			
          		//if (str == "Specialty Materials") {
          		if (str == "Specialty Polymers") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Polymers for paint and coatings", "Polymers for paint and coatings", true, false);
				document.contactform.appy.options[1]=new Option("Polymers for adhesives", "Polymers for adhesives", true, false);
				document.contactform.appy.options[2]=new Option("Polymers for fiberglass", "Polymers for fiberglass", true, false);
				document.contactform.appy.options[3]=new Option("Polymers for building and construction", "Polymers for building and construction", true, false);
				document.contactform.appy.options[4]=new Option("Polymers for nonwovens, paper and textiles", "Polymers for nonwovens, paper and textiles", true, false);
			} 
			
          		//if (str == "Woodworking") {
          		if (str == "Woodworking Adhesives") {
				$("#appy").show();
				noAppy();
				document.contactform.appy.options[0]=new Option("Cabinet and countertop", "Cabinet and countertop", true, false);
				document.contactform.appy.options[1]=new Option("Furniture", "Furniture", true, false);
				document.contactform.appy.options[2]=new Option("Millwork and profile wrap", "Millwork and profile wrap", true, false);
				document.contactform.appy.options[3]=new Option("Composite panel", "Composite panel", true, false);
				document.contactform.appy.options[4]=new Option("Transportation", "Transportation", true, false);
			}		
			
         		if (str == "Other") {
				$("#appy").hide();
			}		
        	}).change();

		// Set Recipient
		$("#region").change (function () {
			var str = "";
          		$("#region option:selected").each(function () {
                		str += $(this).val();
             		});

         		if (str == "North America") {
				myrecipient = "inquiry@hbfuller.com";
				$("#recipient").val(myrecipient);
			}
		
         		//if (str == "Europe India Middle East and Africa") {
         		if (str == "Europe, India, Middle East and Africa (EIMEA)") {
				myrecipient = "info-europe@hbfuller.com";
				$("#recipient").val(myrecipient);
			}
		
         		if (str == "Latin America") {
				myrecipient = "LA.query@hbfuller.com";
				$("#recipient").val(myrecipient);
			}		
		
          		if (str == "Asia Pacific") {
				myrecipient = "AP.query@hbfuller.com";
				$("#recipient").val(myrecipient);
			}			
       		}).change();
	});
 

	function submitform() {
  		document.contactform.submit();
	}
	
    
	//<!-- Begin
	function validate() {
    		var theMessage = "Please complete the following: \n-----------------------------------\n";
    		var noErrors = theMessage

   		 // make sure field is not blank
   		if (document.contactform.FN.value=="") {
   			theMessage = theMessage + "\n --> Enter your First Name";
   		}
	
		// make sure field is not blank
   		if (document.contactform.LN.value=="") {
    			theMessage = theMessage + "\n --> Enter your Last name";
    		}
	
    		if (document.contactform.ByEmail.checked && document.contactform.email.value=="") {	
			// validate an e-mail address
	    		if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.contactform.email.value)){
	    			theMessage = theMessage + "\n --> Enter a Valid Email Address";
	    		}	    
   		}    

		if (document.contactform.region.selectedIndex==0) {
			theMessage = theMessage + "\n --> Select your region.";
		}

		if (document.contactform.mercado.selectedIndex==0) {
			theMessage = theMessage + "\n --> Select your market.";
		}

    		// If no errors, submit the form
    		if (theMessage == noErrors) {
    			document.contactform.submit();
   		} else {
    			// If errors were found, show alert message
    			alert(theMessage);
   			return false;
   		}
	}
	// End -->

