﻿	function copyShipping()
		{
			document.frmUser.ShippingLastName.value = document.frmUser.LastName.value;
			document.frmUser.ShippingFirstName.value = document.frmUser.FirstName.value;
			document.frmUser.ShippingCompany.value = document.frmUser.Company.value;
			document.frmUser.ShippingAddress1.value = document.frmUser.Address1.value;
			document.frmUser.ShippingAddress2.value = document.frmUser.Address2.value;
			document.frmUser.ShippingCity.value = document.frmUser.City.value;
			document.frmUser.State2.selectedIndex = document.frmUser.State1.selectedIndex;
			document.frmUser.ShippingZip.value = document.frmUser.Zip.value;
			document.frmUser.Country2.selectedIndex = document.frmUser.Country1.selectedIndex;
			document.frmUser.ShippingPhone1.value = document.frmUser.DayPhone.value;
			document.frmUser.ShippingPhone2.value = document.frmUser.EveningPhone.value;
			document.frmUser.ShippingEmail.value = document.frmUser.Email.value;
			document.frmUser.POBox.checked = document.frmUser.POBoxB.checked;
		}
	
	function testCopy()
		{
			if (document.frmUser.CopyShipping.checked == true)
				copyShipping();
		}

	function checkSettings()
		{
			var mError = 0;

			if (mError == 0)
				{
					document.frmUser.Mode.value="1VNR";
					document.frmUser.submit();
				}
		}

	function GoPrev()
		{
			var mError = 0;
			if (mError == 0)
				document.frmUser.Mode.value="";
				document.frmUser.submit();
		}

	function SetTaxExempt()
		{
			if (document.frmUser.CTypeS.checked == false)
				{
					if (document.frmUser.CTypeL.checked == false)
							{
								document.frmUser.TaxExempt.checked = 0;
								alert("Only Schools and Libraries may select Tax Exempt");	
							}
				}
		}


	function SetCustType(varCustType)
		{
			if (varCustType == 'S')
				{
					if (document.frmUser.CTypeS.checked == true)
						document.frmUser.CTypeL.checked = 0;
				}
			if (varCustType == 'L')
				{
					if (document.frmUser.CTypeL.checked == true)
						document.frmUser.CTypeS.checked = 0;
				}
//			if (document.frmUser.CTypeS.checked == false)
//				{
//					if (document.frmUser.CTypeL.checked == false)
//							{
//								document.frmUser.TaxExempt.checked = 0;
//							}
//				}
		}

	function SetCountry(idx)
		{
			if (idx == 1)
				{
					if (document.frmUser.CopyShipping.checked == true)
						{
							document.frmUser.State2.selectedIndex = document.frmUser.State1.selectedIndex;
						}
					if (document.frmUser.State1.value != "AP")
						{
							if (document.frmUser.State1.value != "OU")
								{
									document.frmUser.Country1.selectedIndex = 0;
									if (document.frmUser.CopyShipping.checked == true)
										{
											document.frmUser.Country2.selectedIndex = 0;
										}
								}
						}
				}
			else
				{
					if (document.frmUser.State2.value != "AP")
						{
							if (document.frmUser.State2.value != "OU")
								{
									document.frmUser.Country2.selectedIndex = 0;
								}
						}
				}
		}

	function SetState(idx)
		{
			if (idx == 1)
				{
					if (document.frmUser.CopyShipping.checked == true)
						{
							document.frmUser.Country2.selectedIndex = document.frmUser.Country1.selectedIndex;
						}
					if (document.frmUser.Country1.value != "United States")
						{
							if (document.frmUser.State1.value != "AP")
								{
									document.frmUser.State1.selectedIndex = 55;
									if (document.frmUser.CopyShipping.checked == true)
										{
											document.frmUser.State2.selectedIndex = 55;
										}
								}
						}
				}
			else
				{
					if (document.frmUser.Country2.value != "United States")
						{
							if (document.frmUser.State2.value != "AP")
								document.frmUser.State2.selectedIndex = 55;
						}
				}
		}

	function selOption(mOption)
		{
			if (mOption == 1)
				{
					document.frmUser.Source1[0].checked = true;
				}
			else
				{
					if (mOption == 2)
						{
							document.frmUser.Source1[1].checked = true;
						}
					else
						{
							document.frmUser.Source1[2].checked = true;
						}
				}
		}


// fill in source keys ...

function getSubCategories()
		{
			if (document.frmCategory.CategoryID.value == "")
				alert("Please select a category from the pull-down menu.");
			else
				document.frmCategory.submit();
		}


function initControls()
{
populateSourceKeyCat();

}
function populateSourceKeyCat()
{

document.frmUser.SourceKeyCat[0] = new Option('','');
document.frmUser.SourceKeyCat[1] = new Option('TV','19-311NC');
document.frmUser.SourceKeyCat[2] = new Option('Infomercial','19-3511NC');
document.frmUser.SourceKeyCat[3] = new Option('Magazine','9980');
document.frmUser.SourceKeyCat[4] = new Option('Internet','9996');
document.frmUser.SourceKeyCat[5] = new Option('Radio','19-7999');
document.frmUser.SourceKeyCat[6] = new Option('Email','19-5900');
document.frmUser.SourceKeyCat[7] = new Option('Person','9998');
document.frmUser.SourceKeyCat[8] = new Option('Mailing','99-9999');


}

var arrSourceKey = new Array();
var arrSourceKeyCat = new Array();
var arrSourceKeyValue = new Array();

arrSourceKeyValue[0] = '19-0002W';
arrSourceKey[0] = 'Parents - April `09';
arrSourceKeyCat[0] = '9980';

arrSourceKeyValue[1] = '19-0000EY';
arrSourceKey[1] = 'Parenting (Early Years) - Feb `09';
arrSourceKeyCat[1] = '9980';

arrSourceKeyValue[2] = '19-0000SY';
arrSourceKey[2] = 'Parenting (School Years) - Feb `09';
arrSourceKeyCat[2] = '9980';

arrSourceKeyValue[3] = '19-0003HP';
arrSourceKey[3] = 'Homeschooling Parent - Curriculum Guide `09';
arrSourceKeyCat[3] = '9980';

arrSourceKeyValue[4] = '18-0011W';
arrSourceKey[4] = 'German Life - Oct/Nov `08';
arrSourceKeyCat[4] = '9980';
		 	 
arrSourceKeyValue[20] = '99-9999';
arrSourceKey[20] = 'Muzzy Brochure';
arrSourceKeyCat[20] = '99-9999';
			 	 			 
arrSourceKeyValue[68] = '14-7200';
arrSourceKey[68] = 'Chinese Language School CT';
arrSourceKeyCat[68] = '9998';
			 
arrSourceKeyValue[90] = 'KINDERCP';
arrSourceKey[90] = 'KinderCare';
arrSourceKeyCat[90] = '9998';

arrSourceKeyValue[111] = '19-6505';
arrSourceKey[111] = 'PBS.org';
arrSourceKeyCat[111] = '9996';

arrSourceKeyValue[121] = '19-6506';
arrSourceKey[121] = 'PBS Parents';
arrSourceKeyCat[121] = '9996';

arrSourceKeyValue[125] = '19-6001';
arrSourceKey[125] = 'Homeschoogle.com';
arrSourceKeyCat[125] = '9996';

arrSourceKeyValue[126] = '19-0003HP';
arrSourceKey[126] = 'Homeschooling Parent Website';
arrSourceKeyCat[126] = '9996';

arrSourceKeyValue[130] = '19-311YT';
arrSourceKey[130] = 'YouTube';
arrSourceKeyCat[130] = '9996';

arrSourceKeyValue[132] = '19-5915';
arrSourceKey[132] = 'Anniversary Edition Muzzy Email';
arrSourceKeyCat[132] = '19-5900';

arrSourceKeyValue[137] = '19-5900';
arrSourceKey[137] = 'Other Email';
arrSourceKeyCat[137] = '19-5900';

arrSourceKeyValue[138] = '19-9400';
arrSourceKey[138] = 'Hunt Ridge Montessori School';
arrSourceKeyCat[138] = '9998';

arrSourceKeyValue[139] = '9997';
arrSourceKey[139] = 'I am a Teacher/School Administrator';
arrSourceKeyCat[139] = '9998';
			 
arrSourceKeyValue[172] = '9980';
arrSourceKey[172] = 'Other Magazine Ad';
arrSourceKeyCat[172] = '9980';
			 
arrSourceKeyValue[215] = '16-7000';
arrSourceKey[215] = 'Purplebook Baby';
arrSourceKeyCat[215] = '9996';

arrSourceKeyValue[217] = '19-7000';
arrSourceKey[217] = 'Radio Disney';
arrSourceKeyCat[217] = '19-7999';

arrSourceKeyValue[218] = '19-7001';
arrSourceKey[218] = 'Sirius/XM Radio';
arrSourceKeyCat[218] = '19-7999';

arrSourceKeyValue[219] = '19-7002';
arrSourceKey[219] = 'Local Radio Station';
arrSourceKeyCat[219] = '19-7999';
		 
arrSourceKeyValue[222] = '9992';
arrSourceKey[222] = 'From a Teacher/School Administrator';
arrSourceKeyCat[222] = '9998';
			 
arrSourceKeyValue[224] = '9996';
arrSourceKey[224] = 'Surfing the Web';
arrSourceKeyCat[224] = '9996';

arrSourceKeyValue[226] = '19-6900';
arrSourceKey[226] = 'Facebook';
arrSourceKeyCat[226] = '9996';

arrSourceKeyValue[229] = '19-6901';
arrSourceKey[229] = 'Twitter';
arrSourceKeyCat[229] = '9996';
			 
arrSourceKeyValue[230] = '9998';
arrSourceKey[230] = 'Friend';
arrSourceKeyCat[230] = '9998';
			 
arrSourceKeyValue[231] = '19-5900';
arrSourceKey[231] = 'Email';
arrSourceKeyCat[231] = '9998';

arrSourceKeyValue[232] = '19-310CBW';
arrSourceKey[232] = 'CBS';
arrSourceKeyCat[232] = '19-311NC';

arrSourceKeyValue[233] = '19-311SPW';
arrSourceKey[233] = 'Sprout';
arrSourceKeyCat[233] = '19-311NC';
			 
arrSourceKeyValue[234] = '19-311NKW';
arrSourceKey[234] = 'Nickelodeon';
arrSourceKeyCat[234] = '19-311NC';

arrSourceKeyValue[236] = '19-311ABA';
arrSourceKey[236] = 'ABC Family';
arrSourceKeyCat[236] = '19-311NC';

arrSourceKeyValue[238] = '19-311CNA';
arrSourceKey[238] = 'Cartoon Network';
arrSourceKeyCat[238] = '19-311NC';

arrSourceKeyValue[239] = '19-311DKG';
arrSourceKey[239] = 'Discovery Kids';
arrSourceKeyCat[239] = '19-311NC';

arrSourceKeyValue[240] = '19-310QBW';
arrSourceKey[240] = 'Qubo';
arrSourceKeyCat[240] = '19-311NC';

arrSourceKeyValue[246] = '19-311AMN';
arrSourceKey[246] = 'AMC';
arrSourceKeyCat[246] = '19-311NC';

arrSourceKeyValue[246] = '19-311APN';
arrSourceKey[246] = 'Animal Planet';
arrSourceKeyCat[246] = '19-311NC';

arrSourceKeyValue[247] = '19-311BIN';
arrSourceKey[247] = 'Biography';
arrSourceKeyCat[247] = '19-311NC';

arrSourceKeyValue[248] = '19-311CCN';
arrSourceKey[248] = 'Comedy Central';
arrSourceKeyCat[248] = '19-311NC';

arrSourceKeyValue[249] = '19-311BCN';
arrSourceKey[249] = 'CNBC';
arrSourceKeyCat[249] = '19-311NC';

arrSourceKeyValue[250] = '19-311NNN';
arrSourceKey[250] = 'CNN';
arrSourceKeyCat[250] = '19-311NC';

arrSourceKeyValue[251] = '19-311HNN';
arrSourceKey[251] = 'CNN Headline News';
arrSourceKeyCat[251] = '19-311NC';

arrSourceKeyValue[253] = '19-311ECN';
arrSourceKey[253] = 'ESPN Classic';
arrSourceKeyCat[253] = '19-311NC';

arrSourceKeyValue[255] = '19-311FSN';
arrSourceKey[255] = 'Fox Sports NY';
arrSourceKeyCat[255] = '19-311NC';

arrSourceKeyValue[257] = '19-311FNN';
arrSourceKey[257] = 'Fox News';
arrSourceKeyCat[257] = '19-311NC';

arrSourceKeyValue[258] = '19-311GSN';
arrSourceKey[258] = 'Game Show Network';
arrSourceKeyCat[258] = '19-311NC';

arrSourceKeyValue[259] = '19-311HIN';
arrSourceKey[259] = 'History Channel';
arrSourceKeyCat[259] = '19-311NC';

arrSourceKeyValue[260] = '19-311HMN';
arrSourceKey[260] = 'Hallmark Channel';
arrSourceKeyCat[260] = '19-311NC';

arrSourceKeyValue[261] = '19-311MSN';
arrSourceKey[261] = 'MSNBC';
arrSourceKeyCat[261] = '19-311NC';

arrSourceKeyValue[262] = '19-311OXN';
arrSourceKey[262] = 'Oxygen';
arrSourceKeyCat[262] = '19-311NC';

arrSourceKeyValue[263] = '19-311DCN';
arrSourceKey[263] = 'The Discovery Channel';
arrSourceKeyCat[263] = '19-311NC';

arrSourceKeyValue[267] = '19-311TLN';
arrSourceKey[267] = 'TV Land';
arrSourceKeyCat[267] = '19-311NC';

arrSourceKeyValue[268] = '19-311LCN';
arrSourceKey[268] = 'TLC';
arrSourceKeyCat[268] = '19-311NC';

arrSourceKeyValue[269] = '19-311TCN';
arrSourceKey[269] = 'The Travel Channel';
arrSourceKeyCat[269] = '19-311NC';

arrSourceKeyValue[272] = '19-311DRG';
arrSourceKey[272] = 'Dora the Explorer';
arrSourceKeyCat[272] = '19-311NC';

arrSourceKeyValue[273] = '19-311DGG';
arrSourceKey[273] = 'Go, Diego, Go!';
arrSourceKeyCat[273] = '19-311NC';

arrSourceKeyValue[274] = '19-311NHG';
arrSourceKey[274] = 'Ni-Hao, Kai-Lan';
arrSourceKeyCat[274] = '19-311NC';

arrSourceKeyValue[275] = '19-311BKG';
arrSourceKey[275] = 'The Backyardigans';
arrSourceKeyCat[275] = '19-311NC';

arrSourceKeyValue[276] = '19-311MRG';
arrSourceKey[276] = 'Max & Ruby';
arrSourceKeyCat[276] = '19-311NC';

arrSourceKeyValue[277] = '19-311FBG';
arrSourceKey[277] = 'The Fresh Beat Band';
arrSourceKeyCat[277] = '19-311NC';

arrSourceKeyValue[278] = '19-311FOG';
arrSourceKey[278] = 'The Fairly Odd Parents';
arrSourceKeyCat[278] = '19-311NC';

arrSourceKeyValue[279] = '19-311WPG';
arrSourceKey[279] = 'Wonder Pets';
arrSourceKeyCat[279] = '19-311NC';

arrSourceKeyValue[284] = '19-3511NC';
arrSourceKey[284] = 'Infomercial';
arrSourceKeyCat[284] = '19-311NC';

arrSourceKeyValue[286] = '19-311YT';
arrSourceKey[286] = 'YouTube';
arrSourceKeyCat[286] = '19-311NC';

arrSourceKeyValue[296] = '19-311NC';
arrSourceKey[296] = 'Other TV Station';
arrSourceKeyCat[296] = '19-311NC';

arrSourceKeyValue[304] = '19-3511MC';
arrSourceKey[304] = 'Hallmark Movie Channel';
arrSourceKeyCat[304] = '19-3511NC';


function fillSourceKey()
{
var strState = document.frmUser.SourceKeyCat.options[document.frmUser.SourceKeyCat.selectedIndex].value;
var intCount = arrSourceKey.length;
var n=0;
document.frmUser.SourceKey.options.length = 0;
document.frmUser.SourceKey[n++] = new Option('Select Source', '9981');

for (var i = 0; i < intCount; i++)
{

if (strState == arrSourceKeyCat[i])
document.frmUser.SourceKey[n++] = new Option(arrSourceKey[i], arrSourceKeyValue[i]);
}
if (strState != arrSourceKeyCat[i])
document.frmUser.SourceKey[n++] = new Option('Other', '9981');

}