/* ==========================================================    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();					}	});			// product lists and basket	$("input[id^='qty_id'], 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;		}	});			// if we are in 'my part number' on the product page	$("input[id^='myPartNo'], input[id^='stockNo'], input[name^='sht_']").keypress(function(e) {			if(e.which == 13) {				// do nothing				return false;			}	});			// FastOrder Entry	$("input[id^='stockNoQnty']").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='addStockNo']").focus().click();			return false;		}	});	$("input[id^='myPartNoQnty']").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='addMyPartNo']").focus().click();			return false;		}	});						// Conversion Calculator	$("input[id='convFrom']").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[name='doConvert']").focus().click();			return false;		}	});	// Search Box	$("input[id='searchBox']").keypress(function(e) {		if(e.which == 13) {			jQuery(this).blur();			jQuery("button[id='searchButton']").focus().click();			return false;		}	});				// cutting page	$("input[name^='prt_'], input[name^='dim']").keypress(function(e) {			if(e.which == 13) {				// do nothing				return false;			}	});	$("input[name^='dim']").keypress(function(e) {			if(e.which == 13) {				jQuery(this).blur();				jQuery("button[name='basket']").focus().click();				return false;			}	});			// postcode check	$("#deliveryCheckerWidget input[name^='postCode']").keypress(function(e) {			if(e.which == 13) {				jQuery(this).blur();				jQuery("button#deliveryCheckButton").focus().click();				return false;			}	});			// advanced search inputs	$("input[name=productDesc], input[name=stockNumber], input[name=partNumber]").keypress(function(e) {			//console.log('#' + this.name + 'Button');			//$('#' + this.name + 'Button').css('border', '3px solid red');			if(e.which == 13) {				//$('#' + this.name + 'Button').css('border', '3px solid green');				$('#' + this.name + 'Button').focus().click();				//$(this).parentsUntil('div.advSearchBox').parent().find('button').focus().click();				return false;			}	});		});
