	//validateRequest=false
	//ImprintID = new Array (17);
	
	//	sVerseID = cntl.options[cntl.selectedIndex].value;
	//	for(iCounter=1;iCounter<=17;iCounter=iCounter+1){
		
	//			updateLine = eval('document.VerseForm.' + eval('ImprintID[' + iCounter + ']'));
	//			updateLine.value = eval(sVerseID + '[' + iCounter + ']');
	//			updateLine.value = updateLine.value.replace(/\&quot\;/g, '"');
	//			cntl.options[i].value.search('Custom') != -1

	function onChange_InvFont()
	{
		SetFontImage(document.Detail.InvFont.value,'InvFontImage');
		var s = document.Detail.InvFont.value;
		// Font update
//		if ((s.substring(0,1) == "7") || (s == "80"))
		if  (s.substring(0,1) == "3")
		{
			document.Detail.CheckBoxLargeName.checked = false;
			document.Detail.CheckBoxLargeName.disabled = true;
		}
		else
		{
			document.Detail.CheckBoxLargeName.disabled = false;
		}
	}	
	function BookmarkPage()
	{
		var bookmarktitle = "Your Invitation Place - Invitation " + document.Detail.ItemNumber.value;
		if (document.all) 
		{	window.external.AddFavorite(window.location.href,bookmarktitle);			} 
		else 
		{	alert("Press Ctrl+D To Bookmark this page");			}
	}
	function ClearAreas(fm) {
		fm.A4L1.value = "";
		fm.A4L2.value = "";
		fm.A4L3.value = "";
		fm.A4L4.value = "";
		fm.A4L5.value = "";
		fm.A4L6.value = "";
		fm.A4L7.value = "";
		
		fm.A5L1.value = "";
		fm.A5L2.value = "";
		fm.A5L3.value = "";
		fm.A5L4.value = "";
		fm.A5L5.value = "";
		fm.A5L6.value = "";
		fm.A5L7.value = "";
		
		fm.A6L1.value = "";
		fm.A6L2.value = "";
		fm.A6L3.value = "";
		fm.A6L4.value = "";
		fm.A6L5.value = "";
		fm.A6L6.value = "";
		fm.A6L7.value = "";

		//for (i=1;i=7;i++) {	
			//line = eval('document.Detail.A4L'+i);
			//line.value = ""; 
			//line = eval('document.Detail[A5L'+i+']');
			//line.value = ""; 
			//line = eval('document.Detail[A6L'+i+']');
			//line.value = ""; 
			
		//}
		//			updateLine = eval('document.VerseForm.' + eval('ImprintID[' + iCounter + ']'));
		//			updateLine.value = eval(sVerseID + '[' + iCounter + ']');
	}

	function SetQuote(fm) {
		if (fm.QuoteArea.value == "4") {
			fm.A4L1.value = fm.AQL1.value;
			fm.A4L2.value = fm.AQL2.value;
			fm.A4L3.value = fm.AQL3.value;
			fm.A4L4.value = fm.AQL4.value;
			fm.A4L5.value = fm.AQL5.value;
			fm.A4L6.value = fm.AQL6.value;
			fm.A4L7.value = fm.AQL7.value;
		}
		else if (fm.QuoteArea.value == "5") {
			fm.A5L1.value = fm.AQL1.value;
			fm.A5L2.value = fm.AQL2.value;
			fm.A5L3.value = fm.AQL3.value;
			fm.A5L4.value = fm.AQL4.value;
			fm.A5L5.value = fm.AQL5.value;
			fm.A5L6.value = fm.AQL6.value;
			fm.A5L7.value = fm.AQL7.value;
		}
		else if (fm.QuoteArea.value == "6") {
			fm.A6L1.value = fm.AQL1.value;
			fm.A6L2.value = fm.AQL2.value;
			fm.A6L3.value = fm.AQL3.value;
			fm.A6L4.value = fm.AQL4.value;
			fm.A6L5.value = fm.AQL5.value;
			fm.A6L6.value = fm.AQL6.value;
			fm.A6L7.value = fm.AQL7.value;
		}
	}
	function URLencode(sStr) 
	{
		return escape(sStr).
			replace(/\+/g, '%2B').
                replace(/\"/g,'%22').
                   replace(/\'/g, '%27');
	}
	
	function SetInitialFront(fm) {
	
		if (eval(fm["InitialFront"])) {
			fm.A4L1.value = fm.InitialFront.value;
		}
		
	}
	
	function SetName(fm) {
	
//		if (fm.ADL1.value != "") 
//		{
//			fm.A5L1.value = fm.ADL1.value;
//			fm.A5L2.value = fm.ADL2.value;
//			fm.A5L3.value = fm.ADL3.value;
//		}
	
		if (fm.NameType.value == "N13") {
			if (fm.NameArea.value == "4") {
				fm.A4L1.value = fm.ANL1.value;
			}
			else if (fm.NameArea.value == "5") {
				fm.A5L1.value = fm.ANL1.value;
			}
			else if (fm.NameArea.value == "6") {
				fm.A6L1.value = fm.ANL1.value;
			}
		}
		else if (fm.NameType.value == "N3") {
			if (fm.NameArea.value == "4") {
				if (fm.Staggered.value == "x")
				{
					if ((fm.ANL1.value == "") && (fm.ANL3.value == ""))
					{ // If names are not used, proof with blank
						fm.A4L1.value = "";
					}
					else if (fm.ItemID.value == "3604")
					{	
						fm.A4L1.value = fm.ANL1.value + "<h10><v+15>and<h14><v+15>" + fm.ANL3.value;
					}
					else if ((fm.ItemID.value == "3549") || (fm.ItemID.value == "3615"))
					{
						fm.A4L1.value = "<v-40>" + fm.ANL1.value + "<h20><v+20>and<h24><v+20>" + fm.ANL3.value;
					}
					else if ((fm.ItemID.value == "8813") || (fm.ItemID.value == "8815"))
					{
						fm.A4L1.value = "<v-40>" + fm.ANL1.value + "<h+14><v+20>and<h+14><v+20>" + fm.ANL3.value;
					}
					else if ((fm.ItemID.value == "3402") || (fm.ItemID.value == "3415") || (fm.ItemID.value == "3432"))
					{
						fm.A4L1.value = "<v-20>" + fm.ANL1.value + "<h10><v+20>and<h12><v+20>" + fm.ANL3.value;
					}
					else if ((fm.ItemID.value == "8751") || (fm.ItemID.value == "8753") || (fm.ItemID.value == "8755") || (fm.ItemID.value == "8760") || (fm.ItemID.value == "8761") || (fm.ItemID.value == "8763"))
					{
						fm.A4L1.value = "<p+6><v-50>" + fm.ANL1.value + "<h10><v+30><p-6>and<h14><p+6><v+30>" + fm.ANL3.value;
					}
					else if (fm.ItemID.value == "3662")
					{
						fm.A4L1.value = "<v-40>" + fm.ANL1.value + "<v+20> and <v+20>" + fm.ANL3.value;
					}
					else if (fm.ItemID.value == "3669")
					{
						fm.A4L1.value = "<v-15>" + fm.ANL1.value + "<h10><v+20>and<h14><v+20>" + fm.ANL3.value;
					}
					else
					{	fm.A4L1.value = "<p+6><v-15>" + fm.ANL1.value + "<h10><v+20><p-6>and<h14><p+6><v+20>" + fm.ANL3.value;
					}
					// fm.A4__Name.value = "test5";
					// fm.A4__Bride.value = fm.ANL1.value;
					// fm.A4__Groom.value = fm.ANL3.value;
				}
				else 
				{
					fm.A4L1.value = fm.ANL1.value;
					fm.A4L2.value = fm.ANL2.value;
					fm.A4L3.value = fm.ANL3.value;
				}
			}
			else if (fm.NameArea.value == "5") {
				fm.A5L1.value = fm.ANL1.value;
				fm.A5L2.value = fm.ANL2.value;
				fm.A5L3.value = fm.ANL3.value;
			}
		}
		else if (fm.NameType.value == "N1") {
			fm.A4L1.value = fm.ANL1.value;
			fm.A5L1.value = fm.ANL2.value;
		}
		else if (fm.NameType.value == "ND2") {
			fm.A4L1.value = fm.ANL1.value;
			fm.A4L2.value = fm.ANL2.value;
		}
	}
	function SetComboFont(fm)
	{
		var base = "";
		var name = "";
		var size = "";
		var FP = "";
		var V1 = "";
		var V2 = "";
		var V3 = "";
		var V4 = "";
		
		// Font update
		// 301	166	214
		// 302	182	224
		// 303	205	223
		// 304	165	137
		// 305	136	218
		// 306	205	168
		// 307	182	222
		if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "301")
		{	base = "166";
			name = "214";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "302")
		{	base = "182";
			name = "224";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "303")
		{	base = "205";
			name = "223";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "304")
		{	base = "165";
			name = "137";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "305")
		{	base = "136";
			name = "218";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "306")
		{	base = "205";
			name = "168";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "307")
		{	base = "182";
			name = "222";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "308")
		{	base = "165";
			name = "140";
			size = "<P+8>";
			V1 = "<V+4>";
			V2 = "<V-2>";
			V3 = "<V+4>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "309")
		{	base = "204";
			name = "139";
			size = "<P+8>";
			V1 = "<V+3>";
			V2 = "";
			V3 = "";
			V4 = "<V+3>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "310")
		{	base = "211";
			name = "135";
			size = "<P+8>";
			V1 = "<V+4>";
			V2 = "";
			V3 = "<V+4>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "311")
		{	base = "182";
			name = "219";
			size = "<P+6>";
			V1 = "<V+4>";
			V2 = "<V+2>";
			V3 = "<V+5>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "312")
		{	base = "166";
			name = "120";
			size = "<P+8>";
			V1 = "<V+4>";
			V2 = "<V+2>";
			V3 = "<V+5>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "313")
		{	base = "166";
			name = "207";
			size = "<P+8>";
			V1 = "<V+4>";
			V2 = "";
			V3 = "<V+4>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "314")
		{	base = "165";
			name = "214";
			size = "<P+4>";
			V1 = "<V+4>";
			V2 = "<V+4>";
			V3 = "<V+8>";
			V4 = "";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "315")
		{	base = "164";
			name = "137";
			size = "<P+8>";
			V1 = "<V+4>";
			V2 = "";
			V3 = "<V+2>";
			V4 = "";
		}
		
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "370")
		{	base = "165";
			name = "153";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "371")
		{	base = "165";
			name = "154";
			size = "<P+6>";
			V1 = "<V+6>";
			V2 = "";
			V3 = "<V+6>";
			V4 = "<V+3>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "372")
		{	base = "164";
			name = "135";
			size = "<P+10.5>";
			V1 = "<V+8>";
			V2 = "";
			V3 = "<V+6>";
			V4 = "<V+3>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "373")
		{	base = "166";
			name = "143";
			size = "<P+8>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+8>";
			V4 = "<V+1>";
		}
//		Combo 374 not offered on web
//		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "374")
//		{	base = "164";
//			name = "167";
//			size = "<P+14>";
//			V1 = "<V+8>";
//			V2 = "";
//			V3 = "<V+6>";
//			V4 = "<V+3>";
//		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "375")
		{	base = "165";
			name = "168";
			size = "<P+6>";
			V1 = "<V+12>";
			V2 = "<V-4>";
			V3 = "<V+6>";
			V4 = "<V+1>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "376")
		{	base = "136";
			name = "135";
			size = "<P+12.5>";
			V1 = "<V+8>";
			V2 = "";
			V3 = "<V+6>";
			V4 = "<V+3>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "377")
		{	base = "154";
			name = "165";
			size = "<P+8>";
			V1 = "<V+8>";
			V2 = "<V+2>";
			V3 = "<V+4>";
			V4 = "<V+2>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "378")
		{	base = "166";
			name = "142";
			size = "<P+10>";
			V1 = "<V+12>";
			V2 = "";
			V3 = "<V+8>";
			V4 = "<V+6>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "379")
		{	base = "164";
			name = "116";
			size = "<P+8>";
			V1 = "<V+8>";
			V2 = "";
			V3 = "<V+6>";
			V4 = "<V+3>";
		}
		else if (fm.InvFont.options[fm.InvFont.selectedIndex].value == "380")
		{	base = "165";
			name = "120";
			size = "<P+6>";
			V1 = "<V+6>";
			V2 = "";
			V3 = "<V+6>";
			V4 = "<V+3>";
		}
		
		if (fm.InvFont.value == "377") // For Combo 77 w/ block name font, size must come first
		{	FP = size + "<F" + name + ">";
		}
		else
		{	FP = "<F" + name + ">" + size;
		}

		// Set Names on front
		
		if (base != "")
		{
			fm.Font.value = base;
			//fm.Font.value = fm.InvFont[fm.InvFont.selectedIndex].value;
			//fm.Font.value = fm.InvFont.value;
			if (fm.A1L1IsName.value == "yes")
			{	fm.A1L1.value = V1 + FP + fm.A1L1.value;
				fm.A1L2.value = V2 + fm.A1L2.value;
				fm.A1L3.value = V3 + FP + fm.A1L3.value;
				fm.A1L4.value = V4 + fm.A1L4.value;
			}
			else if (fm.A1L2IsName.value == "yes")
			{	fm.A1L2.value = V1 + FP + fm.A1L2.value;
				fm.A1L3.value = V2 + fm.A1L3.value;
				fm.A1L4.value = V3 + FP + fm.A1L4.value;
				fm.A1L5.value = V4 + fm.A1L5.value;
			}
			else if (fm.A1L3IsName.value == "yes")	
			{	fm.A1L3.value = V1 + FP + fm.A1L3.value;
				fm.A1L4.value = V2 + fm.A1L4.value;
				fm.A1L5.value = V3 + FP + fm.A1L5.value;
				fm.A1L6.value = V4 + fm.A1L6.value;			
			}
			else if (fm.A1L4IsName.value == "yes")	
			{	
				fm.A1L4.value = V1 + FP + fm.A1L4.value;
				fm.A1L5.value = V2 + fm.A1L5.value;
				if (fm.dropdownlistVerse.value != "F14") // This verse has both names on one line
				{
					fm.A1L6.value = V3 + FP + fm.A1L6.value;
					fm.A1L7.value = V4 + fm.A1L7.value;	
				}
			}
			else if (fm.A1L5IsName.value == "yes")
			{	fm.A1L5.value = V1 + FP + fm.A1L5.value;
				fm.A1L6.value = V2 + fm.A1L6.value;
				fm.A1L7.value = V3 + FP + fm.A1L7.value;
				fm.A1L8.value = V4 + fm.A1L8.value;
			}
			else if (fm.A1L6IsName.value == "yes")	
			{	fm.A1L6.value = V1 + FP + fm.A1L6.value;
				fm.A1L7.value = V2 + fm.A1L7.value;
				fm.A1L8.value = V3 + FP + fm.A1L8.value;
				fm.A1L9.value = V4 + fm.A1L9.value;
			}
			else if (fm.A1L10IsName.value == "yes")	// Verse F5
			{	fm.A1L10.value = V1 + FP + fm.A1L10.value;
				fm.A1L11.value = V2 + fm.A1L11.value;
				fm.A1L12.value = V3 + FP + fm.A1L12.value;
				fm.A1L13.value = V4 + fm.A1L13.value;
			}
			else if (fm.A1L15IsName.value == "yes")	// Verse F16
			{	fm.A1L15.value = V1 + FP + fm.A1L15.value;
				fm.A1L16.value = V2 + fm.A1L16.value;
				fm.A1L17.value = V3 + FP + fm.A1L17.value;
				fm.A1L18.value = V4 + fm.A1L18.value;
			}
		}
	}
	function RemoveComboFont(fm)
	{
		// fm.A1L1.value = fm.A1L1.value.replace(<.>,'');
		fm.A1L1.value = fm.A1L1.value.replace(/<.*>/g,'');
		fm.A1L2.value = fm.A1L2.value.replace(/<.*>/g,'');
		fm.A1L3.value = fm.A1L3.value.replace(/<.*>/g,'');
		fm.A1L4.value = fm.A1L4.value.replace(/<.*>/g,'');
		fm.A1L5.value = fm.A1L5.value.replace(/<.*>/g,'');
		fm.A1L6.value = fm.A1L6.value.replace(/<.*>/g,'');
		fm.A1L7.value = fm.A1L7.value.replace(/<.*>/g,'');
		fm.A1L8.value = fm.A1L8.value.replace(/<.*>/g,'');
		fm.A1L9.value = fm.A1L9.value.replace(/<.*>/g,'');
		fm.A1L10.value = fm.A1L10.value.replace(/<.*>/g,'');
		fm.A1L11.value = fm.A1L11.value.replace(/<.*>/g,'');
		fm.A1L12.value = fm.A1L12.value.replace(/<.*>/g,'');
		fm.A1L13.value = fm.A1L13.value.replace(/<.*>/g,'');
		fm.A1L14.value = fm.A1L14.value.replace(/<.*>/g,'');
		fm.A1L15.value = fm.A1L15.value.replace(/<.*>/g,'');
		fm.A1L16.value = fm.A1L16.value.replace(/<.*>/g,'');
		fm.A1L17.value = fm.A1L17.value.replace(/<.*>/g,'');
		fm.A1L18.value = fm.A1L18.value.replace(/<.*>/g,'');
	}
	function ClearPointSize_old(fm)
	{
		// Set all font and line sizes to null
		fm.A1L1PS.value = "";
		fm.A1L2PS.value = "";
		fm.A1L3PS.value = "";
		fm.A1L4PS.value = "";
		fm.A1L5PS.value = "";
		fm.A1L6PS.value = "";
		fm.A1L7PS.value = "";		
		fm.A1L8PS.value = "";		
		// Verse F5		
		fm.A1L10PS.value = "";		
		fm.A1L12PS.value = "";		
		// Verse F16
		fm.A1L15PS.value = "";
		fm.A1L17PS.value = "";

		fm.A1L1LD.value = "";
		fm.A1L2LD.value = "";
		fm.A1L3LD.value = "";
		fm.A1L4LD.value = "";
		fm.A1L5LD.value = "";
		fm.A1L6LD.value = "";
		fm.A1L7LD.value = "";
		fm.A1L8LD.value = "";
		// Verse F5
		fm.A1L10LD.value = "";
		fm.A1L12LD.value = "";
		// Verse F16
		fm.A1L15LD.value = "";
		fm.A1L17LD.value = "";
	}
	function SetPointSize_old(fm)
	{
		if (fm.CheckBoxLargeName.checked == true) {
			var fontsize = "28";
			var fontlead = "32";
			if (fm.InvFont.value == "46") // Font 46 was set up incorrectly in typesetting
			{	fontsize = "40"; 
			}
			if (fm.A1L1IsName.value == "yes")
			{	fm.A1L1PS.value = fontsize;
				fm.A1L1LD.value = fontlead;		
			}
			if (fm.A1L2IsName.value == "yes") 
			{	fm.A1L2PS.value = fontsize;
				fm.A1L2LD.value = fontlead;		
			}
			if (fm.A1L3IsName.value == "yes") 
			{	fm.A1L3PS.value = fontsize;
				fm.A1L3LD.value = fontlead;		
			}
			if (fm.A1L4IsName.value == "yes") 
			{	fm.A1L4PS.value = fontsize;
				fm.A1L4LD.value = fontlead;		
			}
			if (fm.A1L5IsName.value == "yes") 
			{	fm.A1L5PS.value = fontsize;
				fm.A1L5LD.value = fontlead;		
			}
			if (fm.A1L6IsName.value == "yes") 
			{	fm.A1L6PS.value = fontsize;
				fm.A1L6LD.value = fontlead;		
			}
			if (fm.A1L7IsName.value == "yes") 
			{	fm.A1L7PS.value = fontsize;
				fm.A1L7LD.value = fontlead;		
			}
			if (fm.A1L8IsName.value == "yes") 
			{	fm.A1L8PS.value = fontsize;
				fm.A1L8LD.value = fontlead;		
			}
			// Verse F5
			if (fm.A1L10IsName.value == "yes") 
			{	fm.A1L10PS.value = fontsize;
				fm.A1L10LD.value = fontlead;		
			}
			if (fm.A1L12IsName.value == "yes") 
			{	fm.A1L12PS.value = fontsize;
				fm.A1L12LD.value = fontlead;		
			}
			// Verse F16
			if (fm.A1L15IsName.value == "yes") 
			{	fm.A1L15PS.value = fontsize;
				fm.A1L15LD.value = fontlead;		
			}
			if (fm.A1L17IsName.value == "yes") 
			{	fm.A1L17PS.value = fontsize;
				fm.A1L17LD.value = fontlead;		
			}
		}
	}
	function SetLargeName(fm)
	{
//		if (fm.CheckBoxLargeName.checked == true) 
//		{
			//- Lettering that need size set before leading to proof correctly
			//144, 146, 149, 155, 158, 164, 165, 182
			//var line1 = "<V+8><P+8>";
			//var line2 = "<V+4><P+8>";
			var line1 = "<P+8><V+8>";
			var line2 = "<P+8><V+4>";
			var line = line1;
			if (fm.A1L1IsName.value == "yes")
			{	fm.A1L1.value = line + fm.A1L1.value;
				line = line2;
			}
			if (fm.A1L2IsName.value == "yes") 
			{	fm.A1L2.value = line + fm.A1L2.value;
				line = line2;
			}
			if (fm.A1L3IsName.value == "yes") 
			{	fm.A1L3.value = line + fm.A1L3.value;
				line = line2;
			}
			if (fm.A1L4IsName.value == "yes") 
			{	fm.A1L4.value = line + fm.A1L4.value;
				line = line2;
			}
			if (fm.A1L5IsName.value == "yes") 
			{	fm.A1L5.value = line + fm.A1L5.value;
				line = line2;
			}
			if (fm.A1L6IsName.value == "yes") 
			{	fm.A1L6.value = line + fm.A1L6.value;
				line = line2;
			}
			if (fm.A1L7IsName.value == "yes") 
			{	fm.A1L7.value = line + fm.A1L7.value;
				line = line2;
			}
			if (fm.A1L8IsName.value == "yes") 
			{	fm.A1L8.value = line + fm.A1L8.value;
				line = line2;
			}
			// Verse F5
			if (fm.A1L10IsName.value == "yes") 
			{	fm.A1L10.value = line + fm.A1L10.value;
				line = line2;
			}
			if (fm.A1L12IsName.value == "yes") 
			{	fm.A1L12.value = line + fm.A1L12.value;
				line = line2;
			}
			// Verse F16
			if (fm.A1L15IsName.value == "yes") 
			{	fm.A1L15.value = line + fm.A1L15.value;
				line = line2;
			}
			if (fm.A1L17IsName.value == "yes") 
			{	fm.A1L17.value = line + fm.A1L17.value;
				line = line2;
			}
//		}
	}	
	function RemoveLargeName(fm)
	{
//		var line1 = "<P+8><V+8>";
//		var line2 = "<P+8><V+4>";
//		fm.A1L1.value = fm.A1L1.value.replace(line1,'');
//		fm.A1L2.value = fm.A1L2.value.replace(line1,'');

//		fm.A1L3.value = fm.A1L3.value.replace(line1,'');
//		fm.A1L3.value = fm.A1L3.value.replace(line2,'');
//		fm.A1L4.value = fm.A1L4.value.replace(line1,'');
//		fm.A1L4.value = fm.A1L4.value.replace(line2,'');
//		fm.A1L5.value = fm.A1L5.value.replace(line1,'');
//		fm.A1L5.value = fm.A1L5.value.replace(line2,'');
//		fm.A1L6.value = fm.A1L6.value.replace(line1,'');
//		fm.A1L6.value = fm.A1L6.value.replace(line2,'');
//		fm.A1L7.value = fm.A1L7.value.replace(line1,'');
//		fm.A1L7.value = fm.A1L7.value.replace(line2,'');
//		fm.A1L8.value = fm.A1L8.value.replace(line1,'');
//		fm.A1L8.value = fm.A1L8.value.replace(line2,'');
//		// Verse F5
//		fm.A1L10.value = fm.A1L10.value.replace(line1,'');
//		fm.A1L10.value = fm.A1L10.value.replace(line2,'');
//		fm.A1L12.value = fm.A1L12.value.replace(line1,'');
//		fm.A1L12.value = fm.A1L12.value.replace(line2,'');
//		// Verse F16
//		fm.A1L15.value = fm.A1L15.value.replace(line1,'');
//		fm.A1L15.value = fm.A1L15.value.replace(line2,'');
//		fm.A1L17.value = fm.A1L17.value.replace(line1,'');
//		fm.A1L17.value = fm.A1L17.value.replace(line2,'');
		
		fm.A1L1.value = fm.A1L1.value.replace(/<.*>/g,'');
		fm.A1L2.value = fm.A1L2.value.replace(/<.*>/g,'');
		fm.A1L3.value = fm.A1L3.value.replace(/<.*>/g,'');
		fm.A1L4.value = fm.A1L4.value.replace(/<.*>/g,'');
		fm.A1L5.value = fm.A1L5.value.replace(/<.*>/g,'');
		fm.A1L6.value = fm.A1L6.value.replace(/<.*>/g,'');
		fm.A1L7.value = fm.A1L7.value.replace(/<.*>/g,'');
		fm.A1L8.value = fm.A1L8.value.replace(/<.*>/g,'');
		// Verse F5
		fm.A1L10.value = fm.A1L10.value.replace(/<.*>/g,'');
		fm.A1L12.value = fm.A1L12.value.replace(/<.*>/g,'');
		// Verse F16
		fm.A1L15.value = fm.A1L15.value.replace(/<.*>/g,'');
		fm.A1L17.value = fm.A1L17.value.replace(/<.*>/g,'');
	}
	function ViewProof(fm) 
	{ 
		var myfeatures = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,Width=790,Height=530,left=0,top=0';
		var Proof_Wait = "";
		Proof_Wait += "<html><body>";
		Proof_Wait += "<b><font color=#000000 size=4>Your proof is being created</font></b>";
		Proof_Wait += "<br><br>";
		Proof_Wait += "Your invitation preview is being created from the data you entered. <br>";
		Proof_Wait += "It will take about 5-10 seconds, and we ask for your patience. <br>";
		Proof_Wait += "We hope you are delighted when you view your personal wedding invitation.";
		Proof_Wait += "</body></html>";
		//window.open('ProofRead_wait.htm','windowproof',myfeatures);
		myWindow = window.open('','windowproof',myfeatures);
		myWindow.document.write(Proof_Wait);
		myWindow.document.title = "Invitation Proof";
		myWindow.status = "Your proof is being created...";

		ClearAreas(fm);		// Clear out areas 4,5,6
		SetQuote(fm);		// Load quotes
		SetName(fm);		// Set Names
		SetInitialFront(fm);// Set Initial on front
		// ClearPointSize(fm);	// Clear point sizes
		if (fm.CheckBoxLargeName.checked == true) 
		{	SetLargeName(fm);	// Set Large Name
		}
		//fm.Font.value = fm.InvFont[fm.InvFont.selectedIndex].value;
		fm.Font.value = fm.InvFont.value; // Set Font
		SetComboFont(fm);
		
		//ViewProof_Load();
		var formcopy = document.Detail;
		var save_target = formcopy.target;
		var save_action = formcopy.action;
		formcopy.target = "windowproof";
//		formcopy.action = "http://63.117.114.5:180/compose";
		formcopy.action = "http://140.239.248.5:180/compose";
		formcopy.submit();
		formcopy.target = save_target;
		formcopy.action = save_action;
		
		if (fm.CheckBoxLargeName.checked == true) 
		{	RemoveLargeName(fm);
		}
		var s = fm.InvFont.value;
		// Font update
//		if ((s.substring(0,1) == "7") || (s == "80"))
		if  (s.substring(0,1) == "3")
		{	RemoveComboFont(fm);
		}
		fm.A4L1.value = ""; // Clear this since it is used for staggered names
	}
	function ViewProof_Load() 
	{
		//var formcopy = document.Detail;
		//var save_target = formcopy.target;
		//var save_action = formcopy.action;
		//formcopy.target = "windowproof";
		//formcopy.action = "http://63.117.114.5:180/compose";
		//formcopy.submit();
		//formcopy.target = save_target;
		//formcopy.action = save_action;
	}
	function AutoCheck()
	{
		document.Detail.CheckBoxInviteReturnOrder.checked = true;
	}
    function OpenFontWindow(CurrentBox) 
    { 
		document.Detail.CurrentFontBox.value = CurrentBox;
		if (document.Detail[CurrentBox].disabled == false)
		{
			OpenWindow('Fonts.aspx','Weddingfonts','width=550,height=550,left=10,top=2,resizable,status=no,toolbar=no,scrollbars');
		}
    }
    function OpenInkWindow(CurrentBox) 
    { 
		document.Detail.CurrentInkBox.value = CurrentBox;
		if (document.Detail[CurrentBox].disabled == false)
		{
			OpenWindow('Inkcolors.aspx','Inkcolors','width=550,height=550,left=10,top=2,resizable,status=no,toolbar=no,scrollbars');
		}
    }
    function OpenLinerWindow(CurrentBox) 
    { 
		// document.Detail.CurrentLinerBox.value = CurrentBox;  There's only one liner box
		OpenWindow('LinerColor.aspx','Linercolors','width=350,height=550,left=10,top=2,screenX=0,screenY=0,outerwidth=500,outerheight=230,resizable,status=no,toolbar=no,scrollbars');
    }
    function SetInkImage(imagecode,ImageToChange) 
    { 
		document.images[ImageToChange].src = 'app/inkcolors/c' + imagecode + '.gif';
    }
    function SetLinerImage(imagecode,ImageToChange) 
    { 
		document.images[ImageToChange].src = 'app/linercolors/c' + imagecode + '.gif';
    }
    function SetFontImage(fontcode,ImageToChange) 
    { 
		document.images[ImageToChange].src = 'app/fonts/f' + fontcode + 'a.gif';
    }
    function SetFontImage_jm(fontcode,ImageToChange) 
    { 
		document.images[ImageToChange].src = 'app/fonts/jm' + fontcode + '.gif';
    }
	function toCurrency(n) 
	{
		var s = "" + Math.round(n * 100) / 100;
		var i = s.indexOf('.');
		if (i < 0) return s + ".00";
		var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3);
		if (i + 2 == s.length) t += "0";
		return t;
	}   
//	function onChange_PlaceCardsItem()
//	{
//		SetPlaceCardsImage();
//		PlaceCardsDisable();
//	}
	function SetPlaceCardsImage()
	{
		var placecardscode = document.Detail.PlaceCardsItem.value;
		placecardscode = placecardscode.substring(1);
		placecardscode = leftTrim(placecardscode);
		document.images["PlaceCardsImage"].src = 'app/placecards/p' + placecardscode + '.jpg';
	}
	function leftTrim(sString)
	{
		while (sString.substring(0,1) == ' ')
		{
			sString = sString.substring(1, sString.length);
		}
		return sString;
	}	
//	function PlaceCardsDisable()
//	{
//		var item = document.Detail.PlaceCardsItem.value;
//		item = item.substring(1);  // Remove Album
//		document.Detail.PlaceCardsDesign.disabled = false;
//		document.Detail.PlaceCardsInitial.disabled = false;
//		if ((item != "1622") && (item != "1723"))
//		{
//			document.Detail.PlaceCardsDesign.options[0].selected = true;
//			document.Detail.PlaceCardsInitial.options[0].selected = true;
//			document.Detail.PlaceCardsDesign.disabled = true;
//			document.Detail.PlaceCardsInitial.disabled = true;
//		}
//	}

	function onClick_CheckBox2()
	{
		if (document.Detail.CheckBox2.checked == false)
		{
			if (eval(document.Detail["CheckBoxKwikSeal"]))
			{	document.Detail.CheckBoxKwikSeal.checked = false;
			}
			document.Detail.CheckBoxInviteReturn.checked = false;
			// if (document.Detail.DefaultLiner.value != "None")
			if (eval(document.Detail["CheckBoxLinedEnvelope"]))
			{	document.Detail.CheckBoxLinedEnvelope.checked = false;
			}
		}
	}

	function onClick_CheckBoxPlaceCardsBlank()
	{
		var item = document.Detail.PlaceCardsItem.value;
		item = item.substring(1);  // Remove Album
		if (document.Detail.CheckBoxPlaceCardsBlank.checked == true)
		{
			document.Detail.PlaceCardsFont.options[0].selected = true;
			document.Detail.PlaceCardsInk.options[0].selected = true;
			document.Detail.PlaceCardsMonth.options[0].selected = true;
			document.Detail.PlaceCardsDate.options[0].selected = true;
			document.Detail.PlaceCardsYear.options[0].selected = true;
			document.Detail.PlaceCardsFont.disabled = true;
			document.Detail.PlaceCardsInk.disabled = true;
			document.Detail.PlaceCardsNames.value = "";
			document.Detail.PlaceCardsNames.disabled = true;
			document.Detail.PlaceCardsMonth.disabled = true;
			document.Detail.PlaceCardsDate.disabled = true;
			document.Detail.PlaceCardsYear.disabled = true;
			if ((item == "1622") || (item == "1723") || (item == "1724") || (item == "1725"))
			{
				document.Detail.PlaceCardsDesign.options[0].selected = true;
				document.Detail.PlaceCardsInitial.options[0].selected = true;
				document.Detail.PlaceCardsDesign.disabled = true;
				document.Detail.PlaceCardsInitial.disabled = true;
			}
			SetInkImage(document.Detail.PlaceCardsInk.value,'PlaceCardsInkImage')
			SetFontImage_jm(document.Detail.PlaceCardsFont.value,'PlaceCardsFontImage');
		}
		else
		{
			document.Detail.PlaceCardsFont.disabled = false;
			document.Detail.PlaceCardsInk.disabled = false;
			document.Detail.PlaceCardsNames.disabled = false;
			document.Detail.PlaceCardsMonth.disabled = false;
			document.Detail.PlaceCardsDate.disabled = false;
			document.Detail.PlaceCardsYear.disabled = false;
			if ((item == "1622") || (item == "1723") || (item == "1724") || (item == "1725"))
			{
				document.Detail.PlaceCardsDesign.disabled = false;
				document.Detail.PlaceCardsInitial.disabled = false;
			}
		}
	}	
	function onChange_NapkinsItem()
	{
		document.Detail.NapkinsBeverageItem.selectedIndex = document.Detail.NapkinsItem.selectedIndex;
		document.Detail.NapkinsLuncheonItem.selectedIndex = document.Detail.NapkinsItem.selectedIndex;
		SetNapkinImage();
		NapkinsBeverageDisable();
		NapkinsLuncheonDisable();
	} 
	function onChange_NapkinsBeverageItem()
	{	document.Detail.NapkinsItem.selectedIndex = document.Detail.NapkinsBeverageItem.selectedIndex;
		SetNapkinImage();
		NapkinsBeverageDisable();
	}
	function onChange_NapkinsLuncheonItem()
	{	document.Detail.NapkinsItem.selectedIndex = document.Detail.NapkinsLuncheonItem.selectedIndex;
		SetNapkinImage();
		NapkinsLuncheonDisable();
	}
	function NapkinsBeverageDisable()
	{
		var item = document.Detail.NapkinsBeverageItem.value;
		item = item.substring(1);  // Remove Album
		document.Detail.NapkinsBeverageDesign.disabled = false;
		document.Detail.NapkinsBeverageInitial.disabled = false;
		if ((item == "2073") || (item == "2083") || (item == "2085"))
		{
			document.Detail.NapkinsBeverageDesign.options[0].selected = true;
			document.Detail.NapkinsBeverageInitial.options[0].selected = true;
			document.Detail.NapkinsBeverageDesign.disabled = true;
			document.Detail.NapkinsBeverageInitial.disabled = true;
		}
	}
	function NapkinsLuncheonDisable()
	{
		var napkincode = document.Detail.NapkinsLuncheonItem.value;
		napkincode = napkincode.substring(1);  // Remove Album
		document.Detail.NapkinsLuncheonDesign.disabled = false;
		document.Detail.NapkinsLuncheonInitial.disabled = false;
		if ((napkincode == "2072") || (napkincode == "2082") || (napkincode == "2084"))
		{
			document.Detail.NapkinsLuncheonDesign.options[0].selected = true;
			document.Detail.NapkinsLuncheonInitial.options[0].selected = true;
			document.Detail.NapkinsLuncheonDesign.disabled = true;
			document.Detail.NapkinsLuncheonInitial.disabled = true;
		}
	}
	
    function SetNapkinImage() 
    { 
		var napkincode = document.Detail.NapkinsItem.value;
		document.images["NapkinImage"].src = 'app/Napkins/' + napkincode + '.jpg';
		
		document.all.spanNapkinBeverage.innerText = document.Detail.NapkinsBeverageItem[document.Detail.NapkinsBeverageItem.selectedIndex].text;
		document.all.spanNapkinLuncheon.innerText = document.Detail.NapkinsLuncheonItem[document.Detail.NapkinsLuncheonItem.selectedIndex].text;

		var DiscountFactor = 1.00 - (document.Detail.DealerDiscountAcc.value / 100);
		
		if (napkincode == "2057") // White
		{	document.all.spanNapkinType.innerText = "White";
			document.all.spanNapkin50.innerText =		toCurrency(Math.round((24.90 * DiscountFactor)*100)/100); // 23.90
			document.all.spanNapkin100.innerText =		toCurrency(Math.round((30.90 * DiscountFactor)*100)/100); // 29.90
			document.all.spanNapkinAdd50.innerText =	toCurrency(Math.round((12.40 * DiscountFactor)*100)/100); // 11.40
		}
		else if ((napkincode == "2073") || (napkincode == "2083") || (napkincode == "2085"))
		{	document.all.spanNapkinType.innerText = "PreStamped";
			document.all.spanNapkin50.innerText =		toCurrency(Math.round((44.90 * DiscountFactor)*100)/100); // 39.90
			document.all.spanNapkin100.innerText =		toCurrency(Math.round((51.90 * DiscountFactor)*100)/100); // 49.90
			document.all.spanNapkinAdd50.innerText =	toCurrency(Math.round((19.90 * DiscountFactor)*100)/100); // 18.40
		}
		else
		{	document.all.spanNapkinType.innerText = "Colored";
			document.all.spanNapkin50.innerText =		toCurrency(Math.round((25.90 * DiscountFactor)*100)/100); // 24.90
			document.all.spanNapkin100.innerText =		toCurrency(Math.round((31.90 * DiscountFactor)*100)/100); // 30.90
			document.all.spanNapkinAdd50.innerText =	toCurrency(Math.round((12.90 * DiscountFactor)*100)/100); // 11.90
		}
    }
	function PopupPlaceCardsDesign()
	{	if (document.Detail.PlaceCardsDesign.disabled == false)
		{	OpenWindow('Designs.aspx?Update=PlaceCardsDesign','Designs','width=660,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	function PopupPlaceCardsInitial()
	{	if (document.Detail.PlaceCardsInitial.disabled == false)
		{	OpenWindow('Initials.aspx?Update=PlaceCardsInitial','Initials','width=680,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	function PopupNapkinsBeverageDesign()
	{	if (document.Detail.NapkinsBeverageDesign.disabled == false)
		{	OpenWindow('Designs.aspx?Update=NapkinsBeverageDesign','Designs','width=660,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	function PopupNapkinsBeverageInitial()
	{	if (document.Detail.NapkinsBeverageInitial.disabled == false)
		{	OpenWindow('Initials.aspx?Update=NapkinsBeverageInitial','Initials','width=680,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	function PopupNapkinsLuncheonDesign()
	{	if (document.Detail.NapkinsLuncheonDesign.disabled == false)
		{	OpenWindow('Designs.aspx?Update=NapkinsLuncheonDesign','Designs','width=660,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	function PopupNapkinsLuncheonInitial()
	{	if (document.Detail.NapkinsLuncheonInitial.disabled == false)
		{	OpenWindow('Initials.aspx?Update=NapkinsLuncheonInitial','Initials','width=680,height=570,left=2,top=1,resizable,status=no,toolbar=no,scrollbars');
		}
	}
	
 	function onChange_NapkinsBeverageFoil(NewValue)
	{	document.Detail.NapkinsLuncheonFoil.value = NewValue;	}

	function onChange_NapkinsLuncheonFoil(NewValue)
	{	document.Detail.NapkinsBeverageFoil.value = NewValue;		}

	function onChange_NapkinsBeverageDesign(NewValue)
	{	if (document.Detail.NapkinsLuncheonDesign.disabled == false)
		{	document.Detail.NapkinsLuncheonDesign.value = NewValue;		}
	}
	function onChange_NapkinsLuncheonDesign(NewValue)
	{	if (document.Detail.NapkinsBeverageDesign.disabled == false)
		{	document.Detail.NapkinsBeverageDesign.value = NewValue;		}
	}
	function onChange_NapkinsBeverageInitial(NewValue)
	{	if (document.Detail.NapkinsLuncheonInitial.disabled == false)
		{	document.Detail.NapkinsLuncheonInitial.value = NewValue;	}
	}
	function onChange_NapkinsLuncheonInitial(NewValue)
	{	if (document.Detail.NapkinsBeverageInitial.disabled == false)
		{	document.Detail.NapkinsBeverageInitial.value = NewValue;	}
	}
	function OpenWindow(URL, WinName, Features) { 
		WinName = window.open(URL, WinName, Features); 
	} 
	function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
	}
	function myfunction() { 
		// This function could be used for processing after proof has been viewed.  Call from proof page
		//document.Detail.test4.click();
	} 


/*  ================================================================
    RETURNS:  true, if card passes the Luhn Mod-10 test. false, otherwise
    ================================================================ */
function isCreditCard(st) {
  // Encoding only works on cards with less than 19 digits
  if (st.length > 19)
    return (false);

  sum = 0; mul = 1; l = st.length;
  for (i = 0; i < l; i++) {
    digit = st.substring(l-i-1,l-i);
    tproduct = parseInt(digit ,10)*mul;
    if (tproduct >= 10)
      sum += (tproduct % 10) + 1;
    else
      sum += tproduct;
    if (mul == 1)
      mul++;
    else
      mul--;
  }
// Uncomment the following line to help create credit card numbers
// 1. Create a dummy number with a 0 as the last digit
// 2. Examine the sum written out
// 3. Replace the last digit with the difference between the sum and
//    the next multiple of 10.

//  document.writeln("<BR>Sum      = ",sum,"<BR>");
//  alert("Sum      = " + sum);

  if ((sum % 10) == 0)
    return (true);
  else
    return (false);

} 
/*  ================================================================
    Sample number: 4111 1111 1111 1111 (16 digits)    
    ================================================================ */
function isVisa(cc)
{
  if (((cc.length == 16) || (cc.length == 13)) &&
      (cc.substring(0,1) == 4))
    return isCreditCard(cc);
  return false;
}  
/*  ================================================================
    Sample number: 340000000000009 (15 digits)
    ================================================================ */
function isAmericanExpress(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 15) && (firstdig == 3) &&
      ((seconddig == 4) || (seconddig == 7)))
    return isCreditCard(cc);
  return false;

} 


/*  ================================================================
    Sample number: 5500 0000 0000 0004 (16 digits)    
    ================================================================ */
function isMasterCard(cc)
{
  firstdig = cc.substring(0,1);
  seconddig = cc.substring(1,2);
  if ((cc.length == 16) && (firstdig == 5) &&
      ((seconddig >= 1) && (seconddig <= 5)))
    return isCreditCard(cc);
  return false;

} 


/*  ================================================================
    Sample number: 6011000000000004 (16 digits)
    ================================================================ */
function isDiscover(cc)
{
  first4digs = cc.substring(0,4);
  if ((cc.length == 16) && (first4digs == "6011"))
    return isCreditCard(cc);
  return false;

} 


function isAnyCard(cc)
{
  if (!isCreditCard(cc))
    return false;
  if (!isMasterCard(cc) && !isVisa(cc) && !isAmericanExpress(cc) && !isDiscover(cc) ) {
    return false;
  }
  return true;
}


function isCardMatch (cardType, cardNumber)
{
	cardType = cardType.toUpperCase();
	var doesMatch = true;

	if ((cardType == "VISA") && (!isVisa(cardNumber)))
		doesMatch = false;
	if ((cardType == "MASTERCARD") && (!isMasterCard(cardNumber)))
		doesMatch = false;
	if ( ( (cardType == "AMERICANEXPRESS") || (cardType == "AMERICAN EXPRESS") || (cardType == "AMEX") )
                && (!isAmericanExpress(cardNumber))) doesMatch = false;
	if ((cardType == "DISCOVER") && (!isDiscover(cardNumber)))
		doesMatch = false;
	return doesMatch;
}  

	// Returns true if character c is an English letter 
	// (A .. Z, a..z).
	//
	// NOTE: Need i18n version to support European characters.
	// This could be tricky due to different character
	// sets and orderings for various languages and platforms.
	function isLetter (c)
	{   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) );
	}

	// Returns true if character c is a digit 
	// (0 .. 9).
	function isDigit (c)
	{   return ((c >= "0") && (c <= "9"));
	}

	// Returns true if character c is a letter or digit.
	function isLetterOrDigit (c)
	{   return (isLetter(c) || isDigit(c))
	}

	// isInteger (STRING s [, BOOLEAN emptyOK])
	// 
	// Returns true if all characters in string s are numbers.
	//
	// Accepts non-signed integers only. Does not accept floating 
	// point, exponential notation, etc.
	//
	// We don't use parseInt because that would accept a string
	// with trailing non-numeric characters.
	//
	// By default, returns defaultEmptyOK if s is empty.
	// There is an optional second argument called emptyOK.
	// emptyOK is used to override for a single function call
	//      the default behavior which is specified globally by
	//      defaultEmptyOK.
	// If emptyOK is false (or any value other than true), 
	//      the function will return false if s is empty.
	// If emptyOK is true, the function will return true if s is empty.
	//
	// EXAMPLE FUNCTION CALL:     RESULT:
	// isInteger ("5")            true 
	// isInteger ("")             defaultEmptyOK
	// isInteger ("-5")           false
	// isInteger ("", true)       true
	// isInteger ("", false)      false
	// isInteger ("5", false)     true
	function isInteger (s)
	{   var i;
		// Search through string's characters one by one
		// until we find a non-numeric character.
		// When we do, return false; if we don't, return true.
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character is number.
			var c = s.charAt(i);
			if (!isDigit(c)) return false;
		}
		// All characters are numbers.
		return true;
	}
	// Removes all characters which appear in string bag from string s.
	function stripCharsInBag (s, bag)
	{   var i;
		var returnString = "";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = s.charAt(i);
			if (bag.indexOf(c) == -1) returnString += c;
		}
		return returnString;
	}
	
	function CheckExtra(source, arguments)
	{
		if ( (document.Detail.CheckBoxInviteReturnOrder.checked == false) && (document.Detail.QuantPrintedOuter.value != "0") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckExtraLined(source, arguments)
	{
		if ( (document.Detail.CheckBoxLinedEnvelopeOrder.checked == false) && (document.Detail.QuantLinedInner.value != "0") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckExtraInf(source, arguments)
	{
		if ( (document.Detail.CheckBoxInformalReturnOrder.checked == false) && (document.Detail.QuantPrintedOuterInf.value != "0") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckExtraThank(source, arguments)
	{
		if ( (document.Detail.CheckBoxThankYouReturnOrder.checked == false) && (document.Detail.QuantPrintedOuterThank.value != "0") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	
	function CheckProof(source, arguments)
	{
		if ( (document.Detail.CheckBoxInviteReturnOrder.checked == false) && 
			(document.Detail.ProofInvRetBW.checked || document.Detail.ProofInvRetPress.checked) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckProofInf(source, arguments)
	{
		if ( (document.Detail.CheckBoxInformalReturnOrder.checked == false) && 
			(document.Detail.ProofInfRetBW.checked || document.Detail.ProofInfRetPress.checked) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckProofThank(source, arguments)
	{
		if ( (document.Detail.CheckBoxThankYouReturnOrder.checked == false) && 
			(document.Detail.ProofThankRetBW.checked || document.Detail.ProofThankRetPress.checked) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckOrderState(source, arguments)
	{
		if (document.Detail.OrderState.value == "")
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckOrderZip(source, arguments)
	{
		if ( (document.Detail.OrderZip.value.length < 5) && 
			 (document.Detail.OrderState.value != "I") && 
			 (document.Detail.OrderState.value != "") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckShipZip(source, arguments)
	{
		if ( (document.Detail.ShipZip.value.length < 5) && 
			 (document.Detail.ShipState.value != "I") && 
			 (document.Detail.ShipState.value != "") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckValidOrderZip(source,arguments)
	{
		var s = document.Detail.OrderZip.value;
		s = stripCharsInBag (s, "-");
	    if ( ( isInteger(s) &&  ((s.length == 5) || (s.length == 9)) )  || 
			(document.Detail.OrderState.value == "I" ) || (s == "" ) )
			arguments.IsValid = true;
		else
			arguments.IsValid = false;
	}
	function CheckValidShipZip(source,arguments)
	{
		var s = document.Detail.ShipZip.value;
		s = stripCharsInBag (s, "-");
	    if ( ( isInteger(s) &&  ((s.length == 5) || (s.length == 9)) )  || 
			(document.Detail.ShipState.value == "I" ) || (s == "" ) )
			arguments.IsValid = true;
		else
			arguments.IsValid = false;
	}
	function CheckZone9(source,arguments)
	{
		// Only allow next day and 2nd day for zone 9
		var Zip3 = "";
		if      ( (document.Detail.ShipTo[1].checked == true) && (document.Detail.OrderState.value != "I") && (document.Detail.OrderZip.value.length >= 3) )
			Zip3 = document.Detail.OrderZip.value.substring(0,3);	
		else if ( (document.Detail.ShipTo[2].checked == true) && (document.Detail.ShipState.value != "I")  && (document.Detail.ShipZip.value.length >= 3) )
			Zip3 = document.Detail.ShipZip.value.substring(0,3);	
		
		var SelectedValue = "";
		for (var i=0; i < document.Detail.ShipMethod.length; i++)
		{
			if (document.Detail.ShipMethod[i].checked == true)
			{	
				SelectedValue = document.Detail.ShipMethod[i].value;
			}
		}
		
		// If it's not 2nd day or next day
		//if ( ( (document.Detail.ShipMethod[3].checked == false) && (document.Detail.ShipMethod[4].checked == false) ) &&
//		if ( ( (SelectedValue != "3") && (SelectedValue != "4") ) &&
		if ( ( (SelectedValue != "3") && (SelectedValue != "4") && (SelectedValue != "8") && (SelectedValue != "9") ) &&
		  ( (Zip3 == "006") ||
			(Zip3 == "007") ||
			(Zip3 == "008") ||
			(Zip3 == "009") ||
			(Zip3 == "962") ||
			(Zip3 == "963") ||
			(Zip3 == "964") ||
			(Zip3 == "965") ||
			(Zip3 == "966") ||
			(Zip3 == "967") ||
			(Zip3 == "968") ||
			(Zip3 == "969") ||
			(Zip3 == "995") ||
			(Zip3 == "996") ||
			(Zip3 == "997") ||
			(Zip3 == "998") ||
			(Zip3 == "999") ) )
			arguments.IsValid = false;
		else
			arguments.IsValid = true;
	}
	function CheckOrderCountry(source,arguments)
	{
	    if ( (document.Detail.OrderState.value == "I") && (document.Detail.OrderCountry.value == "")  )
			arguments.IsValid = false;
		else
			arguments.IsValid = true;
	}
	function CheckShipCountry(source,arguments)
	{
	    if ( (document.Detail.ShipState.value == "I") && (document.Detail.ShipCountry.value == "")  )
			arguments.IsValid = false;
		else
			arguments.IsValid = true;
	}
	function CheckValidCardNumber(source,arguments)
	{
		if (isCardMatch(document.Detail.CardType.value, document.Detail.CardNumber.value) ||
			(document.Detail.CardNumber.value == "12345") )
			arguments.IsValid = true;
		else
			arguments.IsValid = false;
	}
	function CheckCardType(source, arguments)
	{
		if  ( (document.Detail.DealerCreditCardOption.value == "2") &&
			  (document.Detail.CardType.value == "") )
			arguments.IsValid = false;
		else if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[1].checked == true) && 
			     (document.Detail.CardType.value == "")	)
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	function CheckCardNumber(source, arguments)
	{
		if  ( (document.Detail.DealerCreditCardOption.value == "2") &&
			  (document.Detail.CardNumber.value == "") )
			arguments.IsValid = false;
		else if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[1].checked == true) && 
			     (document.Detail.CardNumber.value == "")	)
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	function CheckCardName(source, arguments)
	{
		if  ( (document.Detail.DealerCreditCardOption.value == "2") &&
			  (document.Detail.CardName.value == "") )
			arguments.IsValid = false;
		else if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[1].checked == true) && 
			     (document.Detail.CardName.value == "")	)
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	
	function CheckInitialFront(source, arguments)
	{
		if  (document.Detail.InitialFront.value == "")
			arguments.IsValid = false;
		else
			arguments.IsValid = true;
	}

	function CheckCardMonthYear(source, arguments)
	{
		if  ( (document.Detail.DealerCreditCardOption.value == "2") &&
			  ((document.Detail.CardMonth.value == "") || (document.Detail.CardYear.value == "") ) )
			arguments.IsValid = false;
		else if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[1].checked == true) && 
			  ((document.Detail.CardMonth.value == "") || (document.Detail.CardYear.value == "") ) )
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	function CheckCardCVV2(source, arguments)
	{
		if  ( (document.Detail.DealerCreditCardOption.value == "2") &&
			  (document.Detail.CardCVV2.value == "") )
			arguments.IsValid = false;
		else if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[1].checked == true) && 
			     (document.Detail.CardCVV2.value == "")	)
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	function CheckPaymentType1(source, arguments)
	{
		if (document.Detail.DealerCreditCardOption.value == "3")
		{
			if ( (document.Detail.PaymentType[0].checked == true) && 
			   ( (document.Detail.CardType.value != "")		||
			     (document.Detail.CardNumber.value != "")	||
			     (document.Detail.CardMonth.value != "")	||
			     (document.Detail.CardYear.value != "")		||
			     (document.Detail.CardCVV2.value != "")		)  )
				arguments.IsValid = false;
			else
				arguments.IsValid = true;
		}	
		else
			arguments.IsValid = true;
	}
	function CheckDealerComments(source, arguments)
	{
		if (document.Detail.DealerComments.value.length > 250)
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckOrderComments(source, arguments)
	{
		if (document.Detail.OrderComments.value.length > 250)
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
    function CheckInternalEmail(source, arguments)     
    {
        if (   (document.Detail.TextBoxDealerEmail.value == "orders@birchcraft.com") 
			|| (document.Detail.TextBoxDealerEmail.value == "order@birchcraft.com") 
			|| (document.Detail.TextBoxDealerEmail.value == "cs@birchcraft.com") 
			|| (document.Detail.TextBoxDealerEmail.value == "artwork@birchcraft.com") 
			|| (document.Detail.TextBoxDealerEmail.value == "art@birchcraft.com")		)
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function AddressPOCheck(source, arguments)     {
        var address = document.Detail.OrderAddress.value;
        address = address.toLowerCase();
        if ( ((address.indexOf('p.o.') > -1) || (address.indexOf('po box') > -1)) && (document.Detail.ShipTo[1].checked == true) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function ShipAddressPOCheck(source, arguments)     {
        var address = document.Detail.ShipAddress.value;
        address = address.toLowerCase();
        if ( (address.indexOf('p.o.') > -1) || (address.indexOf('po box') > -1) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
	function CheckBW_NapkinsBeverage(source, arguments)
	{
		var item = document.Detail.NapkinsBeverageItem.value;
		item = item.substring(1); // Remove Album
		if (((item == "2061") && (document.Detail.NapkinsBeverageFoil.value == "BL") ) ||
			((item == "2057") && (document.Detail.NapkinsBeverageFoil.value == "WH") ) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckBW_NapkinsLuncheon(source, arguments)
	{
		var item = document.Detail.NapkinsLuncheonItem.value;
		item = item.substring(1); // Remove Album
		if (((item == "2060") && (document.Detail.NapkinsLuncheonFoil.value == "BL") ) ||
			((item == "2056") && (document.Detail.NapkinsLuncheonFoil.value == "WH") ) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckBW_Notepads(source, arguments)
	{
		var item = document.Detail.NotepadItem.value;
		item = item.substring(1); // Remove Album
		if (((item == "1108") && (document.Detail.NotepadFoil.value == "BL") ) ||
			((item == "1099") && (document.Detail.NotepadFoil.value == "WH") ) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckBW_MatchBooks(source, arguments)
	{
		var item = document.Detail.MatchBooksItem.value;
		item = item.substring(1); // Remove Album
		if ( ( (item == "1085") || (item == "1083") )
			&& (document.Detail.MatchBooksFoil.value == "WH")  )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckDesignsInitials_NapkinsBeverage(source, arguments)
	{
		var item = document.Detail.NapkinsBeverageItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.NapkinsBeverageDesign.value != "") &&
			(document.Detail.NapkinsBeverageInitial.value != "") &&
			(document.Detail.NapkinsBeverageQuant.value != "0") &&						
			(item != "2073") &&
			(item != "2083") &&
			(item != "2085")	)
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckDesignsInitials_NapkinsLuncheon(source, arguments)
	{
		var item = document.Detail.NapkinsLuncheonItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.NapkinsLuncheonDesign.value != "") &&
			(document.Detail.NapkinsLuncheonInitial.value != "") &&
			(document.Detail.NapkinsLuncheonQuant.value != "0") &&						
			(item != "2072") &&
			(item != "2082") &&
			(item != "2084")  )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckDesignsInitials_PlaceCards(source, arguments)
	{
		if (document.Detail.CheckBoxPlaceCardsBlank.checked == true)
		{
			arguments.IsValid = true;
		}
		else if ((document.Detail.PlaceCardsDesign.value != "") &&
    			 (document.Detail.PlaceCardsInitial.value != "") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckDesignsInitials_Notepad(source, arguments)
	{
		if ((document.Detail.NotepadDesign.value != "") &&
			(document.Detail.NotepadInitial.value != "") )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckDesignsInitials_MatchBooks(source, arguments)
	{
		var item = document.Detail.MatchBooksItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.MatchBooksDesign.value != "") &&
			(document.Detail.MatchBooksInitial.value != "") &&
			(item != "1083")		)
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckNapkinsQuant(source,arguments)
	{
		if ( (document.Detail.NapkinsBeverageQuant.value == "0") &&
			(document.Detail.NapkinsLuncheonQuant.value == "0") )
			arguments.IsValid = false;
		else
			arguments.IsValid = true;
	}
	function CheckDI_NapkinsBeverage(source,arguments)
	{
		var item = document.Detail.NapkinsBeverageItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.NapkinsBeverageDesign.value == "") &&
			(document.Detail.NapkinsBeverageInitial.value == "") &&
			(document.Detail.NapkinsBeverageQuant.value != "0") &&			
			(item != "2073") &&
			(item != "2083") &&
			(item != "2085")  )
		{
			yesno = window.confirm("You did not select either a Design or an Initial on the Beverage Napkin. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckDI_NapkinsLuncheon(source,arguments)
	{
		var item = document.Detail.NapkinsLuncheonItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.NapkinsLuncheonDesign.value == "") &&
			(document.Detail.NapkinsLuncheonInitial.value == "") &&
			(document.Detail.NapkinsLuncheonQuant.value != "0") &&						
			(item != "2072") &&
			(item != "2082") &&
			(item != "2084") )
		{
			yesno = window.confirm("You did not select either a Design or an Initial on the Luncheon Napkin. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckDI_PlaceCards(source,arguments)
	{
		var item = document.Detail.PlaceCardsItem.value;
		item = item.substring(1); // Remove Album
		if (document.Detail.CheckBoxPlaceCardsBlank.checked == true)
		{
			arguments.IsValid = true;
		}
		else if ((document.Detail.PlaceCardsDesign.value == "") &&
			(document.Detail.PlaceCardsInitial.value == "") &&
			(document.Detail.PlaceCardsQuant.value != "0")  &&
			((item == "1622") || (item == "1723") || (item == "1724") || (item == "1725"))
			)
		{
			yesno = window.confirm("You did not select either a Design or an Initial. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckDI_Notepad(source,arguments)
	{
		if ((document.Detail.NotepadDesign.value == "") &&
			(document.Detail.NotepadInitial.value == "") &&
			(document.Detail.NotepadQuant.value != "0"))
		{
			yesno = window.confirm("You did not select either a Design or an Initial. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckDI_MatchBooks(source,arguments)
	{
		var item = document.Detail.MatchBooksItem.value;
		item = item.substring(1); // Remove Album
		if ((document.Detail.MatchBooksDesign.value == "") &&
			(document.Detail.MatchBooksInitial.value == "") &&
			(document.Detail.MatchBooksQuant.value != "0")  &&
			(item != "1083") )
		{
			yesno = window.confirm("You did not select either a Design or an Initial. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_NapkinsBeverageNames(source,arguments)
	{
		if ( (document.Detail.NapkinsBeverageNames.value == "") &&
			(document.Detail.NapkinsBeverageQuant.value != "0") )
		{
			yesno = window.confirm("You did not enter Names for Beverage Napkins. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_NapkinsLuncheonNames(source,arguments)
	{
		if ( (document.Detail.NapkinsLuncheonNames.value == "") &&
			(document.Detail.NapkinsLuncheonQuant.value != "0") )
		{
			yesno = window.confirm("You did not enter Names for Luncheon Napkins. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_NapkinsBeverageDate(source,arguments)
	{
		if (((document.Detail.NapkinsBeverageMonth.value == "") ||
			(document.Detail.NapkinsBeverageDate.value	== "") ||
			(document.Detail.NapkinsBeverageYear.value	== "") )&&
			(document.Detail.NapkinsBeverageQuant.value	!= "0") )
		{
			yesno = window.confirm("You did not enter a Beverage Napkin Date. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_NapkinsLuncheonDate(source,arguments)
	{
		if (((document.Detail.NapkinsLuncheonMonth.value == "") ||
			(document.Detail.NapkinsLuncheonDate.value	== "") ||
			(document.Detail.NapkinsLuncheonYear.value	== "") )&&
			(document.Detail.NapkinsLuncheonQuant.value	!= "0") )
		{
			yesno = window.confirm("You did not enter a Luncheon Napkin Date. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_PlaceCardsDate(source,arguments)
	{
		if (document.Detail.CheckBoxPlaceCardsBlank.checked == true)
		{
			arguments.IsValid = true;
		}
		else if ((document.Detail.PlaceCardsMonth.value == "") ||
			(document.Detail.PlaceCardsDate.value  == "") ||
			(document.Detail.PlaceCardsYear.value  == "") )
		{
			yesno = window.confirm("You did not enter a Date. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	
	function Check_NotepadDate(source,arguments)
	{
		if ((document.Detail.NotepadMonth.value == "") ||
			(document.Detail.NotepadDate.value	== "") ||
			(document.Detail.NotepadYear.value	== "") )
		{
			yesno = window.confirm("You did not enter a Date. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_MatchBooksDate(source,arguments)
	{
		if ((document.Detail.MatchBooksMonth.value == "") ||
			(document.Detail.MatchBooksDate.value	== "") ||
			(document.Detail.MatchBooksYear.value	== "") )
		{
			yesno = window.confirm("You did not enter a Date. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_PlaceCardsNames(source,arguments)
	{
		if (document.Detail.CheckBoxPlaceCardsBlank.checked == true)
		{
			arguments.IsValid = true;
		}
		else if (document.Detail.PlaceCardsNames.value == "") 
		{
			yesno = window.confirm("You did not enter Names. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	
	function Check_NotepadNames(source,arguments)
	{
		if (document.Detail.NotepadNames.value == "") 
		{
			yesno = window.confirm("You did not enter Names. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function Check_MatchBooksNames(source,arguments)
	{
		if (document.Detail.MatchBooksNames.value == "") 
		{
			yesno = window.confirm("You did not enter Names. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckNapkinsOnlyOne(source,arguments)
	{
		if ( (document.Detail.NapkinsBeverageQuant.value != "0") &&
			(document.Detail.NapkinsLuncheonQuant.value == "0") )
		{
			yesno = window.confirm("You chose a Beverage napkin, but not a Luncheon Napkin. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else if ( (document.Detail.NapkinsBeverageQuant.value == "0") &&
			(document.Detail.NapkinsLuncheonQuant.value != "0") )
		{
			yesno = window.confirm("You chose a Luncheon napkin, but not a Beverage Napkin. Are you sure?"); 
			if (yesno == 1)
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
			arguments.IsValid = true;
	}
	function CheckBillboard(source, arguments)
	{
		var item = document.Detail.MatchBooksItem.value;
		item = item.substring(1); // Remove Album
		if ( (item == "1083") &&
		((document.Detail.MatchBooksDesign.value != "") ||
			(document.Detail.MatchBooksInitial.value != "") ) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function CheckMline(source, arguments)
	{
		var item = document.Detail.MatchBooksItem.value;
		item = item.substring(1); // Remove Album
		if ( (item != "1083") &&
			(document.Detail.CheckBoxMline.checked == true) )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
	}
	function NotepadHotspot(Item)
	{
		Prefix = document.Detail.NotepadItem[1].value.substring(0,1);
		document.Detail.NotepadItem.value = Prefix + Item;
		document.all.spanNotepad.innerText = "You Selected " +Prefix + Item;
	}
	function SetDayOfWeek(FormObj) {
 		var newdate, newday;
		newdate=new Date(FormObj.Year.options[FormObj.Year.selectedIndex].text, FormObj.Month.options[FormObj.Month.selectedIndex].value -1, FormObj.Date.options[FormObj.Date.selectedIndex].text);
		// Had to use display values because actual values are for verse
		//newdate=new Date(FormObj.Year.options[FormObj.Year.selectedIndex].value, FormObj.Month.options[FormObj.Month.selectedIndex].value -1, FormObj.Date.options[FormObj.Date.selectedIndex].value);
		newday=newdate.getDay();
		if		(newday == 6) {	FormObj.WeekDay.value = "Saturday";  	}
		else if (newday == 0) {	FormObj.WeekDay.value = "Sunday";		}
		else if (newday == 1) {	FormObj.WeekDay.value = "Monday";		}
		else if (newday == 2) {	FormObj.WeekDay.value = "Tuesday";		}
		else if (newday == 3) {	FormObj.WeekDay.value = "Wednesday";	}
		else if (newday == 4) {	FormObj.WeekDay.value = "Thursday";		}
		else if (newday == 5) {	FormObj.WeekDay.value = "Friday";		}
	}
    function ClientValidatePanel2(source, arguments)     {
    
		if (eval(document.Detail["CheckBox7"]))
		{	
			if ((document.Detail.CheckBox2.checked == true) || 
				(document.Detail.CheckBox5.checked == true) ||
				(document.Detail.CheckBox6.checked == true) ||
				(document.Detail.CheckBox7.checked == true) ||
				(document.Detail.CheckBox8.checked == true) )
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
		else
		{
			if ((document.Detail.CheckBox2.checked == true) || 
				(document.Detail.CheckBox5.checked == true) ||
				(document.Detail.CheckBox6.checked == true) )
				arguments.IsValid = true;
			else
				arguments.IsValid = false;
		}
    }
    function ClientValidatePanelAdd(source, arguments)     {
        if ((document.Detail.CheckBoxInviteReturnOrder.checked == true) &&
           ((document.Detail.EnvelopePrintLine1.value == "") ||
            (document.Detail.EnvelopePrintLine2.value == "") ||
            (document.Detail.EnvelopePrintLine1.value == "(Insert Address)") ||
            (document.Detail.EnvelopePrintLine2.value == "(Insert City, State  Zip)") )
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function ClientValidatePanelRes(source, arguments)     {
        if ((document.Detail.ResEnvelopePrintLine1.value == "") ||
            (document.Detail.ResEnvelopePrintLine2.value == "") ||
            (document.Detail.ResEnvelopePrintLine3.value == "")                         
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function ClientValidatePanelInf(source, arguments)     {
        if ((document.Detail.CheckBoxInformalReturnOrder.checked == true) &&
           ((document.Detail.InfEnvelopePrintLine1.value == "") ||
            (document.Detail.InfEnvelopePrintLine2.value == "") ||
            (document.Detail.InfEnvelopePrintLine1.value == "(Insert Address)") ||
            (document.Detail.InfEnvelopePrintLine2.value == "(Insert City, State  Zip)") )
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function ClientValidatePanelThank(source, arguments)     {
        if ((document.Detail.CheckBoxThankYouReturnOrder.checked == true) &&
           ((document.Detail.ThankEnvelopePrintLine1.value == "") ||
            (document.Detail.ThankEnvelopePrintLine2.value == "") ||
            (document.Detail.ThankEnvelopePrintLine1.value == "(Insert Address)") ||
            (document.Detail.ThankEnvelopePrintLine2.value == "(Insert City, State  Zip)") )
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function RequireFax(source, arguments) {
        if ((document.Detail.OrderProofMethod[0].checked == true) && (document.Detail.OrderFax.value == ""))
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
    }
    function DropShipSelected(source, arguments)     {
        if ((document.Detail.ShipTo[2].checked == false) &&
           ((document.Detail.ShipName.value != "") ||
            (document.Detail.ShipAddress.value != "") ||
            (document.Detail.ShipCity.value != "") ||
            (document.Detail.ShipState.value != "") ||
            (document.Detail.ShipZip.value != "") )
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
     }
     function DropShipRequireAddress(source,arguments) {
        if ((document.Detail.ShipTo[2].checked == true) &&
           ((document.Detail.ShipName.value == "") ||
            (document.Detail.ShipAddress.value == "") ||
            (document.Detail.ShipCity.value == "") ||
            (document.Detail.ShipState.value == "") ||
            (document.Detail.ShipZip.value == "") )
             )
          arguments.IsValid = false;
        else
          arguments.IsValid = true;
     }
