function popDoc(name) {
	var openwin=window.open(name,"","width=375,height=525,top=50,left=200")
}

function ShowPurchaseButton(intOptions)
{
	var ynDisplayFlag;
	ynDisplayFlag = 1;
					
	var i;
	for(i = 1;  i <= intOptions; i++)
	{
		if(product.elements[i].value == "")
		{
			ynDisplayFlag = 0;
		}
	}
					
	if(ynDisplayFlag == 1)
	{
		PurchaseButton.style.display = "";
		PurchaseInstructions.style.display = "none";
	}
	else
	{
		PurchaseButton.style.display = "none";
		PurchaseInstructions.style.display = "";
	}
}
						
function display(strID)
{
	var	oElement;
	oElement = strID;
					
	if(oElement.style.display == "none")
	{
		oElement.style.display = "";
	}
	else
	{
		oElement.style.display = "none";
	}
}
				
function displayon(strID)
{
	var	oElement;
	oElement = strID;
	oElement.style.display = "";
}
				
function requestPrice(pstrURL, pnWidth, pnHeight)
{
  strOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + pnWidth + ",height=" + pnHeight;;
  newWin = window.open(pstrURL, 'NewWindow',strOption);
}
				
function CopyInfo(strFormName)
{
	strFormName.shipName.value = strFormName.billName.value;
	strFormName.shipCompany.value = strFormName.billCompany.value;
	strFormName.shipAddress.value = strFormName.billAddress.value;
	strFormName.shipCity.value = strFormName.billCity.value;
	strFormName.shipZip.value = strFormName.billZip.value;
	strFormName.shipState.value = strFormName.billState.value;
	strFormName.shipPhone.value = strFormName.billPhone.value;
}
				
function VerifyChange(strUser)
{
	if(window.confirm("Are you sure you want to change what " + strUser + " has done?"))
	{
		ProductEdit.submit();
	}
}

function CheckCCLen1()
{
	if(checkout2.cardNum1.value.length == 4)
	{
		checkout2.cardNum2.focus();
	}
}
				
function CheckCCLen2()
{
	if(checkout2.cardNum2.value.length == 4)
	{
		checkout2.cardNum3.focus();
	}
}
				
function CheckCCLen3()
{
	if(checkout2.cardNum3.value.length == 4)
	{
		checkout2.cardNum4.focus();
	}
}
				
function CheckState(FormName)
{
	if(FormName.billState.value == 'AK')
	{
		alert('A Surcharge may apply, please check Notes box below');
	}
					
	if(FormName.billState.value == 'HI')
	{
		alert('A Surcharge may apply, please check Notes box below');
	}
}

function AddOptionValue(OptionTable, intOptionPos)
{	
	var intNewRow;
	intNewRowNum = OptionTable.rows.length;
				
	var strTD1;
	var strTD2;
	var strTD3;
	var strTD4;
	
	OptionTable.insertRow();

	strTD1 = OptionTable.rows[intNewRowNum].insertCell();
	strTD2 = OptionTable.rows[intNewRowNum].insertCell();
	strTD3 = OptionTable.rows[intNewRowNum].insertCell();
	strTD4 = OptionTable.rows[intNewRowNum].insertCell();

	strTD1.align = "right";
	strTD1.innerHTML = "<input type='text' style='font-size:9pt' size='10' name='intOptionID" + intOptionPos + "Value" + intNewRowNum + "'/>";
	strTD2.innerHTML = "<input type='text' style='font-size:9pt' size='5' name='intOptionID" + intOptionPos + "Model" + intNewRowNum + "'/>";
	strTD3.innerHTML = "<input type='text' style='font-size:9pt' size='5' name='intOptionID" + intOptionPos + "Price" + intNewRowNum + "'/>";
	strTD4.innerHTML = "<input type='text' style='font-size:9pt' size='5' name='intOptionID" + intOptionPos + "Picture" + intNewRowNum + "'/>";
	
}

function ShowCreditCardInput(strCard)
{
	if(strCard=='AMEX'){display(amex);display(notAmex);}else if(amex.style.display == ''){display(amex);display(notAmex);}
}



