/* ==========================================================    JavaScript Include for ParkerTools Header.    This file contains the jQuery functions that control the action	of the enter key in various parts of the site.    author  :   Tom Banbury    website :   http://www.parkertools.co.uk    version :   1.0========================================================== */$(document).ready(function() {		$("input.[name='username']").focus();	$("input[name='username'], input[name='password']").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='Submit']").focus().click();					}	});		/* capture fasttrack basket enter key */	$("input.fastTrackStk, input.fastTrackQty").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='fastTrack']").focus().click();			return false;		}	});		// product lists and basket	$("input[id^='qty_id'], div[id^='prodPage'] input[name^='qty_'], .bsktHdrInput input").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='basket']").focus().click();			jQuery("button[name='update']").focus().click();			return false;		}	});		//add a stock item to a list	$("div#listContent input").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			if ($(this).attr('name')=='addQuantity' || $(this).attr('name')=='addPart') {				jQuery("button[name='addToList']").focus().click();				return false;			} else if ($(this).attr('name')=='listName' || $(this).attr('name')=='createQuantity' || $(this).attr('name')=='createPart') {				jQuery("button[name='createList']").focus().click();							return false;			}		}	});		// if we are in 'my part number' on the product page	$("div#prodSizeContent input[id^='part_id']").keypress(function(e) {			if(e.which == 13) {				// do nothing				return false;			}	});	// if we are in 'my part number' in lists, text view	$("div#listProductsText input").live('keypress' , function(e) {			if(e.which == 13) {				// do nothing				return false;			}	});		// if we are in 'my part number' in lists, grid view, we use 'live' here because the list is loaded by XHR after the main load	$("div#listProductsList input").live('keypress' , function(e) {						if(e.which == 13) {				$(this).blur();				$(this).parentsUntil('div#listProductsList').find('button').focus().click();				return false;			}	});		$("input[name=productDesc], input[name=stockNumber], input[name=partNumber]").keypress(function(e) {			if(e.which == 13) {				$(this).parentsUntil('div.advSearchBox').parent().find('button').focus().click();				return false;			}	});		});
