﻿function QtyU(thisItem) {
	var thisItemId = thisItem;
	var testName = eval("document.forms[0]."+thisItemId+"");
	var thisTotal = testName.value;
	if (thisTotal == "") {
		thisTotal = 0;
	}
	var newTotal = parseInt(thisTotal) + 1;
	testName.value = newTotal;
}
function QtyD(thisItem) {
	var thisItemId = thisItem;	
	var testName = eval("document.forms[0]."+thisItemId+"");
	var thisTotal = testName.value;
	if (thisTotal!= 0) {
		var newTotal = parseInt(thisTotal) - 1;
		testName.value = newTotal;
	}
}
function pageddlsynch1()
{
	var ddl1 = document.getElementById('ctl00$B$ddlPage1');
	var ddl2 = document.getElementById('ctl00$B$ddlPage2');
	ddl2.selectedIndex = ddl1.selectedIndex;
}
function pageddlsynch2()
{
	var ddl1 = document.getElementById('ctl00$B$ddlPage1');
	var ddl2 = document.getElementById('ctl00$B$ddlPage2');
	ddl1.selectedIndex = ddl2.selectedIndex;
}
function newPopup(Page, Name)
{
	var newPopup;
	newPopup = window.open(Page,Name,"height=300,width=380,status=no,menubar=no,toolbar=no,location=no");
	if (!newPopup.opener)
		newPopup.opener = self;
}
function newPopup2(Page, Name)
{
	var newPopup;
	newPopup = window.open(Page,Name,'width=640,height=480,status=no,menubar=no,toolbar=no,location=no,scrollbars');
	if (!newPopup.opener)
		newPopup.opener = self;
}
function setCookie(name, value){
document.cookie = name + "=" + escape(value)
//alert('A browser cookie has been set with value: '+value);
}

// ConnectionSpeed Detection section
var datasize=165818; // in Bytes
var startTime=0;
var endTime=0;
var date=0;
var textMessage="";
function calcThroughput() {
var diffTimeMilliseconds = endTime - startTime;
var diffTimeSeconds = diffTimeMilliseconds/1000;
var bits = (datasize*8);   // convert Bytes to bits,
var kbits = bits/1024;     // convert bits to kbits
var throughput = kbits/(diffTimeSeconds);
throughput = Math.round(throughput * .93, 0);  // account for IP packet header overhead - averages about 7%
setCookie("ConnectSpeed", throughput); //kbps
//textMessage = "time to load: (sec): <B>" + diffTimeSeconds + "</B><BR>kbits:<B> " + kbits + "</B><BR>Throughput (kbps): <B>" + throughput +"</B>"
}