    function ajaxAction(uri, async_mode) {
        this.async = true;
        if (typeof(async_mode)!='undefined') this.async=async_mode;
        this.uri = uri;
        this.post=ajaxAction_post;
        this.__wait = function () {/* dummy function */};
        this.__done = function () {/* dummy function */};
    }

    function ajaxAction_post(id, params) {
        var xmlHttp = false;
        var callback = this;

        //Prepare ActiveXObject
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            xmlHttp = new XMLHttpRequest();
        } else if (window.ActiveXObject) { // IE
            try {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
        if (!xmlHttp) {
            alert('Cannot create XMLHTTP instance');
            exit(0);
        }

        //Handle the response
        xmlHttp.onreadystatechange=function() {
            switch (xmlHttp.readyState) {
                case 1: //request sent
                    callback.__wait(id);
                    break;
                case 4: //data ready
                    callback.__done(id, xmlHttp.responseText);
                    break;
            }
        }

        //Send data
        xmlHttp.open("POST",this.uri,this.async);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send(params);
        return ((xmlHttp.readyState==4) ? xmlHttp.responseText:null);
    }

    function generateAlias(id_in, id_out) {
        alias=document.getElementById(id_in).value;
        alias=alias.toLowerCase();
        alias=alias.replace(/[\\!?&%$*#;,\'\"<>/]/g,"");
        alias=alias.replace(/\s/g,"-");
        document.getElementById(id_out).value=alias;
    }

    function getMouseX(e) {
        if (e.pageX) {
            mouseX=e.pageX;
        } else {
            mouseX=e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        }
        return mouseX;
    }
    function getMouseY(e) {
        if (e.pageY) {
            mouseY=e.pageY;
        } else {
            mouseY=e.clientY + (document.documentElement.scrollTop  ? document.documentElement.scrollTop  : document.body.scrollTop );
        }
        return mouseY;
    }
    function getKey(event){
        var event_var = (event) ? event : window.event;
        if (event_var.keyCode) keycode = event_var.keyCode;
        else if (event_var.which) keycode = event_var.which;

        return keycode;
    }
    function autoResize(obj, method) {
        if (method == "") return;
        
        var width = obj.contentWindow.document.body.style.width;
        var height = obj.contentWindow.document.body.style.height;
        width = width.replace("px","");
        height = height.replace("px","");
        width_orig = obj.width;
        height_orig = obj.height;

        if ((width=="") && (method.indexOf("x")>=0)){
            obj.width="";
            obj.height="";
            if (obj.contentWindow.document.body.scrollWidth == obj.contentWindow.document.body.clientWidth) {
                obj.width="1";
                width = obj.contentWindow.document.body.scrollWidth;
            } else {                
                width = obj.contentWindow.document.body.scrollWidth;
            }
        }
        if ((height=="") && (method.indexOf("y")>=0)){
            obj.width="";
            obj.height="";
            if (obj.contentWindow.document.body.scrollHeight == obj.contentWindow.document.body.clientHeight) {
                obj.height="1";
                height = obj.contentWindow.document.body.scrollHeight;
            } else {                
                height = obj.contentWindow.document.body.scrollHeight;
            }
        }

        if (method.indexOf("x")>=0) obj.width = width;
        else obj.width = width_orig;
        if (method.indexOf("y")>=0) obj.height = height;
        else obj.height = height_orig;
    }

