	
	var popup_form = null;
	var popup_action = '';
	
	// variable for the background
	var popup_background = new Fx.Style('popup_background', 'opacity', {duration: 100, onComplete: function() {
			// set the display to none when the popup has finished
			if (popup_background.now == 0) {
				document.getElementById('popup_dialog').style.display = 'none';
			}
		}, onStart: function() {
			// set the display to block when the popup starts
			if (popup_background.now == 0) {
				document.getElementById('popup_dialog').style.display = 'block';
			}		
		}});
		
	// variable for the content
	var popup_content = new Fx.Style('popup_content', 'opacity', {duration: 100});	
	
	function confirmDialog() {
	
		// as the submit is not called by the actual button but by the one of the popup
		// and the one of the popup is not within the form - it will not be tramsitted - bastard!
		// so i add a hidden input field with the same name as the button would have had
		var input = document.createElement('input');
		input.name = popup_action;
		input.value = 'OK';
		input.type = 'hidden';
		popup_form.appendChild(input);
				
        var content = document.getElementById('popup_question');
        var children = content.getElementsByTagName('input');;
        var len = children.length;
        for(var i = 0; i < len; i++) {
            var element = children[i];
            //var input2 = document.createElement('input');
            var input2 = element.cloneNode(true);
			/*input2.name = element.id;
			input2.value = element.value;
			input2.checked = element.checked;*/
			//input2.type = 'hidden';
			popup_form.appendChild(input2);
		}
			
			
		popup_form.submit();
		return true;
	}

	function cancelDialog() {
		popup_background._start(0.8, 0);
		popup_content._start(1, 0);
		return false;
	}

	// recursively goes through the parent elements and finds the superior form instance
	function getParentForm(node) {
		var parentNode = node.parentNode;
		if (parentNode != null) {
			if (parentNode.tagName == 'FORM') {
				return parentNode;
			} else {
				return getParentForm(parentNode);
			}
		}
		return null;
	}