		
	function populateSite(nr, selectedValue, selectedText) {
		pSite = "productionSite";
		allSites = document.packaging.pSite;
		siteVal = document.packaging.prodSite;
		
		if (nr==0) {
			document.pd.productionSite.options.length = 1;
			document.pd.packagingType.options.length = 1;
			document.pd.productionSite.options[0].text = "Select";
			document.pd.packagingType.options[0].text = "Select";
			
			return;
		}
		else {
			document.pd.productionSite.options.length = 1;
			document.pd.packagingType.options.length = 1;
			document.pd.packagingType.options[0].text = "Select";
			document.pd.productionSite.options[0].text = "Select";
			matchingSites = 0;
			for (a=0; a<allSites.length; a++) {
				if (selectedValue == allSites[a].value) {
				matchingSites++;
				}
			}
			document.pd.productionSite.options.length = matchingSites + 1;
			
			
			j=1;
			for (i=0; i<allSites.length; i++) {
				if (selectedValue == allSites[i].value) {
					document.pd.productionSite.options[0].text = "Select";
					document.pd.productionSite.options[j].text = allSites[i].text;
					document.pd.productionSite.options[j].value = siteVal[i].value;
					j++;
				}
			}
		}
				
		
	}
	
	function populateType(nr, selectedValue, selectedText) {
		allTypes = document.packaging.pType;
		allPackages = document.packaging.packType;
		
		if (nr==0) {
			return;
		}
		else {
			document.pd.packagingType.options.length = 1;
			document.pd.packagingType.options[0].text = "Select";
			matchingTypes = 0;
			for (a=0; a<allTypes.length; a++) {
				if (selectedValue == allTypes[a].value) {
				matchingTypes++;
				}
			}
			document.pd.packagingType.options.length = matchingTypes + 1;
			
			j=1;
			for (i=0; i<allTypes.length; i++) {
				if (selectedValue == allTypes[i].value) {
					document.pd.packagingType.options[0].text = "Select";
					document.pd.packagingType.options[j].text = allTypes[i].text;
					document.pd.packagingType.options[j].value = allPackages[i].text;
					j++;
				}
			}
			
		}
		
	}
	
	function openUrl(nr, selectedValue, selectedText) {
		//alert(selectedValue)
		//allPackages = document.packaging.packagingType;
		allPackages = document.packaging.packType;
		
		if (nr==0) {
			return;
		}
		else {
			url = "";
			for (i=0; i<allPackages.length; i++) {
				if (selectedValue == allPackages[i].text) {
					url = allPackages[i].text;
				}
			}	
			if (url != "") {
			window.open("/pdf/packaging-datasheet/" + url);
			}
		}
	}

	
	function makeDisable(dropdown){
    var x=document.getElementById(dropdown)
    x.disabled=true
	}
	
	function makeEnable(dropdown){
    var x=document.getElementById(dropdown)
    x.disabled=false
	}


