﻿function addCart(itemNumber)
{
	var inputQtyId = 'Qty' + itemNumber;
	
	var orderQty = Number(document.getElementById(inputQtyId).value);
	var itemCost;
	if (orderQty < 1)
		{
		orderQty = 1;
		}
	if (orderQty > 9)
		{
		itemCost = itemCost2[itemNumber];
		}
	else
		{
		itemCost = itemCost1[itemNumber];
		}
	if (orderQty > 49)
		{
		itemCost = itemCost3[itemNumber];
		}
	document.getElementById("itemCartName").value   = itemDesc[itemNumber];
	document.getElementById("itemCartNumber").value = itemModelNumber[itemNumber];
	document.getElementById("itemCartAmount").value = itemCost;
	document.getElementById("itemCartQty").value    = orderQty;
	
	document.getElementById("submit1").click();
}

function ShowOrderInfo()
	{
	document.write('<p><font face="Arial" size="4"> For a safe and secure transaction all purchases are processed through PayPal.  ');
	document.write('You are not required to create a PayPal account to pay by credit card, they are just our secure method for credit card tranactions.  ');
	document.write('Depending on current factory backlog, products shown as "stock\" will ship within 2 business days. Priority is given to "next day\" and "2 day\" shipments.  ');
	document.write('For international orders, not all countries have shipping rates, if order is placed with $0.00 for shipping, we will contact you with actual shipping rate with a request for payment.  ');
	document.write("Please contact factory by email if you have other special shiping requirements ( <a href=\"mailto:sales@j-works.com\">sales@j-works.com</a> ).  ");
	document.write('Lead time shown are updated periodically and are subject to change without notice.  ');
	document.write('If an order cannot be shipped within given lead time you will be notified.</font></p>');
	}	// end of ShowOrderInfo()
	
function AddressInfo()
	{
	document.write('<p><font face="Arial" size="2">Specifications subject to change without notice</p></font>');
	document.write('<p><br><font face="Arial" size="4"><strong>J-Works, Inc</br></strong></font>');
	document.write('<br><font face="Arial" size="3">11024 Balboa Blvd. #402</br></font>');
	document.write('<br><font face="Arial" size="3">Granada Hills, CA 91344</br></font>');
	document.write('<br><font face="Arial" size="3">818.364-0915 voice  818.364-0912 fax</br></font>');
	document.write('<br><font face="Arial" size="3">Sales@j-works.com</br></font>');
	document.write('<br><font face="Arial" size="3">Web Site: www.j-works.com</br></font></p>');
	}
	
	// display one line of text using passed in strData
function displayLine(strData)
	{
	document.writeln(strData);
	}	// end of displayLine()
	
function commonPageTop()
	{
	 var data = ''
		data += '<div class="menu">'
		data += '<ul>'
		data += '<li><a href="index.html">Home Page</a></li>'
		data += '<li><a href="#">Products Overview</a>'
		data += '	<ul>'
		data +- '      <li><a href="index.html#DigitalOptoInRelayOut">Opto Isolated Input with Relay Output</a></li>'
		data += '	   <li><a href="index.html#DigitalOptoInADCRelay">Opto Input, ADC and Relay&nbsp&nbsp&nbsp&nbsp</a></li>'
		data += '	   <li><a href="index.html#OptoIn"               >Opto Input                           </a></li>'
		data += '	   <li><a href="index.html#SwIn">Switch, Sensor (3 pin Input)</a></li>'
		data += '   </ul>'
		data += '<li><a href="#">Products by Model</a>'
		data += '	<ul>'
		data += '		 <li><a href="jsb310.html">JSB310      </a></li>' 
		data += '		 <li><a href="jsb310a.html">JSB310A    </a></li>'
		data += '	</ul>'
		data += '<li><a href="#">About Us</a>'
		data += '	<ul>'
		data += '		 <li><a href="#">Sub-item A1</a></li>'
		data += '	</ul>'
		data += '</li>'
		data += '</ul>' 
		data += '</div>'

  	 document.write(data);

//		data += '<div id="rMenu">'
//		data += '<ul class="rMenu">'
//		data += '<li class="rMenu"><a href="index.html">Home Page</a></li>'
//		data += '<li class="rMenu"><a href="#">Products Overview</a>'
//		data += '	<ul><li class="rMenu"><a href="index.html#DigitalOptoInRelayOut">Opto Isolated Input with Relay Output</a></li></ul>'
//		data += '	<ul><li class="rMenu"><a href="index.html#DigitalOptoInADCRelay">Opto Input,ADC and Relay</a></li></ul>'
//		data += '	<ul><li class="rMenu"><a href="index.html#OptoIn">Opto Input</a></li></ul>'
//		data += '	<ul><li class="rMenu"><a href="index.html#SwIn">Switch, Sensor (3 pin Input)</a></li></ul>'
//		data += '<li class="rMenu"><a href="#">Products by Model</a>'
//		data += '	<ul>'
//		data += '		 <li class="rMenu"><a href="jsb310.html">JSB310</a></li>' 
//		data += '	</ul>'
//		data += '	<ul>'
//		data += '		 <li class="rMenu"><a href="jsb310a.html">JSB310A</a></li>'
//		data += '	</ul>'
//		data += '<li class="rMenu"><a href="#">About Us</a>'
//		data += '	<ul>'
//		data += '		 <li><a href="#">Sub-item A1</a></li>'
//		data += '	</ul>'
//		data += '</li>'
//		data += '</ul>' 
//		data += '</div>'


}