//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//	@		Description			: This function will be called and writes the event
//  @                             for the enter key in all the html controls inside the form.
//  @       Pages Affected      : Acclogin,OrdTrack,Shipcalculator,Powersearch,
//  @							  ValidateInvite,WishListSearch
//  @		Function Name		: AssignKey
//	@		 		
//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

	function AssignKey()
	{
		var i,k;
		for (i=0;i<document.forms.length;i++) {
			for (k=0;k<document.forms[i].elements.length;k++) {
					if(document.forms[i].elements[k].type == "text" || document.forms[i].elements[k].type == "password" || document.forms[i].elements[k].type == "select-one" || document.forms[i].elements[k].type == "checkbox"){
						eval("document." + document.forms[i].name + "." + document.forms[i].elements[k].name + ".onkeypress=Check")
					}
			}
		}
	}

// End of the function AssignKey()


//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//	@		Description			: This function will be called when the user press the enter
//  @                             key inside the form controls .
//  @       Pages Affected      : Acclogin,OrdTrack,Shipcalculator,Powersearch,
//  @							  ValidateInvite,WishListSearch
//  @		Function Name		: Check(keypressed)
//	@		 		
//	@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

	function Check(keypressed)
	{
	    var key,i;
	    var sFormName,iTextBox;
	    iTextBox=0;
		if (document.all) {
			key=window.event.keyCode;
	    } 
	    else {
			key=keypressed.which;
	    }
		if (key==13) {	
			sFormName=eval("document." + this.form.name);
			for (i=0;i<sFormName.elements.length;i++){
					if (sFormName.elements[i].type == "text" || sFormName.elements[i].type == "password")
						iTextBox++;
			}
			if (iTextBox == 1) return;
			if(sFormName.onsubmit()){	
				//sForm.submit()
			}
			else{
				return false; 
			}
		}
	}

// End of the function Check(keypressed)


	AssignKey()
