function CopyInfo() 
	{
		CopyFromTo("input", "txtFirstName_B", "txtFirstName_S");
		CopyFromTo("input", "txtLastName_B", "txtLastName_S");
		CopyFromTo("input", "txtCompany_B", "txtCompany_S");
		CopyFromTo("input", "txtAddress1_B", "txtAddress1_S");
		CopyFromTo("input", "txtAddress2_B", "txtAddress2_S");
		CopyFromTo("input", "txtCity_B", "txtCity_S");
		CopyFromTo("select", "ddlState_B", "ddlState_S");
		CopyFromTo("input", "txtZip_B", "txtZip_S");
		CopyFromTo("select", "ddlCountry_B", "ddlCountry_S");
		CopyFromTo("input", "txtEmail_B", "txtEmail_S");
		CopyFromTo("input", "txtPhone_B", "txtPhone_S");
		CopyFromTo("input", "txtFax_B", "txtFax_S");		
	}
	
	function CopyFromTo(tagname, el_id1, el_id2)
	{
		var el1 = GetControl(tagname, el_id1);
		var el2 = GetControl(tagname, el_id2);
		if (tagname == "select" && el1 != null && el2 != null)
		{
			el1.selectedIndex = el2.selectedIndex;
		}
		else
		{
			el1.value = el2.value;
		}
	}
	
	function GetControl(tagname, el_id)
	{
		var elements = document.getElementsByTagName(tagname);
		var i;
		var el;
		var s;
		for (i=0; i<elements.length; i++)
		{
			el = elements[i];
			s = el.id;
			if (s.search(el_id) != -1)
			{
				return el;
			}
		}
		return null;
	}

	function CallPrintDialog()
	{
		var BrowserName = navigator.appName;
		if(navigator.userAgent.indexOf('Mac') != -1&&BrowserName != "Netscape")
		{
			alert("Please use the 'Print' option of your Browser to print this page ");
		}
		else
		{
			window.print();
		}
	}

function OpenWindow(Url)
{
	window.open(Url, null, "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function selectAllCheckboxes()
{
form = document.forms[0];
if (form.checkAll.checked)
	{
		for(i = 0; i <= form.elements.length-1; i++)
		{
			if (form.elements[i].name.indexOf('record') != -1)
			{
			form.elements[i].checked = true;
			}
		}
	}
	else
	{
		for(i = 0; i <= form.elements.length-1; i++)
		{
			if (form.elements[i].type == 'checkbox')
			{
			form.elements[i].checked = false;
			}
		}
	}	
}

function resizeMainTable() {
		winheight=(window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:null);
			nHeight = winheight-130;
			if (nHeight<300) {
				nHeight=300;
			}
		mainTable.height = nHeight;		
		}