
/*** ICOMMERCE ***/

function init(page) {}

// ** Show currency converter for Value 'thePrice' **
function cConvert(thePrice)
{
	if (thePrice>0) {
		var theURL = "http://www.xe.net/pca/input.cgi?amount=" + thePrice + "&From=AUD";
	} else {
		var theURL = "http://www.xe.com/pca/input.cgi?&Template=full&from=AUD";
	}

	CurrencyWindow = window.open (theURL, 
									'CurrencyWindow', 
									'toolbar=0,location=0,directories=0=0,menubar=0,scrollbars=0,resizable=1,height=170,width=600');
	CurrencyWindow.focus();
}

function verifyQuantity(theField)
{
	var theValue	= theField.value;
	
	if (theValue.length < 1)	theField.value = "1";
	if (isNaN(theValue))		theField.value = "1";
	theValue					= theValue - 0;
	if (theValue < 1)   		theField.value = "1";
}


/*** GENERAL FORM CHECKING TOOLS ***/

function isFieldEmpty(theField)
{
	return (theField.value.length < 1) ? true : false;
}
function isFieldBadEmail(theField)
{
	theEmail = theField.value;
	if (theEmail.indexOf('@')==-1 || theEmail.indexOf('.')==-1 || theEmail.length<6) return true;
	return false;
}
function clearQuotes(theForm)
{
	for (i = 0; i < theForm.elements.length; i++)
	{
		if (theForm.elements[i].value) theForm.elements[i].value = theForm.elements[i].value.replace(/'/gi,"`");
	}
}

/** LOAD FRAMING PAGE **/

function framedPrint(theID) {
	self.location.href="http://www.bjk.com.au/showProduct/framed/"+theID;
}

/** PRICE ON SHOWPROD **/

function setPrice(theSelect,offset) {
	selPrice = (theSelect.selectedIndex)-offset;
	if (selPrice>-1) {
		selPriceField = eval("document.showProductForm.priceHold"+selPrice);
		document.showProductForm.PRICE0.value = selPriceField.value;
	} else {
		document.showProductForm.PRICE0.value = 0;
	}
}




