// FIX: UNIT NUMBER 0524351
		    var defaultbutton = '';
		    var __defaultFired = false;
            var __nonMSDOMBrowser = (window.navigator.appName.toLowerCase().indexOf('explorer') == -1);
		    
		    function CustomFireDefaultButton(evt, target) {
	     
	        var target = evt.target;
	        var targetID;
	        	        
	        if (target == null)
                { target = window.event.srcElement; }
            if (target)
                { targetID = target.getAttribute("id"); }
 
		    //bugfix: catch enter press in textarea in firefox
		    if(evt.target && evt.target.type == "textarea")
		        return true;
		        
            if (//!__defaultFired &&
                    evt.keyCode == 13 &&
                    !(evt.srcElement &&
                    evt.srcElement.tagName.toLowerCase() == "textarea")) 
                {
                    //check if defaultbutton set, this will always work in a wizard.
                    //since a wizard always has only one default submit button
		    //However, there could still be other elements on the page (e.g. the searchbutton) which are not part of the wizard
		    //So, first look if there's a wrapper for the current element which denotes the enterhandler,
		    //and else call the wizardsubmit handler (if there is one).
                    var wizardSubmitHandler = xGetElementsByClassName('enterbutton_wizardsubmitbutton', null, '*');
		    
		    var hasWizardSubmitHandler = false;

		    if(wizardSubmitHandler != null && wizardSubmitHandler.length > 0)
			hasWizardSubmitHandler = true;
                    
                    
                    //the following code is for nonwizard pages
                    var node = xGetElementById(targetID);   //get the DOM node, which initiated the submit
                    var enterbuttonClassName = "_enterbutton_";
                    
                    //look for the parent div, to see which submitbutton should be called on this enter press, if any.
                    if(node != null)
                    {
	                    while(node.parentNode != null)
	                    {
	                       node = node.parentNode;
	
				//whoops, no classname, most likely there is no handler set...
				if(node.className == null)
				{
					node = null;

					//are we in a wizardpage?
					if(hasWizardSubmitHandler)
					  return SubmitPageByControl("wizardsubmitbutton");

					break;

				}

  	                       if(node.className.indexOf(enterbuttonClassName) != -1)
	                       	  break;
	                    }

	                    if(node != null)	//found our node
	                    {
	                        //the text that comes after the _enterbutton
		                var className = node.className;
		                var startIndex = className.indexOf(enterbuttonClassName) + enterbuttonClassName.length;
		                var totalLength = className.length;
		                className = className.substr(startIndex, totalLength - startIndex);
		                    
		                return SubmitPageByControl(className);
	                    }
                    }
                }
                return true;
            }
            
            function SubmitPageByControl(name) {
                // Find the matching button
                var findbutton = xGetElementsByClassName('enterbutton_' + name, null, '*');
                if (findbutton.length > 0)
                {
                    button = xGetElementsByTagName(findbutton[0],'button');
                    if (button.length > 0)
                    {
                        try {
                            document.form[button[0].id].focus();
                        } catch(err){}
                        
                        document.getElementById(button[0].id).click();
                        return false;
                    }
                    else { return true; }
                }
                else { return true; }
            }
            
            function PageLoad()
            {
                var focusInputBox = xGetElementsByClassName("defaultinputbox", null, "input");
                /*if multiple focusinput boxes have been set (an error...), then just take the last one.*/
                if(focusInputBox.length != 0)                    
                    focusInputBox[focusInputBox.length - 1].focus();
                
                // Change 'klantcontact' onloadNextName contains a function name to execute onload.
                try
                {
                    if ( onloadNextName != null && onloadNextName != "" )
                    {
                        eval(onloadNextName);
                    }
                }
                catch(err){}                 
            }
            // END FIX 0524351
            
            
            function SubmitFirstButtonFromWrapperDiv(classname)
            {
				var findbutton = xGetElementsByClassName(classname, null, '*');
            
				if (findbutton.length > 0)
				{
					var button = xGetElementsByTagName(findbutton[0],'button');
					if (button.length > 0)
					{
						//document.form[button[0].id].focus();
						document.getElementById(button[0].id).click();
						return false;
					}
					else
					{
						return true;
					}
				}
				else
				{
					return true; 
				}
			}
