
function QuickFindChange( iLookup ) {

	if ( QuickFindForm ) {

		f = null;

		if ( iLookup == 1 ) if ( QuickFindForm.lookup1 ) f = QuickFindForm.lookup1;
		if ( iLookup == 2 ) if ( QuickFindForm.lookup2 ) f = QuickFindForm.lookup2;

		if ( f ) {
			if ( f.value != '-' ) {
				window.location = 'index.php?' + f.value;
			}
		}
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		menu_products_over = newImage("images/menu_products-over.gif");
		menu_about_over = newImage("images/menu_about-over.gif");
		menu_order_over = newImage("images/menu_order-over.gif");
		preloadFlag = true;
	}
}

function showPopUp( sURL, iWidth, iHeight ) {
	window.open( sURL, null, "scrollbars=no,resizable=no,width="+iWidth+",height="+iHeight+",status=no,location=no,screenX=25,screenY=25,left=25,top=25,toolbar=no");
	// winPopUnder.blur();
	// this.window.focus();
}

function showNewWindow( sURL, iWidth, iHeight ) {
	window.open( sURL, null, "scrollbars=yes,resizable=yes,width="+iWidth+",height="+iHeight+",status=yes,location=no,screenX=25,screenY=25,left=25,top=25,toolbar=no");
	// winPopUnder.blur();
	// this.window.focus();
}

function SelectProduct( iCatId, iProdId ) {

	if ( window ) {
		selectWindow = window.open( 'select.php?cat=' + iCatId + '&product=' + iProdId, 'selectWindowA', "scrollbars=no,resizable=no,width=500,height=350,status=no,location=no,toolbar=no" );
	}
	if ( selectWindow ) {
		selectWindow.focus();
	}
}

function clearOrder() {
	document.orderEditForm.action.value = 'clear';
	document.orderEditForm.submit();
}

function deleteOrderItems() {
	document.orderEditForm.action.value = 'delete';
	document.orderEditForm.submit();
}

function orderFormEdit() {
	document.orderForm.action.value = 'edit';
	document.orderForm.submit();
}

function orderFormPrint() {
	document.orderForm.action.value = 'print';
	document.orderForm.submit();
}

function orderFormOrder() {
	document.orderForm.action.value = 'order';
	document.orderForm.submit();
}
