﻿	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','20-303NC');
document.frmUser.SourceKeyCat[2] = new Option('Magazine','9980');
document.frmUser.SourceKeyCat[3] = new Option('Internet','9996');
document.frmUser.SourceKeyCat[4] = new Option('Radio','20-7999');
document.frmUser.SourceKeyCat[5] = new Option('Email','20-5900');
document.frmUser.SourceKeyCat[6] = new Option('Person','9998');
document.frmUser.SourceKeyCat[7] = new Option('Mailing','99-9999');


}

var arrSourceKey = new Array();
var arrSourceKeyCat = new Array();
var arrSourceKeyValue = new Array();


arrSourceKeyValue[1] = '20-0000EY';
arrSourceKey[1] = 'Parenting (Early Years) - Feb `10';
arrSourceKeyCat[1] = '9980';

arrSourceKeyValue[2] = '20-0000SY';
arrSourceKey[2] = 'Parenting (School Years) - Feb `10';
arrSourceKeyCat[2] = '9980';

arrSourceKeyValue[3] = '20-0001';
arrSourceKey[3] = 'German Life - Feb/Mar `10';
arrSourceKeyCat[3] = '9980';

arrSourceKeyValue[4] = '20-0002W';
arrSourceKey[4] = 'Parents - April `10';
arrSourceKeyCat[4] = '9980';

arrSourceKeyValue[5] = '19-0003HP';
arrSourceKey[5] = 'Homeschooling Parent - Curriculum Guide `09';
arrSourceKeyCat[5] = '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] = '20-0002MN';
arrSourceKey[111] = 'Parents March E-Newsletter';
arrSourceKeyCat[111] = '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] = '20-303YT';
arrSourceKey[130] = 'YouTube';
arrSourceKeyCat[130] = '9996';

arrSourceKeyValue[132] = '20-5902';
arrSourceKey[132] = 'Anniversary Edition Muzzy Email';
arrSourceKeyCat[132] = '20-5900';

arrSourceKeyValue[133] = '19-6300';
arrSourceKey[133] = 'My Points "Give Your Child the Gift" Email';
arrSourceKeyCat[133] = '20-5900';

arrSourceKeyValue[134] = '19-6301';
arrSourceKey[134] = 'My Points "Surprise Your Child" Email';
arrSourceKeyCat[134] = '20-5900';

arrSourceKeyValue[137] = '20-5900';
arrSourceKey[137] = 'Other Email';
arrSourceKeyCat[137] = '20-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[180] = '16-7000';
arrSourceKey[180] = 'Purplebook Baby';
arrSourceKeyCat[180] = '9996';

arrSourceKeyValue[200] = '20-7000';
arrSourceKey[200] = 'Radio Disney';
arrSourceKeyCat[200] = '20-7999';

arrSourceKeyValue[201] = '20-7001';
arrSourceKey[201] = 'Sirius/XM Radio';
arrSourceKeyCat[201] = '20-7999';

arrSourceKeyValue[202] = '19-7104NY';
arrSourceKey[202] = 'WABC-AM New York';
arrSourceKeyCat[202] = '20-7999';

arrSourceKeyValue[203] = '19-7103NY';
arrSourceKey[203] = 'WINS-AM New York';
arrSourceKeyCat[203] = '20-7999';

arrSourceKeyValue[204] = '19-7102WP';
arrSourceKey[204] = 'WKGR-FM West Palm';
arrSourceKeyCat[204] = '20-7999';


arrSourceKeyValue[219] = '20-7002';
arrSourceKey[219] = 'Local Radio Station';
arrSourceKeyCat[219] = '20-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] = '20-6900';
arrSourceKey[226] = 'Facebook';
arrSourceKeyCat[226] = '9996';

arrSourceKeyValue[229] = '20-6901';
arrSourceKey[229] = 'Twitter';
arrSourceKeyCat[229] = '9996';
			 
arrSourceKeyValue[230] = '9998';
arrSourceKey[230] = 'Friend';
arrSourceKeyCat[230] = '9998';
			 
arrSourceKeyValue[231] = '20-5900';
arrSourceKey[231] = 'Email';
arrSourceKeyCat[231] = '9998';

arrSourceKeyValue[233] = '20-303SPW';
arrSourceKey[233] = 'Sprout';
arrSourceKeyCat[233] = '20-303NC';
			 
arrSourceKeyValue[234] = '20-303NKW';
arrSourceKey[234] = 'Nickelodeon';
arrSourceKeyCat[234] = '20-303NC';

arrSourceKeyValue[236] = '20-303ABN';
arrSourceKey[236] = 'ABC Family';
arrSourceKeyCat[236] = '20-303NC';

arrSourceKeyValue[238] = '20-303CNA';
arrSourceKey[238] = 'Cartoon Network';
arrSourceKeyCat[238] = '20-303NC';

arrSourceKeyValue[239] = '20-303DKG';
arrSourceKey[239] = 'Discovery Kids';
arrSourceKeyCat[239] = '20-303NC';

arrSourceKeyValue[246] = '20-303AMN';
arrSourceKey[246] = 'AMC';
arrSourceKeyCat[246] = '20-303NC';

arrSourceKeyValue[246] = '20-303APN';
arrSourceKey[246] = 'Animal Planet';
arrSourceKeyCat[246] = '20-303NC';

arrSourceKeyValue[247] = '20-303BIN';
arrSourceKey[247] = 'Biography';
arrSourceKeyCat[247] = '20-303NC';

arrSourceKeyValue[248] = '20-303CCN';
arrSourceKey[248] = 'Comedy Central';
arrSourceKeyCat[248] = '20-303NC';

arrSourceKeyValue[249] = '20-303BCN';
arrSourceKey[249] = 'CNBC';
arrSourceKeyCat[249] = '20-303NC';

arrSourceKeyValue[250] = '20-303NNN';
arrSourceKey[250] = 'CNN';
arrSourceKeyCat[250] = '20-303NC';

arrSourceKeyValue[251] = '20-303HNN';
arrSourceKey[251] = 'CNN Headline News';
arrSourceKeyCat[251] = '20-303NC';

arrSourceKeyValue[253] = '20-303CTN';
arrSourceKey[253] = 'Court TV';
arrSourceKeyCat[253] = '20-303NC';

arrSourceKeyValue[255] = '20-303FSN';
arrSourceKey[255] = 'Fox Sports NY';
arrSourceKeyCat[255] = '20-303NC';

arrSourceKeyValue[256] = '20-303FNN';
arrSourceKey[256] = 'Fox News';
arrSourceKeyCat[256] = '20-303NC';

arrSourceKeyValue[257] = '20-303GSN';
arrSourceKey[257] = 'Game Show Network';
arrSourceKeyCat[257] = '20-303NC';

arrSourceKeyValue[258] = '20-303HGN';
arrSourceKey[258] = 'HGTV';
arrSourceKeyCat[258] = '20-303NC';

arrSourceKeyValue[259] = '20-303HIN';
arrSourceKey[259] = 'History Channel';
arrSourceKeyCat[259] = '20-303NC';

arrSourceKeyValue[260] = '20-303HMN';
arrSourceKey[260] = 'Hallmark Channel';
arrSourceKeyCat[260] = '20-303NC';

arrSourceKeyValue[261] = '20-303MSN';
arrSourceKey[261] = 'MSNBC';
arrSourceKeyCat[261] = '20-303NC';

arrSourceKeyValue[262] = '20-303NGN';
arrSourceKey[262] = 'Nat Geo';
arrSourceKeyCat[262] = '20-303NC';

arrSourceKeyValue[263] = '20-303OXN';
arrSourceKey[263] = 'Oxygen';
arrSourceKeyCat[263] = '20-303NC';

arrSourceKeyValue[264] = '20-303DCN';
arrSourceKey[264] = 'The Discovery Channel';
arrSourceKeyCat[264] = '20-303NC';

arrSourceKeyValue[267] = '20-303TLN';
arrSourceKey[267] = 'TV Land';
arrSourceKeyCat[267] = '20-303NC';

arrSourceKeyValue[268] = '20-303LCN';
arrSourceKey[268] = 'TLC';
arrSourceKeyCat[268] = '20-303NC';

arrSourceKeyValue[269] = '20-303TCN';
arrSourceKey[269] = 'The Travel Channel';
arrSourceKeyCat[269] = '20-303NC';

arrSourceKeyValue[272] = '20-303DRG';
arrSourceKey[272] = 'Dora the Explorer';
arrSourceKeyCat[272] = '20-303NC';

arrSourceKeyValue[275] = '20-303BKG';
arrSourceKey[275] = 'The Backyardigans';
arrSourceKeyCat[275] = '20-303NC';

arrSourceKeyValue[276] = '20-303MRG';
arrSourceKey[276] = 'Max & Ruby';
arrSourceKeyCat[276] = '20-303NC';

arrSourceKeyValue[277] = '20-303FBG';
arrSourceKey[277] = 'The Fresh Beat Band';
arrSourceKeyCat[277] = '20-303NC';

arrSourceKeyValue[278] = '20-303FOG';
arrSourceKey[278] = 'The Fairly Odd Parents';
arrSourceKeyCat[278] = '20-303NC';

arrSourceKeyValue[279] = '20-303WPG';
arrSourceKey[279] = 'Wonder Pets';
arrSourceKeyCat[279] = '20-303NC';

arrSourceKeyValue[286] = '20-303YT';
arrSourceKey[286] = 'YouTube';
arrSourceKeyCat[286] = '20-303NC';

arrSourceKeyValue[296] = '20-303NC';
arrSourceKey[296] = 'Other TV Station';
arrSourceKeyCat[296] = '20-303NC';



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');

}