
/* Is this a part of the Referdetect functionality ?
/*
var straffID
function GetCookie (name) 
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var id = document.cookie;
//alert("name="+name+",id="+id);
var i = 0;
while (i < clen) 
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) 
break; 
}
return null;
}
straffID = GetCookie("AffiliateID", "");
if (straffID == null) 
{
straffID = '1001'
};*/


/* For Popping up a new window on the local channel page */

function open_NewWindow(path,status,toolbar,location,locationbar,top,resizable,scroll,height,width) 
	{
		if (path.indexOf("?") == -1)
		{
			path = path+"?section="+this.Section;
		}
		else
		{
			path = path+"&section="+this.Section;
		}
		msg=open(path ,"window","status="+status+",toolbar="+toolbar+",location="+location+",locationbar="+locationbar+",top="+top+",resizable="+resizable+",scrollbars=" + scroll + ",height=" + height + ",width=" + width );
	}



/* For Popping up a new window on the latino and international pages */

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=500,left = 415,top = 337');");
}



function printer_friendly(OrderaffilID)
{ 
  //alert("OrderaffilID="+OrderaffilID);

  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("printableQuote").innerHTML; 
	
  //document.orderForm.calculatorContent.value = content_vlue;
		
  var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>Sterling Satellite | Authorized Dishnet Reseller</title>'); 
		docprint.document.write('</head><body onLoad="self.print()"><center>'); 
		 
		docprint.document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center"  class="billcalc"><tr><td align="center">');
		docprint.document.write('Take advantage of these prices and <b>Order Now</b> by calling <b>1-800-847-8660</b> or by completing the order form and selecting the order button on the bottom of the page. <br />Please mention Promo Code:'+OrderaffilID);
		docprint.document.write('</td></tr></table>');  
		  
		docprint.document.write(content_vlue);          
		docprint.document.write('</center></body></html>'); 
		docprint.document.close(); 
		docprint.focus(); 
}



function cidWindow(){
	cidwindow = window.open("/cid.asp","cid","height=380,width=350,scrollbar=yes")
}



/* autoTab code */

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 displayCallbackTime(fieldname) {
  var top=window.document.orderForm;
  var beforeTime = getRadioCheckedValue(top.before)
  var afterTime = getRadioCheckedValue(top.after)
  
  top.callbackTimeDisplay.value = "Between " + afterTime + " and " + beforeTime;
}



function FrontPage_Form1_Validator(theForm)
{
 
}


	
function CopyAddress()
	{
	document.orderForm.sccFIRSTNAME.value = document.orderForm.firstname.value;
	document.orderForm.sccLASTNAME.value = document.orderForm.lastname.value;
	document.orderForm.sccADDRESS1.value = document.orderForm.address1.value;
	document.orderForm.sccADDRESS2.value = document.orderForm.address2.value;
	document.orderForm.sccCITY.value = document.orderForm.city.value;
	document.orderForm.sccPOSTALCODE.value = document.orderForm.zip.value;
	document.orderForm.sccSTATE.selectedIndex = document.orderForm.state.selectedIndex;
	}
	
	
	
function doSubmit()
	{
	if (FrontPage_Form1_Validator(document.forms[0]))
		{
		doNotPop = 1;
		document.forms[0].submit();
		//location.href = 'default.asp';
		}
	else
		{
		numberoftimes = 0;
		return (false);	
		}
	}
	
	
	
	
// GLOBAL variables: Total estimated monthly fees & other_fees
var monthly_total = 0;
var promo_credit = 0
var prog_total = 0;	
var dvrcvr_fee_total = 0;
var hdrcvr_fee_total = 0;
var xtrarcvr_fee_total = 0;
var movie_total = 0;
var localchan_total = 0;
var selectedEveryPak = false;
var selectedDishDvr = false;
var addFee = true;
var subtractFee = false;
var intlFee_mthly = 0;
var intlFee_annual= 0;
var annual_total = 0;
var localIncluded = true;
var localNotIncluded = false;
var dishDvrDisc=0;