﻿function Control(url,fun,type,sender){
    var obj=new Array();
    for(var i=2;i<arguments[4].length;i++){ 
        var value=arguments[4][i];
        if(typeof(value)=="number" || typeof(value)=="boolean"){
            obj.push('"' + i + '":' + value);
        }        
        else{            
            value=value.replace(/\"/g,"\\\"")
            obj.push('"' + i + '":"' + value + '"');
        }
    }
    var args="{" + obj.join(",") + "}";
    //alert(args);
    if(fun==null){
        var result=$.get(url,"type=" + type + "&sender=" + sender + "&e=" + encodeURIComponent(args));
    }
    else{   
        $.ajax({
           type: "POST",
           url: url,
           data: "type=" + type + "&sender=" + sender + "&e=" + encodeURIComponent(args),
           dataType:"json",
           success: function(msg){
             fun(msg);
           }
        }); 
    }
}

function AC(){
}
AC.get = function(fun, sender) {
Control("AjaxMethod.aspx", fun, "FTP.FTPVUI", sender, arguments);
}
function LoadCate(){
}

LoadCate.get = function(fun, sender) {
Control("AjaxMethod.aspx", fun, "CateUI", sender, arguments);
}


