<!--
function clearForm(form)
{
 form.weight.value="";
 form.dose.value="";
 form.range.value="";
 form.frequency.value="";
 form.route.value="";
 form.warning.value="";
 form.drug.selectedIndex=0;
}


function getDrugPage(form)
{
 var drugName = new Array
 (
	"http://www.guinealynx.info/antibiotics.html",
	"http://www.guinealynx.info/antibiotics.html",
	"http://www.guinealynx.info/antibiotics.html",
	"http://www.guinealynx.info/antibiotics.html",
	"http://www.guinealynx.info/antibiotics.html",
	"http://www.guinealynx.info/antibiotics.html",
	
	"http://www.guinealynx.info/antiparasitics.html#advantage",
	"http://www.guinealynx.info/antiparasitics.html#advantage",
	
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/ivermectin.html",
	"http://www.guinealynx.info/antiparasitics.html#selamectin",
	"http://www.guinealynx.info/antiparasitics.html#selamectin",	
	"http://www.guinealynx.info/antiparasitics.html#selamectin"

 )

 if (form.drug.selectedIndex == null || form.drug.value == 0 )
 {
 parent.location.href = self.location.href;
 alert ("\nPlease select a drug.");
 }
 else
 {
 parent.location.href=drugName[form.drug.selectedIndex];
 }
}

function calcRx(form)
{
 // [dosage, units, range, frequency, route, warning]
 var antibacterialAgents = [
[,,,,],
 [50., " mg", "50 mg/kg total dose", "q12h (every 12 hours)", "PO (by mouth)", "CHLORAMPHENICOL PALMITATE \nHandle with care.", ],
 [5, " mg", "5 mg/kg", "q12h (every 12 hours)", "PO (by mouth)", "DOXYCYCLINE \n5mg/kg is the rat dose. Lower listed doses are sometimes not effective.", ],
 [6.25, " mg", "2.5-10.0 mg/kg", "q12h (every 12 hours)", "PO (by mouth)", "ENROFLOXACIN (Baytril) \nThis drug has a wide dosage range. The mean dose used in the above calculations is 6.25mg/kg. Enrofloxacin is not recommended in young guinea pigs -- may result in arthropathies (bone abnormalities). Watch for antibiotic intolerance, especially anorexia. Call your vet if your guinea pig is not eating.", ],
 [30., " mg", "30 mg/kg", "q12h (every 12 hours)", "PO (by mouth)", "TRIMETHOPRIM-SULFAMETHOXAZOLE (Bactrim)\nThis drug is a widely available human and veterinary product. It is readily available and is well-tolerated by the average guinea pig.", ],
 [0.625, " cc", "30 mg/kg", "q12h (every 12 hours)", "PO (by mouth)", "TRIMETHOPRIM-SULFAMETHOXAZOLE (Bactrim) \nStandard pediatric oral suspension contains: 240mg/5ml. Each 5.0 ml contains 200mg sulfamethoxazole and 40mg trimethoprim/5ml for a total of 240mg active ingredients per 5ml or 48mg/cc. This medication works especially well on many urinary tract infections.", ],
[,,,,],

 [22, " mg", "22 mg/kg", "One application lasts 30 days unless washed off with a detergent shampoo.", "Topical", "Imidacloprid (Advantage) - mg - Topical \nBe sure to dose accurately. Draw only a single dose at one time. \nDoes not kill mites.  Only kills lice. \nMay be used on pregnant cavies and newly weaned young.", ],
 [.2417582, " cc", "22 mg/kg (10 mg/pound)", "One application lasts 30 days unless washed off with a detergent shampoo.", "Topical", "Imidacloprid (Advantage) - cc - Topical \nBe sure to dose accurately. Draw only a single dose at one time. \nDoes not kill mites.  Only kills lice. \nMay be used on pregnant cavies and newly weaned young.", ],

 [.2, " mg", "0.2 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "PO (by mouth)", "IVERMECTIN - mg Oral \nBe sure to dose accurately. Draw only a single dose at one time.", ],
 [.02, " cc", "0.2 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "PO (by mouth)", "IVERMECTIN - cc Oral - 10mg/cc suspension \nYou selected an oral ivermectin dose using a 1% Injection Solution containing 10 mg/ml ivermectin. Be sure to dose accurately. Draw only a single dose at one time (this will be a very small amount, perhaps only a drop).", ],
 [.2, " cc", "0.2 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "PO (by mouth)", "IVERMECTIN - cc Oral - 1mg/cc suspension \nYou selected an oral ivermectin dose using a suspension of 1 mg/cc. Be sure to dose accurately and read the information on oral dosing. Draw only a single dose at one time.", ],
 [.5, " mg", "0.5 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "Topical", "IVERMECTIN - mg Topical \nBe sure to dose accurately. Draw only a single dose at one time.", ],
 [.05, " cc", "0.5 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "Topical", "IVERMECTIN - cc Topical - 10mg/cc suspension \nYou selected a topical ivermectin dose using a 1% Injection Solution containes 10 mg/ml ivermectin. Since ivermectin is dosed topically at 0.5mg/kg, 0.05 cc of this solution (a couple small drops) can be applied to a guinea pig weighing one kilogram. Be sure to dose accurately. Draw only a single dose at one time. Place on bare skin behind ears. See a vet for treatment.", ],
 [.1, " cc", "0.5 mg/kg", "Repeat treatment at least once in 7-10 days. May require multiple treatments.", "Topical", "IVERMECTIN - cc Topical - 5mg/cc suspension \n You selected a topical ivermectin dose using a 0.5 % Pour-On Solution containing 5mg/ml. Since ivermectin is dosed topically at 0.5mg/kg, 0.1cc of this solution (no more than 3 or 4 drops) can be applied to a guinea pig weighing one kilogram. Be sure to dose accurately. Draw only a single dose at one time. Place on bare skin behind ears. See a vet for treatment.", ],
 [10, " mg", "10 mg/kg", "Repeat in two weeks for severe cases of mites.", "Topical", "SELAMECTIN (Revolution)  - mg Topical \nPfizer reportedly advises 10 mg/kg for cavies. \nTHESE PRESCRIPTION ONLY TUBES COME IN DIFFERENT CONCENTRATIONS. BE SURE TO DOSE ACCURATELY. \nDraw only a single dose at one time.", ],
 [.167, " cc", "10 mg/kg", "Repeat in two weeks for severe cases of mites.", "Topical", "SELAMECTIN (Revolution)  -  Topical - 60mg/cc suspension \n\nCHECK CONCENTRATION ON TUBE! \n\nSelamectin packages come in different concentrations. These calculations are based on 60 mg/cc tubes! Be sure to calculate dose based on the correct concentration!", ],   
 [.0833, " cc", "10 mg/kg", "Repeat in two weeks for severe cases of mites.", "Topical", "SELAMECTIN (Revolution)  -  Topical - 120mg/cc suspension \n\nCHECK CONCENTRATION ON TUBE! \n\nSelamectin packages come in different concentrations. These calculations are based on 120 mg/cc tubes! Be sure to calculate dose based on the correct concentration!", ]

 ]

 // Holds whether or not the form is correct
 var Correct = true;

 // Check for missing fields
 if (form.weight.value == null || form.weight.value.length == 0)
 {
 alert ("\nEnter weight of guinea pig.");
 Correct = false;
 }

 if (form.drug.selectedIndex == null || form.drug.value == 0 )
 {
 alert ("\nPlease select a drug.");
 clearForm(form);
 Correct = false;
 }

 // Check that only numbers are in the weight fields
 else if ( Correct == true )
 {
 // Holds the gp's weight
 var TestWeight;

 // Parse the weight value and store it as a variable
 TestWeight = parseFloat(form.weight.value);

 // Check to see that TestWeight is a number
 if (isNaN (TestWeight))
 {
 alert("\nEnter weight as a number.");
 Correct = false;
 form.weight.value="";
 }

 // Check for a realistic gp weight.
 if((TestWeight <= 0) ||
 (TestWeight > 5 && form.units[0].checked) ||
 (TestWeight > 11 && form.units[1].checked) )
 {
 alert("\nGuinea pigs do not weigh this much.\nEnter a smaller number.");
 Correct = false;
 form.weight.value="";
 }
 }

 // If all input is correct, calculate the dosage.
 if (Correct == true)
 {
 // Holds the calculated dose in mg.
 var RX, RX1, RX2, units;

 form.range.value = antibacterialAgents[form.drug.selectedIndex][2];
 form.frequency.value = antibacterialAgents[form.drug.selectedIndex][3];
 form.route.value = antibacterialAgents[form.drug.selectedIndex][4];
 form.warning.value = antibacterialAgents[form.drug.selectedIndex][5];
 units = antibacterialAgents[form.drug.selectedIndex][1];

 RX = antibacterialAgents[form.drug.selectedIndex][0] * TestWeight;

 // Pounds -> kilograms units conversion.
 if (form.units[1].checked)
 {
 RX = RX * .4535924;
 }

 // Append proper units.
 if (RX >= .001)
 {
 form.dose.value = RX + units;
 }
 else
 {
 form.dose.value = "";
 }
 }
}
// -->
