/******************* FillCountry() Comments *****************
This function needs to be called first to populate the country
combobox.  

Created:	@12/01/2002		brian
Modified:	3/26/2003		brian
	Modified to allow the passing of combo's instead of hard
	coding them.  Also created the default capabilities of
	passing a default country to be selected.

Example:  FillCountry(NameOfCountryCombo, NameOfStateCombo, DefaultCountry)
*************************************************************/

function FillCountry(cboCountry, cboState, sDefaultCountry){
	var sDefaultCountry, sDefault, sCountry
		
	cboCountry.options.length=0
	for(i=0;i<sCountryString.split("|").length;i++){
		sCountry = sCountryString.split("|")[i];

		if (sDefaultCountry == sCountry) {
			sDefault=true;
			if (navigator.appName=="Microsoft Internet Explorer"){cboState.focus();}
		}
		else {sDefault=false;}
		
		if (sDefault) {cboCountry.options[i]=new Option(sCountry,sCountry,sDefault,sDefault);}
		else {cboCountry.options[i]=new Option(sCountryString.split("|")[i]);}
	}
}
if (navigator.appName=="Netscape"){
isNav=true
}

/******************* FillState() Comments *******************
This function needs to be called after the FillCountry() to
populate the State combobox.  Also from the onChange of the
country combobox.

Created:	@12/01/2002		brian
Modified:	3/26/2003		brian
	Modified to allow the passing of combo's instead of hard
	coding them.  Also created the default capabilities of
	passing a default country to be selected.

Example:  FillState(NameOfCountryCombo, NameOfStateCombo, DefaultState)
*************************************************************/
function FillState(cboCountry, cboState, sDefaultState){
	var sDefaultState, sState, sDefault
		selIndex=cboCountry.selectedIndex;
	cboState.options.length=0
	for(i=0;i<sStateArray[cboCountry.selectedIndex].split("|").length;i++){
		sState = sStateArray[cboCountry.selectedIndex].split("|")[i];
		
		if(sDefaultState == sState) {
			sDefault=true;
			if (navigator.appName=="Microsoft Internet Explorer"){cboState.focus();}
		} 
		else {sDefault=false;}
		
		if(sDefault) {cboState.options[i]=new Option(sState,sState,sDefault,sDefault)}
		else {
			if(i==0){cboState.options[i]=new Option("Select","Select");
			}else{
			cboState.options[i]=new Option(sState,sState);}
			}
	}
}


function Fillcity(cboState, cboCity, sDefaultCity)

{getVariables();
	var sDefaultCity, sCity, sDefault

	cboCity.options.length=0
	for(i=0;i<sCityArray[cboState.selectedIndex].split("|").length;i++)

	{
		sCity = sCityArray[cboState.selectedIndex].split("|")[i];
		
		if(sDefaultCity == sCity) {
			sDefault=true;
			if (navigator.appName=="Microsoft Internet Explorer"){cboCity.focus();}
		} 
		else {sDefault=false;}
		
		if(sDefault)
		{
			cboCity.options[i]=new Option(sCity,sCity,sDefault,sDefault)
		}
		else {
			if(i==0){cboCity.options[i]=new Option("Select","Select");
			}else{
			cboCity.options[i]=new Option(sCity,sCity);}
			}
	}
}

function redirectPage(val){
	//if(val == "Sub11_prod3"){
		//window.location = "madarchod.html";
//	}
window.location =  val+".htm";
}

var sCountryString = "Select|Canine|Ruminant|Swine|Poultry"
		
var sStateArray = new Array()
sStateArray[0]=""
sStateArray[1]="Select|Perfomance optimizer|Joint Nutritional|Anti-stress|Immunm-modulator|Renal health|Dermatological|Ectoparasiticide|Respiratory health"
sStateArray[2]="Select|Digestive|Dermatological|Perfomance optimizer|Reproductive health|Gut health|Udder health|Anti-Stress|Immunm modulator|Respiratoy health|Galactagogue"
sStateArray[3]="Select|Perfomance optimizer|Anti-Stress|Reproduetive-health|Gut-health|Dermatological|Respiratory-health"
sStateArray[4]="Select|Farm environment|Respiratory-health|Nutritional|Anthelmentic|Anticoccidial|Immune-modulator|Gut-health|Performance-optimizer|Renal-health|Stress-management"
var selIndex='';

var sCityArray = new Array()
sCityArray[0]=""
sCityArray[1]="Select|MeboLiv|MagaCal"
sCityArray[2]="Select|MobiFree"
sCityArray[3]="Select|StressEaze"
sCityArray[4]="Select|ImmuPlus" 
sCityArray[5]="Select|NephTone" 
sCityArray[6]="Select|Splenderm|Dermanol|SkinHeal|Anbooflam" 
sCityArray[7]="Select|EctoZee" 
sCityArray[8]="Select|BronSyp" 

function getVariables(){
if(selIndex==1){
sCityArray[1]="Select|MeboLiv|MagaCal"
sCityArray[2]="Select|MobiFree"
sCityArray[3]="Select|StressEaze"
sCityArray[4]="Select|ImmuPlus" 
sCityArray[5]="Select|NephTone" 
sCityArray[6]="Select|Splenderm|Dermanol|SkinHeal|Anbooflam" 
sCityArray[7]="Select|EctoZee" 
sCityArray[8]="Select|BronSyp" 
 
}else if(selIndex==2){
sCityArray[1]="Select|HimalayanBatisa|HBStrong|Rumbion|EverestBatisa"
sCityArray[2]="Select|Himax|SkinHeal|Teeburb|AnbioFlam|Pestoban"
sCityArray[3]="Select|Meboliv-AFS|Livol|FerroCom|Calmore|MagaCal|Milkofeed"
sCityArray[4]="Select|Prajana-HS|Fertina|Cofecu-Plus|MinForte|UtriFit|Replanta" 
sCityArray[5]="Select|Timpol|D-Bloat|Neblon" 
sCityArray[6]="Select|Dermanol" 
sCityArray[7]="Select|StressCheck" 
sCityArray[8]="Select|ImmuPlus" 
sCityArray[9]="Select|Caflon" 
sCityArray[10]="Select|Galog|Galog-Strong|LactMore|MilKoFeed" 
}else if(selIndex==3){
sCityArray[1]="Select|LivoLiv|FerroCom-Feed-Premix|MagaCal"
sCityArray[2]="Select|StressEaze"
sCityArray[3]="Select|OviFertin"
sCityArray[4]="Select|GutMotil" 
sCityArray[5]="Select|Dermamol" 
sCityArray[6]="Select|Animon" 
}else if(selIndex==4){
sCityArray[1]="Select|AmmoFree-Premix"
sCityArray[2]="Select|Animunin"
sCityArray[3]="Select|BioCholine|BioFitase-1600|HerbalC|Herbal E|HerboLysin|HerboMethione Plus|TranscalPlus"
sCityArray[4]="Select|CestoNil" 
sCityArray[5]="Select|CocciBan|ImmuPlus" 
sCityArray[6]="Select|DefenseUp"
sCityArray[7]="Select|GutMotil-PFS|Herbiotic-FS"
sCityArray[8]="Select|Herbiotic-FS|LivoLiv-250|LivoIPFS|LivoTox|MagaCal|ProLibid|ToxiCheck|TTMP|Bactifier"
sCityArray[9]="Select|NephTone"
sCityArray[10]="Select|StressCheck"
}
}