var rules = {
	'#TemplateMainSection_MainPackageProcessing_ScanscreenLoadTextbox' : function(element){
		if(element.getAttribute('DynamicLookup') == 'True'){gprefix = 'TemplateMainSection_MainPackageProcessing_'; var prefix = 'TemplateMainSection_MainPackageProcessing_';
			element.onkeyup = function() {  search(this.value, prefix); }
			element.onkeydown = function(event) { if (event) { eventhandler(event); } else { eventhandler(window.event); } }
			element.onclick = function() { search(this.value, prefix); }
			element.onblur = function() {setTimeout("hideresults()",200);}
		}
	},
	'a.SettingsTest' : function(element) {
		element.onclick = function() { window.open("../UI/SettingTest.aspx?test="+ element.getAttribute('module') + "&key=" + element.getAttribute('key'), null, "width=600,height=300,menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes"); }
	},
	'#TemplateMainSection_MainZipPackageProcessing_ScanscreenDatafld_ReferenceNbr_Referencenbr' : function(element) {
		element.onkeydown = function(event) { var type = element.id.substring(element.id.lastIndexOf('_') + 1); if (event) { ScanZipHandler(type, event); } else { ScanZipHandler(type, window.event); }}
	},
	'#TemplateMainSection_MainZipPackageProcessing_ScanscreenDatafld_ShipTo_shiptoZip' : function(element) {
		element.onkeydown = function(event) { var type = element.id.substring(element.id.lastIndexOf('_') + 1); if (event) { ScanZipHandler(type, event); } else { ScanZipHandler(type, window.event); }}
	},
	'#TemplateMainSection_MainPackageProcessing_ScanscreenLoadButton' : function(element) {
		element.onclick = function() {if(this.getAttribute("ReadScaleOnLookup")=="1"){ReadScale('TemplateMainSection_MainPackageProcessing_ScanscreenDatafld_Weight_weight');} if (this.getAttribute("ScreenType") == "2") { OdbcLookup(this.getAttribute("query")); }else if (this.getAttribute("ScreenType") == "1"){  this.disabled = true; __doPostBack(this.id.replace("_", "$").replace("_", "$").replace("_", "$").replace("_", "$").replace("$ctl0", "_ctl0"),"");} }
	},
	'#TemplateMainSection_MainPackageProcessing_ScanscreenShipButton' : function(element) {
		element.onclick = function() {if (this.getAttribute("ScreenType") == "1"){ this.disabled = true; __doPostBack(this.id.replace("_", "$").replace("_", "$").replace("_", "$").replace("_", "$").replace("$ctl0", "_ctl0"),"");} }
	},
	'#TemplateMainSection_MainZipPackageProcessing_ScanscreenShipButton' :function(element) {
		element.onclick = function() { this.disabled = true; __doPostBack(this.id.replace("_", "$").replace("_", "$").replace("_", "$").replace("_", "$").replace("$ctl0", "_ctl0"),""); }
	},
	'#MainPage':function(element){
		element.onkeyup = function(){var type = "f2"; if (event.keyCode == 113) { ReadScaleAndShipMain(); } }
	},
	'#TemplateMainSection_MainPackageProcessingC1_ScanscreenLoadTextbox' : function(element){
		if(element.getAttribute('DynamicLookup') == 'True'){
			gprrfix = 'TemplateMainSection_MainPackageProcessingC1_'; var prefix = 'TemplateMainSection_MainPackageProcessingC1_';
			element.onkeyup = function() {   search(this.value, prefix); }
			element.onkeydown = function(event) { if (event) { eventhandler(event); } else { eventhandler(window.event); } }
			element.onclick = function() { search(this.value, prefix); }
			element.onblur = function() { setTimeout('hideresults()',200);}
		}
	}
};

Behaviour.register(rules);

