// when the DOM is ready

$(document).ready(function () {

	var dogProducts = {
		"/dogs/enacard.asp" : "ENACARD",
		"/dogs/heartgard-30-plus.asp" : "HEARTGARD-30 PLUS",
		"/dogs/recombitek.asp" : "RECOMBITEK",
		"/dogs/recombitek-lyme.asp" : "RECOMBITEK LYME",
		"/dogs/recombitek-kc2.asp" : "RECOMBITEK KC2",
		"/dogs/imrab-1-3.asp" : "IMRAB",
		"/dogs/previcox.asp" : "PREVICOX",
		"/dogs/surolan-drops.asp" : "SUROLAN",
		"/dogs/conofite-cream.asp" : "CONOFITE",
		"/dogs/imaverol.asp" : "IMAVEROL",
		"" : "Specify a Product"
	}
	
	var catProducts = {
		"/cats/purevax.asp" : "PUREVAX",
		"/cats/purevax-rabies.asp" : "PUREVAX RABIES",
		"/cats/purevax-feline-leukemia.asp" : "PUREVAX FeLV",
		"/cats/imrab.asp" : "IMRAB",
		"/cats/surolan.asp" : "SUROLAN",
		"/cats/conofite.asp" : "CONOFITE",
		"/cats/itrafungol.asp" : "ITRAFUNGOL",
		"/cats/purevax-ferret-distemper.asp" : "PUREVAX FERRET DISTEMPER",
		"" : "Specify a Product"
	}
	
	var livestockCowProducts = {
		"/cattle/anafen.asp" : "ANAFEN INJECTABLE",
		"/cattle/cystorelin.asp" : "CYSTORELIN",
		"/cattle/eprinex.asp" : "EPRINEX",
		"/cattle/igenity-beef.asp" : "IGENITY BEEF",
		"/cattle/igenity-dairy.asp" : "IGENITY DAIRY",
		"/cattle/imrab.asp" : "IMRAB",
		"/cattle/ivomec-pour-on.asp" : "IVOMEC POUR-ON",
		"/cattle/ivomec-injection.asp" : "IVOMEC INJECTION",
		"/cattle/j-vac.asp" : "J-VAC",
		"/cattle/reliant.asp" : "RELIANT",
		"/cattle/tetradurela.asp" : "TETRADURE",
		"" : "Specify a Product"
			
	}
	
	var swineProducts = {
		"/swine/anafen-injectable.asp" : "ANAFEN INJECTABLE",
		"/swine/anafen-injectable.asp" : "IVOMEC INJECTION",
		"/swine/ivomec-premix.asp" : "IVOMEC PREMIX",
		"/swine/tetradure.asp" : "TETRADURE LA",
		"/swine/stresnil.asp" : "STRESNIL",
		"" : "Specify a Product"
		
		
	}
	
	var horseProducts = {
		"/horses/eqvalan-gold-paste.asp" : "EQVALAN GOLD",
		"/horses/eqvalan-paste.asp" : "EQVALAN",
		"/horses/panomec-paste.asp" : "PANOMEC",
		"/horses/gastogard.asp" : "GASTROGARD",
		"/horses/vulketan-gel.asp" : "VULKETAN Gel",
		"/horses/recombitek-wnv.asp" : "RECOMBITEK EQUINE WNV",
		"/horses/equine-potomovac.asp" : "EQUINE POTOMOVAC",
		"/horses/equine-potomovac111.asp" : "EQUINE POTOMOVAC + IMRAB",
		"/horses/recombitek-influenza.asp" : "RECOMBITEK EQUINE INFLUENZA",
		"/horses/anafen-injectable.asp" : "ANAFEN INJECTABLE",
		"/horses/imrabn.asp" : "IMRAB",
		"" : "Specify a Product"
		
		
	}
	
	var avianProducts = {
		"/poultry/new-castle-bronchitis-mass-conn.asp" : "NEW CASTLE BRONCHITIS MASS & CONN",
		"/poultry/bronchitis-mass-frozen.asp" : "BRONCHITIS MASS (FROZEN)",
		"/poultry/bronchitis-mass.asp" : "BRONCHITIS MASS (FREEZE DRIED)",
		"/poultry/lt-blen.asp" : "LT BLEN",
		"/poultry/tremor-blen-d.asp" : "TREMOR BLEN D",
		"/poultry/pt-blen.asp" : "PT BLEN",
		"/poultry/marek's-hvt.asp" : "MAREK'S HVT",
		"/poultry/marek's-sb-1.asp" : "MAREK'S SB-1",
		"/poultry/rispens-cvi-988.asp" : "RISPENS CVI-988 HVT",
		"/poultry/bur-cell-1+1.asp" : "BUR-CELL 1+1",
		"/poultry/reovirus-l.asp" : "REOGUARD L",
		"/poultry/s-706.asp" : "BURSAL DISEASE VACCINE S-706",
		"/poultry/svs-510.asp" : "SVS-510",
		"/poultry/bursa-blen-m.asp" : "BURSA BLEN M",
		"/poultry/gallivac-hb1-mass.asp" : "GALLIVAC HB-1 MASS",
		"/poultry/vaxxitek.asp" : "VAXXITEK",
		"/poultry/bursa-guard-reo.asp" : "BURSA GARD NBR",
		"/poultry/gallimune-nc-br.asp" : "GALLIMUNE NC-BR",
		"/poultry/bursa-guard-reo.asp" : "BURSA GARD REO",
		"" : "Specify a Product"
		
	}
	
	var defaultHealthIssue = {
		"" : "Select a Health Issue"
	}

	var defaultProduct = {
		"" : "Select a Product"
	}
	
    var dogHealthIssues = {
        "/dogs/canine-heart-disease.asp" : "Canine Heart Disease",
        "/dogs/deworming-heartworm-disease.asp" : "Deworming/ Heartowm Disease",
        "/dogs/canine-osteoarthritis.asp" : "Canine Osteoarthritis",
        "/dogs/zoonotic-infections.asp" : "Zoonotic Infections",
        "/dogs/rabies-information.asp" : "Rabies Virus",
		"" : "Specify a Disease"
    }
                  
    var catHealthIssues = {
        "/cats/cat-health.asp" : "Cat Health and FAQ's",
        "/flash_brochures/KNOW_YOUR_KITTEN/EN/index.html" : "Kitten Health - Know Your Kitten",
        "/flash_brochures/FELINE_LEUK/EN/index.html" : "Feline Leukemia",
        "/cats/rabies-information-cats.asp" : "Rabies Virus",
		"" : "Specify a Disease"
        
    }
    
    var livestockCowHealthIssues = {
        "/cattle/rabies-cattle.asp" : "Rabies",
		"" : "Specify a Disease"
        
    }
    
    var swineHealthIssues = {
        "" : "Parasite Control (Internal/External) - coming soon",
        "Value 2" : "Respiratory Disease - coming soon"
    }
                  
    var horseHealthIssues = {
        "/horses/rabies.asp" : "Rabies",
		"" : "Specify a Disease"
        
    }
    
    var avianHealthIssues = {
        "/poultry/respiratory-protection.asp" : "Respiratory Protection",
		"/poultry/enteric-protection.asp" : "Enteric Protection",
		"/poultry/egg-protection.asp" : "Egg Production Protection",
		"/poultry/bursal-protection.asp" : "Bursal Protection",
		"/poultry/biosecurity-hatchery-protection.asp" : "Biosecurity & Hatchery Protection",
		 "" : "Specify a Disease"
		
    }
    
	$('#productSpecies').change(function() {
	
		//var num_selected = $('#myselect option:selected').val();
		
		if ($('#productSpecies option:selected').val()=="dogs") {
           
		    $("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(dogProducts, true);
        
		} else if ($('#productSpecies option:selected').val()=="cats") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(catProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="livestock_cow_calf") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(livestockCowProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="livestock_feedlot") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(livestockFeedlotProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="livestock_dairy") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(livestockDairyProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="swine") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(swineProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="horses") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(horseProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="avian") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(avianProducts, true);
			
		} else if ($('#productSpecies option:selected').val()=="wildlife") {
			
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(wildlifeProducts, true);
			
		} else {
			$("#productSpecies2").removeOption(/./);
			$("#productSpecies2").addOption(defaultProduct, true);
		}
        
	});

    $('#healthissueSpecies').change(function() {
	
		//var num_selected = $('#myselect option:selected').val();
		
		if ($('#healthissueSpecies option:selected').val()=="dogs") {
           
		    $("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(dogHealthIssues, true);
        
		} else if ($('#healthissueSpecies option:selected').val()=="cats") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(catHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="livestock_cow_calf") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(livestockCowHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="livestock_feedlot") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(livestockFeedlotHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="livestock_dairy") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(livestockDairyHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="swine") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(swineHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="horses") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(horseHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="avian") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(avianHealthIssues, true);
			
		} else if ($('#healthissueSpecies option:selected').val()=="wildlife") {
			
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(wildlifeHealthIssues, true);
			
		} else {
		
			$("#healthissueSpecies2").removeOption(/./);
			$("#healthissueSpecies2").addOption(defaultHealthIssue, true);
		
		}
	
	});

    $('#healthissueSpecies2,#productSpecies2').change(function() {
		var url = $(this).val();
		if (url.length > 0) {
		  top.location = url;
		}
	});
	
});
							