<!-- Begin
function verify_page1() {

		var themessage = "You are required to complete the following fields: ";
		if (document.myForm.name.value.replace(/^\s+|\s+$/g,"")=="")
        {
		    themessage = themessage + " - Name";
		}

		if (document.myForm.address1.value=="")
        {
		    themessage = themessage + " -  Address1";
		}

		if (document.myForm.city.value=="") {
		themessage = themessage + " -  City";
		}

		if (document.myForm.country.selectedIndex ==0 || document.myForm.states.selectedIndex ==0 ) {
		themessage = themessage + "- Country";
		}

		if (document.myForm.postcode.value=="") {
		themessage = themessage + " -  Zip/Postal Code";
		}

		if (document.myForm.email.value=="") {
		themessage = themessage + " -  Email";
		}

		if (document.myForm.breedid.value=="-") {
		themessage = themessage + " -  Breed";
		}

        //alert if fields are empty and cancel form submit
		if (themessage == "You are required to complete the following fields: ") {
			document.myForm.action="orderSCK2.asp";
			document.myForm.submit();
		}
		else {
		alert(themessage);
		return false;
		   }
		}
		//  End -->
		<!--

		function populate(myForm, selected) {

		var africaArray =  new Array("('Select country','',true,true)",
		"('ETHIOPIA')",
		"('SOMALIA')",
		"('SOUTH AFRICA')",
		"('Other')");

		var middleeastArray =  new Array("('Select country','',true,true)",
		"('EGYPT')",
		"('IRAN')",
		"('ISRAEL')",
		"('KUWAIT')",
		"('LEBANON')",
		"('MOROCCO')",
		"('SAUDI ARABIA')",
		"('SYRIA')",
		"('TURKEY')",
		"('U. A. EMIRATES')",
		"('Other')");

		var asiaArray =  new Array("('Select country','',true,true)",
		"('ARMENIA')",
		"('BANGLADESH')",
		"('CAMBODIA')",
		"('CHINA')",
		"('INDIA')",
		"('INDONESIA')",
		"('JAPAN')",
		"('MALAYSIA')",
		"('MYANMAR')",
		"('NEPAL')",
		"('PAKISTAN')",
		"('PHILIPPINES')",
		"('SINGAPORE')",
		"('SOUTH KOREA')",
		"('SRI LANKA')",
		"('TAIWAN')",
		"('THAILAND')",
		"('UZBEKISTAN')",
		"('VIETNAM')",
		"('Other')");

		var europeArray =  new Array("('Select country','',true,true)",
		"('ALBANIA')",
		"('AUSTRIA')",
		"('BELARUS')",
		"('BELGIUM')",
		"('BOSNIA')",
		"('BULGARIA')",
		"('CROATIA')",
		"('CYPRUS')",
		"('CZECH REP.')",
		"('DENMARK')",
		"('ESTONIA')",
		"('FINLAND')",
		"('FRANCE')",
		"('GERMANY')",
		"('GREECE')",
		"('HUNGARY')",
		"('ICELAND')",
		"('IRELAND')",
		"('ITALY')",
		"('LATVIA')",
		"('LIECHTENSTEIN')",
		"('LITHUANIA')",
		"('LUXEMBOURG')",
		"('MACEDONIA')",
		"('MALTA')",
		"('MONACO')",
		"('NETHERLANDS')",
		"('NORWAY')",
		"('POLAND')",
		"('PORTUGAL')",
		"('ROMANIA')",
		"('RUSSIA')",
		"('SLOVAKIA')",
		"('SLOVENIA')",
		"('SPAIN')",
		"('SWEDEN')",
		"('SWITZERLAND')",
		"('UKRAINE')",
		"('UNITED KINGDOM')",
		"('Other')");

		var australiaArray =  new Array("('Select country','',true,true)",
		"('AUSTRALIA')",
		"('NEW ZEALAND')",
		"('Other')");

		var lamericaArray =  new Array("('Select country','',true,true)",
		"('COSTA RICA')",
		"('CUBA')",
		"('EL SALVADOR')",
		"('GUATEMALA')",
		"('HAITI')",
		"('JAMAICA')",
		"('MEXICO')",
		"('PANAMA')",
		"('Other')");

		var samericaArray =  new Array("('Select country','',true,true)",
		"('ARGENTINA')",
		"('BOLIVIA')",
		"('BRAZIL')",
		"('CHILE')",
		"('COLOMBIA')",
		"('ECUADOR')",
		"('PARAGUAY')",
		"('PERU')",
		"('SURINAME')",
		"('URUGUAY')",
		"('VENEZUELA')",
		"('Other')");

		var stateArray = new Array("('Select State','',true,true)",
		"('ALABAMA','AL')",
		"('ALASKA','AK')",
		"('ARIZONA','AZ')",
		"('ARKANSAS','AR')",
		"('CALIFORNIA','CA')",
		"('COLORADO','CO')",
		"('CONNECTICUT','CT')",
		"('COLUMBIA','DC')",
		"('DELAWARE','DE')",
		"('FLORIDA','FL')",
		"('GEORGIA','GA')",
		"('HAWAII','HI')",
		"('IDAHO','ID')",
		"('ILLINOIS','IL')",
		"('INDIANA','IN')",
		"('IOWA','IA')",
		"('KANSAS','KS')",
		"('KENTUCKY','KY')",
		"('LOUISIANA','LA')",
		"('MAINE','ME')",
		"('MARYLAND','MD')",
		"('MASSACHUSETTS','MA')",
		"('MICHIGAN','MI')",
		"('MICRONESIA','FM')",
		"('MINNESOTA','MN')",
		"('MISSISSIPPI','MS')",
		"('MISSOURI','MO')",
		"('MONTANA','MT')",
		"('NEBRASKA','NE')",
		"('NEVADA','NV')",
		"('NEW HAMPSHIRE','NH')",
		"('NEW JERSEY','NJ')",
		"('NEW MEXICO','NM')",
		"('NEW YORK','NY')",
		"('NORTH CAROLINA','NC')",
		"('NORTH DAKOTA','ND')",
		"('OHIO','OH')",
		"('OKLAHOMA','OK')",
		"('OREGON','OR')",
		"('PALAU','PW')",
		"('PENNSYLVANIA','PA')",
		"('PUERTO RICO','PR')",
		"('RHODE ISLAND','RI')",
		"('SOUTH CAROLINA','SC')",
		"('SOUTH DAKOTA','SD')",
		"('TENNESSEE','TN')",
		"('TEXAS','TX')",
		"('UTAH','UT')",
		"('VERMONT','VT')",
		"('VIRGIN ISLANDS','VI')",
		"('VIRGINIA','VA')",
		"('WASHINGTON','WA')",
		"('WEST VIRGINIA','WV')",
		"('WISCONSIN','WI')",
		"('WYOMING','WY')");

		var provinceArray = new Array("('Select Province','',true,true)",
		"('ALBERTA','AB')",
		"('BRITISH COLUMBIA','BC')",
		"('LABRADOR','NL')",
		"('MANITOBA','MB')",
		"('NEW BRUNSWICK','NB')",
		"('NEWFOUNDLAND','NL')",
		"('NORTHWEST TERRITORIES','NT')",
		"('NOVE SCOTIA','NS')",
		"('NUNAVUT','NU')",
		"('ONTARIO','ON')",
		"('PRINCE EDWARD ISLAND','PE')",
		"('QUEBEC','QC')",
		"('SASKATCHEWAN','SK')",
		"('YUKON','YT')");

		var noArray = new Array("('<--------------------','',true,true)");

		if (selected == '1') 	{
		for (var i=0; i < stateArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		stateArray[i]);
								}
							}

		if (selected == '0') 	{
		while (provinceArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < provinceArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		provinceArray[i]);
								}
						}

		if (selected == '2') 	{
		while (asiaArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < asiaArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		asiaArray[i]);
								}
						}

		if (selected == '3') 	{
		while (africaArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < africaArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		africaArray[i]);
								}
						}

		if (selected == '4') 	{
		while (australiaArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < australiaArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		australiaArray[i]);
								}
						}

		if (selected == '5') 	{
		while (europeArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < europeArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		europeArray[i]);
								}
						}

		if (selected == '6') 	{
		while (middleeastArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < middleeastArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		middleeastArray[i]);
								}
						}

		if (selected == '7') 	{
		while (lamericaArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < lamericaArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		lamericaArray[i]);
								}
						}

		if (selected == '8') 	{
		while (samericaArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < samericaArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" +

		samericaArray[i]);
								}
						}

		if ((selected == '')) 	{
		while (noArray.length < myForm.states.options.length) {
		myForm.states.options[(myForm.states.options.length - 1)] = null;
		}
		for (var i=0; i < noArray.length; i++) 	{
		eval("myForm.states.options[i]=" + "new Option" + noArray[i]);
							}
					}
}

// -->

<!-- Begin
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode;
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

		if(input.value.length >= len && !containsElement(filter,keyCode))
		{
			input.value = input.value.slice(0, len);

            //input.form[(getIndex(input)+1)].focus();
			input.form[(getIndex(input)+1) % input.form.length].focus();
		}
}

function containsElement(arr, ele)
		{
			var found = false, index = 0;
			while(!found && index < arr.length)
			if(arr[index] == ele)
			found = true;
			else
			index++;
			return found;
}

function getIndex(input)
		{
			var index = -1, i = 0, found = false;
			while (i < input.form.length && index == -1)
            {
			    if (input.form[i] == input)
                {
                    index = i;
                }
			    else
                {
                    i++;
                }

            }
            return index;
        }
//		return true;
//		}

function goto(url)
		{
			document.myForm.action= url;
			document.myForm.submit();
		}

function showalert()
		{
			<!--window.open('Belleville.asp','','width=300,height=200,resizable=no,scrollbars=no,toolbars=no,location=no,status=no,menubar=no,copyhistory=no');-->

		}

// ------------------------------------------------------
// Function to calculate price for color test
// Required
// 1. Split a string with a list of alleles;
// 2. Analyse the allele to make sure that same allele is not counted twice
// 3. Calculate how much to add for an additional alleles.
// 4. Return the total price.
// -------------------------------------------------------
function pricecolortest(genotype, curr)
{

    var listOfAlleles = new Array();
    var i;

    var PriceSingleTestUS = 65;  // price for the first tested allele
    var PriceAdditionalTestUS = 20; // price for any additional allele
    var PriceSingleTestCDN = 65;  // price for the first tested allele
    var PriceAdditionalTestCDN = 20; // price for any additional allele
    var TotalPrice = 0;

    var includeInPrice;  // keeps track of the current allele is needed to be included in the final price

    // List of alleles that are needed to be checked to avoid double charges - E, B, A, K, S:
    // Allele E - E, esmall;
    // Allele B - B, bsmall;
    // Allele K - Kb, ky, kx;
    // Allele A - ay, ax, at, a
    // Allele S - S, sp, si

    var alE = false;
    var alB = false;
    var alA = false;
    var alK = false;
    var alS = false;

    // Remove last '-' sign at the end of the string
    genotype=genotype.substr(0,genotype.length-1)

    // Split the string into array listOfAlleles
    listOfAlleles=genotype.split("-");

    // Analyze each allele
    for (i in listOfAlleles)
    {
        includeInPrice = true; // Assume that the allele is to be included in the final price.

        // Check E allele
        if(listOfAlleles[i]=="E" || listOfAlleles[i]=="esmall")
        {
            if(alE==false)
            {
              alE=true;
            }
            else
            {
              includeInPrice = false; // If E allele is already counted, do not include in the final price
            }
        }

        // Check B allele
        if(listOfAlleles[i]=="B" || listOfAlleles[i]=="bsmall")
        {
            if(alB==false)
            {
              alB=true;
            }
            else
            {
              includeInPrice = false; // If B allele is already counted, do not include in the final price
            }
        }

        // Check K allele
        if(listOfAlleles[i]=="Kb" || listOfAlleles[i]=="ky" || listOfAlleles[i]=="kx")
        {
            if(alK==false)
            {
              alK=true;
            }
            else
            {
              includeInPrice = false; // If K allele is already counted, do not include in the final price
            }
        }

        // Check A allele
        if(listOfAlleles[i]=="ay" || listOfAlleles[i]=="at" || listOfAlleles[i]=="ax" || listOfAlleles[i]=="a")
        {
            if(alA==false)
            {
              alA=true;
            }
            else
            {
              includeInPrice = false; // If A allele is already counted, do not include in the final price
            }
        }

        // Check S allele
        if(listOfAlleles[i]=="S" || listOfAlleles[i]=="sp" || listOfAlleles[i]=="si")
        {
            if(alS==false)
            {
              alS=true;
            }
            else
            {
              includeInPrice = false; // If S allele is already counted, do not include in the final price
            }
        }

        if(includeInPrice == true)
        {
          if (TotalPrice == 0)
          {
            if (curr == "Canada")
            {
                TotalPrice = TotalPrice + PriceSingleTestCDN;
            }
            else
            {
                TotalPrice = TotalPrice + PriceSingleTestUS;
            }

          }
          else
          {
            if (curr == "Canada")
            {
                TotalPrice = TotalPrice + PriceAdditionalTestCDN;
            }
            else
            {
                TotalPrice = TotalPrice + PriceAdditionalTestUS;
            }

          }
        }

    }
    return TotalPrice;
}
//  End -->

		function verify_page2()
		{
			var flag = false;
				for (i=0; i<document.myForm.quantity.length; i++)
				{

						if (document.myForm.quantity[i].value != 0)
						{
							flag =  true;
						}
						else
						{
						    if(!flag)
                            {flag= false};
						}

				}
			//alert if fields are empty and cancel form submit
            if (flag == true)
			{
				document.myForm.action = "orderSCK3.asp";
				document.myForm.submit();
			}
			else
			{
				alert("You must select a test/quantity combination in order to continue");
				return false;
			}
		}
		function myPopup(url)
		{
			url = "./OnlineSummary/" + url;
			window.open(url, "myWindow", "status = 1, height = 400, width = 550, resizable = 1" )
		}
		function goto(url)
		{
			document.myForm.action= url;
			document.myForm.submit();
		}
		//  End -->