$.fn.formToJSON = function()
    {
        var r = "{";
        $.each(this, function() {
            $.each(this, function() {
                if(this.type=="radio" || this.type=="checkbox") {
                    if(this.checked)
                        if($(this).attr("rel") == "int" || $(this).attr("rel") == "double")
                            r+= "'"+this.name+"':"+this.value+",";
                    if($(this).attr("rel") == "string")
                        r+= "'"+this.name+"':'"+this.value+"',";
                }
                else {
                    if($(this).attr("rel") && $(this).attr("rel") != "" && this.value != "") {
                        if($(this).attr("rel") == "int" || $(this).attr("rel") == "double")
                            r+= "'"+this.name+"':"+this.value+",";
                        if($(this).attr("rel") == "string")
                            r+= "'"+this.name+"':'"+this.value+"',";
                    }
                }
            })
        })
        r += "'wah':'wo'}";
        return r;
    };