//Javascript Document For funswitcher by trance
 


function checkreq(id,msg) {
    if ($.trim($("#" + id).val()) == "") {
        alert(msg);
        return false;
    }
    else
        return true;
}
function checknum(id) {
    if ($.trim($("#" + id).val()).match(/^\d*$/) == "")
        return false;
    else
        return true;
}

function getreply(id, d) {
    // if ($.trim($(div).html()).length>0) ; return;

    $.ajax(
        {
            url: '../handle/reply.ashx?type=0&id=' + id,
            type: 'GET',
            datatype: 'XML',
            complete: function() { },
            error: function() { alert("»ñÈ¡ÆÀÂÛÊ§°Ü"); },
            success: function(data) {
                var hasre = false;
                if ($(data).find("ds").length > 0)
                    $("#" + d).append("<h4>RE</h4>");
                // if (hasre) $("#" + d).append("<fieldset><legend>re£º</legend>");
                $(data).find("ds").each(

                function(i, item) {
                    $("#" + d).append("<ul>");
                    $("#" + d).append("<li><span style='float:right;padding-right:10px;'>" + $(item).find("redate").text() + "</span>" + $(item).find("username").text() + "</li>");
                    $("#" + d).append("<li> " + $(item).find("reply").text() + " </li> ");
                    $("#" + d).append("</ul>");
                }

                );
                // if(hasre)  $("#" + d).append("</fieldset>"); 
            }
        }
        );
    }


    
