	// JavaScript Document
	
	<!--
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
	}
	//-->
	
	
	function  SelectCard()
	{
	if (document.client_info.type.value == 'amex')
	{
	card.style.display = "none";
	card_mx.style.display = "";
	
		document.forms['client_info'].elements['mxcard1'].value =  '';
		document.forms['client_info'].elements['mxcard2'].value =  '';
		document.forms['client_info'].elements['mxcard3'].value =  '';
		document.forms['client_info'].elements['card1'].value =  '';
		document.forms['client_info'].elements['card2'].value =  '';
		document.forms['client_info'].elements['card3'].value =  '';
		document.forms['client_info'].elements['card4'].value =  '';
	
	}
	else
	{
	card_mx.style.display = "none";
	card.style.display = "";
		document.forms['client_info'].elements['mxcard1'].value =  '';
		document.forms['client_info'].elements['mxcard2'].value =  '';
		document.forms['client_info'].elements['mxcard3'].value =  '';
		document.forms['client_info'].elements['card1'].value =  '';
		document.forms['client_info'].elements['card2'].value =  '';
		document.forms['client_info'].elements['card3'].value =  '';
		document.forms['client_info'].elements['card4'].value =  '';
	}
	
	}
	
	function checkpackagechoice() 
	{

		if (document.client_info.A23.checked == true || document.client_info.B23.checked == true)
		{

			document.client_info.hdaddon5.checked = false;
			document.client_info.hdaddon6.checked = false;
			document.client_info.hdaddon5.disabled = true;
			document.client_info.hdaddon6.disabled = true;
		}
		else
		{

			document.client_info.hdaddon5.disabled = false;
			document.client_info.hdaddon6.disabled = false;

		}

		//if (document.client_info.A23.checked == true || document.client_info.B23.checked == true)
		//{
		//	document.client_info.hdaddon.checked == false;
		//	alert("You have already selected dishHD.  You cannot add any HD add ons to this package.");
		//	return false;
		//}
	}
	
	function hide() 
	{
		//var div_ref = document.all("id_div");
		if (document.client_info.issame.checked == false)
			//(document.client_info.issame.value ==  'yes')
			{
				//alert("yes");
				billing_div.style.display = "none";
				document.client_info.issame.value = 'no';
				//div_ref.style.visibility = "hidden";
				//div_ref.style.display = "none";
			}
		else
			{	
				//alert("no");
				//div_ref.style.visibility = "visible";
				//div_ref.style.display = "block";
				billing_div.style.display = "";
				document.forms['client_info'].elements['b_firstname'].value = '';
				document.forms['client_info'].elements['b_initial'].value =  '';
				document.forms['client_info'].elements['b_lastname'].value =  '';
				document.forms['client_info'].elements['b_address1'].value =  '';
				document.forms['client_info'].elements['b_address2'].value =  '';
				document.forms['client_info'].elements['b_city'].value =  '';
				document.forms['client_info'].elements['b_state'].value =  '';	
				document.forms['client_info'].elements['b_zip'].value =  '';
				document.forms['client_info'].elements['b_dayareacode'].value =  '';
				document.forms['client_info'].elements['b_day3first'].value =  '';
				document.forms['client_info'].elements['b_day4last'].value =  '';
			}
	}
	
	function show() 
	{
		var div_ref = document.all("id_div");
		div_ref.style.visibility = "visible";
	}
	
	
//check the values of each field in the form.

	function validateclient3_info(client_info)
	
		{
			if (client_info.frompage3.value == "yes") 
			{			
			if(client_info.cvv.value=="")
			 {alert("Please enter your CVV.")
			 client_info.cvv.focus();
			 return false;}
			
			if(client_info.ssn.value=="")
			 {alert("Please enter your SSN.")
			 client_info.ssn.focus();
			 return false;}
			}
		}
	function validateclient_info(client_info)		  

		{	
			
			
			if(client_info.s_firstname.value=="")
			 {alert("Please enter your first name.")
			 client_info.s_firstname.focus();
			 return false;
			}
			if(client_info.s_lastname.value=="")
			 {alert("Please enter your last name.")
			 client_info.s_lastname.focus();
			 return false;
			}
			if(client_info.s_address1.value=="")
			 {alert("Please enter your service street address.")
			 client_info.s_address1.focus();
			 return false;
			}
			if(client_info.s_city.value=="")
			 {alert("Please enter your service address city.")
			 client_info.s_city.focus();
			 return false;
			}
			
			if(client_info.s_city.value=="" || client_info.s_state.value == "xx")
			 {alert("Please enter your service address state.")
			 client_info.s_state.focus();
			 return false;
			}
			if(client_info.s_zip.value=="")
			 {alert("Please enter your service address postal code.")
			 client_info.s_zip.focus();
			 return false;
			}
			//Can be reached at number
			if(client_info.s_day3first.value=="" )
			 {alert("Please enter first three digits (prefix) of your daytime phone.")
			 client_info.s_day3first.focus();
			 return false;
			}
			if(client_info.s_day4last.value=="" )
			 {alert("Please enter the last 4 digits of you daytime phone.")
			 client_info.s_day4last.focus();
			 return false;
			}
			if(client_info.s_dayareacode.value=="")
			 {alert("Please enter your daytime phone areacode.")
			 client_info.s_dayareacode.focus();
			 return false;
			}
		
	/*		if(client_info.s_even3first.value=="" )
			 {alert("Please enter first three digits (prefix) of your home phone.")
			 client_info.s_even3first.focus();
			 return false;
			}
			if(client_info.s_even4last.value=="" )
			 {alert("Please enter the last 4 digits of you home phone.")
			 client_info.s_even4last.focus();
			 return false;
			}
			if(client_info.s_evenareacode.value=="")
			 {alert("Please enter your home phone areacode.")
			 client_info.s_evenareacode.focus();
			 return false;
			}*/
			if(client_info.email.value=="")
			 {alert("Please enter your email address for order confirmation. If no email address please call to complete your order.")
			 client_info.email.focus();
			 return false;
			}
			if(client_info.confirm_email.value=="")
			 {alert("Please confirm your email address. Your email address will be used for order confirmation.")
			 client_info.confirm_email.focus();
			 return false;
			}
			if(client_info.roomnum.value=="99")
			 {alert("Please call to speak to one of our knowledgeable sales staff to assist you with your unique needs.")
			 client_info.roomnum.focus();
			 return false;
			}
			  if (client_info.issame.checked = true) 
			  {
				document.forms['client_info'].elements['b_firstname'].value = document.forms['client_info'].elements['s_firstname'].value; 
				document.forms['client_info'].elements['b_initial'].value = document.forms['client_info'].elements['s_initial'].value;
				document.forms['client_info'].elements['b_lastname'].value = document.forms['client_info'].elements['s_lastname'].value;
				document.forms['client_info'].elements['b_address1'].value = document.forms['client_info'].elements['s_address1'].value;
				document.forms['client_info'].elements['b_address2'].value = document.forms['client_info'].elements['s_address2'].value;
				document.forms['client_info'].elements['b_city'].value = document.forms['client_info'].elements['s_city'].value;
				document.forms['client_info'].elements['b_state'].value = document.forms['client_info'].elements['s_state'].value;
				document.forms['client_info'].elements['b_zip'].value = document.forms['client_info'].elements['s_zip'].value;
				document.forms['client_info'].elements['b_dayareacode'].value = document.forms['client_info'].elements['s_dayareacode'].value;
				document.forms['client_info'].elements['b_day3first'].value = document.forms['client_info'].elements['s_day3first'].value;
				document.forms['client_info'].elements['b_day4last'].value = document.forms['client_info'].elements['s_day4last'].value;	
	//			document.forms['client_info'].elements['b_evenareacode'].value = document.forms['client_info'].elements['s_evenareacode'].value;
	//			document.forms['client_info'].elements['b_even3first'].value = document.forms['client_info'].elements['s_even3first'].value;
	//			document.forms['client_info'].elements['b_even4last'].value = document.forms['client_info'].elements['s_even4last'].value;	
			  }
			  else
			  {
				if(client_info.b_firstname.value=="")
				 {alert("Please enter the first name of the person as shown on the credit card.")
				 client_info.b_firstname.focus();
				 return false;
				}
				if(client_info.b_lastname.value=="")
				 {alert("Please enter the last name of the person as shown on the credit card.")
				 client_info.b_lastname.focus();
				 return false;
				}
				if(client_info.b_address1.value=="")
				 {alert("Please enter the billing street address as shown on the credit card statement.")
				 client_info.b_address1.focus();
				 return false;
				}
				if(client_info.b_city.value=="")
				 {alert("Please enter the billing address city as shown on the credit card statement.")
				 client_info.b_city.focus();
				 return false;
				}
				
				if(client_info.b_city.value=="" || client_info.b_state.value == "xx")
				 {alert("Please enter the billing address state as shown on the credit card statement.")
				 client_info.b_state.focus();
				 return false;
				}
				if(client_info.b_zip.value=="")
				 {alert("Please enter the billing postal code as shown on the credit card statement.")
				 client_info.b_zip.focus();
				 return false;
				}
				//Billing number
				if(client_info.b_day3first.value=="" )
				 {alert("Please enter first three digits (prefix) of the phone number assigned to this credit card.")
				 client_info.b_day3first.focus();
				 return false;
				}
				if(client_info.b_dayareacode.value=="")
				 {alert("Please enter the areacode of the phone number assigned to this credit card.")
				 client_info.b_dayareacode.focus();
				 return false;
				}
				if(client_info.b_day4last.value=="" )
				 {alert("Please enter the last 4 digits of the phone number assigned to this credit card.")
				 client_info.b_day4last.focus();
				 return false;
				}
			
			
			  }

		}	

  function checkEmail(checkString)
	{
		var newstr = "";
		var at = false;
		var dot = false;
	
		// DO SOME PRELIMINARY CHECKS ON THE DATA
		if (checkString != "") 
		{	
		// IF EMAIL ADDRESS HAS A '@' CHARACTER
		if (checkString.indexOf("@") != -1) 
		{
		  at = true;
	
		// IF EMAIL ADDRESS HAS A '.' CHARACTER
		} else if (checkString.indexOf(".") != -1) 
		{
		  dot = true;
		}
		// PARSE REMAINDER OF STRING
		

			for (var i = 0; i < checkString.length; i++) {
				ch = checkString.substring(i, i + 1)
				if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
					|| (ch == "@") || (ch == ".") || (ch == "_")
					|| (ch == "-") || (ch >= "0" && ch <= "9")) {
					   newstr += ch;
						if (ch == "@") {
							at=true;
							}
						if (ch == ".") {
							dot=true;
						}
				}
			}
			
			if ((at == true) && (dot == true)) {
				return newstr;
				}
			else {
			  // DISPLAY ERROR MESSAGE
			  alert ("Sorry, the email address you\nentered is not in the correct\nformat.  The format should be xxxxxxxx@xxxxx.xxx");
			  return"";
			  //client_reg.email.focus();
			 
				}

	

		} else 
		{
			  // DISPLAY ERROR MESSAGE
			  alert ("Sorry, the email address you\nentered is not in the correct\nformat.  The format should be xxxxxxxx@xxxxx.xxx");
			  return"";
		}
		
		
	}
	
	function MM_preloadImages() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}
	//-->
	function isNumberKey(evt)
	  {
		 var charCode = (evt.which) ? evt.which : event.keyCode
		 if (charCode > 31 && (charCode < 48 || charCode > 57))
			return false;
	
		 return true;
	
	  }
		
		var isNN = (navigator.appName.indexOf("Netscape")!=-1);
	function autoTab(input,len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode; 
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
		if(input.value.length >= len && !containsElement(filter,keyCode)) {
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
		}
		
	function containsElement(arr, ele) {
		
		var found = false, index = 0;
		while(!found && index < arr.length)
		if(arr[index] == ele)
		found = true;
		else
		index++;
		return found;
		}
		
	function getIndex(input) {
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
		if (input.form[i] == input)index = i;
		else i++;
		return index;
		}
		return true;
		}


	function checkPws(form) {
		pws1 = client_info.email.value;
		pws2 = client_info.confirm_email.value;
	
		if (pws1 != pws2) {
			alert ("\nYou did not enter the same email. Please re-enter your confirmation email.");
			client_info.confirm_email.focus();
			//document.forms['client_info'].elements['email'].value = '';
			document.forms['client_info'].elements['confirm_email'].value = '';
		
			return false;
			}
				else return true;
			}	



	function clearcheck() 
	  {
		document.forms['client_info'].elements['b_firstname'].value = '';
		document.forms['client_info'].elements['b_lastname'].value =  '';
		document.forms['client_info'].elements['b_address1'].value =  '';
		document.forms['client_info'].elements['b_address2'].value =  '';
		document.forms['client_info'].elements['b_city'].value =  '';
		document.forms['client_info'].elements['b_state'].value =  '';	
		document.forms['client_info'].elements['b_zip'].value =  '';
		document.forms['client_info'].elements['b_dayareacode'].value =  '';
		document.forms['client_info'].elements['b_day3first'].value =  '';
		document.forms['client_info'].elements['b_day4last'].value =  '';
//		document.forms['client_info'].elements['b_evenareacode'].value =  '';
//		document.forms['client_info'].elements['b_even3first'].value =  '';
//		document.forms['client_info'].elements['b_even4last'].value =  '';
	  }
	
